Security hardware equipment testing method and device, equipment, medium and program product
By using timed tasks and preset test instructions in the specified operating system for automated testing, the problem of low testing efficiency of secure hardware equipment is solved, and an efficient and accurate testing process is achieved.
Patent Information
- Application Number
- CN202410729846.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2025-01-14
AI Technical Summary
Testing for secure hardware devices in a specified operating system is less efficient, and it relies on manual communication and simulated interaction between the specified operating system and the secure hardware device.
Through the scheduled task scheduling preset test instructions, element identification and testing are carried out, test instructions are executed using environment configuration information and the location of elements to be tested, test reports are generated, and automated testing is realized.
Improves the efficiency and accuracy of the test, reduces the time and cost of manually performing the test, and ensures test coverage and accuracy.
Smart Images

Figure CN119311487A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of software engineering technology and information security technology, and more specifically, to a method, apparatus, device, medium and program product for testing a secure hardware device. Background Art
[0002] With the development of information technology and the rapid changes in Internet industry policies, network information security risks are growing. For example, by providing an autonomous and controllable designated operating system and security hardware equipment, we can meet the needs of safer and more reliable information security. Among them, testing security hardware equipment in the designated operating system is an important part of ensuring the security and reliability of the designated operating system.
[0003] In the process of implementing the concept of the present disclosure, the inventors found that there are at least the following problems in the related art: the efficiency of testing security hardware devices in a specified operating system is low. Summary of the invention
[0004] In view of the above problems, the present disclosure provides a method, apparatus, device, medium and program product for testing a secure hardware device.
[0005] According to the first aspect of the present disclosure, a method for testing a secure hardware device is provided, comprising: in response to a scheduled task being triggered, scheduling a preset test instruction according to an instruction identifier indicated by the scheduled task, wherein the preset test instruction includes environment configuration information matching at least one specified operating system and secure hardware device; in response to receiving a test request from a specified operating system, performing element identification on an interface to be tested corresponding to the secure hardware device to obtain an element identification result, wherein the interface to be tested includes multiple elements to be tested, and the element identification result is used to determine the positions of the multiple elements to be tested; and testing the multiple elements to be tested by executing the preset test instruction according to the environment configuration information and the positions of the multiple elements to be tested.
[0006] According to an embodiment of the present disclosure, the above-mentioned response to receiving a test request from a specified operating system, performing element identification on the interface to be tested corresponding to the security hardware device, and obtaining the element identification result includes: in response to receiving a test request from a specified operating system, obtaining an image of the interface to be tested; performing image recognition on the image of the interface to be tested to obtain element image information corresponding to each of the multiple elements to be tested, and performing optical character recognition on the image of the interface to be tested to obtain element text information and element coordinate information corresponding to each of the multiple elements to be tested.
[0007] According to an embodiment of the present disclosure, the environment configuration information includes communication parameter information matching the security hardware device and data path information corresponding to each of the at least one specified operating system. The above-mentioned testing of the multiple elements to be tested by executing preset test instructions based on the environment configuration information and the positions of the multiple elements to be tested includes: for each element to be tested, determining the position of the element to be tested according to the element image information, the element text information and the element coordinate information, and locating the element to be tested; communicating with the security hardware device according to the communication parameter information; reading the test data according to the data path information to obtain target test data, wherein the test data matches the at least one specified operating system and the security hardware device; generating a test report based on the target test data and according to the positions of the multiple elements to be tested by executing preset test instructions on the multiple elements to be tested after being located; and pushing the test report in response to the completion of the scheduled task execution.
[0008] According to an embodiment of the present disclosure, the above-mentioned reading of test data according to data path information to obtain target test data includes: reading test data according to data path information; processing the test data according to preset test cases to obtain intermediate test data, wherein the preset test cases are associated with security hardware devices; based on preset mapping rules, converting the intermediate test data to obtain target test data, wherein the target test data includes M key-value relationships, and M is a positive integer.
[0009] According to an embodiment of the present disclosure, the preset test instructions include at least one interactive operation. The above-mentioned target test data-based, according to the positions of multiple elements to be tested, by executing the preset test instructions on the multiple elements to be tested after being positioned, generating a test report includes: determining the operation execution order according to the preset test case, wherein the operation execution order is used to characterize the execution order of at least one interactive operation; for each interactive operation, determining the operation execution content according to M key-value relationships, wherein the operation execution content is used to characterize the interactive content of the interactive operation; for each interactive operation, according to the operation execution order, the operation execution content and the positions of multiple elements to be tested, by executing the interactive operation on the multiple elements to be tested after being positioned, obtaining a test result corresponding to the interactive operation; and generating a test report according to the test result of each of at least one interactive operation.
[0010] According to an embodiment of the present disclosure, the preset test instruction also includes instruction call information of at least one interactive operation, the operation call information includes first call information and second call information, and for each interactive operation, the above-mentioned test results corresponding to the interactive operation are obtained by performing interactive operations on the multiple elements to be tested after being located according to the operation execution order, the operation execution content and the position of the multiple elements to be tested, including: when the instruction call information represents the first call information, calling a general function test instruction, so that the multiple elements to be tested after being located interact with the security hardware device, and obtaining a general function test result; and when the instruction call information represents the second call information, executing a specific function test instruction, so that the multiple elements to be tested after being located interact with the security hardware device, and obtaining a specific function test result, wherein the specific function test instruction is determined based on at least one specified operating system and security hardware device.
[0011] According to an embodiment of the present disclosure, before the above-mentioned target test data is used to execute preset test instructions, so that the multiple located elements to be tested interact with the security hardware device and generate a test report, the security hardware device testing method also includes: based on a preset period, sending online request information to the security hardware device, and in response to receiving online response information from the security hardware device, verifying the multiple located elements to be tested based on preset verification rules.
[0012] Another aspect of the present disclosure provides a security hardware device testing apparatus, comprising: a scheduling module, for, in response to a scheduled task being triggered, scheduling a preset test instruction according to an instruction identifier indicated by the scheduled task, wherein the preset test instruction includes environment configuration information matching at least one specified operating system and security hardware device; an identification module, for, in response to receiving a test request from a specified operating system, performing element identification on a to-be-tested interface corresponding to the security hardware device to obtain an element identification result, wherein the to-be-tested interface includes a plurality of to-be-tested elements, and the element identification result is used to determine the positions of the plurality of to-be-tested elements; and a testing module, for, according to the environment configuration information and the positions of the plurality of to-be-tested elements, testing the plurality of to-be-tested elements by executing the preset test instruction.
[0013] Another aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.
[0014] Another aspect of the present disclosure further provides a computer-readable storage medium having a computer program or instruction stored thereon, wherein the steps of the method are performed when the computer program or instruction is executed by a processor.
[0015] Another aspect of the present disclosure further provides a computer program product, including a computer program or instructions, which implement the steps of the above method when the computer program or instructions are executed by a processor.
[0016] According to an embodiment of the present disclosure, by setting and automatically executing a scheduled task, a preset test instruction that matches at least one specified operating system and a security hardware device can be scheduled. By identifying the elements of the interface to be tested, the positions of multiple elements to be tested can be determined, so that multiple elements to be tested can be tested by executing the preset test instructions according to the environment configuration information and the respective positions of the multiple elements to be tested. Thus, the security hardware device testing method provided by the embodiment of the present disclosure can automatically execute the test process for the security hardware device in the specified operating system, and can accurately locate and operate each element to be tested during the execution of the preset test instruction, reducing the time and cost of manually executing the test, effectively improving the efficiency and accuracy of the test, and thus can at least partially solve the technical problem of low efficiency in testing the security hardware device in the specified operating system in the related art. In addition, based on the compatibility and versatility of the scheduled task and the preset test instruction, it can ensure that the preset test instruction can be correctly executed in the instruction operating system, and the interface to be tested can be effectively tested, which helps to improve the test coverage and test accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0018] Figure 1 The application scenario diagram schematically shows the security hardware device testing method, apparatus, device, medium and program product according to the embodiment of the present disclosure;
[0019] Figure 2 A flowchart of a method for testing a secure hardware device according to an embodiment of the present disclosure is schematically shown;
[0020] Figure 3 A flowchart of a security hardware device test according to an embodiment of the present disclosure is schematically shown;
[0021] Figure 4 A security hardware device testing framework according to an embodiment of the present disclosure is schematically shown;
[0022] Figure 5 A structural block diagram schematically shows a security hardware device testing device according to an embodiment of the present disclosure; and
[0023] Figure 6A block diagram of an electronic device suitable for implementing a security hardware device testing method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0024] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0025] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0026] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0027] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0028] In the technical solution of the present disclosure, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0029] In the scenario of using personal information for automated decision-making, the methods, devices, and systems provided by the embodiments of the present disclosure provide users with corresponding operation portals for users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered. The expression "automated decision-making" here refers to the activity of automatically analyzing and evaluating a person's behavioral habits, interests and hobbies, or economic, health, credit status, etc. through computer programs, and making decisions. The expression "expert decision-making" here refers to the activity of making decisions by people who specialize in a certain field, have specialized experience, knowledge and skills, and have reached a certain level of professionalism.
[0030] With the development of information technology and the rapid changes in Internet industry policies, network information security risks are growing. For example, by providing an autonomous and controllable designated operating system and security hardware equipment, we can meet the needs of safer and more reliable information security. Among them, testing security hardware equipment in the designated operating system is an important part of ensuring the security and reliability of the designated operating system.
[0031] According to an embodiment of the present disclosure, a secure hardware device can be used for security authentication. For example, the secure hardware can be used to provide services such as identity authentication and data encryption to improve the security of network transaction operations.
[0032] According to an embodiment of the present disclosure, in a specified operating system, the security hardware device can be tested based on the interface to be tested corresponding to the security hardware device to ensure that the security hardware device can achieve the expected functions and performance in the specified operating system. The interface to be tested can be displayed based on a specified application installed in the specified operating system.
[0033] For example, the security hardware device can be connected to an operating terminal installed with a specified operating system through a USB interface, so that the communication between the specified operating system and the security hardware device can be realized based on the driver corresponding to the security hardware device installed in the specified operating system. Based on multiple elements to be tested in the interface to be tested, interactive operations such as clicking, input, and selection can be performed to simulate the interactive operations of users in actual applications. The test result corresponding to each interactive operation can be determined based on the response information and operation information of the security hardware device for each interactive operation.
[0034] In the process of implementing the concepts disclosed herein, the inventors discovered that there are at least the following problems in the related art: testing of security hardware devices in a specified operating system relies heavily on manual implementation of communication between the specified operating system and the security hardware devices, as well as simulation of the execution of interactive operations, resulting in low testing efficiency.
[0035] In order to at least partially solve the technical problems existing in the related art, the present disclosure provides a method, apparatus, device, medium and program product for testing a security hardware device. The method for testing a security hardware device includes: in response to a timed task being triggered, according to the instruction identifier indicated by the timed task, scheduling a preset test instruction, wherein the preset test instruction includes environment configuration information matching at least one specified operating system and a security hardware device; in response to receiving a test request from a specified operating system, performing element identification on an interface to be tested corresponding to the security hardware device to obtain an element identification result, wherein the interface to be tested includes multiple elements to be tested, and the element identification result is used to determine the positions of the multiple elements to be tested; and testing the multiple elements to be tested by executing the preset test instruction according to the environment configuration information and the positions of the multiple elements to be tested.
[0036] Figure 1 The application scenario diagram of the security hardware device test according to the embodiment of the present disclosure is schematically shown.
[0037] like Figure 1 As shown, the application scenario 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0038] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).
[0039] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0040] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0041] It should be noted that the security hardware device testing method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the security hardware device testing device provided in the embodiment of the present disclosure can generally be set in the server 105. The security hardware testing method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the security hardware testing device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.
[0042] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0043] Figure 2 The flowchart of the security hardware device testing method according to the embodiment of the present disclosure is schematically shown.
[0044] like Figure 2 As shown, the security hardware device testing method 200 of this embodiment includes operations S210 to S230.
[0045] In operation S210, in response to the timed task being triggered, a preset test instruction is scheduled according to an instruction identifier indicated by the timed task, wherein the preset test instruction includes environment configuration information matching at least one specified operating system and security hardware device;
[0046] In operation S220, in response to receiving a test request from a specified operating system, performing element recognition on an interface to be tested corresponding to the security hardware device to obtain an element recognition result, wherein the interface to be tested includes a plurality of elements to be tested, and the element recognition result is used to determine positions of the plurality of elements to be tested;
[0047] In operation S230, the plurality of elements to be tested are tested by executing preset test instructions according to the environment configuration information and the positions of the plurality of elements to be tested.
[0048] According to one embodiment of the present disclosure, the specified operating system may include at least one operating system, wherein there are significant differences between the aforementioned at least one operating system. For example, the specified operating system may include a first operating system and a second operating system. Specifically, the first operating system and the second operating system have significant differences at least in hardware architecture, ecosystem, and user experience. The specified application may include at least one application, wherein there are significant differences between the aforementioned at least one application. For example, the specified application may include a first application and a second application. Specifically, the display content of the interface to be tested in the first application and the second application differs at least in terms of interface layout, element style, overall style, menu function, interactive form, etc. Based on this, the display content of the interface to be tested corresponding to the security hardware device may vary depending on the operating system and / or application. Therefore, when testing the security hardware device based on the interface to be tested in the specified operating system, it is necessary to fully consider the compatibility and versatility of the operating system and the application installed on the operating system.
[0049] It should be noted that the above-mentioned scheduled tasks and preset test instructions are compatible with at least one specified operating system and at least one application. For example, the preset test instructions are preferably written in a programming language that supports cross-operating systems and cross-applications. For example, the preset test instructions are preferably capable of supporting cross-operating system and cross-application test tools and libraries. For example, the preset test instructions are preferably capable of configuring appropriate execution environments (such as communication configuration and file path configuration, etc.) for different operating systems and applications.
[0050] According to an embodiment of the present disclosure, a scheduled task can be understood as a task or operation that can be automatically executed based on a predetermined time interval or a predetermined time. The instruction identifier can be used to uniquely identify a preset test instruction. The environmental configuration information can be understood as a configuration parameter that needs to be matched with at least one specified operating system and a security hardware device. Based on this, the preset test instruction can be matched with at least one specified operating system and a security hardware device, thereby ensuring the compatibility and versatility of the preset test instruction under different specified operating systems, and being able to test the security hardware device under the test scenarios of different specified operating systems.
[0051] According to one embodiment of the present disclosure, the at least one specified operating system may include a general operating system and an ICT operating system. Among them, ICT can also be referred to as information technology application innovation, and the ICT operating system can be understood as an operating system built using autonomous and controllable information technology products and services.
[0052] According to an embodiment of the present disclosure, the interface to be tested can be understood as a management interface or an operation interface corresponding to a security hardware device. The elements to be tested can be understood as various visual components and interactive elements in the interface to be tested.
[0053] For example, the interface to be tested may include an application program interface and / or a web interface corresponding to the security hardware device, etc. The multiple elements to be tested may include at least one of the following: a text box, a button, a drop-down menu, a selection box (radio box / check box), a link, a picture / icon, a table, a slider / scroll bar, a pop-up window, an audio / video player, and a label / title.
[0054] Exemplarily, in response to a scheduled task being triggered, a preset test instruction matching at least one specified operating system and security hardware device can be scheduled according to the instruction identifier indicated by the scheduled task. In response to receiving a test request from a specified operating system, an element identification can be performed on the interface to be tested corresponding to the security hardware device to obtain an element identification result. The element identification result can be used to determine the positions of multiple elements to be tested.
[0055] According to an embodiment of the present disclosure, by setting and automatically executing a scheduled task, a preset test instruction that matches at least one specified operating system and a security hardware device can be scheduled. By identifying the elements of the interface to be tested, the positions of multiple elements to be tested can be determined, so that multiple elements to be tested can be tested by executing the preset test instructions according to the environment configuration information and the respective positions of the multiple elements to be tested. Thus, the security hardware device testing method provided by the embodiment of the present disclosure can automatically execute the test process for the security hardware device in the specified operating system, and can accurately locate and operate each element to be tested during the execution of the preset test instruction, reducing the time and cost of manually executing the test, effectively improving the efficiency and accuracy of the test, and thus can at least partially solve the technical problem of low efficiency in testing the security hardware device in the specified operating system in the related art. In addition, based on the compatibility and versatility of the scheduled task and the preset test instruction, it can ensure that the preset test instruction can be correctly executed in the instruction operating system, and the interface to be tested can be effectively tested, which helps to improve the test coverage and test accuracy.
[0056] According to an embodiment of the present disclosure, in response to receiving a test request from a specified operating system, element identification is performed on the interface to be tested corresponding to the security hardware device, and the element identification result includes: in response to receiving a test request from the specified operating system, obtaining an image of the interface to be tested; performing image recognition on the image of the interface to be tested to obtain element image information corresponding to each of the multiple elements to be tested, and performing optical character recognition on the image of the interface to be tested to obtain element text information and element coordinate information corresponding to each of the multiple elements to be tested.
[0057] According to an embodiment of the present disclosure, in response to receiving a test request from a specified operating system, a screen capture tool can be used to obtain an image of the interface to be tested. By performing image recognition on the image of the interface to be tested, element image information corresponding to each of the multiple elements to be tested can be obtained. By performing optical character recognition (OCR) on the image of the interface to be tested, element text information and element coordinate information corresponding to each of the multiple elements to be tested can be obtained. Among them, the element image information can be used to characterize the appearance information of the element to be tested, the element text information can be used to characterize the name or description information of the element to be tested, and the element coordinate information can be used for the position information of the element to be tested. Based on this, it is possible to determine the positions of each of the multiple elements to be tested according to the element recognition results.
[0058] Optionally, the interface image to be tested may be binarized, and image recognition and / or optical character recognition may be performed on the binarized interface image to be tested to improve the efficiency and accuracy of element recognition.
[0059] According to the embodiments of the present disclosure, those skilled in the art may also reasonably select other element identification methods according to actual needs or application scenarios. Exemplarily, in response to receiving a test request from a specified operating system, the source code of the interface to be tested may be obtained, and the element attribute information of each of the multiple elements to be tested may be determined based on the source code of the interface to be tested. For example, the element attribute information may include at least one of the following: identifier (ID), name (Name), class name (Class Name), tag name (Tag Name), link text (link text). Correspondingly, multiple elements to be tested may be identified based on syntax such as CSSSelector (CSS selector), XPath (path language), and the element attribute information of each of the multiple elements to be tested may be obtained.
[0060] According to one embodiment of the present disclosure, the element recognition result may include element image information, element text information, element coordinate information and element attribute information, which can help to further improve the accuracy of element recognition for multiple elements to be tested, so as to facilitate subsequent targeted testing of the multiple elements to be tested, which can help to further improve the efficiency and accuracy of the test.
[0061] According to an embodiment of the present disclosure, the environment configuration information includes communication parameter information matching the security hardware device and data path information corresponding to each of the at least one specified operating system. According to the environment configuration information and the positions of the multiple elements to be tested, by executing preset test instructions, the multiple elements to be tested are tested, including: for each element to be tested, according to the element image information, the element text information and the element coordinate information, the position of the element to be tested is determined, and the element to be tested is positioned; according to the communication parameter information, the security hardware device is communicated; according to the data path information, the test data is read to obtain target test data, wherein the test data matches the at least one specified operating system and the security hardware device; based on the target test data, according to the positions of the multiple elements to be tested, a test report is generated by executing preset test instructions on the multiple elements to be tested after positioning; and in response to the completion of the scheduled task execution, the test report is pushed.
[0062] According to the embodiments of the present disclosure, the test data can be understood as the input information required in the process of testing the security hardware device in the specified operating system, and the test data matches at least one specified operating system and the security hardware device. Based on this, the test data can be used to simulate the actual interactive operation of the user on the security hardware device in at least one specified operating system, so as to verify the expected function of the interface to be tested or test the ability of the interface to be tested to handle exceptions.
[0063] According to an embodiment of the present disclosure, data path information can be used to locate and access test data in a specified operating system. Exemplarily, the data path information may include the file name and directory information of the test data. Communication parameter information may enable communication between a specified operating system and a security hardware device. Communication parameter information may include serial port parameter information (e.g., serial port number, baud rate, data bit, stop bit, etc.). For example, a corresponding serial port driver may be installed in a specified operating system based on a chip in a security hardware device, and communication between a specified operating system and a security setting may be enabled by setting the serial port parameter information.
[0064] According to the embodiments of the present disclosure, the target test data can be understood as data that can be directly read and used during the execution of the preset test instructions. For example, the format of the target test data can be selected as a key-value pair, a table, a list, etc., which is not limited here.
[0065] According to the embodiments of the present disclosure, based on the target test data and according to the positions of the multiple elements to be tested, by executing preset test instructions, the multiple elements to be tested after being located interact with the security hardware device and generate a test report. On this basis, the test report can be pushed in response to the completion of the scheduled task execution. Based on this, the automated testing and test report push for the security hardware device in the specified operating system can be realized by executing the preset test instructions, thereby reducing the time and cost of manually executing the test, and thus effectively improving the efficiency of the test.
[0066] According to an embodiment of the present disclosure, reading test data according to data path information to obtain target test data includes: reading test data according to data path information; processing the test data according to preset test cases to obtain intermediate test data, wherein the preset test cases are associated with security hardware devices; converting the intermediate test data based on preset mapping rules to obtain target test data, wherein the target test data includes M key-value relationships, and M is a positive integer.
[0067] According to the embodiments of the present disclosure, a test case can be understood as a description of a test task for a security hardware device. A test case can test the function, behavior, and performance of a software system through predefined steps, conditions, and expected results. Test data can be processed according to a preset test case (e.g., adaptively adjusting the format, quantity, content, etc. of the test data) to obtain intermediate test data to meet the test requirements of the test case.
[0068] According to an embodiment of the present disclosure, the intermediate test data may be converted based on a preset mapping rule to obtain target test data. For example, the intermediate test data may be converted into a multi-level dictionary data structure based on a preset mapping rule, and the multi-level dictionary data structure may include M key-value relationships.
[0069] According to an embodiment of the present disclosure, the preset test instructions include at least one interactive operation. Based on the target test data and according to the positions of multiple elements to be tested, the preset test instructions are executed on the multiple elements to be tested after being located, and generating a test report includes: determining the operation execution order according to the preset test case, wherein the operation execution order is used to characterize the execution order of at least one interactive operation; for each interactive operation, determining the operation execution content according to M key-value relationships, wherein the operation execution content is used to characterize the interactive content of the interactive operation; for each interactive operation, according to the operation execution order, the operation execution content and the positions of multiple elements to be tested, by executing the interactive operation on the multiple elements to be tested after being located, a test result corresponding to the interactive operation is obtained; and generating a test report according to the test result of each of the at least one interactive operation.
[0070] According to one embodiment of the present disclosure, at least one interactive operation may include text / picture input, text / picture selection, button selection, button click, drop-down menu selection, form filling and submission, audio / video playback, scrolling and dragging and dropping, pop-up window processing, operation gesture response, etc.
[0071] According to the embodiments of the present disclosure, since the test case can be used to describe the test task for the security hardware device on the specified operating system, the execution order of at least one interactive operation can be determined according to the preset test case. Further, since the test data can be understood as the input information required in the test process for the security hardware device in the specified operating system, the interactive content of each interactive operation can be determined according to the M key-value relationships.
[0072] According to an embodiment of the present disclosure, for each interactive operation, the multiple elements to be tested and the security hardware device can be positioned to interact according to the operation execution order, the operation execution content and the positions of the multiple elements to be tested, and a test result corresponding to the interactive operation can be obtained. On this basis, a test report can be generated according to the test result of at least one interactive operation.
[0073] According to an embodiment of the present disclosure, the preset test instructions also include instruction call information of at least one interactive operation, the operation call information includes first call information and second call information, and for each interactive operation, according to the operation execution order, the operation execution content and the position of the multiple elements to be tested, the interactive operation is performed on the multiple elements to be tested after being located, and the test results corresponding to the interactive operation are obtained, including: when the instruction call information represents the first call information, calling the general function test instruction, so that the multiple elements to be tested after being located interact with the security hardware device, and obtaining the general function test result; and when the instruction call information represents the second call information, executing the specific function test instruction, so that the multiple elements to be tested after being located interact with the security hardware device, and obtaining the specific function test result, wherein the specific function test instruction is determined based on at least one specified operating system and security hardware device.
[0074] According to an embodiment of the present disclosure, general functional testing instructions may include reusable test libraries, functions or classes, and specific functional testing instructions may include specific control operations, data operations, keyboard and mouse operations, etc. corresponding to at least one specified operating system and security hardware device.
[0075] According to the embodiments of the present disclosure, the general function test instructions help simplify the development process of the preset test instructions, and are conducive to improving the versatility and reusability of the preset test instructions. The specific function test instructions can ensure the compatibility of the preset test instructions with at least one specified operating system and security hardware device, thereby helping to ensure the stable execution of the preset test instructions.
[0076] According to an embodiment of the present disclosure, before executing preset test instructions based on target test data, allowing the located multiple elements to be tested to interact with the security hardware device, and generating a test report, the method also includes: sending online request information to the security hardware device based on a preset period, and in response to receiving online response information from the security hardware device, verifying the located multiple elements to be tested based on preset verification rules.
[0077] According to an embodiment of the present disclosure, by sending online request information to a secure hardware device and receiving online response information from the secure hardware device, it can be determined that both the instruction operating system and the secure hardware device can operate and respond normally, thereby ensuring the stability of communication between the specified operating system and the secure hardware device.
[0078] According to an embodiment of the present disclosure, in response to receiving online response information from a secure hardware device, the located multiple elements to be tested can be verified based on preset verification rules to ensure that each element to be tested is accessible and operable for at least one interactive operation. For example, for each element to be tested, the type, format, location, attribute, visibility, accessibility, text content, response time, etc. of the element to be tested can be verified.
[0079] According to the embodiments of the present disclosure, the above settings can help ensure that the preset test instructions can be automatically executed more stably and accurately, thereby helping to further improve the efficiency and accuracy of the test.
[0080] Figure 3 The flowchart of the security hardware device test according to the embodiment of the present disclosure is schematically shown.
[0081] like Figure 3 As shown, in response to the timing task 301 being triggered, the preset test instruction 303 can be scheduled according to the instruction identifier 302 indicated by the timing task 301. The preset test instruction 303 may include environment configuration information 304 matching at least one operating system and a security hardware device 306.
[0082] According to an embodiment of the present disclosure, in response to receiving a test request 305 from a specified operating system, an element recognition may be performed on a to-be-tested interface 307 corresponding to a security hardware device 306 to obtain an element recognition result 308. For each to-be-tested element 310, a position 309 of the to-be-tested element may be determined according to the element recognition result 308, and each to-be-tested element 310 may be located.
[0083] According to an embodiment of the present disclosure, the environment configuration information 304 may include communication parameter information 304_1 corresponding to the security hardware device and data path information 304_2 corresponding to at least one designated operating system.
[0084] Exemplarily, communication may be performed with the secure hardware device 306 according to the communication parameter information 304_1. Test data 311 may be read according to the data path information 304_2. Test data 311 may be processed according to a preset test case 312 associated with the secure hardware device to obtain intermediate test data 313. Intermediate test data 313 may be converted based on a preset mapping rule to obtain target test data 314. The target test data 314 may include M key-value relationships 315.
[0085] According to an embodiment of the present disclosure, an operation execution order 316 may be determined according to a preset test case 312. An operation execution content 317 of each of at least one interactive operation may be determined according to M key-value relationships 315. On this basis, for each interactive operation, an interactive operation may be performed on the located multiple elements to be tested 310 according to the operation execution order 316, the operation execution content 317, and the respective positions 309 of the multiple elements to be tested, to obtain a test result 318 corresponding to the interactive operation. A test report 319 may be generated according to the test result 318 of each of the at least one interactive operation.
[0086] According to an embodiment of the present disclosure, in response to the completion of the execution of the timing task 301, a test report 319 may be pushed.
[0087] Figure 4 A security hardware device testing framework according to an embodiment of the present disclosure is schematically shown.
[0088] like Figure 4 As shown, the security hardware device testing framework may include an operating environment layer, a general framework layer, a common component layer, a basic method layer, and an instruction engine layer.
[0089] Exemplarily, the operating environment layer may include at least one specified operating system. The general framework layer may be selected as an open source test tool that is compatible with multiple operating systems, which is not limited here. The common component layer may include reusable test libraries, functions or classes, and the basic method class may include functions or classes for implementing specific control operations, data operations, keyboard and mouse operations, etc. The instruction engine layer may be used to implement data interaction, as well as the calling and execution of the common component layer and the basic method layer.
[0090] For example, the common component layer may include a browser operation library, an online detection service, an object file (yaml) operation service, a file operation service, a log management service, an interface image acquisition service, an optical character recognition service, an image recognition service, and the like.
[0091] For example, the basic method layer may include element positioning class, element operation class, mouse and keyboard class, data operation class, browser processing class, date class, assertion class, etc.
[0092] For example, the instruction engine layer may include an interactive operation control class, a general function test instruction calling class, a specific function test instruction execution class, a target test data driving class, a shared variable class, and the like.
[0093] Based on the above-mentioned security hardware device testing method, the present disclosure also provides a security hardware device testing device. Figure 5 The device is described in detail.
[0094] Figure 5 The structural block diagram of the security hardware device testing apparatus according to an embodiment of the present disclosure is schematically shown.
[0095] like Figure 5 As shown, the security hardware device testing apparatus 500 of this embodiment includes a scheduling module 510 , an identification module 520 and a testing module 530 .
[0096] The scheduling module 510 is used to schedule a preset test instruction according to the instruction identifier indicated by the scheduled task in response to the scheduled task being triggered, wherein the preset test instruction includes environment configuration information matching at least one specified operating system and security hardware device;
[0097] an identification module 520, configured to, in response to receiving a test request from a specified operating system, perform element identification on an interface to be tested corresponding to the security hardware device to obtain an element identification result, wherein the interface to be tested includes a plurality of elements to be tested, and the element identification result is used to determine positions of the plurality of elements to be tested; and
[0098] The testing module 530 is used to test the multiple elements to be tested by executing preset testing instructions according to the environment configuration information and the positions of the multiple elements to be tested.
[0099] According to an embodiment of the present disclosure, the scheduling module 510 may include an interface acquisition submodule, a first identification submodule, and a second identification submodule.
[0100] The interface acquisition submodule is used to acquire the image of the interface to be tested in response to receiving a test request from a specified operating system.
[0101] The first recognition submodule is used to perform image recognition on the interface image to be tested to obtain element image information corresponding to each of the multiple elements to be tested.
[0102] The second recognition submodule is used to perform optical character recognition on the interface image to be tested, and obtain element text information and element coordinate information corresponding to each of the multiple elements to be tested.
[0103] According to an embodiment of the present disclosure, the test module 530 may include a positioning submodule, a communication submodule, a reading submodule, a testing submodule, and a pushing submodule.
[0104] The positioning submodule is used to determine the position of each element to be tested according to the element image information, element text information and element coordinate information, and to position the element to be tested.
[0105] A communication submodule, used to communicate with the security hardware device according to the communication parameter information;
[0106] The reading submodule is used to read the test data according to the data path information to obtain the target test data, wherein the test data matches at least one specified operating system and security hardware device.
[0107] The test submodule is used to generate a test report based on the target test data and the positions of the multiple elements to be tested by executing preset test instructions on the multiple elements to be tested after positioning.
[0108] The push submodule is used to push the test report in response to the completion of the scheduled task execution.
[0109] According to an embodiment of the present disclosure, the reading submodule may include a data reading unit, a data processing unit, and a data conversion unit.
[0110] The data reading unit is used to read the test data according to the data path information.
[0111] The data processing unit is used to process the test data according to the preset test case to obtain the intermediate test data, wherein the preset test case is associated with the security hardware device.
[0112] The data conversion unit is used to convert the intermediate test data based on a preset mapping rule to obtain target test data, wherein the target test data includes M key-value relationships, and M is a positive integer.
[0113] According to an embodiment of the present disclosure, the test submodule may include a first determination unit, a second determination unit, an interactive operation unit, and a report generation unit.
[0114] The first determining unit is used to determine an operation execution order according to a preset test case, wherein the operation execution order is used to characterize an execution order of at least one interactive operation.
[0115] The second determining unit is used to determine, for each interactive operation, the operation execution content according to the M key-value relationships, wherein the operation execution content is used to characterize the interactive content of the interactive operation.
[0116] The interactive operation unit is used for obtaining a test result corresponding to the interactive operation by performing the interactive operation on the located multiple elements to be tested according to the operation execution order, the operation execution content and the positions of the multiple elements to be tested for each interactive operation.
[0117] The report generating unit is used to generate a test report according to the test result of each of at least one interactive operation.
[0118] According to an embodiment of the present disclosure, the interactive operation subunit may include an instruction calling subunit and an instruction executing subunit.
[0119] The instruction calling subunit is used to call the general function test instruction when the instruction calling information represents the first calling information, so as to make the located multiple elements to be tested interact with the security hardware device to obtain the general function test result.
[0120] The instruction execution subunit is used to execute specific function test instructions when the instruction call information represents the second call information, so that the located multiple elements to be tested and the security hardware device interact to obtain specific function test results, wherein the specific function test instructions are determined based on at least one specified operating system and security hardware device.
[0121] According to an embodiment of the present disclosure, the security hardware device testing apparatus 500 further includes a request module and a verification module.
[0122] The request module is used to send online request information to the security hardware device based on a preset period.
[0123] The verification module is used to verify the located multiple elements to be tested based on preset verification rules in response to receiving online response information from the security hardware device.
[0124] According to an embodiment of the present disclosure, any multiple modules including the scheduling module 510, the identification module 520 and the test module 530 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the scheduling module 510, the identification module 520 and the test module 530 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the scheduling module 510, the identification module 520 and the test module 530 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.
[0125] It should be noted that the security hardware device testing apparatus part in the embodiment of the present disclosure corresponds to the security hardware device testing method part in the embodiment of the present disclosure. The description of the security hardware device testing apparatus part specifically refers to the security hardware device testing method part, which will not be repeated here.
[0126] Figure 6 A block diagram of an electronic device suitable for implementing a security hardware device testing method according to an embodiment of the present disclosure is schematically shown.
[0127] like Figure 6 As shown, the electronic device 600 according to an embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 to a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0128] In RAM 603, various programs and data required for the operation of electronic device 600 are stored. Processor 601, ROM 602 and RAM 603 are connected to each other via bus 604. Processor 601 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0129] According to an embodiment of the present disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the I / O interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 609 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage portion 608 as needed.
[0130] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0131] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 602 and / or RAM 603 described above and / or one or more memories other than ROM 602 and RAM 603.
[0132] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program includes a program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the security hardware device testing method provided by the embodiment of the present disclosure.
[0133] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 601. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0134] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0135] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, apparatus, module, unit, etc. described above can be implemented by a computer program module.
[0136] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0137] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0138] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0139] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A method for testing a security hardware device, characterized in that: The method comprises: In response to the timed task being triggered, scheduling a preset test instruction according to the instruction identifier indicated by the timed task, wherein the preset test instruction includes environment configuration information matching at least one specified operating system and the security hardware device; In response to receiving a test request from the designated operating system, performing element identification on an interface to be tested corresponding to the security hardware device to obtain an element identification result, wherein the interface to be tested includes a plurality of elements to be tested, and the element identification result is used to determine positions of the plurality of elements to be tested; and The plurality of elements to be tested are tested by executing the preset test instructions according to the environment configuration information and the positions of the plurality of elements to be tested.
2. The method according to claim 1, characterized in that In response to receiving the test request from the designated operating system, performing element identification on the interface to be tested corresponding to the security hardware device to obtain the element identification result includes: In response to receiving a test request from the designated operating system, acquiring an image of an interface to be tested; Performing image recognition on the interface image to be tested to obtain element image information corresponding to each of the multiple elements to be tested, and Optical character recognition is performed on the interface image to be tested to obtain element text information and element coordinate information corresponding to each of the multiple elements to be tested.
3. The method according to claim 2, characterized in that The environment configuration information includes communication parameter information matching the security hardware device and data path information corresponding to each of the at least one specified operating system, and the testing of the multiple elements to be tested by executing the preset test instructions according to the environment configuration information and the positions of the multiple elements to be tested includes: For each of the elements to be tested, determining the position of the element to be tested according to the element image information, the element text information and the element coordinate information, and locating the element to be tested; Communicating with the security hardware device according to the communication parameter information; Reading test data according to the data path information to obtain target test data, wherein the test data matches the at least one specified operating system and the security hardware device; Based on the target test data, according to the positions of the multiple elements to be tested, by executing the preset test instructions on the multiple elements to be tested after positioning, generating a test report; and In response to the scheduled task being completed, the test report is pushed.
4. The method according to claim 3, characterized in that The reading of the test data according to the data path information to obtain the target test data comprises: Reading the test data according to the data path information; Processing the test data according to a preset test case to obtain intermediate test data, wherein the preset test case is associated with the security hardware device; Based on a preset mapping rule, the intermediate test data is converted to obtain target test data, wherein the target test data includes M key-value relationships, where M is a positive integer.
5. The method according to claim 4, characterized in that The preset test instruction includes at least one interactive operation, and the generating of the test report based on the target test data and according to the positions of the plurality of elements to be tested by executing the preset test instruction on the plurality of elements to be tested after being located includes: Determine an operation execution order according to the preset test case, wherein the operation execution order is used to characterize the execution order of the at least one interactive operation; For each of the interactive operations, determining an operation execution content according to the M key-value relationships, wherein the operation execution content is used to characterize the interactive content of the interactive operation; For each of the interactive operations, according to the operation execution order, the operation execution content and the positions of the multiple elements to be tested, by performing the interactive operation on the multiple elements to be tested after being located, a test result corresponding to the interactive operation is obtained; and The test report is generated according to the test result of each of the at least one interactive operation.
6. The method according to claim 5, characterized in that The preset test instruction also includes instruction call information of the at least one interactive operation, the operation call information includes first call information and second call information, and for each interactive operation, the test result corresponding to the interactive operation is obtained by performing the interactive operation on the located multiple elements to be tested according to the operation execution order, the operation execution content and the positions of the multiple elements to be tested, including: In the case where the instruction calling information represents the first calling information, calling a general function test instruction, so that the located multiple elements to be tested interact with the security hardware device to obtain a general function test result; and In the case where the instruction call information represents the second call information, a specific function test instruction is executed to make the located multiple elements to be tested interact with the security hardware device to obtain a specific function test result, wherein the specific function test instruction is determined based on the at least one specified operating system and the security hardware device.
7. The method according to claim 3, characterized in that Before executing the preset test instructions based on the target test data to allow the located multiple elements to be tested to interact with the security hardware device and generate a test report, the method further includes: Based on a preset period, sending online request information to the security hardware device, and In response to receiving the online response information from the security hardware device, the located multiple elements to be tested are verified based on preset verification rules.
8. A security hardware device testing device, characterized in that: The device comprises: A scheduling module, configured to, in response to a scheduled task being triggered, schedule a preset test instruction according to an instruction identifier indicated by the scheduled task, wherein the preset test instruction includes environment configuration information matching at least one specified operating system and the security hardware device; an identification module, configured to, in response to receiving a test request from the specified operating system, perform element identification on an interface to be tested corresponding to the security hardware device to obtain an element identification result, wherein the interface to be tested includes a plurality of elements to be tested, and the element identification result is used to determine positions of the plurality of elements to be tested; and The testing module is used to test the multiple elements to be tested by executing the preset testing instructions according to the environmental configuration information and the positions of the multiple elements to be tested.
9. An electronic device, comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
11. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.