Equipment testing method, equipment testing device, electronic equipment and storage medium
By obtaining device model and processor model information, measuring the calculation time, and accurately determining whether the device to be tested is a simulator, the problem of low security and increased distinction difficulty is solved, and the accurate identification of the simulator and real equipment is achieved. Safety guarantee.
Patent Information
- Application Number
- CN202411088296.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-11-22
AI Technical Summary
The low security of the simulator makes it difficult to accurately identify whether the application is calculated in the simulator, and the difficulty of distinguishing increases as the simulator is close to the function of the real device.
By obtaining the model information of the device to be tested and the processor model information, we can determine whether there is an abnormality in the device. If there is no abnormality, measure the processor's calculation time on the general operator and determine whether the device is an emulator based on the duration.
Accurately distinguish whether the equipment to be tested is a simulator or a real device, prevent illegal activities, and improve safety.
Smart Images

Figure CN119003304A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and more specifically, to a device testing method, a device testing apparatus, an electronic device and a storage medium. Background Art
[0002] An emulator is a simulation program that can simulate the operating system of another device and run the corresponding application program on one device. Therefore, for program developers, the emulator is a convenient application development and testing tool. However, the security of the emulator is usually not high, which makes some developers use the program loopholes of the emulator to carry out illegal activities. However, the functions of the emulator and the real electronic device are getting closer and closer, so it is becoming more and more difficult to distinguish between the two. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a device testing method, a device testing apparatus, an electronic device and a storage medium to accurately determine whether the device under test is a simulator according to the operation time of each processor under test on a general operator in the device under test.
[0004] In a first aspect, an embodiment of the present invention provides a device testing method, the method comprising:
[0005] Acquire device information of the device to be tested, the device information including first model information of the device to be tested and second model information of multiple processors to be tested in the device to be tested;
[0006] Determine a first test result of the device to be tested according to the first model information and the second model information, where the first test result is used to indicate whether the device to be tested is abnormal;
[0007] In response to the first test result indicating that the device under test has no abnormality, obtaining the operation time of each processor under test on the general operator;
[0008] A second test result of the device to be tested is determined according to each of the operation durations, where the second test result is used to indicate whether the device to be tested is a simulator.
[0009] In a second aspect, an embodiment of the present invention provides a device testing apparatus, the apparatus comprising:
[0010] An information acquisition unit, configured to acquire device information of a device to be tested, wherein the device information includes first model information of the device to be tested and second model information of a plurality of processors to be tested in the device to be tested;
[0011] A first testing unit, configured to determine a first test result of the device to be tested according to the first model information and the second model information, wherein the first test result is used to indicate whether the device to be tested is abnormal;
[0012] a duration acquisition unit, configured to acquire the operation duration of each processor under test on a general operator in response to the first test result indicating that the device under test has no abnormality;
[0013] The second testing unit is used to determine a second testing result of the device to be tested according to each of the operation durations, wherein the second testing result is used to indicate whether the device to be tested is a simulator.
[0014] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory and a processor, wherein the memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method described in the first aspect.
[0015] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0016] In a fifth aspect, an embodiment of the present invention provides a computer program product, wherein the computer program product includes a computer program / instructions, and when the computer program / instructions are executed by a processor, the method described in the first aspect is implemented.
[0017] After obtaining the model information of the device to be tested and the model information of multiple processors to be tested in the device to be tested, the embodiment of the present invention determines whether the device to be tested has an abnormality based on the model information of the device to be tested and the model information of each processor to be tested. If there is no abnormality, the operation time of each processor to be tested on the general operator is obtained, and then whether the device to be tested is a simulator is determined based on the above time. The processing capability of the simulator for general operators is usually significantly different from the processing capability of real electronic devices for general operators. Therefore, the embodiment of the present invention can accurately determine whether the device to be tested is a simulator or a real electronic device based on the operation time of each processor to be tested in the device to be tested on the general operator. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The above and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
[0019] Figure 1 is a flow chart of a device testing method according to a first embodiment of the present invention;
[0020] Figure 2is a flow chart of determining a first test result of a device to be tested in an optional implementation manner of an embodiment of the present invention;
[0021] Figure 3 is a schematic diagram of a second test result of an embodiment of the present invention;
[0022] Figure 4 is a schematic diagram of a device testing apparatus according to a second embodiment of the present invention;
[0023] Figure 5 is a schematic diagram of an electronic device according to a third embodiment of the present invention. DETAILED DESCRIPTION
[0024] The present application is described below based on embodiments, but the present application is not limited to these embodiments. In the detailed description of the present application below, some specific details are described in detail. It is possible for those skilled in the art to fully understand the present application without the description of these details. In order to avoid confusing the essence of the present application, known methods, processes, flows, components and circuits are not described in detail.
[0025] In addition, persons of ordinary skill in the art will appreciate that the drawings provided herein are for illustration purposes and are not necessarily drawn to scale.
[0026] Unless the context clearly requires otherwise, the words "include", "comprising" and similar words throughout the application should be interpreted as including rather than exclusive or exhaustive; that is, the meaning is "including but not limited to".
[0027] In the description of this application, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, the meaning of "plurality" is two or more.
[0028] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0029] According to different actual applications, simulators can be divided into multiple categories. Common simulator types include computer simulator (Computer Simulator), network simulator (Network Simulator), mobile device simulator (Mobile Device Simulator), game simulator (Game Simulator), etc.
[0030] Taking mobile device simulators as an example, according to the classification of mobile device operating systems, common mobile device simulators can include Android simulators, iOS simulators, etc. In daily life, users can use mobile device simulators to operate mobile device applications on personal computers, such as operating mobile games, and some simulators support the operation of multiple games at the same time, thus bringing greater convenience to users.
[0031] However, the security of simulators is usually much lower than the operating environment of real electronic devices. Therefore, some developers may embed viruses or malware in simulators and use them to conduct illegal activities, such as stealing user information, tampering with system permissions, and damaging the system. In order to avoid this as much as possible, it is necessary to accurately identify whether the user is operating the application in the simulator. However, with the continuous updating of technology, the virtual operating environment simulated by the simulator is getting closer and closer to the operating environment of real electronic devices. Some simulators can even achieve functions such as establishing close-range communication and communication connection with mobile devices. Therefore, the difficulty of identifying simulators is becoming higher and higher.
[0032] In the embodiment of the present invention, the device to be tested is a mobile phone as an example for description. However, those skilled in the art can easily understand that when the device to be tested is other electronic devices, such as a personal computer, other mobile terminals, including tablet computers, laptop computers, smart wearable devices, etc., the method of the embodiment of the present invention is also applicable.
[0033] Figure 1 FIG. 1 is a flow chart of a device testing method according to a first embodiment of the present invention. Figure 1 As shown, the method of this embodiment includes the following steps:
[0034] Step S100, obtaining device information of the device to be tested.
[0035] According to actual needs, this embodiment can obtain the device information of the device to be tested in the corresponding application scenario. For example, in scenarios where fairness needs to be ensured, such as competitive games, online exams, financial transactions, etc., the device information of the device to be tested can be obtained to identify whether the device to be tested is a simulator.
[0036] Among them, the device information of the device to be tested may include the model information of the device to be tested, that is, the first model information and the model information of the processor to be tested in the device to be tested, that is, the second model information. The processor to be tested is also the processor configured by the device to be tested, such as a central processing unit (CPU, Central Processing Unit), a graphics processing unit (GPU, Graphics Processing Unit), a digital signal processor (DSP, Digital Signal Processor), a high performance computing processor (HPC, High Performance Computing), and an embedded processor (EP, EmbeddedProcessor). Optionally, the device information of the device to be tested may also include other information, such as the device identification of the device to be tested, etc., which is not limited in this embodiment.
[0037] In this step, the detection device (such as a server, a platform management computer, etc.) can receive the device information sent by the corresponding electronic device with the authorization of the user, and determine the corresponding electronic device as the device to be tested. Specifically, the detection device can perform security verification on the operating environment of the device to be tested, and obtain the device information of the device to be tested when the operating environment meets the security verification conditions, so as to prevent the operation data of the device to be tested from being tampered with, resulting in inaccurate test results. Among them, the security verification conditions can be determined according to actual needs, such as whether a network security application is installed in the device to be tested, whether the system files or key components of the device to be tested are complete, and whether the system log of the device to be tested records the existence of security threats or abnormal behaviors of the device to be tested.
[0038] Step S200: determining a first test result of the device to be tested according to the first model information and the second model information.
[0039] After acquiring the model information of the device to be tested and the model information of each processor to be tested, the detection device may determine whether the device to be tested is abnormal according to the model information of the device to be tested and the model information of each processor to be tested.
[0040] Figure 2 FIG. 1 is a flow chart of determining a first test result of a device to be tested in an optional implementation of an embodiment of the present invention. Figure 2 As shown, in an optional implementation of this embodiment, step S200 may include the following steps:
[0041] Step S210: Acquire third model information of a plurality of standard processors in a standard device according to the first model information.
[0042] In this embodiment, the detection device can obtain a device with the same model as the device to be tested according to the model information of the device to be tested, that is, the model information of each standard processor in the standard device, that is, the third model information. Optionally, the model information of each standard processor in the standard device can be provided by the manufacturer of the standard device, or can be obtained by the detection personnel after disassembling the standard device. This embodiment does not limit the method for obtaining the model information of the standard processor.
[0043] Step S220, determining a first test result according to a matching result of the second model information and the third model information.
[0044] The standard device is a real electronic device, and the processors of the standard device have not been replaced. Therefore, if the model information of the processor to be tested in the device to be tested matches the model information of the standard processor in the standard device, it means that there is no abnormality in the device to be tested, that is, the device to be tested is a real electronic device, or a simulator, so the next step of testing can be carried out.
[0045] It is easy to understand that if the model information of the processor to be tested in the device to be tested does not match the model information of the standard processor in the standard device, it means that there is an abnormality in the device to be tested. For example, the device to be tested may be a simulator, or the device to be tested has been replaced with hardware that is different from the original model. Therefore, the device to be tested can be marked as an abnormal device for further testing by the inspector.
[0046] In this embodiment, the matching of the model information of the processor to be tested in the device to be tested and the model information of the standard processor in the standard device means that the number and model information of the processor to be tested are completely consistent with the number and model information of the standard processor.
[0047] For example, the standard processor in the standard device includes 1 CPU, one GPU and one DSP, and the model of the CPU is CPU1, the model of the GPU is GPU1, and the model of the DSP is DSP1. Only when the processor to be tested in the device to be tested also includes one CPU, one GPU and one DSP, and the model of the CPU is CPU1, the model of the GPU is GPU1, and the model of the DSP is DSP1, can it be determined that the model information of the processor to be tested matches the model information of the standard processor; if the processor to be tested in the device to be tested includes one CPU, one GPU and one DSP, and the model of the CPU is CPU1, the model of the GPU is GPU2, and the model of the DSP is DSP1, or the processor to be tested in the device to be tested includes one CPU, one GPU and two DSPs, and the model of the CPU is CPU1, the model of the GPU is GPU1, and the model of the DSP is DSP1, or the processor to be tested in the device to be tested includes one CPU, one GPU, one DSP and one HPC, it means that the model information of the processor to be tested does not match the model information of the standard processor.
[0048] Step S300 , in response to the first test result indicating that the device under test has no abnormality, obtaining the operation time of each processor under test on the general operator.
[0049] If there is no abnormality in the device to be tested, the detection device can command each processor to be tested in the device to be tested to operate the same general operator, and obtain the operation time of each processor to be tested on the general operator. Common operators may include differential operators, gradient operators, divergence operators, Laplace operators, Hamiltonian operators, etc. Further, the general operator is an operator that can be operated by each processor to be tested, such as vector operations (including vector addition, vector subtraction, vector product, etc.), matrix operations (including matrix addition, matrix subtraction, calculation of the conjugate matrix of a preset matrix, calculation of the transposed matrix of a preset matrix, etc.).
[0050] Step S400: determining a second test result of the device to be tested according to each operation duration.
[0051] A simulator is just a program that can only simulate the operating environment and hardware parameters of a real device, but cannot simulate the data processing capabilities of a real processor. Therefore, the detection device can determine whether the second test result of the device to be tested is a simulator based on the operation time of each processor to be tested on the general operator in the device to be tested.
[0052] Common processors in mobile phones include central processing units, graphics processors and embedded neural network processors (also known as neural processing units NPUs, Neural Processing Units). Therefore, at least one of the graphics processor and the embedded neural network processor and the central processor are taken as examples for explanation as the processors to be tested.
[0053] In the first possible case, if the difference between the computing time of the central processing unit on the general operator, that is, the first computing time, and the computing time of the graphics processor on the general operator, that is, the second computing time, meets the first computing condition, and / or the computing time of the central processing unit on the general operator and the computing time of the embedded neural network processor on the general operator, that is, the third computing time, meets the second computing condition, the detection device can determine that the device to be tested is a simulator.
[0054] In actual situations, the processing capabilities of graphics processors and embedded neural network processors for general operators are usually higher than those of central processors, that is, the operation time of graphics processors and embedded neural network processors for general operators is usually lower than that of central processors for general operators. Therefore, if the difference between the first operation time and the second operation time represents the result of subtracting the second operation time from the first operation time, the first operation condition can be set to the difference between the first operation time and the second operation time is less than the first threshold, etc.; if the difference between the first operation time and the second operation time represents the result of subtracting the first operation time from the second operation time, the first operation condition can be set to the difference between the first operation time and the second operation time is greater than the first threshold, etc. Similarly, if the difference between the first operation time and the third operation time represents the result of subtracting the third operation time from the first operation time, the second operation condition can be set to the difference between the first operation time and the third operation time is less than the second threshold, etc.; if the difference between the first operation time and the third operation time represents the result of subtracting the first operation time from the third operation time, the second operation condition can be set to the difference between the first operation time and the third operation time is greater than the second threshold, etc.
[0055] Optionally, in order to ensure the accuracy of equipment testing, the first threshold can be determined based on the difference between the computing time of the central processing unit in the standard processor for the general operator and the computing time of the graphics processor in the standard processor for the general operator, and the second threshold can be determined based on the difference between the computing time of the embedded neural network processor in the standard processor for the general operator and the computing time of the graphics processor in the standard processor for the general operator.
[0056] For example: the central processing unit in the processor to be tested is CPU1, the graphics processing unit is GPU1, the embedded neural network processor is NPU1, the general operator is the matrix multiplication of high-dimensional matrices, the first operation condition is that the first operation duration minus the second operation duration is less than 1 second, and the second operation condition is that the first operation duration minus the third operation duration is less than 1.5 seconds. The operation duration of CPU1's matrix multiplication of the high-dimensional matrix is t1, the operation duration of GPU1's matrix multiplication of the high-dimensional matrix is t2, and the operation duration of NPU1's matrix multiplication of the high-dimensional matrix is t3, and the difference between the first operation duration and the second operation duration is t1-t2=0.67 (seconds), which meets the first operation condition, and the difference between the first operation duration and the third operation duration is t1-t3=1.502 (seconds), and the detection device can determine that the device to be tested is a simulator.
[0057] In the second possible situation, if the processor to be tested includes a graphics processor and an embedded neural network processor, and the difference between the operation time of the graphics processor on the general operator and the operation time of the embedded neural network processor on the general operator meets the third operation condition, the detection device can determine that the device to be tested is a simulator.
[0058] In actual situations, the processing capability of an embedded neural network processor for general operators is usually higher than that of a graphics processor, that is, the operation time of an embedded neural network processor for general operators is usually lower than that of a graphics processor. Therefore, if the difference between the second operation time and the third operation time represents the result of subtracting the third operation time from the second operation time, the third operation condition can be set to a value that the difference between the second operation time and the third operation time is less than a third threshold value, etc.; if the difference between the second operation time and the third operation time represents the result of subtracting the second operation time from the third operation time, the third operation condition can be set to a value that the difference between the second operation time and the third operation time is greater than a third threshold value, etc.
[0059] Optionally, in order to ensure the accuracy of device testing, the third threshold can be determined based on the difference between the operation time of the graphics processor in the standard processor on the general operator and the operation time of the embedded neural network processor in the standard processor on the general operator.
[0060] For example: the graphics processor in the processor to be tested is GPU1, the embedded neural network processor is NPU1, the general operator is matrix multiplication of high-dimensional matrices, and the third operation condition is that the second operation duration minus the third operation duration is less than 0.5 seconds. The operation duration of GPU1's matrix multiplication of high-dimensional matrices is t2, and the operation duration of NPU1's matrix multiplication of high-dimensional matrices is t3. The difference between the second operation duration and the third operation duration is t2-t3=0.47 (seconds), which meets the third operation condition, and the detection device can determine that the device to be tested is a simulator.
[0061] In the third possible scenario, the processor to be tested includes a central processing unit and a graphics processing unit, and the difference between the first operation time and the second operation time does not meet the first operation condition. The detection device can obtain the standard operation time of the standard processor for the general operator according to the model information of each processor to be tested, and determine whether the device to be tested is a simulator according to the first operation time, the second operation time and the standard operation time. The processing capabilities of processors of the same model for the same general operator are usually not much different, so the difference between the operation time of the processor to be tested for the general operator and the operation time of the standard processor for the general operator is large, indicating that the processor to be tested is more likely to be not a real processor but a simulator.
[0062] In this embodiment, the standard operation time can be a single operation time of a single standard processor on a general operator, or it can be the average of single operation times of multiple standard processors on a general operator, or it can be the average of multiple operation times of a single standard processor on a general operator, and this embodiment does not impose any restrictions.
[0063] If the processor to be tested includes a central processing unit and a graphics processing unit, the standard processor in the standard device also includes a central processing unit and a graphics processing unit. Therefore, specifically, the detection device can obtain the standard operation time of the central processing unit in the standard processor for the general operator as the first standard operation time, and at the same time obtain the standard operation time of the graphics processing unit in the standard processor for the general operator as the second standard operation time, and determine that the device to be tested is a simulator when the absolute value of the difference between the first operation time and the first standard operation time meets the fourth operation condition, and / or the absolute value of the difference between the second operation time and the second standard operation time meets the fifth operation condition.
[0064] Among them, the fourth operation condition can be set to that the absolute value of the difference between the first operation duration and the first standard operation duration is less than or equal to the fourth threshold, and the fifth operation condition can be set to that the absolute value of the difference between the second operation duration and the second standard operation duration is less than or equal to the fifth threshold.
[0065] Optionally, in order to ensure the accuracy of the equipment test, the fourth threshold value can be determined according to the first reference operation time and the operation time error, and the fifth threshold value can be determined according to the second reference operation time and the operation time error. For example, if the first reference operation time is 0.8 seconds and the operation time error is 1%, the fourth threshold value can be set to 0.008 seconds.
[0066] For example: the central processing unit in the processor to be tested is GPU1, the graphics processing unit is GPU1, the general operator is the matrix multiplication of high-dimensional matrices, and the first operation condition is that the first operation duration minus the second operation duration is less than 1 second. The operation duration of CPU1's matrix multiplication of high-dimensional matrices is t1, and the operation duration of GPU1's matrix multiplication of high-dimensional matrices is t2. The difference between the first operation duration and the second operation duration is t1-t2=1.06 (seconds), which does not meet the first operation condition. The detection device can obtain the operation duration of the central processing unit CPU2 in the standard processor for the matrix multiplication of the high-dimensional matrix is T1 and the operation duration of the graphics processing unit GPU2 for the matrix multiplication of the high-dimensional matrix is T2. Among them, the absolute value of the difference between the first operation duration and the first standard operation duration |T1-t1|=0.3 (seconds), which meets the fourth operation condition, and the absolute value of the difference between the second operation duration and the second standard operation duration |T2-t2|=0.001 (seconds), which does not meet the fifth operation condition, and the detection device can determine that the device to be tested is a simulator.
[0067] In a fourth possible scenario, the processor to be tested includes a central processing unit and an embedded neural network processor, and the difference between the first operation time and the third operation time does not meet the second operation condition. The detection device can obtain the standard operation time of the standard processor for the general operator according to the model information of each processor to be tested, and determine whether the device to be tested is a simulator according to the first operation time, the third operation time and the standard operation time.
[0068] If the processor to be tested includes a central processing unit and an embedded neural network processor, the standard processor in the standard device also includes a central processing unit and an embedded neural network processor. Therefore, specifically, the detection device can obtain the standard operation time of the central processing unit in the standard processor for the general operator as the first standard operation time, and at the same time obtain the standard operation time of the embedded neural network processor in the standard processor for the general operator as the third standard operation time, and determine that the device to be tested is a simulator when the difference between the first operation time and the first standard operation time meets the fourth operation condition, and / or the difference between the third operation time and the third standard operation time meets the sixth operation condition.
[0069] The sixth operation condition may be set to that the absolute value of the difference between the third operation duration and the third standard operation duration is less than or equal to a sixth threshold. Optionally, in order to ensure the accuracy of the device test, the sixth threshold may be determined based on the third reference operation duration and the operation duration error.
[0070] In the fifth possible situation, the processor to be tested includes a central processing unit, a graphics processing unit and an embedded neural network processor, and the difference between the first operation time and the second operation time does not meet the first operation condition, and the difference between the second operation time and the third operation time does not meet the third operation condition. The detection device can obtain the standard operation time of the standard processor for the general operator according to the model information of each processor to be tested, and determine whether the device to be tested is a simulator according to the first operation time, the second operation time, the third operation time and the standard operation time.
[0071] If the processor to be tested includes a central processing unit, a graphics processing unit and an embedded neural network processor, then the standard processor in the standard device also includes a central processing unit, a graphics processing unit and an embedded neural network processor. Therefore, specifically, the detection device can obtain the standard operation time of the central processing unit in the standard processor for the general operator as the first standard operation time, the standard operation time of the graphics processing unit in the standard processor for the general operator as the second standard operation time, and the standard operation time of the embedded neural network processor in the standard processor for the general operator as the third standard operation time, and determine that the device to be tested is a simulator when the difference between the first operation time and the first standard operation time meets the fourth operation condition, and / or the absolute value of the difference between the second operation time and the second standard operation time meets the fifth operation condition, and / or the difference between the third operation time and the third standard operation time meets the sixth operation condition.
[0072] For example: the central processing unit in the processor to be tested is GPU1, the graphics processing unit is GPU1, the embedded neural network processor is NPU1, the general operator is matrix multiplication of high-dimensional matrices, the first operation condition is that the first operation time minus the second operation time is less than 1 second, and the third operation condition is that the second operation time minus the third operation time is less than 0.5 seconds. The operation time of CPU1's matrix multiplication of high-dimensional matrices is t1, the operation time of GPU1's matrix multiplication of high-dimensional matrices is t2, and the operation time of NPU1's matrix multiplication of high-dimensional matrices is t3. The difference between the first operation time and the second operation time is t1-t2=1.06 (seconds), which does not meet the first operation condition. The difference between the second operation time and the third operation time is t2-t3=0.53 (seconds), which does not meet the third operation condition. The detection device can obtain that the operation time of the central processing unit CPU2 in the standard processor for the matrix multiplication of the high-dimensional matrix is T1, the operation time of the graphics processor GPU2 for the matrix multiplication of the high-dimensional matrix is T2, and the operation time of the embedded neural network processor NPU2 for the matrix multiplication of the high-dimensional matrix is T3. Among them, the absolute value of the difference between the first operation time and the first standard operation time |T1-t1|=0.3 (seconds), which meets the fourth operation condition, the absolute value of the difference between the second operation time and the second standard operation time |T2-t2|=0.001 (seconds), which does not meet the fifth operation condition, and the absolute value of the difference between the third operation time and the third standard operation time |T3-t3|=0.24 (seconds), which meets the sixth operation condition. The detection device can determine that the device to be tested is a simulator.
[0073] It is easy to understand that in other cases, the processor to be tested includes a central processing unit and a graphics processing unit, and the difference between the first operation time and the second operation time does not meet the first operation condition, the absolute value of the difference between the first operation time and the first standard operation time does not meet the fourth operation condition, and the absolute value of the difference between the second operation time and the second standard operation time does not meet the fifth operation condition; or the processor to be tested includes a central processing unit and an embedded neural network processor, and the difference between the first operation time and the second operation time does not meet the first operation condition, the absolute value of the difference between the first operation time and the first standard operation time does not meet the fourth operation condition, and the third operation condition The absolute value of the difference between the calculation time and the third standard calculation time does not meet the sixth calculation condition; or, the processor to be tested includes a central processing unit, a graphics processing unit and an embedded neural network processor, and the difference between the first calculation time and the second calculation time does not meet the first calculation condition, the absolute value of the difference between the first calculation time and the first standard calculation time does not meet the fourth calculation condition, the absolute value of the difference between the second calculation time and the second standard calculation time does not meet the fifth calculation condition, and the absolute value of the difference between the third calculation time and the third standard calculation time does not meet the sixth calculation condition, the detection device can determine that the device to be tested is not a simulator, that is, a real electronic device.
[0074] Figure 3 is a schematic diagram of the second test result of the embodiment of the present invention. Figure 3 As shown, t1 is the first running time of the central processing unit CPU1 to be tested, t2 is the second running time of the graphics processing unit GPU1 to be tested, t3 is the third running time of the embedded neural network processor NPU1 to be tested, T1 is the first standard running time of the standard central processing unit CPU2, T2 is the second standard running time of the standard graphics processing unit GPU2, T3 is the third standard running time of the standard embedded neural network processor NPU2, and n, p and q are all real numbers greater than or equal to 0.
[0075] If the mobile phone MB1 includes CPU1 and GPU1, and t1-t2≤0, the first operation condition is met, and the detection device can determine that the mobile phone MB1 is a simulator; if the mobile phone MB1 includes CPU1 and NPU1, and t1-t3≤0, the second operation condition is met, and the detection device can determine that the mobile phone MB1 is a simulator; if the mobile phone MB1 includes CPU1, GPU1 and NPU1, and t2-t3≤0, the third operation condition is met, and the detection device can determine that the mobile phone MB1 is a simulator; if the mobile phone MB1 includes CPU1, GPU1 and NPU1, and t1-t2≤0, the first operation condition is met, and / or t1-t3≤0, the second operation condition is met, the detection device can determine that the mobile phone MB1 is a simulator; if the mobile phone MB1 includes CPU1 and GPU1, and t1-t2>0, the first operation condition is not met, but | T1-t1|≥n, satisfies the fourth operation condition, and / or |T2-t2|≥p, satisfies the fifth operation condition, the detection device can determine that the mobile phone MB1 is a simulator; if the mobile phone MB1 includes CPU1 and NPU1, and t1-t3>0, does not meet the second operation condition, but |T1-t1|≥n, satisfies the fourth operation condition, and / or |T3-t3|≥q, satisfies the sixth operation condition, the detection device can determine that the mobile phone MB1 is a simulator; if the mobile phone MB1 includes CPU1, GPU1 and NPU1, and t1-t2>0, does not meet the first operation condition, t2-t3>0, does not meet the third operation condition, but |T1-t1|≥n, satisfies the fourth operation condition, and / or |T2-t2|≥p, satisfies the fifth operation condition, and / or |T3-t3|≥q, satisfies the sixth operation condition, the detection device can determine that the mobile phone MB1 is a simulator.
[0076] If the mobile phone MB1 includes a CPU1 and a GPU1, and t1 - t2 > 0, the first operation condition is not satisfied, |T1 - t1| < n, the fourth operation condition is not satisfied, and at the same time |T2 - t2| < p, the fifth operation condition is not satisfied, the detection device can determine that the mobile phone MB1 is a real device; if the mobile phone MB1 includes a CPU1 and an NPU1, and t1 - t3 > 0, the second operation condition is not satisfied, |T1 - t1| < n, the fourth operation condition is not satisfied, and at the same time |T3 - t3| < q, the sixth operation condition is not satisfied, the detection device can determine that the mobile phone MB1 is a real device; if the mobile phone MB1 includes a CPU1, a GPU1 and an NPU1, and t1 - t2 > 0, the first operation condition is not satisfied, t2 - t3 > 0, the third operation condition is satisfied, |T1 - t1| < n, the fourth operation condition is not satisfied, |T2 - t2| < p, the fifth operation condition is not satisfied, and at the same time |T3 - t3| < q, the sixth operation condition is not satisfied, the detection device can determine that the mobile phone MB1 is a real device.
[0077] Optionally, after determining that the device to be tested is a simulator, the detection device can further process the device to be tested, such as issuing a warning to the tester, prohibiting some permissions of the device to be detected, etc., which is not limited in this embodiment.
[0078] In the embodiment of the present invention, after obtaining the model information of the device to be tested and the model information of multiple processors to be tested in the device to be tested, it is determined whether there is an abnormality in the device to be tested according to the model information of the device to be tested and the model information of each processor to be tested. If there is no abnormality, the operation duration of each processor to be tested for the general operator is obtained, and then it is determined whether the device to be tested is a simulator according to the above duration. The processing ability of the simulator for the general operator is usually significantly different from that of the real electronic device for the general operator. Therefore, the embodiment of the present invention can accurately determine whether the device to be tested is a simulator or a real electronic device according to the operation duration of each processor to be tested in the device to be tested for the general operator.
[0079] Figure 4 is a schematic diagram of the device testing apparatus according to the second embodiment of the present invention. As Figure 4 shown, the device testing apparatus of this embodiment includes an information acquisition unit 401, a first testing unit 402, a duration acquisition unit 403, and a second testing unit 404.
[0080] Among them, the information acquisition unit 401 is used to obtain device information of the device to be tested, and the device information includes first model information of the device to be tested and second model information of multiple processors to be tested in the device to be tested; the first test unit 402 is used to determine a first test result of the device to be tested based on the first model information and the second model information, and the first test result is used to characterize whether the device to be tested has an abnormality; the duration acquisition unit 403 is used to obtain the operation duration of each processor to be tested on a general operator in response to the first test result characterizing that the device to be tested has no abnormality; the second test unit 404 is used to determine a second test result of the device to be tested based on each operation duration, and the second test result is used to characterize whether the device to be tested is a simulator.
[0081] Furthermore, the first testing unit 402 includes a first information obtaining subunit and a first result determining subunit.
[0082] Among them, the first information acquisition subunit is used to obtain the third model information of multiple standard processors in the standard device according to the first model information, and the standard device is a device with the same model as the device to be tested; the first result determination subunit is used to determine the first test result according to the matching result of the second model information and the third model information.
[0083] Furthermore, the first result determination subunit includes a first result determination module and a second result determination module.
[0084] Among them, the first result determination module is used to determine that the first test result indicates that there is no abnormality in the device to be tested in response to the second model information matching the third model information; the second result determination module is used to determine that the first test result indicates that there is an abnormality in the device to be tested in response to the second model information not matching the third model information.
[0085] Furthermore, the plurality of standard processors include at least one of a graphics processor and an embedded neural network processor and a central processing unit.
[0086] Further, the second testing unit 404 includes a second result determining subunit and / or a third result determining subunit.
[0087] Among them, the second result determination subunit is used to determine that the second test result represents that the device to be tested is a simulator in response to the difference between the first operation time and the second operation time satisfying the first operation condition, the first operation time is the operation time of the central processing unit on the general operator, and the second operation time is the operation time of the graphics processor on the general operator; the third result determination subunit is used to determine that the second test result represents that the device to be tested is a simulator in response to the difference between the first operation time and the third operation time satisfying the second operation condition, and the third operation time is the operation time of the embedded neural network processor on the general operator.
[0088] Furthermore, the second testing unit 404 includes a fourth result determination subunit.
[0089] Among them, the fourth result determination subunit is used to determine that the second test result represents that the device to be tested is a simulator in response to the difference between the second operation time and the third operation time satisfying the third operation condition, the second operation time is the operation time of the graphics processor on the general operator, and the third operation time is the operation time of the embedded neural network processor on the general operator.
[0090] Furthermore, the second testing unit 404 includes a duration obtaining subunit and a fifth result determining subunit.
[0091] Among them, the duration acquisition subunit is used to respond to the difference between the first operation duration and the second operation duration not satisfying the first operation condition, and / or the difference between the second operation duration and the third operation duration not satisfying the third operation condition, and obtain the standard operation duration of the standard processor for the general operator according to the second model information, the first operation duration is the operation time of the central processing unit for the general operator, the second operation time is the operation time of the graphics processor for the general operator, the third operation time is the operation time of the embedded neural network processor for the general operator, and the standard processor is a processor of the same model as the processor to be tested; the fifth result determination subunit is used to determine the second test result according to at least one of the second operation time and the third operation time, the first operation time and the standard operation time.
[0092] Furthermore, the standard processor includes a central processing unit, a graphics processing unit and an embedded neural network processor, and the standard computing time includes at least one of a second standard computing time and a third standard computing time, the first standard computing time is the standard computing time of the central processing unit for the general operator, the second standard computing time is the standard computing time of the graphics processing unit for the general operator, and the third standard computing time is the standard computing time of the embedded neural network processor for the general operator.
[0093] Further, the fifth result determination subunit includes at least one of a third result determination module, a fourth result determination module and a fifth result determination module.
[0094] Among them, the third result determination module is used to determine that the second test result represents that the device to be tested is a simulator in response to the absolute value of the difference between the first operation time and the first standard operation time satisfying the fourth operation condition; the fourth result determination module is used to determine that the second test result represents that the device to be tested is a simulator in response to the absolute value of the difference between the second operation time and the second standard operation time satisfying the fifth operation condition; the fifth result determination module is used to determine that the second test result represents that the device to be tested is a simulator in response to the absolute value of the difference between the third operation time and the third standard operation time satisfying the sixth operation condition.
[0095] Furthermore, the information acquisition unit 401 includes a verification subunit and a second information acquisition subunit.
[0096] The verification subunit is used to perform security verification on the operating environment of the device to be tested; and the second information acquisition subunit is used to acquire the device information in response to the operating environment satisfying the security verification condition.
[0097] After obtaining the model information of the device to be tested and the model information of multiple processors to be tested in the device to be tested, the embodiment of the present invention determines whether the device to be tested has an abnormality based on the model information of the device to be tested and the model information of each processor to be tested. If there is no abnormality, the operation time of each processor to be tested on the general operator is obtained, and then whether the device to be tested is a simulator is determined based on the above time. The processing capability of the simulator for general operators is usually significantly different from the processing capability of real electronic devices for general operators. Therefore, the embodiment of the present invention can accurately determine whether the device to be tested is a simulator or a real electronic device based on the operation time of each processor to be tested in the device to be tested on the general operator.
[0098] Figure 5 Schematic diagram of an electronic device according to a third embodiment of the present invention. In this embodiment, the electronic device 5 includes a server, a terminal, etc. Figure 5As shown, the electronic device 5: includes at least one processor 501; and a memory 502 that is communicatively connected to at least one processor 501; and a communication component 503 that is communicatively connected to a scanning device, and the communication component 503 receives and sends data under the control of the processor 501; wherein the memory 502 stores instructions that can be executed by at least one processor 501, and the instructions are executed by at least one processor 501 to implement the above-mentioned device testing method.
[0099] Specifically, the electronic device includes: one or more processors 501 and a memory 502, Figure 5 A processor 501 is taken as an example. The processor 501 and the memory 502 may be connected via a bus or other means. Figure 5 In the example, the bus connection is used. The memory 502 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The processor 501 executes various functional applications and data processing of the device by running the non-volatile software programs, instructions and modules stored in the memory 502, that is, realizing the above-mentioned device testing method.
[0100] The memory 502 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store a list of options, etc. In addition, the memory 502 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 502 may optionally include a memory remotely arranged relative to the processor 501, and these remote memories may be connected to an external device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0101] One or more modules are stored in the memory 502 , and when executed by one or more processors 501 , the device testing method in any of the above method embodiments is executed.
[0102] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.
[0103] After obtaining the model information of the device to be tested and the model information of multiple processors to be tested in the device to be tested, the embodiment of the present invention determines whether the device to be tested has an abnormality based on the model information of the device to be tested and the model information of each processor to be tested. If there is no abnormality, the operation time of each processor to be tested on the general operator is obtained, and then whether the device to be tested is a simulator is determined based on the above time. The processing capability of the simulator for general operators is usually significantly different from the processing capability of real electronic devices for general operators. Therefore, the embodiment of the present invention can accurately determine whether the device to be tested is a simulator or a real electronic device based on the operation time of each processor to be tested in the device to be tested on the general operator.
[0104] Another embodiment of the present invention relates to a non-volatile storage medium for storing a computer-readable program, wherein the computer-readable program is used for a computer to execute part or all of the above method embodiments.
[0105] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0106] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A device testing method, characterized in that: The method comprises: Acquire device information of the device to be tested, the device information including first model information of the device to be tested and second model information of multiple processors to be tested in the device to be tested; Determine a first test result of the device to be tested according to the first model information and the second model information, where the first test result is used to indicate whether the device to be tested is abnormal; In response to the first test result indicating that the device under test has no abnormality, obtaining the operation time of each processor under test on the general operator; A second test result of the device to be tested is determined according to each of the operation durations, where the second test result is used to indicate whether the device to be tested is a simulator.
2. The method according to claim 1, characterized in that Determining a first test result of the device to be tested according to the first model information and the second model information includes: Acquire third model information of a plurality of standard processors in a standard device according to the first model information, wherein the standard device is a device having the same model as the device to be tested; The first test result is determined according to a matching result between the second model information and the third model information.
3. The method according to claim 2, characterized in that Determining the first test result according to the matching result of the second model information and the third model information includes: In response to the second model information matching the third model information, determining that the first test result indicates that there is no abnormality in the device to be tested; In response to the second model information not matching the third model information, it is determined that the first test result indicates that an abnormality exists in the device to be tested.
4. The method according to claim 2, characterized in that: The plurality of standard processors include at least one of a graphics processor and an embedded neural network processor and a central processing unit.
5. The method according to claim 4, characterized in that Determining the second test result of the device to be tested according to each of the operation durations includes: In response to a difference between a first operation duration and a second operation duration satisfying a first operation condition, determining that the second test result indicates that the device to be tested is a simulator, the first operation duration is the operation duration of the central processing unit on the general operator, and the second operation duration is the operation duration of the graphics processing unit on the general operator; and / or In response to the difference between the first operation duration and the third operation duration satisfying the second operation condition, it is determined that the second test result indicates that the device to be tested is a simulator, and the third operation duration is the operation duration of the embedded neural network processor on the general operator.
6. The method according to claim 4, characterized in that Determining the second test result of the device to be tested according to each of the operation durations includes: In response to the difference between the second operation time and the third operation time satisfying the third operation condition, it is determined that the second test result characterizes that the device to be tested is a simulator, the second operation time is the operation time of the graphics processor on the general operator, and the third operation time is the operation time of the embedded neural network processor on the general operator.
7. The method according to claim 4, characterized in that Determining the second test result of the device to be tested according to each of the operation durations includes: In response to the difference between the first operation duration and the second operation duration not satisfying the first operation condition, and / or the difference between the second operation duration and the third operation duration not satisfying the third operation condition, obtaining the standard operation duration of the general operator by the standard processor according to the second model information, wherein the first operation duration is the operation duration of the central processing unit on the general operator, the second operation duration is the operation duration of the graphics processing unit on the general operator, and the third operation duration is the operation duration of the embedded neural network processor on the general operator, and the standard processor is a processor of the same model as the processor to be tested; The second test result is determined according to at least one of the second operation duration and the third operation duration, the first operation duration, and the standard operation duration.
8. The method according to claim 7, characterized in that The standard processor includes a central processing unit, a graphics processing unit and an embedded neural network processor. The standard computing time includes at least one of a second standard computing time and a third standard computing time and a first standard computing time. The first standard computing time is the standard computing time of the central processing unit for the general operator, the second standard computing time is the standard computing time of the graphics processing unit for the general operator, and the third standard computing time is the standard computing time of the embedded neural network processor for the general operator.
9. The method according to claim 8, characterized in that Determining the second test result according to at least one of the second operation duration and the third operation duration, the first operation duration, and the standard operation duration includes: In response to the absolute value of the difference between the first operation duration and the first standard operation duration satisfying a fourth operation condition, determining that the second test result indicates that the device to be tested is a simulator; and / or In response to the absolute value of the difference between the second operation duration and the second standard operation duration satisfying a fifth operation condition, determining that the second test result indicates that the device to be tested is a simulator; and / or In response to an absolute value of a difference between the third operation duration and the third standard operation duration satisfying a sixth operation condition, it is determined that the second test result indicates that the device to be tested is a simulator.
10. The method according to claim 1, characterized in that The obtaining of device information of the device to be tested includes: Performing security verification on the operating environment of the device to be tested; In response to the operating environment satisfying a security verification condition, the device information is acquired.
11. A device testing apparatus, characterized in that: The device comprises: An information acquisition unit, configured to acquire device information of a device to be tested, wherein the device information includes first model information of the device to be tested and second model information of a plurality of processors to be tested in the device to be tested; A first testing unit, configured to determine a first test result of the device to be tested according to the first model information and the second model information, wherein the first test result is used to indicate whether the device to be tested is abnormal; a duration acquisition unit, configured to acquire the operation duration of each processor under test on a general operator in response to the first test result indicating that the device under test has no abnormality; The second testing unit is used to determine a second testing result of the device to be tested according to each of the operation durations, wherein the second testing result is used to indicate whether the device to be tested is a simulator.
12. An electronic device comprising a memory and a processor, characterized in that: The memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method according to any one of claims 1-10.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
14. A computer program product, characterized in that The computer program product comprises a computer program / instructions, which implement the method according to any one of claims 1 to 10 when executed by a processor.
