A method and system for testing compatibility of APP applications based on smart terminals

By generating virtual user behavior sequences and utilizing blockchain technology, the problems of compatibility testing efficiency and credibility of smart terminal APPs are solved, and efficient and reliable compatibility testing and result verification are achieved.

CN119377128BActive Publication Date: 2025-04-18SHENZHEN ZHAOYUAN TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411963730.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-18
Estimated Expiration
2044-12-30

AI Technical Summary

Technical Problem

When performing application APP compatibility test on smart terminals, traditional methods are time-consuming and labor-intensive and difficult to fully cover complex user operation scenarios. Outsourcing tests also have problems with data security and credibility of test results.

Method used

By collecting real user operation behavior data for preprocessing, combining long and short-term memory network models to generate virtual user behavior sequences, replacing traditional manually written test cases, and automatically performing tests in different smart terminal environments. Blockchain technology is used to hash the test results and a consensus mechanism to generate a chain structure to ensure the immutability and traceability of the test results.

Benefits of technology

It greatly improves test efficiency and coverage, improves test execution efficiency and consistency, ensures the credibility and transparency of test results, especially in outsourcing test scenarios, which effectively ensures data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119377128B_ABST
    Figure CN119377128B_ABST
Patent Text Reader

Abstract

The present invention discloses a compatibility testing method and system for an application APP based on a smart terminal, which relates to the field of application testing technology, including collecting real user operation behavior data and preprocessing it; using the preprocessed real user operation behavior data in combination with a long short-term memory network model to generate a virtual user behavior sequence; replacing the traditional manually written test cases with virtual user behavior sequences, automatically performing compatibility testing of application APPs in different smart terminal environments, and obtaining test result data; hashing the test result data of each compatibility test to obtain a hash value of the test result data. The present invention greatly improves test efficiency and coverage by combining a long short-term memory network model to generate a virtual user behavior sequence, automated testing tools, and blockchain technology, and ensures that the test results cannot be tampered with and are traceable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of application testing technology, and in particular to a method and system for testing the compatibility of an application APP based on a smart terminal. Background Art

[0002] With the rapid development of mobile Internet, there are many types of applications (APPs) on smart terminals and diverse user needs, which leads to greater challenges for developers in APP compatibility testing. Due to the large differences in hardware configuration, operating system version, screen resolution and network environment of smart terminals, the compatibility of APPs has become one of the main difficulties in the development process. Traditional compatibility testing usually relies on manually writing test cases and verifying them on different devices. This method not only consumes a lot of time and manpower, but also makes it difficult to fully cover complex user operation scenarios.

[0003] In the actual development process, enterprises usually outsource part of the development and testing tasks to third-party companies to reduce costs and improve efficiency. However, outsourcing testing has problems such as data security and the credibility of test results, especially the transparency of the test process and the risk of tampering with test results. Summary of the invention

[0004] In view of the above existing problems, the present invention is proposed.

[0005] Therefore, the present invention provides an application APP compatibility testing method and system based on a smart terminal to solve the problem of unreliable test results in outsourced testing scenarios.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] In a first aspect, an embodiment of the present invention provides an application APP compatibility testing method based on a smart terminal, which includes collecting real user operation behavior data and performing preprocessing;

[0008] Using the pre-processed real user operation behavior data and combining it with the long short-term memory network model, a virtual user behavior sequence is generated;

[0009] Virtual user behavior sequences replace traditional manually written test cases, automatically perform compatibility tests on application apps in different smart terminal environments, and obtain test result data;

[0010] Perform hashing on the test result data of each compatibility test to obtain a hash value of the test result data;

[0011] Combine the hash value of the test result data, the test execution time, the smart terminal information and the block hash value of the previous test to generate the corresponding block, and form the block into a chain structure through the consensus mechanism to obtain the compatibility test blockchain;

[0012] The compatibility test results can be verified and traced through the test data in the compatibility test blockchain.

