Operating system testing method, device and system integrating multiple chips

By receiving user input data in the running panel of the test script, automatically identifying and selecting the target chip, and using the target command parameter set for testing, the problem of inefficiency of multiple chips in complex industrial control systems is solved, and efficient integration testing is achieved.

CN118897810BActive Publication Date: 2025-02-28BEIJING SMARTCHIP MICROELECTRONICS TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411401823.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-02-28
Estimated Expiration
2044-10-09

AI Technical Summary

Technical Problem

In complex industrial control systems, it is necessary to integrate multiple chips with different functions for testing, resulting in repeated editing and maintenance of the same functional instructions in different test projects, increasing the testing workload and reducing the testing efficiency.

Method used

An operating system testing method integrating multiple chips is proposed. By receiving the input data from the user on the running panel of the test script, the test target chip is automatically identified and selected, and the operating system of the target chip is tested using the target command parameter set, thereby realizing the integrated testing of multiple chips in a single test process.

Benefits of technology

By reducing the time of repeated work and environment switching, it improves testing efficiency, simplifies the test process, and reduces the possibility of operational errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The present application discloses a method, device and system for testing an operating system integrating multiple chips, belonging to the field of chip testing technology. The method includes: receiving input data from a user in a running panel of a test script; the test script is used to test multiple different chips with at least partially identical functional instructions; selecting a target chip for testing according to the input data; using the test script to test the operating system of the target chip using a target command parameter set. The present application establishes the same test script for multiple different chips with at least partially identical functional instructions, tests different chips by changing input data and command parameters, and realizes integrated testing of multiple chips with a single test process. Different chips can also interact with each other, and different command parameters can be tested by modifying the value of the command parameter. There is no need to write code for each command parameter test, which reduces code redundancy and improves test efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of chip testing technology, and in particular, relates to an operating system testing method, device and system integrating multiple chips. Background Art

[0002] With the rapid development of industrial automation and intelligence, controllers are increasingly used in various industrial fields. One of the core components of the controller is the security chip, which is responsible for performing key tasks and ensuring the security of the system. The chip operating system (COS) is the basic software to realize these functions, and its stability and security are crucial to the entire control system.

[0003] In complex industrial control systems, it is often necessary to integrate multiple chips with different functions to achieve diverse control requirements. Each chip needs a corresponding COS system according to its specific functions and application scenarios. In order to fully test the COS functions of each chip, it is necessary to create independent test projects for different chips.

[0004] In actual industrial projects, the COS of chips with different functions in the controller may have a lot of overlap in basic functional instructions, which leads to the need to repeatedly edit and maintain the same functional instructions in different test projects during maintenance and test execution, increasing the testing workload and reducing testing efficiency. Summary of the invention

[0005] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a method, device and system for testing an operating system integrating multiple chips to achieve integrated testing of different chips and improve testing efficiency.

[0006] In a first aspect, the present application provides an operating system testing method integrating multiple chips, including:

[0007] Receiving input data from a user in a running panel of a test script; the test script is used to test a plurality of different chips having at least partially identical functional instructions;

[0008] Selecting a target chip for testing according to the input data;

[0009] The test script is used to test the operating system of the target chip using a target command parameter set.

[0010] According to the operating system testing method for integrating multiple chips of the present application, input data from the user in the running panel of the test script is received; the test script is used to test multiple different chips with at least partially identical functional instructions; the target chip for the test is selected according to the input data; the operating system of the target chip is tested using the test script using the target command parameter set. The embodiment of the present application establishes the same test script for multiple different chips with at least partially identical functional instructions. When the user inputs data in the running panel of the test script, the target chip for this test can be automatically identified and selected, and then the operating system of the selected chip is tested using the target command parameter set. Other chips can also be tested by changing the input data and command parameters, thus realizing integrated testing of multiple chips with a single test process, reducing the time of repeated work and environment switching, and improving test efficiency.

[0011] According to one embodiment of the present application, the step of selecting a target chip for testing according to the input data includes:

[0012] The chip corresponding to the input data is matched as the target chip according to a preset corresponding relationship; wherein the corresponding relationship represents a mapping relationship between the input data and the chip.

[0013] In this embodiment, by establishing a preset correspondence between input data and chips, user input data can be automatically identified according to these preset mapping relationships, thereby matching the corresponding chip as a test target, thereby improving the pertinence and efficiency of the test process.

[0014] According to an embodiment of the present application, matching the chip corresponding to the input data as the target chip according to a preset corresponding relationship includes:

[0015] Convert the input data into Boolean data and assign the value to the target variable;

[0016] The chip corresponding to the value of the target variable is matched according to the preset corresponding relationship as the target chip.

[0017] In this embodiment, the user's input data is logically converted and expressed in the form of Boolean values, and then the chip for this test is matched based on the Boolean value according to the preset correspondence, thereby improving the logic and automation of the test selection and making the test process more concise and efficient.

[0018] According to an embodiment of the present application, the operation panel displays prompt information of the corresponding relationship.

[0019] In this embodiment, by displaying the mapping relationship between input data and chips on the running panel, the user can intuitively understand how the input data will affect the selection of test targets, thereby reducing the user's guesswork and errors during the test configuration process and improving the test efficiency.

[0020] In this embodiment, the method further comprises:

[0021] A connection is established with a plurality of card readers through a preset communication interface function; wherein different card readers are connected with different chips.

[0022] In this embodiment, connections are established with multiple card readers through a preset communication interface function to achieve communication with different chips, so that test data can be accurately transmitted and received. Moreover, since communication can be performed with different chips, simulated interaction can also be performed between different chips, further improving the efficiency of the test.

[0023] According to an embodiment of the present application, the step of using the test script to test the operating system of the target chip using target command parameters includes:

[0024] Get the card reader list;

[0025] Matching a target card reader connected to the target chip from the card reader list;

[0026] Data interaction with the target chip is established through the target card reader, so as to use the test script to test the operating system of the target chip using the target command parameter set.

[0027] In this embodiment, by obtaining a list of available card readers and then matching the target card reader connected to the target chip from the list, data interaction can be established between the target card reader and the target chip, and the chip operating system can be tested using the test script and the target command parameter set. Through the automated card reader matching process, the test efficiency is improved, the need for manual intervention is reduced, and the possibility of operational errors is reduced. In addition, this matching method can adapt to newly added card readers and chips without requiring a large number of modifications to the test script.

[0028] According to an embodiment of the present application, using the test script to test the operating system of the target chip using a target command parameter set includes:

[0029] Obtain the number of specific parameter values ​​supported by each target command parameter in the target command parameter set;

[0030] Match the target parameter passing function of the test script according to the number of specific parameter values ​​supported by each target command parameter;

[0031] The target parameter passing function is called to perform traversal testing on each target command parameter in the target command parameter set.

