Test method and device, equipment and storage medium

Through the test method of encoding the i2C protocol data as a sound wave signal on the embedded controller EC, the problem of the invasion and test efficiency of the I2C logic analyzer in the existing technology, and the non -invasive and efficient I2C protocol test.

CN119356956APending Publication Date: 2025-01-24HEFEI LCFC INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411304928.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

In the prior art, the use of I2C logic analyzers to capture I2C logs is invasive, making it difficult to test on a circuit board encapsulated in a case, and the test efficiency and reliability are low.

Method used

By implementing a test method on the embedded controller EC, using the I2C bus to communicate with the subordinate device, receiving the I2C protocol data and encoding it as a sound wave signal, send it to the application through the PWM pin To obtain the I2C protocol.

Benefits of technology

It realizes non-invasive I2C protocol testing, reduces the risk of physical damage, and improves the flexibility, reliability and efficiency of testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356956A_ABST
    Figure CN119356956A_ABST
Patent Text Reader

Abstract

The invention provides a testing method, device and equipment and a storage medium, the method is applied to an embedded controller EC, the method comprises the steps that a connection instruction is obtained, the EC is in communication connection with slave equipment through an I2C bus in response to the connection instruction, and the slave equipment is used for providing I2C protocol data; receiving the I2C protocol data sent by the slave device and storing the I2C protocol data in a register; sending a synchronization signal to an application program to enable the application program to receive data; and encoding the I2C protocol data into a sound wave signal, and sending the sound wave signal to an application program through a PWM pin, so that the application program collects and analyzes the sound wave signal to obtain an I2C protocol. According to the scheme, a non-invasive testing method is adopted, the physical damage risk in the testing process is reduced, and the testing flexibility, reliability and efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of testing technology, and in particular to a testing method, device, equipment and storage medium. Background Art

[0002] In the process of developing, debugging and maintaining electronic products, it is very important to have a deep understanding of the working mechanism and data transmission process of the Inter-Integrated Circuit (I2C) protocol. By capturing I2C logs and parsing the I2C protocol, engineers can clearly see the communication process between devices, thereby better understanding the protocol specifications and improving development efficiency.

[0003] The current method of capturing I2C logs is to use an I2C logic analyzer, which can monitor the data changes on the I2C bus in real time. Through supporting software such as DSVIEW, the I2C logic analyzer can display the captured I2C logs in the form of waveforms or data lists to achieve data visualization. This allows engineers to intuitively see the entire process of I2C communication, which is convenient for problem analysis and performance evaluation.

[0004] However, when using an I2C logic analyzer, you need to find the corresponding pins of the I2C BUS on the electronic device to be tested, and use a wire welding tool to weld the logic analyzer probe to these pins. This traditional wire welding connection method is somewhat invasive during the test process, which not only reduces the test efficiency, but also is often difficult to implement for circuit boards that have been encapsulated in a casing. Summary of the invention

[0005] The present disclosure provides a testing method, device, equipment and storage medium to at least solve the above technical problems existing in the prior art.

[0006] According to a first aspect of the present disclosure, a testing method is provided, the method being applied to an embedded controller EC, the method comprising:

[0007] Obtaining a connection instruction, in response to which the EC is connected to a slave device for communication via an I2C bus, wherein the slave device is used to provide I2C protocol data;

[0008] Receive the I2C protocol data sent by the slave device and store it in a register;

[0009] sending a synchronization signal to an application program so that the application program receives data;

[0010] The I2C protocol data is encoded into a sound wave signal and sent to an application program through a PWM pin, so that the application program collects and analyzes the sound wave signal to obtain the I2C protocol.

[0011] In one possible implementation, the obtaining connection instruction includes:

[0012] In response to receiving a test instruction, obtaining a test sound wave;

[0013] Generate a sound wave signal of a preset frequency based on the test sound wave;

[0014] If the sound wave signal of the preset frequency meets the target condition, it is determined that the connection instruction is obtained.

[0015] In one possible implementation manner, if the sound wave signal of the preset frequency meets the target condition, it includes:

[0016] Sending the sound wave signal of the preset frequency to an application program, so that the application program collects and analyzes the sound wave signal of the preset frequency to obtain an analysis result; wherein the collection frequency of the application program is the same as the preset frequency;

