Application information collection method, system, electronic device and storage medium

By generating and loading dynamic link libraries, the problem of difficulty in collecting all information about the native elements of the operating system application page in the prior art is solved, and the effect of quickly obtaining the initial page information and meeting the needs of in-depth testing is achieved.

CN113515441BActive Publication Date: 2025-04-01ASPIRE TECH (SHENZHEN) LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110265943.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-11
Publication Date
2025-04-01
Estimated Expiration
2041-03-11

AI Technical Summary

Technical Problem

Existing automated testing technologies are difficult to effectively collect all information about native elements in the operating system application page, resulting in the inability to meet the needs of in-depth testing.

Method used

By obtaining the initial link project, application application information and page initial information, importing the initial link project to generate a dynamic link project, compiling the dynamic link project to obtain a dynamic link library, and loading it into the application, so that the application can collect page target information based on the dynamic link library.

Benefits of technology

There is no need to develop test scripts specifically, which can quickly obtain the application's page initial information, meet the needs of in-depth testing, and do not invade the application's functional code, and do not use the operating system's native test framework.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113515441B_ABST
    Figure CN113515441B_ABST
Patent Text Reader

Abstract

The present application discloses an application information collection method, system, electronic device and storage medium. The method of the present application includes: obtaining an initial link project, application information of an application and initial page information of the application, and then importing the obtained application information and initial page information into the initial link project, generating a dynamic link project, then compiling the dynamic link project, obtaining a dynamic link library, and finally loading the dynamic link library into the application, so that the application can collect the page target information of the application according to the dynamic link library. The present application links to the dynamic link library after the application development is completed, and collects the page target information through the dynamic link library, without intruding into the functional code of the application, and without using the native test framework of the operating system, which can ensure that the developer does not need to specially develop the test script for the corresponding page control when developing the application, and quickly obtains the initial page information of the application according to user needs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automated testing, and in particular to an application information collection method, system, electronic device and storage medium. Background Art

[0002] Some operating system automation frameworks usually use UI (User Interface) control retrieval technology to obtain the location and information of native elements in the operating system application page, making it easier to write test scripts for the corresponding controls to simulate clicks or other operations to achieve the purpose of automated testing. Since some operating systems are not open source systems, the customized services they provide are very limited, resulting in automated testing that usually requires developers to manually add corresponding page elements during the development phase, such as scripts that specify control buttons, text, etc., and then use the operating system's native UI test framework. However, this method cannot effectively collect all the information of page elements.

[0003] Currently, third-party cross-platform test automation tools can be used to link to the native framework of the operating system to obtain information about native elements in the application page launched by the operating system device, such as control name, control type, width, height, coordinates, etc. However, the page data returned by the third-party cross-platform test tool is not all the properties of the control, but custom data output by the automated test tool function. The custom data output by the automated test tool may not be able to collect the element attribute data required by the user, and thus cannot meet certain in-depth testing requirements. Summary of the invention

[0004] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes an application information collection method, system, electronic device and storage medium, which do not require the use of the native test framework of the operating system, can ensure that developers do not need to specially develop test scripts for corresponding page controls when developing applications, and can quickly obtain the initial page information of the application according to user needs.

[0005] According to the first aspect of the present application, the application information collection method includes:

[0006] Get the initial link project, application information of the application and initial page information;

[0007] Importing the application information and the page initial information into the initial link project to generate a dynamic link project;

[0008] Compile the dynamic link project to obtain a dynamic link library;

[0009] The dynamic link library is loaded into the application program, so that the application program collects page target information according to the dynamic link library.

[0010] The application information collection method according to the embodiment of the present application has at least the following beneficial effects:

[0011] The initial link project, the application information of the application, and the initial page information of the application are obtained, and then the obtained application information and the initial page information are imported into the initial link project to generate a dynamic link project, and then the dynamic link project is compiled to obtain a dynamic link library, and finally the dynamic link library is loaded into the application, so that the application can collect the page target information of the application according to the dynamic link library. This application links the dynamic link library after the application development is completed, and collects the page target information through the dynamic link library. There is no need to invade the functional code of the application, nor to use the native test framework of the operating system. It can ensure that developers do not need to specially develop test scripts for corresponding page controls when developing applications, and quickly obtain the initial page information of the application according to user needs.