[0032] In this embodiment, by obtaining the number of specific parameter values ​​supported by each parameter in the target command parameter set and matching the corresponding target parameter passing functions according to these numbers, it is possible to automatically select a suitable parameter passing function according to the number of different parameter values, without having to write corresponding test programs for different parameters, thereby improving test efficiency.

[0033] According to an embodiment of the present application, matching the target parameter passing function of the test script according to the number of specific parameter values ​​supported by each target command parameter includes:

[0034] When the number of specific parameter values ​​supported by each target command parameter is one, the target parameter transfer function is determined to be a Parameter function.

[0035] In this embodiment, when the number of specific parameter values ​​is only one, the target parameter passing function is determined as the Parameter function. The Parameter function can be used to directly pass these parameter values ​​to the test script, avoiding unnecessary loops or conditional judgments, thereby improving the speed of test execution.

[0036] According to an embodiment of the present application, matching the target parameter passing function of the test script according to the number of specific parameter values ​​supported by each target command parameter includes:

[0037] When the number of specific parameter values ​​supported by at least one target command parameter is one, and the number of specific parameter values ​​supported by at least one target command parameter is multiple, it is determined that the target parameter transfer function is a ParameterPartion function.

[0038] In this embodiment, when single-value parameters and multi-value parameters coexist, the ParameterPartion function can distinguish and directly assign values ​​to single-value parameters, and use the Scan function for multi-value parameters, so that different command parameters can be passed to the test script in an appropriate manner without the need for large-scale modifications to the test script, thereby improving test efficiency.

[0039] According to an embodiment of the present application, matching the target parameter passing function of the test script according to the number of specific parameter values ​​supported by each target command parameter includes:

[0040] When the number of specific parameter values ​​supported by each target command parameter is multiple, it is determined that the target parameter transfer function is a Scan function.

[0041] In this embodiment, when the target command parameters all support multiple specific parameter values, the Scan function is selected as the target parameter passing function, and the parameter values ​​of each target command parameter are automatically iterated, so that the test script performs a detailed scan and test on all possible values ​​of each parameter, thereby improving the test efficiency.

[0042] According to one embodiment of the present application, the test script is edited based on the Python language; and the test script is run in PyCharm.

[0043] In this embodiment, by writing the test script based on Python language and running it in the integrated development environment of PyCharm, the test process is made more efficient and easy to maintain and expand.

[0044] In a second aspect, the present application provides an operating system testing device integrating multiple chips, including:

[0045] A receiving module, used to receive input data from a user in a running panel of a test script; the test script is used to test a plurality of different chips having at least partially identical functional instructions;

[0046] A selection module, used for selecting a target chip for testing according to the input data;

[0047] A test module is used to test the operating system of the target chip using the test script and a target command parameter set.

[0048] According to the operating system testing device for integrating multiple chips of the present application, input data from the user in the running panel of the test script is received; the test script is used to test multiple different chips with at least partially identical functional instructions; the target chip for the test is selected according to the input data; the operating system of the target chip is tested using the test script using the target command parameter set. The embodiment of the present application establishes the same test script for multiple different chips with at least partially identical functional instructions. When the user inputs data in the running panel of the test script, the target chip for this test can be automatically identified and selected, and then the operating system of the selected chip is tested using the target command parameter set. Other chips can also be tested by changing the input data and command parameters, thus realizing integrated testing of multiple chips with a single test process, reducing the time of repeated work and environment switching, and improving test efficiency.

[0049] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for testing an operating system integrating multiple chips as described in the first aspect above is implemented.

[0050] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the operating system testing method integrating multiple chips as described in the first aspect above.

[0051] In a fifth aspect, the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the operating system testing method integrating multiple chips as described in the first aspect above.

[0052] In a sixth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the operating system testing method for integrating multiple chips as described in the first aspect above.

[0053] In a seventh aspect, the present application provides an operating system testing system integrating multiple chips, including a testing device and multiple card readers connected to the testing device;

[0054] The testing device exchanges data with different chips through different card readers;

[0055] The testing device is used to execute the operating system testing method integrating multiple chips described in the first aspect above.

[0056] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects:

[0057] According to the operating system testing method for integrating multiple chips of the present application, input data from the user in the running panel of the test script is received; the test script is used to test multiple different chips with at least partially identical functional instructions; the target chip for the test is selected according to the input data; the operating system of the target chip is tested using the test script using the target command parameter set. The embodiment of the present application establishes the same test script for multiple different chips with at least partially identical functional instructions. When the user inputs data in the running panel of the test script, the target chip for this test can be automatically identified and selected, and then the operating system of the selected chip is tested using the target command parameter set. Other chips can also be tested by changing the input data and command parameters, thus realizing integrated testing of multiple chips with a single test process, reducing the time of repeated work and environment switching, and improving test efficiency.

[0058] Furthermore, in some embodiments, by establishing a preset correspondence between input data and chips, user input data can be automatically identified according to these preset mapping relationships, thereby matching the corresponding chip as a test target, thereby improving the pertinence and efficiency of the test process.

[0059] Furthermore, in some embodiments, by performing logical conversion on the user's input data and expressing it in the form of Boolean values, and then matching the chip for this test based on the Boolean values ​​according to a preset correspondence, the logic and automation of the test selection are improved, making the test process more concise and efficient.

[0060] Furthermore, in some embodiments, by displaying the mapping relationship between input data and chips on the running panel, users can intuitively understand how the input data will affect the selection of test targets, thereby reducing user guesswork and errors during the test configuration process and improving test efficiency.

[0061] Furthermore, in some embodiments, connections are established with multiple card readers through a preset communication interface function to achieve communication with different chips, so that test data can be accurately transmitted and received. Moreover, since communication can be performed with different chips, simulated interactions can also be performed between different chips, further improving the efficiency of the test.

[0062] Furthermore, in some embodiments, by obtaining a list of available card readers and then matching a target card reader connected to a target chip from the list, data interaction can be established between the target card reader and the target chip, and the chip operating system can be tested using a test script and a target command parameter set. Through the automated card reader matching process, the test efficiency is improved, the need for manual intervention is reduced, and the possibility of operational errors is reduced. In addition, this matching method can adapt to newly added card readers and chips without requiring a large number of modifications to the test script.

[0063] Furthermore, in some embodiments, by obtaining the number of specific parameter values ​​supported by each parameter in the target command parameter set and matching the corresponding target parameter passing functions according to these numbers, it is possible to automatically select a suitable parameter passing function according to the number of different parameter values, eliminating the need to write corresponding test programs for different parameters, thereby improving test efficiency.

[0064] Furthermore, in some embodiments, by determining the target parameter passing function as a Parameter function when the number of specific parameter values ​​is only one, these parameter values ​​can be directly passed to the test script using the Parameter function, avoiding unnecessary loops or conditional judgments, thereby improving the speed of test execution.