[0013] As a preferred solution of the application APP compatibility testing method based on smart terminals described in the present invention, wherein: the real user operation behavior data includes operation timestamp, operation type, operation location, operation duration, operation target and smart terminal information; the preprocessing includes data cleaning, data standardization and data segmentation; the virtual user behavior sequence includes operation sequence ID, operation type sequence, operation location sequence, operation time sequence, operation duration sequence and feedback simulation; the different smart terminal environments include smart terminal type, operating system version, screen resolution, hardware configuration and network environment; the test result data includes smart terminal information, operation sequence data and system response data.

[0014] As a preferred solution of the application APP compatibility test method based on smart terminal described in the present invention, wherein: using the pre-processed real user operation behavior data, combined with the long short-term memory network model, to generate a virtual user behavior sequence, the specific steps are as follows:

[0015] The preprocessed real user operation behavior data is used as the training set and test set for the long short-term memory network model training;

[0016] Initialize the LSTM network model based on the deep learning framework. The input layer of the model receives the preprocessed user operation behavior data. The hidden layer is used to capture the dependencies in the operation duration. The output layer is responsible for generating predicted virtual user behaviors and training the LSTM network model.

[0017] Use the trained long short-term memory network model to generate virtual user behavior sequences under given smart terminal types and operating environments;

[0018] The generated virtual user behavior sequence is compared with the actual test case to ensure its rationality and completeness, and to ensure that the virtual behavior can cover the operation scenarios of real users.

[0019] As a preferred solution of the application APP compatibility testing method based on smart terminals described in the present invention, the virtual user behavior sequence replaces the traditional manually written test cases, automatically performs the compatibility test of the application APP in different smart terminal environments, and obtains the test result data. The specific steps are as follows:

[0020] The generated virtual user behavior sequence is imported into the automated testing tool Appium by calling the interface API programmatically, replacing the traditional manually written test cases.

[0021] In different smart terminal environments, the automated testing tool Appium executes each operation step by step according to the virtual user behavior sequence;

[0022] The automated testing tool Appium collects test result data after executing virtual user behavior sequences in each smart terminal environment.

[0023] As a preferred solution of the application APP compatibility test method based on smart terminals of the present invention, wherein: the smart terminal information in the test result data includes the specific model of the smart terminal, the operating system version, the screen resolution, the hardware configuration and the network environment; the operation sequence data in the test result data includes the operation timestamp, the operation type, the operation location, the operation duration and the operation target; the system response data in the test result data includes the response time, the response result and the error information;

[0024] The test result data of each compatibility test is hashed to obtain the hash value of the test result data. The specific steps are as follows:

[0025] Organize the collected test result data into a structured format of intelligent terminal information, operation sequence data, and system response data, and save it in JSON;

[0026] The formatted test result data is converted into a string form to obtain a test result data string;

[0027] The test result data string is hashed using the SHA-256 encryption algorithm to obtain a fixed-length test result data hash value.

[0028] As a preferred solution of the application APP compatibility test method based on smart terminals described in the present invention, wherein: combining the test result data hash value, test execution time, smart terminal information and the block hash value of the previous test, generating the corresponding block, and forming the block into a chain structure through a consensus mechanism to obtain a compatibility test blockchain, the specific steps are as follows:

[0029] Deploy blockchain nodes both in the cloud and on-premises at outsourcing companies to form a hybrid node network;

[0030] The node obtains the hash value of the previous block and builds the current block;

[0031] Hash all the contents of the current block to generate the hash value of the current block;

[0032] The block is verified through the delegated proof-of-stake consensus mechanism. Once the verification is passed, the block is added to the blockchain to obtain a compatibility test blockchain.

[0033] As a preferred solution of the application APP compatibility testing method based on smart terminals described in the present invention, the specific steps of verifying and tracing the compatibility test results are as follows:

[0034] When a compatibility test result needs to be verified, the hash value of the test result is queried through the blockchain;

[0035] Compare the found hash value with the recalculated test result hash value;

[0036] If the hash values ​​are consistent, it means the test results have not been tampered with;

[0037] If they are inconsistent, it means that the test data may have been modified;

[0038] Through the chain structure stored in the blockchain, the history of each test can be traced;

[0039] By tracing back multiple blocks, we can analyze whether the test results of the application APP on different smart terminals and environments are consistent, and discover long-term compatibility issues or compatibility defects in specific versions.

