CN114168120A - Data acquisition method and device, computer equipment and storage medium - Google Patents

Data acquisition method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114168120A
CN114168120A CN202111500556.3A CN202111500556A CN114168120A CN 114168120 A CN114168120 A CN 114168120A CN 202111500556 A CN202111500556 A CN 202111500556A CN 114168120 A CN114168120 A CN 114168120A
Authority
CN
China
Prior art keywords
cell
trigger event
event
processing
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111500556.3A
Other languages
Chinese (zh)
Inventor
李海涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Shiyinlian Software Technology Co ltd
Guangzhou Kugou Computer Technology Co Ltd
Original Assignee
Guangzhou Shiyinlian Software Technology Co ltd
Guangzhou Kugou Computer Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Shiyinlian Software Technology Co ltd, Guangzhou Kugou Computer Technology Co Ltd filed Critical Guangzhou Shiyinlian Software Technology Co ltd
Priority to CN202111500556.3A priority Critical patent/CN114168120A/en
Publication of CN114168120A publication Critical patent/CN114168120A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Abstract

The embodiment of the application discloses a data acquisition method and device, computer equipment and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: acquiring a trigger event for a cell in any list page through a proxy object; forwarding the trigger event to a target object through the proxy object, wherein the target object comprises a processing method code for processing any trigger event of a cell, and a buried point code is set in the processing method code; running a target processing method code corresponding to the trigger event to process the trigger event; and acquiring buried point data through the buried point code in the target processing method code. According to the scheme, the events occurring in any list page can be recorded only by adding the embedded point codes in the target object, so that the number of the embedded point codes is reduced, the labor cost is also reduced, and the research and development efficiency is improved.

Description