[0065] Furthermore, in some embodiments, when single-value parameters and multi-value parameters coexist, the ParameterPartion function can distinguish and directly assign values ​​to single-value parameters, and use the Scan function for multi-value parameters, so that different command parameters can be passed to the test script in an appropriate manner without the need for large-scale modifications to the test script, thereby improving test efficiency.

[0066] Furthermore, in some embodiments, when the target command parameters support multiple specific parameter values, the Scan function is selected as the target parameter passing function to automatically iterate the parameter values ​​of each target command parameter, so that the test script can perform a detailed scan and test on all possible values ​​of each parameter, thereby improving the test efficiency.

[0067] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0069] Figure 1 It is a schematic diagram of the architecture of an operating system testing system integrating multiple chips provided in an embodiment of the present application;

[0070] Figure 2 It is a schematic diagram of a logical structure of connecting multiple card readers provided in an embodiment of the present application;

[0071] Figure 3 This is one of the flowcharts of the test script test provided in the embodiment of the present application;

[0072] Figure 4 This is the second flowchart of the test script test provided in the embodiment of the present application;

[0073] Figure 5 It is a schematic diagram of the architecture of the test project provided in the embodiment of the present application;

[0074] Figure 6 It is a flowchart of a method for testing an operating system integrating multiple chips provided in an embodiment of the present application;

[0075] Figure 7 It is a structural schematic diagram of an operating system testing device integrating multiple chips provided in an embodiment of the present application;

[0076] Figure 8 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0077] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0078] The terms "first", "second", etc. in the specification of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are usually a class, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0079] In complex industrial control systems, it is often necessary to integrate multiple chips with different functions to achieve diverse control needs. Each chip needs to have a corresponding COS system according to its specific functions and application scenarios. For example, controllers in various industrial fields usually include security chips on the main control module and security chips on the functional modules. The security chip on the main control module is usually responsible for the core functions of the entire control system, such as data processing, decision making, task scheduling, etc., and needs to have advanced control logic, real-time data processing capabilities, and communication and coordination capabilities with other modules; the security chip on the functional module is responsible for specific tasks, such as data acquisition, signal processing, motion control, etc., focusing on performing specific functions, and may have specific hardware interface support, data processing algorithms or communication protocols. The security chip on the functional module works closely with the security chip on the main control module to achieve coordinated operation of the entire system.

[0080] In the related art, the functional testing of the security chip of the main control module and the security chip of the functional module on the controller in various industrial fields is to create a test project based on COS. The main control module COS requires a test project, and the functional module COS needs to recreate the test project to implement the functional testing of the two COS respectively. However, the main control module COS and the functional module COS of the controller may have a lot of overlap in basic functional instructions. For example, there are "verify user" functional instructions in both the main control module COS and the functional module COS. The logic of "verify user" may be the same, such as sending a command with basically the same format. This results in the need to repeatedly edit and maintain the same functional instructions in two different test projects when maintaining and executing tests, which increases the testing workload and reduces the testing efficiency.

[0081] The present application takes into account that if the same test script can be established for multiple different chips with at least partially identical functional instructions, the user can enter data in the test script's running panel to automatically identify and select the target chip for this test, and then use the target command parameter set to test the operating system of the selected chip. Other chips can also be tested by changing the input data and command parameters, thereby realizing integrated testing of multiple chips with a single test process. It is expected to solve the problem of low testing efficiency caused by the need to repeatedly edit and maintain the same functional instructions in different test projects in the prior art.

[0082] The following, in conjunction with the accompanying drawings, describes in detail the operating system testing method, device and storage medium for integrating multiple chips provided in the embodiments of the present application through specific embodiments and their application scenarios.

[0083] First, an operating system testing system 100 integrating multiple chips provided in an embodiment of the present application is introduced. Figure 1 As shown, the operating system testing system 100 integrating multiple chips may include a testing device 101 and multiple card readers 102 connected to the testing device. Different card readers 102 may be connected to different chips to achieve communication between the testing device 101 and the chips.

[0084] Among them, the test device 101 can be a comprehensive test platform or device, which is responsible for controlling the entire test process, including but not limited to: execution and management of test scripts, collection and analysis of test data, construction and maintenance of the test environment, interface and communication with the chip under test, and recording and reporting of test results. The test device 101 can include hardware components and software components. The hardware components may include processors, storage devices, interface cards, etc., while the software components may include operating systems, test frameworks, drivers, etc. The test device 101 can be a desktop computer, a tablet computer, a laptop computer, etc.

[0085] The card reader 102 can be a hardware device for establishing a physical or wireless connection with a specific chip for data transmission and communication. The card reader 102 can be a physical interface device, such as a USB card reader, a PCIe card or other types of interface adapters, allowing the test device 101 to communicate with the chip through a standard hardware interface. The card reader 102 can also be a wireless communication device. If the chip supports wireless communication, the card reader can include a wireless module for establishing a wireless connection. The card reader 102 can also be an adapter for a specific protocol, such as an adapter for communication protocols such as SPI, I2C, UART, etc., for communicating with chips using these protocols. In an operating system test system 100 that integrates multiple chips, different card readers 102 can be designed to adapt to different types of chips so that the test device 101 can effectively communicate and exchange data with various chips.

[0086] During the test process, the connection between the test device 101 and the card reader 102 can be established according to the type of operating system used by the test device 101. For example, if the test device 101 uses the WINDOWS system, the API (Application Programming Interface) function of the standard user PC / SC (Personal Computer / Smart Card) interface based on the WINDOWS platform can be called to use the test device 101 to establish communication with multiple card readers 102 connected to it and realize data interaction between chips. Among them, data interaction refers to the process of sending and receiving data between the chip and the test script in the test device 101, for example, it can include the test script sending commands to the chip and receiving the chip's response, and verifying whether the chip's response is as expected, so that the test process can be completed.

[0087] In the embodiment of the present application, multiple card readers 102 can be connected to chips with different functions, for example, they can be connected to the security chip of the main control module, and they can also be connected to the security chip on the functional module.

[0088] Multiple card readers 102 can simultaneously send and receive data. The specific implementation function can be in the encapsulation communication interface function layer of the test device 101. Taking the test device 101 using the WINDOWS system as an example, the function logic structure of connecting multiple card readers 102 is as follows: Figure 2 As shown. Figure 2The functions used in SCardEstablishContext, SCardListReaders, SCardConnect, SCardDisconnect, and SCardStatus. Among them, the SCardEstablishContext function is used to establish a connection with the card reader 102, and can enumerate to the Nth card reader 102 according to the insertion order of the card reader 102; the SCardListReaders function can identify the name of the card reader 102 enumerated by the SCardEstablishContext function, and return a list tmplist containing all the card reader names, so as to understand which card readers 102 can be connected; the SCardConnect function is used to establish a connection with a specific card reader 102. Once the connection is established, commands can be sent to the card reader 102 to communicate with the chip. For example, if the Nth card reader 102 needs to be connected , the handle value of the interface corresponding to the name of the card reader 102 can be recorded in the variable phCard. If the N+1th card reader 102 needs to be connected, the handle value of the interface corresponding to the name of the card reader 102 is additionally recorded in the variable phCard. If two or more card readers 102 need to be opened at the same time, the handle values ​​of the interfaces corresponding to the names of these card readers 102 can be added to the variable phCard through the SCardConnect function; SCardDisconnect is used to disconnect the card reader 102; SCardStatus function is used to query the status of the chip currently connected to the card reader 102, and can return various card information, such as the chip reset answer (Answer to Reset, ATR) and the chip status.

[0089] The number parameter N of the card reader 102 can be used to determine to which card reader 102 the instruction in the test process is sent, and the card reader 102 then sends the instruction to the corresponding chip to implement the test process.

[0090] In some embodiments, a test project can be created by combining Python language with PyCharm, an integrated development environment. For example, a test script can be written based on Python language and run in PyCharm to implement the test of the chip's operating system. By writing a test script based on Python language and running it in PyCharm, an integrated development environment, the test process is more efficient and easy to maintain and expand. Among them, the test script is a set of automated test instructions. The test script may include test logic and test parameters. The test logic may be test steps and processes.

[0091] In the embodiment of the present application, the test logic and test parameters in the test script can be separated. For example, for chips with different functions, as long as these chips have at least some of the same functional instructions, a set of common test logic can be defined in the test script according to the functional instructions of these same parts, and the specific command parameters are passed to the test script as test parameters. In this way, regardless of whether the functions of the chips are the same, as long as the test steps of these chips are the same, the same test script can be used, and only different command parameters need to be passed in.

[0092] An example is used to illustrate the test script of the embodiment of the present application. In this example, chip A and chip B are included. Both chip A and chip B use application protocol data units (APDU) for data exchange. The basic format of the APDU command may include the following command parameters:

[0093] CLA (Class): defines the category of commands, which is used to distinguish different service providers or applications.

[0094] ‌INS‌ (Instruction): Indicates the type of operation to be performed, such as querying balance, verifying user, executing payment, etc.

[0095] ‌P1‌ and ‌P2‌: Provide additional operation parameters to further define the specific behavior of the command in the INS field.

[0096] ‌Lc‌ (Length): Specifies the length of the data field.

[0097] For chip A and chip B, the logic of verifying the user may be the same, that is, sending a command containing the user name and then checking whether the response indicates that the user verification is successful. However, although the logic of verifying the user is the same for chip A and chip B, the command parameters and responses may have the following differences. For example, the command parameters of chip A may accept the username and password as the verification credentials, while the command parameters of chip B may only require the username; the response code for success or failure may be different. Chip A may return 0x9000 for success, while chip B may return 0x0000 for success.

[0098] Therefore, a common test script can be created based on the logic of user verification of chip A and chip B. In this script, how to construct and send commands for user verification is defined, and the specific command parameters are passed to the test script as test parameters. In this way, integrated testing of different chips can be achieved. When different chips have at least some of the same functional instructions, there is no need to edit and maintain them separately in multiple test projects, which improves test efficiency.

[0099] In some embodiments, in the test script, the chip currently being tested can be selected based on the user's input. Specifically, the user can input an integer and any key through the input function in the Python language, and then convert the user's input value into Boolean data and assign it to a variable. The variable is used to select which card reader to connect to, thereby implementing the test. For example, for chip A and chip B, their functional instructions are the same, such as Figure 3 As shown in the figure, after running the test script, the user can enter data in the running panel Console as prompted, and convert the input data into Boolean data and assign it to the variable ReaderType. If the variable ReaderType is true, then select chip A and connect the card reader corresponding to chip A; if the variable ReaderType is false, then select chip B and connect the card reader corresponding to chip B, and then test through command parameters. Figure 4 As shown, for chip A and chip B, if only some functional instructions are the same, for example, only the functional instructions corresponding to the forward function are the same, then the functional instructions corresponding to the forward function can be tested.

[0100] When reverse testing the COS of a chip, the common command has complex parameters and each parameter may support multiple interval values, which requires writing multiple loop traversal functions for the same type of parameters to achieve comprehensive parameter testing. Especially when the command contains more than four parameters, the amount of loop code required will increase significantly, making the COS parameter scanning test code written using traditional methods redundant and bloated.

[0101] To solve this problem, the embodiment of the present application optimizes the code of the parameter scanning test part in the test script, and creates parameter passing functions Parameter, ParameterPartion and Scan in the command prompt (CMD) function layer. You can choose which parameter passing function to call for testing according to the number of correct values ​​supported by the command parameter. Among them, the correct value means that the input parameter value is a specific parameter value, and the special parameter value can be correctly parsed and executed by the COS of the chip. For example, for command parameters CLA, P1, P2, Lc, etc., there are clear definitions in some communication protocols, which define the meaning of these command parameters and the corresponding correct values. For example, in the command parameter CLA, the specific parameter value 0x00 may represent a security-related command.

[0102] In some embodiments, when the number of specific parameter values ​​supported by each command parameter is one, the parameter transfer function is determined to be a Parameter function. For example, for command parameters CLA, P1, P2, and Lc, the number of specific parameter values ​​supported by these command parameters is one, that is, these command parameters have only one correct value, and the Parameter function can be used as a parameter transfer function. Inside the Parameter function, a for loop can be used to traverse the correct values ​​of these command parameters, and each for loop iterates once, avoiding unnecessary loops or conditional judgments, thereby improving the speed of test execution.

[0103] In some embodiments, when at least one of the command parameters supports one specific parameter value and at least one of the command parameters supports more than one specific parameter value, the parameter passing function is determined to be the ParameterPartion function. For example, for the command parameters CLA, P1, P2, and Lc, in addition to passing in the correct values ​​of the command parameters CLA, P1, P2, and Lc, an integer parameter needs to be passed in to indicate which command parameter supports more than one specific parameter value. For example, if the first command parameter CLA supports more than one specific parameter value, 1 is passed in. Inside the ParameterPartion function, for command parameters that support one specific parameter value, the correct values ​​of these command parameters can be traversed, and each for loop is iterated once; based on the passed in integer parameter, judgment is made, and for command parameters that support more than one specific parameter value, the Scan function is used to perform separate tests, so that different command parameters can be passed to the test script in an appropriate manner without large-scale modifications to the test script, thereby improving test efficiency.

[0104] In some embodiments, when the number of specific parameter values ​​supported by each command parameter is multiple, the parameter transfer function is determined to be a Scan function. In this case, for each command parameter, the Scan function can be called for testing. Among them, the Scan function can accept an array list as a parameter, which contains all possible correct values. The function traverses the test data internally to check whether each data is in the array list. If the data is not in the list, a reverse status word is returned, indicating that the test failed.