[0040] In a second aspect, the present invention provides an application APP compatibility testing system based on a smart terminal, including a data collection and preprocessing module, a user behavior modeling module, an automated test execution module, a test result hashing module, a block generation and blockchain storage module, and a test result verification and tracing module;

[0041] The data collection and preprocessing module is used to collect real user operation behavior data and perform preprocessing;

[0042] The user behavior modeling module is used to generate a virtual user behavior sequence by using the pre-processed real user operation behavior data in combination with a long short-term memory network model;

[0043] The automated test execution module is used to replace the traditional manually written test cases with virtual user behavior sequences, automatically perform compatibility tests on application APPs in different smart terminal environments, and obtain test result data;

[0044] The test result hashing module is used to perform hashing on the test result data of each compatibility test to obtain a hash value of the test result data;

[0045] The block generation and blockchain storage module is used to combine the hash value of the test result data, the test execution time, the smart terminal information and the block hash value of the previous test to generate the corresponding block, and form the block into a chain structure through a consensus mechanism to obtain a compatibility test blockchain;

[0046] The test result verification and tracing module is used to verify and trace the compatibility test results through the test data in the compatibility test blockchain.

[0047] In a third aspect, an embodiment of the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, any step of the application APP compatibility testing method based on the smart terminal as described in the first aspect of the present invention is implemented.

[0048] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, any step of the application APP compatibility testing method based on a smart terminal as described in the first aspect of the present invention is implemented.

[0049] The beneficial effects of the present invention are as follows: by combining the long short-term memory network model to generate virtual user behavior sequences, it is possible to replace traditional manually written test cases, greatly improving the test efficiency. Virtual user behavior sequences can cover complex user operation scenarios, solving the problem of insufficient coverage of traditional tests. With the help of automated testing tools, tests are automatically executed in a variety of smart terminal environments, further improving the execution efficiency and consistency of tests. The test results are hashed using blockchain technology, and a chain structure is generated through a consensus mechanism to ensure the immutability and traceability of the test results. This feature is particularly important in outsourced testing scenarios, which can effectively ensure the security of data and the transparency of the testing process, and enhance the credibility of test results. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0051] Figure 1 This is a flow chart of the application APP compatibility testing method based on smart terminals in Example 1.

[0052] Figure 2 This is a flowchart for obtaining a virtual user behavior sequence in Example 1. DETAILED DESCRIPTION

[0053] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.

[0054] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0055] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0056] Example 1, reference Figure 1 and Figure 2 , which is the first embodiment of the present invention, and provides an application APP compatibility testing method based on a smart terminal, comprising the following steps:

[0057] S1. Collect real user operation behavior data and pre-process it, including the following steps:

[0058] Real user operation behavior data includes operation timestamp, operation type, operation location, operation duration, operation target and smart terminal information; preprocessing includes data cleaning, data standardization and data segmentation; virtual user behavior sequence includes operation sequence ID, operation type sequence, operation location sequence, operation time sequence, operation duration sequence and feedback simulation; different smart terminal environments include smart terminal type, operating system version, screen resolution, hardware configuration and network environment; test result data includes smart terminal information, operation sequence data and system response data.

[0059] After the user agrees, the real user operation behavior data is collected by, but not limited to, embedding a logging module in the application code to automatically capture the user's operation behavior data. All user identity-related information will be anonymized. Data collection follows the principle of data minimization.

[0060] When storing, use encryption storage technology (such as AES encryption) to encrypt data stored locally or in the cloud to ensure that even if the data is obtained, it cannot be read directly.

[0061] During data transmission, encryption protocols (such as HTTPS or TLS) are used to ensure the security of data when it is transmitted on the network, preventing the data from being intercepted or tampered with during transmission.

[0062] Regularly clean up expired or useless data to ensure that user operation behavior data is not stored for a long time. You can set the data retention period, and data that exceeds the period will be automatically deleted.

[0063] According to the requirements of privacy protection laws, users have the right to access their operational behavior data and request the deletion of collected data. Therefore, applications should provide channels for users to access and delete data to ensure that users can manage their data independently.

[0064] In particular, data segmentation in preprocessing is to decompose the processed data into independent data sets suitable for model training, validation, and testing. Reasonable data segmentation can ensure the generalization ability of the model and avoid overfitting.

[0065] Data segmentation includes, but is not limited to, segmenting user operation behavior data according to time series, segmenting each step of user operation into behavior segments, and segmenting the data set into a training set, a validation set, and a test set.

[0066] S2. Using the pre-processed real user operation behavior data and combining it with the long short-term memory network model, a virtual user behavior sequence is generated, including the following steps:

[0067] The preprocessed real user operation behavior data is used as the training set and test set for the long short-term memory network model training;

[0068] Initialize the LSTM network model based on the deep learning framework. The input layer of the model receives the preprocessed user operation behavior data. The hidden layer is used to capture the dependencies in the operation duration. The output layer is responsible for generating predicted virtual user behaviors and training the LSTM network model.

[0069] Choose an appropriate loss function (such as mean squared error or cross entropy loss) to measure the difference between the model's predictions and the true user behavior.

[0070] Use the Adam optimization algorithm to minimize the loss function and gradually update the model weights.

[0071] Through multiple iterations, the model is continuously optimized so that it can better predict user operation behavior.

[0072] Through multiple iterations and optimizations, the prediction error of the long short-term memory network model gradually decreases, making the virtual user behavior generated by the model closer to the real user behavior.

[0073] Use the trained long short-term memory network model to generate virtual user behavior sequences under given smart terminal types and operating environments;

[0074] The generated virtual user behavior sequence is compared with the actual test case to ensure its rationality and completeness, and to ensure that the virtual behavior can cover the operation scenarios of real users.

[0075] In particular, by automatically generating reasonable and complete virtual user behavior sequences, the time for manually writing test cases is reduced, while the test coverage and efficiency are improved.

[0076] S3. Virtual user behavior sequences replace traditional manually written test cases, automatically perform compatibility tests on application APPs in different smart terminal environments, and obtain test result data, including the following steps:

[0077] Call Appium's API programmatically (using Python, Java, and other languages) and pass the generated virtual user behavior sequence to Appium as input. Convert the data structure of the virtual user behavior sequence (such as JSON format) into a format that Appium can recognize. Map each operation behavior to an Appium operation command, replacing the traditional manually written test cases.

[0078] In different smart terminal environments, the automated testing tool Appium executes each operation step by step according to the virtual user behavior sequence;

[0079] The Appium tool can automatically execute virtual user behaviors in different smart terminals (device models, operating system versions, etc.) to verify the compatibility of the application on various devices.

[0080] By executing virtual user behaviors through Appium, we can ensure the consistency of operations on different terminals and reduce testing errors caused by device differences.

[0081] The automated testing tool Appium collects test result data after executing virtual user behavior sequences in each smart terminal environment.

[0082] It should be noted that Appium automatically records the operation log when executing each virtual user behavior, capturing the execution results of each operation (such as success, failure). For failed operations (such as element not found, timeout, etc.), record the relevant error log and save the failed screenshot. During the test, Appium can collect performance data such as response time, memory usage, CPU usage, etc. for each operation. Collect the crash logs of the application on different terminals (if a crash occurs).

[0083] S4, hashing the test result data of each compatibility test to obtain a hash value of the test result data, including the following steps:

[0084] The smart terminal information in the test result data includes the specific model of the smart terminal, operating system version, screen resolution, hardware configuration and network environment; the operation sequence data in the test result data includes the operation timestamp, operation type, operation location, operation duration and operation target; the system response data in the test result data includes the response time, response result and error information;

[0085] Organize the collected test result data into a structured format of intelligent terminal information, operation sequence data, and system response data, and save it in JSON;

[0086] It should be noted that by organizing the test result data into JSON format, the data becomes easy to read, analyze and store, which is convenient for subsequent processing and verification. The test results are divided into three parts: intelligent terminal information, operation sequence data and system response data, ensuring a clear data structure for future expansion and use.

[0087] The formatted test result data is converted into a string form to obtain a test result data string;

[0088] It should be noted that the structured test result data is converted into a string format through methods such as json.dumps(), which is convenient for subsequent hash processing. The converted string format retains the details of all test data to ensure the integrity and consistency of the data.

[0089] The test result data string is hashed using the SHA-256 encryption algorithm to obtain a fixed-length test result data hash value.

[0090] It should be noted that SHA-256 (Secure Hash Algorithm 256-bit) is a common hash algorithm. It belongs to the SHA-2 (Secure Hash Algorithm 2) family, designed by the National Security Agency (NSA) of the United States and released by the National Institute of Standards and Technology (NIST). Through the SHA-256 encryption algorithm, a 64-character hash value is generated to uniquely identify the test result data. The generation of the hash value ensures the integrity and immutability of the test result data. Any modification to the original data will result in a significant change in the hash value. The hash value can be used as a means of data verification to ensure that the data subsequently transmitted or stored has not been tampered with.

[0091] S5. Combine the hash value of the test result data, the test execution time, the smart terminal information and the block hash value of the previous test to generate the corresponding block, and form the block into a chain structure through the consensus mechanism to obtain the compatibility test blockchain, including the following steps:

[0092] Deploy blockchain nodes both in the cloud and on-premises at outsourcing companies to form a hybrid node network;

[0093] It should be noted that a blockchain platform that supports the Delegated Proof of Stake consensus mechanism is selected, and one or more blockchain nodes are deployed on the cloud service platform. Each node will be responsible for receiving and verifying blocks as part of the hybrid network. Deploy blockchain nodes on the local infrastructure of the outsourcing company. Ensure that the local nodes are connected to the cloud nodes through the public network. Configure firewalls and security policies to ensure that the communication between nodes is secure and stable. Configure the node's network connection, storage, and computing resources to ensure that the node can operate stably and participate in consensus.

[0094] Configure the blockchain network so that cloud nodes and local nodes can recognize each other and share block data to form a hybrid node network. Set up a peer-to-peer network of nodes to ensure that nodes can communicate with each other over the Internet.

[0095] The node obtains the hash value of the previous block and builds the current block;

[0096] Hash all the contents of the current block to generate the hash value of the current block;

[0097] It should be noted that the Delegated Proof of Stake consensus mechanism is a consensus mechanism based on equity, which verifies blocks by voting to select a portion of nodes as "trustees". These trustees are responsible for verifying blocks and adding them to the blockchain. It has high efficiency and low energy consumption, and is particularly suitable for distributed networks.

[0098] The block is verified through the delegated proof-of-stake consensus mechanism. Once the verification is passed, the block is added to the blockchain to obtain a compatibility test blockchain.

[0099] It should be noted that the efficiency of block verification is greatly improved through the delegated proof-of-stake consensus mechanism, and it is not necessary for every node to participate in the verification, which reduces the burden on the network. Through the trustee verification, it is ensured that all blocks added to the blockchain are legal and verified, avoiding tampering by malicious nodes.

[0100] S6. Verify and trace the compatibility test results through the test data in the compatibility test blockchain, including the following steps:

[0101] When a compatibility test result needs to be verified, the hash value of the test result is queried through the blockchain;

[0102] It should be noted that the hash value of a compatibility test is successfully obtained from the blockchain to prepare for subsequent verification. The hash value in the blockchain ensures the integrity of the test data when it is stored and cannot be tampered with.

[0103] Compare the found hash value with the recalculated test result hash value;

[0104] If the hash values ​​are consistent, it means the test results have not been tampered with;

[0105] If they are inconsistent, it means that the test data may have been modified;

[0106] It should be noted that by comparing the hash values, it is successfully verified whether the test results are consistent with the records in the blockchain, ensuring the reliability of the test data. If the hash values ​​are inconsistent, the possibility of data modification can be quickly discovered, ensuring the credibility of the test data.

[0107] Through the chain structure stored in the blockchain, the history of each test can be traced;

[0108] By tracing back multiple blocks, we can analyze whether the test results of the application APP on different smart terminals and environments are consistent, and discover long-term compatibility issues or compatibility defects in specific versions.

[0109] It should be noted that the chain structure of the blockchain can be used to trace the history of a test and ensure the traceability of data. By analyzing the test results in multiple blocks, long-term compatibility issues or performance differences of the APP in different terminals and environments can be discovered.

[0110] The present embodiment also provides an application APP compatibility testing system based on a smart terminal, including: a data collection and preprocessing module, a user behavior modeling module, an automated test execution module, a test result hashing module, a block generation and blockchain storage module, and a test result verification and tracing module; the data collection and preprocessing module is used to collect real user operation behavior data and perform preprocessing; the user behavior modeling module is used to use the preprocessed real user operation behavior data in combination with a long short-term memory network model to generate a virtual user behavior sequence; the automated test execution module is used to replace the traditional manually written test cases with virtual user behavior sequences, automatically perform compatibility tests of application APPs in different smart terminal environments, and obtain test result data; the test result hashing module is used to hash the test result data of each compatibility test to obtain a hash value of the test result data; the block generation and blockchain storage module is used to combine the hash value of the test result data, the test execution time, the smart terminal information and the block hash value of the previous test to generate a corresponding block, and form a chain structure of the block through a consensus mechanism to obtain a compatibility test blockchain; the test result verification and tracing module is used to verify and trace the compatibility test results through the test data in the compatibility test blockchain.

[0111] This embodiment also provides a computer device, which is suitable for the application APP compatibility testing method based on smart terminals, including: a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute computer executable instructions to implement the application APP compatibility testing method based on smart terminals as proposed in the above embodiment.

[0112] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

[0113] The present embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the method for implementing the application APP compatibility testing based on a smart terminal as proposed in the above embodiment is implemented; the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, referred to as EPROM), programmable read-only memory (Programmable Red-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0114] In summary, the present invention generates virtual user behavior sequences by combining the long short-term memory network model, which can replace traditional manually written test cases and greatly improve the test efficiency. Virtual user behavior sequences can cover complex user operation scenarios, solving the problem of insufficient coverage of traditional tests. With the help of automated testing tools, tests are automatically executed in a variety of smart terminal environments, further improving the execution efficiency and consistency of tests. The test results are hashed using blockchain technology, and a chain structure is generated through a consensus mechanism to ensure the immutability and traceability of the test results. This feature is particularly important in outsourced testing scenarios, which can effectively ensure the security of data and the transparency of the testing process, and enhance the credibility of test results.

[0115] Example 2, referring to Table 1, is the second example of the present invention. To further verify the technical solution of the present invention, experimental simulation data of an application APP compatibility testing method based on a smart terminal is provided.

[0116] In order to verify the effectiveness of the application APP compatibility test method based on smart terminals in the present invention, different smart terminal environments were prepared for the experiment, including different terminal models, operating system versions, screen resolutions and network environments. The experiment collected the operation behavior data of 5,000 real users, including the timestamp, operation type, operation location, operation duration and operation target of the operation. The data was preprocessed, the data cleaning step removed abnormal data, the data standardization step ensured the uniformity of operation data between different devices, and the data segmentation step divided the original operation behavior data into a training set and a test set.

[0117] After preprocessing, the long short-term memory (LSTM) network model is used to train the user operation behavior data. The model input layer accepts the preprocessed operation data, the hidden layer captures the temporal dependency of the operation, and the output layer generates a virtual user behavior sequence. The LSTM model training set used in the experiment has 4,000 operation data and the test set has 1,000 operation data. The trained virtual user behavior sequence includes the operation sequence ID, operation type sequence, operation location sequence, operation time sequence, and feedback simulation, ensuring that the generated virtual user behavior can cover the actual operation scenarios.

[0118] The virtual user behavior sequence is imported into the automated testing tool Appium through the API interface, replacing the traditional manually written test cases. Appium executes the virtual user behavior sequence in three different smart terminal environments (such as high-end, mid-end, and low-end) to collect test result data, including operation timestamp, operation type, operation location, operation duration, and system response data (response time, system feedback, etc.). The test result data is hashed using the SHA-256 algorithm to generate a fixed-length hash value, and the test result data, test time, smart terminal information, and the block hash value of the previous test are recorded in the blockchain to form a compatibility test blockchain.

[0119] The details are shown in Table 1 below:

[0120] Table 1 Compatibility test results table