[0012] According to some embodiments of the present application, the initial page information of the application is obtained by the following steps:

[0013] Get the page view of the preset application;

[0014] Filtering the internal sub-controls in the page view;

[0015] Extracting the page initial information in the page view, wherein the page initial information includes control information.

[0016] According to some embodiments of the present application, the method further includes:

[0017] Obtaining a control variable corresponding to the control information and a control method called by the control variable;

[0018] The control variables and the control methods are serialized to generate sequence information.

[0019] According to some embodiments of the present application, loading the dynamic link library into the application comprises:

[0020] Determine the operating system used by the application program based on the application information;

[0021] Obtaining development tools for the operating system;

[0022] The dynamic link library is loaded into the preset application through the development tool.

[0023] According to some embodiments of the present application, enabling the application to collect the page target information according to the dynamic link library includes:

[0024] Establishing a communication service in the dynamic link library;

[0025] The page target information in the application is collected based on the communication service.

[0026] According to some embodiments of the present application, loading the dynamic link library into the application comprises:

[0027] Obtaining an executable file generated after compiling and packaging the application;

[0028] The dynamic link library is loaded into the executable file.

[0029] According to some embodiments of the present application, the method further includes:

[0030] Obtaining a first signature certificate corresponding to the dynamic link library and a second signature certificate corresponding to the executable file;

[0031] Determining whether the signatures of the first signature certificate and the second signature certificate are identical;

[0032] If so, it is determined that the dynamic link library is loaded normally.

[0033] According to the second aspect of the present application, the application information collection system includes:

[0034] Acquisition module: The acquisition module is used to acquire the initial link project, application information of the application program and initial page information;

[0035] Import module: the import module is used to import the application information and the page initial information into the initial link project to generate a dynamic link project;

[0036] Compilation module: the compilation module is used to compile the dynamic link project to obtain a dynamic link library;

[0037] Collection module: The collection module is used to load the dynamic link library into the application program, so that the application program collects page target information according to the dynamic link library.

[0038] The application information collection system according to the embodiment of the present application has at least the following beneficial effects:

[0039] The application information collection system of the embodiment of the present application includes an acquisition module, an import module, a compilation module and a collection module. The acquisition module acquires the initial link project, the application information of the application and the initial page information of the application. The import module imports the acquired application information and the initial page information into the initial link project to generate a dynamic link project. The compilation module compiles the dynamic link project to obtain a dynamic link library. The collection module loads the dynamic link library into the application so that the application can collect the page target information of the application according to the dynamic link library. The present application links to the dynamic link library after the application development is completed. The page target information is collected through the dynamic link library without intruding into the functional code of the application and without using the native test framework of the operating system. It can ensure that the developer does not need to specially develop the test script for the corresponding page control when developing the application, and quickly obtains the initial page information of the application according to the user's needs.

[0040] An electronic device according to a third aspect of the present application includes:

[0041] at least one processor, and

[0042] a memory communicatively connected to the at least one processor; wherein,

[0043] The memory stores instructions, and the instructions are executed by the at least one processor so that when the at least one processor executes the instructions, the application information collection method as described in any one of the embodiments of the first aspect of the present application is implemented.

[0044] The electronic device according to the embodiment of the present application has at least the following beneficial effects: by executing the application information collection method as described in the embodiment of the first aspect, the initial link project, the application information of the application and the initial page information of the application are obtained, and then the obtained application information and the initial page information are imported into the initial link project to generate a dynamic link project, and then the dynamic link project is compiled to obtain a dynamic link library, and finally the dynamic link library is loaded into the application, so that the application can collect the page target information of the application according to the dynamic link library. The present application links to the dynamic link library after the application development is completed, and collects the page target information through the dynamic link library, without intruding into the functional code of the application, and without using the native test framework of the operating system, which can ensure that the developer does not need to specially develop the test script of the corresponding page control when developing the application, and quickly obtains the initial page information of the application according to the user's needs.

[0045] A computer-readable storage medium according to a fourth aspect of the present application includes:

[0046] The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to execute the application information collection method as described in the embodiment of the first aspect of the present application.