Data acquisition method and device, computer equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a data acquisition method, a data acquisition device, computer equipment and a storage medium.
Background
Currently, applications typically present data to a user through a list page. The cell is a basic component forming a list page, and the list page can display data such as pictures, buttons, text videos and videos through the cell. The user may perform various operations on the cells to manipulate the data displayed by the cells. In order to analyze the user behavior data, a code for executing events such as display, sliding, and clicking in a source code of a list page is usually adopted to write a buried point code to obtain the user behavior data.
In the process of implementing the present application, the inventor finds that codes of cells in different list pages are the same, which may cause a technician to write the same buried point code in source codes of the different list pages, thereby resulting in waste of human resources and reduction of research and development efficiency.
Disclosure of Invention
The embodiment of the application provides a data acquisition method and device, computer equipment and a storage medium, so that the labor cost is reduced, and the research and development efficiency is improved. The technical scheme is as follows:
in one aspect, a data acquisition method is provided, and the method includes:
acquiring a trigger event for a cell in any list page through a proxy object;
forwarding the trigger event to a target object through the proxy object, wherein the target object comprises a processing method code for processing any trigger event of a cell, and a buried point code is set in the processing method code;
running a target processing method code corresponding to the trigger event to process the trigger event;
and acquiring buried point data through the buried point code in the target processing method code.
In another aspect, a data acquisition apparatus is provided, the apparatus comprising:
the first acquisition module is used for acquiring a trigger event of a cell in any list page through the proxy object;
the forwarding module is used for forwarding the trigger event to a target object through the proxy object, the target object comprises a processing method code for processing any trigger event of the cells, and the processing method code is provided with a buried point code;
the running module is used for running a target processing method code corresponding to the trigger event to process the trigger event;
and the second acquisition module is used for acquiring the buried point data through the buried point code in the target processing method code.
In another aspect, a computer device is provided, which includes a processor and a memory, wherein at least one program code is stored in the memory, and the at least one program code is loaded and executed by the processor to implement the operations executed in the data acquisition method according to the above aspect.
In another aspect, a computer-readable storage medium is provided, in which at least one program code is stored, and the at least one program code is loaded and executed by a processor to implement the operations performed in the data acquisition method according to the above aspect.
In still another aspect, a computer program product is provided, where at least one program code is stored in the computer program product, and the at least one program code is loaded and executed by a processor to implement the operations performed in the data acquisition method of the foregoing embodiments.
The data acquisition method, the data acquisition device, the computer equipment and the storage medium provided by the embodiment of the application provide a target object, wherein the target object comprises a processing method code for processing any cell triggering event of a cell, so that the target object can process the cell triggering event of any list page, and therefore, the event occurring in any list page can be recorded only by adding a buried point code in the target object, the number of the buried point codes is reduced, the labor cost is also reduced, and the research and development efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application;
fig. 2 is a flowchart of a data acquisition method provided in an embodiment of the present application;
FIG. 3 is a flow chart of another data acquisition method provided by an embodiment of the present application;
FIG. 4 is a schematic diagram of a proxy class provided by an embodiment of the present application;
FIG. 5 is a flowchart illustrating a process for proxy objects according to an embodiment of the present disclosure;
fig. 6 is a flowchart of a data acquisition method provided in an embodiment of the present application;
fig. 7 is a flowchart of a data acquisition method provided in an embodiment of the present application;
fig. 8 is a flowchart of a data acquisition method provided in an embodiment of the present application;
fig. 9 is a schematic structural diagram of a data acquisition apparatus according to an embodiment of the present application;
FIG. 10 is a schematic structural diagram of another data acquisition device provided in the embodiments of the present application;
fig. 11 is a schematic structural diagram of a terminal according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present application more clear, the embodiments of the present application will be further described in detail with reference to the accompanying drawings.
It will be understood that, as used herein, the terms "first," "second," "third," "fourth," "fifth," "sixth," and the like may be used herein to describe various concepts, which are not limited by these terms unless otherwise specified. These terms are only used to distinguish one concept from another. For example, the first processing result may be referred to as a second processing result, and the second processing result may be referred to as a first processing result without departing from the scope of the present application.
As used herein, the terms "each," "plurality," "at least one," "any," and the like, at least one of which comprises one, two, or more than two, and a plurality of which comprises two or more than two, each refer to each of the corresponding plurality, and any refer to any one of the plurality. For example, the plurality of objects includes 3 objects, each of the 3 objects refers to each of the 3 objects, and any one of the 3 objects refers to any one of the 3 objects, which may be a first object, a second object, or a third object.
It is understood that in the specific implementation manner of the present application, if user information, user behavior data, and other data related to a user are involved in the data of the embedded point obtained by the embedded point code, when the above embodiment of the present application is applied to a specific product or technology, user permission or consent needs to be obtained, and the collection, use, and processing of the related data need to comply with relevant laws and regulations and standards of relevant countries and regions.
The data acquisition method provided by the embodiment of the application is executed by computer equipment. In one possible implementation, the computer device is a terminal, e.g., a cell phone, a tablet, a computer, etc. In another possible implementation, the computer device includes a terminal and a server.
Fig. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application. Referring to fig. 1, the implementation environment includes a terminal 101 and a server 102. The terminal 101 and the server 102 are connected via a wireless or wired network.
The terminal 101 has installed thereon a target application served by the server 102, through which the terminal 101 can implement functions such as data transmission, message interaction, and the like. Optionally, the target application is a target application in an operating system of the terminal 101, or a target application provided by a third party. For example, the target application is a multimedia processing application having a function of playing multimedia data, for example, a function of playing video, a function of playing audio, and the like. Of course, the multimedia processing application can also have other functions, such as sharing function, commenting function, and the like. Optionally, the server 102 is a background server of the target application or a cloud server providing services such as cloud computing and cloud storage.
Alternatively, the terminal 101 obtains the buried point data through the buried point code, transmits the buried point data to the server 102, and the server 102 receives and stores the buried point data.
The data acquisition method provided by the embodiment of the application can be applied to any application operation scene, and the buried point data is acquired in the application operation process.
Fig. 2 is a flowchart of a text data display method according to an embodiment of the present application. The embodiment of the application takes an execution main body as an example, and the example is explained. Referring to fig. 2, the method includes:
201. and the terminal acquires the trigger event of the cell in any list page through the proxy object.
The cells are basic components forming a list page, and the list page can display data such as pictures, buttons, text videos and videos through the cells. For example, in some short video applications, when a user views different list pages through a sliding up and down operation, the codes of the cells in the different list pages are the same, but the source data of the cells are different, so that the displayed contents of the cells are different. The cell in step 201 may be the same cell as the cell in the other list pages. Of course, the scheme provided in the embodiment of the present application can also be applied to the case where the cells in different list pages are different, and therefore, the cell in step 201 may also be a cell different from the cells in other list pages. The same cells mean that the codes of the cells are the same, and the different cells mean that the codes of the cells are different.
A proxy object is an object with forwarding functionality that can forward the acquired trigger event to other objects. The list page refers to a page developed in a list form, and most of the pages provided in the current application are the list pages. The trigger event refers to any event triggered by any cell in the list page, and the event may be a click event, a display event, a slide event, and the like.
202. And the terminal forwards the trigger event to a target object through the proxy object, wherein the target object comprises a processing method code for processing any trigger event of the cell, and the processing method code is provided with a buried point code.
Since the target object includes a processing method code for processing any trigger event of the cell, the target object can process any trigger event of the cell. Thus, the proxy object may forward the trigger event to the target object, which processes the trigger event.
For example, the target object includes a processing method code for processing a slide event, a processing method code for processing a presentation event, a processing method code for processing a click event, and the like.
In the embodiment of the application, the embedded point code is added to the processing method code included in the target object, and in the process of processing the trigger event by the processing method code, the embedded point code in the processing method code also runs, so that the embedded point data is obtained.
203. And the terminal runs the target processing method code corresponding to the trigger event to process the trigger event.
Different types of trigger events require different processing method code to process. And the target processing method code corresponding to the trigger event is a processing method code for processing the trigger event.
For example, if the trigger event is a click event, a processing method code corresponding to the click event is run to process the cell event, that is, a processing method code for processing the click event is run to process the trigger event.
204. And the terminal acquires the buried point data through the buried point code in the target processing method code.
In the embodiment of the application, each processing method code in the target object is provided with a buried point code, and when any processing method code runs, the buried point code in the processing method code also runs, and then buried point data is acquired.
The embedded point code may be set manually by a technician, or may be set at the processing method code by another program, and the setting method of the embedded point code is not limited in the embodiment of the present application.
The embedded point data is data acquired by the embedded point code, and the embedded point code can report the data to the server after acquiring the data, and the embedded point data can be user behavior data or other data.
For example, the trigger event may be a click event, and the embedded point code may acquire data of a click object, a click number, and the like of the click event, and report the data.
The data acquisition method provided by the embodiment of the application provides a target object, and the target object comprises a processing method code for processing any trigger event of a cell, so that the target object can process the trigger event of any list page, and the event occurring in any list page can be recorded only by adding a point embedding code in the target object, so that the number of the point embedding codes is reduced, the labor cost is also reduced, and the research and development efficiency is improved.
In a possible implementation manner, the trigger event carries a cell identifier of a triggered cell, and the target object is a cell object;
the forwarding the trigger event to the target object through the proxy object includes:
and forwarding the trigger event to the cell object corresponding to the cell identifier through the proxy object based on the cell identifier.
In one possible implementation manner, the forwarding, by the proxy object, the trigger event to the cell object corresponding to the cell identifier based on the cell identifier includes:
determining a cell object corresponding to the cell identifier based on the cell identifier in the trigger event through the proxy object;
acquiring a protocol followed by the cell object, wherein the protocol is used for defining a processing method code for a trigger event;
and forwarding the trigger event to the cell object corresponding to the cell identification under the condition that the protocol followed by the cell object is a target protocol, wherein the processing method code defined by the target protocol is the same as the processing method code in the controller of the list page, and the controller is used for processing any trigger event to the list page.
In a possible implementation manner, the determining, by the proxy object, a cell object corresponding to a cell identifier based on the cell identifier in the trigger event includes:
forwarding the trigger event to an event processing object through the proxy object;
determining a cell object corresponding to the cell identifier based on the cell identifier in the trigger event through the event processing object;
the forwarding the trigger event to the cell object corresponding to the cell identifier when the protocol followed by the cell object is a target protocol includes:
and forwarding the trigger event to the cell object corresponding to the cell identifier through the event processing object under the condition that the protocol followed by the cell object is the target protocol.
In one possible implementation manner, the target object is an event processing object, and the event processing object is used for processing a trigger event; the forwarding the trigger event to the target object through the proxy object includes:
forwarding, by the proxy object, the trigger event to the event processing object, so that the target processing method code in the event processing object processes the trigger event.
In one possible implementation, the forwarding, by the proxy object, the trigger event to the event processing object includes:
acquiring a protocol followed by the event processing object, wherein the protocol is used for defining a processing method code for a trigger event;
and forwarding the trigger event to the event processing object through the proxy object under the condition that the protocol followed by the event processing object is a target protocol.
In one possible implementation, forwarding, by the proxy object, the trigger event to an event processing object includes:
acquiring a responder list through the proxy object, wherein the responder list is used for recording responders for processing the triggering event;
forwarding, by the proxy object, the trigger event to the event handling object if the responder list includes the event handling object.
In one possible implementation, before the obtaining, by the proxy object, the responder list, the method further includes:
binding the proxy object and the event processing object with a list class;
in the case of loading any list page, adding a controller of the list page and the event processing object bound to the list class to the responder list through the proxy object bound to the list class.
In another possible implementation manner, the trigger event carries a cell identifier of a triggered cell, and the target object is an event processing object;
the executing of the target processing method code corresponding to the trigger event processes the trigger event, including:
based on the cell identification, acquiring target data in the cell corresponding to the cell identification from the cell class;
and operating a target processing method code corresponding to the trigger event to process the target data.
In another possible implementation, the target object is a responder object, the responder object is an object created based on a responder class, and the responder class is a class for processing a buried point;
the forwarding the trigger event to the target object through the proxy object includes:
forwarding the trigger event to the responder object via the proxy object.
In a possible implementation manner, after the trigger event for any list page is obtained by the proxy object, the method further includes:
forwarding the trigger event to a controller of the list page through the proxy object;
and processing the trigger event through the controller, and updating the list page.
All the above optional technical solutions may be combined arbitrarily to form optional embodiments of the present application, and are not described herein again.
It should be noted that, in the embodiment of the present application, the target object is an object capable of processing any kind of trigger event, and the target object includes processing method code for processing any kind of trigger event. In one possible implementation, the target object is a cell object, which is an object created based on a cell class. In another possible implementation, the target object is an event handling object, and the event handling object is an object created based on an event handling class EvenHandler. In another possible implementation, the target object is a responder object, which is an object created based on a responder class, which is a class that specializes in handling landfills. The data acquisition method is exemplarily illustrated below by using the embodiment shown in fig. 3, taking the target object as the cell object as an example.
Fig. 3 is a flowchart of a data acquisition method according to an embodiment of the present application. Referring to fig. 3, in the embodiment of the present application, an execution subject is exemplarily illustrated as a terminal, and the method includes:
301. and the terminal acquires the trigger event of the cell in any list page through the proxy object.
A proxy object is an object with forwarding functionality. Optionally, the proxy object may hold a responder list, in which at least one object is recorded. Such as a controller for the list page, a cell object corresponding to a cell in the list page, an event handling object, etc. After the proxy object acquires any message, the proxy object forwards the message to the object recorded in the responder list, and the object recorded in the responder list forwards or processes the message, so that the object recorded in the responder list can be regarded as a responder of the message received by the proxy object.
By adding the target object into the responder list, the trigger event can be forwarded to the target object when the proxy object acquires the trigger event of any list page, so that the target object becomes a responder of the trigger event in the list page.
Optionally, the proxy object may also add or delete responders from the list of responders. Optionally, the proxy object adds an object identifier of an object in the list of respondents, so that the object becomes a responder to the triggering event of the list page. After the proxy object receives any message, the message is forwarded to the object corresponding to the object identification based on the object identification in the responder list.
The proxy object is an object created based on a proxy class. Optionally, the proxy object is an object created based on NSProxy (a proxy class); optionally, as shown in fig. 4, in the embodiment of the present application, a proxy class (ForwardProxy) is added, and the proxy class inherits to an NSProxy (a proxy class), has all the attributes of the NSProxy, and may also have other attributes. The agent class ForwardProxy is an agent class newly added in the program.
The list page can be regarded as a page view which can be rolled in the application, the cells are basic components which form the list page, and data such as pictures, buttons, character views and the like can be displayed through the cells.
The terminal is provided with a list class, and when a list page is loaded, the terminal can create a list object based on the list class. To enable the proxy object to receive the trigger event in the list page, a binding relationship between the proxy object and the list object may be established. Since different list pages correspond to different list objects, in order to enable a proxy object to receive a trigger event in any one list page, each list object needs to be bound with the proxy object. Optionally, each time the terminal creates a list object, the created list object is bound with the proxy object; optionally, the terminal binds the proxy object with the list class, so that each list object created based on the list class inherits the binding relationship, and each list object created based on the list class is bound with the proxy object.
For example, in the process that the terminal displays any list page, the user performs a trigger operation on a cell in the list page, and the proxy object bound to the list object acquires a trigger event corresponding to the trigger operation.
302. And the terminal forwards the trigger event to a cell object through the proxy object, wherein the cell object comprises a processing method code for processing any trigger event, and the processing method code is provided with a buried point code.
The terminal is also provided with a cell class, the cell class is a subclass of the list class, and the cell object is an object created based on the cell class. The cell class comprises processing method codes for processing any kind of trigger event, and therefore the cell objects created based on the cells comprise the processing method codes for processing any kind of trigger event. In the embodiment of the present invention, the buried point code is set in the processing method code of the cell class, and therefore, the buried point code is also set in all the processing method codes of the cell objects created based on the cell.
The list page may include a plurality of cells, and the trigger event acquired by the proxy object may be a trigger event for any cell. The cell objects created based on the cell classes are in one-to-one correspondence with the cells in the list page. For example, cell 1, cell 2, and cell 3 are included in the list page, and 3 cell objects, cell object 1, cell object 2, and cell object 3 respectively, are created based on the cell class. Therefore, the proxy object needs to forward the received trigger event to the corresponding cell object for processing.
In the embodiment of the application, the cell is a front-end expression of a cell object, and the cell object is a source code of the cell. For example, when the terminal accesses a list page, the terminal creates at least one cell object for the list page based on the cell class, and displays at least one corresponding cell for presenting corresponding data (buttons, pictures, texts, videos, and the like) in the list page based on the created at least one cell object. Subsequently, if the user performs a trigger operation on a cell in the list page, the proxy object may forward a trigger event generated by the trigger operation to the cell object of the cell for processing.
It should be noted that, in one possible implementation, the list page includes a plurality of different types of cells. For example, a cell displaying a "comment" button, a cell displaying a "like" button, a cell displaying a picture, and the like. Accordingly, the terminal includes at least three cell classes: cell class 1, cell class 2, and cell class 3. The cell class 1 is used for creating a cell object displaying a comment button, the cell class 2 is used for creating a cell object displaying a comment button, and the cell class 3 is used for creating a cell object displaying a picture. When the terminal accesses the list page, the terminal creates a first cell object based on the cell class 1, and displays cells containing a 'comment' button in the list page based on the created first cell object; the terminal creates a second cell object based on the cell class 2, and displays cells containing the 'like' option in a list page based on the created second cell object; and the terminal creates a third cell object based on the cell class 3 and displays the cells containing the pictures in the list page based on the created third cell object.
That is, each cell class is used to create a cell object corresponding to a type of cell. For example, list page 1, list page 2, list page 3, and list page 4 all include cells displaying "like" option, and the cells in list page 1, list page 2, list page 3, and list page 4 for displaying "like" option are all displayed based on the same cell class to create corresponding cell objects. For another example, each of the list pages 1, 2, 3, and 4 includes cells having a length x, a width y, and a rectangular shape; then, the cells with length x, width y and rectangular shape in the list page 1, the list page 2, the list page 3 and the list page 4 are all displayed by creating corresponding cell objects based on the same cell class.
In one implementation, although the source codes corresponding to the cells for displaying the "like" option in the 4 list pages are the same, the terminal still creates a cell object for the cells for displaying the "like" option in each list page. Although the source codes of the cell objects are the same, the data sources of the cell objects are different, and the displayed contents may be different.
For example, list page 1 is a viewing page for short video a, and cell 1 is used to display the "like" identifier and the total number of like for short video a; the list page 2 is a viewing page of the short video B, and the cell 2 is used for displaying the 'like' identification and the total like number of the short video B; the codes in the cell object corresponding to the cell 1 and the cell object corresponding to the cell 2 are the same, but the data sources of the two cell objects are different, and the total praise number displayed is different.
In one possible implementation, the trigger event carries a cell identifier of the triggered cell; the terminal forwards the trigger event to the cell object through the proxy object, and the method comprises the following steps: and the terminal forwards the trigger event to the cell object corresponding to the cell identifier through the proxy object based on the cell identifier.
The cell identifier may be any identifier capable of determining a unique cell, such as a cell name and a cell number, and the cell identifier is not limited in the embodiment of the application.
For example, the terminal forwards the trigger event to the cell object 1 based on the cell identifier 1 through the proxy object.
It should be noted that, in one possible implementation, each list page corresponds to a controller, and the controller processes various events in the list page to update the display content of the list page. The cell object in the embodiment of the application is only used for processing the trigger event so that the buried point code obtains the buried point data, but the influence on the list page is not generated. Therefore, in order to ensure that the buried point data acquired by the buried point code is accurate, the processing result of the cell object needs to be consistent with the processing result of the controller.
Optionally, the embodiment of the present application defines a method for processing a trigger event through a protocol, and therefore, it can be determined whether a processing method code in a cell object is the same as a processing method code in a controller through the protocol followed by the cell object. If the processing method codes in the cell objects are the same as the processing method codes in the controller, the processing results of the cell objects are also the same as the processing results in the controller, the embedded point codes are arranged in the controller and the embedded point data obtained by arranging the embedded point codes in the cell objects are also the same, and the embedded point data obtained by the embedded point codes are ensured to be accurate.
In a possible implementation manner, the forwarding, by the terminal, the trigger event to the cell object corresponding to the cell identifier through the proxy object based on the cell identifier includes: the terminal determines a cell object corresponding to the cell identifier based on the cell identifier in the trigger event through the proxy object; the terminal acquires a protocol followed by the cell object, wherein the protocol is used for defining a processing method code for a trigger event; and forwarding the unit trigger event to the cell object corresponding to the cell identification under the condition that the protocol followed by the cell object is a target protocol, wherein the processing method code defined by the target protocol is the same as the processing method code in the controller of the list page, and the controller is used for processing any trigger event to the list page.
Optionally, the cell object includes a protocol table that includes the protocol to which the cell object conforms, and thus, the proxy object may determine the protocol to which the cell object conforms by querying the protocol table. It should be noted that, the embodiment of the present application is only an exemplary illustration of the protocol for obtaining the cell object, and is not limited thereto.
It should be noted that, in the embodiment of the present application, the proxy object may directly forward the trigger event to the cell object, and the proxy object may also forward the trigger event to the cell object through another object, which is not limited in the embodiment of the present application.
In one possible implementation manner, the terminal forwards the trigger event to the cell object through the proxy object, including: the terminal forwards the trigger event to an event processing object through the proxy object, and the event processing object determines a cell object corresponding to the cell identifier based on the cell identifier in the trigger event; forwarding the trigger event to the cell object through the event handling object.
Alternatively, the event handling object may forward the trigger event directly to the cell object; optionally, the event processing object needs to determine the protocol followed by the cell object first, and when the protocol followed by the cell object meets the requirement, the trigger event is forwarded to the cell object. For example, the terminal forwards the trigger event to the cell object through the event processing object, including: the terminal forwards the trigger event to the event processing object through the proxy object; the terminal determines a cell object corresponding to the cell identifier through the event processing object based on the cell identifier in the trigger event; acquiring a protocol followed by the cell object through the event processing object, wherein the protocol is used for defining a processing method code for the trigger event; and forwarding the trigger event to the cell object corresponding to the cell identifier through the event processing object under the condition that the protocol followed by the cell object is the target protocol.
It should be noted that the cell object compliance target protocol (CellProtocol) in the embodiment of the present application may be implemented by letting the cell class comply with the target protocol. Since the cell object is created based on the cell class, the cell object inherits the properties of the cell class. Thus, having a cell class conform to a target protocol, each cell object created based on that cell class conforms to the target protocol.
In one possible implementation, the proxy object holds a responder list and the proxy object forwards the trigger event to the objects recorded in the responder list. The proxy object holds the responder list, wherein the responder list can be acquired by the proxy object; or the proxy object is bound with the responder list; the proxy object may also include the responder list, and the like, and the relationship between the proxy object and the responder list is not limited in the embodiment of the present application.
Some list pages have a plurality of cells, each cell corresponds to a cell object, and the cell object is added to the responder list to forward the trigger event to the corresponding cell object, so that a large operating pressure is generated. Therefore, another method is provided in the embodiments of the present application, in which an event processing object is added to a responder list, a cell object is determined by the event processing object, and a trigger event is forwarded to a corresponding cell object.
In a possible implementation manner, the forwarding, by the terminal, the trigger event to the event processing object through the proxy object includes: acquiring a responder list through the proxy object, wherein the responder list is used for recording responders for processing the triggering event; in the event that the responder list includes the event handling object, the trigger event is forwarded to the event handling object through the proxy object.
Alternatively, the respondents recorded in the responder list may be added by a proxy object having a function of adding or deleting respondents in the responder list. Optionally, before the terminal acquires the responder list through the proxy object, the method further includes: the terminal binds the proxy object and the event processing object with the list class; in the case of loading any list page, the controller of the list page and the event handling object bound to the list class are added to the responder list through the proxy object bound to the list class.
For example, a technical person adds an agent class ForwardProxy and an event handling class evenHandler in a program, binds a list class with the agent class ForwardProxy and the event handling class EvenHandler through methods such as set, adds a method for setting a data source for the list class, and dynamically binds a ForwardProxy object and an event handling object in the list class during program operation. As shown in fig. 5, when a list page is loaded, a ForwardProxy object bound to the list object adds a controller of the list page to a responder list, and also adds an EvenHandler event processing object to a message responder list through the ForwardProxy object, a trigger event of the list page is sent to a forwarding proxy object bound to the list object for processing, and the ForwardProxy object forwards the received trigger event to a cell object for processing; alternatively, as shown in fig. 6, the ForwardProxy object forwards the trigger event to the controller of the list page and the EvenHandler event handling object according to the responder list, and the EvenHandler event handling object forwards the trigger event to the corresponding cell object.
It should be noted that the ForwardProxy object may also forward the trigger event to the responder list, which forwards the trigger event to the controller of the list page and the EvenHandler event handling object.
303. And the terminal runs a target processing method code corresponding to the trigger event to process the trigger event to obtain a first processing result.
Step 303 is the same as step 203, and is not described in detail herein.
304. And the terminal acquires the buried point data through the buried point code in the target processing method code.
The step 304 is similar to the step 204, and is not described in detail herein.
305. The terminal forwards the trigger event to the controller of the list page through the proxy object.
It should be noted that, in a possible implementation manner, the terminal not only runs the target processing method code corresponding to the trigger event to process the trigger event, but also updates the list page based on the processing result of the target processing method code. At this time, the terminal does not need to perform step 305 and step 306.
In another possible implementation, the terminal manages the list page through the controller, and at this time, the controller is required to process the trigger event and update the list page. Therefore, the terminal also forwards the trigger event to the controller of the list page through the proxy object so that the controller processes the trigger event.
Optionally, the proxy object holds a responder list and the proxy object forwards the trigger event to the objects recorded in the responder list. The terminal forwards the trigger event to the controller of the list page through the proxy object, and the trigger event comprises the following steps: the terminal acquires a responder list through the proxy object, wherein the responder list is used for recording responders for processing the trigger event; in the event that the responder list includes the controller, the trigger event is forwarded to the controller via the proxy object.
306. And the terminal processes the trigger event based on the controller and updates the list page.
The method comprises the following steps that the controller comprises a processing method code for processing any trigger event, and the terminal processes the trigger event based on the controller, and comprises the following steps: and the terminal runs the target processing method code corresponding to the trigger event through the controller to process the trigger event.
The data acquisition method provided by the embodiment of the application provides a proxy object and a cell object, wherein the cell object comprises a processing method code for processing any trigger event of a cell; any trigger event of any list page is forwarded to the cell object through the proxy object, and the cell object can process any trigger event of any list page, so that events occurring in any list page can be recorded only by adding the embedded point codes in the cell object, the number of the embedded point codes is reduced, the labor cost is also reduced, and the research and development efficiency is improved.
In addition, in the embodiment of the application, before the trigger event is forwarded to the cell object, the protocol followed by the cell object is also inquired, so that the consistency of the processing result of the cell object and the processing result of the controller is ensured, and the accuracy of the buried point data obtained by the buried point code is further ensured.
In addition, in the embodiment of the application, an event processing object is added, and the event processing object can forward the trigger event to the corresponding cell object by adding the event processing object into the responder list, so that each cell object does not need to be added into the responder list, the operation of the program is simplified, and the operating efficiency is improved.
The following describes an exemplary data acquisition method by taking the target object as an event processing object through the embodiment shown in fig. 7.
Fig. 7 is a flowchart of a data acquisition method provided in the present application. Referring to fig. 7, in the embodiment of the present application, an execution subject is exemplarily illustrated as a terminal, and the method includes:
701. and the terminal acquires the trigger event of the cell in any list page through the proxy object.
The step 701 is similar to the step 301, and is not described in detail here.
702. And the terminal forwards the trigger event to an event processing object through the proxy object, wherein the event processing object comprises a processing method code for processing any trigger event, and a buried point code is arranged in the processing method code.
Similar to step 302, the proxy object may directly forward the trigger event to the event processing object, or may determine a protocol followed by the event processing object first, and forward the trigger event to the event processing object when the protocol followed by the event processing object meets requirements.
In one possible implementation manner, the forwarding, by the terminal, the trigger event to the event processing object through the proxy object includes: acquiring a protocol followed by the event processing object, wherein the protocol is used for defining a processing method code for the trigger event; and if the protocol followed by the event processing object is a target protocol, forwarding the trigger event to the event processing object through the proxy object.
Optionally, the proxy object holds a responder list, and the proxy object forwards the trigger event to the responders recorded in the responder list. In a possible implementation manner, the forwarding, by the terminal, the trigger event to the event processing object through the proxy object includes: acquiring a responder list through the proxy object, wherein the responder list is used for recording responders for processing the triggering event; in the event that the responder list includes the event handling object, the trigger event is forwarded to the event handling object through the proxy object.
Optionally, before obtaining the responder list through the proxy object, the method further includes: binding the proxy object and the event processing object with the list class; in the case of loading any list page, the controller of the list page and the event handling object bound to the list class are added to the responder list through the proxy object bound to the list class.
It should be noted that the event processing object in step 702 is similar to the event processing object in step 302, and is not repeated here, but the difference is that the event processing object in step 702 includes a processing method code for processing any trigger event, and the event processing object in step 702 is used for processing the trigger event. The event processing object in this step 702 no longer forwards the trigger event to other object processing, but processes itself.
703. And the terminal runs the target processing method code corresponding to the trigger event to process the trigger event.
Step 703 is similar to step 303, and is not described in detail here.
It should be noted that, in the embodiment shown in fig. 3, the target object is a cell object, and therefore, the cell object can directly take the data (for example, display content, etc.) of the cell, and the cell object directly runs the target processing method code to process the acquired cell data. In the embodiment shown in fig. 7, the target object is an event processing object, and the event processing object needs to acquire cell data from the cell object. In a possible implementation manner, the terminal runs a target processing method code corresponding to the trigger event through the event processing object to process the trigger event, including: and the terminal acquires cell data from the cell object corresponding to the cell identifier through the event processing object based on the cell identifier in the trigger event, and runs a target processing method code to process the acquired cell data.
704. And the terminal acquires the buried point data through the buried point code in the target processing method code.
Step 704 is similar to step 204, and is not described in detail herein.
705. The terminal forwards the trigger event to the controller of the list page through the proxy object.
Step 705 is similar to step 305, and is not described in detail herein.
706. The terminal processes the trigger event through the controller and updates the list page.
Step 706 is the same as step 306, and is not described in detail herein.
The data acquisition method provided by the embodiment of the application provides an event processing object, and the event processing object comprises a processing method code for processing any trigger event of a cell, so that the event processing object can process the trigger event of any list page, and the event occurring in any list page can be recorded only by adding a point embedding code in the event processing object, so that the number of the point embedding codes is reduced, the labor cost is also reduced, and the research and development efficiency is improved.
The following describes an exemplary data acquisition method by taking the target object as the responder processing object as an example according to the embodiment shown in fig. 8.
Fig. 8 is a flowchart of a data acquisition method provided in the present application. Referring to fig. 8, in the embodiment of the present application, an execution subject is exemplarily illustrated as a terminal, and the method includes:
801. and the terminal acquires the trigger event of the cell in any list page through the proxy object.
Step 801 is the same as step 301, and is not described in detail here.
802. The terminal forwards the trigger event to a responder object through the proxy object, wherein the responder object comprises a processing method code for processing any trigger event, and a buried point code is arranged in the processing method code.
Similar to step 302, the proxy object may forward the trigger event directly to the responder object, or may determine the protocol followed by the responder object first, and forward the trigger event to the responder object when the protocol followed by the responder object meets the requirements.
In one possible implementation, the terminal forwards the trigger event to the responder object through the proxy object, including: acquiring a protocol followed by the responder object, wherein the protocol is used for defining a processing method code for the trigger event; in the event that the protocol followed by the responder object is a target protocol, the trigger event is forwarded to the responder object via the proxy object.
Optionally, the proxy object holds a responder list, and the proxy object forwards the trigger event to the responders recorded in the responder list. In one possible implementation manner, the terminal forwards the trigger event to the responder object through the proxy object, including: acquiring a responder list through the proxy object, wherein the responder list is used for recording responders for processing the triggering event; in the event that the responder list includes the responder object, the trigger event is forwarded to the responder object via the proxy object.
Optionally, before obtaining the responder list through the proxy object, the method further includes: binding the proxy object and the responder object to a list class; in the case of loading any list page, the controller of the list page and the responder object bound to the list class are added to the responder list through the proxy object bound to the list class.
It should be noted that the responder object in step 802 is similar to the event processing object in step 302, and is not described again here, except that the responder object does not forward the trigger event to other object processing, but processes itself, and the responder object in step 802 includes a processing method code for processing any trigger event.
Another point to be noted is that the responder object is different from the event processing object only in that: the responder object is generated based on a responder class, the responder class is a class of a special processing embedded point set by a technician, the responder class can be a component class or a non-component class, and the responder class is not limited in the embodiment of the application. And the event processing object is generated based on an event processing class, and the event processing class is EvenHandler.
803. And the terminal runs the target processing method code corresponding to the trigger event to process the trigger event.
Step 803 is similar to step 303 and will not be described in detail here.
It should be noted that, in the embodiment shown in fig. 3, the target object is a cell object, and therefore, the cell object can directly take the data (for example, display content, etc.) of the cell, and the cell object directly runs the target processing method code to process the acquired cell data. In the embodiment shown in fig. 8, the target object is a responder object, and the responder object needs to acquire cell data from the cell object. In a possible implementation manner, the terminal executes, through the responder object, the target processing method code corresponding to the trigger event to process the trigger event, including: and the terminal acquires cell data from the cell object corresponding to the cell identifier through the responder object based on the cell identifier in the trigger event, and runs a target processing method code to process the acquired cell data.
804. And the terminal acquires the buried point data through the buried point code at the target processing method code.
Step 804 is similar to step 204, and is not described in detail herein.
805. The terminal forwards the trigger event to the controller of the list page through the proxy object.
The step 805 is similar to the step 305, and is not described in detail herein.
806. The terminal processes the trigger event through the controller and updates the list page.
Step 806 is the same as step 306, and is not described in detail here.
The data acquisition method provided by the embodiment of the application provides a responder object, and the responder object comprises a processing method code for processing any trigger event of a cell, so that the responder object can process the trigger event of any list page, and the event occurring in any list page can be recorded only by adding a buried point code in the responder object, thereby reducing the number of the buried point codes, reducing the labor cost and improving the research and development efficiency.
It should be noted that, in the embodiment of the present application, when the target object is a cell object, the proxy object may directly forward the trigger event to the target object, or forward the trigger event to the target object through the event processing object; and when the target object is an event processing object or a responder object, the proxy object can directly forward the trigger event to the target object without transferring through other objects.
In addition, when the target object is a cell object, if the proxy object directly forwards the trigger event to the target object, the proxy object needs to forward the trigger event to the corresponding cell object according to the cell targeted by the trigger event, and the requirement on the proxy object is high; when the target object is an event processing object or a responder object, the proxy object can directly forward the trigger event to the target object without considering the cell targeted by the trigger event, and the requirement on the proxy object is low.
In addition, when the target object is a cell object or a responder object, the target object also needs to acquire corresponding source data from the corresponding cell object and then operates the corresponding processing method code to process the source data.
Fig. 9 is a schematic structural diagram of a data acquisition apparatus provided in the present application. Referring to fig. 9, the apparatus includes:
a first obtaining module 901, configured to obtain, through a proxy object, a trigger event for a cell in any list page;
a forwarding module 902, configured to forward the trigger event to a target object through the proxy object, where the target object includes a processing method code for processing any trigger event of a cell, and the processing method code is provided with a buried point code;
an operation module 903, configured to operate a target processing method code corresponding to the trigger event to process the trigger event;
a second obtaining module 904, configured to obtain the buried point data through the buried point code in the target processing method code.
As shown in fig. 10, in a possible implementation manner, the trigger event carries a cell identifier of a triggered cell, and the target object is a cell object;
the forwarding module 902 is configured to forward, through the proxy object, the trigger event to the cell object corresponding to the cell identifier based on the cell identifier.
In one possible implementation manner, the forwarding module 902 includes:
an object determining unit 9021, configured to determine, by the proxy object, a cell object corresponding to the cell identifier based on the cell identifier in the trigger event;
a protocol acquiring unit 9022, configured to acquire a protocol followed by the cell object, where the protocol is used to define a processing method code for a trigger event;
a forwarding unit 9023, configured to forward the trigger event to the cell object corresponding to the cell identifier when a protocol followed by the cell object is a target protocol, where a processing method code defined by the target protocol is the same as a processing method code in a controller of the list page, and the controller is configured to process any trigger event for the list page.
In a possible implementation manner, the object determining unit 9021 is configured to forward the trigger event to an event processing object through the proxy object; determining a cell object corresponding to the cell identifier based on the cell identifier in the trigger event through the event processing object;
the forwarding unit 9023 is configured to forward the trigger event to the cell object corresponding to the cell identifier through the event processing object when the protocol followed by the cell object is the target protocol.
In one possible implementation manner, the target object is an event processing object, and the event processing object is used for processing a trigger event; the forwarding module 902 is configured to forward, through the proxy object, the trigger event to the event processing object, so that the target processing method code in the event processing object processes the trigger event.
In one possible implementation manner, the forwarding module 902 includes:
a protocol acquiring unit 9022, configured to acquire a protocol followed by the event processing object, where the protocol is used to define a processing method code for a trigger event;
a forwarding unit 9023, configured to forward, when a protocol followed by the event processing object is a target protocol, the trigger event to the event processing object through the proxy object.
In a possible implementation manner, the forwarding unit 9023 is configured to obtain, by using the proxy object, a responder list, where the responder list is used to record a responder for processing a trigger event; forwarding, by the proxy object, the trigger event to the event handling object if the responder list includes the event handling object.
In one possible implementation, the apparatus further includes:
a binding module 905, configured to bind the proxy object and the event processing object with a list class;
an adding module 906, configured to add, in the case of loading any list page, the controller of the list page and the event processing object bound to the list class to the responder list through the proxy object bound to the list class.
In a possible implementation manner, the cell triggering event carries a cell identifier of a triggered cell, and the target object is an event processing object;
the running module 903 is configured to obtain target data in a cell corresponding to the cell identifier from a cell class based on the cell identifier; and operating a target processing method code corresponding to the trigger event to process the target data.
In one possible implementation, the target object is a responder object, the responder object is an object created based on a responder class, and the responder class is a class for processing a buried point;
the forwarding module 902 is configured to forward the trigger event to the responder object through the proxy object.
In one possible implementation, the apparatus further includes:
the forwarding module 902 is further configured to forward the trigger event to a controller of the list page through the proxy object;
a processing module 907, configured to process the trigger event through the controller, and update the list page.
The embodiment of the present application further provides a computer device, where the computer device includes a processor and a memory, where the memory stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the operations performed in the data acquisition method according to the above embodiment.
Optionally, the computer device is provided as a terminal. Fig. 11 is a schematic structural diagram of a terminal according to an embodiment of the present application. The terminal 1100 may be a portable mobile terminal such as: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4), a notebook computer, or a desktop computer. Terminal 1100 may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, and so forth.
The terminal 1100 includes: a processor 1101 and a memory 1102.
Processor 1101 may include one or more processing cores, such as a 4-core processor, an 8-core processor, or the like. The processor 1101 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 1101 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 1101 may be integrated with a GPU (Graphics Processing Unit) that is responsible for rendering and rendering content that the display screen needs to display. In some embodiments, the processor 1101 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
Memory 1102 may include one or more computer-readable storage media, which may be non-transitory. Memory 1102 can also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in the memory 1102 is used to store at least one program code for execution by the processor 1101 to implement the data acquisition methods provided by the method embodiments herein.
In some embodiments, the terminal 1100 may further include: a peripheral interface 1103 and at least one peripheral. The processor 1101, memory 1102 and peripheral interface 1103 may be connected by a bus or signal lines. Various peripheral devices may be connected to the peripheral interface 1103 by buses, signal lines, or circuit boards. Specifically, the peripheral device includes: at least one of radio frequency circuitry 1104, display screen 1105, camera assembly 1106, audio circuitry 1107, positioning assembly 1108, and power supply 1109.
The peripheral interface 1103 may be used to connect at least one peripheral associated with I/O (Input/Output) to the processor 1101 and the memory 1102. In some embodiments, the processor 1101, memory 1102, and peripheral interface 1103 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1101, the memory 1102 and the peripheral device interface 1103 may be implemented on separate chips or circuit boards, which is not limited by this embodiment.
The Radio Frequency circuit 1104 is used to receive and transmit RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuit 1104 communicates with communication networks and other communication devices via electromagnetic signals. The radio frequency circuit 1104 converts an electric signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electric signal. Optionally, the radio frequency circuit 1104 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuit 1104 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: the world wide web, metropolitan area networks, intranets, generations of mobile communication networks (2G, 3G, 4G, and 20G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the rf circuit 1104 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display screen 1105 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 1105 is a touch display screen, the display screen 1105 also has the ability to capture touch signals on or over the surface of the display screen 1105. The touch signal may be input to the processor 1101 as a control signal for processing. At this point, the display screen 1105 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, display 1105 may be one, disposed on a front panel of terminal 1100; in other embodiments, the display screens 1105 can be at least two, respectively disposed on different surfaces of the terminal 1100 or in a folded design; in other embodiments, display 1105 can be a flexible display disposed on a curved surface or on a folded surface of terminal 1100. Even further, the display screen 1105 may be arranged in a non-rectangular irregular pattern, i.e., a shaped screen. The Display screen 1105 may be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), and the like.
Camera assembly 1106 is used to capture images or video. Optionally, camera assembly 1106 includes a front camera and a rear camera. The front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 1106 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
The audio circuitry 1107 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 1101 for processing or inputting the electric signals to the radio frequency circuit 1104 to achieve voice communication. For stereo capture or noise reduction purposes, multiple microphones may be provided, each at a different location of terminal 1100. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from the processor 1101 or the radio frequency circuit 1104 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, the audio circuitry 1107 may also include a headphone jack.
Positioning component 1108 is used to locate the current geographic position of terminal 1100 for purposes of navigation or LBS (Location Based Service). The Positioning component 1108 can be based on the united states GPS (Global Positioning System), the chinese beidou System or the russian glonass Positioning System, and the european union galileo Positioning System.
Power supply 1109 is configured to provide power to various components within terminal 1100. The power supply 1109 may be alternating current, direct current, disposable or rechargeable. When the power supply 1109 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, terminal 1100 can also include one or more sensors 1110. The one or more sensors 1110 include, but are not limited to: acceleration sensor 1111, gyro sensor 1112, pressure sensor 1113, fingerprint sensor 1114, optical sensor 1115, and proximity sensor 1116.
The acceleration sensor 1111 may detect the magnitude of acceleration on three coordinate axes of the coordinate system established with the terminal 110. For example, the acceleration sensor 1111 may be configured to detect components of the gravitational acceleration in three coordinate axes. The processor 1101 may control the display screen 1105 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 1111. The acceleration sensor 1111 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 1112 may detect a body direction and a rotation angle of the terminal 1100, and the gyro sensor 1112 may cooperate with the acceleration sensor 1111 to acquire a 3D motion of the user with respect to the terminal 1100. From the data collected by gyroscope sensor 1112, processor 1101 may implement the following functions: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
Pressure sensor 1113 may be disposed on a side bezel of terminal 1100 and/or underlying display screen 1102. When the pressure sensor 1113 is disposed on the side frame of the terminal 1100, the holding signal of the terminal 1100 from the user can be detected, and the processor 1101 performs left-right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 1113. When the pressure sensor 1113 is disposed at the lower layer of the display screen 1102, the processor 1101 controls the operability control on the UI interface according to the pressure operation of the user on the display screen 1105. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 1114 is configured to collect a fingerprint of the user, and the processor 1101 identifies the user according to the fingerprint collected by the fingerprint sensor 1114, or the fingerprint sensor 1114 identifies the user according to the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, the user is authorized by the processor 1101 to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying for and changing settings, etc. Fingerprint sensor 1114 may be disposed on the front, back, or side of terminal 1100. When a physical button or vendor Logo is provided on the terminal 1100, the fingerprint sensor 1114 may be integrated with the physical button or vendor Logo.
Optical sensor 1115 is used to collect ambient light intensity. In one embodiment, the processor 1101 may control the display brightness of the display screen 1105 based on the ambient light intensity collected by the optical sensor 1115. Specifically, when the ambient light intensity is high, the display brightness of the display screen 1105 is increased; when the ambient light intensity is low, the display brightness of the display screen 1105 is reduced. In another embodiment, processor 1101 may also dynamically adjust the shooting parameters of camera assembly 1106 based on the ambient light intensity collected by optical sensor 1115.
A proximity sensor 1116, also referred to as a distance sensor, is provided on the front panel of terminal 1100. Proximity sensor 1116 is used to capture the distance between the user and the front face of terminal 1100. In one embodiment, when the proximity sensor 1116 detects that the distance between the user and the front face of the terminal 1100 is gradually decreased, the display screen 1105 is controlled by the processor 1101 to switch from a bright screen state to a dark screen state; when the proximity sensor 1116 detects that the distance between the user and the front face of the terminal 1100 becomes progressively larger, the display screen 1105 is controlled by the processor 1101 to switch from a breath-screen state to a light-screen state.
Those skilled in the art will appreciate that the configuration shown in fig. 11 does not constitute a limitation of terminal 1100, and may include more or fewer components than those shown, or may combine certain components, or may employ a different arrangement of components.
Optionally, the computer device is provided as a server. Fig. 12 is a schematic structural diagram of a server 1200 according to an exemplary embodiment, where the server 1200 may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 1201 and one or more memories 1202, where at least one program code is stored in the memory 1202, and the at least one program code is loaded and executed by the processors 1201 to implement the methods provided by the above method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input/output interface, so as to perform input/output, and the server may also include other components for implementing the functions of the device, which are not described herein again.
The embodiment of the present application further provides a computer-readable storage medium, where at least one program code is stored in the computer-readable storage medium, and the at least one program code is loaded and executed by a processor to implement the operations executed in the data acquisition method of the foregoing embodiment.
The embodiment of the present application further provides a computer program product, where at least one program code is stored in the computer program product, and the at least one program code is loaded and executed by a processor, so as to implement the operations executed in the data acquisition method of the foregoing embodiment.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only an alternative embodiment of the present application and is not intended to limit the present application, and any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (15)

1. A method for data acquisition, the method comprising:
acquiring a trigger event for a cell in any list page through a proxy object;
forwarding the trigger event to a target object through the proxy object, wherein the target object comprises a processing method code for processing any trigger event of a cell, and a buried point code is set in the processing method code;
running a target processing method code corresponding to the trigger event to process the trigger event;
and acquiring buried point data through the buried point code in the target processing method code.
2. The method according to claim 1, wherein the trigger event carries a cell identifier of a triggered cell, the target object is a cell object, and the cell object includes a source code of the cell;
the forwarding the trigger event to the target object through the proxy object includes:
and forwarding the trigger event to the cell object corresponding to the cell identifier through the proxy object based on the cell identifier.
3. The method according to claim 2, wherein forwarding, by the proxy object, the trigger event to the cell object corresponding to the cell identifier based on the cell identifier comprises:
determining a cell object corresponding to the cell identifier based on the cell identifier in the trigger event through the proxy object;
acquiring a protocol followed by the cell object, wherein the protocol is used for defining a processing method code for a trigger event;
and forwarding the trigger event to the cell object corresponding to the cell identification under the condition that the protocol followed by the cell object is a target protocol, wherein the processing method code defined by the target protocol is the same as the processing method code in the controller of the list page, and the controller is used for processing any trigger event to the list page.
4. The method according to claim 3, wherein the determining, by the proxy object, a cell object corresponding to the cell identifier based on the cell identifier in the trigger event includes:
forwarding the trigger event to an event processing object through the proxy object;
determining a cell object corresponding to the cell identifier based on the cell identifier in the trigger event through the event processing object;
the forwarding the trigger event to the cell object corresponding to the cell identifier when the protocol followed by the cell object is a target protocol includes:
and forwarding the trigger event to the cell object corresponding to the cell identifier through the event processing object under the condition that the protocol followed by the cell object is the target protocol.
5. The method according to claim 1, wherein the target object is an event processing object, and the event processing object is used for processing a trigger event; the forwarding the trigger event to the target object through the proxy object includes:
forwarding, by the proxy object, the trigger event to the event processing object, so that the target processing method code in the event processing object processes the trigger event.
6. The method of claim 5, wherein forwarding the trigger event to the event processing object via the proxy object comprises:
acquiring a protocol followed by the event processing object, wherein the protocol is used for defining a processing method code for a trigger event;
and forwarding the trigger event to the event processing object through the proxy object under the condition that the protocol followed by the event processing object is a target protocol.
7. The method according to any one of claims 4 to 6, wherein forwarding the trigger event to an event processing object via the proxy object comprises:
acquiring a responder list through the proxy object, wherein the responder list is used for recording responders for processing the triggering event;
forwarding, by the proxy object, the trigger event to the event handling object if the responder list includes the event handling object.
8. The method of claim 7, wherein prior to obtaining the list of respondents via the proxy object, the method further comprises:
binding the proxy object and the event processing object with a list class;
in the case of loading any list page, adding a controller of the list page and the event processing object bound to the list class to the responder list through the proxy object bound to the list class.
9. The method according to claim 1, wherein the trigger event carries a cell identifier of a triggered cell, and the target object is an event processing object;
the executing of the target processing method code corresponding to the trigger event processes the trigger event, including:
based on the cell identification, acquiring target data in the cell corresponding to the cell identification from the cell class;
and operating a target processing method code corresponding to the trigger event to process the target data.
10. The method of claim 1, wherein the target object is a responder object, the responder object is an object created based on a responder class, and the responder class is a class for processing a buried point;
the forwarding the trigger event to the target object through the proxy object includes:
forwarding the trigger event to the responder object via the proxy object.
11. The method of claim 1, wherein after the trigger event for any list page is obtained by the proxy object, the method further comprises:
forwarding the trigger event to a controller of the list page through the proxy object;
and processing the trigger event through the controller, and updating the list page.
12. A data acquisition apparatus, characterized in that the apparatus comprises:
the first acquisition module is used for acquiring a trigger event of a cell in any list page through the proxy object;
the forwarding module is used for forwarding the trigger event to a target object through the proxy object, the target object comprises a processing method code for processing any trigger event of the cells, and the processing method code is provided with a buried point code;
the running module is used for running a target processing method code corresponding to the trigger event to process the trigger event;
and the second acquisition module is used for acquiring the buried point data through the buried point code in the target processing method code.
13. A computer device comprising a processor and a memory, the memory having stored therein at least one program code, the at least one program code being loaded and executed by the processor to perform operations carried out in a data acquisition method according to any one of claims 1 to 11.
14. A computer-readable storage medium having stored therein at least one program code, the at least one program code being loaded and executed by a processor to perform operations performed in the data acquisition method of any one of claims 1 to 11.
15. A computer program product having at least one program code stored therein, the at least one program code being loaded and executed by a processor to perform the operations of the data acquisition method as claimed in any one of claims 1 to 11.
CN202111500556.3A 2021-12-09 2021-12-09 Data acquisition method and device, computer equipment and storage medium Pending CN114168120A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111500556.3A CN114168120A (en) 2021-12-09 2021-12-09 Data acquisition method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111500556.3A CN114168120A (en) 2021-12-09 2021-12-09 Data acquisition method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114168120A true CN114168120A (en) 2022-03-11