[0105] According to this embodiment, parameter passing functions Parameter, ParameterPartion and Scan are created in the CMD function layer. By passing in the correct values ​​of the command parameters, parameter scanning tests on the entire command can be implemented. Other command tests can reuse these parameter passing functions. They only need to modify the correct values ​​of each command parameter in the command, which reduces code redundancy and improves test efficiency.

[0106] In the related technology, the controller's main control module COS and functional module COS usually interact with each other in actual applications and cooperate with each other to achieve various controls. In the related technology, the COS test of the chip is usually conducted individually, and there is no simulated interaction between different chips. The abnormalities in the interaction data between different chips are exposed during on-site debugging, which increases project risks.

[0107] The operating system test system integrating multiple chips provided in the embodiment of the present application can solve the above technical problems to realize data interaction between different chips, thereby realizing interactive testing between different chips. Specifically, in the operating system test system integrating multiple chips provided in the embodiment of the present application, the architecture of the test project is as follows: Figure 5 As shown, it can include the process of opening the card reader and the process of interactive instructions. The process of opening the card reader can include receiving the card reader number N passed in the command test module layer, and then establishing a communication interface function layer with the card reader numbered N, so as to achieve data interaction with the chip corresponding to the card reader numbered N. The process of interactive instructions can include receiving the test command input in the command test module layer, that is, receiving the input data of the user in the running panel of the test script, determining which chip to test according to the input data, and obtaining the card reader number corresponding to the chip, opening the card reader in the process of opening the card reader, establishing communication with the chip, and then calling the command encapsulation function in the CMD function layer to generate a command, and the parameter transmission function uses the corresponding command parameters to pass into the command, and sends the command to the chip, so as to test the chip.

[0108] In the architecture of this test project, different chips can also realize data interaction. For example, for chip A and chip B, during the interactive test, chip B may need the output of chip A. The output of chip A can be input into the test device through the card reader. After receiving the output of chip A, the test device can select the output of chip A, select the data required for testing chip B, and then use these data as input to test chip B. In this way, the interactive test of chip A and chip B can be realized.

[0109] The following describes an operating system testing method for integrating multiple chips provided by an embodiment of the present application. The operating system testing method for integrating multiple chips can be applied to a terminal, and can be specifically executed by hardware or software in the terminal.

[0110] The terminal includes, but is not limited to, a portable communication device such as a mobile phone or a tablet computer having a touch-sensitive surface (e.g., a touch screen display and / or a touch pad). It should also be understood that in some embodiments, the terminal may not be a portable communication device, but a desktop computer having a touch-sensitive surface (e.g., a touch screen display and / or a touch pad).

[0111] In the following various embodiments, a terminal including a display and a touch-sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, a mouse and a joystick.

[0112] The operating system testing method for integrating multiple chips provided in the embodiment of the present application can be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the operating system testing method for integrating multiple chips. The electronic devices mentioned in the embodiment of the present application include but are not limited to mobile phones, tablet computers, computers, servers, etc. The operating system testing method for integrating multiple chips provided in the embodiment of the present application is described below using an electronic device as an example of the execution subject.

[0113] like Figure 6 As shown, the operating system testing method integrating multiple chips includes: step 610, step 620 and step 630.

[0114] Step 610: receiving input data from the user in the running panel of the test script; the test script is used to test a plurality of different chips having at least partially identical functional instructions.

[0115] In an embodiment of the present application, a test script is a collection of automated test instructions. The test script may include test logic and test parameters. The test logic may be test steps and processes.

[0116] In some embodiments, a test project can be created by combining Python language with PyCharm, an integrated development environment. For example, a test script can be written based on Python language and run in PyCharm to implement a test of the chip's operating system. By writing a test script based on Python language and running it in PyCharm, an integrated development environment, the test process is more efficient and easy to maintain and expand.

[0117] In the embodiment of the present application, the test logic and test parameters in the test script can be separated. For example, for chips with different functions, as long as these chips have at least some of the same functional instructions, a set of common test logic can be defined in the test script according to the functional instructions of these same parts, and the specific command parameters are passed to the test script as test parameters. In this way, regardless of whether the functions of the chips are the same, as long as the test steps of these chips are the same, the same test script can be used, and only different command parameters need to be passed in.

[0118] An example is used to illustrate the test script of the embodiment of the present application. In this example, chip A and chip B are included. Both chip A and chip B use application protocol data units (APDU) for data exchange. The basic format of the APDU command may include the following command parameters:

[0119] CLA (Class): defines the category of commands, which is used to distinguish different service providers or applications.

[0120] ‌INS‌ (Instruction): Indicates the type of operation to be performed, such as querying balance, verifying user, executing payment, etc.

[0121] ‌P1‌ and ‌P2‌: Provide additional operation parameters to further define the specific behavior of the command in the INS field.

[0122] ‌Lc‌ (Length): Specifies the length of the data field.

[0123] For chip A and chip B, the logic of authenticating a user may be the same, that is, sending a command containing a username and then checking whether the response indicates that the user authentication is successful. However, although the logic of authenticating a user is the same for chip A and chip B, the command parameters and responses may be different. For example, the command parameters of chip A may accept a username and password as authentication credentials, while the command parameters of chip B may only require a username; the response code for success or failure may be different. Chip A may return 0x9000 for success, while chip B may return 0x0000 for success.

[0124] Therefore, a common test script can be created based on the logic of user verification of chip A and chip B. In this script, how to construct and send commands for user verification is defined, and the specific command parameters are passed to the test script as test parameters. In this way, integrated testing of different chips can be achieved. When different chips have at least some of the same functional instructions, there is no need to edit and maintain them separately in multiple test projects, which improves test efficiency.

[0125] In the embodiment of the present application, after running the test script, the user can input data in the running panel Console.

[0126] Step 620, selecting a target chip to be tested according to the input data;

[0127] In the embodiment of the present application, the user's input data can be used to indicate the chip that the user has selected for testing this time. For example, an association relationship between the input data and the chip can be established in advance. For example, if the user input data is the number 1, it means that the chip that the user has selected for testing this time is chip A, and if the user input data is the number 0, it means that the chip that the user has selected for testing this time is chip B; or, the chip that the user has selected for testing this time can also be determined by detecting the keywords of the user's input data, which is not limited in the embodiment of the present application.

[0128] Step 630: Use the test script to test the operating system of the target chip using the target command parameter set.

[0129] In the embodiment of the present application, after determining the target chip to be tested, a communication connection with the target chip can be established to determine the command and command parameter set of the command to be tested this time. The command parameter set may include multiple command parameters, and for each command parameter, a value range or possible value of the command parameter may be determined. The command and command parameter set of the command to be tested this time may be pre-entered by the user.