[0047] According to the computer-readable storage instructions of the embodiment of the present application, at least the following beneficial effects are achieved: by executing the application information collection method as described in the embodiment of the first aspect, the initial link project, the application information of the application, and the initial page information of the application are obtained, and then the obtained application information and the initial page information are imported into the initial link project to generate a dynamic link project, and then the dynamic link project is compiled to obtain a dynamic link library, and finally the dynamic link library is loaded into the application, so that the application can collect the page target information of the application according to the dynamic link library. The present application links to the dynamic link library after the application development is completed, and collects the page target information through the dynamic link library, without intruding into the functional code of the application, and without using the native test framework of the operating system, which can ensure that the developer does not need to specially develop the test script for the corresponding page control when developing the application, and quickly obtains the initial page information of the application according to user needs.

[0048] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The present application is further described below with reference to the accompanying drawings and embodiments, wherein:

[0050] Figure 1 A first flow chart of an application information collection method provided in some embodiments of the present application;

[0051] Figure 2 A first flow chart of step S400 in the application information collection method provided in some embodiments of the present application;

[0052] Figure 3 A second flow chart of step S400 in the application information collection method provided in some embodiments of the present application;

[0053] Figure 4 A third flow chart of step S400 in the application information collection method provided in some embodiments of the present application;

[0054] Figure 5 A second flow chart of the application information collection method provided in some embodiments of the present application;

[0055] Figure 6 A third flow chart of the application information collection method provided in some embodiments of the present application;

[0056] Figure 7A specific application flow chart of the application information collection method provided in some other embodiments of the present application;

[0057] Figure 8 This is a block diagram of the module structure of a resource allocation device provided in some embodiments of the present application.

[0058] Reference numerals:

[0059] Acquisition module 100, import module 200, compilation module 300, collection module 400. DETAILED DESCRIPTION

[0060] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.

[0061] In the description of this application, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed", etc. are understood to exclude the number itself, and "above", "below", "within", etc. are understood to include the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.

[0062] In the description of the present application, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", 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 present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0063] Currently, third-party cross-platform test automation tools can be used to link to the native framework of the operating system to obtain information about native elements in the application page launched by the operating system device, such as control name, control type, width, height, coordinates, etc. However, the page data returned by the third-party cross-platform test tool is not all the properties of the control, but custom data output by the automated test tool function. The custom data output by the automated test tool may not be able to collect the element attribute data required by the user, and thus cannot meet certain in-depth testing requirements.

[0064] Based on this, the present application proposes an application information collection method, system, electronic device and storage medium, which can obtain the initial link project, the application information of the application and the initial page information of the application, and then import the obtained application information and page initial information into the initial link project to generate a dynamic link project, and then compile the dynamic link project to obtain a dynamic link library, and finally load the dynamic link library into the application, so that the application can collect the page target information of the application according to the dynamic link library. The present application links the dynamic link library after the application development is completed, and collects the page target information through the dynamic link library, without intruding into the functional code of the application, and without using the native test framework of the operating system, which can ensure that developers do not need to specially develop test scripts for corresponding page controls when developing applications, and quickly obtain the initial page information of the application according to user needs.

[0065] It should be noted that the operating system targeted in the embodiments of the present application takes the iOS operating system as an example, which is used to solve the problem that the iOS operating system is a non-open source system.

[0066] In a first aspect, an embodiment of the present application provides a method for collecting application information.

[0067] Reference Figure 1 , Figure 1 An application information collection method provided in some embodiments of the present application specifically includes the following steps:

[0068] S100, obtaining the initial link project, application information of the application program and initial page information;

[0069] S200, importing application information and page initial information into an initial link project to generate a dynamic link project;

[0070] S300, compile the dynamic link project to obtain the dynamic link library;

[0071] S400: Load the dynamic link library into the application program, so that the application program collects page target information according to the dynamic link library.

[0072] In step S100, the embodiment of the present application needs to obtain the initial link project, the application information of the application and the initial information of the page. The initial link project here is created in the usual way of developing native dynamic libraries. The application information collection method mentioned in the embodiment of the present application, taking the iOS system as an example, firstly creates an iOS dynamic library in the normal way of developing native dynamic libraries, that is, the initial link project mentioned in the embodiment of the present application, and then obtains the application information of the application. The application information here includes the application name, package name, version, device type, screen width and height, screen ratio, currently obtained screenshots, etc., and provides the data of the tested application for the test page. The package name here is the unique ID of the application package, which is the unique identifier of each iOS application. In actual applications, the iOS native framework UIKit can be used to read the mainBundle, and the application information of the application can be obtained through the mainBundle. The UIKitk framework provides a series of classes to establish and manage the user interface interface, application object, event control, drawing model, window, view and interface for controlling the touch screen of the iPhone OS application. The mainBundle is the resources used by the application, such as the location of data such as code, graphics and music in the file system. The initial page information of the application is the page elements in the application. In actual applications, the page elements in the tested iOS application can be obtained by using the recursiveDescription function of keyWindow in the iOS native UIkit framework.

[0073] In some embodiments, the initial page information of the application in the embodiments of the present application is obtained by following the steps below:

[0074] Get the page view of the preset application; filter the internal sub-controls in the page view, extract the page initial information in the page view, and the page initial information includes the control information. There are many pages in the application. The page view is used to display the distribution of all the contents of the document in the application on the entire page and the position of the entire document on each page, and can be edited to achieve the effect of visual operation. Since the page element acquisition does not involve the internal sub-controls, it is necessary to filter the internal sub-controls in the page view, and then extract the page initial information in the filtered page view. In actual application, because the view of the current interface of the ios application will be loaded into the Window, all elements of the view are obtained from the Window, where the Window represents the window opened in the browser. The views obtained in the embodiment of the present application are sorted by the order and level of addition, and the internal sub-controls with prefixes such as UILayoutGuide are filtered, and each layer of the page view is traversed and read to obtain the class name, memory address, control coordinates, user interaction properties, and gesture recognition of the control. Here, UILayoutGuide is a virtual view, and the one with the prefix is ​​the internal sub-control. Since the internal sub-control does not need to be obtained in the collected data, it is necessary to filter it. The user interaction attributes in the embodiment of the present application include user interaction, control state, and multi-touch, wherein user interaction indicates whether the control enables user interaction. If it is not enabled, for example, a button click will not trigger an event. The control state indicates whether the control is enabled. If it is not enabled, the control selection state and highlight state will not be displayed. Multi-touch indicates that multiple touch events are supported. The gesture recognition in the embodiment of the present application includes: click gesture, pinch gesture, rotation gesture, slide gesture, drag gesture, and long press gesture, wherein the click gesture processes click touch recognition and supports single-point and multi-point gestures; the pinch gesture processes the recognition of the proportion and speed of finger pinching; the rotation gesture processes the rotation gesture, the recognition of the rotation angle and the rotation speed; the slide gesture processes the slide gesture, sets the processor to process the swipe in the direction, and specifies that the gesture processor only processes the touch events of several fingers; the drag gesture processes the drag gesture, supports the maximum number of fingers to drag, the minimum number of fingers to drag, the displacement of the drag gesture on the specified control, and the drag speed of the drag gesture on the specified control; the long press gesture processes the long press gesture, at least how many seconds to press to trigger the gesture, how many fingers must be pressed, and specifies the maximum distance that the long press gesture allows the user to move.

[0075] In step S200, the application information and the page initial information are imported into the initial link project to generate a dynamic link project, that is, the application information and the page initial information obtained in step S100 are imported into the initial link project to obtain a dynamic link project.

[0076] In step S300, the dynamic link project is compiled to obtain a dynamic link library.

[0077] In step S400, the dynamic link library is loaded into the application so that the application can collect page target information according to the dynamic link library. The page target information here refers to page elements in the application obtained by the user according to actual needs.

[0078] In some embodiments, Figure 2 As shown, the step S400 of "loading the dynamic link library into the application" specifically includes:

[0079] S410, determining an operating system used by the application program based on the application information;

[0080] S420, obtaining a development tool for an operating system;

[0081] S430, loading the dynamic link library into a preset application through a development tool.

[0082] In step S410, the operating system used by the application is determined based on the application information of the application, such as the Android system or the iOS system.