Family

ID=80484933

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111500556.3A Pending CN114168120A (en) 2021-12-09 2021-12-09 Data acquisition method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114168120A (en)

Similar Documents

Publication Publication Date Title
CN107885533B (en) Method and device for managing component codes
CN110674022B (en) Behavior data acquisition method and device and storage medium
CN110308956B (en) Application interface display method and device and mobile terminal
CN113204298B (en) Method and device for displaying release progress, electronic equipment and storage medium
CN110278464B (en) Method and device for displaying list
CN110362366B (en) Application interface display method and device
CN110288689B (en) Method and device for rendering electronic map
CN111752666A (en) Window display method and device and terminal
CN111694478A (en) Content display method, device, terminal and storage medium
CN112749362A (en) Control creating method, device, equipment and storage medium
CN110677713B (en) Video image processing method and device and storage medium
CN111737100A (en) Data acquisition method, device, equipment and storage medium
CN107943484B (en) Method and device for executing business function
CN111897465B (en) Popup display method, device, equipment and storage medium
CN112230910A (en) Page generation method, device, equipment and storage medium of embedded program
CN115562529A (en) Visual point burying method and device, terminal and storage medium
CN113836426A (en) Information pushing method and device and electronic equipment
CN109189525B (en) Method, device and equipment for loading sub-page and computer readable storage medium
CN109618018B (en) User head portrait display method, device, terminal, server and storage medium
CN113268234A (en) Page generation method, device, terminal and storage medium
CN112000576A (en) Code data detection method, device, equipment and storage medium
CN110941458A (en) Method, device and equipment for starting application program and storage medium
CN114168120A (en) Data acquisition method and device, computer equipment and storage medium
CN113495770A (en) Method, device, terminal and storage medium for displaying application page
CN111241451A (en) Webpage processing method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination