WO2012151978A1 - Method and device for recognizing port properties of data card - Google Patents

Method and device for recognizing port properties of data card Download PDF

Info

Publication number
WO2012151978A1
WO2012151978A1 PCT/CN2011/083721 CN2011083721W WO2012151978A1 WO 2012151978 A1 WO2012151978 A1 WO 2012151978A1 CN 2011083721 W CN2011083721 W CN 2011083721W WO 2012151978 A1 WO2012151978 A1 WO 2012151978A1
Authority
WO
WIPO (PCT)
Prior art keywords
port
data card
attribute
ports
matching rule
Prior art date
Application number
PCT/CN2011/083721
Other languages
French (fr)
Chinese (zh)
Inventor
李兵
李睿
李晓锋
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2012151978A1 publication Critical patent/WO2012151978A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • G06F13/4081Live connection to bus, e.g. hot-plugging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/38Universal adapter
    • G06F2213/3804Memory card connected to a computer port directly or by means of a reader/writer

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

Disclosed are a method and a device for recognizing port properties of a data card. The method comprises: obtaining identification information of each port of a currently inserted or restarted data card; according to the identification information of each port, invoking a matching rule to recognize port properties of each port of the data card, the matching rule comprising: the correlation between the port properties of a port and the identifier of the port; and recording port property information of each port of the current data card. Through the present invention, each port of a data card can be recognized without polling all ports of the data card, thereby improving the working efficiency.

Description

