A configurable user behavior collection method and device
By using asynchronous cache management and global behavior listeners in the financial market client to separate business logic and event listening, the repetitive workload and logical confounding problems of user behavior listening in the existing technology are solved, and flexible configuration and efficient maintenance are achieved.
Patent Information
- Application Number
- CN202011020724.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-25
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2040-09-25
AI Technical Summary
In the prior art, financial market clients need to register events in each interface to listen to user behavior, resulting in heavy and cumbersome repetitive workload, and the event acquisition logic is mixed with business logic, resulting in poor readability and increased maintenance difficulty.
By pre-registering controls to monitor user behavior in the event manager, and using the asynchronous cache management mechanism, obtain control name and logic layer information, separate business logic and event monitoring, and use global behavior listeners to centrally monitor user operations to reduce coupling and adjustment Difficulty.
It realizes flexible configuration and centralized monitoring of user behavior, reduces workload, avoids business logic errors, and improves system maintenance flexibility and readability.
Smart Images

Figure CN112102008B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of behavior collection framework development, and specifically, relates to a configurable user behavior collection method and device. Background Art
[0002] The Internet Trading Platform project is a desktop client program developed by WPF in the Windows environment. In order to better count the user usage of each product on the Internet Trading Platform and provide users with a better experience in the future, it is necessary to collect data on user behavior. At present, the client in the financial market needs to register events in various controls on each interface to monitor user behavior. This method has the following disadvantages:
[0003] 1). It is necessary to register monitoring events for each control to be monitored on each interface, which is a lot of repetitive work and cumbersome.
[0004] 2). If you need to change the listening events of a type of control, you need to delete the old implementation of this type of control in all interfaces and then register the new event. This is a lot of work and is prone to omissions in deletion or registration.
[0005] 3). The implementation logic of the monitored event collection user behavior is mixed with the business logic, which has poor readability and is easy to change the business logic by mistake, making the later maintenance of the platform more difficult. Summary of the invention
[0006] The present application provides a configurable user behavior collection method and device to at least solve the current problem that before monitoring user behavior, events need to be registered in various controls on each interface in order to monitor user behavior.
[0007] According to one aspect of the present application, a configurable user behavior collection method is provided, comprising:
[0008] Monitor whether the controls pre-registered in the event manager are triggered;
[0009] If yes, get the name of the control and determine whether to include the control in asynchronous cache management;
[0010] Collect user behavior from controls managed by asynchronous cache.
[0011] In one embodiment, obtaining the name of a control and determining whether to include the control in asynchronous cache management includes:
[0012] Determine whether the name of the control starts with Sts_;
[0013] If yes, determine whether the logic layer of the control inherits the interface of the component on the page;
[0014] If so, the specified code in the name of the control and the menu and submenu in the page component are intercepted and placed in the asynchronous cache manager.
[0015] In one embodiment, the user behavior collection method further includes:
[0016] Name the control according to the presentation layer and logic layer where the control is located. The name of the control on the presentation layer must start with Sts_.
[0017] In one embodiment, the user behavior collection method further includes: setting the logic layer where the control is located as an interface that inherits the page component, and the interface has two attributes: menu and submenu.
[0018] According to another aspect of the present application, a configurable user behavior collection device is also provided, including:
[0019] The monitoring unit is used to monitor whether the controls pre-registered in the event manager are triggered;
[0020] The asynchronous cache unit is used to obtain the name of the control and determine whether to include the control in the asynchronous cache management if yes;
[0021] The user behavior collection unit is used to collect user behavior from controls included in asynchronous cache management.
[0022] In one embodiment, the asynchronous cache unit includes:
[0023] The name judgment module is used to judge whether the name of the control starts with Sts_;
[0024] The interface judgment module is used to judge whether the logic layer of the control inherits the interface of the page component if yes;
[0025] The interception module, if yes, is used to intercept the specified code in the name of the control and the menus and submenus in the page component where it is located and put them into the asynchronous cache manager.
[0026] In one embodiment, the configurable user behavior collection device further includes:
[0027] The control naming unit is used to name the control according to the display layer and logic layer where the control is located. The name of the control on the display layer must start with Sts_.
[0028] In one embodiment, the user behavior collection device further includes: an interface setting unit, which is used to set the logic layer where the control is located as an interface that inherits the page component, and the interface has two attributes: menu and submenu.
[0029] The present application uses a global behavior listener to centrally monitor the time when the user operates the control. Therefore, there is no need to pay attention to whether there is business logic in the event of the monitored control. It separates it from the business logic, reduces the coupling degree, and is conducive to flexible adjustment of the monitoring strategy in the later stage. On the other hand, the present application shortens the length of the control and solves the problem that the same control number in the common control indicates different meanings in different pages, which is easy to cause ambiguity. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0031] Figure 1 A flow chart of a configurable user behavior collection method provided for this application.
[0032] Figure 2 This is a process for determining whether to include a control in asynchronous cache management based on the name of the control in the embodiment of the present application.
[0033] Figure 3 This is a diagram of the behavior collection method in an embodiment of the present application.
[0034] Figure 4 A structural block diagram of a configurable user behavior collection device provided in this application.
[0035] Figure 5 This is a structural block diagram of an asynchronous cache unit in an embodiment of the present application.
[0036] Figure 6 This is a specific implementation of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] Based on the existing problems in the background technology, this application provides a configurable user behavior collection method, such as Figure 1 As shown, including:
[0039] S101: Monitor whether a control pre-registered in the event manager is triggered.
[0040] Currently, the client of the financial market interconnected trading platform is developed using the WPF MVVM framework, with the View (display layer) and ViewModel (logic layer) separated from the front and back ends.
[0041] In a specific embodiment of the present application, in order to flexibly configure and monitor different events of various controls and selectively collect user behaviors, an expansion is made on the basis of the EventManager event manager that comes with WPF to form a behavior listener to monitor and collect events triggered by user operations on financial market client controls. The ReigsterClassHandler method of the event manager provides the control type to be registered, the event, and the processing method of the triggered event. Therefore, the control type to be registered and monitored can be dynamically selected through an XML configuration file or a code configuration method. When the user operates the control, the event is triggered, and the behavior listener obtains the monitoring information.
[0042] S102: If yes, obtain the name of the control and determine whether to include the control in asynchronous cache management.
[0043] In one embodiment, the name of the control is obtained and it is determined whether to include the control in the asynchronous cache management, such as Figure 2 As shown, including:
[0044] S201: Determine whether the name of the control begins with Sts_.
[0045] S202: If yes, determine whether the logic layer of the control inherits the interface of the component on the page.
[0046] S203: If yes, intercept the specified code in the name of the control and the menu and submenu in the page component where the control is located and put them into the asynchronous cache manager.
[0047] In a specific embodiment, if Figure 3 As shown, when the user operates the control to trigger the event method, depending on whether the name of the control starts with Sts_ and whether the ViewModel inherits the IPageComponent interface of the page component, if both conditions are met, the code after Sts_ in the control Name and the FlowType and SubFlowType in the page component are intercepted and put into the asynchronous cache in the BehaviorManager behavior management.
[0048] S103: Collecting user behaviors from controls included in asynchronous cache management.
[0049] In a specific embodiment, a control will have many events, such as the text box getting focus, losing focus, content change events, etc. In the future, as the focus of user behavior changes, you may need to monitor other events of the control. At this time, you only need to adjust the monitoring control event configuration file to complete it, thereby reducing the workload. Currently, two registration methods are supported:
[0050] 1.Xml configuration file format
[0051] 2. Code configuration form
[0052] The technicians may be only interested in the behavior of some controls of the same type operated by the users, and they only need to collect the controls that comply with the custom naming conventions.
[0053] In one embodiment, the user behavior collection method further includes:
[0054] Name the control according to the presentation layer and logic layer where the control is located. The name of the control on the presentation layer must start with Sts_.
[0055] In a specific embodiment, a method of naming (coding) View (display layer) + ViewModel (logic layer) is used to identify a unique control. Traditional control coding must include page functions and control meanings, which makes the coding very long and it is difficult to achieve that the same control number in a common control represents different meanings on different pages. The new control identification naming specification, the naming of the View layer simply represents the meaning of the control, and the naming of the ViewModel layer only represents the page function. Different View and ViewModel combinations can represent different identification meanings.
[0056] In one embodiment, the user behavior collection method further includes: setting the logic layer where the control is located as an interface that inherits the page component, and the interface has two attributes: menu and submenu.
[0057] In a specific embodiment, considering that some pages are created from a parent page or there are multiple Tab pages in a page, there are two attributes in the interface: menu FlowType and submenu SubFlowType.
[0058] This application uses a global behavior listener to monitor events triggered by user operation controls instead of registering events in various controls on each page in the prior art to monitor user behavior. Therefore, there is no need to pay attention to whether the events of the monitored controls have business logic, which increases flexibility for adjusting the monitoring strategy later.
[0059] The behavior collection method provided by this application requires little code change for large projects that have already been launched. As long as the names of valid controls are named according to the agreed rules and the corresponding ViewModel fills in the menu name or submenu name, the framework can basically automatically fill in the menu name, so the menu name basically does not need to be changed, and you only need to pay attention to the control coding. Secondly, it reduces the degree of coupling and increases flexibility. If you need to change or cancel the monitoring event of the control in the future, you only need to modify the monitoring rules at the global level, avoiding the traditional implementation method that requires modifying the code from each interface. At the same time, it is also isolated from the business logic, avoiding the possibility of modifying the business logic by mistake.
[0060] Based on the same inventive concept, the embodiments of the present application also provide a configurable user behavior collection device, which can be used to implement the method described in the above embodiments, as described in the following embodiments. Since the principle of solving the problem by the configurable user behavior collection device is similar to that of the configurable user behavior collection method, the implementation of the configurable user behavior collection device can refer to the implementation of the configurable user behavior collection method, and the repeated parts will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements predetermined functions. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0061] like Figure 4 As shown, the present application also provides a configurable user behavior collection device, including:
[0062] A monitoring unit 401 is used to monitor whether a control pre-registered in the event manager is triggered;
[0063] The asynchronous cache unit 402 is used to obtain the name of the control and determine whether to include the control in the asynchronous cache management if yes;
[0064] The user behavior collection unit 403 is used to collect user behaviors from the controls included in the asynchronous cache management.
[0065] In one embodiment, if Figure 5 As shown, the asynchronous cache unit 402 includes:
[0066] The name determination module 501 is used to determine whether the name of the control begins with Sts_;
[0067] Interface determination module 502, if yes, is used to determine whether the logic layer of the control inherits the interface of the page component;
[0068] The interception module 503, if yes, is used to intercept the specified code in the name of the control and the menu and submenu in the page component where the control is located and put them into the asynchronous cache manager.
[0069] In one embodiment, the configurable user behavior collection device further includes:
[0070] The control naming unit is used to name the control according to the display layer and logic layer where the control is located. The name of the control on the display layer must start with Sts_.
[0071] In one embodiment, the user behavior collection device further includes: an interface setting unit, which is used to set the logic layer where the control is located as an interface that inherits the page component, and the interface has two attributes: menu and submenu.
[0072] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0073] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0074] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0075] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0076] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
[0077] The embodiments of the present application also provide a specific implementation of an electronic device that can implement all the steps in the method in the above embodiments, see Figure 6 , the electronic device specifically includes the following contents:
[0078] Processor 601, memory 602, communication interface 603, bus 604 and non-volatile memory 605;
[0079] The processor 601, memory 602, and communication interface 603 communicate with each other via the bus 604;
[0080] The processor 601 is used to call the computer program in the memory 602 and the non-volatile memory 605. When the processor executes the computer program, all the steps in the method in the above embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:
[0081] S101: Monitor whether a control pre-registered in the event manager is triggered.
[0082] S102: If yes, obtain the name of the control and determine whether to include the control in asynchronous cache management.
[0083] S103: Collecting user behaviors from controls included in asynchronous cache management.
[0084] The embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps of the method in the above embodiments. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, all the steps of the method in the above embodiments are implemented. For example, when the processor executes the computer program, the following steps are implemented:
[0085] S101: Monitor whether a control pre-registered in the event manager is triggered.
[0086] S102: If yes, obtain the name of the control and determine whether to include the control in asynchronous cache management.
[0087] S103: Collecting user behaviors from controls included in asynchronous cache management.
[0088] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the hardware + program embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. Although the embodiment of this specification provides the method operation steps described in the embodiment or flow chart, more or less operation steps can be included based on conventional or non-creative means. The order of steps listed in the embodiment is only one way of executing the order of many steps, and does not represent the only execution order. When the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiment or the accompanying drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or device including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such a process, method, product or device. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or device including the elements. For the convenience of description, the above device is described by dividing it into various modules according to its functions. Of course, when implementing the embodiments of this specification, the functions of each module can be implemented in the same one or more software and / or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The present invention is described with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiments of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the process and / or box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0089] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, the embodiments of this specification may be in the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the embodiments of this specification may be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts refer to the partial description of the method embodiment. In the description of this specification, the description of the reference term "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of this specification.
[0090] In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradicting each other. The above is only an embodiment of the embodiment of this specification and is not intended to limit the embodiment of this specification. For those skilled in the art, the embodiment of this specification may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiment of this specification shall be included in the scope of the claims of the embodiment of this specification.
Claims
1. A configurable user behavior collection method, characterized in that: Based on the event manager, a behavior listener is formed to monitor and collect events triggered by user operation controls on the financial market client, including: Use the global behavior listener to monitor whether the controls pre-registered in the event manager are triggered; If yes, obtain the name of the control and determine whether to include the control in asynchronous cache management; Collect user behavior from controls managed by asynchronous cache.
2. The configurable user behavior collection method according to claim 1, characterized in that: The obtaining the name of the control and determining whether to include the control in asynchronous cache management includes: Determine whether the name of the control begins with Sts_; If yes, determine whether the logic layer of the control inherits the interface of the page component; If so, the specified code in the name of the control and the menu and submenu in the page component are intercepted and put into the asynchronous cache manager.
3. The configurable user behavior collection method according to claim 1, characterized in that: Also includes: Name the control according to the presentation layer and logic layer where the control is located. The name of the control on the presentation layer must start with Sts_.
4. The configurable user behavior collection method according to any one of claims 1 to 3, characterized in that: Also includes: The logic layer where the control is located is set as an interface that inherits the page component, and the interface has two attributes: menu and submenu.
5. A configurable user behavior collection device, characterized in that: Based on the event manager, a behavior listener is formed to monitor and collect events triggered by user operation controls on the financial market client, including: The monitoring unit is used to monitor whether the controls pre-registered in the event manager are triggered through the global behavior listener; an asynchronous cache unit, for, if yes, obtaining the name of the control and determining whether to include the control in asynchronous cache management; The user behavior collection unit is used to collect user behavior from controls included in asynchronous cache management.
6. The configurable user behavior collection device according to claim 5, characterized in that: The asynchronous cache unit comprises: A name determination module, used to determine whether the name of the control begins with Sts_; The interface judgment module is used to judge whether the logic layer of the control inherits the interface of the page component if yes; The interception module, if yes, is used to intercept the specified code in the name of the control and the menu and submenu in the page component where the control is located and put them into the asynchronous cache manager.
7. The configurable user behavior collection device according to claim 5, characterized in that: Also includes: The control naming unit is used to name the control according to the display layer and logic layer where the control is located. The name of the control on the display layer must start with Sts_.
8. The configurable user behavior collection device according to any one of claims 5 to 7, characterized in that: Also includes: The interface setting unit is used to set the logic layer where the control is located as the interface of the inherited page component, and the interface has two attributes: menu and submenu.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the configurable user behavior collection method described in any one of claims 1 to 4 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the configurable user behavior collection method described in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Page data collection method and device
CN107491488A
Page data acquisition method and device and server
CN109739717A
Micro-service development framework and real-time monitoring implementation method
CN110825356A
Method and apparatus for configuring a user interface
US7917855B1
Statistical method and apparatus for behaviors of front-end users
WO2017167042A1
