CN115358331A - Device type identification method and device, computer readable storage medium and terminal - Google Patents

Device type identification method and device, computer readable storage medium and terminal Download PDF

Info

Publication number
CN115358331A
CN115358331A CN202211026529.1A CN202211026529A CN115358331A CN 115358331 A CN115358331 A CN 115358331A CN 202211026529 A CN202211026529 A CN 202211026529A CN 115358331 A CN115358331 A CN 115358331A
Authority
CN
China
Prior art keywords
port group
state information
port
type
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211026529.1A
Other languages
Chinese (zh)
Inventor
林文华
黄天宝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Ziguang Zhanrui Technology Co ltd
Original Assignee
Xiamen Ziguang Zhanrui Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Ziguang Zhanrui Technology Co ltd filed Critical Xiamen Ziguang Zhanrui Technology Co ltd
Priority to CN202211026529.1A priority Critical patent/CN115358331A/en
Publication of CN115358331A publication Critical patent/CN115358331A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/71Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information
    • G06F21/73Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information by creating or determining hardware identification, e.g. serial numbers

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

A device type identification method and device, a computer readable storage medium and a terminal are provided, and the method comprises the following steps: sending an I/O port state reading instruction to an expansion chip, wherein the I/O port state reading instruction is used for reading state information of one or more I/O port groups of the expansion chip; receiving the read state information of each I/O port group from the expansion chip; analyzing the received state information of the I/O port group to determine the type of the equipment to be identified by the state information of the target I/O port group of the expansion chip; the state information of each I/O port group and the device type have preset one-to-one correspondence. The scheme can save the occupation of the I/O resources of the main chip and improve the utilization rate of the I/O resources of the main chip.

Description