[0130] Then start the test. During the test, for each command parameter, you can use the test script to perform traversal testing to ensure that all predefined parameter values ​​are covered. For parameters that support multiple parameter values, you can use a loop structure to iterate these parameter values ​​in the test script. After that, you can determine whether the response of each command parameter meets expectations based on the data fed back by the COS of the target chip. After the test is completed, generate a test report to summarize the test results and problems found. Among them, the test report can include key information such as test coverage, failed cases, and problem lists.

[0131] According to the operating system testing method for integrating multiple chips of the present application, input data from the user in the running panel of the test script is received; the test script is used to test multiple different chips with at least partially identical functional instructions; the target chip for the test is selected according to the input data; and the operating system of the target chip is tested using the test script using the target command parameter set. The embodiment of the present application establishes the same test script for multiple different chips with at least partially identical functional instructions. When the user inputs data in the running panel of the test script, the target chip for this test can be automatically identified and selected, and then the operating system of the selected chip is tested using the target command parameter set. Other chips can also be tested by changing the input data and command parameters, thus realizing integrated testing of multiple chips with a single test process, reducing the time of repeated work and environment switching, and improving test efficiency.

[0132] In some embodiments, selecting a target chip to be tested according to input data includes:

[0133] The chip corresponding to the input data is matched as the target chip according to a preset corresponding relationship; wherein the corresponding relationship represents the mapping relationship between the input data and the chip.

[0134] In this embodiment, the preset corresponding relationship defines the mapping relationship between different input data and different chips, for example, if the input data is "1", it corresponds to chip A, and if the input data is "0", it corresponds to chip B. After obtaining the user's input data, the corresponding chip can be searched in the corresponding relationship, for example, by querying a mapping table or executing a database query.

[0135] The target chip is determined based on the mapping relationship found. If the input data has a corresponding relationship with multiple chips, the multiple chips can be determined as target chips, and the test is performed for each matching target chip.

[0136] In this embodiment, by establishing a preset correspondence between input data and chips, user input data can be automatically identified according to these preset mapping relationships, thereby matching the corresponding chip as a test target, thereby improving the pertinence and efficiency of the test process.

[0137] In some embodiments, matching a chip corresponding to the input data as a target chip according to a preset corresponding relationship includes:

[0138] Convert the input data into Boolean data and assign it to the target variable;

[0139] The chip corresponding to the value of the target variable is matched according to the preset corresponding relationship as the target chip.

[0140] In this embodiment, the user can input integers and arbitrary keys through the input function in Python language, and then convert the user's input value into Boolean data and assign it to a variable. Through this variable, which card reader to connect to is selected to implement the test. For example, for chip A and chip B, their functional instructions are the same, such as Figure 3 As shown in the figure, after running the test script, the user can input data in the running panel Console, convert the input data into Boolean data, and assign it to the variable ReaderType. If the variable ReaderType is true, then select chip A and connect the card reader corresponding to chip A; if the variable ReaderType is false, then select chip B and connect the card reader corresponding to chip B, and then test through command parameters. Figure 4 As shown, for chip A and chip B, if only some functional instructions are the same, for example, only the functional instructions corresponding to the forward function are the same, then the functional instructions corresponding to the forward function can be tested.

[0141] In this embodiment, the user's input data is logically converted and expressed in the form of Boolean values, and then the chip for this test is matched based on the Boolean value according to the preset correspondence, thereby improving the logic and automation of the test selection and making the test process more concise and efficient.

[0142] In some embodiments, the operation panel displays prompt information with corresponding relationships.

[0143] In this embodiment, the operation panel displays prompt information of the corresponding relationship, so that the user interface provides additional auxiliary information to help the user understand the mapping relationship between the input data and the target chip.

[0144] The prompt information can be a text description, chart, flow chart or other visual aid elements, displayed on the run panel to help users understand the correspondence between different input data types and chips. When the user selects or enters different data, the prompt information on the run panel can be dynamically updated to reflect the corresponding chip currently selected.

[0145] In this embodiment, by displaying the mapping relationship between input data and chips on the running panel, the user can intuitively understand how the input data will affect the selection of test targets, thereby reducing the user's guesswork and errors during the test configuration process and improving the test efficiency.

[0146] In some embodiments, the method further comprises:

[0147] A connection is established with a plurality of card readers through a preset communication interface function; wherein different card readers are connected with different chips.

[0148] In this embodiment, the connection between the electronic device and the card reader can be established according to the type of operating system used by the electronic device. For example, if the electronic device uses the WINDOWS system, the API function of the standard user PC / SC interface based on the WINDOWS platform can be called to use the electronic device to establish communication with multiple card readers connected to it and realize data interaction between chips. Among them, data interaction refers to the process of sending and receiving data between the chip and the test script in the electronic device, for example, it can include the test script sending commands to the chip and receiving the response of the chip, and verifying whether the response of the chip meets expectations, so that the test process can be completed.

[0149] In this embodiment, multiple card readers can be connected to chips with different functions, for example, they can be connected to a security chip on a main control module, or they can be connected to a security chip on a functional module.

[0150] Multiple card readers can send and receive data at the same time. For example, the communication interface functions used by the electronic device using the WINDOWS system may include SCardEstablishContext, SCardListReaders, SCardConnect, SCardDisconnect, and SCardStatus. Through the card reader number N, it can be determined which card reader the instruction in the test process is sent to, and then the card reader sends the instruction to the corresponding chip to implement the test process.

[0151] In this embodiment, connections are established with multiple card readers through a preset communication interface function to achieve communication with different chips, so that test data can be accurately transmitted and received. Moreover, since communication can be performed with different chips, simulated interaction can also be performed between different chips, further improving the efficiency of the test.

[0152] According to an embodiment of the present application, using a test script to test the operating system of a target chip using target command parameters includes:

[0153] Get the card reader list;

[0154] Match the target card reader connected to the target chip from the card reader list;

[0155] Data interaction with the target chip is established through the target card reader to test the operating system of the target chip using a test script with a target command parameter set.

[0156] In this embodiment, the card reader list can be obtained through the SCardListReaders function, and then the target card reader connected to the target chip can be matched from the card reader list. For example, the connection relationship between the card reader and the chip can be established in advance, such as chip A is connected to card reader a, and chip B is connected to card reader b. After determining the target chip, the card reader connected to the target chip can be matched according to the card reader list. Of course, if there is no card reader connected to the target chip in the card reader list, it means that the card reader may not be connected correctly, or the user's input data is incorrect, then a prompt message of test abnormality can be returned, such as a prompt "the chip is not connected".

[0157] After establishing a communication connection with the target card reader, data interaction can be established with the target chip through the target card reader, so that the COS of the target chip can be tested.

