WO2019085083A1 - 控件匹配方法、装置、计算机设备和存储介质 - Google Patents

控件匹配方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2019085083A1
WO2019085083A1 PCT/CN2017/112661 CN2017112661W WO2019085083A1 WO 2019085083 A1 WO2019085083 A1 WO 2019085083A1 CN 2017112661 W CN2017112661 W CN 2017112661W WO 2019085083 A1 WO2019085083 A1 WO 2019085083A1
Authority
WO
WIPO (PCT)
Prior art keywords
control
view
path
index
touched
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.)
Ceased
Application number
PCT/CN2017/112661
Other languages
English (en)
French (fr)
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Publication of WO2019085083A1 publication Critical patent/WO2019085083A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/041Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means
    • G06F3/0416Control or interface arrangements specially adapted for digitisers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72454User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to context-related or environment-related conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72457User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to geographic location

Definitions

  • the present application relates to the field of computer technology, and in particular, to a control matching method, apparatus, computer device, and storage medium.
  • a buried point in APP is an important means for many APP developers to collect user behavior data.
  • various schemes for setting a buried point in an APP such as code embedding, visual embedding, and no embedding.
  • the scheme of visualizing the buried point and the non-buried point can upload the information of the APP page control to the web server through the terminal, and the web server obtains the information about the buried point of the control by the relevant personnel, and sends the buried point information to the terminal, so that the terminal is in the terminal.
  • the touched control is matched with the control that sets the buried point according to the buried point information, thereby determining whether the touch event of the control needs to be reported to the server.
  • the terminal matches the touched controls according to the position coordinates.
  • this method is only applicable to terminals of the same size as those used when setting the buried point.
  • the control position coordinates are different due to the difference in the size of the terminal, so that the controls on the terminals of other sizes cannot be accurately matched, so that it is difficult to accurately report the touch event of the control.
  • a control matching method, device, and computer are provided Equipment and storage media.
  • a control matching method includes: acquiring a touch event occurring in a current application page, intercepting the touch event; the touch event corresponding to the touched control of the application; acquiring a view path of the touched control And an index path; obtaining a view path and an index path of the plurality of buried point controls sent by the server; matching the view path of the touched control with the view path of the buried control, and indexing the touched control Matching with the index path of the embedded control; and when the view path and the index path are successfully matched, respectively, the touch event corresponding to the touched control is reported to the server.
  • a control matching device includes: an intercepting module, configured to acquire a touch event occurring in a current application page, and intercept the touch event; the touch event corresponds to a touched control of the application; and the path is acquired a module, configured to acquire a view path and an index path of the touched control, and obtain a view path and an index path of the plurality of buried point controls sent by the server; and a path matching module, configured to: view the view path of the touched control Matching the view path of the buried control to match the index path of the touched control with the index path of the buried control; and reporting the module, when the view path and the index path are successfully matched respectively, The touch event corresponding to the touched control is reported to the server.
  • a computer apparatus comprising a memory and one or more processors having stored therein computer readable instructions that, when executed by a processor, implement the steps of a control matching method provided in any one of the embodiments of the present application.
  • One or more non-volatile storage media storing computer readable instructions that, when executed by one or more processors, cause one or more processors to implement the controls provided in any one embodiment of the present application The steps to match the method.
  • FIG. 1 is an application scenario diagram of a control matching method in an embodiment
  • FIG. 2 is a flow chart of a control matching method in an embodiment
  • FIG. 3 is a flow chart of a control matching method in another embodiment
  • FIG. 4 is a schematic diagram of a multi-fork tree corresponding to a current application page in an embodiment
  • FIG. 5 is a schematic diagram of adding a buried border in a screenshot of a page in an embodiment
  • Figure 6 is a structural diagram of a control matching device in an embodiment
  • Figure 7 is a block diagram of a computer device in one embodiment.
  • first may be referred to as a second client
  • second client may be referred to as a first client, without departing from the scope of the present application.
  • Both the first client and the second client are clients, but they are not the same client.
  • the present application provides a control matching method, which can be applied to an application environment as shown in FIG. 1.
  • the first terminal 102, the second terminal 104, and the third terminal 106 are respectively connected to the server 108 through a network.
  • the first terminal 102, the second terminal 104, and the third terminal 106 may each be at least one of a smart phone, a tablet computer, a desktop computer, and an in-vehicle computer, but are not limited thereto.
  • the server 108 may be a stand-alone physical server or a server cluster composed of a plurality of physical servers.
  • the first terminal 102 and the third terminal 106 respectively run an application that needs to set a buried point.
  • the first terminal 102 corresponds to an application developer
  • the third terminal 106 corresponds to an application user.
  • the third terminal 106 and the third terminal 106 may be the same terminal or different terminals.
  • the above application can be a native application (Native APP), a web application (Web APP), or a hybrid application.
  • the first terminal 102 and the third terminal 106 respectively install a plug-in SDK (Software Development Kit) in the application.
  • the SDK is a pre-developed script based on the open source UI (User Interface) cross-platform framework.
  • the UI cross-platform framework can be a React Native framework or a Weex framework.
  • the SDK includes data collection scripts, touch event interception scripts, control matching scripts, and touch event reporting scripts for data collection, touch event interception, control matching, and touch event reporting.
  • the first terminal 102 acquires view data displayed by the current application page by using the SDK, and transmits the view data to the server 108.
  • the view data includes a screenshot of the current page and attribute information of the multiple views.
  • the server 108 restores the screenshot of the page according to the attribute information, and sends the restored screenshot of the page to the second terminal 104.
  • the second terminal displays the restored screenshot of the page through the web page, and obtains a buried point operation of the plurality of controls in the screenshot of the application by the application developer, and the buried point corresponding to the control (hereinafter referred to as “buried point control”)
  • the information is returned to the server 108.
  • the server 108 generates a view path and an index path respectively corresponding to the plurality of buried point controls according to the attribute information, and sends the buried point information, the view path and the index path of the buried point control to the third terminal 106.
  • the third terminal 106 uses the SDK to acquire a touch event corresponding to the touched control in the current application page, intercepts the touch event, and acquires a view path of the touched control and
  • the index path matches the view path of the touched control with the view path of the buried control, and matches the index path of the touched control with the index path of the buried control. If the matching is successful, the third terminal 106 reports the touch event to the server 108.
  • the view path distinguishes the controls of different levels.
  • the index path distinguishes multiple different controls in the same level.
  • the view path and the index path can be used to accurately locate the control, thereby improving the matching precision of the control.
  • FIG. 2 is a schematic flow chart of a method according to an embodiment of the present application. It should be understood that although the various steps in the flowchart of FIG. 2 are sequentially displayed as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless explicitly stated in this article, the implementation of these steps Lines do not have strict order restrictions, which can be performed in other orders. Moreover, at least some of the steps in FIG. 2 may include a plurality of sub-steps or stages, which are not necessarily performed at the same time, but may be executed at different times, and the order of execution thereof is not necessarily This may be performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of the other steps.
  • a control matching method is provided.
  • the method is applied to the third terminal as an example, and specifically includes the following steps:
  • Step 202 Acquire a touch event occurring in a current application page, and intercept the touch event; the touch event corresponds to the touched control of the application.
  • the third terminal acquires a touch event corresponding to the touched control (hereinafter referred to as “touched control”) in the current application page, and uses the SDK pair. Touch events to intercept.
  • the server sends the buried point information, the view path and the index path of the buried control to the third terminal, the third terminal uses the SDK to cache the buried point information, the view path and the index path of the buried point control.
  • Step 204 Acquire a view path and an index path of the touched control.
  • the third terminal also uses the SDK to collect and cache attribute information of multiple views of the current application page.
  • Views include controls and view controllers.
  • the user can touch the visible controls. Touch operations include tapping, long press, short press, or swipe.
  • View controllers are used to create and manage controls that are invisible to the user. Although the view controller is invisible to the user, it is necessary to build the view path and index path of the control.
  • the attribute information includes a view name and a view index.
  • the view name can be a control name or a controller name
  • the view index can be a view control index or a controller index.
  • the view name can directly reflect the view type.
  • UIWindow (a kind of control name) belongs to the window type control
  • UIButton belongs to the button type control
  • RootViewController belongs to the root view controller.
  • the SDK separately numbers the views of different levels, and separately numbers the different types of views of the same level, and consecutively numbers the same type of views of the same level. The number is used as the view index corresponding to the corresponding view. For example, suppose there are three button type controls in the same level view, numbered with 0 as the initial value, and the control index corresponding to the three button type controls can be 0, 1, and 2 in order.
  • the SDK can record the view index as a subscript of the view name of the corresponding view, such as UIButton 0 , UIButton 1 and UIButton 2 .
  • the attribute information also includes hierarchical information for multiple views of the current application page. Each view has corresponding level information, and the level information includes an inheritance relationship between the view and one or more other views. For example, the control UIButton inherits from the control UIView, and the control UIView is the upper level view of the control UIButton.
  • the SDK When the user touches a certain control of the current application page through the third terminal, the SDK reads the attribute information of the cached touched control, and obtains the hierarchical path of the touched control according to the attribute information.
  • Hierarchical paths include view paths and index paths.
  • the SDK backtracks step by step according to the hierarchical information of the touched control, that is, whether the touched control has a higher level view.
  • the view name and view index of the upper level view are extracted.
  • the SDK continues to go back up step by step according to the hierarchical information of the touched control, that is, whether the corresponding upper level view still exists in the upper level view of the touched control, and if so, extract the corresponding view name and view index until the highest level view.
  • the SDK uses the first preset identifier to splicing the extracted plurality of view names step by step, that is, splicing the view names of the plurality of views of the touched control from the highest level view to the directory name, to obtain a directory string.
  • the directory string is used as the view path corresponding to the touched control.
  • the SDK uses the second preset identifier to splicing the extracted multiple view indexes step by step, that is, splicing the view indexes of the plurality of views of the touched control from the highest level view to the index index, and obtaining the index string, and the index string is touched.
  • the index path corresponding to the control thereby obtaining the hierarchical path corresponding to the touched control.
  • the first preset identifier and the second preset identifier may be “/”, “_”, “#”, “@” or “*”, etc., respectively.
  • the view path corresponding to the control UIButton 1 may be /UIwindow/ViewController/UIView/UIButton, and the index path may be 0_1_2_1.
  • the hierarchical path can also be combined with the index path and the index path.
  • the view index is used as a subscript of the view name of the corresponding view, and the plurality of subtitled view names are successively spliced in the above manner by using the first preset identifier or the second preset identifier to obtain the following hierarchical path: UIwindow 0 /ViewController 1 /UIView 2 /UIButton 1 .
  • Step 206 Acquire a view path and an index path of multiple buried point controls sent by the server.
  • step 206 may be performed before step 204 or may be performed in parallel with step 204.
  • Step 208 Match the view path of the touched control with the view path of the buried control, and match the index path of the touched control with the index path of the buried control.
  • the third terminal uses the SDK to read the view path and the index path of the cached plurality of buried point controls, and uses the view path and the index path of the buried control as the matching reference object, respectively, and the view path and the index path of the touched control are respectively Match the reference object for matching.
  • the third terminal matches the hierarchical path of the touched control with the hierarchical path of the buried control according to the view depth of each view in the hierarchical path.
  • the view depth of a view refers to the order in which the view's view name is relative to other view names in its hierarchical path.
  • the first view name in the view path corresponds to the first view depth
  • the second view name corresponds to the second view depth
  • the UIwindow in the view path/UIwindow/ViewController/UIView/UIButton corresponds to the first view depth
  • the ViewController corresponds to the second view depth
  • the UIView corresponds to the third view depth
  • the UIButton corresponds to the fourth view depth.
  • the last view name is the view name of the touched control, corresponding to the final view depth.
  • the third terminal can also match the hierarchical path of the touched control with the hierarchical path of the buried control in other manners, which is not limited herein.
  • the SDK culls the hierarchical path of the touched control with the hierarchical path of the plurality of buried control according to the depth of the view, and gradually reduces the number of the buried control as the matching reference object to reduce unnecessary matching.
  • the SDK performs the first round matching, and the view name and the corresponding view index of the first view depth in the touch control hierarchical path are respectively associated with the view name of the first view depth in the plurality of buried control level paths and corresponding The view index is matched, and the view name of the first view depth and the corresponding view index respectively match the view path of the successfully one or more buried control.
  • the SDK performs the second round of matching, and the view name and the corresponding view index of the second view depth in the touch control hierarchical path are respectively corresponding to the view name and the corresponding view of the second view depth in the filtered plurality of buried point control hierarchical paths.
  • the view index is matched, so after multiple rounds of matching until touched The view name and view index of the control are also matched.
  • the SDK caches the hierarchical path of the following buried control.
  • the hierarchical path of the buried control A is /UIwindow 0 /RootController 1 /UIView 2 /UIButton 1
  • the hierarchical path of the buried control B is /UIwindow 0 /ViewController 1 /ChildController 1 /UILabel
  • the hierarchical path of the buried control C is /UIwindow 0 /ViewController 1 /UIView 2 /UIButton 1
  • the hierarchical path of the buried control D is /UIwindow 0 /ViewController 1 /UIView 2 / UIButton 0
  • the hierarchical path of the buried point control A will be eliminated after the second round of matching
  • the hierarchical path of the buried point control B will be eliminated after the third round of matching
  • the fourth round of matching only needs to be buried.
  • Point control C and D's hierarchical path to match It should be understood that the present embodiment only gives a limited number of matching reference objects, the actual number of buried control devices is large, and the depth of the actual hierarchical path is deep, so in the actual operation, the above-mentioned culling matching The way to improve the matching efficiency is more obvious.
  • Step 210 When the view path and the index path are successfully matched, the touch event corresponding to the touch control is reported to the server.
  • the server that receives the touch event reporting information and the server that sends the buried point information to the third terminal may be the same server or different servers.
  • the view path can distinguish the controls corresponding to different hierarchical views.
  • the index path can distinguish different controls corresponding to the same hierarchical view.
  • the combination of the view path and the index path can accurately locate the control, thereby improving the control matching. Accuracy, in turn, can accurately report the touch events of the control.
  • the step of obtaining the view path and the index path of the touched control includes: querying whether there is a matching successful record corresponding to the touched control; and acquiring the attribute information of the touched control when there is no corresponding matching successful record And generating a view path and an index path of the touched control according to the attribute information; the method further includes: jumping to the step of reporting the touch event corresponding to the touch control to the server when there is a corresponding matching successful record.
  • the matching result of the control is recorded, and when the control is touched again, there is no need to repeat matching, so that the third terminal only needs to perform matching once for each control, which can improve the matching efficiency of the control.
  • the third terminal service resource can be saved.
  • the step of acquiring a view path and an index path of the plurality of buried control units sent by the server includes: sending a visual burying point request to the server; and receiving the configuration table according to the configuration table returned by the visual burying point request, and configuring the table record Multiple configuration items are configured; the current application page is parsed according to the configuration item, and the attribute information corresponding to multiple views in the current page is obtained; the configuration item corresponding to the attribute information is added to the configuration table; the configuration table is sent to the server, so that the server is configured according to The view path and the index path of the plurality of buried point controls generated by the attribute information; receiving the view path and the index path of the plurality of buried point controls sent by the server.
  • the application developer may add missing configuration items to the configuration table according to requirements, and may also delete unnecessary configuration items, such as a control background image with a large amount of data, to prevent the first terminal from reporting some redundancy.
  • the data of the view can be optimized to a certain extent, and the attribute information of the view acquired by the first terminal and the time of filling the configuration table can be reduced, thereby improving the efficiency of generating the view path and the index path by the server.
  • the step of acquiring the view path and the index path of the touched control includes: acquiring attribute information of the touched control; the attribute information includes a view name, a view index, and hierarchical information; and one or more according to the touched control Level information of the view, using the first preset identifier to splicing the view name of the highest level view to the view name of the touched control, to obtain a directory string, and using the directory string as the view path of the touched control; according to the touched control With the hierarchical information of one or more views, the view index of the highest-level view is indexed to the view index of the touched control by the second preset identifier, and the index string is obtained, and the index string is used as the index path of the touched control. .
  • the third terminal acquires the attribute information of the touched control by using the SDK.
  • the SDK traces back up according to the level information of the touched control, that is, whether the touched control has a higher level view. It is easy to understand that when the touched control is the highest level view of the current application page, the touched control does not exist.
  • One level view When the touched control has a hierarchical view, the view name and view index of the upper level view are extracted.
  • the SDK continues to go back up step by step according to the hierarchical information of the touched control, that is, whether the corresponding upper level view still exists in the upper level view of the touched control, and if so, extract the corresponding view name and view index until the highest level view.
  • the SDK uses the first preset identifier to splicing the extracted plurality of view names step by step, that is, splicing the view names of the plurality of views of the touched control from the highest level view to the directory name, to obtain a directory string.
  • the directory string is used as the view path corresponding to the touched control.
  • the SDK uses the second preset identifier to splicing the extracted multiple view indexes step by step, that is, splicing the view indexes of the plurality of views of the touched control from the highest level view to the index index, and obtaining the index string, and the index string is touched.
  • the index path corresponding to the control thereby obtaining the hierarchical path corresponding to the touched control.
  • the first preset identifier and the second preset identifier may be “/”, “_”, “#”, “@” or “*”, etc., respectively.
  • the view names of the view paths correspond to views of different levels, so the view path can distinguish the views of different levels.
  • the view path corresponding to the control UIButton 1 in the above example is /UIwindow/ViewController/UIView/UIButton
  • the UIwindow is the highest level view
  • the ViewController is the next level view of the UIwindow
  • the UIView is the next level view of the ViewController.
  • the UIButton is the next level view of the UIView.
  • Multiple views can inherit from the same view, that is, multiple views corresponding to the upper level view can be the same view, such as the control UIButton 0 , the control UIButton 1 and the control UIButton 2 can inherit from the same control UIView.
  • the index path can reflect the display hierarchy relationship of a view in the corresponding upper level view, that is, different views of the same level can be distinguished. For example, suppose the index path corresponding to the control UIButton 1 in the above example is 0_1_2_1, indicating that the UIwindow is the highest level view, the view controller ViewController is the second child view of the upper level view UIwindow, and the control UIView is the upper level view ViewController. In the third subview, the control UIButton is the second child view of the upper level view UIView.
  • the view path can distinguish different levels of views, and the index path can distinguish different views of the same level, so that the combination of the view path and the index path can complete the unique positioning of the control.
  • the step of reporting the touch event corresponding to the touch control to the server further includes: when the touched control is buried When the view path or the index path of the point control is successfully matched, the icons corresponding to the touched control and the buried point control are respectively obtained; the icon corresponding to the touched control and the icon corresponding to the buried point control are compressed to the same size, so that the compressed
  • the plurality of icons have the same number of pixels; the pixel matrix corresponding to the corresponding icon is generated by using the pixel values of the plurality of pixels in each icon; and the pixel matrix corresponding to the icon corresponding to the embedded control according to the pixel matrix of the icon corresponding to the touched control And calculating a similarity between the corresponding icon of the touched control and the icon corresponding to the embedded control; when the similarity reaches the threshold, the touch event corresponding to the touch control is reported to the server.
  • the third terminal uses the SDK to reassign the view index to multiple views of the current application page.
  • the view index is established by numbering, in order to ensure the continuity of the number, the SDK renumbers multiple views of the current application page.
  • the button control UIButton 1 is deleted, the button control UIButton 2 becomes the button control UIButton 1 , and The button control UIButton 2 could not be found.
  • the third terminal matches the button control UIButton 2 as the original button control UIButton 1 with the buried control. In other words, the third terminal actually obtains the hierarchical path of the original button control UIButton 1. If the third terminal also caches the information of the corresponding hierarchical path sent by the server, the touched button control UIButton 2 will also match successfully. However, the matching result at this time should be invalid.
  • the hash value of the icon corresponding to the touched control is matched.
  • the third terminal uses the SDK to obtain the hash value of the icon corresponding to the touched control.
  • the hash value of the icon corresponding to the embedded control that is successfully matched with the touched-level hierarchical path is obtained, and the hash value of the icon corresponding to the touched control is matched with the hash value of the icon corresponding to the buried control.
  • the hash value of the corresponding icon of the touched control When the hash value of the corresponding icon of the touched control is successfully matched with the hash value of the icon corresponding to the embedded control, it indicates that the matching of the hierarchical path is a valid match, and the touch event can be reported. After matching the hierarchical path of the touched control, matching the hash value of the icon corresponding to the touched control can improve the matching accuracy.
  • the third terminal used by the user and the first terminal used by the application developer to set the buried point are terminals of different sizes, the icon size corresponding to the same control on the current application page is different, so that the hash value corresponding to the icon is different. .
  • the third terminal may treat the touched control as a control that is not set to be buried because there is no buried control having the same hash value as the icon corresponding to the touched control. And the touch event corresponding to the touched control is not reported, so that the touch event is missed. Therefore, when the hash value matching of the icon corresponding to the touch control fails, it is not determined that the touched control is not set to be buried, possibly because the corresponding icon of the touched control is different from the size of the icon corresponding to the embedded control.
  • the third terminal acquires an icon corresponding to the touched control by using the SDK, acquires an icon corresponding to the plurality of buried control, and compresses the icon corresponding to the touched control and the icon corresponding to the embedded control to the same size, so that the compressed Multiple icons have the same number of pixels, such as 32*32 PPI (pixels per inch).
  • the SDK uses the pixel values of multiple pixels in each icon as matrix elements to generate a pixel matrix corresponding to the corresponding icon.
  • the pixel value of each corresponding pixel includes the R value corresponding to the three color channels of red (R), green (G), and blue (B), and the G value and B value.
  • the third terminal uses the SDK to obtain a pixel matrix of a plurality of icons corresponding to the buried point control according to the above manner, and calculates a corresponding icon of the touched control and is buried according to the pixel matrix of the corresponding icon of the touched control and the pixel matrix of the icon corresponding to the embedded control.
  • the point control corresponds to the similarity of the icons.
  • the SDK reports the touch event corresponding to the touch control to the server.
  • the hash value of the corresponding icon of the touch control fails to match, the similarity between the icon corresponding to the touched control and the icon corresponding to the embedded control is matched, and the touched control may be a buried control. Further judgment can reduce the situation in which the touch event is missed, and can further improve the matching precision of the control.
  • the similarity between the corresponding icon of the touched control and the corresponding icon of the embedded control is calculated.
  • the step of degree includes: calculating a gray value corresponding to each pixel point according to the pixel value of the plurality of pixel points in the icon; generating a gray matrix corresponding to the corresponding icon by using the gray value of the plurality of pixel points in each icon Calculating the gray mean value corresponding to the icon according to the gray value of the plurality of pixels in the icon; replacing the plurality of gray values in the corresponding gray matrix according to the gray mean value, and obtaining the target matrix corresponding to the corresponding icon;
  • the target matrix of the corresponding icon of the touch control and the target matrix of the icon corresponding to the buried point control are subjected to a preset logical operation to obtain a similarity matrix; and according to the similarity matrix, the similarity between the corresponding icon of the touched control and the icon
  • the third terminal uses the SDK to calculate the gray value corresponding to the corresponding pixel point according to the pixel value of each pixel in the icon, and uses the gray value of the plurality of pixel points in the icon as a matrix element to generate a gray matrix corresponding to the corresponding icon.
  • the gray value corresponding to each pixel point may be an average value of the pixel values of the pixel point, that is, an R value corresponding to the three color channels, an average value of the G value and the B value, thereby converting the pixel matrix corresponding to the icon into gray.
  • the degree matrix which converts the matrix corresponding to the color icon into a matrix corresponding to the black and white icon, can reduce the calculation amount of the third terminal.
  • the SDK performs DCT transform (Discrete Cosine Transform) on the converted gray matrix, and transforms the gray matrix from the time domain to the frequency domain. It is easy to understand that the frequency is negatively correlated with the image signal intensity corresponding to the icon, and the image signal intensity can be kept at the low frequency portion by the DCT transform, and the high frequency portion can be filtered out, thereby enhancing the image signal intensity.
  • DCT transform Discrete Cosine Transform
  • the SDK calculates the gray mean value corresponding to the icon according to the gray value of the plurality of pixels in the icon.
  • the grayscale mean value is an average value of grayscale values corresponding to all pixel points in the gray matrix corresponding to the icon.
  • the SDK replaces the plurality of gray values in the corresponding gray matrix according to the gray mean value, and obtains the target matrix corresponding to the corresponding icon. Specifically, the SDK traverses each matrix element in the gray matrix, and if the gray value corresponding to the matrix element is greater than or equal to the gray mean value, the gray value corresponding to the matrix element is set to the first target value; otherwise, the gray value is The value is set to the second target value, thereby obtaining the target matrix corresponding to the icon.
  • the SDK performs a preset logical operation on the target matrix of the icon corresponding to the touched control and the target matrix of the icon corresponding to the embedded control to obtain a similarity matrix.
  • Preset logic operations include XOR operations.
  • the SDK performs an exclusive OR operation on the target matrix of the icon corresponding to the touched control and each matrix element in the target matrix of the icon corresponding to the embedded control.
  • the target matrix of the icon corresponding to the touched control is In the target matrix corresponding to the icon of the buried point control, the gray level values corresponding to the matrix elements on the same matrix coordinate are the same, and the SDK adds the first similar value as the matrix element on the same matrix coordinate to the similarity matrix; otherwise, the first The two similar values are added to the similarity matrix as matrix elements on the same matrix coordinates.
  • the SDK traverses the similarity matrix, calculates the number of first similar values in the similarity matrix, calculates the similarity of the two icons according to the number of the first similar values in the similarity matrix, and when the similarity reaches the threshold, the touched control The corresponding touch event is reported to the server.
  • the SDK when the gray value corresponding to the matrix element in the gray matrix is greater than or equal to the gray mean value, the SDK sets the gray value corresponding to the matrix element to 1; otherwise, the matrix element corresponds to The gray value is set to 0, and the obtained 01 matrix is used as the target matrix corresponding to the icon.
  • the SDK performs an exclusive-OR calculation on the 01 matrix of the corresponding icon of the touched control and the 01 matrix of the icon corresponding to the embedded control, and uses the obtained 01 matrix as the similarity matrix corresponding to the two icons.
  • the SDK traverses the similarity matrix and calculates the number of 1s in the similarity matrix. When the number of 1s in the similarity matrix reaches the threshold, the touch event corresponding to the touch control is reported to the server.
  • the threshold can be set freely, such as 9.
  • the step of reporting the touch event corresponding to the touch control to the server includes: acquiring a plurality of server identifiers and corresponding resource occupancy parameters; screening the plurality of server identifiers according to the resource occupancy parameters to obtain the least resource occupation The server identifier reports the touch event to the corresponding server.
  • a control matching method is provided, which is applied to the server as an example, and specifically includes the following steps:
  • Step 304 Receive a burying operation corresponding to the control, and acquire a view path corresponding to the immersed control according to the attribute information.
  • Step 306 According to the tier information, assign a corresponding view index to the view in the current page, and splicing the view index corresponding to the highest level view to the view index corresponding to the immersed control to obtain an index string, and using the index string as the index string.
  • the index path of the buried control According to the tier information, assign a corresponding view index to the view in the current page, and splicing the view index corresponding to the highest level view to the view index corresponding to the immersed control to obtain an index string, and using the index string as the index string.
  • the server sequentially splices the view name of the plurality of views of the highest level view to the view of the buried point control according to the hierarchical information of the buried point control, to obtain a directory string, and uses the directory string as a buried point control.
  • the corresponding view path For example, the view path corresponding to the UIButton of the touched control may be /UIwindow/ViewController/UIView/UIButton.
  • the server numbers multiple views according to the hierarchical information of multiple views, and uses the number as the view index of the corresponding view. View indexes include control indexes and controller indexes.
  • the server sequentially splices the highest hierarchical view to the view index of the plurality of views of the buried control according to the hierarchical information of the buried control to obtain an index string, and uses the index string as a buried point control.
  • the corresponding view path For example, the index path corresponding to the UIButton of the touched control may be 0_1_2_1.
  • Step 308 Send the view path and the index path of the buried control to the terminal, so that when the terminal intercepts the touch event corresponding to the touched control, the terminal controls the touched control and the buried control according to the view path and the index path. Matches and reports the touch event corresponding to the touch control when the match is successful.
  • the server sends the view path and the index path of the plurality of buried control to the third terminal.
  • the third terminal intercepts the touch event corresponding to the touched control by using the SDK, and touches the touched control and the buried point according to the view path and the index path.
  • the control matches and the touch event corresponding to the touch control is reported to the server when the matching is successful.
  • the attribute information further includes: a view identifier; a step of generating a view path and an index path corresponding to the embedded control, including: acquiring a screenshot of the current application page; and using the plurality of view identifiers according to the preset rule Array elements are added to multiple arrays; multiple arrays have different levels; query the view name corresponding to the view ID in the highest level array, mark the view name corresponding to the view ID in the highest level array as the parent node; query the next highest level array
  • the view identifier in the view identifies the view name corresponding to the view identifier in the next highest level array as the child node of the parent node according to the hierarchical information; and the child node as the view name corresponding to the view identifier in the next level array
  • the parent node is iterated until the lowest level array, and the multi-fork tree of the application page is obtained; the hierarchical path corresponding to the multiple views is generated according to the multi-fork tree, and the corresponding buried border is
  • the preset terminal send a screenshot of the page with the buried border to the preset end
  • the preset terminal displays the screenshot of the page with the buried border and obtains the buried operation of the corresponding control of the buried border; receives the buried point information of the embedded control returned by the preset terminal, and generates the information according to the multi-fork tree The hierarchical path of the buried control.
  • View data includes screenshots of the current application page and attribute information for multiple views.
  • the screenshot of the page is a static screenshot.
  • Views include controls and view controllers.
  • the attribute information includes a view name, a view identifier, and hierarchical information.
  • the server builds a multi-fork tree corresponding to the current application page according to the attribute information of the view, and generates a hierarchical path of the buried control according to the multi-fork tree.
  • the server establishes the highest level array, extracts the view identifier corresponding to the view with the same view name as the preset root view in the view data, and adds the extracted view identifier to the highest level array.
  • the highest level array can be A1[ID 6].
  • the server marks the extracted view as a parent view, and traverses the view data according to the hierarchical information of the parent view to detect whether the child view corresponding to the parent view exists.
  • the child view corresponding to the parent view refers to the next level view of the parent view.
  • the server establishes a second-level array, extracts the view identifier of the child view corresponding to the parent view in the view data, and adds the extracted view identifier to the next-highest level array.
  • the next highest level array can be A2[ID 2, ID 7, ID 8].
  • the server uses the extracted subview as the parent view and queries the view data for the corresponding subview.
  • the server creates the next level array as described above. This loops until the corresponding subview does not exist in the view data, resulting in the lowest level array.
  • the next level array can be A3[ID 1, ID 4, ID5], and the lowest level array can be A4[ID3, ID 9, ID10, ID 11, ID 12].
  • the server After generating the highest level array, the server queries the view name corresponding to the array element of the highest level array, and marks the view name corresponding to the array element of the highest level array as the root node of the multi-fork tree.
  • the root node of the multi-fork tree is the view name UIWindow corresponding to the array element ID 6 of the highest-level array A1.
  • the server After obtaining the root node of the multi-fork tree, the server generates the next-highest level array in the above manner, queries the view name corresponding to the array element of the next-highest level array, and marks the view name corresponding to the array element of the next-highest level array as a multi-fork tree.
  • the child node of the middle root node connects the child node to the root node by using a preset connection line to form a plurality of branches of the multi-fork tree.
  • the root node is also the parent node of the above child nodes.
  • the preset connection line may be a line segment with an arrow
  • the child node of the root node is a view name UIView (view) corresponding to three array elements ID2, ID7, and ID8 of the next highest level array A2.
  • ViewController view controller
  • UIView corresponding to the three branches forming a multi-fork tree.
  • the server After obtaining the child node of the root node of the multi-fork tree, the server generates the next-level array according to the above manner, and uses the child node as the parent node of the array element in the next-level array, and queries the view corresponding to the array element of the next-level array. Name, using the default connection line to the array element in the next level array The view name corresponding to the prime is connected to the corresponding parent node to extend the branches of the multi-tree. In other words, the server queries the next level view of the corresponding view of each child node according to the hierarchical information of the corresponding view of each child node, and connects the view name corresponding to the corresponding array element in the next level array to the corresponding one by using a preset connection line.
  • Child node For example, as shown in FIG. 4, it is assumed that the array element ID2 of the next highest level array A2 does not have a lower level view corresponding to the view, and the next level view of the array element ID7 corresponding to the view includes the view corresponding to the array element ID1, and the array element ID1 is The view name UIView of the corresponding view is connected to the view name ViewController of the view corresponding to the array element ID7.
  • the server sequentially adds the view name of the corresponding view of the array element in each array as a node to the multi-fork tree in the above manner, and forms a multi-fork tree corresponding to the current application page.
  • the server integrates the attribute information of the multiple views in the current application page according to the view data without the hierarchical structure, and extracts a multi-fork tree that can reflect the hierarchical structure between the multiple views of the current page as a whole.
  • the server numbers each node of the multi-fork tree so that the view corresponding to each node has a view index. Specifically, the server separately numbers the views corresponding to different hierarchical nodes in the multi-fork tree, and uses the number as the view index of the corresponding view.
  • the server can record the view index as a subscript of the view name of the corresponding view. For example, as shown in FIG. 4, the view indexes corresponding to the three button type views may be UIButton 0 (button 0 ), UIButton 1 (button 1 ), and UIButton 2 (button 2 ).
  • the server uses the second preset identifier to splicing the view indexes corresponding to the plurality of nodes in the multi-fork tree to the target node in sequence, and obtains an index string, and uses the index string as an index path of the corresponding node of the target node.
  • View paths and index paths allow for accurate positioning of each touchable view.
  • the server adds a corresponding buried border to the touchable view according to the positioning. Buried border can respond Click action by the application developer. As shown in FIG. 5, the shape and size of the buried border may be the same as the shape and size of the icon of the corresponding view.
  • the server sends a screenshot of the page with the buried border to the preset terminal, that is, the second terminal.
  • the second terminal displays a screenshot of the page with the buried border.
  • the application developer can implement the burying point setting by clicking the burying border on the screenshot of the second terminal and inputting the corresponding touch event identifier.
  • the server generates the hierarchical path corresponding to the embedded control according to the foregoing manner, and sends the hierarchical path of the buried control to the third terminal, so that the third terminal is touched according to the hierarchical path when intercepting the touch event corresponding to the touched control.
  • the control matches the buried control.
  • the multi-fork tree constructed according to the hierarchical information of the view can reflect the hierarchical structure of the multiple views of the current page as a whole, thereby performing the view path and the index path generated by the multi-fork tree. Accurate positioning.
  • the view includes a control; the attribute information further includes a basic attribute and an access attribute; and the step of generating a hierarchical path corresponding to the plurality of views according to the multi-fork tree, comprising: identifying, according to the basic attribute, whether the control is a touchable control; When the control is not a touchable control, it is recognized whether the control name is a collection element in the target collection and whether the access attribute has a preset attribute value; when the control name is a collection element in the target collection, and the access attribute has a preset attribute value Mark the control as a touchable control; generate a hierarchical path corresponding to each of the plurality of touchable controls according to the multi-fork tree.
  • the attribute information sent by the first terminal to the server includes the basic attributes of the view.
  • Basic properties include transparent properties, hidden properties, and interactive properties.
  • Interaction properties include the userInteractionEnabled (an attribute name) property.
  • the server stores a preset collection.
  • the preset collection records the control names of multiple controls that can be touched, such as UIControl, UITableViewCell, UICollectionViewCell, UIView, and the control names of the corresponding subclass controls.
  • the server identifies whether the control's control name belongs to a collection element in the preset collection. When it belongs, the server obtains the attribute values of the transparent attribute, the hidden attribute and the interactive attribute of the control, and identifies whether the three attribute values are respectively the respective preset attribute values.
  • the server marks the control as a touchable control.
  • Cross-platform pages exist in Web APP or hybrid APP, such as H5 (HTML5, Hypertext Markup Language) pages.
  • the control names of controls in cross-platform pages do not belong to the collection elements in the preset collection.
  • the server identifies whether the control's control name belongs to a collection element in the target collection.
  • the target collection also records the control names of multiple controls that can be touched, such as the control name of RCTView (a control name) and its subclass controls. When it does not belong to a collection element in the target collection, it means that the control cannot be touched.
  • the attribute information acquired by the first terminal by using the SDK further includes an access attribute.
  • Access properties include the isAccessibilityElement (an attribute name) property.
  • the server obtains the attribute value of the access attribute, and determines whether the attribute value is a preset attribute value.
  • the server marks the control as a touchable control.
  • a hierarchical path corresponding to each of the plurality of touchable controls is generated according to the multi-fork tree.
  • the touchable control in the current application page can be identified according to the basic attribute; when the application is a Web APP or a hybrid APP, the current application can be compared according to the access attribute.
  • the touchable control in the program page is recognized, so that the touchable control recognition method can be universal for various types of applications, and the recognition precision of the touchable control can be improved.
  • the step of assigning a corresponding view index to the control in the current page according to the level information includes: separately numbering the controls of different levels according to the level information; separately marking different types of views of the same level separately The number is used as the control index corresponding to the control; the method further includes: when adding or deleting the view on the current application page, re-numbering the view of the same type as the newly added or deleted view, and using the number as the control corresponding to the control index.
  • Different types of views of the same level are separately numbered, which can minimize the impact of adding or deleting views on the control index, and has a certain index path anti-interference effect.
  • a computer device is provided, as shown in FIG. 7, which includes a processor, a storage device, and a network interface connected by a system bus.
  • the processor of the computer device is used to provide computing and control capabilities.
  • the storage device of the computer device includes one or more non-volatile storage media, one or more internal memories.
  • the server's non-volatile storage medium stores operating system and computer readable instructions.
  • the internal memory of the computer device provides an environment for the operation of an operating system and computer readable instructions in a non-volatile storage medium.
  • the network interface of the computer device is configured to communicate with an external terminal through a network connection, for example, receiving a screenshot of a current application page sent by the first terminal, and attribute information of multiple views.
  • the computer readable instructions are executed by the processor to implement a control matching method.
  • the computer readable instructions when executed, may include the flow of an embodiment of the methods as described above.
  • the storage medium may be a magnetic disk, an optical disk, a read only memory (ReCd-Only Memory, ROM), or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Environmental & Geological Engineering (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

一种控件匹配方法,包括:获取当前应用程序页面中发生的触摸事件,对触摸事件进行拦截;触摸事件与应用程序的被触摸控件相对应;获取被触摸控件的视图路径和索引路径;获取服务器发送的多个被埋点控件的视图路径和索引路径;将被触摸控件的视图路径与被埋点控件的视图路径进行匹配,将被触摸控件的索引路径与被埋点控件的索引路径进行匹配;当视图路径和索引路径分别匹配成功时,将被触摸控件对应的触摸事件上报至服务器。

Description

控件匹配方法、装置、计算机设备和存储介质
本申请要求于2017年11月1日提交中国专利局,申请号为2017110589618,申请名称为“控件匹配方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,特别是涉及控件匹配方法、装置、计算机设备和存储介质。
背景技术
在APP(Application,应用程序)中设置埋点是很多APP开发商收集用户行为数据的重要手段。目前,在APP中设置埋点的方案有多种,如代码埋点、可视化埋点和无埋点等。其中,可视化埋点和无埋点的方案可以通过终端将APP页面控件信息上传至Web服务器,Web服务器获取相关人员对控件的埋点信息,并将埋点信息下发至终端,以使终端在APP页面中某个控件被触摸时,根据埋点信息对被触摸的控件与设置埋点的控件进行匹配,进而判断是否需要将该控件的触摸事件上报至服务器。
在传统方式中,终端根据位置坐标对被触摸的控件进行匹配。但这种方式仅适用于与设置埋点时使用的终端尺寸相同的终端。在其他尺寸终端上,即使被触摸的是相同的控件,但由于终端尺寸的差异,控件位置坐标不同,使得对于其他尺寸终端上的控件无法准确匹配,从而难以对控件的触摸事件进行准确上报。
发明内容
根据本申请公开的各种实施例,提供一种控件匹配方法、装置、计算机 设备和存储介质。
一种控件匹配方法,包括:获取当前应用程序页面中发生的触摸事件,对所述触摸事件进行拦截;所述触摸事件与所述应用程序的被触摸控件相对应;获取被触摸控件的视图路径和索引路径;获取服务器发送的多个被埋点控件的视图路径和索引路径;将所述被触摸控件的视图路径与被埋点控件的视图路径进行匹配,将所述被触摸控件的索引路径与被埋点控件的索引路径进行匹配;及当所述视图路径和索引路径分别匹配成功时,将所述被触摸控件对应的触摸事件上报至服务器。
一种控件匹配装置,包括:拦截模块,用于获取当前应用程序页面中发生的触摸事件,对所述触摸事件进行拦截;所述触摸事件与所述应用程序的被触摸控件相对应;路径获取模块,用于获取被触摸控件的视图路径和索引路径,及获取服务器发送的多个被埋点控件的视图路径和索引路径;路径匹配模块,用于将所述被触摸控件的视图路径与被埋点控件的视图路径进行匹配,将所述被触摸控件的索引路径与被埋点控件的索引路径进行匹配;及上报模块,用于当所述视图路径和索引路径分别匹配成功时,将所述被触摸控件对应的触摸事件上报至服务器。
一种计算机设备,包括存储器和一个或多个处理器,存储器中存储有计算机可读指令,计算机可读指令被处理器执行时实现本申请任意一个实施例中提供的控件匹配方法的步骤。
一个或多个存储有计算机可读指令的非易失性存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器实现本申请任意一个实施例中提供的控件匹配方法的步骤。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需 要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为一个实施例中控件匹配方法的应用场景图;
图2为一个实施例中控件匹配方法的流程图;
图3为另一个实施例中控件匹配方法的流程图;
图4为一个实施例中当前应用程序页面对应的多叉树的示意图;
图5为一个实施例中在页面截图中添加埋点边框的示意图;
图6为一个实施例中控件匹配装置的结构图;
图7为一个实施例中计算机设备的框图。
具体实施方式
为了使本申请的技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
可以理解,本申请所使用的术语“第一”、“第二”等可在本文中用于描述各种元件,但这些元件不受这些术语限制。这些术语仅用于将第一个元件与另一个元件区分。举例来说,在不脱离本申请的范围的情况下,可以将第一客户端称为第二客户端,且类似地,可将第二客户端称为第一客户端。第一客户端和第二客户端两者都是客户端,但其不是同一客户端。
本申请提供一种控件匹配方法,可以应用于如图1所示的应用环境中。其中,第一终端102、第二终端104与第三终端106分别通过网路与服务器108连接。第一终端102、第二终端104和第三终端106分别可以是智能手机、平板电脑、台式计算机、车载电脑中的至少一种,但并不局限于此。服务器108可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群。第一终端102与第三终端106上分别运行了需要设置埋点的应用程序。第一终端102对应应用程序开发商,第三终端106对应应用程序用户。第一终端 102与第三终端106可以是同一终端,也可以是不同终端。上述应用程序可以是原生应用程序(Native APP),也可以是网络应用程序(Web APP),还可以是混合应用程序。第一终端102和第三终端106在应用程序中分别安装了插件SDK(Software Development Kit,软件开发工具包)。SDK是基于开源的UI(User Interface,用户界面)跨平台框架预先开发生成的脚本。UI跨平台框架可以是React Native框架或Weex框架等。SDK包括数据采集脚本、触摸事件拦截脚本、控件匹配脚本和触摸事件上报脚本等,用于数据采集、触摸事件拦截、控件匹配和触摸事件上报等。
当需要对应用程序设置埋点时,第一终端102利用SDK获取当前应用程序页面显示的视图数据,将视图数据发送至服务器108。视图数据包括当前页面的页面截图及多个视图的属性信息。服务器108根据属性信息对页面截图进行还原,将还原后的页面截图发送至第二终端104。第二终端通过Web页面展示还原后的页面截图,获取应用程序开发商对页面截图中多个控件的埋点操作,将被埋点的控件(以下称“被埋点控件”)对应的埋点信息返回至服务器108。服务器108根据属性信息生成多个被埋点控件分别对应的视图路径和索引路径,将被埋点控件的埋点信息、视图路径和索引路径发送至第三终端106。当用户对当前应用程序页面的某个控件进行触摸操作时,第三终端106利用SDK获取当前应用程序页面中被触摸控件对应的触摸事件,对触摸事件进行拦截,获取被触摸控件的视图路径和索引路径,将被触摸控件的视图路径与被埋点控件的视图路径进行匹配,将被触摸控件的索引路径与被埋点控件的索引路径进行匹配。若分别匹配成功,则第三终端106将触摸事件上报至服务器108。视图路径对不同层级的控件进行区分,索引路径对同一层级多个不同控件进行区分,结合视图路径和索引路径可以对控件进行准确定位,从而可以提高控件匹配精度。
图2为本申请一个实施例的方法的流程示意图。应该理解的是,虽然图2的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执 行并没有严格的顺序限制,其可以以其他的顺序执行。而且,图2中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,其执行顺序也不必然是依次进行,而是可以与其他步骤或者其他步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
在一个实施例中,如图2所示,提供了一种控件匹配方法,以该方法应用于第三终端为例进行说明,具体包括以下步骤:
步骤202,获取当前应用程序页面中发生的触摸事件,对触摸事件进行拦截;触摸事件与应用程序的被触摸控件相对应。
当用户通过第三终端对当前应用程序页面的某个控件进行触摸操作时,第三终端获取当前应用程序页面中被触摸的控件(以下称“被触摸控件”)对应的触摸事件,利用SDK对触摸事件进行拦截。当服务器将被埋点控件的埋点信息、视图路径和索引路径发送至第三终端时,第三终端利用SDK对被埋点控件的埋点信息、视图路径和索引路径进行缓存。
步骤204,获取被触摸控件的视图路径和索引路径。
第三终端还利用SDK采集并缓存了当前应用程序页面多个视图的属性信息。视图包括控件和视图控制器。用户可以对可见的控件进行触摸操作。触摸操作包括点击、长按、短按或滑动等。视图控制器用于创建和管理控件,对用户是不可见的。视图控制器虽对用户虽是不可见的,但是构建控件的视图路径和索引路径所必须的。属性信息包括视图名称和视图索引。视图名称可以是控件名称或控制器名称,视图索引可以是视图控件索引或控制器索引。视图名称可以直接反映视图类型,如UIwindow(一种控件名称)属于窗口类型控件,UIButton属于按钮类型控件,RootViewController属于根视图控制器等。SDK根据当前应用程序页面多个视图之间的层级关系,对不同层级的视图分别进行单独编号,对同一层级的不同类型的视图分别进行单独编号,对同一层级的相同类型视图进行连续编号,将编号作为相应视图对应的视图索引。例如,假设在同一层级的视图中存在三个按钮类型控件,以0作为初始 值进行编号,则三个按钮类型控件对应的控件索引依次可以是0,1和2。SDK可以将视图索引作为对应视图的视图名称的下标进行记录,如UIButton0,UIButton1和UIButton2。属性信息还包括当前应用程序页面多个视图的层级信息。每个视图具有对应的层级信息,层级信息包括该视图与其他一个或多个视图之间的继承关系。例如,控件UIButton继承于控件UIView,则控件UIView为控件UIButton的上一层级视图。
当用户通过第三终端对当前应用程序页面的某个控件进行触摸操作时,SDK读取缓存的被触摸控件的属性信息,根据属性信息得到被触摸控件的层级路径。层级路径包括视图路径和索引路径。具体的,SDK根据被触摸控件的层级信息向上逐级回溯,即识别被触摸控件是否存在上一层级视图。当被触摸控件存在上一层级视图时,提取该上一层级视图的视图名称和视图索引。SDK根据被触摸控件的层级信息继续向上逐级回溯,即识别被触摸控件的上一层级视图是否仍存在对应的上一层级视图,若存在,则提取对应的视图名称和视图索引,直至最高层级视图。
根据被触摸控件的层级信息,SDK利用第一预设标识将提取到的多个视图名称逐级拼接,即将最高层级视图至被触摸控件的多个视图的视图名称依次拼接,得到目录字符串,将该目录字符串作为被触摸控件对应的视图路径。SDK利用第二预设标识将提取到的多个视图索引逐级拼接,即将最高层级视图至被触摸控件的多个视图的视图索引依次拼接,得到索引字符串,将该索引字符串作为被触摸控件对应的索引路径,从而得到被触摸控件对应的层级路径。第一预设标识和第二预设标识分别可以是“/”,“_”,“#”,“@”或“*”等。
例如,假设被触摸控件为上述举例中的控件UIButton1,控件UIButton1对应的视图路径可以是/UIwindow/ViewController/UIView/UIButton,索引路径可以是0_1_2_1。可以理解,层级路径也可以将视图路径与索引路径结合展示。例如,将视图索引作为对应视图的视图名称的下标,利用第一预设标识或第二预设标识按照上述方式将多个带有下标的视图名称进行逐级拼接,得到如下层级路径:/UIwindow0/ViewController1/UIView2/UIButton1
步骤206,获取服务器发送的多个被埋点控件的视图路径和索引路径。
需要说明的是,步骤206可以在步骤204之前执行,也可以与步骤204并列执行。
步骤208,将被触摸控件的视图路径与被埋点控件的视图路径进行匹配,将被触摸控件的索引路径与被埋点控件的索引路径进行匹配。
第三终端利用SDK读取缓存的多个被埋点控件的视图路径和索引路径,将被埋点控件的视图路径和索引路径作为匹配参考对象,将被触摸控件的视图路径和索引路径分别与匹配参考对象进行匹配。
为了提高匹配效率,第三终端根据层级路径中每个视图的视图深度将被触摸控件的层级路径与被埋点控件的层级路径进行匹配。一个视图的视图深度是指该视图的视图名称在其层级路径中相对其他视图名称的顺序。为了描述方便,规定视图路径中第一个视图名称对应第一视图深度,第二个视图名称对应第二视图深度,如此递推。例如,视图路径/UIwindow/ViewController/UIView/UIButton中UIwindow对应第一视图深度,ViewController对应第二视图深度,UIView对应第三视图深度,UIButton对应第四视图深度。最后一个视图名称为被触摸控件的视图名称,对应最后的视图深度。可以理解,第三终端还可以采用其他方式对被触摸控件的层级路径与被埋点控件的层级路径进行匹配,这里不作限制。
SDK根据视图深度将被触摸控件的层级路径与多个被埋点控件的层级路径进行剔除式匹配,逐渐减少被埋点控件作为匹配参考对象的数量,以减少不必要的匹配。具体的,SDK进行第一轮匹配,将被触摸控件层级路径中第一视图深度的视图名称和对应的视图索引分别与多个被埋点控件层级路径中第一视图深度的视图名称和对应的视图索引进行匹配,筛选第一视图深度的视图名称和对应的视图索引分别匹配成功的一个或多个被埋点控件的视图路径。SDK进行第二轮匹配,将被触摸控件层级路径中第二视图深度的视图名称和对应的视图索引分别与筛选出的多个被埋点控件层级路径中第二视图深度的视图名称和对应的视图索引进行匹配,如此经过多轮匹配,直至被触摸 控件的视图名称和视图索引也完成匹配。
例如,假设SDK缓存了以下被埋点控件的层级路径,如被埋点控件A的层级路径为/UIwindow0/RootController1/UIView2/UIButton1,被埋点控件B的层级路径为/UIwindow0/ViewController1/ChildController1/UILabel,被埋点控件C的层级路径为/UIwindow0/ViewController1/UIView2/UIButton1,被埋点控件D的层级路径为/UIwindow0/ViewController1/UIView2/UIButton0,则经过第二轮匹配时将被埋点控件A的层级路径被剔除,经过第三轮匹配时将被埋点控件B的层级路径被剔除,第四轮匹配时只需与被埋点控件C和D的层级路径进行匹配。应当理解的是,本实施例仅示意性的给出有限个匹配参考对象,实际被埋点控件的数量较多,且实际层级路径的视图深度较深,故在实际操作中,上述剔除式匹配方式对匹配效率的提高更为明显。
步骤210,当视图路径和索引路径分别匹配成功时,将被触摸控件对应的触摸事件上报至服务器。
当存在被埋点控件的视图路径与被触摸控件的视图路径相匹配,且该被埋点控件的索引路径与被触摸控件的索引路径相匹配时,表示被触摸控件属于被埋点控件,需要将被触摸控件对应的触摸事件上报至服务器。需要说明的是,接收触摸事件上报信息的服务器与向第三终端下发埋点信息的服务器可以是同一服务器,也可以是不同的服务器。
本实施例中,视图路径可以对不同层级视图对应的控件进行区分,索引路径可以对同一层级视图对应的不同控件进行区分,视图路径和索引路径的结合可以对控件准确定位,从而能够提高控件匹配精度,进而可以对控件的触摸事件进行准确上报。
在一个实施例中,获取被触摸控件的视图路径和索引路径的步骤,包括:查询是否存在被触摸控件对应的匹配成功记录;当不存在对应的匹配成功记录时,获取被触摸控件的属性信息,根据属性信息生成被触摸控件的视图路径和索引路径;该方法还包括:当存在对应的匹配成功记录时,跳转至将被触摸控件对应的触摸事件上报至服务器的步骤。本实施例中,若一个控件已 经进行过匹配且匹配成功,则对该控件的匹配结果进行记录,当该控件再次被触摸时无需重复匹配,使得第三终端对每个控件只需进行一次匹配,可以提高控件匹配效率,也可以节省第三终端服务资源。
在一个实施例中,获取服务器发送的多个被埋点控件的视图路径和索引路径的步骤,包括:向服务器发送可视化埋点请求;接收服务器根据可视化埋点请求返回的配置表,配置表记录了多个配置项;根据配置项对当前应用程序页面进行解析,获取当前页面中多个视图对应的属性信息;将属性信息对应配置项添加至配置表;将配置表发送至服务器,使服务器根据属性信息生成的多个被埋点控件的视图路径和索引路径;接收服务器发送的多个被埋点控件的视图路径和索引路径。本实施例中,应用程序开发商可以根据需求及时在配置表中添加遗漏的配置项,也可以删除不必要的配置项,如数据量较大的控件背景图片,避免第一终端上报一些冗余的数据,可以对上报的视图的属性信息进行一定程度上的优化,也可以减少第一终端获取视图的属性信息以及填写配置表的时间,进而可以提高服务器对视图路径和索引路径的生成效率。
在一个实施例中,获取被触摸控件的视图路径和索引路径的步骤,包括:获取被触摸控件的属性信息;属性信息包括视图名称,视图索引以及层级信息;根据被触摸控件与一个或多个视图的层级信息,利用第一预设标识将最高层级视图的视图名称至被触摸控件的视图名称逐级拼接,得到目录字符串,将目录字符串作为被触摸控件的视图路径;根据被触摸控件与一个或多个视图的层级信息,利用第二预设标识将最高层级视图的视图索引至被触摸控件的视图索引逐级拼接,得到索引字符串,将索引字符串作为被触摸控件的索引路径。
当用户通过第三终端对当前应用程序页面的某个控件进行触摸操作时,第三终端利用SDK获取被触摸控件的属性信息。SDK根据被触摸控件的层级信息向上逐级回溯,即识别被触摸控件是否存在上一层级视图。容易理解,当被触摸控件为当前应用程序页面的最高层级视图时,被触摸控件不存在上 一层级视图。当被触摸控件存在上一层级视图时,提取该上一层级视图的视图名称和视图索引。SDK根据被触摸控件的层级信息继续向上逐级回溯,即识别被触摸控件的上一层级视图是否仍存在对应的上一层级视图,若存在,则提取对应的视图名称和视图索引,直至最高层级视图。
根据被触摸控件的层级信息,SDK利用第一预设标识将提取到的多个视图名称逐级拼接,即将最高层级视图至被触摸控件的多个视图的视图名称依次拼接,得到目录字符串,将该目录字符串作为被触摸控件对应的视图路径。SDK利用第二预设标识将提取到的多个视图索引逐级拼接,即将最高层级视图至被触摸控件的多个视图的视图索引依次拼接,得到索引字符串,将该索引字符串作为被触摸控件对应的索引路径,从而得到被触摸控件对应的层级路径。第一预设标识和第二预设标识分别可以是“/”,“_”,“#”,“@”或“*”等。
组成视图路径的各个视图名称分别对应不同层级的视图,故视图路径可以对不同层级的视图进行区分。例如,假设上述举例中的控件UIButton1对应的视图路径为/UIwindow/ViewController/UIView/UIButton,则表示UIwindow为最高层级视图,ViewController为UIwindow的下一层级视图,UIView为ViewController的下一层级视图,UIButton为UIView的下一层级视图。
多个视图可以继承于同一视图,即多个视图分别对应的上一层级视图可以是同一视图,如控件UIButton0,控件UIButton1和控件UIButton2可以继承于同一控件UIView。索引路径可以反映对一个视图在对应的上一层级视图中的显示层级关系,即可以对同一层级的不同视图进行区分。例如,假设上述举例中的控件UIButton1对应的索引路径为0_1_2_1,则表示UIwindow为最高层级视图,视图控制器ViewController为上一层级视图UIwindow的第2个子视图,控件UIView为上一层级视图ViewController的第3个子视图,控件UIButton为上一层级视图UIView的第2个子视图。
本实施例中,视图路径可以对不同层级的视图进行区分,索引路径可以对同一层级的不同视图进行区分,从而视图路径和索引路径的结合可以共同完成控件唯一性定位。
在一个实施例中,当被触摸控件与被埋点控件的视图路径和索引路径分别匹配成功时,将被触摸控件对应的触摸事件上报至服务器的步骤,还包括:当被触摸控件与被埋点控件的视图路径或索引路径匹配成功时,获取被触摸控件以及被埋点控件分别对应的图标;将被触摸控件对应的图标和被埋点控件对应的图标压缩至相同尺寸,使压缩后的多个图标具有相同数量的像素点;利用每个图标中多个像素点的像素值生成得到相应图标对应的像素矩阵;根据被触摸控件对应图标的像素矩阵与被埋点控件对应图标的像素矩阵,计算被触摸控件对应图标和被埋点控件对应图标的相似度;当相似度达到阈值时,将被触摸控件对应的触摸事件上报至服务器。
在当前应用程序页面某个控件被删除时,第三终端利用SDK对当前应用程序页面多个视图重新分配视图索引。当以编号的方式建立视图索引时,为了保证编号的连续性,SDK对当前应用程序页面多个视图重新编号,如将按钮控件UIButton1删除后,按钮控件UIButton2变为按钮控件UIButton1,而找不到按钮控件UIButton2。当用户点击按钮控件UIButton2时,第三终端将按钮控件UIButton2当作原按钮控件UIButton1与被埋点控件进行匹配。换句话说,第三终端实际获取的是原按钮控件UIButton1的层级路径,若第三终端也缓存了服务器下发的对应层级路径的信息,则被触摸的按钮控件UIButton2也会匹配成功,但此时的匹配结果应当是无效的。
为了防止上述无效匹配,在对层级路径进行匹配后,对被触摸控件对应图标的哈希值进行匹配。具体的,当被触摸控件与被埋点控件的视图路径和索引路径分别匹配成功,且被触摸控件属于预设类型的控件时,第三终端利用SDK获取被触摸控件对应图标的哈希值,获取与被触摸控件层级路径匹配成功的被埋点控件对应图标的哈希值,将被触摸控件对应图标的哈希值与该被埋点控件对应图标的哈希值进行匹配。当被触摸控件对应图标的哈希值与被埋点控件对应图标的哈希值匹配成功时,表示对层级路径的匹配为有效匹配,可以对触摸事件进行上报。在对被触摸控件的层级路径进行匹配后,对被触摸控件对应图标的哈希值进行匹配,可以提高匹配准确度。
当用户使用的第三终端与应用程序开发商设置埋点时使用的第一终端为不同尺寸的终端时,当前应用程序页面上同一控件对应的图标尺寸不同,使得图标对应的哈希值也不同。即使被触摸控件实际属于被埋点控件,第三终端也可能因不存在与该被触摸控件对应图标具有相同哈希值的被埋点控件,将被触摸控件视作未被设置埋点的控件,进而对该被触摸控件对应的触摸事件不予上报,使得触摸事件被漏报。因而,当被触摸控件对应图标的哈希值匹配失败时,尚不能确定该被触摸控件未被设置埋点,有可能是因为被触摸控件对应图标与被埋点控件对应图标的尺寸不同导致。
为了克服上述触摸事件漏报的问题,当被触摸控件对应图标的哈希值匹配失败时,对被触摸控件对应图标的与被埋点控件对应图标的相似度进行匹配。具体的,第三终端利用SDK获取被触摸控件对应的图标,获取多个被埋点控件对应的图标,将被触摸控件对应的图标和被埋点控件对应的图标压缩至相同尺寸,使压缩后的多个图标具有相同数量的像素点,如32*32PPI(pixels per inch,像素每英寸)。SDK将每个图标中多个像素点的像素值作为矩阵元素,生成相应图标对应的像素矩阵。对于RGB颜色模式(一种颜色标准)的图标,对应的每个像素点的像素值包括红(R)、绿(G)、蓝(B)三个颜色通道分别对应的R值,G值和B值。
第三终端利用SDK按照上述方式得到多个被埋点控件对应图标的像素矩阵,根据被触摸控件对应图标的像素矩阵与被埋点控件对应图标的像素矩阵,计算被触摸控件对应图标和被埋点控件对应图标的相似度。当相似度达到阈值时,SDK将被触摸控件对应的触摸事件上报至服务器。
本实施例中,当被触摸控件对应图标的哈希值匹配失败时,对被触摸控件对应图标与被埋点控件对应图标的相似度进行匹配,可以对被触摸控件是否属于被埋点控件作进一步的判断,可以减少触摸事件被漏报的情况,也可以进一步提高控件匹配精度。
在一个实施例中,根据被触摸控件对应图标的像素矩阵与被埋点控件对应图标的像素矩阵,计算被触摸控件对应图标和被埋点控件对应图标的相似 度的步骤,包括:根据图标中多个像素点的像素值,计算每个像素点对应的灰度值;利用每个图标中多个像素点的灰度值生成得到相应图标对应的灰度矩阵;根据图标中多个像素点的灰度值,计算图标对应的灰度均值;根据灰度均值对相应灰度矩阵中的多个灰度值进行替换,得到相应图标对应的目标矩阵;对被触摸控件对应图标的目标矩阵与被埋点控件对应图标的目标矩阵进行预设逻辑运算,得到相似度矩阵;根据相似度矩阵,计算被触摸控件对应图标和被埋点控件对应图标的相似度。
第三终端利用SDK根据图标中每个像素点的像素值计算相应像素点对应的灰度值,将该图标中多个像素点的灰度值作为矩阵元素,生成相应图标对应的灰度矩阵。每个像素点对应的灰度值可以是该像素点的像素值的平均值,即三个颜色通道对应的R值,G值和B值的平均值,从而将图标对应的像素矩阵转换为灰度矩阵,即将彩色图标对应的矩阵转换为黑白图标对应的矩阵,可以减少第三终端计算量。在其中一个实施例中,SDK对转换得到的灰度矩阵进行DCT变换(Discrete Cosine Transform,离散余弦变换),将灰度矩阵从时域变换至频域。容易理解,频率与图标对应的图像信号强度负相关,通过DCT变换可以将图像信号强度保持在低频部分,过滤掉高频部分,从而可以加强图像信号强度。
SDK根据图标中多个像素点的灰度值计算该图标对应的灰度均值。灰度均值为图标对应的灰度矩阵中全部像素点对应灰度值的平均值。SDK根据灰度均值对对应灰度矩阵中的多个灰度值进行替换,得到相应图标对应的目标矩阵。具体的,SDK遍历灰度矩阵中每一个矩阵元素,若矩阵元素对应的灰度值大于或等于灰度均值,将该矩阵元素对应的灰度值置为第一目标值;否则,将灰度值置为第二目标值,从而得到图标对应的目标矩阵。
SDK对被触摸控件对应图标的目标矩阵与被埋点控件对应图标的目标矩阵进行预设逻辑运算,得到相似度矩阵。预设逻辑运算包括异或运算。具体的,SDK对被触摸控件对应图标的目标矩阵与被埋点控件对应图标的目标矩阵中每个矩阵元素进行异或运算。若在被触摸控件对应图标的目标矩阵和被 埋点控件对应图标的目标矩阵中,同一矩阵坐标上的矩阵元素对应的灰度值相同,则SDK将第一相似值作为相同矩阵坐标上的矩阵元素添加至相似度矩阵中;否则,将第二相似值作为相同矩阵坐标上的矩阵元素添加至相似度矩阵中。SDK对相似度矩阵进行遍历,计算相似度矩阵中第一相似值的数量,根据相似度矩阵中第一相似值的数量计算两个图标的相似度,当相似度达到阈值时,将被触摸控件对应的触摸事件上报至服务器。
在一个具体的实施例中,当灰度矩阵中矩阵元素对应的灰度值大于或等于灰度均值时,SDK将该矩阵元素对应的灰度值置为1;否则,将该矩阵元素对应的灰度值置为0,将得到的01矩阵作为图标对应的目标矩阵。SDK对被触摸控件对应图标的01矩阵与被埋点控件对应图标的01矩阵进行异或计算,将得到的01矩阵作为两个图标对应的相似度矩阵。SDK对相似度矩阵进行遍历,计算相似度矩阵中1的数量,当相似度矩阵中1的数量达到阈值时,将被触摸控件对应的触摸事件上报至服务器。阈值可以自由设置,如9。
本实施例中,不仅可以减少触摸事件被漏报的情况,进一步提高控件匹配精度,由于被触摸控件对应图标与被埋点控件对应图标的相似度仅需简单异或运算和有限次遍历即可计算得到,计算量小,从而还可以提高匹配效率。
在一个实施例中,将被触摸控件对应的触摸事件上报至服务器的步骤,包括:获取多个服务器标识以及对应的资源占用参数;根据资源占用参数对多个服务器标识进行筛选,得到资源占用最少的服务器标识,将触摸事件上报至对应的服务器。
在一个实施例中,如图3所示,提供了一种控件匹配方法,以该方法应用于服务器为例进行说明,具体包括以下步骤:
步骤302,接收终端发送的当前应用程序页面中多个视图的属性信息;视图包括控件;属性信息包括视图名称和层级信息。
步骤304,接收控件对应的埋点操作,根据属性信息获取被埋点的控件对应的视图路径。
步骤306,根据层级信息,对当前页面中视图分配对应的视图索引,将最高层级视图对应的视图索引至被埋点的控件对应的视图索引逐级拼接,得到索引字符串,将索引字符串作为被埋点的控件的索引路径。
服务器根据第一终端发送的当前应用程序页面多个视图的属性信息,对应页面截图中可以进行触摸操作的控件(以下称“可触摸控件”)进行识别,对可触摸控件添加对应的埋点边框,将设有埋点边框的页面截图发送至第二终端。第二终端通过Web页面对页面截图进行展示,获取应用程序开发商对埋点边框的点击操作以及输入的对应的触摸事件标识,将埋点边框对应控件的埋点信息发送至服务器。服务器根据被埋点控件的层级信息,利用第一预设标识将最高层级视图至被埋点控件的多个视图的视图名称依次拼接,得到目录字符串,将该目录字符串作为被埋点控件对应的视图路径。例如,被触摸控件UIButton对应的视图路径可以是/UIwindow/ViewController/UIView/UIButton。服务器根据多个视图的层级信息,对多个视图分别进行编号,将编号作为相应视图的视图索引。视图索引包括控件索引和控制器索引。服务器根据被埋点控件的层级信息,利用第二预设标识将最高层级视图至被埋点控件的多个视图的视图索引依次拼接,得到索引字符串,将该索引字符串作为被埋点控件对应的视图路径。例如,被触摸控件UIButton对应的索引路径可以是0_1_2_1。
步骤308,将被埋点的控件的视图路径和索引路径发送至终端,使终端在拦截到被触摸控件对应的触摸事件时,根据视图路径和索引路径对被触摸控件和被埋点的控件进行匹配,并在匹配成功时将被触摸控件对应的触摸事件进行上报。
服务器将多个被埋点控件的视图路径和索引路径发送至第三终端。当用户在第三终端对当前应用程序页面中某个控件进行触摸操作时,第三终端利用SDK对被触摸控件对应的触摸事件进行拦截,根据视图路径和索引路径对被触摸控件和被埋点控件进行匹配,并在匹配成功时将被触摸控件对应的触摸事件上报至服务器。
本实施例中,根据应用程序页面中多个视图的属性信息,可以生成被埋点的控件对应的视图路径和索引路径;将被埋点的控件的视图路径和索引路径发送至终端,可以使终端在拦截到被触摸控件对应的触摸事件时,根据视图路径和索引路径对被触摸控件和被埋点的控件进行匹配,根据匹配结果进行触摸事件的上报。由于路径信息不仅包括控件对应的视图路径,还包括索引路径,视图路径可以对不同层级的视图进行区分,索引路径可以对同一层级的不同视图进行区分,视图路径和索引路径的结合可以共同完成控件唯一性定位,从而能够提高控件匹配精度,进而可以更准确的采集用户行为数据。
在一个实施例中,属性信息还包括视图标识;生成被埋点的控件对应的视图路径和索引路径的步骤,包括:获取当前应用程序页面的页面截图;按照预设规则将多个视图标识作为数组元素添加至多个数组;多个数组具有不同的级别;查询最高级别数组中的视图标识对应的视图名称,将最高级别数组中的视图标识对应的视图名称标记为父节点;查询次高级别数组中的视图标识对应的视图名称,根据层级信息,将次高级别数组中的视图标识对应的视图名称标记为父节点的子节点;将子节点作为下一级别数组中的视图标识对应的视图名称的父节点进行迭代,直至最低级别数组,得到应用程序页面的多叉树;根据多叉树生成多个视图分别对应的层级路径,根据层级路径在页面截图对相应的视图添加对应的埋点边框,将设有埋点边框的页面截图发送至预设终端,使预设终端对设有埋点边框的页面截图进行展示并获取对埋点边框对应控件的埋点操作;接收预设终端返回的被埋点的控件的埋点信息,根据多叉树生成被埋点控件的层级路径。
当需要对应用程序设置埋点时,第一终端利用SDK获取当前应用程序页面的视图数据。视图数据包括当前应用程序页面的页面截图及多个视图的属性信息。页面截图为静态的屏幕截图。视图包括控件和视图控制器。属性信息包括视图名称、视图标识和层级信息。视图标识可以唯一识别一个视图,可以是视图编号,如IDn(n=1,2…)等。服务器根据视图的属性信息构建当前应用程序页面对应的多叉树,根据多叉树生成被埋点控件的层级路径。具 体的,服务器建立最高级别数组,在视图数据中提取与预设根视图具有相同视图名称的视图对应的视图标识,将提取到的视图标识添加至最高级别数组。例如,如图4所示,最高级别数组可以是A1[ID 6]。
服务器将提取到的视图标记为父视图,根据该父视图的层级信息,对视图数据进行遍历,检测是否存在该父视图对应的子视图。父视图对应的子视图是指父视图的下一层级视图。当存在时,服务器建立次高级别数组,在视图数据中提取该父视图对应的子视图的视图标识,将提取到的视图标识添加至次高级别数组。例如,次高级别数组可以是A2[ID 2,ID 7,ID 8]。
服务器将提取到的子视图作为父视图,在视图数据中查询是否存在对应的子视图。当视图数据中存在对应的子视图时,服务器按照上述方式建立下一级别数组。如此循环,直至视图数据中不存在对应的子视图时,得到最低级别数组。例如,下一级别数组可以是A3[ID 1,ID 4,ID5],最低级别数组可以是A4[ID3,ID 9,ID10,ID 11,ID 12]。
在生成最高级别数组后,服务器查询最高级别数组的数组元素对应的视图名称,将最高级别数组的数组元素对应的视图名称标记为多叉树的根节点。例如,如图4所示,多叉树的根节点为最高级别数组A1的数组元素ID 6对应的视图名称UIWindow(窗口)。在得到多叉树的根节点后,服务器按照上述方式生成次高级别数组,查询次高级别数组的数组元素对应的视图名称,将次高级别数组的数组元素对应的视图名称标记为多叉树中根节点的子节点,利用预设连接线将子节点连接至根节点,形成多叉树的多个树枝。可以理解,根节点也是上述子节点的父节点。例如,如图4所示,预设连接线可以是带有箭头的线段,根节点的子节点为次高级别数组A2的三个数组元素ID2、ID7和ID8分别对应的视图名称UIView(视图)、ViewController(视图控制器)和UIView,对应形成多叉树的三个树枝。
在得到多叉树根节点的子节点后,服务器按照上述方式生成下一级别数组,将上述子节点作为该下一级别数组中数组元素的父节点,查询下一级别数组的数组元素对应的视图名称,利用预设连接线将下一级别数组中数组元 素对应的视图名称连接至对应的父节点,以对多叉树的树枝进行延长。换句话说,服务器根据上述每个子节点对应视图的层级信息,查询每个子节点对应视图的下一层级视图,利用预设连接线将下一级别数组中相应数组元素对应的视图名称连接至对应的子节点。例如,如图4所示,假设次高级别数组A2的数组元素ID2对应视图不存在下一层级视图,数组元素ID7对应视图的下一层级视图包括数组元素ID1对应的视图,则将数组元素ID1对应视图的视图名称UIView连接至数组元素ID7对应视图的视图名称ViewController。服务器按照上述方式依次将每个数组中数组元素对应视图的视图名称作为节点添加至多叉树中,形成当前应用程序页面最终对应的多叉树。本实施例中,服务器根据不具有层级结构的视图数据,对当前应用程序页面中多个视图的属性信息进行整合,提炼出可以从整体上反应当前页面多个视图间层级结构的多叉树。
服务器在多叉树构建过程中,对多叉树每个节点进行编号,以使每个节点对应的视图具有视图索引。具体的,服务器对多叉树中不同层级节点对应的视图分别进行单独编号,将编号作为对应视图的视图索引。服务器可以将视图索引作为对应视图的视图名称的下标进行记录。例如,如图4所示,三个按钮类型视图对应的视图索引可以是UIButton0(按钮0),UIButton1(按钮1)和UIButton2(按钮2)。
服务器根据视图的属性信息对可触摸视图进行识别。可触摸视图包括可触摸控件。服务器根据可触摸视图对应的视图标识,在多叉树中查询对应的节点,将该节点标记为目标节点。服务器利用第一预设标识将多叉树中根节点至目标节点的多个节点分别对应的视图名称依次拼接,得到目录字符串,将目录字符串作为目标节点对应视图的视图路径。服务器利用第二预设标识将多叉树中根节点至目标节点的多个节点分别对应的视图索引依次拼接,得到索引字符串,将索引字符串作为目标节点对应视图的索引路径。视图路径和索引路径可以对每个可触摸视图进行准确定位。
服务器根据定位对可触摸视图添加对应的埋点边框。埋点边框可以响应 应用程序开发商的点击操作。如图5所示,埋点边框的形状与大小可以是与对应视图的图标的形状与大小一致。服务器将设有埋点边框的页面截图发送至预设终端,即第二终端。第二终端对设有埋点边框的页面截图进行展示。应用程序开发商可以通过在第二终端对页面截图上点击埋点边框,并输入对应的触摸事件标识,实现埋点设置。服务器按照上述方式生成被埋点控件对应的层级路径,将被埋点控件的层级路径发送至第三终端,使第三终端在拦截到被触摸控件对应的触摸事件时,根据层级路径对被触摸控件和被埋点控件进行匹配。
本实施例中,根据视图的层级信息构建的多叉树,可以从整体上反应当前页面多个视图的层级结构,由此根据多叉树生成的视图路径和索引路径,可以对每个视图进行准确定位。
在一个实施例中,视图包括控件;属性信息还包括基本属性和访问属性;根据多叉树生成多个视图分别对应的层级路径的步骤,包括:根据基本属性识别控件是否为可触摸控件;当控件不是可触摸控件时,识别控件名称是否为目标集合中的集合元素及访问属性是否具有预设的属性值;当控件名称为目标集合中的集合元素,且访问属性具有预设的属性值时,将控件标记为可触摸控件;根据多叉树生成多个可触摸控件分别对应的层级路径。
当应用程序为原生APP时,第一终端发送至服务器的属性信息包括视图的基本属性。基本属性包括透明属性、隐藏属性和交互属性等。交互属性包括userInteractionEnabled(一种属性名称)属性。服务器存储了预设集合。预设集合记录了可以进行触摸操作的多个控件的控件名称,如UIControl,UITableViewCell、UICollectionViewCell,UIView及分别对应的子类控件的控件名称。服务器识别控件的控件名称是否属于预设集合中的集合元素。当属于时,服务器获取该控件的透明属性、隐藏属性和交互属性各自的属性值,识别三个属性值是否分别为各自的预设属性值。当三个属性值均为各自对应的预设属性值时,表示该控件为不透明的,可见的且可以与用户交互的,服务器将该控件标记为可触摸控件。
Web APP或者混合APP中存在跨平台页面,如H5(HTML5,超文本标记语言)页面,跨平台页面中控件的控件名称并不属于预设集合中的集合元素。当根据基本属性将控件识别为不可以进行触摸操作的控件时,服务器识别控件的控件名称是否属于目标集合中的集合元素。目标集合也记录了可以进行触摸操作的多个控件的控件名称,如RCTView(一种控件名称)及其子类控件的控件名称。当不属于目标集合中的集合元素时,表示该控件不可以进行触摸操作。当应用程序为Web APP或者混合APP时,第一终端利用SDK获取的属性信息还包括访问属性。访问属性包括isAccessibilityElement(一种属性名称)属性。当控件名称属于目标集合中的集合元素时,服务器获取访问属性的属性值,判断该属性值是否为预设的属性值。当控件名称为目标集合中的集合元素,且访问属性具有预设的属性值时,服务器将控件标记为可触摸控件。根据多叉树生成多个可触摸控件分别对应的层级路径。
本实施例中,当应用程序为原生APP时,根据基本属性即可对当前应用程序页面中的可触摸控件进行识别;当应用程序为Web APP或者混合APP时,可以根据访问属性对对当前应用程序页面中的可触摸控件进行识别,使得该可触摸控件识别方法对于多种类型的应用程序均可以通用,可以提高可触摸控件的识别精度。
在一个实施例中,根据层级信息,对当前页面中控件分配对应的视图索引的步骤,包括:根据层级信息对不同层级的控件分别进行单独编号;对同一层级的不同类型的视图分别进行单独编号,将编号作为控件对应的控件索引;方法还包括:在当前应用程序页面新增或删除视图时,对与新增或删除的视图相同类型的视图重新进行单独编号,将编号作为控件对应的控件索引。对同一层级的不同类型的视图分别进行单独编号,可以尽量减少新增或删除视图对控件索引的影响,具有一定的索引路径抗干扰作用。
在一个实施例中,如图6所示,提供了一种控件匹配装置,包括:拦截模块602,路径获取模块604,路径匹配模块606和上报模块608,其中:拦截模块602,用于获取当前应用程序页面中发生的触摸事件,对触摸事件进 行拦截;触摸事件与应用程序的被触摸控件相对应。路径获取模块604,用于获取被触摸控件的视图路径和索引路径,及获取服务器发送的多个被埋点控件的视图路径和索引路径。路径匹配模块606,用于将被触摸控件的视图路径与被埋点控件的视图路径进行匹配,将被触摸控件的索引路径与被埋点控件的索引路径进行匹配。上报模块608,用于当视图路径和索引路径分别匹配成功时,将被触摸控件对应的触摸事件上报至服务器。
在一个实施例中,提供了一种计算机设备,如图7所示,该计算机设备包括通过系统总线连接的处理器、存储装置和网络接口。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储装置包括一个或多个非易失性存储介质、一个或多个内存储器。该服务器的非易失性存储介质存储有操作系统和计算机可读指令。该计算机设备的内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信,比如,接收第一终端发送的当前应用程序页面的页面截图及多个视图的属性信息等。该计算机可读指令被处理器执行时以实现一种控件匹配方法。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,前述计算机可读指令可存储于一非易失性存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,存储介质可为磁碟、光盘、只读存储记忆体(ReCd-Only Memory,ROM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上实施例仅表达了本申请的几种实施方式,但并不能因此而理解为对发明专利范围的限制。对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。

Claims (20)

  1. 一种控件匹配方法,包括:
    获取当前应用程序页面中发生的触摸事件,对所述触摸事件进行拦截;所述触摸事件与所述应用程序的被触摸控件相对应;
    获取被触摸控件的视图路径和索引路径;
    获取服务器发送的多个被埋点控件的视图路径和索引路径;
    将所述被触摸控件的视图路径与被埋点控件的视图路径进行匹配,将所述被触摸控件的索引路径与被埋点控件的索引路径进行匹配;及
    当所述视图路径和索引路径分别匹配成功时,将所述被触摸控件对应的触摸事件上报至服务器。
  2. 根据权利要求1所述的方法,其特征在于,所述获取被触摸控件的视图路径和索引路径,包括:
    获取被触摸控件的属性信息;所述属性信息包括视图名称,视图索引以及层级信息;
    根据被触摸控件与一个或多个视图的层级信息,利用第一预设标识将最高层级视图的视图名称至所述被触摸控件的视图名称逐级拼接,得到目录字符串,将所述目录字符串作为被触摸控件的视图路径;及
    根据被触摸控件与一个或多个视图的层级信息,利用第二预设标识将最高层级视图的控视图索引至所述被触摸控件的控视图索引逐级拼接,得到索引字符串,将所述索引字符串作为被触摸控件的索引路径。
  3. 根据权利要求1所述的方法,其特征在于,所述当被触摸控件与被埋点控件的视图路径和索引路径分别匹配成功时,将被触摸控件对应的触摸事件上报至服务器,还包括:
    当所述被触摸控件与被埋点控件的视图路径或索引路径匹配成功时,获取被触摸控件以及被埋点控件分别对应的图标;
    将所述被触摸控件对应的图标和被埋点控件对应的图标压缩至相同尺寸,使压缩后的多个图标具有相同数量的像素点;
    利用每个图标中多个像素点的像素值生成得到相应图标对应的像素矩阵;
    根据所述被触摸控件对应图标的像素矩阵与被埋点控件对应图标的像素矩阵,计算所述被触摸控件对应图标和被埋点控件对应图标的相似度;及
    当相似度达到阈值时,将所述被触摸控件对应的触摸事件上报至服务器。
  4. 根据权利要求3所述的方法,其特征在于,所述根据所述被触摸控件对应图标的像素矩阵与被埋点控件对应图标的像素矩阵,计算被触摸控件对应图标和被埋点控件对应图标的相似度,包括:
    根据图标中多个像素点的像素值,计算每个像素点对应的灰度值;
    利用每个图标中多个像素点的灰度值生成得到相应图标对应的灰度矩阵;
    根据图标中多个像素点的灰度值,计算图标对应的灰度均值;
    根据灰度均值对相应灰度矩阵中的多个灰度值进行替换,得到相应图标对应的目标矩阵;
    对所述被触摸控件对应图标的目标矩阵与被埋点控件对应图标的目标矩阵进行预设逻辑运算,得到相似度矩阵;及
    根据所述相似度矩阵,计算被触摸控件对应图标和被埋点控件对应图标的相似度。
  5. 一种控件匹配方法,包括:
    接收终端发送的当前应用程序页面中多个视图的属性信息;所述视图包括控件;所述属性信息包括视图名称和层级信息;
    获取控件对应的埋点操作,根据所述属性信息获取被埋点的控件对应的视图路径;
    根据所述层级信息,对当前页面中视图分配对应的视图索引,将最高层级视图对应的视图索引至被埋点的控件对应的视图索引逐级拼接,得到索引字符串,将所述索引字符串作为被埋点的控件的索引路径;及
    将被埋点的控件的视图路径和索引路径发送至所述终端,使终端在拦截 到被触摸控件对应的触摸事件时,根据视图路径和索引路径对被触摸控件和被埋点的控件进行匹配,并在匹配成功时将被触摸控件对应的触摸事件进行上报。
  6. 根据权利要求5所述的方法,其特征在于,所述根据所述层级信息,对当前页面中控件分配对应的视图索引,包括:
    根据所述层级信息,对不同层级的控件分别进行单独编号;
    对同一层级的不同类型的视图分别进行单独编号,将所述编号作为控件对应的控件索引;及
    所述方法还包括:在当前应用程序页面新增或删除视图时,对与新增或删除的视图相同类型的视图重新编号,将重设的编号作为控件对应的控件索引。
  7. 一种控件匹配装置,包括:
    拦截模块,用于获取当前应用程序页面中发生的触摸事件,对所述触摸事件进行拦截;所述触摸事件与所述应用程序的被触摸控件相对应;
    路径获取模块,用于获取被触摸控件的视图路径和索引路径,及获取服务器发送的多个被埋点控件的视图路径和索引路径;
    路径匹配模块,用于将所述被触摸控件的视图路径与被埋点控件的视图路径进行匹配,将所述被触摸控件的索引路径与被埋点控件的索引路径进行匹配;及
    上报模块,用于当所述视图路径和索引路径分别匹配成功时,将所述被触摸控件对应的触摸事件上报至服务器。
  8. 根据权利要求7所述的装置,其特征在于,所述路径获取模块还用于获取被触摸控件的属性信息;所述属性信息包括视图名称,视图索引以及层级信息;根据被触摸控件与一个或多个视图的层级信息,利用第一预设标识将最高层级视图的视图名称至所述被触摸控件的视图名称逐级拼接,得到目录字符串,将所述目录字符串作为被触摸控件的视图路径;及根据被触摸控件与一个或多个视图的层级信息,利用第二预设标识将最高层级视图的控视 图索引至所述被触摸控件的控视图索引逐级拼接,得到索引字符串,将所述索引字符串作为被触摸控件的索引路径。
  9. 一种计算机设备,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:获取当前应用程序页面中发生的触摸事件,对所述触摸事件进行拦截;所述触摸事件与所述应用程序的被触摸控件相对应;
    获取被触摸控件的视图路径和索引路径;
    获取服务器发送的多个被埋点控件的视图路径和索引路径;
    将所述被触摸控件的视图路径与被埋点控件的视图路径进行匹配,将所述被触摸控件的索引路径与被埋点控件的索引路径进行匹配;及
    当所述视图路径和索引路径分别匹配成功时,将所述被触摸控件对应的触摸事件上报至服务器。
  10. 根据权利要求9所述的计算机设备,其特征在于,所述处理器还用于执行:获取被触摸控件的属性信息;所述属性信息包括视图名称,视图索引以及层级信息;
    根据被触摸控件与一个或多个视图的层级信息,利用第一预设标识将最高层级视图的视图名称至所述被触摸控件的视图名称逐级拼接,得到目录字符串,将所述目录字符串作为被触摸控件的视图路径;及
    根据被触摸控件与一个或多个视图的层级信息,利用第二预设标识将最高层级视图的控视图索引至所述被触摸控件的控视图索引逐级拼接,得到索引字符串,将所述索引字符串作为被触摸控件的索引路径。
  11. 根据权利要求9所述的计算机设备,其特征在于,所述处理器还用于执行:当所述被触摸控件与被埋点控件的视图路径或索引路径匹配成功时,获取被触摸控件以及被埋点控件分别对应的图标;
    将所述被触摸控件对应的图标和被埋点控件对应的图标压缩至相同尺寸,使压缩后的多个图标具有相同数量的像素点;
    利用每个图标中多个像素点的像素值生成得到相应图标对应的像素矩 阵;
    根据所述被触摸控件对应图标的像素矩阵与被埋点控件对应图标的像素矩阵,计算所述被触摸控件对应图标和被埋点控件对应图标的相似度;及
    当相似度达到阈值时,将所述被触摸控件对应的触摸事件上报至服务器。
  12. 根据权利要求11所述的计算机设备,其特征在于,所述处理器还用于执行:根据图标中多个像素点的像素值,计算每个像素点对应的灰度值;
    利用每个图标中多个像素点的灰度值生成得到相应图标对应的灰度矩阵;
    根据图标中多个像素点的灰度值,计算图标对应的灰度均值;
    根据灰度均值对相应灰度矩阵中的多个灰度值进行替换,得到相应图标对应的目标矩阵;
    对所述被触摸控件对应图标的目标矩阵与被埋点控件对应图标的目标矩阵进行预设逻辑运算,得到相似度矩阵;及
    根据所述相似度矩阵,计算被触摸控件对应图标和被埋点控件对应图标的相似度。
  13. 一种计算机设备,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:接收终端发送的当前应用程序页面中多个视图的属性信息;所述视图包括控件;所述属性信息包括视图名称和层级信息;
    获取控件对应的埋点操作,根据所述属性信息获取被埋点的控件对应的视图路径;
    根据所述层级信息,对当前页面中视图分配对应的视图索引,将最高层级视图对应的视图索引至被埋点的控件对应的视图索引逐级拼接,得到索引字符串,将所述索引字符串作为被埋点的控件的索引路径;及
    将被埋点的控件的视图路径和索引路径发送至所述终端,使终端在拦截到被触摸控件对应的触摸事件时,根据视图路径和索引路径对被触摸控件和被埋点的控件进行匹配,并在匹配成功时将被触摸控件对应的触摸事件进行 上报。
  14. 根据权利要求13所述的计算机设备,其特征在于,所述处理器还用于执行:根据所述层级信息,对不同层级的控件分别进行单独编号;
    对同一层级的不同类型的视图分别进行单独编号,将所述编号作为控件对应的控件索引;及
    在当前应用程序页面新增或删除视图时,对与新增或删除的视图相同类型的视图重新编号,将重设的编号作为控件对应的控件索引。
  15. 一个或多个存储有计算机可读指令的非易失性存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:获取当前应用程序页面中发生的触摸事件,对所述触摸事件进行拦截;所述触摸事件与所述应用程序的被触摸控件相对应;
    获取被触摸控件的视图路径和索引路径;
    获取服务器发送的多个被埋点控件的视图路径和索引路径;
    将所述被触摸控件的视图路径与被埋点控件的视图路径进行匹配,将所述被触摸控件的索引路径与被埋点控件的索引路径进行匹配;及
    当所述视图路径和索引路径分别匹配成功时,将所述被触摸控件对应的触摸事件上报至服务器。
  16. 根据权利要求15所述的存储介质,其特征在于,所述处理器还用于执行:获取被触摸控件的属性信息;所述属性信息包括视图名称,视图索引以及层级信息;
    根据被触摸控件与一个或多个视图的层级信息,利用第一预设标识将最高层级视图的视图名称至所述被触摸控件的视图名称逐级拼接,得到目录字符串,将所述目录字符串作为被触摸控件的视图路径;及
    根据被触摸控件与一个或多个视图的层级信息,利用第二预设标识将最高层级视图的控视图索引至所述被触摸控件的控视图索引逐级拼接,得到索引字符串,将所述索引字符串作为被触摸控件的索引路径。
  17. 根据权利要求15所述的存储介质,其特征在于,所述处理器还用于 执行:当所述被触摸控件与被埋点控件的视图路径或索引路径匹配成功时,获取被触摸控件以及被埋点控件分别对应的图标;
    将所述被触摸控件对应的图标和被埋点控件对应的图标压缩至相同尺寸,使压缩后的多个图标具有相同数量的像素点;
    利用每个图标中多个像素点的像素值生成得到相应图标对应的像素矩阵;
    根据所述被触摸控件对应图标的像素矩阵与被埋点控件对应图标的像素矩阵,计算所述被触摸控件对应图标和被埋点控件对应图标的相似度;及
    当相似度达到阈值时,将所述被触摸控件对应的触摸事件上报至服务器。
  18. 根据权利要求17所述的存储介质,其特征在于,所述处理器还用于执行:根据图标中多个像素点的像素值,计算每个像素点对应的灰度值;
    利用每个图标中多个像素点的灰度值生成得到相应图标对应的灰度矩阵;
    根据图标中多个像素点的灰度值,计算图标对应的灰度均值;
    根据灰度均值对相应灰度矩阵中的多个灰度值进行替换,得到相应图标对应的目标矩阵;
    对所述被触摸控件对应图标的目标矩阵与被埋点控件对应图标的目标矩阵进行预设逻辑运算,得到相似度矩阵;及
    根据所述相似度矩阵,计算被触摸控件对应图标和被埋点控件对应图标的相似度。
  19. 一个或多个存储有计算机可读指令的非易失性存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:接收终端发送的当前应用程序页面中多个视图的属性信息;所述视图包括控件;所述属性信息包括视图名称和层级信息;
    获取控件对应的埋点操作,根据所述属性信息获取被埋点的控件对应的视图路径;
    根据所述层级信息,对当前页面中视图分配对应的视图索引,将最高层 级视图对应的视图索引至被埋点的控件对应的视图索引逐级拼接,得到索引字符串,将所述索引字符串作为被埋点的控件的索引路径;及
    将被埋点的控件的视图路径和索引路径发送至所述终端,使终端在拦截到被触摸控件对应的触摸事件时,根据视图路径和索引路径对被触摸控件和被埋点的控件进行匹配,并在匹配成功时将被触摸控件对应的触摸事件进行上报。
  20. 根据权利要求19所述的存储介质,其特征在于,所述处理器还用于执行:根据所述层级信息,对不同层级的控件分别进行单独编号;
    对同一层级的不同类型的视图分别进行单独编号,将所述编号作为控件对应的控件索引;及
    在当前应用程序页面新增或删除视图时,对与新增或删除的视图相同类型的视图重新编号,将重设的编号作为控件对应的控件索引。
PCT/CN2017/112661 2017-11-01 2017-11-23 控件匹配方法、装置、计算机设备和存储介质 Ceased WO2019085083A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711058961.8A CN107861655B (zh) 2017-11-01 2017-11-01 控件匹配方法、装置、计算机设备和存储介质
CN201711058961.8 2017-11-01

Publications (1)

Publication Number Publication Date
WO2019085083A1 true WO2019085083A1 (zh) 2019-05-09

Family

ID=61697519

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/112661 Ceased WO2019085083A1 (zh) 2017-11-01 2017-11-23 控件匹配方法、装置、计算机设备和存储介质

Country Status (2)

Country Link
CN (1) CN107861655B (zh)
WO (1) WO2019085083A1 (zh)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111143184A (zh) * 2019-12-27 2020-05-12 北京达佳互联信息技术有限公司 数据处理方法、装置及系统
CN111427741A (zh) * 2020-02-26 2020-07-17 中国平安人寿保险股份有限公司 埋点上报方法及相关产品
CN111552620A (zh) * 2020-04-03 2020-08-18 北京字节跳动网络技术有限公司 数据获取方法、装置、终端及存储介质
CN112181794A (zh) * 2020-09-29 2021-01-05 中国平安财产保险股份有限公司 页面监听方法、装置、计算机设备及存储介质
CN112559278A (zh) * 2019-09-25 2021-03-26 腾讯科技(深圳)有限公司 操作数据的获取方法和装置
CN112685259A (zh) * 2020-12-30 2021-04-20 平安证券股份有限公司 基于埋点的数据采集方法、装置、电子设备及存储介质
CN112883250A (zh) * 2019-11-29 2021-06-01 阿里巴巴集团控股有限公司 生成埋点标识的方法、装置和埋点的方法
CN113515715A (zh) * 2020-10-15 2021-10-19 腾讯科技(深圳)有限公司 埋点事件编码的生成方法、处理方法及相关设备
CN113568689A (zh) * 2021-01-22 2021-10-29 腾讯科技(深圳)有限公司 一种埋点信息确定方法、装置、设备及存储介质
CN113761310A (zh) * 2020-07-07 2021-12-07 北京沃东天骏信息技术有限公司 一种采集点击数据的方法和装置
CN114491353A (zh) * 2020-11-11 2022-05-13 广州市有车以后信息科技有限公司 一种提高h5页面埋点上报可靠性的方法
CN116821499A (zh) * 2023-06-29 2023-09-29 中国工商银行股份有限公司 信息展示方法及装置、电子设备和计算机可读存储介质
CN117873887A (zh) * 2024-01-04 2024-04-12 书行科技(北京)有限公司 一种埋点处理方法、装置、电子设备和存储介质

Families Citing this family (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110554892A (zh) * 2018-05-31 2019-12-10 北京京东尚科信息技术有限公司 信息获取方法和装置
CN110673886B (zh) * 2018-07-03 2023-10-03 百度在线网络技术(北京)有限公司 用于生成热力图的方法和装置
CN109213515B (zh) * 2018-07-12 2021-10-29 创新先进技术有限公司 多平台下埋点归一方法及装置和电子设备
CN110875869B (zh) * 2018-08-31 2022-05-31 Oppo广东移动通信有限公司 一种红包识别方法、系统及终端设备
CN110875876B (zh) * 2018-09-04 2022-05-27 Oppo广东移动通信有限公司 电子红包识别方法、电子红包识别装置及移动终端
CN110880999B (zh) * 2018-09-05 2022-05-27 Oppo广东移动通信有限公司 一种电子红包识别方法、装置及终端设备
CN110881002B (zh) * 2018-09-06 2022-06-21 Oppo广东移动通信有限公司 一种电子红包监控方法、装置及终端设备
CN110881001B (zh) * 2018-09-06 2022-06-03 Oppo广东移动通信有限公司 一种电子红包检测方法、系统及终端设备
CN109446069A (zh) * 2018-09-26 2019-03-08 平安普惠企业管理有限公司 兼容性测试方法、装置、计算机设备和介质
CN109522191A (zh) * 2018-10-16 2019-03-26 深圳壹账通智能科技有限公司 一种采集交互行为指令的属性信息的方法及装置
CN111131369B (zh) * 2018-11-01 2022-09-27 百度在线网络技术(北京)有限公司 App使用情况的传输方法、装置、电子设备及存储介质
CN110442510B (zh) * 2019-06-19 2024-09-13 中国平安财产保险股份有限公司 一种页面属性获取方法、装置及计算机设备、存储介质
CN112416995B (zh) * 2019-08-23 2023-12-08 腾讯科技(深圳)有限公司 一种数据统计方法、装置、计算机设备及存储介质
CN110659191B (zh) * 2019-09-02 2023-07-18 深圳市铭数信息有限公司 埋点数据分析方法、装置、计算机设备和存储介质
CN111008052A (zh) * 2019-10-21 2020-04-14 爱钱进(北京)信息科技有限公司 提供界面图像的方法、装置以及存储介质
CN110851326A (zh) * 2019-11-08 2020-02-28 浙江每日互动网络科技股份有限公司 一种埋点方法、数据采集方法和装置
CN110888573A (zh) * 2019-11-08 2020-03-17 爱钱进(北京)信息科技有限公司 对控件进行标识的方法、装置以及存储介质
CN111338506B (zh) * 2020-02-19 2022-01-07 Oppo广东移动通信有限公司 触摸响应方法、装置、电子设备及存储介质
CN111338923B (zh) * 2020-03-03 2024-03-01 北京新氧科技有限公司 埋点曝光处理方法、装置及设备
CN112162739B (zh) * 2020-09-25 2024-10-08 北京易观数智科技股份有限公司 基于js-sdk的可视化埋点方法及系统
CN112416728A (zh) * 2020-11-23 2021-02-26 平安普惠企业管理有限公司 埋点数据获取方法、装置、客户端设备及可读存储介质
CN113031812A (zh) * 2021-03-18 2021-06-25 Oppo广东移动通信有限公司 触控事件上报方法、装置、终端及存储介质
CN113127373A (zh) * 2021-05-18 2021-07-16 爱驰汽车有限公司 可视化埋点方法、系统、装置、设备及存储介质
CN114385469A (zh) * 2021-12-30 2022-04-22 上海浦东发展银行股份有限公司 一种数据埋点采集方法、装置、设备和存储介质
CN114860675A (zh) * 2022-05-18 2022-08-05 北京奇艺世纪科技有限公司 日志生成方法、装置、设备及存储介质
CN115269093B (zh) * 2022-07-29 2026-03-06 抖音视界有限公司 一种页面的检测方法、装置、计算机设备及可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102946319A (zh) * 2012-09-29 2013-02-27 焦点科技股份有限公司 网络用户行为信息分析系统及其分析方法
CN104572043A (zh) * 2013-10-16 2015-04-29 阿里巴巴集团控股有限公司 一种对客户端应用的控件进行实时埋点的方法及装置
WO2016169435A1 (zh) * 2015-04-22 2016-10-27 阿里巴巴集团控股有限公司 一种数据采集方法和系统、及其终端和服务器
CN106776247A (zh) * 2016-11-23 2017-05-31 腾云天宇科技(北京)有限公司 一种监控应用中控件的方法、服务器及系统
CN107220230A (zh) * 2016-03-22 2017-09-29 阿里巴巴集团控股有限公司 一种信息采集方法和装置,以及一种智能终端

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105391566B (zh) * 2014-09-04 2018-12-07 中国移动通信集团黑龙江有限公司 一种动态的网络设备配置比对的方法及装置
CN105512667B (zh) * 2014-09-22 2019-01-15 中国石油化工股份有限公司 红外和可见光视频图像融合识别火灾的方法
CN106445484B (zh) * 2015-08-12 2019-09-13 北京易数科技有限公司 通过软件开发工具包实现数据跟踪的方法及系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102946319A (zh) * 2012-09-29 2013-02-27 焦点科技股份有限公司 网络用户行为信息分析系统及其分析方法
CN104572043A (zh) * 2013-10-16 2015-04-29 阿里巴巴集团控股有限公司 一种对客户端应用的控件进行实时埋点的方法及装置
WO2016169435A1 (zh) * 2015-04-22 2016-10-27 阿里巴巴集团控股有限公司 一种数据采集方法和系统、及其终端和服务器
CN107220230A (zh) * 2016-03-22 2017-09-29 阿里巴巴集团控股有限公司 一种信息采集方法和装置,以及一种智能终端
CN106776247A (zh) * 2016-11-23 2017-05-31 腾云天宇科技(北京)有限公司 一种监控应用中控件的方法、服务器及系统

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112559278A (zh) * 2019-09-25 2021-03-26 腾讯科技(深圳)有限公司 操作数据的获取方法和装置
CN112559278B (zh) * 2019-09-25 2024-02-09 腾讯科技(深圳)有限公司 操作数据的获取方法和装置
CN112883250A (zh) * 2019-11-29 2021-06-01 阿里巴巴集团控股有限公司 生成埋点标识的方法、装置和埋点的方法
CN111143184A (zh) * 2019-12-27 2020-05-12 北京达佳互联信息技术有限公司 数据处理方法、装置及系统
CN111143184B (zh) * 2019-12-27 2023-11-07 北京达佳互联信息技术有限公司 数据处理方法、装置及系统
CN111427741A (zh) * 2020-02-26 2020-07-17 中国平安人寿保险股份有限公司 埋点上报方法及相关产品
CN111552620A (zh) * 2020-04-03 2020-08-18 北京字节跳动网络技术有限公司 数据获取方法、装置、终端及存储介质
CN111552620B (zh) * 2020-04-03 2023-07-11 北京字节跳动网络技术有限公司 数据获取方法、装置、终端及存储介质
CN113761310A (zh) * 2020-07-07 2021-12-07 北京沃东天骏信息技术有限公司 一种采集点击数据的方法和装置
CN112181794A (zh) * 2020-09-29 2021-01-05 中国平安财产保险股份有限公司 页面监听方法、装置、计算机设备及存储介质
CN113515715A (zh) * 2020-10-15 2021-10-19 腾讯科技(深圳)有限公司 埋点事件编码的生成方法、处理方法及相关设备
CN113515715B (zh) * 2020-10-15 2024-03-15 腾讯科技(深圳)有限公司 埋点事件编码的生成方法、处理方法及相关设备
CN114491353A (zh) * 2020-11-11 2022-05-13 广州市有车以后信息科技有限公司 一种提高h5页面埋点上报可靠性的方法
CN112685259A (zh) * 2020-12-30 2021-04-20 平安证券股份有限公司 基于埋点的数据采集方法、装置、电子设备及存储介质
CN113568689A (zh) * 2021-01-22 2021-10-29 腾讯科技(深圳)有限公司 一种埋点信息确定方法、装置、设备及存储介质
CN116821499A (zh) * 2023-06-29 2023-09-29 中国工商银行股份有限公司 信息展示方法及装置、电子设备和计算机可读存储介质
CN117873887A (zh) * 2024-01-04 2024-04-12 书行科技(北京)有限公司 一种埋点处理方法、装置、电子设备和存储介质

Also Published As

Publication number Publication date
CN107861655B (zh) 2020-07-07
CN107861655A (zh) 2018-03-30

Similar Documents

Publication Publication Date Title
WO2019085083A1 (zh) 控件匹配方法、装置、计算机设备和存储介质
US11163851B2 (en) Method, apparatus, computer device and storage medium of page displaying
WO2019085084A1 (zh) 埋点处理方法、装置、计算机设备和存储介质
US10387292B2 (en) Determining application test results using screenshot metadata
US11461689B2 (en) Techniques for automatically testing/learning the behavior of a system under test (SUT)
CN107729227B (zh) 应用程序测试范围确定方法、系统、服务器和存储介质
US10268735B1 (en) Graph based resolution of matching items in data sources
CN112860811B (zh) 数据血缘关系的确定方法、装置、电子设备和存储介质
CN109471900B (zh) 图表类数据自定义动作数据交互方法及系统
CN107688664B (zh) 图表生成方法、装置、计算机设备和存储介质
WO2021017735A1 (zh) 一种智能合约的形式化验证方法、电子装置及存储介质
US11216482B2 (en) Systems and methods for access to multi-tenant heterogeneous databases
CN109725980B (zh) 生成镜像标签的方法、设备以及计算机可读介质
US20220092116A1 (en) Automatic graph database query construction and execution
CN113918194A (zh) 一种页面组件的显示方法、装置、电子设备及存储介质
CN114579561A (zh) 数据处理方法和装置、存储介质
CN108093026A (zh) 多租户请求的处理方法及装置
US20150379112A1 (en) Creating an on-line job function ontology
CN109240679A (zh) 脚本文件的图形化方法及装置
US10949219B2 (en) Containerized runtime environments
CN115016925A (zh) 资源管理方法、装置、电子设备和存储介质
CN110989982B (zh) 一种带返回值函数的积木块构建方法、装置、存储介质和处理器
CN114461502B (zh) 模型的监控方法和装置
CN114416678A (zh) 一种资源处理方法、装置、设备以及存储介质
CN115994250A (zh) 一种用户行为可视化方法、系统、计算机设备及介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17930186

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 25/09/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 17930186

Country of ref document: EP

Kind code of ref document: A1