Device type identification method and device, computer readable storage medium and terminal
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a device type identification method and apparatus, a computer-readable storage medium, and a terminal.
Background
In the field of digital electronics, it is often necessary to identify the type of external device to which the host chip is connected to provide the correct software driver. In the technology of single software and multiple hardwares, the hardware peripherals can be changed according to the requirements of customers under the condition that the software version is not changed, so that different hardware peripherals share the same software package. Specifically, when the external device needs to be added or changed according to the customer requirements, the software version in the main chip does not need to be updated, but the change of the external device type can be automatically identified, the target driver corresponding to the newly accessed or changed device type is determined, and then the target driver is accurately loaded and executed after the driver loading related software is subjected to adaptive adjustment. Therefore, the workload and the cost of software maintenance can be greatly reduced.
In the prior art, the single soft multi-hard scheme is mainly implemented by using the I/O port resource of the main chip. For example, by reading a preset pin voltage on the main chip, and configuring (for example, configuring as needed to be loaded) a target device state in the device tree according to a difference of the preset pin voltage, the system automatically loads a target driver corresponding to the target device, thereby implementing a single-software multi-hardware function. However, the above scheme may occupy the inherently limited IO resources on the main chip. Since the main chip is mainly customized according to the purpose or the special function of the chip, each I/O port on the main chip often has its own special purpose, and recognizing the type of the external device to load the driving software is a general function. In addition, the cost of directly adding I/O pins on the main chip is high and the practicability is low due to the limitation of relevant factors such as the size of the main chip, software and hardware.
Therefore, under the condition that a large number of external device types need to be identified by software self-adaption, a device type identification method is urgently needed to be provided, so that the I/O resource occupation of a main chip can be saved, and the I/O utilization rate of the main chip is improved.
Disclosure of Invention
The technical problem solved by the embodiment of the invention is that the I/O port resources on the main chip are directly occupied to realize equipment type identification in the prior art, so that the I/O resources of the main chip are insufficient, and the utilization rate of the I/O resources of the main chip is reduced.
In order to solve the foregoing technical problem, an embodiment of the present invention provides an apparatus type identification method, including the following steps: sending an I/O port state reading instruction to an expansion chip, wherein the I/O port state reading instruction is used for reading state information of one or more I/O port groups of the expansion chip; receiving the read state information of each I/O port group from the expansion chip; analyzing the received state information of the I/O port group to determine the type of the equipment to be identified by the state information of the target I/O port group of the expansion chip; the state information of each I/O port group and the equipment type have preset one-to-one correspondence.
Optionally, before performing parsing processing on the received state information of the I/O port group, the method further includes: determining the target I/O port group.
Optionally, the determining the target I/O port group includes: determining the type of the equipment to be identified in response to receiving an equipment driver loading instruction, wherein the equipment driver loading instruction corresponds to the type of the equipment to be identified one by one; and determining an I/O port group corresponding to the device type to be identified as the target I/O port group.
Optionally, the I/O port state read instruction is sent in response to receiving a device driver load instruction.
Optionally, the I/O port state read instruction is used to read state information of all I/O ports of the expansion chip.
Optionally, the state information of the target I/O port group is combined state information of part or all of the I/O ports in the target I/O port group.
Optionally, the analyzing the received state information of the I/O port group to determine the type of the device to be identified by the state information of the target I/O port group of the expansion chip includes: analyzing the received state information of the I/O port group to screen out the state information of the target I/O port group of the expansion chip; and determining the type of the equipment to be identified by the state information of the target I/O port group of the expansion chip.
Optionally, the determining the type of the device to be identified, which is identified by the state information of the target I/O port group of the expansion chip, includes: determining equipment type identification information according to the state information of the target I/O port group; and determining the type of the equipment to be recognized based on the equipment type identification information.
Optionally, determining the device type identifier information according to the state information of the target I/O port group includes: converting the combined state information of each I/O port in the target I/O port group into an equipment identification number by adopting a binary conversion mode; and determining the equipment type identification information according to the equipment identification number.
Optionally, the combined status information of the I/O ports in the target I/O port group is represented by binary numbers, and/or the device identification number is represented by decimal numbers.
Optionally, the I/O port status information in each I/O port group includes first status information and second status information; the first state information is one of a high-level state signal and a low-level state signal, and the second state information is the other of the high-level state signal and the low-level state signal.
Optionally, the method further includes: determining a target driver corresponding to the type of the equipment to be identified, and loading the target driver; and the type of the equipment to be identified and the target driver have one-to-one correspondence.
Optionally, the device type to be identified is selected from one or more of the following: a display board type, a camera type, an audio device type, a sensor type, and a radio frequency card type.
An embodiment of the present invention further provides an apparatus for identifying a device type, including: the system comprises a port group state information reading module, a port group state information reading module and a port group state information reading module, wherein the port group state information reading module is used for sending an I/O port state reading instruction to an expansion chip, and the I/O port state reading instruction is used for reading the state information of one or more I/O port groups of the expansion chip; the port group state information receiving module is used for receiving the read state information of each I/O port group from the expansion chip; the device type identification module to be identified is used for analyzing the received state information of the I/O port group so as to determine the type of the device to be identified by the state information of the target I/O port group of the expansion chip; the state information of each I/O port group and the device type have preset one-to-one correspondence.
Embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the above-mentioned device type identification method.
The embodiment of the present invention further provides a terminal, which includes a memory and a processor, where the memory stores a computer program capable of running on the processor, and the processor executes the steps of the device type identification method when running the computer program.
Compared with the prior art, the technical scheme of the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, an I/O port state reading instruction is sent to an expansion chip, and the I/O port state reading instruction is used for reading the state information of one or more I/O port groups of the expansion chip; receiving the read state information of each I/O port group from the expansion chip; analyzing the received state information of the I/O port group to determine the type of the equipment to be identified by the state information of the target I/O port group of the expansion chip; the state information of each I/O port group and the equipment type have preset one-to-one correspondence.
Compared with the prior art that the external equipment is mainly identified by using the I/O port resource of the main chip, the limited I/O resource on the main chip can be occupied, the scheme disclosed by the invention is specially used for realizing the equipment type identification function by adopting the expansion chip and the I/O port thereof, and particularly, the I/O port of the expansion chip is divided into port groups, and different equipment types are identified by using the state information of each I/O port group on the expansion chip, so that the equipment type to be identified connected with the main chip can be determined after the state information of the target I/O port group of the expansion chip is obtained. Therefore, the occupation of the I/O resources of the main chip can be saved, and the utilization rate of the I/O resources of the main chip is improved.
Further, the determining the target I/O port group comprises: determining the type of the equipment to be identified in response to receiving an equipment driver loading instruction, wherein the equipment driver loading instruction corresponds to the type of the equipment to be identified one by one; and determining an I/O port group corresponding to the device type to be identified as the target I/O port group. In the embodiment of the present invention, a mapping relationship between a device driver load instruction and a device type and a mapping relationship between a device type and an I/O port group of an expansion chip may be preset. Therefore, the main chip can quickly and accurately determine the corresponding target I/O port group after receiving the device driver loading instruction. Further, in the subsequent steps, the type of the connected equipment to be identified can be accurately determined according to the state information of the target I/O port group, and a corresponding target driver is loaded.
Further, the determining the type of the device to be recognized, which is identified by the state information of the target I/O port group of the expansion chip, includes: determining equipment type identification information according to the state information of the target I/O port group; and determining the type of the equipment to be identified based on the equipment type identification information. In the embodiment of the invention, different equipment types are identified by adopting the combined state information of part or all of the I/O port state information in the I/O port group, which is favorable for quickly and accurately determining the equipment type to be identified connected with the main chip.
Further, the method further comprises: determining a target driver corresponding to the type of the equipment to be identified, and loading the target driver; and the type of the equipment to be identified and the target driver have one-to-one correspondence. In the embodiment of the present invention, mapping relationships between different device types and each target driver may be preset, so that after determining the device type to be identified by the state information of the target I/O port group of the expansion chip, the target driver to be actually loaded may be determined and loaded. Therefore, the function of 'single soft and multiple hard' can be realized under the condition of saving the I/O resource of the main chip.
Drawings
Fig. 1 is a flowchart of a device type identification method according to an embodiment of the present invention;
FIG. 2 is a flowchart of one embodiment of step S13 of FIG. 1;
FIG. 3 is a partial flow diagram of another method for device type identification in an embodiment of the invention;
fig. 4 is a schematic structural diagram of device type identification based on an extended chip in an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an apparatus type identification device in an embodiment of the present invention.
Detailed Description
As described above, in the "single-software multi-hardware" technology, when the external device needs to be added or changed according to the customer requirement, the software version in the main chip does not need to be updated, but the corresponding target driver can be determined and loaded by automatically recognizing the change of the type of the external device.
In the prior art, the single soft multi-hard scheme is mainly implemented by using the I/O port resource of the main chip. For example, by reading a preset pin voltage on the main chip, and configuring (for example, configuring as needed to be loaded) a target device state in the device tree according to a difference of the preset pin voltage, the system automatically loads a target driver corresponding to the target device, thereby implementing a single-software multi-hardware function. However, the above scheme may occupy the limited IO resources on the main chip, which may result in the occupied I/O port on the main chip being unavailable for other tasks. In addition, the cost of directly adding I/O pins on the main chip is high and the practicability is low due to the limitation of relevant factors such as the size of the main chip, software and hardware.
The embodiment of the invention provides a device type identification method, which comprises the steps of sending an I/O port state reading instruction to an expansion chip, wherein the I/O port state reading instruction is used for reading state information of one or more I/O port groups of the expansion chip; receiving the read state information of each I/O port group from the expansion chip; analyzing the received state information of the I/O port group to determine the type of the equipment to be identified by the state information of the target I/O port group of the expansion chip; the state information of each I/O port group and the device type have preset one-to-one correspondence.
In the above, the expansion chip and the I/O port thereof are specially used for realizing the function of recognizing the type of the external device, specifically, the I/O port of the expansion chip is divided into port groups, and different device types are identified by using the state information of each I/O port group on the expansion chip, so that the type of the device to be recognized connected to the main chip can be determined after the state information of the target I/O port group of the expansion chip is acquired. Therefore, the occupation of the I/O resources of the main chip can be saved, and the utilization rate of the I/O resources of the main chip is improved.
In order to make the aforementioned objects, features and advantages of the present invention more comprehensible, embodiments accompanying figures are described in detail below.
Referring to fig. 1, fig. 1 is a flowchart of a device type identification method according to an embodiment of the present invention. The method may include steps S11 to S13:
step S11: sending an I/O port state reading instruction to an expansion chip, wherein the I/O port state reading instruction is used for reading state information of one or more I/O port groups of the expansion chip;
step S12: receiving the read state information of each I/O port group from the expansion chip;
step S13: and analyzing the received state information of the I/O port group to determine the type of the equipment to be identified by the state information of the target I/O port group of the expansion chip.
The state information of each I/O port group and the device type have preset one-to-one correspondence.
It is understood that in a specific implementation, the method may be implemented by a software program running in a processor integrated within a chip or a chip module; alternatively, the method can be implemented in hardware or a combination of hardware and software.
In a specific implementation of step S11, the I/O port state reading instruction may be specifically sent to the expansion chip by the main chip running the foregoing method. The extension chip is relative to the main chip and can be regarded as an external device of the main chip. The expansion chip and the main chip may communicate with each other through an Inter-Integrated Circuit (IIC) protocol (or referred to as an I2C protocol), a Serial Peripheral Interface (SPI) protocol, and other communication protocols, but are not limited thereto.
The expansion chip is provided with a plurality of I/O (Input/Output) ports, the I/O ports can be regarded as PINs (PIN PINs) on the expansion chip, each I/O port is divided into one or a plurality of I/O port groups in advance, and the state information and the type of each I/O port group have a preset one-to-one correspondence relationship. Specifically, each device type may be identified by some or all of the I/O port state information in the corresponding I/O port group
The status information (or combined status information) of each I/O port group may be specifically debugged or configured by hardware circuitry. In a specific implementation, for the same I/O port group, by performing different debugging/configuration on a hardware circuit, the state information of the I/O port group may be changed, thereby changing the identified device type.
Wherein the number of ports within different port groups may be the same or different.
In some non-limiting embodiments, the status information for each I/O port within the respective I/O port group may include first status information that is one of a high level status signal and a low level status signal, and second status information that is the other of a high level status signal and a low level status signal.
Wherein the state information of the target I/O port group is the combined state information of part or all of the I/O ports in the target I/O port group.
In some non-limiting embodiments, the device type to be identified may be selected from one or more of a display board type, a camera type, an audio device type, a sensor type, and a radio frequency card type. In practical applications, the device type to be identified may also be another device type than the device types listed above, which is not limited in this embodiment of the present invention.
Further, as a non-limiting example, the I/O port state read instruction may be issued by the master chip in response to receiving a device driver load instruction.
In a specific implementation, the device driver loading instruction may be triggered by software and/or hardware when an external device belonging to the device type to be identified is connected to the main chip, or may be triggered by a user clicking a driver loading function button/key, or may be triggered by other conditions, which is not limited in this embodiment of the present invention.
In a specific implementation, the I/O port state reading instruction may also be sent by the master chip in response to receiving an instruction of another type in another specific application scenario where device type identification is required, which is not limited in this embodiment of the present invention.
In some embodiments, the I/O port status reading instruction is configured to read status information of all I/O ports of the expansion chip. And then the expansion chip returns the read state information of all the I/O ports to the main chip, and the application program of the main chip analyzes the state information so as to quickly determine the state information of the required target I/O port group. In this scheme, the master chip determines the target I/O port group before parsing the received status information.
In other embodiments, the I/O port status read instruction is dedicated to reading status information of a target I/O port group of the expansion chip. And then the expansion chip returns the read state information of the target I/O port group to the main chip. In such a scheme, the master chip determines the target set of I/O ports before sending the I/O port status read instruction.
In a specific implementation of step S12, the master chip may receive the read status information of each I/O port group from the expansion chip based on the IIC protocol or the SPI protocol.
In a specific implementation of step S13, the target I/O port group may be determined before parsing the received status information of the I/O port group. It is understood that the status information of the one or more I/O port groups read by the expansion chip includes the status information of the target I/O port group.
Referring to fig. 2, fig. 2 is a flowchart of an embodiment of step S13 in fig. 1. The step S13 may include steps S21 to S22, and each step will be described below.
In step S21, the received status information of the I/O port group is analyzed to screen out the status information of the target I/O port group of the expansion chip.
In step S22, the type of the device to be identified by the status information of the target I/O port group of the expansion chip is determined.
Further, the step S22 may include: determining equipment type identification information according to the state information of the target I/O port group; and determining the type of the equipment to be identified based on the equipment type identification information.
In a specific implementation, the device type identification information may uniquely identify a type of device to be identified. That is, each device type uniquely corresponds to a device type identification information
In the embodiment of the invention, the status information of the port is adopted to identify various equipment types, which is beneficial to quickly and accurately determining the equipment type to be identified by the status information of the target I/O port group, and further determining the equipment type to be identified connected with the main chip.
Further, determining device type identification information from the status information of the target I/O port group comprises: converting the combined state information of each I/O port in the target I/O port group into an equipment identification number by adopting a binary conversion mode; and determining the equipment type identification information according to the equipment identification number.
Wherein the combined state information of each I/O port in the target I/O port group is represented by binary numbers, and/or the device identification number is represented by decimal numbers.
In a specific embodiment, the target I/O port group includes 4I/O ports in total, where the combined state information of each I/O port is 0010, and the result obtained after conversion into a decimal number in a binary conversion manner is 2, that is, the type of the device to be identified with the device identification number of 2 may be determined.
In another specific embodiment, the target I/O port group includes 3I/O ports in total, where the combined state information of each I/O port is 110, and the result obtained after conversion into a decimal number in a binary conversion manner is 6, that is, the type of the device to be identified with the device identification number of 6 may be determined.
In the embodiment of the invention, the expansion chip and the I/O port thereof are specially used for realizing the function of identifying the device type, specifically, the I/O port of the expansion chip is divided into the port groups, and different device types are identified by using the state information of each I/O port group on the expansion chip, so that the device type to be identified connected with the main chip can be determined after the state information of the target I/O port group of the expansion chip is acquired. Therefore, the occupation of the I/O resources of the main chip can be saved, and the utilization rate of the I/O resources of the main chip is improved.
Further, the method further comprises: determining a target driver corresponding to the type of the equipment to be identified, and loading the target driver; and the equipment type to be identified and the target driver have one-to-one correspondence. Therefore, mapping relations between different device types and each target driver can be preset, so that after the device type to be identified by the state information of the target I/O port group of the expansion chip is determined, the target driver which is actually required to be loaded can be determined and loaded, and the function of 'single soft multiple hard' is realized under the condition of saving the I/O resource of the main chip.
Referring to fig. 3, fig. 3 is a partial flowchart of another device type identification method in an embodiment of the present invention. The other device type identification method may include steps S11 to S13 shown in fig. 1, and may further include steps S31 to S32. Wherein, steps S31 to S32 may be performed before step S13. The following description is made of differences from fig. 1.
In step S31, in response to receiving a device driver loading instruction, determining the device type to be identified, where the device driver loading instruction corresponds to the device type to be identified one to one.
In a specific implementation, a mapping table (a first mapping table) regarding one-to-one correspondence between different device driver loading instructions (or device drivers) and different device types may be preset. After receiving a specific device driver loading instruction, the main chip can quickly and accurately determine the corresponding device type to be identified by directly searching the first mapping relation table.
In step S32, an I/O port group corresponding to the device type to be identified is determined as the target I/O port group.
The state information of each I/O port group and the equipment type have preset one-to-one correspondence.
In a specific implementation, a mapping relation table (second mapping relation table) regarding one-to-one correspondence between different device types and the respective I/O port groups of the expansion chip may also be preset. After the master chip determines the type of the device to be identified in step S31, the corresponding I/O port group may be determined quickly and accurately as the target I/O port group by directly searching the second mapping relationship table.
In the embodiment of the present invention, a mapping relationship between a device driver load instruction and a type of a device, and a mapping relationship between a type of a device and an I/O port group of an expansion chip may be preset. Therefore, after receiving a device driver loading instruction, the corresponding target I/O port group can be quickly and accurately determined, and in the subsequent steps, the specific device type to be identified can be accurately determined according to the state information of the target I/O port group.
It is noted that the method of determining the target I/O port group shown in the above steps S31 to S32 is only a non-limiting example. In specific implementation, the target I/O port group may also be determined by adopting other adaptive methods according to different application scenarios, which is not limited in the embodiment of the present invention.
In the specific implementation, more details regarding steps S31 to S32 are performed with reference to the foregoing description and the related descriptions in fig. 1 and fig. 2, and are not repeated herein.
Referring to fig. 4, fig. 4 is a schematic structural diagram of device type identification based on an extended chip according to an embodiment of the present invention.
As a non-limiting example, the main chip 41 and the expansion chip 42 may be coupled to each other, and the main chip 41 and the expansion chip 42 may communicate via an Inter-Integrated Circuit (IIC) or I2C protocol. The expansion chip 42 has a plurality of I/O (Input/Output) ports (also called PIN PINs) thereon, and is pre-divided into a plurality of I/O port groups. For example, port group 1 to port group 5 are shown, wherein port group 1 has three ports P1_0 to P1_2, port group 2 has four ports P0_0 to P0_3, port group 3 has three ports P0_4 to P0_6, port group 4 has three ports P2_0 to P2_2, and port group 5 has two ports P2_3 to P2_ 4.
The state information of each I/O port group and the equipment type have a preset one-to-one correspondence relationship:
as shown in the figure, the state information of the port group 1 (specifically, the combined state information of each port in the port group 1) is used to identify the type of the display panel, the state information of the port group 2 is used to identify the type of the camera, the state information of the port group 3 is used to identify the type of the audio device, the state information of the port group 4 is used to identify the type of the radio frequency card, and the state information of the port group 5 is used to identify the type of the sensor.
Each type of the device to be identified may be identified by a part or all of the I/O ports in the corresponding I/O port group.
In a specific implementation, the expansion chip 42 determines the type of the device to be identified based on the state information of the target I/O port group by reading the state information of each port in each I/O port group (the state information of each I/O port may be a high-level state signal or a low-level state signal), and screening out the state information of the target I/O port group.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an apparatus type identification device in an embodiment of the present invention. The device type identification means may include:
a port group status information reading module 51, configured to send an I/O port status reading instruction to an expansion chip, where the I/O port status reading instruction is used to read status information of one or more I/O port groups of the expansion chip;
a port group status information receiving module 52, configured to receive, from the expansion chip, the read status information of each I/O port group;
a to-be-identified device type identifying module 53, configured to analyze the received state information of the I/O port group, so as to determine a to-be-identified device type identified by the state information of the target I/O port group of the expansion chip;
the state information of each I/O port group and the device type have preset one-to-one correspondence.
In a specific implementation, the device type identification apparatus may correspond to a chip of a device type identification function; or to a chip module having a device type identification function in the terminal, or to the terminal.
For the principle, specific implementation and beneficial effects of the device type identification apparatus, please refer to the foregoing and the related descriptions about the device type identification method shown in fig. 1 to fig. 4, which are not described herein again.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the device type identification method shown in fig. 1 to 4. The computer-readable storage medium may include a non-volatile memory (non-volatile) or a non-transitory memory, and may further include an optical disc, a mechanical hard disk, a solid state hard disk, and the like.
Specifically, in the embodiment of the present invention, the processor may be a Central Processing Unit (CPU), and the processor may also be another general-purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or another programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will also be appreciated that the memory in the embodiments of the subject application may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash memory. Volatile memory can be Random Access Memory (RAM), which acts as external cache memory. By way of example and not limitation, many forms of Random Access Memory (RAM) are available, such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous DRAM (SLDRAM), and direct bus RAM (DR RAM).
An embodiment of the present invention further provides a terminal, which includes a memory and a processor, where the memory stores a computer program capable of running on the processor, and the processor executes the steps of the device type identification method shown in fig. 1 to 4 when running the computer program. The terminal can include but is not limited to a mobile phone, a computer, a tablet computer and other terminal devices, and can also be a server, a cloud platform and the like.
The above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, the above-described embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. The procedures or functions according to the embodiments of the present application are wholly or partially generated when the computer instructions or the computer program are loaded or executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer program may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer program may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire or wirelessly.
In the several embodiments provided in the present application, it should be understood that the disclosed method, apparatus and system may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative; for example, the division of the unit is only a logic function division, and there may be another division manner in actual implementation; for example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately and physically included, or two or more units may be integrated into one unit. The integrated unit may be implemented in the form of hardware, or in the form of hardware plus a software functional unit. For example, for each device or product applied to or integrated into a chip, each module/unit included in the device or product may be implemented by hardware such as a circuit, or at least a part of the module/unit may be implemented by a software program running on a processor integrated within the chip, and the rest (if any) part of the module/unit may be implemented by hardware such as a circuit; for each device or product applied to or integrated with the chip module, each module/unit included in the device or product may be implemented by using hardware such as a circuit, and different modules/units may be located in the same component (e.g., a chip, a circuit module, etc.) or different components of the chip module, or at least some of the modules/units may be implemented by using a software program running on a processor integrated within the chip module, and the rest (if any) of the modules/units may be implemented by using hardware such as a circuit; for each device and product applied to or integrated in the terminal, each module/unit included in the device and product may be implemented by using hardware such as a circuit, and different modules/units may be located in the same component (e.g., a chip, a circuit module, etc.) or different components in the terminal, or at least part of the modules/units may be implemented by using a software program running on a processor integrated in the terminal, and the rest (if any) part of the modules/units may be implemented by using hardware such as a circuit.
It should be understood that the term "and/or" herein is merely one type of association relationship that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein indicates that the former and latter associated objects are in an "or" relationship.
The "plurality" appearing in the embodiments of the present application means two or more.
The descriptions of the first, second, etc. appearing in the embodiments of the present application are only for illustrating and differentiating the objects, and do not represent the order or the particular limitation of the number of the devices in the embodiments of the present application, and do not constitute any limitation to the embodiments of the present application.
It should be noted that the sequence numbers of the steps in this embodiment do not represent a limitation on the execution sequence of the steps.
Although the present invention is disclosed above, the present invention is not limited thereto. Various changes and modifications may be effected therein by one skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (16)

1. A device type identification method, comprising:
sending an I/O port state reading instruction to an expansion chip, wherein the I/O port state reading instruction is used for reading state information of one or more I/O port groups of the expansion chip;
receiving the read state information of each I/O port group from the expansion chip;
analyzing the received state information of the I/O port group to determine the type of equipment to be identified by the state information of the target I/O port group of the expansion chip;
the state information of each I/O port group and the device type have preset one-to-one correspondence.
2. The method of claim 1, wherein prior to parsing the received state information for the group of I/O ports, the method further comprises:
determining the target I/O port group.
3. The method of claim 2, wherein the determining the target set of I/O ports comprises:
determining the type of the equipment to be identified in response to receiving an equipment driver loading instruction, wherein the equipment driver loading instruction corresponds to the type of the equipment to be identified one by one;
and determining an I/O port group corresponding to the device type to be identified as the target I/O port group.
4. The method of claim 1, wherein the I/O port state read instruction is sent in response to receiving a device driver load instruction.
5. The method of claim 1, wherein the I/O port status read instruction is configured to read status information of all I/O ports of the expansion chip.
6. The method of claim 1, wherein the status information of the target I/O port group is combined status information of some or all I/O ports within the target I/O port group.
7. The method according to claim 1, wherein the parsing the received status information of the I/O port group to determine the type of the device to be recognized identified by the status information of the target I/O port group of the expansion chip comprises:
analyzing the received state information of the I/O port group to screen out the state information of the target I/O port group of the expansion chip;
and determining the type of the equipment to be identified by the state information of the target I/O port group of the expansion chip.
8. The method of claim 7, wherein the determining the type of the device to be identified by the status information of the target I/O port group of the expansion chip comprises:
determining equipment type identification information according to the state information of the target I/O port group;
and determining the type of the equipment to be recognized based on the equipment type identification information.
9. The method of claim 8, wherein determining device type identification information from the status information for the target group of I/O ports comprises:
converting the combined state information of each I/O port in the target I/O port group into an equipment identification number by adopting a binary conversion mode;
and determining the equipment type identification information according to the equipment identification number.
10. The method of claim 9, wherein the combined status information for each I/O port within the target I/O port group is represented in binary numbers and/or wherein the device identification number is represented in decimal numbers.
11. The method of claim 1, wherein the I/O port status information within each I/O port group comprises first status information and second status information;
wherein the first state information is one of a high level state signal and a low level state signal, and the second state information is the other of the high level state signal and the low level state signal.
12. The method of claim 1, further comprising:
determining a target driver corresponding to the type of the equipment to be identified, and loading the target driver;
and the type of the equipment to be identified and the target driver have one-to-one correspondence.
13. The method of claim 1, wherein the device type to be identified is selected from one or more of:
a display board type, a camera type, an audio device type, a sensor type, and a radio frequency card type.
14. An apparatus for identifying a device type, comprising:
the system comprises a port group state information reading module, a port group state information reading module and a port group state information reading module, wherein the port group state information reading module is used for sending an I/O port state reading instruction to an expansion chip, and the I/O port state reading instruction is used for reading the state information of one or more I/O port groups of the expansion chip;
the port group state information receiving module is used for receiving the read state information of each I/O port group from the expansion chip;
the device type identification module to be identified is used for analyzing the received state information of the I/O port group so as to determine the type of the device to be identified by the state information of the target I/O port group of the expansion chip;
the state information of each I/O port group and the device type have preset one-to-one correspondence.
15. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the device type identification method of any one of claims 1 to 13.
16. A terminal comprising a memory and a processor, the memory having stored thereon a computer program operable on the processor, wherein the processor, when executing the computer program, performs the steps of the device type identification method of any one of claims 1 to 13.
CN202211026529.1A 2022-08-25 2022-08-25 Device type identification method and device, computer readable storage medium and terminal Pending CN115358331A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211026529.1A CN115358331A (en) 2022-08-25 2022-08-25 Device type identification method and device, computer readable storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211026529.1A CN115358331A (en) 2022-08-25 2022-08-25 Device type identification method and device, computer readable storage medium and terminal

Publications (1)

Publication Number Publication Date
CN115358331A true CN115358331A (en) 2022-11-18

Family

ID=84003965

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211026529.1A Pending CN115358331A (en) 2022-08-25 2022-08-25 Device type identification method and device, computer readable storage medium and terminal

Country Status (1)

Country Link
CN (1) CN115358331A (en)

Similar Documents

Publication Publication Date Title
US20160275027A1 (en) System and Method to Avoid SMBus Address Conflicts via a Baseboard Management Controller
CN105488125A (en) Page access method and apparatus
US10318312B2 (en) Support of Option-ROM in socket-direct network adapters
CN111880916A (en) Multi-drawing task processing method, device, terminal, medium and host in GPU
CN114860699A (en) Data quality detection method, device, equipment and storage medium
CN113177015B (en) Frame header-based serial port communication method and serial port chip
CN108628712B (en) Application program testing method and terminal equipment
CN114138363A (en) Program data calling method, device, equipment and storage medium
CN117077221A (en) Hard disk screen printing distribution method and device, computer equipment and medium
CN111046393B (en) Vulnerability information uploading method and device, terminal equipment and storage medium
CN114860321B (en) External device control method, device, equipment and medium based on raspberry pie
CN115358331A (en) Device type identification method and device, computer readable storage medium and terminal
CN110389977B (en) Database connection creating method and device and terminal equipment
CN114116866A (en) Data acquisition method and device, terminal equipment and storage medium
CN111723032B (en) Interrupt management and control method and electronic equipment
CN112835759A (en) Test data processing method and device, electronic equipment and storage medium
CN111709210A (en) Method and device for generating component list, terminal equipment and storage medium
CN113050998B (en) Electronic device and control method
CN114579198B (en) Memory chip starting method and device, computer equipment and storage medium
CN109976876B (en) Accelerator management method and device
CN117215966B (en) Test method and test device for chip SDK interface and electronic equipment
CN114489851B (en) Memory chip starting method and device, computer equipment and storage medium
CN111026666A (en) Test data processing method, device, computer system and medium
CN113885919A (en) Software acquisition method and device, terminal equipment and readable storage medium
CN116775163A (en) Configuration file acquisition method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination