Event processing method and device, electronic equipment and storage medium
By generating the object's proxy at the local service layer and listening to operation events, the two-way binding technology is solved in terms of efficiency and memory usage, and efficient automatic synchronization between memory data and display pages is achieved.
Patent Information
- Application Number
- CN202311172595.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-12
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2043-09-12
AI Technical Summary
The existing two-way binding technology has shortcomings in efficiency and memory usage, and it is difficult to effectively improve the efficiency of two-way binding and reduce memory usage.
By generating an object's proxy at the local service layer and listening to object's operation events at the local service layer, automatic synchronization between memory data and display pages is achieved, reducing the memory usage of application framework layer and improving the efficiency of responding to operation events.
Automatic synchronization between memory data and display pages is realized, reducing memory usage and improving efficiency in responding to operational events.
Smart Images

Figure CN119621252A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of event processing, and in particular to an event processing method and device, an electronic device, and a storage medium. Background Art
[0002] Bidirectional binding is a key technology that can achieve automatic synchronization between memory data and display pages, making application development more convenient and efficient. Bidirectional can be understood as: the page side that displays data on the view and a specific memory side allocated by the browser to store data. Binding can be understood as: being able to change each other and eventually achieve consistency. For example, the modification of data on the memory data side can be shown on the view after the page is rendered; and when we actively change the value on the page, the memory data side also changes accordingly. However, how to improve the efficiency of bidirectional binding and reduce memory usage still needs attention. Summary of the invention
[0003] The present invention provides an event processing method and device, an electronic device, and a storage medium.
[0004] According to a first aspect of an embodiment of the present disclosure, there is provided an event processing method, including:
[0005] In response to detecting an access instruction to an object in a page or a memory of the object, generating a proxy of the object in a local service layer; wherein the memory of the object is located in the local service layer;
[0006] According to the agent of the object, monitoring the operation events of the object at the local service layer;
[0007] An operation event on the object is responded to in the memory of the page and the object.
[0008] In some embodiments, the monitoring, at the local service layer, operation events on the object according to the proxy of the object includes:
[0009] The predefined function in the local service layer is called through the agent of the object to monitor the operation events of the object.
[0010] In some embodiments, calling a predefined function in the local service layer through a proxy of the object to monitor operation events on the object includes:
[0011] The predefined function in the local service layer is called in the form of a callback function through the proxy of the object to monitor the operation events of the object.
[0012] In some embodiments, the monitoring, at the local service layer, operation events on the object according to the proxy of the object includes:
[0013] The proxy of the object is pointed to the document object node corresponding to the object in the local service layer in the form of a pointer, and the operation events on the object are monitored.
[0014] In some embodiments, in response to the operation event being an event for updating the object, the method further includes:
[0015] The pointer is released after the page and the object's memory respond to the update of the object.
[0016] In some embodiments, responding to an operation event on the object in the memory of the page and the object includes:
[0017] updating the memory of the object according to the operation event at the local service layer; and
[0018] In the local service layer, the memory of the object is bound to a document object node that uses the memory of the object, and the bound document object node is updated according to the operation event;
[0019] The updated document object node is rendered in the local service layer, and the rendered page is displayed.
[0020] In some embodiments, the page is a quick application page.
[0021] According to a second aspect of an embodiment of the present disclosure, there is provided an event processing device, including:
[0022] A generating module, configured to generate a proxy of the object in a local service layer in response to detecting an access instruction to an object in a page or a memory of the object; wherein the memory of the object is located in the local service layer;
[0023] A monitoring module, configured to monitor operation events on the object at the local service layer according to the agent of the object;
[0024] The response module is configured to respond to the operation event of the object in the memory of the page and the object.
[0025] In some embodiments, the monitoring module is further configured to call a predefined function in the local service layer through a proxy of the object to monitor operation events on the object.
[0026] In some embodiments, the monitoring module is further configured to call a predefined function in the local service layer in the form of a callback function through the proxy of the object to monitor operation events on the object.
[0027] In some embodiments, the monitoring module is further configured to point the proxy of the object to the document object node corresponding to the object in the local service layer in the form of a pointer, and monitor operation events on the object.
[0028] In some embodiments, in response to the operation event being an event for updating the object, the apparatus further comprises:
[0029] A release module is configured to release the pointer after the page and the memory of the object respond to the update of the object.
[0030] In some embodiments, the response module is further configured to update the memory of the object at the local service layer according to the operation event; and, at the local service layer, bind the memory of the object to the document object node that uses the memory of the object, and update the bound document object node according to the operation event; render the updated document object node at the local service layer, and display the rendered page.
[0031] In some embodiments, the page is a quick application page.
[0032] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0033] A processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the method as described in the first aspect above.
[0034] According to a fourth aspect of an embodiment of the present disclosure, there is provided a storage medium, including:
[0035] When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as described in the first aspect above.
[0036] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0037] In the embodiment of the present disclosure, the automatic synchronization between the memory data and the display page is realized by bidirectional binding through the proxy of the object, so that the memory data end and the display page end can be decoupled. In addition, since the embodiment of the present disclosure generates the proxy of the object in the local service layer and monitors the operation events of the object in the local service layer without cross-layer monitoring, compared with the method of generating the proxy of the object in the application framework layer and based on complex data structures and frequent interactions between the application framework layer and the local service layer to achieve monitoring, it can reduce the memory usage of the application framework layer and improve the efficiency of the page end and the memory end in responding to operation events.
[0038] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0040] Figure 1 It is a schematic diagram of a responsive data model in related technologies.
[0041] Figure 2 This is an example diagram of the principle of a monitoring establishment process in the related technology.
[0042] Figure 3 It is a flow chart of an event processing method provided by an embodiment of the present disclosure.
[0043] Figure 4 It is a diagram of an event processing device shown in an embodiment of the present disclosure.
[0044] Figure 5 It is a block diagram of an electronic device shown in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0045] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0046] The development of two-way binding technology can be divided into the following stages:
[0047] Initial stage: In the initial version, the support for two-way binding technology was relatively weak. Developers needed to manually write logic code to handle the update and synchronization between data and interface, which was not convenient and prone to errors.
[0048] Framework support stage: With the continuous improvement of the quick application framework, two-way binding technology has been better supported. The framework provides some built-in instructions and syntax to make data binding and updating more concise and intuitive. For example, developers can use instructions similar to Vue.js (such as v-model) to implement two-way data binding.
[0049] Data model optimization stage: With the in-depth research and application practice of quick applications, the two-way binding technology has been further optimized. In terms of data models, more flexible and efficient data binding mechanisms have been introduced, such as responsive data models. This model can automatically update related interfaces by monitoring data changes, reducing the workload of manually writing data update logic.
[0050] Among them, the method of introducing a proxy for monitoring is a responsive data model. Figure 1 It is a schematic diagram of a responsive data model in related technologies, such as Figure 1 As shown, for the target object (data) in the page, a proxy for the target object can be created based on Proxy, thereby implementing interception and customization of basic operations. For example, based on the object proxy, the get function (getter) is associated to intercept the attribute access to the data object, and the set function (setter) is associated to intercept the attribute setting of the data object. Among them, data includes multiple attributes, and different attributes can be identified by different keywords such as key1, key2, etc. Figure 1 In the example, the proxy of the object (such as the proxy variable) intercepts the key1 of the original data data (i.e. the target object) in the page. When the attribute key1 is accessed, the getter is triggered, and the electronic device calls the track method to establish monitoring; when the attribute key1 is set, the setter is triggered, and the electronic device calls the trigger method to trigger the setting of the attribute. It should be noted that the operations such as Array, map, and delete in the data object are all monitored and implemented through the proxy object.
[0051] When the object's proxy monitors, it completes the monitoring through the interaction between the application framework layer (JS framework layer, referred to as js layer) and the local service layer (native layer). Figure 2 This is an example diagram of the principle of a monitoring establishment process in the related technology. Taking the quick application displayed on the front end as an example, the local service layer parses the application package program of the quick application to obtain the virtual DOM (VDOM) tree data. When the VDOM tree data is obtained, Figure 2As shown, the program will create a specific DOM element such as a text element according to the dom_create_element function in the native layer. After creating the element, it will call the effect object in the js layer based on call effectWarp, and then place the object in the stack and set it as the global variable activeEffect. Furthermore, the program calls the dom_update_element_attribute function in the native layer to obtain the attributes of the created DOM element, and calls the call prop function to read or assign the attribute values of the DOM element. The program will create a proxy (target) corresponding to the DOM element in the js layer, and intercept the reading and assignment operations through the proxy. If it is a read operation, the program will call target.key and trigger the track method, adding dependencies to the effect to establish monitoring. As shown Figure 2 In the part marked by the dotted box L1, the program binds the listener to the proxy through global variables, and the subsequent assignment operation will trigger these bound listeners. The above process of establishing the listener actually establishes the mapping relationship between the target and the ReactiveEffect. The relationship is connected in series through activeEffect and activeVmId, and the problem of multi-layer calls is managed through effectStack and vmStack. Figure 2 As shown in the figure, in order to establish a mapping between target and ReactiveEffect, some data structures in the part marked by the dotted box L2 are introduced in the js layer, such as the Map container vmTargetMapobj structure, the TargetMap structure for obtaining properties, the KeyToDepMap structure for storing the properties of the responsive object, and the Set structure for storing dependencies.
[0052] It can be seen from this that Figure 2 The monitoring method shown will involve many data structures. These structures are created in the js layer, occupying a lot of memory and having a long access link. When triggering monitoring, it also involves frequent communication between the js layer and the native layer, affecting efficiency.
[0053] In this regard, the present disclosure provides an event processing method. Figure 3 is a flow chart of an event processing method provided by an embodiment of the present disclosure, such as Figure 3 As shown, the following steps are included:
[0054] S11, in response to detecting an access instruction to an object in a page or a memory of the object, generating a proxy of the object in a local service layer; wherein the memory of the object is located in the local service layer;
[0055] S12. According to the proxy of the object, monitoring the operation events of the object at the local service layer;
[0056] S13: Respond to an operation event on the object in the page and the memory of the object.
[0057] In the embodiments of the present disclosure, the event processing execution subject may be an electronic device that can run applications, such as user equipment (UE), mobile devices, user terminals, mobile phones, tablet computers, personal digital assistants (PDAs), handheld devices, computing devices, vehicle-mounted devices, wearable devices, etc. In some possible implementations, the event processing method may be implemented by a processor in a terminal device calling computer-readable instructions stored in a memory.
[0058] In the implementation of the present disclosure, the page can be a form page, a quick application page, or a page of any other application, etc., which is not limited by the embodiments of the present disclosure. The object in the page can be any page element in the page, and the page element has a corresponding memory in the local service layer, and the attribute value of the page element can be stored in the memory.
[0059] In step S11, the electronic device generates a proxy for the object in the local service layer in response to detecting an access instruction to an object in the page or the memory of the object. Exemplarily, when a user operates a page at the front end, such as clicking or selecting a page element in the page, the electronic device detects an access instruction to the object in the page; in addition, when the application actively updates the display of the page according to a predetermined program, such as updating the display content of some page elements in the page, it will actively trigger the update of the attribute value of the corresponding object in the memory, and at this time, the electronic device detects an access instruction to the memory of the object.
[0060] In the disclosed embodiment, the proxy of the object generated in the local service layer will intercept the access to the object. In step S12, the electronic device monitors the operation events of the object in the local service layer according to the proxy of the object. After the monitoring is established, the operation events of the object monitored by the proxy of the object may include, for example, attribute access events, attribute setting events, and may also include events of deleting the object, or events of enumerating the attribute values of the object. Exemplarily, when accessing a certain attribute of the object, the getter is triggered, and the proxy of the object will call the track method to establish monitoring to monitor whether there is an attribute setting event to trigger the setter.
[0061] In step S13, after the electronic device monitors the operation event on the object at the local service layer, it responds to the operation event on the object in both the page and the memory of the object.
[0062] For example, after the object's proxy detects an operation to set the object's attributes, the electronic device can change the attribute value of the object in the memory of the local service layer object and update the display of the front-end page. For another example, after the object's proxy detects an operation to delete the object, the electronic device can delete the memory of the object in the local service layer and update the display of the front-end page, and the updated page does not include the deleted object.
[0063] In the disclosed embodiment, the automatic synchronization between the memory data and the display page is realized by bidirectional binding through the proxy of the object, so that the memory data end and the display page end can be decoupled. In addition, since the disclosed embodiment generates the proxy of the object in the local service layer and monitors the operation events of the object in the local service layer without cross-layer monitoring, compared with the method of generating the proxy of the object in the application framework layer and based on complex data structures and frequent interactions between the application framework layer and the local service layer to achieve monitoring, it can reduce the memory usage of the application framework layer and improve the efficiency of the page end and the memory end in responding to operation events.
[0064] In some embodiments, the monitoring, at the local service layer, operation events on the object according to the proxy of the object includes:
[0065] The predefined function in the local service layer is called through the agent of the object to monitor the operation events of the object.
[0066] In the embodiment of the present disclosure, the predefined functions in the local service layer may be functions built into the operating system, such as set function, get function, apply function, has, delete, define property, etc. In addition, the predefined functions may also be functions customized by developers, which is not limited in the embodiment of the present disclosure.
[0067] It is understandable that since the local service layer provides the main feature support for the operating system through C or C++ libraries, the execution efficiency of the local service layer code should be high. Therefore, calling the predefined functions in the local service layer through the object's proxy to monitor the operation events of the object can improve the efficiency of interception and monitoring.
[0068] In some embodiments, calling a predefined function in the local service layer through a proxy of the object to monitor operation events on the object includes:
[0069] The predefined function in the local service layer is called in the form of a callback function through the proxy of the object to monitor the operation events of the object.
[0070] In the disclosed embodiment, as mentioned above, the local service layer provides the main feature support for the operating system through C or C++ libraries. The local service layer can easily customize some classes, such as customizing classes through the lightweight and embeddable JavaScript engine QuickJS. In addition, the class can define additional exotic callback functions, such as the JSClassExoticMethods function table built into QuickJS, which covers callback functions such as set, get, has, delete, defineproperty, etc. These functions can be used to easily intercept objects.
[0071] It is understandable that, since the callback function allows the program to automatically call the function to handle the event when the event occurs, the predefined function in the local service layer is called in the form of a callback function in the implementation of the present disclosure, making the program more flexible and extensible.
[0072] In some embodiments, the monitoring, at the local service layer, operation events on the object according to the proxy of the object includes:
[0073] The proxy of the object is pointed to the document object node corresponding to the object in the local service layer in the form of a pointer, and the operation events on the object are monitored.
[0074] The document object node is a node in the Document Object Model (DOM), which is used to describe the front-end page in a structural manner and convert the front-end page into a structured set consisting of a document object node (Node) and an object (including the object's properties and methods). In the disclosed embodiment, the object's proxy is pointed to the object's document object node (e.g., Domelement) in the form of a pointer, that is, the document object node directly serves as the listener of the object's proxy, so that the object's proxy can easily access all the properties and methods of the document object node. Exemplarily, the object's proxy can directly call various attribute keys of the document object node.
[0075] As mentioned before Figure 2 In the scheme of creating an object proxy in the js layer, for example, after the setter is triggered, the trigger logic needs to notify the Domelement object to execute the effect to make the attribute setting effective. The updated attribute value in the native layer (dom_element_update) needs to be packaged into a js object for the js layer to call, such as Figure 2As shown, it needs to be wrapped with effectWrap, and ReactiveEffect is a 40-byte object. The js package also takes up 40 bytes. In addition, some wrapper functions such as wrapper 40 bytes, and other auxiliary data, occupy at least 200 bytes of memory; and Figure 2 In the related technology described above, a mapping is established between Target and ReactiveEffect, that is, a mapping between the proxy of an object and each attribute. Since each attribute (key) of an object involves a mapping, it occupies a large amount of memory, and each mapping is approximately 40-50 bytes.
[0076] In the disclosed embodiment, a proxy for an object is created in the local service native layer and points to the document object node corresponding to the object in the local service layer in the form of a pointer. Since the pointer occupies 4 bytes, the attribute key index of the object occupies 4 bytes, plus the overhead of the attribute value vector type, it is basically around 8-16 bytes. Moreover, since the object's proxy points to the object's document object node, the object's proxy can share the options object (including function objects) of the document object node and save the dependency pointer, which only requires 4 bytes of overhead and almost no additional overhead.
[0077] In general, in the related art, a property monitoring process of an object consumes about 200-400 bytes of space; while the solution of the embodiment of the present disclosure only requires about 12-16 bytes of space.
[0078] As can be seen from the above, the embodiment of the present disclosure can greatly save memory overhead by generating a proxy for the object in the local service layer and pointing the proxy of the object to the document object node corresponding to the object in the local service layer in the form of a pointer to implement monitoring.
[0079] In some embodiments, in response to the operation event being an event for updating the object, the method further includes:
[0080] The pointer is released after the page and the object's memory respond to the update of the object.
[0081] In the embodiments of the present disclosure, an event for updating an object is, for example, an event for changing an attribute value of an object, or an event for deleting an object, or an event for adding an object based on the object (i.e., changing the dependency relationship of the document object node corresponding to the object), etc.
[0082] Since in the embodiment of the present disclosure, the proxy of the object points to the document object node corresponding to the object in the form of a pointer, the electronic device can directly release the pointer to remove the dependency between the proxy of the object and the document object node after the page and the object's memory respond to the update of the object.
[0083] It can be understood that in the embodiment of the present disclosure, the dependency is released by releasing the pointer, which is simple and effective. On the one hand, the memory can be released immediately by releasing the pointer after responding to the operation event; on the other hand, it can also reduce the occurrence of erroneous modification of the object.
[0084] In some embodiments, responding to an operation event on the object in the memory of the page and the object includes:
[0085] updating the memory of the object according to the operation event at the local service layer; and
[0086] In the local service layer, the memory of the object is bound to a document object node that uses the memory of the object, and the bound document object node is updated according to the operation event;
[0087] The updated document object node is rendered at the local service layer, and the rendered page is displayed.
[0088] In the disclosed embodiment, when the memory side responds to the operation event of the object, since the memory is located in the local service layer, the memory of the object can be directly updated according to the operation event in the local service layer. In the disclosed embodiment, when the operation event is an event of setting a property value, updating the memory of the object includes updating the data in the memory; when the operation event is an event of deleting the object, updating the memory of the object includes deleting the memory of the object.
[0089] In the disclosed embodiment, when the page side responds to the operation event of the object, the local service layer will first render it, and then display the rendered page. When the local service layer is rendering, the electronic device will bind the memory of the object to the document object node that uses the memory of the object, so that all document object nodes that use the memory can be updated. Among them, the update of the document object node includes the modification of the attribute value of the node, and may also include the adjustment of the dependency relationship between the document object nodes in the document object model corresponding to the page. For example, after deleting the memory of the object, the corresponding document object nodes do not exist in the document object model.
[0090] It can be understood that in the embodiment of the present disclosure, bidirectional binding is achieved through the proxy of the object generated by the local service layer, so that the display page and the memory data can respond quickly and achieve automatic synchronization.
[0091] As mentioned above, the page in the embodiment of the present disclosure may be a quick application page. Since the purpose of the quick application itself is to provide users with a better experience with lower resource consumption and faster speed, the aforementioned method of the embodiment of the present disclosure is applied to the quick application, which can further optimize the performance of the quick application.
[0092] Figure 4 is a diagram of an event processing device shown in an embodiment of the present disclosure, comprising Figure 4 It is known that, including:
[0093] A generation module 101 is configured to generate a proxy of the object in a local service layer in response to detecting an access instruction to an object in a page or a memory of the object; wherein the memory of the object is located in the local service layer;
[0094] A monitoring module 102, configured to monitor operation events on the object at the local service layer according to the proxy of the object;
[0095] The response module 103 is configured to respond to the operation event on the object in the page and the memory of the object.
[0096] In some embodiments, the monitoring module 102 is further configured to call a predefined function in the local service layer through a proxy of the object to monitor operation events on the object.
[0097] In some embodiments, the monitoring module 102 is further configured to call a predefined function in the local service layer in the form of a callback function through the proxy of the object to monitor operation events on the object.
[0098] In some embodiments, the monitoring module 102 is further configured to point the proxy of the object to the document object node corresponding to the object in the local service layer in the form of a pointer, and monitor operation events on the object.
[0099] In some embodiments, in response to the operation event being an event for updating the object, the apparatus further comprises:
[0100] The release module 104 is configured to release the pointer after the page and the memory of the object respond to the update of the object.
[0101] In some embodiments, the response module 103 is also configured to update the memory of the object at the local service layer according to the operation event; and, at the local service layer, bind the memory of the object to the document object node that uses the memory of the object, and update the bound document object node according to the operation event; render the updated document object node at the local service layer, and display the rendered page.
[0102] In some embodiments, the page is a quick application page.
[0103] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0104] Figure 5 8 is a block diagram of an electronic device 800 shown in an embodiment of the present disclosure. For example, the electronic device 800 may be a smart phone, a mobile computer, etc.
[0105] Reference Figure 5 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0106] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0107] The memory 804 is configured to store various types of data to support operations on the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0108] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.
[0109] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0110] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0111] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0112] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of the components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0113] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as Wi-Fi, 4G or 5G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0114] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0115] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0116] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the aforementioned event processing method.
[0117] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims above.
[0118] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. An event processing method, characterized in that: The method comprises: In response to detecting an access instruction to an object in a page or a memory of the object, generating a proxy of the object in a local service layer; wherein the memory of the object is located in the local service layer; According to the agent of the object, monitoring the operation events of the object at the local service layer; An operation event on the object is responded to in the memory of the page and the object.
2. The method according to claim 1, characterized in that The monitoring of the operation events of the object at the local service layer according to the proxy of the object includes: The predefined function in the local service layer is called through the agent of the object to monitor the operation events of the object.
3. The method according to claim 2, characterized in that The calling of the predefined function in the local service layer through the proxy of the object to monitor the operation events of the object includes: The predefined function in the local service layer is called in the form of a callback function through the proxy of the object to monitor the operation events of the object.
4. The method according to claim 1, characterized in that: The monitoring of the operation events of the object at the local service layer according to the proxy of the object includes: The proxy of the object is pointed to the document object node corresponding to the object in the local service layer in the form of a pointer, and the operation events on the object are monitored.
5. The method according to claim 4, characterized in that In response to the operation event being an event for updating the object, the method further includes: The pointer is released after the page and the object's memory respond to the update of the object.
6. The method according to claim 1, characterized in that The responding to the operation event of the object in the memory of the page and the object includes: updating the memory of the object according to the operation event at the local service layer; and In the local service layer, the memory of the object is bound to a document object node that uses the memory of the object, and the bound document object node is updated according to the operation event; The updated document object node is rendered in the local service layer, and the rendered page is displayed.
7. The method according to claim 1, characterized in that The page is a quick application page.
8. An event processing device, characterized in that: The device comprises: A generating module, configured to generate a proxy of the object in a local service layer in response to detecting an access instruction to an object in a page or a memory of the object; wherein the memory of the object is located in the local service layer; A monitoring module, configured to monitor operation events on the object at the local service layer according to the agent of the object; The response module is configured to respond to the operation event of the object in the memory of the page and the object.
9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method as claimed in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for synchronizing data
CN110619096A
Page processing method and device, electronic equipment and storage medium
CN115203618A
Cross-domain storage
US20220405462A1