[0017] If the analysis result is the same as the test sound wave, the sound wave signal of the preset frequency meets the target condition.

[0018] In one possible implementation, encoding the I2C protocol data into a sound wave signal and sending it to the application via a PWM pin includes:

[0019] Convert the I2C protocol data into a binary sequence;

[0020] generating a sound wave signal according to the binary sequence;

[0021] The sound wave signal is sent to the application program through the PWM pin, so that the application program collects and analyzes the sound wave signal.

[0022] In one possible implementation, generating a sound wave signal according to the binary sequence includes:

[0023] If the binary value is 0, the PWM signal is at a low level, and the PWM signal controls the speaker to not make a sound to generate a corresponding sound wave signal;

[0024] If the binary value is 1, the PWM signal is at a high level, and the PWM signal controls the speaker to generate a corresponding sound wave signal.

[0025] In one possible implementation, the application collects and analyzes the sound wave signal to obtain the I2C protocol, including:

[0026] Arranging the sound wave signals collected by the application program into a sound wave sequence in chronological order;

[0027] Converting the sound wave sequence into a binary sequence;

[0028] The binary sequence is decoded into actual data according to the I2C protocol specification to obtain the I2C protocol.

[0029] In one possible implementation, converting the sound wave sequence into a binary sequence comprises:

[0030] If the volume represented by the sound wave signal collected by the application is greater than a threshold, the audio signal is parsed as a binary value 1;

[0031] If the volume represented by the sound wave signal collected by the application is less than a threshold, the audio signal is parsed as a binary value of 0.

[0032] According to a second aspect of the present disclosure, a testing device is provided, the device comprising:

[0033] An acquisition module, used for acquiring a connection instruction, in response to which the EC is connected to a slave device through an I2C bus for communication, and the slave device is used for providing I2C protocol data;

[0034] A receiving module, used for receiving the I2C protocol data sent by the slave device and storing it in a register;

[0035] A sending module, used for sending a synchronization signal to an application program so that the application program receives data;

[0036] The processing module is used to encode the I2C protocol data into a sound wave signal and send it to the application program through the PWM pin, so that the application program collects and analyzes the sound wave signal to obtain the I2C protocol.

[0037] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0038] at least one processor; and

[0039] a memory communicatively connected to the at least one processor; wherein,

[0040] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the present disclosure.

[0041] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method described in the present disclosure.

[0042] The present disclosure provides a test method, device, equipment and storage medium, which obtains a connection instruction, responds to the connection instruction EC to communicate with a slave device through an I2C bus, wherein the slave device is used to provide I2C protocol data; then receives the I2C protocol data sent by the slave device and stores it in a register; sends a synchronization signal to an application so that the application receives the data; encodes the I2C protocol data into a sound wave signal, and sends it to the application through a PWM pin, so that the application collects and analyzes the sound wave signal to obtain the I2C protocol. Compared with the prior art, this solution can obtain the I2C protocol without using a hardware I2C logic analyzer. The non-invasive testing method of this solution not only reduces the risk of physical damage during the test process, but also improves the flexibility, reliability and efficiency of the test.

[0043] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, in which:

[0045] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.

[0046] Figure 1 A schematic diagram of a testing method according to an embodiment of the present disclosure is shown;

[0047] Figure 2 A schematic diagram showing a flow chart of another testing method according to an embodiment of the present disclosure is shown;

[0048] Figure 3 A schematic diagram of the structure of a testing device according to an embodiment of the present disclosure is shown;

[0049] Figure 4 A schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0050] In order to make the purpose, features, and advantages of the present disclosure more obvious and easy to understand, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0051] Using an I2C logic analyzer to capture I2C logs and parse the I2C protocol is an indispensable and important tool in the development, debugging and maintenance of electronic products. It can help engineers deeply understand the working mechanism and data transmission process of the I2C protocol and improve development efficiency and quality. The traditional wire bonding method is somewhat invasive when testing serial communication interfaces such as the I2C bus. This invasiveness brings many disadvantages, mainly including the following aspects:

[0052] (1) Physical damage risk: During the wire bonding process, the circuit board needs to be welded using tools such as welding guns, which may cause physical damage to the circuit board or surrounding components. In particular, for delicate electronic components or fragile circuit board structures, high temperatures and mechanical stress during the welding process may cause damage.

[0053] (2) Reliability issues: The reliability of wire connection is often affected by the quality of welding. If the welding is not firm or there is a cold solder joint, problems such as signal interruption or distortion may occur during the test, thus affecting the accuracy of the test results.

[0054] (3) Limited test flexibility: The wire bonding method usually requires test points or test interfaces to be reserved on the circuit board, which makes the configuration and reconfiguration of the test equipment relatively difficult. When different circuit boards or different communication interfaces need to be tested, the wire bonding operation may need to be re-performed, which increases the complexity and time cost of the test.

[0055] (4) Test environment restrictions: For circuit boards that have been encapsulated in a housing, it is often difficult to connect them using solder wires. Even if it is possible, the housing needs to be disassembled or punched, which not only increases the complexity of the test but may also damage the overall structure of the product.

[0056] (5) Reduced test efficiency: Wire bonding requires a certain amount of time and technical costs. Especially when faced with a large number of test requirements, this invasive testing method will significantly reduce test efficiency. In addition, the stability and reliability issues of wire bonding may also lead to frequent troubleshooting and retesting during the test process.

[0057] (6) Increased testing costs: Wire welding requires professional welding tools and technical support, which increases the labor and equipment costs of testing. At the same time, since wire welding may damage the circuit board or surrounding components, it may also bring additional repair and replacement costs.

[0058] Based on this, the present disclosure provides a testing method to reduce the risk of physical damage during the testing process and improve the flexibility, reliability and efficiency of the testing.

[0059] According to the embodiments of the present disclosure, Figure 1 A flow chart of a testing method is shown, the method is applied to an embedded controller EC, the method comprising:

[0060] S1. Obtain a connection instruction. In response to the connection instruction, the EC is connected to a slave device through an I2C bus for communication. The slave device is used to provide I2C protocol data.

[0061] An embedded controller (EC) is a chip built into the motherboard of an electronic device, especially in mobile computer systems such as laptops. The EC chip is soldered on the motherboard and is responsible for a variety of system management and control functions to ensure the stable operation and efficient performance of the electronic device.

[0062] The connection instruction may come from an operating system, firmware or other management program. After receiving the connection instruction, the EC establishes a communication connection with the slave device (Slave device) through the I2C bus, where the I2C bus is a widely used serial communication protocol for connecting a Master device and its Slave devices. In this example, the EC acts as a Master device.

[0063] Slave devices are used to store or generate data that needs to be transmitted to the Master device. Slave devices can include various peripheral devices that communicate with the EC through the I2C bus, such as Type-C PD controller, temperature sensor, keyboard controller, touchpad controller, etc. These devices work together under the unified management of the EC to realize the various functions of the laptop.

[0064] For example, in one example, the slave device is a Type-C PD (Power Delivery) controller. When a Type-C device (such as a charger, docking station, etc.) is plugged into the Type-C interface of a laptop, the EC communicates with the Type-C PD controller through the I2C bus. The I2C protocol data provided by the PD controller to the EC through the I2C protocol is data related to the power management of the laptop, including power negotiation information, status information, configuration information, etc. The PD controller is responsible for processing the power management strategy on the Type-C interface, including negotiating power supply, current limiting, etc. The EC controls the power output of the Type-C interface by sending instructions to the PD controller to ensure that the device can charge or receive power safely and efficiently.

[0065] Another example of a slave device is a temperature sensor, which is a key component in a laptop computer for monitoring hardware temperature. These sensors are usually located near key components such as the CPU, GPU, and hard disk to obtain their temperature information in real time. The EC regularly reads the data of these temperature sensors through the I2C bus and adjusts the fan speed according to the temperature value. When the temperature exceeds the preset threshold, the EC will increase the fan speed to increase heat dissipation and prevent hardware overheating. On the contrary, when the temperature drops to a safe range, the EC will reduce the fan speed to save energy and reduce noise.

[0066] S2. Receive the I2C protocol data sent by the slave device and store it in a register.

[0067] EC receives data sent by slave devices through I2C bus, which follows the I2C protocol format. EC stores these data in internal registers for subsequent processing.

[0068] S3. Send a synchronization signal to the application so that the application receives data.

[0069] The EC sends a synchronization signal to the application, which may be a firmware program running on the EC, or an application communicating with the EC through a certain interface, or an application deployed on other electronic devices communicating with the EC through a wireless network, Bluetooth, etc., which is not limited by the present disclosure. In this example, the application is installed on a mobile phone for easy user operation. This synchronization signal notifies the application that the data is ready and can be received and processed.

[0070] S4, encoding the I2C protocol data into a sound wave signal, and sending it to an application through a PWM pin, so that the application collects and analyzes the sound wave signal to obtain the I2C protocol.

[0071] EC converts the I2C protocol data stored in the register into sound wave signals by controlling the PWM (pulse width modulation) pin of EC. The signal output by the PWM pin can be modulated to represent different data values. The application parses these sound wave signals to obtain the I2C protocol.

[0072] In the above scheme, by obtaining a connection instruction, in response to the connection instruction, EC communicates with the slave device through the I2C bus, wherein the slave device is used to provide I2C protocol data; then the I2C protocol data sent by the slave device is received and stored in a register; a synchronization signal is sent to the application so that the application receives the data; the I2C protocol data is encoded into a sound wave signal, and sent to the application through the PWM pin, so that the application collects and analyzes the sound wave signal to obtain the I2C protocol. Compared with the prior art, this scheme can obtain the I2C protocol without using a hardware I2C logic analyzer. The non-invasive testing method of this scheme not only reduces the risk of physical damage during the test process, but also improves the flexibility, reliability and efficiency of the test.

[0073] In one example, the obtaining connection instruction includes:

[0074] In response to receiving a test instruction, obtaining a test sound wave;

[0075] Generate a sound wave signal of a preset frequency based on the test sound wave;

[0076] If the sound wave signal of the preset frequency meets the target condition, it is determined that the connection instruction is obtained.

[0077] The test instruction can come from an external device, user operation, or an event within the system. For example, in this example, it is issued by the user triggering the hot key of the EC. Upon receiving the test instruction, the EC will start to generate a test sound wave, which can be pre-defined or sent by an external device. After obtaining the test sound wave, the EC will process it to generate a sound wave signal with a preset frequency. This preset frequency is agreed in advance between the EC and the slave device and is used to identify a specific connection request or command. After generating the sound wave signal of the preset frequency, the EC will check whether the signal meets specific target conditions. The target conditions may include parameters such as the frequency, amplitude, and duration of the signal. If the signal meets the target conditions, the EC will determine that the connection instruction has been successfully obtained and prepare for subsequent communication or operations.

[0078] In one example, if the sound wave signal of the preset frequency meets the target condition, it includes:

[0079] Sending the sound wave signal of the preset frequency to an application program, so that the application program collects and analyzes the sound wave signal of the preset frequency to obtain an analysis result; wherein the collection frequency of the application program is the same as the preset frequency;

[0080] If the analysis result is the same as the test sound wave, the sound wave signal of the preset frequency meets the target condition.

[0081] EC sends the generated sound wave signal of preset frequency to the application through an appropriate interface (such as PWM pin simulated audio output). The application needs to configure a collection frequency that is the same as the preset frequency to capture the sound wave signal. This setting ensures that the sampling of the signal will not be distorted, so that the original signal can be accurately restored.

[0082] The application analyzes the collected signal and then compares the analysis result with the original test sound wave. If the analysis result is the same as the test sound wave, the EC can determine that the sound wave signal of the preset frequency meets the target condition.

[0083] In one example, the EC sends a test sound wave, such as sending data with hexadecimal "54". This data is T in ASCII encoding, which represents the handshake signal of Test, and locks the sampling frequency, such as 1KHZ. The EC configures the PWM pin, which can generate an audio signal with a specific frequency of 1KHZ by adjusting the duty cycle. The signal encodes the test data "54". The EC sends the test sound wave through the Audio codec or Buzzer. The application samples and processes the recorded audio signal and identifies the "54" data in the test sound wave. If the identification is successful, the application displays that the test is successful, which means that the target conditions are met.

[0084] In one example, encoding the I2C protocol data into a sound wave signal and sending it to an application via a PWM pin includes:

[0085] Convert the I2C protocol data into a binary sequence;

[0086] generating a sound wave signal according to the binary sequence;

[0087] The sound wave signal is sent to the application program through the PWM pin, so that the application program collects and analyzes the sound wave signal.

[0088] Convert these I2C protocol data into a simple binary sequence, which will contain all the necessary bit information for subsequent generation of sound wave signals. Map each bit in the binary sequence to a certain characteristic of the audio signal, that is, generate a sound wave signal.

[0089] In one example, generating a sound wave signal according to the binary sequence includes:

[0090] If the binary value is 0, the PWM signal is at a low level, and the PWM signal controls the speaker to not make a sound to generate a corresponding sound wave signal;

[0091] If the binary value is 1, the PWM signal is at a high level, and the PWM signal controls the speaker to generate a corresponding sound wave signal.

[0092] For example, each bit in the binary sequence can be mapped to the loudness characteristics of the audio signal. For example, if the binary value is 0, there is no sound; if the binary value is 1, there is sound.

[0093] In one example, the application collects and analyzes the sound wave signal to obtain the I2C protocol, including:

[0094] Arranging the sound wave signals collected by the application program into a sound wave sequence in chronological order;

[0095] Converting the sound wave sequence into a binary sequence;

[0096] The binary sequence is decoded into actual data according to the I2C protocol specification to obtain the I2C protocol.

[0097] After the application collects the sound wave signal through the microphone, it needs to use signal processing technology to parse out the original binary sequence. Once the binary sequence is restored, the application can convert it back to the original I2C protocol data for further processing or display.

[0098] Assuming that the EC sends data at a frequency of 1KHz, each PWM cycle (i.e., the time of high level or low level) is 1ms. If the data sent is 53 in decimal, converted to binary data 01010011, the EC will control the PWM signal in the following way:

[0099] 0 (no sound): The PWM signal is low level and the speaker does not make any sound.

[0100] 1 (loud): PWM signal is high level and the speaker makes sound.

[0101] Therefore, for 01010011, the PWM signal will change in the following order (each state lasts 1ms): low level (not ringing), high level (ringing), low level (not ringing), high level (ringing), low level (not ringing), low level (not ringing), high level (ringing), high level (ringing).

[0102] If the application samples this PWM signal at the same 1KHz frequency (i.e. checks whether the speaker is making sound every 1ms), it will be able to accurately record the above sequence of "sound" and "no sound", and obtain the sound wave sequence of no sound, sound, no sound, sound, no sound, no sound, sound, sound; then the application can convert this sequence back to binary data 01010011. Finally, according to the I2C protocol specification, the binary sequence is decoded into actual data to obtain the I2C protocol.

[0103] The following is a detailed description of this solution in conjunction with specific scenarios, where a laptop is taken as an example of the machine to be tested.

[0104] like Figure 2 A testing method is shown, comprising:

[0105] S101. The user presses a hot key on the EC to request sending a test sound wave.

[0106] S102, EC responds to the hotkey input and reads the preset test data; EC configures the PWM pin to generate an audio signal of a specific frequency (such as 1KHZ), which encodes the test data; EC sends out the test sound wave through the Audio codec or Buzzer.

[0107] S103, the audio recording module of the mobile phone APP (application) starts recording the audio signal, and the APP samples and processes the recorded audio signal to identify the test sound wave; if the identification is successful, the APP displays a test success message and prompts the user to insert the I2C device.

[0108] S104: The user inserts the I2C device into the corresponding interface of the machine to be tested.

[0109] S105 , the EC communicates with the I2C slave device through the I2C bus and requests to read data; the I2C slave device responds to the request and sends the required data to the register of the EC.

[0110] S016, EC sends synchronization signal and I2C protocol data. First, EC configures registers such as CPRS, DCR, PWMCTRL, etc. to prepare to send audio signals. EC first sends a synchronization signal (such as "53" represents Start) to notify the mobile phone APP to start receiving data. EC encodes the I2C protocol data into an audio signal and sends it through the PWM pin.

[0111] For example, taking the output of 1KHZ (cycle 1ms) as an example, the PWM output frequency can be adjusted to 8KHZ (cycle 0.125ms) through CPRS, and then the duty cycle can be adjusted to 100% or 0% through the DCR register, and then the duty cycle register can be changed every 1ms through PWMCTL (to achieve 0 / 1 conversion, and this register will not be changed when not converting), so that the actual output is a PWM signal of 1KHZ.

[0112] S107, the mobile phone APP receives and parses the I2C protocol data, the APP continues to record the audio signal, and detects the synchronization signal "53"; after detecting the synchronization signal, the APP starts to parse the I2C protocol data in the subsequent audio signal. The APP uses digital signal processing technology to convert the audio signal into a 0 / 1 sequence and decodes it into actual data according to the I2C protocol specification. The APP displays the decoded I2C data on the interface for the user to view or further process.

[0113] According to an embodiment of the present disclosure, the present disclosure also provides a testing device, such as Figure 3 As shown, the device comprises:

[0114] An acquisition module 10, used for acquiring a connection instruction, in response to which the EC is connected to a slave device through an I2C bus for communication, and the slave device is used for providing I2C protocol data;

[0115] A receiving module 20, configured to receive the I2C protocol data sent by the slave device and store the data in a register;

[0116] The sending module 30 is used to send a synchronization signal to the application so that the application receives data;

[0117] The processing module 40 is used to encode the I2C protocol data into a sound wave signal and send it to the application through the PWM pin, so that the application can collect and analyze the sound wave signal to obtain the I2C protocol.

[0118] In one example, the obtaining module 10 is further configured to:

[0119] In response to receiving a test instruction, obtaining a test sound wave;

[0120] Generate a sound wave signal of a preset frequency based on the test sound wave;

[0121] If the sound wave signal of the preset frequency meets the target condition, it is determined that the connection instruction is obtained.

[0122] In one example, the obtaining module 10 is further configured to:

[0123] Sending the sound wave signal of the preset frequency to an application program, so that the application program collects and analyzes the sound wave signal of the preset frequency to obtain an analysis result; wherein the collection frequency of the application program is the same as the preset frequency;

[0124] If the analysis result is the same as the test sound wave, the sound wave signal of the preset frequency meets the target condition.

[0125] In one example, the processing module 40 is further configured to:

[0126] Convert the I2C protocol data into a binary sequence;

[0127] generating a sound wave signal according to the binary sequence;

[0128] The sound wave signal is sent to the application program through the PWM pin, so that the application program collects and analyzes the sound wave signal.

[0129] In one example, the processing module 40 is further configured to:

[0130] If the binary value is 0, the PWM signal is at a low level, and the PWM signal controls the speaker to not make a sound to generate a corresponding sound wave signal;

[0131] If the binary value is 1, the PWM signal is at a high level, and the PWM signal controls the speaker to generate a corresponding sound wave signal.

[0132] In one example, the processing module 40 is further configured to:

[0133] Arranging the sound wave signals collected by the application program into a sound wave sequence in chronological order;

[0134] Converting the sound wave sequence into a binary sequence;

[0135] The binary sequence is decoded into actual data according to the I2C protocol specification to obtain the I2C protocol.

[0136] In one possible implementation, converting the sound wave sequence into a binary sequence comprises:

[0137] If the volume represented by the sound wave signal collected by the application is greater than a threshold, the audio signal is parsed as a binary value 1;

[0138] If the volume represented by the sound wave signal collected by the application is less than a threshold, the audio signal is parsed as a binary value of 0.

[0139] According to an embodiment of the present disclosure, the present disclosure further provides an electronic device, including:

[0140] at least one processor; and

[0141] a memory communicatively connected to the at least one processor; wherein,

[0142] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the present disclosure.

[0143] According to an embodiment of the present disclosure, the present disclosure further provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the method described in the present disclosure.

[0144] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.

[0145] Figure 4A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0146] like Figure 4 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0147] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0148] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as test methods. For example, in some embodiments, the test method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the test method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the test method in any other appropriate manner (e.g., by means of firmware).