[0121] Test environment Device Model Operating system version Screen resolution Operation sequence ID Total operations Average response time (ms) High-end equipment iPhone 14 iOS 16 1170x2532 Seq001 150 83 High-end equipment Samsung Galaxy S23 Android 13 1440x3200 Seq001 150 92 Mid-range devices Xiaomi Mi 11 Android 12 1080x2400 Seq001 150 113 Mid-range devices OnePlus 9 Android 12 1080x2400 Seq001 150 117 Low-end devices Redmi Note 10 Android 11 1080x2400 Seq001 150 189 Low-end devices Oppo A53 Android 11 720x1600 Seq001 150 200

[0122] According to the data in the table, it can be clearly seen that there are significant differences in the compatibility performance of different smart terminals when executing virtual user behavior sequences. High-end devices such as iPhone 14 and Samsung Galaxy S23 have an average response time of 83 milliseconds and 92 milliseconds when performing 150 operations, respectively, showing good compatibility and response speed. The average response time of mid-range devices such as Xiaomi Mi 11 and OnePlus 9 increased slightly to 113 milliseconds and 117 milliseconds, respectively, but remained within a reasonable range, showing good adaptability. Low-end devices such as Redmi Note 10 and Oppo A53 showed obvious performance bottlenecks, with response times of 189 milliseconds and 200 milliseconds, respectively, showing poor compatibility when processing complex operations.

[0123] Through these data, we can further analyze that the virtual user behavior sequence introduced in the present invention replaces the traditional manually written test cases and has obvious performance advantages. First, the virtual user behavior sequence can cover more operation scenarios and simulate more complex and realistic user operation behaviors. Compared with traditional test cases, the test scope is wider and more comprehensive. Secondly, the automated execution of the virtual user behavior sequence saves a lot of manual writing and execution time, and improves the test efficiency. Especially in the testing of low-end devices, the virtual user behavior sequence can more quickly discover the performance bottlenecks and compatibility problems of the device.

[0124] Compared with the existing compatibility testing methods, the present invention provides a complete and traceable test data chain by combining the virtual user behavior sequence generated by the long short-term memory network model with the compatibility test blockchain, ensuring the immutability of the test results and the transparency of the data. Through blockchain technology, the hash values ​​of all test results are recorded on the chain, which is convenient for subsequent verification and tracing, which is difficult to achieve in the prior art, reflecting the innovation and unique advantages of the present invention.

[0125] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A compatibility testing method for an application APP based on a smart terminal, characterized by: include, Collect real user operation behavior data and perform preprocessing; Using the pre-processed real user operation behavior data and combining it with the long short-term memory network model, a virtual user behavior sequence is generated; Virtual user behavior sequences replace traditional manually written test cases, automatically perform compatibility tests on application apps in different smart terminal environments, and obtain test result data; Perform hashing on the test result data of each compatibility test to obtain a hash value of the test result data; Combine the hash value of the test result data, the test execution time, the smart terminal information and the block hash value of the previous test to generate the corresponding block, and form the block into a chain structure through the consensus mechanism to obtain the compatibility test blockchain; Through the test data in the compatibility test blockchain, the compatibility test results can be verified and traced; The real user operation behavior data includes operation timestamp, operation type, operation location, operation duration, operation target and smart terminal information; the preprocessing includes data cleaning, data standardization and data segmentation; the virtual user behavior sequence includes operation sequence ID, operation type sequence, operation location sequence, operation time sequence, operation duration sequence and feedback simulation; the different smart terminal environments include smart terminal type, operating system version, screen resolution, hardware configuration and network environment; the test result data includes smart terminal information, operation sequence data and system response data; Using the preprocessed real user operation behavior data and combining it with the long short-term memory network model, a virtual user behavior sequence is generated. The specific steps are as follows: The preprocessed real user operation behavior data is used as the training set and test set for the long short-term memory network model training; Initialize the LSTM network model based on the deep learning framework. The input layer of the model receives the preprocessed user operation behavior data. The hidden layer is used to capture the dependencies in the operation duration. The output layer is responsible for generating predicted virtual user behaviors and training the LSTM network model. Use the trained long short-term memory network model to generate virtual user behavior sequences under given smart terminal types and operating environments; The generated virtual user behavior sequences are compared with actual test cases to ensure that the virtual behaviors can cover the operation scenarios of real users.