[0158] In this embodiment, by obtaining a list of available card readers and then matching the target card reader connected to the target chip from the list, data interaction can be established between the target card reader and the target chip, and the chip operating system can be tested using the test script and the target command parameter set. Through the automated card reader matching process, the test efficiency is improved, the need for manual intervention is reduced, and the possibility of operational errors is reduced. In addition, this matching method can adapt to newly added card readers and chips without requiring a large number of modifications to the test script.

[0159] According to an embodiment of the present application, using a test script to test the operating system of a target chip using a target command parameter set includes:

[0160] Get the number of specific parameter values ​​supported by each target command parameter in the target command parameter set;

[0161] Match the target parameter passing function of the test script according to the number of specific parameter values ​​supported by each target command parameter;

[0162] Call the target parameter passing function to traverse and test each target command parameter in the target command parameter set.

[0163] In this embodiment, the specific parameter value is the correct value supported by each target command parameter, and the correct value can be correctly parsed and executed by the COS of the chip. For example, for command parameters CLA, P1, P2, Lc, etc., there are clear definitions in some communication protocols, which define the meaning of these command parameters and the corresponding correct values. For example, in the command parameter CLA, the specific parameter value 0x00 may represent a security-related command.

[0164] In this embodiment, in the test script, the parameter passing function can traverse the test of each target command parameter according to the specific parameter values ​​supported by each target command parameter, send commands and each target command parameter to the target chip, obtain the test output fed back by the target chip, and verify the test output according to the expected results.

[0165] In this embodiment, the number of specific parameter values ​​supported by each target command parameter is different, and different parameter transfer functions can be selected. For example, a correspondence between the number of specific parameter values ​​supported by each target command parameter and the parameter transfer function can be pre-established, and then the corresponding parameter transfer function can be matched according to the correspondence.

[0166] In this embodiment, by obtaining the number of specific parameter values ​​supported by each parameter in the target command parameter set and matching the corresponding target parameter passing functions according to these numbers, it is possible to automatically select a suitable parameter passing function according to the number of different parameter values, without having to write corresponding test programs for different parameters, thereby improving test efficiency.

[0167] According to one embodiment of the present application, matching the target parameter passing function of the test script according to the number of specific parameter values ​​supported by each target command parameter includes:

[0168] When the number of specific parameter values ​​supported by each target command parameter is one, the target parameter transfer function is determined to be a Parameter function.

[0169] In this embodiment, when the number of specific parameter values ​​supported by each command parameter is one, the parameter transfer function is determined to be the Parameter function. For example, for the command parameters CLA, P1, P2, and Lc, the number of specific parameter values ​​supported by these command parameters is one, that is, these command parameters have only one correct value, and the Parameter function can be used as the parameter transfer function. Inside the Parameter function, a for loop can be used to traverse the correct values ​​of these command parameters, and each for loop iterates once.

[0170] In this embodiment, when the number of specific parameter values ​​is only one, the target parameter passing function is determined as the Parameter function. The Parameter function can be used to directly pass these parameter values ​​to the test script, avoiding unnecessary loops or conditional judgments, thereby improving the speed of test execution.

[0171] According to one embodiment of the present application, matching the target parameter passing function of the test script according to the number of specific parameter values ​​supported by each target command parameter includes:

[0172] When the number of specific parameter values ​​supported by at least one target command parameter is one, and the number of specific parameter values ​​supported by at least one target command parameter is multiple, it is determined that the target parameter transfer function is a ParameterPartion function.

[0173] In this embodiment, when at least one of the command parameters supports one specific parameter value and at least one of the command parameters supports more than one specific parameter value, the parameter passing function is determined to be the ParameterPartion function. For example, for the command parameters CLA, P1, P2, and Lc, in addition to passing in the correct values ​​of the command parameters CLA, P1, P2, and Lc, an integer parameter needs to be passed in to indicate which command parameter supports more than one specific parameter value. For example, if the first command parameter CLA supports more than one specific parameter value, 1 is passed in. Within the ParameterPartion function, for command parameters that support one specific parameter value, the correct values ​​of these command parameters can be traversed, and each for loop is iterated once; judgment is made based on the passed in integer parameter, and command parameters that support more than one specific parameter value are tested separately using the Scan function.

[0174] In this embodiment, when single-value parameters and multi-value parameters coexist, the ParameterPartion function can distinguish and directly assign values ​​to single-value parameters, and use the Scan function for multi-value parameters, so that different command parameters can be passed to the test script in an appropriate manner without the need for large-scale modifications to the test script, thereby improving test efficiency.

[0175] According to one embodiment of the present application, matching the target parameter passing function of the test script according to the number of specific parameter values ​​supported by each target command parameter includes:

[0176] When the number of specific parameter values ​​supported by each target command parameter is multiple, it is determined that the target parameter transfer function is a Scan function.

[0177] In this embodiment, when the number of specific parameter values ​​supported by each command parameter is multiple, the parameter transfer function is determined to be a Scan function. In this case, for each command parameter, the Scan function can be called for testing. Among them, the Scan function can accept an array list as a parameter, and the list contains all possible correct values. The function traverses the test data internally to check whether each data is in the array list. If the data is not in the list, a reverse status word is returned, indicating that the test failed.

[0178] In this embodiment, when the target command parameters all support multiple specific parameter values, the Scan function is selected as the target parameter passing function, and the parameter values ​​of each target command parameter are automatically iterated, so that the test script performs a detailed scan and test on all possible values ​​of each parameter, thereby improving the test efficiency.

[0179] By creating parameter passing functions Parameter, ParameterPartion, and Scan and passing in the correct values ​​of command parameters, you can implement parameter scanning testing for the entire command. Other command tests can reuse these parameter passing functions and only need to modify the correct values ​​of each command parameter in the command, which reduces code redundancy and improves test efficiency.

[0180] The operating system testing method for integrating multiple chips provided in the embodiment of the present application can be executed by an operating system testing device for integrating multiple chips. In the embodiment of the present application, the operating system testing method for integrating multiple chips is executed by an operating system testing device for integrating multiple chips as an example to illustrate the operating system testing device for integrating multiple chips provided in the embodiment of the present application.

[0181] An embodiment of the present application also provides an operating system testing device integrating multiple chips.

[0182] like Figure 7 As shown, the operating system testing device integrating multiple chips includes:

[0183] The receiving module 710 is used to receive input data from a user in a running panel of a test script; the test script is used to test a plurality of different chips having at least partially the same functional instructions;

[0184] A selection module 720, for selecting a target chip for testing according to input data;

[0185] The testing module 730 is used to test the operating system of the target chip using a test script and a target command parameter set.

[0186] According to the operating system testing device for integrating multiple chips of the present application, input data from the user in the running panel of the test script is received; the test script is used to test multiple different chips with at least partially identical functional instructions; the target chip for the test is selected according to the input data; and the operating system of the target chip is tested using the test script using the target command parameter set. The embodiment of the present application establishes the same test script for multiple different chips with at least partially identical functional instructions. When the user inputs data in the running panel of the test script, the target chip for this test can be automatically identified and selected, and then the operating system of the selected chip is tested using the target command parameter set. Other chips can also be tested by changing the input data and command parameters, thus realizing integrated testing of multiple chips with a single test process, reducing the time of repeated work and environment switching, and improving test efficiency.

[0187] In some embodiments, the selection module 720 is further configured to:

[0188] The chip corresponding to the input data is matched as the target chip according to a preset corresponding relationship; wherein the corresponding relationship represents the mapping relationship between the input data and the chip.

[0189] In some embodiments, the selection module 720 is further configured to:

[0190] Convert the input data into Boolean data and assign it to the target variable;

[0191] The chip corresponding to the value of the target variable is matched according to the preset corresponding relationship as the target chip.

[0192] In some embodiments, the testing module 730 is further configured to:

[0193] Get the card reader list;

[0194] Match the target card reader connected to the target chip from the card reader list;

[0195] Data interaction with the target chip is established through the target card reader to test the operating system of the target chip using a test script with a target command parameter set.

[0196] In some embodiments, the testing module 730 is further configured to:

[0197] Get the number of specific parameter values ​​supported by each target command parameter in the target command parameter set;

[0198] Match the target parameter passing function of the test script according to the number of specific parameter values ​​supported by each target command parameter;

[0199] Call the target parameter passing function to traverse and test each target command parameter in the target command parameter set.

[0200] In some embodiments, the testing module 730 is further configured to:

[0201] When the number of specific parameter values ​​supported by each target command parameter is one, the target parameter transfer function is determined to be a Parameter function.

[0202] In some embodiments, the testing module 730 is further configured to:

[0203] When the number of specific parameter values ​​supported by at least one target command parameter is one, and the number of specific parameter values ​​supported by at least one target command parameter is multiple, it is determined that the target parameter transfer function is a ParameterPartion function.

[0204] In some embodiments, the testing module 730 is further configured to:

[0205] When the number of specific parameter values ​​supported by each target command parameter is multiple, it is determined that the target parameter transfer function is a Scan function.

[0206] The operating system testing device integrating multiple chips in the embodiment of the present application can be an electronic device, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application is not specifically limited.

[0207] The operating system testing device integrating multiple chips in the embodiment of the present application may be a device having an operating system. The operating system may be a Microsoft (Windows) operating system, an Android (Android) operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0208] In some embodiments, Figure 8 As shown, an embodiment of the present application also provides an electronic device 800, including a processor 801, a memory 802, and a computer program stored in the memory 802 and executable on the processor 801. When the program is executed by the processor 801, each process of the embodiment of the operating system testing method for integrating multiple chips is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0209] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

[0210] An embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned embodiment of the operating system testing method integrating multiple chips are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0211] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0212] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the above-mentioned operating system testing method for integrating multiple chips.

[0213] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0214] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned operating system testing method embodiment integrating multiple chips, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0215] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0216] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0217] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0218] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present application, all of which are within the protection of the present application.

[0219] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

Claims

1. A method for testing an operating system integrating multiple chips, characterized in that: include: Receive input data from the user in the test script run panel; The test script is used to test a plurality of different chips having at least partially identical functional instructions; Selecting a target chip for testing according to the input data; The test script adopts a target command parameter set to test the operating system of the target chip, including: obtaining the number of specific parameter values ​​supported by each target command parameter in the target command parameter set; the specific parameter values ​​are correct values ​​supported by each target command parameter, and the correct values ​​can be correctly parsed and executed by the chip's operating system; matching the target parameter passing function of the test script according to the number of specific parameter values ​​supported by each target command parameter; calling the target parameter passing function to traverse and test each target command parameter in the target command parameter set.

2. The method according to claim 1, characterized in that The step of selecting a target chip to be tested according to the input data comprises: The chip corresponding to the input data is matched as the target chip according to a preset corresponding relationship; wherein the corresponding relationship represents a mapping relationship between the input data and the chip.

3. The method according to claim 2, characterized in that The step of matching the chip corresponding to the input data as the target chip according to the preset corresponding relationship includes: Convert the input data into Boolean data and assign the value to the target variable; The chip corresponding to the value of the target variable is matched according to the preset corresponding relationship as the target chip.

4. The method according to claim 3, characterized in that The operation panel displays prompt information of the corresponding relationship.

5. The method according to claim 1, characterized in that The method further comprises: A connection is established with a plurality of card readers through a preset communication interface function; wherein different card readers are connected with different chips.

6. The method according to claim 1, characterized in that The using the test script to test the operating system of the target chip using target command parameters includes: Get the card reader list; Matching a target card reader connected to the target chip from the card reader list; Data interaction with the target chip is established through the target card reader, so as to use the test script to test the operating system of the target chip using the target command parameter set.

7. The method according to claim 1, characterized in that The method of matching the target parameter passing function of the test script according to the number of specific parameter values ​​supported by each target command parameter includes: When the number of specific parameter values ​​supported by each target command parameter is one, the target parameter transfer function is determined to be a Parameter function.

8. The method according to claim 1, characterized in that The method of matching the target parameter passing function of the test script according to the number of specific parameter values ​​supported by each target command parameter includes: When the number of specific parameter values ​​supported by at least one target command parameter is one, and the number of specific parameter values ​​supported by at least one target command parameter is multiple, it is determined that the target parameter transfer function is a ParameterPartion function.

9. The method according to claim 1, characterized in that: The method of matching the target parameter passing function of the test script according to the number of specific parameter values ​​supported by each target command parameter includes: When the number of specific parameter values ​​supported by each target command parameter is multiple, it is determined that the target parameter transfer function is a Scan function.

10. The method according to any one of claims 1 to 9, characterized in that: The test script is edited based on Python language; and the test script is run in PyCharm.

11. An operating system testing device integrating multiple chips, characterized in that: include: A receiving module is used to receive input data from the user in the running panel of the test script; The test script is used to test a plurality of different chips having at least partially identical functional instructions; A selection module, used for selecting a target chip for testing according to the input data; A test module is used to use the test script to test the operating system of the target chip using a target command parameter set, including: obtaining the number of specific parameter values ​​supported by each target command parameter in the target command parameter set; the specific parameter values ​​are correct values ​​supported by each target command parameter, and the correct values ​​can be correctly parsed and executed by the chip's operating system; matching the target parameter passing function of the test script according to the number of specific parameter values ​​supported by each target command parameter; calling the target parameter passing function to traverse and test each target command parameter in the target command parameter set.

12. An operating system testing system integrating multiple chips, characterized in that: It includes a testing device and a plurality of card readers connected to the testing device; The testing device exchanges data with different chips through different card readers; The testing device is used to execute the method according to any one of claims 1 to 10.

13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 10 is implemented.

14. A non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Universal testing method and device for chips

    CN110045266A

  • Chip testing system and method

    CN117250483A