[0149] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0150] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0151] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0152] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0153] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0154] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0155] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0156] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0157] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A testing method, characterized in that: The method is applied to an embedded controller EC, and the method comprises: Obtaining a connection instruction, in response to which the EC is connected to a slave device for communication via an I2C bus, wherein the slave device is used to provide I2C protocol data; Receive the I2C protocol data sent by the slave device and store it in a register; sending a synchronization signal to an application program so that the application program receives data; The I2C protocol data is encoded into a sound wave signal and sent to an application program through a PWM pin, so that the application program collects and analyzes the sound wave signal to obtain the I2C protocol.

2. The method according to claim 1, characterized in that The obtaining connection instruction comprises: In response to receiving a test instruction, obtaining a test sound wave; Generate a sound wave signal of a preset frequency based on the test sound wave; If the sound wave signal of the preset frequency meets the target condition, it is determined that the connection instruction is obtained.

3. The method according to claim 2, characterized in that If the sound wave signal of the preset frequency meets the target condition, it includes: Sending the sound wave signal of the preset frequency to an application program, so that the application program collects and analyzes the sound wave signal of the preset frequency to obtain an analysis result; wherein the collection frequency of the application program is the same as the preset frequency; If the analysis result is the same as the test sound wave, the sound wave signal of the preset frequency meets the target condition.

4. The method according to claim 1, characterized in that: Encode the I2C protocol data into a sound wave signal and send it to the application through the PWM pin, including: Convert the I2C protocol data into a binary sequence; generating a sound wave signal according to the binary sequence; The sound wave signal is sent to the application program through the PWM pin, so that the application program collects and analyzes the sound wave signal.

5. The method according to claim 4, characterized in that Generating a sound wave signal according to the binary sequence comprises: If the binary value is 0, the PWM signal is at a low level, and the PWM signal controls the speaker to not make a sound to generate a corresponding sound wave signal; If the binary value is 1, the PWM signal is at a high level, and the PWM signal controls the speaker to generate a corresponding sound wave signal.

6. The method according to claim 1, characterized in that The application collects and analyzes the sound wave signal to obtain the I2C protocol, including: Arranging the sound wave signals collected by the application program into a sound wave sequence in chronological order; Converting the sound wave sequence into a binary sequence; The binary sequence is decoded into actual data according to the I2C protocol specification to obtain the I2C protocol.

7. The method according to claim 6, characterized in that Converting the sound wave sequence into a binary sequence includes: If the volume represented by the sound wave signal collected by the application is greater than a threshold, the audio signal is parsed as a binary value 1; If the volume represented by the sound wave signal collected by the application is less than a threshold, the audio signal is parsed as a binary value of 0.

8. A testing device, characterized in that: The device comprises: An acquisition module, used for acquiring a connection instruction, in response to which the EC is connected to a slave device through an I2C bus for communication, and the slave device is used for providing I2C protocol data; A receiving module, used for receiving the I2C protocol data sent by the slave device and storing it in a register; A sending module, used for sending a synchronization signal to an application program so that the application program receives data; The processing module is used to encode the I2C protocol data into a sound wave signal and send it to the application program through the PWM pin, so that the application program collects and analyzes the sound wave signal to obtain the I2C protocol.

9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute: Obtaining a connection instruction, in response to which the EC is connected to a slave device for communication via an I2C bus, wherein the slave device is used to provide I2C protocol data; Receive the I2C protocol data sent by the slave device and store it in a register; sending a synchronization signal to an application program so that the application program receives data; The I2C protocol data is encoded into a sound wave signal and sent to an application program through a PWM pin, so that the application program collects and analyzes the sound wave signal to obtain the I2C protocol.

10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute: Obtaining a connection instruction, in response to which the EC is connected to a slave device for communication via an I2C bus, wherein the slave device is used to provide I2C protocol data; Receive the I2C protocol data sent by the slave device and store it in a register; sending a synchronization signal to an application program so that the application program receives data; The I2C protocol data is encoded into a sound wave signal and sent to an application program through a PWM pin, so that the application program collects and analyzes the sound wave signal to obtain the I2C protocol.