2. The method for testing the compatibility of an application APP based on a smart terminal according to claim 1, characterized in that: Virtual user behavior sequences replace traditional manually written test cases, automatically perform compatibility tests on application apps in different smart terminal environments, and obtain test result data. The specific steps are as follows: The generated virtual user behavior sequence is imported into the automated testing tool Appium by calling the interface API programmatically, replacing the traditional manually written test cases. In different smart terminal environments, the automated testing tool Appium executes each operation step by step according to the virtual user behavior sequence; The automated testing tool Appium collects test result data after executing virtual user behavior sequences in each smart terminal environment.

3. The method for testing the compatibility of an application APP based on a smart terminal according to claim 2, characterized in that: The smart terminal information in the test result data includes the specific model of the smart terminal, the operating system version, the screen resolution, the hardware configuration and the network environment; the operation sequence data in the test result data includes the operation timestamp, the operation type, the operation location, the operation duration and the operation target; the system response data in the test result data includes the response time, the response result and the error information; The test result data of each compatibility test is hashed to obtain the hash value of the test result data. The specific steps are as follows: Organize the collected test result data into a structured format of intelligent terminal information, operation sequence data, and system response data, and save it in JSON; The formatted test result data is converted into a string form to obtain a test result data string; The test result data string is hashed using the SHA-256 encryption algorithm to obtain a fixed-length test result data hash value.

4. The method for testing the compatibility of an application APP based on a smart terminal according to claim 3, characterized in that: Combine the test result data hash value, test execution time, smart terminal information and the block hash value of the previous test to generate the corresponding block, and form a chain structure through the consensus mechanism to obtain the compatibility test blockchain. The specific steps are as follows: Deploy blockchain nodes both in the cloud and on-premises at outsourcing companies to form a hybrid node network; The node obtains the hash value of the previous block and builds the current block; Hash all the contents of the current block to generate the hash value of the current block; The block is verified through the delegated proof-of-stake consensus mechanism. Once the verification is passed, the block is added to the blockchain to obtain a compatibility test blockchain.

5. The method for testing the compatibility of an application APP based on a smart terminal according to claim 4, characterized in that: The specific steps to verify and trace the compatibility test results through the test data in the compatibility test blockchain are as follows: When a compatibility test result needs to be verified, the hash value of the test result is queried through the blockchain; Compare the found hash value with the recalculated test result hash value; If the hash values ​​are consistent, it means the test results have not been tampered with; If they are inconsistent, it means that the test data may have been modified; Through the chain structure stored in the blockchain, the history of each test can be traced; By tracing back multiple blocks, we can analyze whether the test results of the application APP on different smart terminals and environments are consistent, and discover long-term compatibility issues or compatibility defects in specific versions.

6. A system for testing the compatibility of an application APP based on a smart terminal, based on the method for testing the compatibility of an application APP based on a smart terminal according to any one of claims 1 to 5, characterized in that: Including data collection and preprocessing module, user behavior modeling module, automated test execution module, test result hashing module, block generation and blockchain storage module and test result verification and traceability module; The data collection and preprocessing module is used to collect real user operation behavior data and perform preprocessing; The user behavior modeling module is used to generate a virtual user behavior sequence by using the pre-processed real user operation behavior data in combination with a long short-term memory network model; The automated test execution module is used to replace the traditional manually written test cases with virtual user behavior sequences, automatically perform compatibility tests on application APPs in different smart terminal environments, and obtain test result data; The test result hashing module is used to perform hashing on the test result data of each compatibility test to obtain a hash value of the test result data; The block generation and blockchain storage module is used to combine the hash value of the test result data, the test execution time, the smart terminal information and the block hash value of the previous test to generate the corresponding block, and form the block into a chain structure through a consensus mechanism to obtain a compatibility test blockchain; The test result verification and tracing module is used to verify and trace the compatibility test results through the test data in the compatibility test blockchain.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the application APP compatibility testing method based on the smart terminal are implemented as described in any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the smart terminal-based application APP compatibility testing method described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • APP software compatibility automatic test method

    CN111984529A