[0083] In step S420, the development tool corresponding to the operating system is obtained. Taking the ios operating system as an example, the dynamic library is loaded into the ios application through Xcode, where Xcode is an integrated development tool running on ios. Because the dynamic link library needs to be loaded into the process of the application after compilation, so that the page structure in the Window can be read, and the initial page information obtained can be dynamically integrated and linked to the application based on the message mechanism in RunTime. In the embodiment of the present application, the message mechanism in RunTime is utilized to dynamically obtain the structure through the message mechanism RunTime of ios at runtime. Since the basic framework of ios is basically implemented by Objective-C language (object-oriented programming language, ObjC or OC that expands C), Objective-C language is a dynamic language, which puts many static languages ​​​​in the compilation and linking period to be processed at runtime, and it cannot be determined which function is actually called during compilation. Only when it is really running will the corresponding function be found according to the name of the function to call. In the compilation stage, any function can be called, even if this function is not implemented, as long as it has been declared, it will not report an error.

[0084] In step S430, the dynamic link library is loaded into the preset application through the development tool. For example, in the iOS system, the dynamic link library is loaded into the application through Xcode.

[0085] In some embodiments, Figure 3As shown, the step S400 of "enabling the application to collect page target information according to the dynamic link library" specifically includes:

[0086] S440, establishing a communication service in a dynamic link library;

[0087] S450, collecting page target information in the application based on the communication service.

[0088] In step S440, a communication service is established in the dynamic link library. Taking a mobile phone using the iOS system as an example, the iOS terminal device is used as a server, and a third-party component usbmuxd is used to create USB (Universal Serial Bus) service support, a third-party component GCDAsyncSocket is used to create a Socket, and a third-party component is used to create HTTP (Hypertext Transfer Protocol), etc., so that service communication supporting multiple protocols can be realized, the process of customizing interactive data is simplified, and the access development cost is realized quickly and efficiently. Among them, the usbmuxd service here is mainly used to realize multi-channel TCP connection on the USB protocol, abstracting USB communication into TCP communication, GCDAsyncSocket is an asynchronous interactive socket communication completed by Apple's multi-tasking mechanism, and the Socket here is also a socket, which is an abstraction of the endpoint for two-way communication between application processes on different hosts in the network, and is an interface for communication and interaction between the application and the network protocol root.

[0089] In step S450, the page target information in the application is collected based on the communication service. For example, when the iOS application has source code, the dynamic link library can be loaded into the application through Xcode, and then the application can be packaged directly. After compilation and packaging, the application can be installed and run directly, and the page elements in the application, that is, the page target elements, are obtained by requesting the communication service interface protocol established in the dynamic link library.

[0090] In some embodiments, Figure 4 As shown, the step S400 of "loading the dynamic link library into the application" specifically includes:

[0091] S460, obtaining an executable file generated after the application is compiled and packaged;

[0092] S470: Load the dynamic link library into the executable file.

[0093] In step S460, an executable file generated after the application is compiled and packaged is obtained.

[0094] In step S470, the dynamic link library is loaded into the executable file. In actual applications, when the iOS application does not have the application source code, the dynamic link library needs to be manually injected. At this time, a third-party tool is needed to inject the dynamic link library into the binary file of the application. The binary file here translates the program data into machine code and outputs it to the disk for storage. After the iOS application is compiled and packaged, the corresponding iOS system binary executable file will be generated.

[0095] In some embodiments, Figure 5 As shown, the application information collection method mentioned in this application specifically also includes the steps of:

[0096] S500, obtaining a control variable corresponding to the control information and a control method called by the control variable;

[0097] S600, serialize the control variables and control methods to generate sequence information.

[0098] In step S500, the embodiment of the present application needs to read the control properties. At this time, it is necessary to obtain the control information in the initial page information, obtain the control variables corresponding to the control information, and the control methods called by the control variables. In actual applications, the native RunTime framework of ios can be used to obtain a list of all functions of the current control page, and obtain a list of all variable properties of the current control page, that is, control variables, to list all control variables and control methods of the receiver, as well as their types and values.

[0099] In step S600, the control variables and control methods are serialized to generate sequence information, where the sequence information indicates that the control variables and methods are processed and arranged in a certain format. For example, the control variables and control methods are serialized into a json (JS Object Notation) structure to enhance readability and facilitate sending to the business page through the interface, that is, the page where the user needs to view the sequence information, and then the business page is converted and displayed into easy-to-understand control elements according to the corresponding fields.

[0100] In some embodiments, Figure 6 As shown, the application information collection method mentioned in this application specifically also includes the steps of:

[0101] S700, obtaining a first signature certificate corresponding to the dynamic link library and a second signature certificate corresponding to the executable file;

[0102] S800, determining whether the signatures of the first signature certificate and the second signature certificate are the same;

[0103] S900: If yes, it is determined that the dynamic link library is loaded normally.

[0104] In step S700, the embodiment of the present application needs to sign the dynamic link library to obtain a first signature certificate, and needs to sign the executable file to obtain a second signature certificate. The embodiment of the present application needs to obtain the first signature certificate and the second signature certificate, where the first signature certificate and the second signature certificate are development certificates of the application.

[0105] In step S800, it is determined whether the signatures of the first signature certificate and the second signature certificate are identical. If they are not identical, it indicates that the dynamic link library is not loaded normally.

[0106] In step S900, if the signatures of the first signature certificate and the second signature certificate are the same, it is determined that the dynamic link library is loaded normally. Since the non-jailbroken device must be signed by the same certificate, the first signature certificate and the second signature certificate must be signed by the same certificate to run normally.

[0107] In some embodiments, Figure 7 As shown, in actual applications, first create an ios dynamic link library, then read the basic information of the application, then get all the elements in the page view from the Window in the memory, then get the function list and attributes of the element based on RunTime, create a communication service and export the data, and finally connect the dynamic library. You can test the source code link of the application or test the installation package link of the application, and then you can get the page target information of the page through the application.

[0108] In an embodiment of the present application, an initial link project, application information of an application, and initial page information of the application are obtained, and then the obtained application information and initial page information are imported into the initial link project to generate a dynamic link project, and then the dynamic link project is compiled to obtain a dynamic link library, and finally the dynamic link library is loaded into the application, so that the application can collect the page target information of the application according to the dynamic link library. The present application links the dynamic link library after the application development is completed, and collects the page target information through the dynamic link library, without intruding into the functional code of the application, and without using the native test framework of the operating system, which can ensure that the developer does not need to specially develop the test script for the corresponding page control when developing the application, and quickly obtains the initial page information of the application according to user needs.

[0109] In a second aspect, an embodiment of the present application further provides an application information collection system for executing the application information collection method mentioned in the embodiment of the first aspect.

[0110] In some embodiments, Figure 8As shown, the application information collection system includes an acquisition module 100, an import module 200, a compilation module 300 and a collection module 400. The acquisition module 100 acquires the initial link project, the application information of the application and the initial page information of the application. The import module 200 imports the acquired application information and the initial page information into the initial link project to generate a dynamic link project. The compilation module 300 compiles the dynamic link project to obtain a dynamic link library. The collection module 400 loads the dynamic link library into the application so that the application can collect the page target information of the application according to the dynamic link library. This application links to the dynamic link library after the application development is completed. The page target information is collected through the dynamic link library without intruding into the functional code of the application and without using the native test framework of the operating system. It can ensure that developers do not need to specially develop test scripts for corresponding page controls when developing applications, and quickly obtain the initial page information of the application according to user needs.

[0111] In a third aspect, an embodiment of the present application also provides an electronic device.

[0112] In some embodiments, the electronic device includes: at least one processor, and a memory communicatively connected to the at least one processor; wherein the memory stores instructions, and the instructions are executed by the at least one processor so that when the at least one processor executes the instructions, any application information collection method in the embodiments of the present application is implemented.

[0113] The processor and the memory may be connected via a bus or other means.

[0114] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer executable programs, such as the application information collection method described in the embodiment of the present application. The processor implements the above-mentioned application information collection method by running the non-transitory software programs and instructions stored in the memory.

[0115] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store and execute the above-mentioned application information collection method. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0116] The non-transient software programs and instructions required to implement the above-mentioned application information collection method are stored in the memory, and when executed by one or more processors, the application information collection method mentioned in the above-mentioned first aspect embodiment is executed.

[0117] In a fourth aspect, embodiments of the present application also provide a computer-readable storage medium.

[0118] In some embodiments, a computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to execute the application information collection method mentioned in the embodiment of the first aspect.

[0119] In some embodiments, the storage medium stores computer executable instructions, which are executed by one or more control processors, for example, by a processor in the above-mentioned electronic device, so that the above-mentioned one or more processors can execute the above-mentioned application information collection method.

[0120] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0121] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0122] The embodiments of the present application are described in detail above in conjunction with the accompanying drawings, but the present application is not limited to the above embodiments. Various changes can be made within the knowledge of ordinary technicians in the relevant technical field without departing from the purpose of the present application. In addition, the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

Claims

1. An application information collection method, characterized in that: include: Get the initial link project, application information of the application and initial page information; The initial page information of the application is obtained by the following steps: obtaining a page view of a preset application, wherein the page view is used to display the distribution of all contents of the document in the application on the entire page and the position of the entire document on each page; Filter the internal sub-controls in the page view, traverse and read the page view, obtain the class name, memory address, control coordinates, user interaction attributes and gesture recognition of the internal sub-controls; extract the page initial information in the filtered page view, the page initial information includes control information; obtain the control variables corresponding to the control information and the control methods called by the control variables; serialize the control variables and the control methods to generate sequence information; the application information of the application includes the application name, package name, version, device type, screen width and height, screen ratio, and currently obtained screenshots; Importing the application information and the page initial information into the initial link project to generate a dynamic link project; Compile the dynamic link project to obtain a dynamic link library; Loading the dynamic link library into the application program so that the application program collects page target information according to the dynamic link library; The loading of the dynamic link library into the application comprises: determining the operating system used by the application based on the application information; acquiring a development tool for the operating system; and loading the dynamic link library into the preset application through the development tool.

2. The application information collection method according to claim 1, characterized in that: The method of enabling the application to collect page target information according to the dynamic link library includes: Establishing a communication service in the dynamic link library; The page target information in the application is collected based on the communication service.

3. The application information collection method according to claim 1, characterized in that: The step of loading the dynamic link library into the application program comprises: Obtaining an executable file generated after compiling and packaging the application; The dynamic link library is loaded into the executable file.

4. The application information collection method according to claim 3, characterized in that: The method further comprises: Obtaining a first signature certificate corresponding to the dynamic link library and a second signature certificate corresponding to the executable file; Determining whether the signatures of the first signature certificate and the second signature certificate are identical; If so, it is determined that the dynamic link library is loaded normally.

5. Application information collection system, including: Acquisition module: The acquisition module is used to acquire the initial link project, application information of the application program and initial page information; The initial page information of the application is obtained by the following steps: obtaining a page view of a preset application, wherein the page view is used to display the distribution of all contents of the document in the application on the entire page and the position of the entire document on each page; Filter the internal sub-controls in the page view, traverse and read the page view, obtain the class name, memory address, control coordinates, user interaction attributes and gesture recognition of the internal sub-controls; extract the page initial information in the filtered page view, the page initial information includes control information; obtain the control variables corresponding to the control information and the control methods called by the control variables; serialize the control variables and the control methods to generate sequence information; the application information of the application includes the application name, package name, version, device type, screen width and height, screen ratio, and currently obtained screenshots; Import module: the import module is used to import the application information and the page initial information into the initial link project to generate a dynamic link project; Compilation module: the compilation module is used to compile the dynamic link project to obtain a dynamic link library; Acquisition module: the acquisition module is used to load the dynamic link library into the application program, so that the application program acquires page target information according to the dynamic link library; The loading of the dynamic link library into the application comprises: determining the operating system used by the application based on the application information; acquiring a development tool for the operating system; and loading the dynamic link library into the preset application through the development tool.

6. An electronic device, characterized in that include: at least one processor, and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions, and the instructions are executed by the at least one processor, so that the at least one processor implements the application information collection method according to any one of claims 1 to 4 when executing the instructions.

7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to execute the application information collection method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Method and apparatus for automatically generating software item encoding file by metadata

    CN105224377A

  • Method and device for obtaining application functions based on iOS platform

    CN106325847A