A method, device, equipment and storage medium for automatically collecting application online messages
By implementing automated control on a personal computer PC, automatically downloading and installing mobile APPs, and collecting their online messages, the time-consuming and labor-intensive problem of manual sampling is solved, and the efficiency of automated message sampling is achieved.
Patent Information
- Application Number
- CN202010575271.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-22
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2040-06-22
AI Technical Summary
In the prior art, mobile APP packets can only be manually sampled, which makes them boring and time-consuming and labor-intensive, and cannot meet the demand for accurate packet sampling in the big data era.
By realizing automated control on a personal computer PC, connecting to the mobile terminal with a data cable, downloading and installing applications that need to be captured, controlling the mobile terminal to send Internet access messages, and automatically collecting application Internet access messages of the mobile terminal through hotspot WIFI.
It realizes automated packet capture and sampling, breaks through the human resources bottleneck, releases human resources, and improves the efficiency of large-scale Internet protocol accurate message sampling.
Smart Images

Figure CN113923111B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent network communication technology, and in particular to a method, device and storage medium for automatically collecting application online messages. Background Art
[0002] Internet protocol development provides the basic capabilities of intelligent pipelines and big data analysis for various products. Internet protocol development relies on accurate message sampling of traffic generated by each APP (Application) when surfing the Internet.
[0003] The APP installed on the mobile phone has a unique identifier: the iOS system bundleID (Bundle identifier, application ID), the Android system packageName (package name). Through the unique identifier of each APP, you can use a PC (Personal Computer) to control the operation of clicking the interface controls of the mobile phone APP through Appium. Appium is an open source automated testing tool that supports driving applications on iOS and Android platforms.
[0004] Tcpdump is a packet capture tool that runs in the command line. When the PC turns on the wifi (wireless network) hotspot and the mobile phone connects to the wifi to access the Internet, tcpdump can be used on the PC to capture all the traffic generated by the mobile phone's Internet access.
[0005] The APP Internet traffic is captured manually. The specific process is as follows:
[0006] Step 1. Connect your phone to wifi
[0007] Step 2: Install the APP that needs to capture packets on your phone
[0008] Step 3: Enable the packet capture function for mobile Internet traffic on the PC
[0009] Step 4: Find the APP that needs to be captured on your phone and open it to perform business operations
[0010] Step 5: Stop the mobile phone packet capture function on the PC
[0011] Manual packet sampling is tedious, time-consuming and laborious, and there are thousands of Internet protocols. Manual packet sampling alone cannot keep up with the needs of the big data era. Summary of the invention
[0012] The main purpose of the embodiments of the present invention is to propose a method, device and storage medium for automatically collecting application Internet messages, aiming to overcome the defect that mobile phone APP messages can only be sampled manually, break through the limitation of manpower bottleneck, and achieve the effect of automated message capture and sampling.
[0013] To achieve the above object, an embodiment of the present invention provides a method for automatically collecting application Internet access messages, the method comprising the following steps:
[0014] When the mobile terminal is connected to the personal computer PC via a data line and connected to the hotspot WIFI turned on by the PC, the PC controls the mobile terminal to download and install the application that needs to be captured via the data line;
[0015] After the mobile terminal completes downloading and installing the application, the PC controls the mobile terminal to send an Internet access message for the application via a data line;
[0016] During the period when the mobile terminal sends the Internet access message of the application, the PC automatically collects the Internet access message of the application of the mobile terminal through the hotspot WIFI.
[0017] To achieve the above object, an embodiment of the present invention provides a device for automatically collecting application Internet access messages, including:
[0018] A control module, used for controlling the mobile terminal to download and install the application that needs to be captured through the data line when the mobile terminal is connected to the personal computer PC through a data line and connected to the hotspot WIFI turned on by the PC at the same time, and controlling the mobile terminal to send the Internet access message of the application through the data line after the mobile terminal completes the download and installation of the application;
[0019] The collection module is used to automatically collect the application Internet access messages of the mobile terminal through the hotspot WIFI during the period when the mobile terminal sends the Internet access messages of the application.
[0020] To achieve the above-mentioned purpose, an embodiment of the present invention further proposes a device for automatically collecting application Internet access messages, wherein the device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, and the program implements the steps of the aforementioned method when executed by the processor.
[0021] To achieve the above objectives, the present invention provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the aforementioned method.
[0022] The present invention proposes a method, device and storage medium for automatically collecting application Internet access messages, which overcomes the defect that mobile phone APP messages can only be sampled manually, breaks through the limitation of manpower bottleneck, achieves the effect of automatic message capture and sampling, releases human resources, and improves the efficiency of large-scale Internet protocol accurate message sampling. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 This is a flow chart of a method for automatically collecting application Internet access messages provided in Example 1 of the present invention.
[0024] Figure 2 It is a schematic diagram of a device for automatically collecting application Internet access messages provided in Embodiment 2 of the present invention.
[0025] Figure 3 This is a diagram of the construction of an automated message sampling device provided in an embodiment of the present invention.
[0026] Figure 4 This is a flow chart of automatic message sampling provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0027] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0028] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present invention, and have no special meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.
[0029] Embodiment 1
[0030] like Figure 1 As shown, this embodiment provides a method for automatically collecting application Internet access messages, the method comprising the following steps:
[0031] Step S110: When the mobile terminal is connected to the personal computer PC via a data line and connected to the hotspot WIFI turned on by the PC, the PC controls the mobile terminal to download and install the application that needs to be captured via the data line;
[0032] Step S120: After the mobile terminal completes downloading and installing the application, the PC controls the mobile terminal to send an Internet access message of the application through a data line;
[0033] Step S130: While the mobile terminal is sending the Internet access message of the application, the PC automatically collects the Internet access message of the application of the mobile terminal through the hotspot WIFI.
[0034] Wherein, the mobile terminal includes an Android mobile terminal and an Iphone mobile terminal.
[0035] The embodiment of the present invention also includes: the PC installs and debugs the adb commands required for applications on the Android mobile terminal and the ios-deploy commands required for applications on the Iphone mobile terminal; the PC installs appium for reading interface control information of applications on the Android mobile terminal or the Iphone mobile terminal.
[0036] Specifically, the PC controls the mobile terminal to download and install the application that needs to be captured through the data cable, including: the PC opens the application store on the mobile terminal through the data cable; the PC reads the search box control in the mobile terminal application store through Python+appium, and enters the name of the application that needs to be captured in the search box control to obtain search results; the PC downloads and installs the application in the mobile terminal according to the search results.
[0037] Specifically, the PC controls the mobile terminal to send the Internet access message of the application through the data line, including: the PC reads all controls of the mobile terminal application interface through Python+appium; the PC clicks all the controls of the read mobile terminal application interface in sequence to make the mobile terminal send the Internet access message of the application.
[0038] Embodiment 2
[0039] Figure 2 Schematic diagram of a device for automatically collecting application Internet access messages provided by Embodiment 2 of the present invention, such as Figure 2 As shown, it includes: a control module 201 and a collection module 202.
[0040] The control module 201 is used to control the mobile terminal to download and install the application that needs to be captured through the data line when the mobile terminal is connected to the personal computer PC through a data line and is connected to the hotspot WIFI turned on by the PC at the same time, and to control the mobile terminal to send the Internet access message of the application through the data line after the mobile terminal completes the download and installation of the application; the collection module 202 is used to automatically collect the application Internet access message of the mobile terminal through the hotspot WIFI during the period when the mobile terminal sends the Internet access message of the application.
[0041] Wherein, the mobile terminal includes an Android mobile terminal and an Iphone mobile terminal.
[0042] The embodiment of the present invention also includes: an installation module, which is used for PC to install and debug the adb commands required for applications on the Android mobile terminal and the ios-deploy commands required for applications on the Iphone mobile terminal, and install appium, which is used to read interface control information of applications on the Android mobile terminal or the Iphone mobile terminal.
[0043] Embodiment 3 of the present invention proposes a device for automatically collecting application Internet access messages, characterized in that the device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein the program is executed by the processor to realize the following Figure 1 The specific steps shown.
[0044] Embodiment 4 of the present invention provides a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the following Figure 1 The specific steps shown.
[0045] The present invention adopts the following technical solutions:
[0046] By analyzing the process of manual packet capture, it is found that: Step 1, connecting the mobile phone to wifi is a one-time operation, which can be done manually. Steps 2, 3, 4, and 5 are multiple operations, and each APP needs to be sampled once. Steps 3 and 5 can be implemented through the tcpdump command line. In the present invention, step 2 is changed to automatically install the APP to the mobile phone:
[0047] 21. The PC opens the app store using the unique ID of the mobile app store;
[0048] 22. Find the search box control in the App Store and click to enter the name of the App to be sampled;
[0049] 23. Download and install the APP on your mobile phone;
[0050] 24. After the APP is installed, open the APP settings to allow the use of network and other functions, and obtain the unique identification of the APP;
[0051] 25. Close the app store and APP mobile process.
[0052] In the present invention, step 4 is changed to automatically traverse all controls in the APP:
[0053] 41. PC opens the APP through a unique identifier;
[0054] 42. PC reads all controls on the APP open page and clicks through them one by one;
[0055] At this point, after setting up the sampling device environment (install appium on the PC, turn on the hotspot wifi after connecting to the Internet via network cable, turn on the developer mode on iPhone and Android phones and connect to the wifi turned on by the PC), you can start the automated sampling process.
[0056] The hardware module part of the embodiment of the present invention includes:
[0057] 1. One PC and one network cable.
[0058] 2. One Android phone and one corresponding data cable.
[0059] 3. One iPhone and one corresponding data cable.
[0060] The process of setting up the automatic message sampling equipment is as follows: Figure 3 As shown:
[0061] Step 301: Connect the PC to the Internet via a network cable and enable the hotspot Wi-Fi.
[0062] Step 302: The mobile phone is connected to the PC via a data cable and connected to the Wi-Fi network;
[0063] Step 303: The mobile phone turns on the developer mode;
[0064] Step 304: The PC installs and debugs commands required for apps on Android and iPhone, such as adb, ios-deploy, etc.;
[0065] Step 305: Install appium on the PC and debug it until the interface control information of the APP on Android and iPhone can be read on the PC.
[0066] The process of implementing automatic message sampling is as follows: Figure 4 As shown:
[0067] Step 401: Build the environment and manually Figure 1 The sampling environment is set up as shown;
[0068] Step 402: Automatically install the APP. The PC uses Python+appium to read the controls on the mobile phone APP interface and sends a command to click the controls to complete the APP installation steps;
[0069] Step 403: Start automatic packet capture. Python starts a subprocess to start tcpdump packet capture;
[0070] Step 404: Automatically traverse the APP. Use Python+appium to read all controls on the APP interface, and traverse and click the browsing pages in turn;
[0071] Step 405: Automatically terminate packet capture. Close Python's subprocess for starting tcpdump packet capture.
[0072] The following is combined with Figure 4 The technical scheme of the present invention is further described in detail with specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.
[0073] In the relevant embodiments, the common Taobao APP is used as an example to illustrate the method of automatic sampling. The embodiment equipment uses Mac mini, Xiaomi 8 and iPhone 8. Mac mini controls the mobile phone through python3+appium. The mobile phone turns on the developer mode and the mobile phone language uses English.
[0074] Example 5: Taobao automatic message sampling on Android phone
[0075] Step 501: Mac mini opens Android's Wandoujia through python3+appium, according to the unique identification package name packageName=com.wandoujia.phoenix2 and main control appActivity=com.pp.assistant.activity.PPMainActivity;
[0076] Step 502: the interface control "android.widget.TextSwitcher" is detected, and after clicking, "Mobile Taobao" is automatically input for search;
[0077] Step 503: Click "Install" corresponding to Taobao Mobile in the search results, and click "Install" as prompted until the "Open" control appears, indicating that the installation is complete;
[0078] Step 504: After clicking "Open", click the 'Allow' control in the pop-up window as prompted, and use the adb command on the Mac mini to read all the startup pages of the opened mobile Taobao, and obtain the unique identifier of mobile Taobao packageName = com.taobao.taobao and the main activity appActivity = com.taobao.tao.TBMainActivity;
[0079] Step 505: Use the adb command on the Mac mini to close Wandoujia and Taobao Mobile;
[0080] Step 506: On the Mac mini, Python starts a subprocess to start tcpdump to capture packets;
[0081] Step 507: Mac mini opens Taobao app according to packageName and appActivity of Taobao on the mobile phone, reads all element controls on the interface, and clicks all controls in sequence;
[0082] Step 508: After the traversal is completed, use the adb command on the Mac mini to close Taobao Mobile and kill the subprocess that starts tcpdump to capture packets.
[0083] Example 6: Automatic message sampling of Taobao on iPhone
[0084] Step 601: Mac mini uses python3+appium to open the App Store of iPhone according to the unique identifier bundleID=com.apple.AppStore;
[0085] Step 602: the interface control "Search" is detected, and after clicking, "Mobile Taobao" is automatically input for search;
[0086] Step 603: Click "GET" corresponding to Taobao Mobile in the search results, and click "Install" as prompted until the "Open" control appears, indicating that the installation is complete;
[0087] Step 604: After clicking "Open", click the 'Allow' control in the pop-up window as prompted, and use the ios-deploy command on the Mac mini to find out the unique identifier of Taobao Mobile, bundleID=com.taobao.taobao4iphone;
[0088] Step 605: Close App Store and Taobao on the Mac mini;
[0089] Step 606: On the Mac mini, Python starts a subprocess to start tcpdump to capture packets. The Mac mini opens the Taobao app according to the bundle ID of the mobile Taobao app, reads all element controls on the interface, and clicks all controls in sequence.
[0090] Step 607: After the traversal is completed, close Taobao Mobile on the Mac mini and kill the subprocess that starts tcpdump to capture packets.
[0091] The embodiments of the present invention propose a method, device and storage medium for automatically collecting application Internet access messages, which overcome the defect that mobile phone APP messages can only be sampled manually, break through the limitation of manpower bottleneck, achieve the effect of automatic message capture and sampling, release human resources, and improve the efficiency of large-scale Internet protocol accurate message sampling.
[0092] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0093] In hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. 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 implemented as hardware, or 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 non-transitory medium) and a communication medium (or temporary medium). As known to those of ordinary skill 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 technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can 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.
[0094] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the present invention is not limited thereby. Any modification, equivalent substitution and improvement made by those skilled in the art without departing from the scope and essence of the present invention shall be within the scope of the present invention.
Claims
1. A method for automatically collecting application Internet access messages, characterized in that: The method comprises the following steps: When the mobile terminal is connected to a personal computer PC via a data line and connected to a hotspot WIFI turned on by the PC, the PC controls the mobile terminal to download and install the application that needs to be captured via the data line; After the mobile terminal completes downloading and installing the application, the PC reads and clicks on all controls of the mobile terminal application interface in sequence through a data cable and Python+appium, so that the mobile terminal sends an Internet access message of the application; During the period when the mobile terminal sends the Internet access message of the application, the PC automatically collects the Internet access message of the application of the mobile terminal through the hotspot WIFI.
2. The method according to claim 1, characterized in that The mobile terminals include Android mobile terminals and Iphone mobile terminals.
3. The method according to claim 2, characterized in that Also includes: The PC installs and debugs the adb command required for the application on the Android mobile terminal and the ios-deploy command required for the application on the iPhone mobile terminal; The PC is installed with appium, which is used to read the interface control information of the application on the Android mobile terminal or the Iphone mobile terminal.
4. The method according to claim 3, characterized in that: The PC controls the mobile terminal to download and install the application that needs to be captured through the data line, including: The PC opens the application store on the mobile terminal via a data cable; The PC reads the search box control in the mobile terminal application store through Python+appium, and inputs the name of the application to be captured in the search box control to obtain search results; The PC downloads and installs the application in the mobile terminal according to the search result.
5. A device for automatically collecting application Internet access messages, characterized in that: include: The control module is used to control the mobile terminal to download and install the application that needs to be captured through the data line when the mobile terminal is connected to the personal computer PC through a data line and connected to the hotspot WIFI turned on by the PC at the same time, and after the mobile terminal completes the download and installation of the application, read and click all the controls of the application interface of the mobile terminal through the data line and Python+appium in sequence, so that the mobile terminal sends the Internet access message of the application; The collection module is used to automatically collect the application Internet access messages of the mobile terminal through the hotspot WIFI during the period when the mobile terminal sends the Internet access messages of the application.
6. The device according to claim 5, characterized in that The mobile terminals include Android mobile terminals and Iphone mobile terminals.
7. The device according to claim 6, characterized in that Also includes: The installation module is used for PC installation and debugging of adb commands required for applications on the Android mobile terminal and ios-deploy commands required for applications on the Iphone mobile terminal, as well as installation of appium for reading interface control information of applications on the Android mobile terminal or the Iphone mobile terminal.
8. A device for automatically collecting application Internet access messages, characterized in that: The device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the steps of the method for automatically collecting application Internet access messages as described in any one of claims 1 to 4 are realized.
9. A storage medium for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the method for automatically collecting application Internet access messages described in any one of claims 1 to 4.
Citation Information
Patent Citations
Android malicious code detection device and method based on dynamic activation and behavior monitoring
CN104182688A