数据卡端口属性的识别方法及装置 技术领域 本发明涉及通信领域, 具体而言, 涉及一种数据卡端口属性的识别方法及装置。 背景技术 数据卡作为一种上网产品, 由于携带方便得到了越来越广泛的应用。 目前数据卡 的使用方式主要有两种: 方式 1、 借助主机端的数据卡应用程序完成数据业务功能; 方式 2、 数据卡在客户端 /服务器系统中充当服务器的角色。 在方式 1中,数据业务功能包括数据卡端口识别功能,数据卡端口识别主要包括: 数据卡识别、 数据卡进入多端口模式识别及数据卡端口属性识别。 在现有技术中, 数 据卡识别主要是通过遍历 USB总线上的 USB设备,得到与 USB设备对应的设备描述 符, 从而得到 VID (厂商 ID)和 PID (产品 ID), 通过 VID来判断是否识别数据卡; 在识 别了数据卡后, 需要数据卡进入多端口模式, 只有在该模式下, 对应的端口才能够被 驱动识别, 现有技术主要是通过弹出光盘来完成; 数据卡端口属性识别, 现有技术是 在多端口模式下, 借助 USB 转串口驱动程序生成对应的接口设备文件 (ttyUSB*或 ttyACM* ), 依据 AT和 MODEM口可以发送 AT指令的特性, 逐一向接口设备文件发 送 AT指令, 并根据返回结果从所有端口中找到 AT口和 MODEM口。为了区分 AT口 和 MODEM口, 分别为 AT口和 MODEM口配置一个配置文件, 该配置文件记录了数 据卡产品找到 AT口和 MODEM口的先后顺序。 但是, 这种方式需要数据卡应用程序 扫描所有数据卡端口后才能找到 AT和 MODEM口, 不能做到在数据卡应用程序工作 时就知道相应的端口属性, 从而延缓了数据卡上线时间。 发明内容 本发明的主要目的在于提供一种数据卡端口属性的识别方法及装置, 以至少解决 上述问题之一。 根据本发明的一个方面, 提供了一种数据卡端口属性的识别方法, 包括: 获取当 前插入或重启的数据卡的各个端口的标识信息; 根据各个端口的标识信息, 调用匹配 规则对数据卡的各个端口的端口属性进行识别, 其中, 匹配规则包括: 端口的端口属 性与端口的标识的对应关系。 在获取当前插入或重启的数据卡的各个端口的标识信息之前, 还包括: 获取数据 卡的所有端口的标识; 生成匹配规则, 在匹配规则中记录各个端口的标识与该端口的 端口属性之间的对应关系。 获取数据卡的所有端口的标识, 包括: 获取数据卡的所有端口的端口属性分布信 息; 根据端口属性分布信息确定所有端口中各个端口的标识。 属性分布信息包括: 数据卡的厂商编号、 数据卡的产品编号、 端口的类型以及端 口在数据卡上的位置信息。 生成匹配规则, 包括: 生成数据卡的所有端口的每个端口的端口名称信息。 在根据所述各个端口的标识信息, 调用匹配规则对所述数据卡的各个端口的端口 属性进行识别之后, 还包括: 记录所述当前数据卡的各个所述端口的端口属性信息。 根据本发明的另一方面, 提供了一种数据卡端口属性的识别装置, 包括: 获取模 块, 设置为获取当前插入或重启的数据卡的各个端口的标识信息; 识别模块, 设置为 根据各个端口的标识信息, 调用匹配规则对数据卡的各个端口的端口属性进行识别, 其中, 匹配规则包括: 端口的端口属性与端口的标识的对应关系。 上述获取模块包括: 获取单元, 设置为获取数据卡的所有端口的标识; 生成单元, 设置为生成匹配规则, 在匹配规则中记录各个端口的标识与该端口的端口属性之间的 对应关系。 通过本发明, 采用能够将数据卡的各个端口的标识匹配至该端口的匹配规则 (实 际应用中, 可以采用 UDEV规则)对数据卡的端口进行识别, 解决了当前数据卡的端 口识别过程中必须对所有的端口进行轮询才能确定各个端口类型造成的工作时间较长 的问题, 进而达到了提高端口识别效率的效果。 附图说明 此处所说明的附图用来提供对本发明的进一步理解, 构成本申请的一部分, 本发 明的示意性实施例及其说明用于解释本发明, 并不构成对本发明的不当限定。 在附图 中: 图 1是根据本发明实施例的数据卡端口属性的识别方法的流程图; 图 2是根据本发明优选实施例的一款数据卡在插入状态下接口 2的 UDEV规则的 配置流程图; 图 3是根据本发明实施例的数据卡端口属性的识别装置的结构示意图; 图 4是根据本发明优选实施例的数据卡端口属性的识别装置的结构示意图。 具体实施方式 下文中将参考附图并结合实施例来详细说明本发明。 需要说明的是, 在不冲突的 情况下, 本申请中的实施例及实施例中的特征可以相互组合。 图 1是根据本发明实施例的数据卡端口属性的识别方法的流程图, 如图 1所示, 该方法主要包括以下步骤 (步骤 S 102-步骤 S104): 步骤 S102, 获取当前插入或重启的数据卡的各个端口的标识信息; 在本发明实施例中, 可以先获取需要插入或重启的数据卡的所有端口的标识, 根 据所有端口的标识生成匹配规则 (包括生成数据卡的所有端口的每个端口的端口名称 信息), 再在匹配规则中记录各个端口的标识与该端口的端口属性之间的对应关系。在 实际应用中, 可以通过获取数据卡的所有端口的端口属性分布信息进而确定所有端口 中各个端口的标识, 其中, 属性分布信息可以包括: 数据卡的厂商编号、 数据卡的产 品编号、 端口的类型以及端口在数据卡上的位置信息。 需要说明的是, 实际应用中, 可以采用 UDEV规则。 步骤 S104, 根据各个端口的标识信息, 调用匹配规则对数据卡的各个端口的端口 属性进行识别, 其中, 匹配规则包括: 端口的端口属性与端口的标识的对应关系。 在本发明实施例中, 在匹配规则生成后, 可以将其 (也就是端口的端口属性与端 口的标识的对应关系) 进行存储操作, 以便后续调用。 优选地, 在根据所述各个端口 的标识信息, 调用匹配规则对所述数据卡的各个端口的端口属性进行识别之后, 还可 以记录所述当前数据卡的各个所述端口的端口属性信息。采用该端口属性的识别方法, 可以实现对但当前数据卡的各个端口的识别。 图 2是根据本发明优选实施例的一款数据卡在插入状态下接口 2的 UDEV规则的 配置流程图, 如图 2所示, 主要包括以下步骤: TECHNICAL FIELD The present invention relates to the field of communications, and in particular to a method and an apparatus for identifying a data card port attribute. BACKGROUND As a kind of Internet access product, a data card has been widely used due to its convenient portability. At present, there are two main ways to use data cards: Mode 1. The data service function is completed by the data card application on the host side; Mode 2, the data card acts as a server in the client/server system. In mode 1, the data service function includes a data card port identification function, and the data card port identification mainly includes: data card identification, data card entry multi-port mode recognition, and data card port attribute identification. In the prior art, the data card identification mainly obtains a device descriptor corresponding to the USB device by traversing the USB device on the USB bus, thereby obtaining a VID (vendor ID) and a PID (product ID), and determining whether to identify by the VID. After the data card is identified, the data card needs to enter the multi-port mode. Only in this mode, the corresponding port can be driven and recognized. The prior art is mainly completed by ejecting the optical disc; In the prior art, in the multi-port mode, the corresponding interface device file (ttyUSB* or ttyACM*) is generated by using the USB to serial port driver, and the AT command can be sent according to the AT and MODEM ports, and the AT command is sent to the interface device file one by one. And find the AT port and MODEM port from all ports according to the returned result. To distinguish between the AT port and the MODEM port, configure a configuration file for the AT port and the MODEM port respectively. This configuration file records the sequence in which the data card product finds the AT port and the MODEM port. However, this method requires the data card application to scan all the data card ports to find the AT and MODEM ports. It is not possible to know the corresponding port attributes when the data card application works, thereby delaying the data card online time. SUMMARY OF THE INVENTION A primary object of the present invention is to provide a method and apparatus for identifying data port attributes to solve at least one of the above problems. According to an aspect of the present invention, a method for identifying a data card port attribute is provided, including: acquiring identification information of each port of a currently inserted or restarted data card; and calling a matching rule for the data card according to the identification information of each port The port attributes of each port are identified. The matching rules include: Correspondence between the port attribute of the port and the identifier of the port. Before obtaining the identification information of each port of the currently inserted or restarted data card, the method further includes: obtaining an identifier of all ports of the data card; generating a matching rule, and recording, between the identifiers of the ports and the port attributes of the port, in the matching rule Correspondence. Obtaining the identifiers of all ports of the data card, including: obtaining port attribute distribution information of all ports of the data card; determining the identifiers of each port in all ports according to the port attribute distribution information. The attribute distribution information includes: the manufacturer number of the data card, the product number of the data card, the type of the port, and the location information of the port on the data card. Generate matching rules, including: Generate port name information for each port of all ports of the data card. After identifying the port attributes of the ports of the data card according to the identification information of the ports, the method further includes: recording port attribute information of each port of the current data card. According to another aspect of the present invention, an apparatus for identifying a data card port attribute includes: an obtaining module configured to acquire identification information of each port of a currently inserted or restarted data card; and an identification module configured to be based on each port The identification information of the port of the data card is identified by the matching rule, where the matching rule includes: a correspondence between the port attribute of the port and the identifier of the port. The obtaining module includes: an obtaining unit, configured to obtain an identifier of all ports of the data card; and a generating unit, configured to generate a matching rule, and record, in the matching rule, a correspondence between an identifier of each port and a port attribute of the port. According to the present invention, the matching rule of the data port can be matched to the matching rule of the port (in the actual application, the UDEV rule can be used) to identify the port of the data card, and the current data card must be identified in the port identification process. Polling all ports can determine the problem of long working hours caused by each port type, and thus achieve the effect of improving port identification efficiency. BRIEF DESCRIPTION OF THE DRAWINGS The accompanying drawings, which are set to illustrate,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, In the drawings: FIG. 1 is a flowchart of a method for identifying a data card port attribute according to an embodiment of the present invention; 2 is a flow chart showing the configuration of a UDEV rule of the interface 2 in the inserted state of the data card according to a preferred embodiment of the present invention; FIG. 3 is a schematic structural diagram of the device for identifying the attributes of the data card port according to the embodiment of the present invention; Is a schematic structural diagram of an apparatus for identifying data port attributes according to a preferred embodiment of the present invention. BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, the present invention will be described in detail with reference to the accompanying drawings. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict. 1 is a flowchart of a method for identifying a data card port attribute according to an embodiment of the present invention. As shown in FIG. 1, the method mainly includes the following steps (step S102-step S104): Step S102: Acquire a current insertion or restart In the embodiment of the present invention, the identifiers of all the ports of the data card that need to be inserted or restarted are obtained, and the matching rules are generated according to the identifiers of all the ports (including each port that generates the data card. Port name information of the port. Then, the matching rule records the correspondence between the identifier of each port and the port attribute of the port. In an actual application, the port attribute distribution information of all the ports of the data card can be obtained to determine the identifier of each port in the port. The attribute distribution information can include: the manufacturer number of the data card, the product number of the data card, and the port number. Type and location information of the port on the data card. It should be noted that in practical applications, UDEV rules can be adopted. Step S104: In accordance with the identification information of each port, the matching rule is invoked to identify the port attribute of each port of the data card, where the matching rule includes: a correspondence between the port attribute of the port and the identifier of the port. In the embodiment of the present invention, after the matching rule is generated, the storage node (that is, the correspondence between the port attribute of the port and the identifier of the port) may be stored for subsequent calls. Preferably, after the port attribute of each port of the data card is identified according to the identification information of the respective ports, the port attribute information of each port of the current data card may also be recorded. The identification method of the port attribute can be used to identify each port of the current data card. 2 is a flow chart showing the configuration of a UDEV rule of the interface 2 in the inserted state of the data card according to a preferred embodiment of the present invention. As shown in FIG. 2, the method mainly includes the following steps:
S202, 获取该款数据卡的端口的具体属性分布信息; 请参考表 1, 如表 1所示, 该款数据卡端口分布包括 DIAG口、 GPS 口、 UI AT 口、 EXT AT口、 MODEM口以及 TV口。 表 1 数据卡的设备属性表 S202. Obtain specific attribute distribution information of a port of the data card. Please refer to Table 1. As shown in Table 1, the data card port distribution includes DIAG port, GPS port, UI AT port, EXT AT port, MODEM port and TV port. Table 1 Device attribute table of the data card
Figure imgf000006_0001
Figure imgf000006_0001
S204, 通过 udevadm工具获取该款数据卡信息, 并作为端口 2的唯一标识; 请参考表 2, 如表 2所示, 通过 udevadm工具找到可以作为端口唯一标识的属性 信 息 , 可 以 将 KERNEL=="ttyUSB*" , SUBSYSTEMS=="USB" , ATTRS{bInterfaceNumber}=="02", ATTRS{modalias}=="usb:vl9d2p0153*"作为接口 2 的唯一标识, 同理, 可以找出 DIAG口和 MODEM口等端口的唯一标识, 当然, 也可 以找出其他类型端口的唯一标识, 从而可以进一步生成匹配规则 (UDEV规则)。 表 2 数据卡插入时接口 2的自身属性及双亲属性的获取程序表 looking at device devices/pci0000:00/0000:00: ld.7/usbl/l-5/l-5: 1.2/ttyUSE2/tty/ttyUSE21S204, obtaining the data card information by using the udevadm tool, and serving as the unique identifier of the port 2; refer to Table 2, as shown in Table 2, using the udevadm tool to find the attribute information that can be used as the unique identifier of the port, and can be KERNEL=="ttyUSB*" , SUBSYSTEMS=="USB" , ATTRS{bInterfaceNumber}=="02", ATTRS{modalias}=="usb:vl9d2p0153*" as the unique identifier for interface 2, for the same reason, you can find the DIAG port and MODEM The unique identifier of the port, of course, can also find the unique identifier of other types of ports, so that the matching rule (UDEV rule) can be further generated. Table 2 Obtaining the program's own attributes and parental attributes when the data card is inserted. Look at device devices/pci0000:00/0000:00: ld.7/usbl/l-5/l-5: 1.2/ttyUSE2/tty /ttyUSE2 1 :
KER EL==rrttyUSE2" KER EL== rr ttyUSE2"
3UB3Y3TEH=="tty"  3UB3Y3TEH=="tty"
DRIVER==rrrr DRIVER== rrrr
looking at parent device /devices/pciOOOO :00/0000 :00: Id.7/usbl/ 1-5/ 1-5 :1.2/ttyU3E2':  Looking at parent device /devices/pciOOOO :00/0000 :00: Id.7/usbl/ 1-5/ 1-5 :1.2/ttyU3E2':
KE ELS==rrttyUSB2rr KE ELS== rr ttyUSB2 rr
SUESYSTEHS==rrusb-serial SUESYSTEHS== rr usb-serial
DRIVER3=="optionl"  DRIVER3=="optionl"
ATTRS { ort_nuriber} =="0"  ATTRS { ort_nuriber} =="0"
looking at parent device devices/pciOOOO :00/0000 :00: Id.7/usbl/ 1-5/ 1-5 :1.2  Looking at parent device devices/pciOOOO :00/0000 :00: Id.7/usbl/ 1-5/ 1-5 :1.2
KE NEL3=="1-S:1.2"  KE NEL3=="1-S:1.2"
SUBSYSTEHS DRIVERS==rroption" SUBSYSTEHS DRIVERS== rr option"
ATTRS { lnterfaceNuri e]:}  ATTRS { lnterfaceNuri e]:}
ATTRS{bAlternateSetting} ==" 0"  ATTRS{bAlternateSetting} ==" 0"
ATTRS { bNumEnd oin s} =="0 "  ATTRS { bNumEnd oin s} =="0 "
ATTR3{bInterf aceClass} =="f f "  ATTR3{bInterf aceClass} =="f f "
ATTR3{bInterface3ubClas3}=="ff"  ATTR3{bInterface3ubClas3}=="ff"
ATT S{bInterfaceProtocol}==rrff " ATT S{bInterfaceProtocol}== rr ff "
ATTRS{r[iodalias :vl9D2p0153d0000dc00d3c00dp00icrriscrriprrrr ATTRS{r[iodalias :vl9D2p0153d0000dc00d3c00dp00icrriscrriprr rr
ATTR3{ suppoi:ts_autosu3pend} =="1"  ATTR3{ suppoi:ts_autosu3pend} =="1"
S206, 生成 UDEV规则文件作为匹配规则; 在获取到各个端口的唯一标识后, 对于该款数据卡来说, 即可以生成 UDEV规则 ( 匹 配 规 贝 lj ) : KERNEL=="ttyUSB*" , SUBSYSTEMS=="USB" , ATTRS{bInterfaceNumber}=="00" , ATTRS{modalias}=="usb:vl9d2p0153*" , NAME="xxx_multi_port_devices/pO 153_at" , SYMLINK+=at, 其中, NAME 表示当匹 配条件满足时, 在 /dev 目录下创建的相应的设备文件的名称, SYMLINK表示在 /dev 下创建该设备的符号链接。 S206. Generate a UDEV rule file as a matching rule. After obtaining the unique identifier of each port, for this data card, UDEV rules can be generated (matching rules lj): KERNEL=="ttyUSB*" , SUBSYSTEMS=="USB" , ATTRS{bInterfaceNumber}= ="00" , ATTRS{modalias}=="usb:vl9d2p0153*" , NAME="xxx_multi_port_devices/pO 153_at" , SYMLINK+=at, where NAME represents the corresponding creation created in the /dev directory when the matching condition is met The name of the device file, SYMLINK indicates that the symbolic link for the device was created under /dev.
S208, 为 UDEV规则创建符号链接, 以能够运行 UDEV规则; 把创建的 UDEV 规则放入 /etc/udev/rules.d 目录下, 重启电脑或在终端下运行 /sbin/udevadm control -reload-rules/sbin/udevadm trigger -sub sy stem-match=tty , 以使新 生成并的 UDEV规则可以在链接后运行。 S208, creating a symbolic link for the UDEV rule to be able to run the UDEV rule; placing the created UDEV rule in the /etc/udev/rules.d directory, restarting the computer, or running /sbin/udevadm control -reload-rules/ under the terminal Sbin/udevadm trigger -sub sy stem-match=tty , so that newly generated UDEV rules can be run after the link.
S210, 调用 UDEV规则对各个端口进行识别; S210, calling a UDEV rule to identify each port;
S212, 在 /dev设备下生成数据卡各个端口的相应设备文件。 采用上述实施例提供的数据卡端口属性的识别方法, 可以调用根据各个端口的端 口标识生成的 UDEV规则对数据卡的各个端口进行识别, 省去了传统数据卡应用程序 需要对数据卡的各个端口进行轮询才能获取各个端口的端口属性的过程时间, 进而提 高了数据卡端口属性的识别效率。 图 3是根据本发明实施例的数据卡端口属性的识别装置的结构示意图, 如图 3所 示, 该装置用以实现上述实施例提供的数据卡端口属性的识别方法, 该装置主要包括: 获取模块 10和识别模块 20。 其中, 获取模块 10, 设置为获取当前插入或重启的数据 卡的各个端口的标识信息; 识别模块 20, 连接至获取模块 10, 设置为根据各个端口的 标识信息, 调用匹配规则对数据卡的各个端口的端口属性进行识别, 其中, 匹配规则 包括: 端口的端口属性与端口的标识的对应关系。 采用该装置, 可以实现当前数据卡 的所有端口的识别。 图 4是根据本发明优选实施例的数据卡端口属性的识别装置的结构示意图, 如图 4所示, 获取模块 10还可以包括: 获取单元 12和生成单元 14。 其中, 获取单元 12, 设置为获取数据卡的所有端口的标识; 生成单元 14, 连接至获取单元 12, 设置为生成 匹配规则, 在匹配规则中记录各个端口的标识与该端口的端口属性之间的对应关系。 采用上述实施例提供的数据卡端口属性的识别装置, 可以调用根据各个端口的端 口标识生成的 UDEV规则对数据卡的各个端口进行识别, 省去了传统数据卡应用程序 需要对数据卡的各个端口进行轮询才能获取各个端口的端口属性的过程时间, 进而提 高了数据卡端口属性的识别效率。 从以上的描述中, 可以看出, 本发明实现了如下技术效果: 通过调用根据各个端 口的端口标识生成的 UDEV规则对数据卡的各个端口进行识别, 从而可以生成数据卡 各端口对应的设备文件, 从而省去了传统数据卡应用程序需要对数据卡的各个端口进 行轮询才能获取各个端口的端口属性的过程时间, 进而提高了数据卡端口属性的识别 效率。 可以在不经过对数据卡的所有端口进行轮询的情况下即可识别数据卡的各个端 口, 提高了工作效率, 降低了时间成本。 显然, 本领域的技术人员应该明白, 上述的本发明的各模块或各步骤可以用通用 的计算装置来实现, 它们可以集中在单个的计算装置上, 或者分布在多个计算装置所 组成的网络上, 可选地, 它们可以用计算装置可执行的程序代码来实现, 从而, 可以 将它们存储在存储装置中由计算装置来执行, 并且在某些情况下, 可以以不同于此处 的顺序执行所示出或描述的步骤, 或者将它们分别制作成各个集成电路模块, 或者将 它们中的多个模块或步骤制作成单个集成电路模块来实现。 这样, 本发明不限制于任 何特定的硬件和软件结合。 以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本领域的技 术人员来说, 本发明可以有各种更改和变化。 凡在本发明的精神和原则之内, 所作的 任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。 S212. Generate a corresponding device file of each port of the data card under the /dev device. The data card port attribute identification method provided by the foregoing embodiment may be used to identify each port of the data card according to the UDEV rule generated by the port identifier of each port, thereby eliminating the need for the traditional data card application to each port of the data card. Polling can obtain the process time of the port attributes of each port, which improves the identification efficiency of the data port port attributes. FIG. 3 is a schematic structural diagram of an apparatus for identifying a data card port attribute according to an embodiment of the present invention. As shown in FIG. 3, the apparatus is configured to implement the method for identifying a data card port attribute provided by the foregoing embodiment, where the apparatus mainly includes: Module 10 and identification module 20. The obtaining module 10 is configured to obtain the identification information of each port of the currently inserted or restarted data card. The identification module 20 is connected to the obtaining module 10, and is configured to invoke the matching rule on each of the data cards according to the identification information of each port. The port attribute of the port is identified. The matching rule includes: Correspondence between the port attribute of the port and the identifier of the port. With this device, the identification of all ports of the current data card can be achieved. 4 is a schematic structural diagram of an apparatus for identifying data port attributes according to a preferred embodiment of the present invention. As shown in FIG. 4, the obtaining module 10 may further include: an obtaining unit 12 and a generating unit 14. The obtaining unit 12 is configured to obtain an identifier of all ports of the data card. The generating unit 14 is connected to the obtaining unit 12, and is configured to generate a matching rule, where the matching rule records the identifier of each port and the port attribute of the port. Correspondence. The identification device of the data card port attribute provided by the foregoing embodiment may call the UDEV rule generated according to the port identifier of each port to identify each port of the data card, thereby eliminating the traditional data card application. It is necessary to poll each port of the data card to obtain the process time of the port attribute of each port, thereby improving the identification efficiency of the data port port attribute. From the above description, it can be seen that the present invention achieves the following technical effects: By calling the UDEV rules generated according to the port identifiers of the respective ports, each port of the data card is identified, thereby generating a device file corresponding to each port of the data card. Therefore, the process time that the traditional data card application needs to poll each port of the data card to obtain the port attribute of each port is omitted, thereby improving the recognition efficiency of the data port port attribute. The ports of the data card can be identified without polling all the ports of the data card, which improves work efficiency and reduces time cost. Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein. The steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps are fabricated as a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software. The above is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.

Claims

权 利 要 求 书 Claim
1. 一种数据卡端口属性的识别方法, 包括: 1. A method for identifying data port port attributes, including:
获取当前插入或重启的数据卡的各个端口的标识信息;  Obtain identification information of each port of the currently inserted or restarted data card;
根据所述各个端口的标识信息, 调用匹配规则对所述数据卡的各个端口的 端口属性进行识别, 其中, 所述匹配规则包括: 端口的端口属性与端口的标识 的对应关系。  And the matching rule is used to identify the port attribute of each port of the data card according to the identifier information of the port, where the matching rule includes: a correspondence between a port attribute of the port and an identifier of the port.
2. 根据权利要求 1所述的方法, 其中, 在获取当前插入或重启的数据卡的各个端 口的标识信息之前, 还包括: 2. The method according to claim 1, wherein before acquiring the identification information of each port of the currently inserted or restarted data card, the method further includes:
获取所述数据卡的所有端口的标识;  Obtaining an identifier of all ports of the data card;
生成所述匹配规则, 在所述匹配规则中记录各个端口的标识与该端口的端 口属性之间的所述对应关系。  The matching rule is generated, and the correspondence between the identifier of each port and the port attribute of the port is recorded in the matching rule.
3. 根据权利要求 2所述的方法, 其中, 获取所述数据卡的所有端口的标识, 包括: 获取所述数据卡的所有端口的端口属性分布信息; The method of claim 2, wherein obtaining the identifiers of all ports of the data card comprises: acquiring port attribute distribution information of all ports of the data card;
根据所述端口属性分布信息确定所述所有端口中各个端口的标识。  Determining an identifier of each of the ports according to the port attribute distribution information.
4. 根据权利要求 3所述的方法, 其中, 所述属性分布信息包括: 所述数据卡的厂 商编号、 所述数据卡的产品编号、 所述端口的类型以及所述端口在所述数据卡 上的位置信息。 4. The method according to claim 3, wherein the attribute distribution information comprises: a vendor number of the data card, a product number of the data card, a type of the port, and the port is in the data card Location information on.
5. 根据权利要求 2所述的方法, 其中, 生成所述匹配规则, 包括: 生成所述数据卡的所有端口的每个端口的端口名称信息。 5. The method of claim 2, wherein generating the matching rule comprises: generating port name information for each port of all ports of the data card.
6. 根据权利要求 1所述的方法, 其中, 在根据所述各个端口的标识信息, 调用匹 配规则对所述数据卡的各个端口的端口属性进行识别之后, 还包括: The method according to claim 1, wherein after the port attribute of each port of the data card is identified by the matching rule according to the identification information of the respective ports, the method further includes:
记录所述当前数据卡的各个所述端口的端口属性信息。  Recording port attribute information of each of the ports of the current data card.
7. 一种数据卡端口属性的识别装置, 包括: 7. A device for identifying data port port attributes, comprising:
获取模块, 设置为获取当前插入或重启的数据卡的各个端口的标识信息; 识别模块, 设置为根据所述各个端口的标识信息, 调用匹配规则对所述数 据卡的各个端口的端口属性进行识别, 其中, 所述匹配规则包括: 端口的端口 属性与端口的标识的对应关系。 The obtaining module is configured to obtain identification information of each port of the currently inserted or restarted data card; The identification module is configured to: according to the identification information of each port, invoke a matching rule to identify a port attribute of each port of the data card, where the matching rule includes: a correspondence between a port attribute of the port and an identifier of the port .
8. 根据权利要求 7所述的装置, 其中, 所述获取模块包括: The device according to claim 7, wherein the obtaining module comprises:
获取单元, 设置为获取所述数据卡的所有端口的标识;  An obtaining unit, configured to obtain an identifier of all ports of the data card;
生成单元, 设置为生成所述匹配规则, 在所述匹配规则中记录各个端口的 标识与该端口的端口属性之间的所述对应关系。  The generating unit is configured to generate the matching rule, and record the correspondence between the identifier of each port and the port attribute of the port in the matching rule.
PCT/CN2011/083721 2011-08-18 2011-12-08 Method and device for recognizing port properties of data card WO2012151978A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110237841.0A CN102426556B (en) 2011-08-18 2011-08-18 The recognition methods of port attribute of data card and device
CN201110237841.0 2011-08-18

Publications (1)

Publication Number Publication Date
WO2012151978A1 true WO2012151978A1 (en) 2012-11-15

Family

ID=45960544

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/083721 WO2012151978A1 (en) 2011-08-18 2011-12-08 Method and device for recognizing port properties of data card

Country Status (2)

Country Link
CN (1) CN102426556B (en)
WO (1) WO2012151978A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102904785B (en) * 2012-10-17 2015-12-02 深圳市吉祥腾达科技有限公司 The method of wireless Internet card compatibility
CN103761202B (en) * 2014-02-18 2016-08-31 深圳英飞拓科技股份有限公司 A kind of data storage node hard disk position identification method and system
CN104820647B (en) * 2015-03-20 2017-12-29 惠州Tcl移动通信有限公司 A kind of method and terminal for handling USB interface information
CN108076153A (en) * 2017-12-21 2018-05-25 深圳市四面信息科技有限公司 A kind of the big data transmission method and system of anti-AT obstructions
CN108462143B (en) * 2018-03-08 2019-06-28 云南电网有限责任公司电力科学研究院 A kind of test optical port recognition methods of intelligent substation and device
CN109117197A (en) * 2018-08-28 2019-01-01 郑州云海信息技术有限公司 A method of it is chaotic to solve the name of cluster network interface card

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070294430A1 (en) * 2006-06-20 2007-12-20 Microsoft Corporation Generating a device address persistent across different instantiations of an electronic device
CN101324876A (en) * 2008-07-15 2008-12-17 深圳华为通信技术有限公司 Operating mode switch of data card and control method, apparatus and data card thereof
CN101655924A (en) * 2009-09-21 2010-02-24 中兴通讯股份有限公司 Method for recognizing data card, data card and system
CN101853224A (en) * 2010-04-21 2010-10-06 中兴通讯股份有限公司 Method and device for identifying port of data card device under Linux system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100589496C (en) * 2004-05-13 2010-02-10 深圳市友邻通讯设备有限公司 Technique for controlling interface of multiple voices/data card
CN101430669A (en) * 2008-11-20 2009-05-13 深圳华为通信技术有限公司 Exception recovery method and device for apparatus with network interface card and memory device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070294430A1 (en) * 2006-06-20 2007-12-20 Microsoft Corporation Generating a device address persistent across different instantiations of an electronic device
CN101324876A (en) * 2008-07-15 2008-12-17 深圳华为通信技术有限公司 Operating mode switch of data card and control method, apparatus and data card thereof
CN101655924A (en) * 2009-09-21 2010-02-24 中兴通讯股份有限公司 Method for recognizing data card, data card and system
CN101853224A (en) * 2010-04-21 2010-10-06 中兴通讯股份有限公司 Method and device for identifying port of data card device under Linux system

Also Published As

Publication number Publication date
CN102426556B (en) 2017-12-05
CN102426556A (en) 2012-04-25

Similar Documents

Publication Publication Date Title
JP5360630B2 (en) Method and apparatus for correcting USB device drive and matching information
WO2012151978A1 (en) Method and device for recognizing port properties of data card
US11483214B2 (en) Synchronizing data between cloud manager and providers
US9197629B2 (en) Remote direct memory access authentication of a device
US10536456B2 (en) Method and system for identifying user information in social network
CN105511936B (en) Test system, method and device
CN108632271B (en) Identity authentication method and device
WO2019095862A1 (en) Method and device for handling multi-subscriber request
US8447857B2 (en) Transforming HTTP requests into web services trust messages for security processing
CN105068946A (en) Android device identification method and apparatus
CN108810611A (en) The control system and method for Multimedia Fusion terminal start-up course
WO2021169811A1 (en) Method, apparatus, system and device for generating special effects, and storage medium
WO2018068655A1 (en) License management method and system
CN108234174B (en) Management method and device of virtual network function
CN111081258B (en) Voiceprint model management method, system, storage medium and device
CN110798358B (en) Distributed service identification method and device, computer readable medium and electronic equipment
CN111538672A (en) Test case layered test method, computer device and computer-readable storage medium
WO2017000540A1 (en) Data query method and device
US10212036B2 (en) Performance testing method, performance testing apparatus performing the same and storage medium storing the same
CN111291072A (en) Session data extraction method, device, computer system and readable storage medium
US10642907B2 (en) Processing service data
CN113238807A (en) Module compatibility method, platform and server based on android system
CN111092765B (en) Intelligent driving method, system, electronic device and readable storage medium
CN112162797A (en) Data processing method, system, storage medium and electronic device
CN102111446B (en) Device connection handling method, combination equipment and host equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11865109

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11865109

Country of ref document: EP

Kind code of ref document: A1