Test method, system, storage medium and electronic device for device fingerprint collection
Through automated testing methods, the device information is obtained and the target message and assertion value is determined, the problem of low efficiency in device fingerprint acquisition testing is solved, automated testing is realized, and efficiency is improved.
Patent Information
- Application Number
- CN202210737216.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-27
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2042-06-27
AI Technical Summary
In the prior art, the testing of equipment fingerprint collection requires manual testing cases through manual labor, resulting in low testing efficiency.
By obtaining device information in the test case, determining the target message and assertion value based on the device information and the interface definition of the test system, extracting the target field value in the target message, and converting the assertion value into a target assertion value matching the target field value format, and determining whether the test case has passed the test based on the target field value and the target assertion value.
The test automation of equipment fingerprint acquisition is realized, the testing efficiency is improved, and the inefficiency problem of manual testing is avoided.
Smart Images

Figure CN115098376B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of financial technology, and specifically, to a testing method, system, storage medium and electronic device for device fingerprint collection. Background Art
[0002] With the rapid development of mobile Internet, the use of mobile client for transactions is very common. However, there are also fraudulent transactions when using mobile client for transactions. How to identify fraudulent transactions is an urgent problem to be solved in the risk field. The current method of identifying fraudulent transactions is to embed SDK or JS on the APP side of the mobile phone to actively collect device information. The SDK obtains a unique device fingerprint through a series of operations based on the collected information. The device fingerprint of the same device is unique, so the device fingerprint can prevent the black industry chain from tampering with the device information to implement fraudulent transactions. However, in the test process of device fingerprint collection, it is usually necessary to manually operate the mobile phone to initiate a transaction, and then manually check whether the device fingerprint is collected, and the test efficiency is very low.
[0003] The test of device fingerprint collection in related technologies requires manual execution of test cases, resulting in low test efficiency. No effective solution has been proposed yet. Summary of the invention
[0004] The present application provides a testing method for device fingerprint collection to solve the problem in the related art that the testing of device fingerprint collection requires manual execution of test cases, resulting in low testing efficiency.
[0005] According to one aspect of the present application, a test method for device fingerprint collection is provided. The method includes: obtaining device information in a test case, wherein the test case is a case for simulating a user initiating a transaction through a device, and a device fingerprint collection device collecting a device fingerprint of the device; determining a target message based on the device information and the interface definition of the test system; obtaining an assertion value corresponding to the target message, wherein the assertion value is used to characterize preset feature information of the device fingerprint; extracting a target field value in the target message, and converting the assertion value into a target assertion value that matches the target field value format; determining whether the test case passes the test based on the target field value and the target assertion value.
[0006] Optionally, determining whether the test case passes the test based on the target field value and the target assertion value includes: comparing the target assertion value and the target field value, if the data type and value of the target assertion value and the target field value are the same, it means that the test case passes the test; if the data type and value of the target assertion value and the target field value are different, it means that the test case fails the test. By comparing the target assertion value and the target field value, it can be determined whether the characteristics of the device fingerprint are incorrect when collected, thereby determining whether the test case passes the test.
[0007] Optionally, determining the target message based on the device information and the interface definition of the test system includes: extracting at least one target parameter based on the device information, wherein the target parameter is used to characterize the characteristic information of the device fingerprint; obtaining the interface definition of the test system, and assembling the target parameter into a message based on the interface definition. By assembling the target parameter into a message, the tester can understand the collection of the device fingerprint.
[0008] Optionally, obtaining the interface definition of the test system, and assembling the target parameters into the target message according to the interface definition includes: obtaining the interface definition, wherein the interface definition includes at least: the interface field length and the type of the received parameter; processing the parameter length of at least one target parameter to obtain an updated target parameter, wherein the parameter length of the updated target parameter matches the interface field length; assembling the updated target parameter into the target message according to the format of the interface definition. By processing the target parameters, the interface of the test system can receive the target parameters.
[0009] Optionally, obtaining the assertion value corresponding to the target message includes: extracting target data from the target parameter; and obtaining the assertion value corresponding to the target message based on the target data. By obtaining the assertion value, it can be determined whether the device fingerprint has changed after being collected.
[0010] Optionally, a conversion rule for converting the assertion value into a target assertion value that matches the target field value format is one of the following: type conversion, length truncation, and value mapping. The conversion rule allows the assertion value to be converted into a target assertion value that can be compared with the target field value.
[0011] Optionally, if the data type and value of the target assertion value and the target field value are different, it means that the test case has failed the test, including: if the data type and value of the target assertion value and the target field value are different, re-running the test case in the test system; if the number of times the test case is re-run in the test system exceeds a preset number, stopping the test case, indicating that the test case has failed the test. By re-running the test case where the data type and value of the target assertion value and the target field value are different, errors in collecting device fingerprints due to environmental factors can be avoided.
[0012] Optionally, before obtaining the device information in the test case, the method further includes: determining whether there is a test case in the test system; if there is a test case in the test system, verifying whether there is an interface definition file in the test system, and if there is an interface definition file, running the test case, wherein the interface definition file is used to edit the content of the interface definition; if there is no test case in the test system, sending a prompt message to the tester. By verifying whether the interface definition file and the test case exist, it is possible to avoid the situation where there are only target parameters but no test case and the test system cannot run.
[0013] According to another aspect of the present application, a test system for device fingerprint collection is provided. The system includes: a data acquisition unit, which is used to acquire device information in a test case and an interface definition of a test system; a data processing unit, which determines a target message based on the device information and the interface definition of the test system, and determines an assertion value corresponding to the target message; a data conversion unit, which is used to extract a target field value in the target message, and convert the assertion value into a target assertion value that matches the target field value format; and a judgment unit, which is used to determine whether the test case passes the test based on the target field value and the target assertion value.
[0014] According to another aspect of an embodiment of the present invention, a computer storage medium is provided, which is used to store a program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute a test method for device fingerprint collection.
[0015] According to another aspect of an embodiment of the present invention, an electronic device is provided, comprising a processor and a memory; the memory stores computer-readable instructions, and the processor is used to execute the computer-readable instructions, wherein a test method for device fingerprint collection is executed when the computer-readable instructions are executed.
[0016] Through this application, the following steps are adopted: obtaining device information in the test case, wherein the test case is a case for simulating a user initiating a transaction through a device, and a device fingerprint collection device collecting the device fingerprint of the device; determining the target message based on the device information and the interface definition of the test system; obtaining the assertion value corresponding to the target message, wherein the assertion value is used to characterize the preset feature information of the device fingerprint; extracting the target field value in the target message, and converting the assertion value into a target assertion value that matches the target field value format; determining whether the test case passes the test based on the target field value and the target assertion value, thereby solving the problem that the test of device fingerprint collection in the related technology requires manual execution of the test case by manpower, resulting in low test efficiency. By comparing the target field value and the target assertion value obtained in the test case to determine whether the test case passes the test, the test of device fingerprint collection is automated and efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 It is a flow chart of a test method for device fingerprint collection provided in an embodiment of the present application;
[0019] Figure 2 is a schematic diagram of a test system for device fingerprint collection provided in an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of a test device for collecting device fingerprints according to an embodiment of the present application;
[0021] Figure 4 is a schematic diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0022] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:
[0026] Device fingerprint: Generate a unique serial number based on a certain algorithm based on device information, which can uniquely identify a device;
[0027] SDK: Software Development Kit, software development kit;
[0028] JS: JavaScript, a lightweight, interpreted or just-in-time compiled programming language with a function-first approach.
[0029] According to an embodiment of the present application, a testing method for device fingerprint collection is provided.
[0030] Figure 1 FIG. 1 is a flow chart of a test method for collecting device fingerprints according to an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:
[0031] Step S102, obtaining device information in a test case, wherein the test case is a case for simulating a user initiating a transaction through a device, and a device fingerprint collection device collecting a device fingerprint of the device.
[0032] Specifically, the test case is a simulation case running in the test system for device fingerprint collection. The simulation case simulates manually initiating a transaction from the APP end and then manually checking the device fingerprint collection situation on the server end. The test case is simulated in the form of adjusting the parameters input into the test system. The device information is the information extracted from the mobile phone when collecting the device fingerprint, and the device information contains the device fingerprint.
[0033] Step S104, determining the target message according to the device information and the interface definition of the test system.
[0034] Specifically, the interface definition regulates the parameters input into the test system to filter the target parameters required in the device information. The target message is determined by the target parameters, and the target message is used by the tester to read the collection status of the device fingerprint.
[0035] Step S106, obtaining an assertion value corresponding to the target message, wherein the assertion value is used to characterize preset feature information of the device fingerprint.
[0036] Specifically, the assertion value is determined based on the target parameters received by the test system. Some parameters in the target parameters can display the collection status of the device fingerprint. The assertion value is the corresponding preset numerical value of some parameters. For example, the assertion value can be Flout0.12 (Flout is a floating point data type), String0.123 (String is a string data type) and 1.
[0037] Step S108, extracting the target field value in the target message, and converting the assertion value into a target assertion value that matches the format of the target field value.
[0038] Specifically, the target field value is a numerical value that represents the device fingerprint feature information. For example, the target field value can be true (indicating that the numerical value is true), and the target assertion value is the assertion value that matches the target field value. For example, if the assertion value is 1, the target assertion value corresponding to the target field value is true.
[0039] Step S110, determining whether the test case passes the test according to the target field value and the target assertion value.
[0040] Specifically, if the target field value and the target assertion value are the same, for example, the target field value and the target assertion value are both true, then the test case passes the test, indicating that the device fingerprint collection is successful.
[0041] The test method for device fingerprint collection provided in the embodiment of the present application obtains the device information in the test case, wherein the test case is a case for simulating a user initiating a transaction through a device, and the device fingerprint collection device collects the device fingerprint of the device; determines the target message based on the device information and the interface definition of the test system; obtains the assertion value corresponding to the target message, wherein the assertion value is used to characterize the preset feature information of the device fingerprint; extracts the target field value in the target message, and converts the assertion value into a target assertion value that matches the target field value format; determines whether the test case passes the test based on the target field value and the target assertion value, thereby solving the problem that the test of device fingerprint collection in the related art requires manual execution of the test case by manpower, resulting in low test efficiency. By comparing the target field value and the target assertion value obtained in the test case to determine whether the test case passes the test, the test of device fingerprint collection is automated and efficient.
[0042] To determine whether a test case passes the test, it is necessary to compare the target field value and the target assertion value. Optionally, in the test method for device fingerprint collection provided in an embodiment of the present application, determining whether the test case passes the test is based on the target field value and the target assertion value, including: comparing the target assertion value and the target field value. If the data type and value of the target assertion value and the target field value are the same, it indicates that the test case passes the test; if the data type and value of the target assertion value and the target field value are different, it indicates that the test case fails the test.
[0043] For example, if the target field values are String0.12, String0.12, and true, and the target assertion values are String0.12, String0.12, and true, and the data types and values of the target assertion values and the target field values are the same, the test case passes the test and the device fingerprint is successfully collected; if the target field values are String0.12, String0.12, and true, and the target assertion values are String0.11, String0.12, and 1, and the values of String0.12 and String0.11 are different, and the data types of true and 1 are different, the test case fails the test. By comparing the target assertion value and the target field value, it can be determined whether there is an error in the collection of the device fingerprint features, thereby determining whether the test case passes the test.
[0044] Before obtaining the target field value, it is necessary to obtain the message output by the test system. Optionally, based on the device information and the interface definition of the test system, determining the target message includes: extracting at least one target parameter based on the device information, wherein the target parameter is used to characterize the characteristic information of the device fingerprint; obtaining the interface definition of the test system, and assembling the target parameters into a message based on the interface definition.
[0045] Specifically, the target parameter is a state parameter associated with the device fingerprint, which can represent the characteristic information of the device fingerprint. The interface definition regulates the target parameter input into the test system. By assembling the target parameter into a message, the tester can understand the collection of the device fingerprint.
[0046] Before the target parameters are input into the test system, the target parameters need to be updated to target parameters that match the interface. Optionally, the interface definition of the test system is obtained, and the target parameters are assembled into a target message according to the interface definition, including: obtaining the interface definition, wherein the interface definition includes at least: the interface field length, the type of the received parameter; processing the parameter length of at least one target parameter to obtain an updated target parameter, wherein the parameter length of the updated target parameter matches the interface field length; and assembling the updated target parameters into a target message according to the format of the interface definition.
[0047] Specifically, the interface definition specifies the target parameter format for input into the test system. For example, the field of target parameter A is String0.123456789, and the interface field length is limited to 4 digits in the interface definition. Then the field of target parameter A needs to be updated to String0.123 to be received by the test system. The data type of target parameter B is Double, and the types of received parameters in the interface definition only include String, Int (integer data type), and Flout. Then target parameter B cannot be input into the test system. By processing the target parameters, the interface of the test system can receive the target parameters.
[0048] The assertion value needs to correspond to the target message. Optionally, obtaining the assertion value corresponding to the target message includes: extracting target data in the target parameter; and obtaining the assertion value corresponding to the target message based on the target data.
[0049] Specifically, the target data is the field value corresponding to the target message. By obtaining the assertion value, it can be determined whether the device fingerprint has changed after being collected.
[0050] The assertion value needs to be converted through a conversion rule to obtain a target assertion value. Optionally, the conversion rule for converting the assertion value into a target assertion value that matches the target field value format is one of the following: type conversion, length truncation, and value mapping.
[0051] An example of the conversion rule is shown in Table 1.
[0052] Table 1
[0053] Conversion rules Target field value Asserting Values Target assertion value Type conversion String0.12 Flout0.12 String0.12 Length cut String0.12 String0.123 String0.12 Value Mapping true 1 true
[0054] Determining whether a test case passes the test requires running the test case in a test system. Optionally, if the data type and numerical value of a target assertion value differ from that of a target field value, it indicates that the test case fails the test, including: if the data type and numerical value of a target assertion value differ from that of a target field value, re-running the test case in the test system; if the number of times the test case is re-run in the test system exceeds a preset number, stopping running the test case, indicating that the test case fails the test.
[0055] Specifically, during the process of the test system running the test case, if the test system determines that the data type and value of the target assertion value and the target field value are the same, it means that the test case passes the test. If the test system determines that the data type and value of the target assertion value and the target field value are different, the test system reruns the test case. The number of reruns is limited by a preset number of times in the test system. For example, if the X test case is run three times in the test system, and the test result each time is that the data type and value of the target assertion value and the target field value are different, the test case fails the test. By rerunning the test case in which the data type and value of the target assertion value and the target field value are different, errors caused by environmental factors when collecting device fingerprints can be avoided.
[0056] Before the test system runs the test case, it is necessary to verify the running environment. Optionally, before obtaining the device information in the test case, the method also includes: determining whether the test case exists in the test system; if the test case exists in the test system, verifying whether the interface definition file exists in the test system, and if the interface definition file exists, running the test case, wherein the interface definition file is used to edit the content of the interface definition; if the test case does not exist in the test system, sending a prompt message to the tester.
[0057] Specifically, before the test system runs the test case, it is necessary to verify the operating environment, including verifying whether the test case corresponding to the target parameters input into the test system exists, and verifying whether the interface definition file exists. Since the target parameters input into the test system may correspond to an empty test case, the test case needs to be verified. The interface definition file is a file that edits the interface definition of the test system. If the interface definition file does not exist, the target parameters cannot be adjusted to target parameters that match the test system. By verifying whether the interface definition file and the test case exist, it is possible to avoid the situation where there are only target parameters but no test cases, and the test system cannot run.
[0058] According to an embodiment of the present application, a test system for device fingerprint collection is provided. Figure 2 is a schematic diagram of a test system for device fingerprint collection provided in an embodiment of the present application, such as Figure 2 As shown, the system includes: a data acquisition unit 201, used to obtain device information in a test case and an interface definition of a test system; a data processing unit 202, used to determine a target message and an assertion value corresponding to the target message based on the device information and the interface definition of the test system; a data conversion unit 203, used to extract a target field value in the target message and convert the assertion value into a target assertion value that matches the target field value format; a judgment unit 204, used to determine whether the test case passes the test based on the target field value and the target assertion value.
[0059] Specifically, the data acquisition unit 201 includes a data loading module and a data verification module. The data loading module is used to load the device information in the test case and the interface definition of the test system, and the data verification module is used to check whether the test case and the interface definition file exist; the data processing unit 202 includes a data assembly module and an assertion value acquisition module. The data assembly module is used to assemble the target message according to the device information and the interface definition of the test system, and the assertion value acquisition module is used to obtain the assertion value; the data conversion unit 203 includes a message parsing module and a conversion module. The message parsing module is used to extract the target field value in the target message, and the conversion module is used to convert the assertion value into a target assertion value that matches the target field value format; the judgment unit 204 includes a data comparison module and a result display module. The data comparison module is used to compare whether the target field value and the target assertion value are the same, and the result display module is used to display the test result of the test case.
[0060] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0061] The embodiment of the present application also provides a device fingerprint collection test device. It should be noted that the device fingerprint collection test device of the embodiment of the present application can be used to execute the device fingerprint collection test method provided in the embodiment of the present application. The device fingerprint collection test device provided in the embodiment of the present application is introduced below.
[0062] Figure 3 Schematic diagram of a test device for collecting device fingerprints according to an embodiment of the present application. Figure 3 As shown, the device includes: a first acquisition unit 10, used to acquire device information in a test case, wherein the test case is a case for simulating a user initiating a transaction through a device, and a device fingerprint collection device collecting a device fingerprint of the device; a first determination unit 20, used to determine a target message according to the device information and an interface definition of a test system; a second acquisition unit 30 obtains an assertion value corresponding to the target message, wherein the assertion value is used to characterize preset feature information of the device fingerprint; a conversion unit 40, used to extract a target field value in the target message, and convert the assertion value into a target assertion value that matches the target field value format; a second determination unit 50, used to determine whether the test case passes the test according to the target field value and the target assertion value.
[0063] Optionally, in the device fingerprint collection test apparatus provided in the embodiment of the present application, the second determination unit 50 includes: a comparison module, used to compare the target assertion value and the target field value. If the data type and value of the target assertion value and the target field value are the same, it indicates that the test case passes the test; if the data type and value of the target assertion value and the target field value are different, it indicates that the test case fails the test.
[0064] Optionally, in the test device for device fingerprint collection provided in an embodiment of the present application, the first determination unit 20 includes: a first extraction module, used to extract at least one target parameter based on device information, wherein the target parameter is used to characterize characteristic information of the device fingerprint; an assembly module, used to obtain an interface definition of the test system, and assemble the target parameter into a message based on the interface definition.
[0065] Optionally, in the test device for device fingerprint collection provided in the embodiment of the present application, the assembly module includes: an acquisition sub-module, used to obtain an interface definition, wherein the interface definition includes at least: an interface field length, a type of received parameter; an update sub-module, used to process the parameter length of at least one target parameter to obtain an updated target parameter, wherein the parameter length of the updated target parameter matches the interface field length; and an assembly sub-module, used to assemble the updated target parameters into a target message according to the format of the interface definition.
[0066] Optionally, in the device fingerprint collection test apparatus provided in the embodiment of the present application, the second acquisition unit 30 includes: a second extraction module, used to extract target data in the target parameter; and an acquisition module, used to obtain an assertion value corresponding to the target message based on the target data.
[0067] Optionally, in the device fingerprint collection test apparatus provided in the embodiment of the present application, the conversion unit 40 includes: a type conversion module, a length interception module and a value mapping module.
[0068] Optionally, in the device fingerprint collection test apparatus provided in the embodiment of the present application, the comparison module in the second determination unit 50 also includes: a retry submodule, used to rerun the test case in the test system when the data type and numerical value of the target assertion value and the target field value are different; a stop submodule, used to stop running the test case when the number of times the test case is rerun in the test system exceeds a preset number of times, indicating that the test case has failed the test.
[0069] Optionally, in the device fingerprint collection test device provided in the embodiment of the present application, the device also includes: a judgment unit, used to judge whether there is a test case in the test system; a verification unit, used to verify whether an interface definition file exists in the test system when there is a test case in the test system, and if the interface definition file exists, run the test case, wherein the interface definition file is used to edit the content of the interface definition; a prompt unit, used to send a prompt message to the tester when there is no test case in the test system.
[0070] The device fingerprint collection test device provided in the embodiment of the present application is used to obtain the device information in the test case through the first acquisition unit 10, wherein the test case is a case for simulating a user to initiate a transaction through a device, and the device fingerprint collection device collects the device fingerprint of the device; the first determination unit 20 is used to determine the target message according to the device information and the interface definition of the test system; the second acquisition unit 30 obtains the assertion value corresponding to the target message, wherein the assertion value is used to characterize the preset feature information of the device fingerprint; the conversion unit 40 is used to extract the target field value in the target message, and convert the assertion value into a target assertion value that matches the target field value format; the second determination unit 50 is used to determine whether the test case passes the test based on the target field value and the target assertion value, which solves the problem that the test of device fingerprint collection in the related technology requires manual execution of the test case by manpower, resulting in low test efficiency. By comparing the target field value and the target assertion value obtained in the test case to determine whether the test case passes the test, the test automation and efficiency of device fingerprint collection are achieved.
[0071] The above-mentioned device fingerprint collection test apparatus includes a processor and a memory. The above-mentioned first acquisition unit 10, determination unit 20, second acquisition unit 30, conversion unit 40 and second determination unit 50 are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0072] The processor contains a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the test automation and efficiency of device fingerprint collection can be achieved by adjusting the kernel parameters.
[0073] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0074] The embodiment of the present application further provides a computer storage medium, which is used to store a program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute a test method for device fingerprint collection.
[0075] The present application also provides an electronic device, Figure 4 is a schematic diagram of an electronic device provided according to an embodiment of the present application, such as Figure 4 As shown, the device 401 includes a processor and a memory; the memory stores computer-readable instructions, and the processor is used to run the computer-readable instructions, wherein the computer-readable instructions execute a test method for device fingerprint collection when they are run. The electronic device in this article can be a server, PC, PAD, mobile phone, etc.
[0076] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or at least one computer-usable storage medium (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contains computer-usable program code.
[0077] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or at least one process and / or box Figure 1 A device that is a block or at least a function specified in a block.
[0078] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or at least one process and / or box Figure 1 boxes or at least the functions specified in a box.
[0079] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or at least one process and / or box Figure 1 A block or at least a step of the function specified in a block.
[0080] In a typical configuration, a computing device includes one or at least one processor (CPU), input / output interfaces, network interfaces, and memory.
[0081] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0082] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0083] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0084] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A test method for device fingerprint collection, characterized in that: include: Obtaining device information in a test case, wherein the test case is a case for simulating a user initiating a transaction through a device, and a device fingerprint collection device collecting a device fingerprint of the device. The test case is a simulation case running in a test system of the device fingerprint collection device. The simulation case simulates manually initiating a transaction from an APP end and then manually checking the device fingerprint collection situation on a server end, and simulates running the test case in the form of adjusting parameters input into the test system. The device information is information extracted from a mobile phone end when collecting the device fingerprint, and the device information includes the device fingerprint; Determine the target message according to the device information and the interface definition of the test system; Obtaining an assertion value corresponding to the target message, wherein the assertion value is used to characterize preset feature information of the device fingerprint; Extracting a target field value in the target message, and converting the assertion value into a target assertion value matching a format of the target field value; Determining whether the test case passes the test according to the target field value and the target assertion value; Determining the target message according to the device information and the interface definition of the test system includes: Extracting at least one target parameter according to the device information, wherein the target parameter is used to characterize feature information of the device fingerprint; Obtaining an interface definition of the test system, and assembling the target parameters into a message according to the interface definition; Acquiring the interface definition of the test system, and assembling the target parameters into a target message according to the interface definition includes: Obtaining the interface definition, wherein the interface definition at least includes: an interface field length and a type of a received parameter; Processing a parameter length of the at least one target parameter to obtain an updated target parameter, wherein the parameter length of the updated target parameter matches the interface field length; The updated target parameters are assembled into the target message according to the format defined by the interface.
2. The method according to claim 1, characterized in that Determining whether the test case passes the test according to the target field value and the target assertion value includes: Compare the target assertion value with the target field value. If the data type and value of the target assertion value are the same as those of the target field value, it means that the test case passes the test. If the data type and the numerical value of the target assertion value are different from those of the target field value, it means that the test case fails the test.
3. The method according to claim 1, characterized in that Obtaining the assertion value corresponding to the target message includes: extracting target data from the target parameters; According to the target data, an assertion value corresponding to the target message is obtained.
4. The method according to claim 1, characterized in that The conversion rule for converting the assertion value into a target assertion value matching the target field value format is one of the following: type conversion, length truncation, and value mapping.
5. The method according to claim 2, characterized in that: If the data type and value of the target assertion value are different from those of the target field value, then the test case fails the test including: If the data type and the value of the target assertion value are different from those of the target field value, re-running the test case in the test system; When the number of times the test case is re-run in the test system exceeds a preset number, the running of the test case is stopped, indicating that the test case has failed the test.
6. The method according to claim 1, characterized in that Before obtaining the device information in the test case, the method further includes: Determining whether the test case exists in the test system; In the case where the test case exists in the test system, verifying whether an interface definition file exists in the test system, and if the interface definition file exists, running the test case, wherein the interface definition file is used to edit the content of the interface definition; When the test case does not exist in the test system, a prompt message is sent to the tester.
7. A device fingerprint collection test system, characterized in that: include: A data acquisition unit is used to acquire device information in a test case and an interface definition of a test system. The test case is a simulation case running in a test system of a device fingerprint collection device. The simulation case simulates manually initiating a transaction from an APP end and then manually checking the device fingerprint collection situation on a server end. The test case is simulated in the form of adjusting parameters input into the test system. The device information is information extracted from a mobile phone end when collecting the device fingerprint, and the device information includes the device fingerprint; A data processing unit, determining a target message according to the device information and an interface definition of the test system, and determining an assertion value corresponding to the target message; A data conversion unit, used for extracting a target field value in the target message, and converting the assertion value into a target assertion value matching a format of the target field value; A judgment unit, used to determine whether the test case passes the test according to the target field value and the target assertion value; The data acquisition unit includes a data loading module and a data verification module, wherein the data loading module is used to load the device information in the test case and the interface definition of the test system, and the data verification module is used to verify whether the test case and the interface definition file exist: Extracting at least one target parameter according to the device information, wherein the target parameter is used to characterize feature information of the device fingerprint; Obtaining an interface definition of the test system, and assembling the target parameters into a message according to the interface definition; The data processing unit includes a data assembly module, which is used to assemble the target message according to the device information and the interface definition of the test system: Obtaining the interface definition, wherein the interface definition at least includes: an interface field length and a type of a received parameter; Processing a parameter length of the at least one target parameter to obtain an updated target parameter, wherein the parameter length of the updated target parameter matches the interface field length; The updated target parameters are assembled into the target message according to the format defined by the interface.
8. A computer storage medium, characterized in that: The computer storage medium is used to store a program, wherein when the program is run, the device where the computer storage medium is located is controlled to execute the device fingerprint collection test method according to any one of claims 1 to 6.
9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores computer-readable instructions, and the processor is used to execute the computer-readable instructions, wherein the computer-readable instructions, when executed, execute the device fingerprint collection test method described in any one of claims 1 to 6.
Citation Information
Patent Citations
Data collection method and device
CN104572456A
Terminal fingerprint test method, device, computer equipment and storage medium
CN108304289A