[go: up one dir, main page]

WO2019041104A1 - 一种通信接口及通信方法 - Google Patents

一种通信接口及通信方法 Download PDF

Info

Publication number
WO2019041104A1
WO2019041104A1 PCT/CN2017/099350 CN2017099350W WO2019041104A1 WO 2019041104 A1 WO2019041104 A1 WO 2019041104A1 CN 2017099350 W CN2017099350 W CN 2017099350W WO 2019041104 A1 WO2019041104 A1 WO 2019041104A1
Authority
WO
WIPO (PCT)
Prior art keywords
module
field
data
communication
function module
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.)
Ceased
Application number
PCT/CN2017/099350
Other languages
English (en)
French (fr)
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.)
Hangzhou Laibu Technology Co Ltd
Original Assignee
Hangzhou Laibu 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 Hangzhou Laibu Technology Co Ltd filed Critical Hangzhou Laibu Technology Co Ltd
Priority to PCT/CN2017/099350 priority Critical patent/WO2019041104A1/zh
Publication of WO2019041104A1 publication Critical patent/WO2019041104A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/725Cordless telephones

Definitions

  • the present invention relates to the field of intelligent terminal communication, and more particularly to a communication interface and a communication method.
  • Intelligent terminals have a wide range of applications in people's daily lives, and they also have more and more functions. For example, smart phones, smart watches, smart glasses, etc., greatly facilitate people's production and life. However, limited to volume, cost, and standardized production, current smart terminals have been limited in hardware structure at the factory, thereby limiting their functions, resulting in limited functionality, and cannot be extended, failing to meet the user's functional expansion requirements and individual needs.
  • the existing intelligent terminal expands the function of the intelligent terminal through the external function module of the interface.
  • a smartphone connects to a bank card swipe device via a USB interface.
  • this method has certain limitations, the number of functional modules that can be connected is limited, and the types of functional modules connected are also limited, which cannot meet the needs of people.
  • the aesthetics are poor after connection, which makes the operation of the intelligent terminal inconvenient.
  • the technical problem to be solved by the present invention is to provide a communication interface and a communication method for the defects of the prior art smart terminal having limited functions and inconvenient expansion interfaces.
  • the technical solution adopted by the present invention to solve the technical problem thereof is: constructing a communication interface, wherein the communication interface is used for connection and communication between a function module and a module platform, and the communication interface is transmitted through a preset data frame.
  • Data the preset data frame includes: a preamble field, a command code field, a sequence number field, a data length field, a data content field, a check code field, where
  • the preamble field is a synchronization header, which is used to indicate a flow direction of the data stream
  • the command code field is a communication command between the function module and the module platform
  • the serial number field is an automatically generated serial number, and the corresponding reply command uses the same serial number;
  • the data content field is a transmission data content;
  • the data length field is a length of the transmitted data content
  • the check code field is used to verify the preset data frame.
  • the communication interface of the present invention includes: a first interface disposed on the function module and a second interface disposed on the module platform, the first interface and The second interfaces are matched;
  • the first interface and the second interface are 8-pin interfaces, including: a first pin VIN, a second pin DET0, a third pin DET1, a fourth bow I foot VOUT, and a fifth bow I GND, sixth pin DM, seventh pin DP, eighth pin GND;
  • the first pin VIN is used for power access of the function module
  • the second bow I foot DET0 and the third pin DET1 are used to classify the function module
  • the fourth pin VOUT is used for a power output of the function module
  • the sixth bow DM and the seventh DP DP are used to transmit data content.
  • the eight pins of the first interface and the second interface are distributed in two rows, four pins in each row, and the pins in each row are equally spaced. Or the eight pins of the first interface and the second interface are distributed in a row;
  • the function module is an empty module or an idle module, and no signal enters or outputs;
  • the function module is a first type of power supply module, and the first type of power supply module needs to supply power to the module platform;
  • the function module is a second type of power supply module, and the second type power supply module needs to supply power to the module platform;
  • the fourth category the function module is a battery or a charging device.
  • the present invention further provides a communication method between a function module and a module frame.
  • the function module uses the above communication interface to connect a module frame, where the module frame is used to connect an intelligent terminal, and the communication protocol used by the communication interface includes : Tuen Mun Agreement, Module Control Protocol, Data Exchange Protocol; [0026]
  • the trick protocol is used for discovery detection of a function module; the module control protocol is used to set a configuration of the function module and a type of adjustment of the function; and the data exchange protocol is used for downloading and uploading data.
  • the function module and the module frame communication method of the present invention the communication between the function module and the module frame includes:
  • S2 after the module framework identifies the type of the functional module, performing power supply and/or connection operations for the functional module;
  • S4 The module framework establishes a communication connection with the function module according to the trick protocol.
  • the communication interface transmits data through a preset data frame, in the preset data frame: a preamble field, a command code field, a sequence number field
  • the data length field and the check code field have a data length of 1 byte, and the data content field has a data length of N bytes, and N is a natural number;
  • the check code field is verified by a BCC check mode.
  • the functional module and the module framework communication method of the present invention are provided with at least one slot for installing the functional module, and the functional module passes one or more of the plugs.
  • a slot is coupled to the module frame.
  • the present invention further provides a communication method between a module framework and an intelligent terminal, using the above communication interface, the smart terminal is installed with a management APP for managing the module framework and the function module;
  • the smart terminal communicates with a module framework, and the module framework communicates with the function module through the communication interface.
  • the communication interface transmits data through a preset data frame, in the preset data frame: a preamble field, a command code field, a serial number
  • the data length of the field, the data length field, and the check code field is 4 bytes, and the data length of the data content field is N bytes, and N is a natural number;
  • the check code field is verified by a CRC check mode.
  • the command code field includes a connection request command field in which the smart terminal initiates a connection to the module framework, a break connection command field in which the smart terminal initiates a disconnection connection to the module frame, and a preset interval issued by the module frame interval Synchronization command field;
  • the smart terminal includes: a smart phone, a smart bracelet, and smart glasses;
  • the smart terminal uses an Android operating system, an IOS operating system, a Windows operating system, and a Linux operating system.
  • a communication interface and communication method embodying the present invention has the following beneficial effects:
  • the communication interface includes: a first interface disposed on the function module and a second interface disposed on the module platform, the first interface and the The two interfaces are matched, and the first interface and the second interface are 8-pin interfaces.
  • the communication interface is used for connection and communication between the function module and the module platform, and the communication interface transmits data through a preset data frame, and the preset data frame includes: a preamble field, a command code field, a sequence number field, a data length field, and a data content. Field, check code field.
  • FIG. 1 is a schematic structural diagram of a communication interface communication function module and a module platform according to the present invention
  • 2a and 2b are pin diagrams of a communication interface of the present invention.
  • FIG. 3 is a schematic diagram of a connection manner between a module platform and a function module according to the present invention.
  • FIG. 4 is a format diagram of a preset data frame of a communication interface for transmitting data according to the present invention
  • FIG. 5 is a schematic diagram of a communication process between a functional module and a module framework of the present invention.
  • FIG. 6 is a schematic flow chart of a communication method between a functional module and a module framework according to the present invention.
  • FIG. 7 is a schematic structural diagram of a system of a module framework and an intelligent terminal according to the present invention.
  • FIG. 8 is a schematic structural diagram of a module frame and an intelligent terminal according to the present invention.
  • FIG. 9 is a schematic diagram of a control structure of a battery module of the present invention.
  • 10 is a schematic view showing a control structure of an air and water module according to the present invention
  • 11 is a schematic diagram of a Bluetooth headset control structure according to the present invention
  • FIG. 12 is a schematic diagram of a control structure of a wristband module according to the present invention.
  • FIG. 1 is a schematic structural diagram of a communication interface communication function module and a module platform according to the present invention.
  • the communication interface of the present invention is used to connect and implement communication between the module platform and the function module.
  • the smart terminal includes, but is not limited to, a smart phone, a smart bracelet, smart glasses, etc.; the smart terminal uses an Android operating system, an IOS operating system, a Windows operating system, a Linux operating system, and the like.
  • Function modules include but are not limited to: battery module, air module, water module, bracelet module, Bluetooth headset module, positioning module, distance detection module, temperature detection module, storage module, NFC module, wireless charging module, etc.
  • the communication interface includes: a first interface disposed on the function module and a second interface disposed on the module platform, and the first interface and the second interface are matched.
  • the module platform may include a plurality of second interfaces, and the module platform connects the first interface of the function modules through each of the second interfaces to implement expansion of one functional module.
  • the first interface and the second interface are 8-pin interfaces, including: a first pin VIN, a second pin DET0, a third pin DET1, a fourth bow 13 but VOUT, a fifth bow 13 But GND, sixth pin DM, seventh pin DP, eighth pin GND.
  • the first pin VIN is used for power access of the function module, and is used for the first type of function module and the second type of function module, and the first type of function module and the second type of function module are divided by the second pin.
  • DET0 and the third pin DET1 are implemented.
  • the second bow I foot DET0 and the third pin DET1 are used to classify the function module according to the second bow
  • the impedance level of DET1 divides the functional modules into four categories:
  • the functional module is an empty module or an idle module, and the module only needs to be plugged into the module platform, and no signal is entered or output.
  • the functional modules are the first type of power supply modules, which require the modular platform to provide electrical characteristics, ie, provide electrical energy and communicate.
  • the module platform is a module frame
  • the module framework is used to connect to the smart terminal, and the second type of function module is directly connected to the module frame for use.
  • the functional module is a second type of power supply module, which requires the modular platform to provide electrical characteristics, that is, to provide electrical energy and to communicate.
  • the module platform is a module framework
  • the module framework is used to connect the smart terminal
  • the second type of function module is directly connected to the smart terminal for use.
  • the third type of function module is a storage module
  • the storage module processes the data through the module framework and then transfers the data to the smart terminal, the data transmission rate is slow, and the requirements of the processor of the module frame are relatively high, resulting in The cost increases. Therefore, such modules need to directly interact with the intelligent terminal for data interaction without intermediate transfer, thereby increasing the data transmission rate.
  • the fourth type of function module is a battery or a charging device, and the battery can be charged by VIN at the same time.
  • the fourth reference 3 but VOUT is used for the power output of the function module
  • the sixth bow I pin DM and the seventh bow I pin DP are used to transmit data content.
  • FIGS. 2a and 2b are diagrams showing the pin structure of a communication interface of the present invention.
  • the eight pins of the first interface correspond to the eight pins of the second interface.
  • the eight pins of the first interface and the second interface are distributed in two rows, four pins in each row, and the pins in each row are equally spaced.
  • the eight pins of the first interface and the second interface are distributed in a row, that is, eight pins are arranged in a row. It can be understood that the distribution of the eight pins of the communication interface can be adaptively adjusted according to the shape and connection position of the functional module and the module platform.
  • FIG. 3 is a schematic diagram of a connection manner between a module platform and a function module according to the present invention.
  • a plurality of second interfaces are disposed on the module platform, and each second interface corresponds to a slot for installing the function module, the slots are arranged in parallel, and the function module passes through one or more slots and the module frame connection.
  • the function module is inserted into the slot, and the second interface of the module platform is connected through the first interface thereof, thereby implementing connection with the module platform.
  • the function module can be a slot to plug in a function module, also It can be a module that occupies multiple slots.
  • the module platform is provided with four second interfaces, corresponding to four slots, which may be a single-slot function module corresponding to one slot of a function module, or a function module corresponding to two slots.
  • the two-in-one interface can also be a four-in-one interface with one function module corresponding to four slots. It can be understood that when one module corresponds to multiple slots, the first interface may be one or more.
  • the functional modules in the present invention may be a single function or a plurality of functions, and may be combined as needed. If it is a single function module, only one first interface is required; if it is a multi-function module, there may be multiple first interfaces.
  • FIG. 4 is a block diagram of a preset data frame format for transmitting data of a communication interface according to the present invention.
  • the communication interface is used for connection and communication between the function module and the module platform, and the communication interface transmits data through a preset data frame, where the preset data frame includes: a preamble field (preamble), a command code field (command field) ), serial number field (serial number), data length field (data length), data content field (data), check code field (checksum);
  • the preamble field is a synchronization header, which is used to indicate the flow direction of the data stream, and its byte is fixed.
  • the command code field is a communication command between the function module and the module platform.
  • the present invention sets a command list, which is stored in the function module and the module platform for encoding and decoding.
  • the serial number field is a serial number automatically generated by a system composed of a module platform and a function module, and the corresponding reply command uses the same serial number, and only the initiator has the serial number generated by the system.
  • the data content field is a transmission data content, where the transmission data content includes commands and data sent by the module platform to the function module, and collected data sent by the function module to the module platform. For example, temperature data, positioning information, etc. collected by the function module.
  • the data length field is the length of the data content to be transmitted, and the length of the data content can be set as needed, and can satisfy the data transmission requirement; for example, 255 bytes, 1024 bytes, and the like.
  • the check code field is used to verify the preset data frame. After the transmission of the preset data frame is completed, it is necessary to detect whether the data frame has an error during transmission and to perform data correction by verification.
  • the present invention does not limit the manner of data verification, and can perform data verification. For example, use CRC check (C Yclic Redundancy Check, Cyclic Redundancy Check Code) or BCC Check Character
  • FIG. 5 is a schematic diagram of a communication process between a functional module and a module framework of the present invention.
  • the function module uses the communication interface to connect to the module framework, and the module framework is used to connect the smart terminal.
  • the communication protocol used by the communication interface includes: a trick protocol, a module control protocol, and a data exchange protocol.
  • the trick protocol is used for discovery detection of function modules.
  • the data of the trick protocol is defined as: Data type (1 byte) + Data mode supported by the module (1 byte) + 2 bytes (extended).
  • the Tuen Mun Agreement is shown in Table 1:
  • a module control protocol is used to set the configuration of the function module and the type of the command to be adjusted
  • a data exchange protocol is used for downloading and uploading data.
  • FIG. 6 is a schematic flow chart of a communication method between a functional module and a module framework according to the present invention.
  • the function module of the present invention and the module framework communication method, the module interface and the function module adopt the HID (Human Interface Device) protocol as the underlying communication basic protocol, and the application data packet adopts the preset data frame.
  • the communication between the function module and the module framework includes the following steps:
  • S1 after the function module is plugged into the module frame, the module frame performs module type identification on the function module, and During the identification process, the module framework does not supply power to the functional modules;
  • S2 after the module frame identifies the type of the function module, powering and/or connecting the function module;
  • S4 The module framework establishes a communication connection with the function module according to the trick protocol.
  • the communication interface for the command frame and the function module transmits data by using a preset data frame
  • the length of the preset data frame is not more than 260 bytes
  • the small end mode is adopted.
  • the data length of the preamble field, the command code field, the sequence number field, the data length field, and the check code field is 1 byte
  • the data length of the data content field is N bytes, where N is Natural number.
  • the preamble field is a synchronization header, which is used to indicate the flow direction of the data stream, and its byte is fixed.
  • the command code field is a communication command between the function module and the module framework.
  • the present invention sets a command list, which is stored in the function module and the module frame, respectively, for encoding and decoding.
  • the serial number field is a serial number automatically generated by a system composed of a module framework and a function module, and the corresponding reply command uses the same serial number, and only the initiator has the serial number generated by the system.
  • the data content field is a transmission data content, which includes commands and data sent by the module framework to the function module, and collected data sent by the function module to the module framework. For example, temperature data, positioning information, etc. collected by the function module.
  • the data length field is the length of the transmitted data content, and is up to 255 bytes.
  • the check code field is used to verify the preset data frame. After the transmission of the preset data frame is completed, it is necessary to detect whether the data frame has an error during transmission and to perform data correction by verification.
  • the verification code field is verified by the BCC check method.
  • the air module needs to report the trick protocol after power-on, and the data in the trick protocol is as defined above.
  • the air module uses the command code of the Internet of Things module, and all command codes are defined between 0X10 and 0X1F.
  • the late increase command ⁇ specifies the value of the corresponding command in this interval.
  • Command Name Get current air indicator data.
  • Command code value 0X10.
  • Command Description Obtain the air module data values of the air module.
  • Application scenario The framework communicates with the air module through this instruction to obtain the air related data.
  • Air return data Little endian 4 bytes of air data, or OxFFFFxxxx, where OxFFFF indicates an error return and XXXX indicates an error code.
  • the wristband module needs to report the trick protocol after power-on, and the data in the trick protocol is as defined above.
  • All the command codes of the bracelet module are defined between 0X20 and 0X2F, and the later increase command ⁇ specifies the value of the corresponding command in this area.
  • Command code value 0X20.
  • Air return data The length is returned by the module, error ⁇ returns 4 bytes OxFFFFxxxx, where OxFFFF indicates an error return and XXXX indicates an error code.
  • FIG. 7 is a schematic structural diagram of a system of a module framework and an intelligent terminal according to the present invention.
  • the function module establishes a connection and communicates with the module framework through the communication interface of the present invention, and the module frame connects to the intelligent terminal and communicates.
  • the smart terminal is a smart phone
  • the module frame is a mobile phone back shell.
  • the above communication interface is used between the function module and the module framework, and the management terminal is provided with a management APP for managing the module framework and the function module.
  • the intelligent terminal communicates with the module framework, and the module framework communicates with the function module through the communication interface.
  • the communication interface transmits data through a preset data frame, in a preset data frame: a preamble field, a command code field, a sequence number field, a data length field, And the data length of the check code field is 4 bytes, the data length of the data content field is N bytes, and N is a natural number.
  • the preamble field is a synchronization header, which is used to indicate the flow direction of the data stream, and its byte is fixed.
  • the command code field is a communication command between the function module and the module framework.
  • the present invention is provided with a command list, which is stored in the function module, the module framework, and the intelligent terminal, respectively, for encoding and decoding. .
  • the sequence number field is an automatically generated sequence of a system composed of a smart terminal, a module framework, and a function module. No. The corresponding reply command uses the same serial number. Only the initiator has the system generated serial number.
  • the data content field is a transmission data content, which includes commands and data sent by the module platform to the function module, and collected data sent by the function module to the module platform. For example, temperature data, positioning information, etc. collected by the function module.
  • the data length field is the length of the transmitted data content, and the length of the data content is not more than 1024 bytes. Preferably, if the data length is greater than 1024 bytes, a framing connection is used.
  • the check code field is used to check the preset data frame. After the transmission of the preset data frame is completed, it is necessary to detect whether the data frame has an error during transmission and to perform data correction by verification. The check code field is verified by the CRC check method.
  • the command code field includes: a connection request command field in which the smart terminal initiates a connection to the module framework, for example, after the android host detects the module framework, and the module framework responds, the subsequent service query can be extended, the field The value is 0x4E584E43.
  • the smart terminal initiates a disconnection connection command field of the disconnection connection to the module framework; for example, the android host is to be triggered after the module framework is broken, and the subsequent command field cannot be transmitted after the module framework rings, the value of the field is 0x45534C43, or the module is detected. After the frame is unplugged, it is automatically in the CLOSE state.
  • the synchronization command field issued by the module frame interval is preset, for example, automatically initiated by the framework every 5 seconds. The value of this field is 0x434E5953. If the field is not received, it indicates that the connection is abnormal.
  • FIG. 8 is a schematic structural diagram of a module frame and an intelligent terminal according to the present invention.
  • Command Word Description This protocol mainly describes the control method of module frame access detection and frame power acquisition.
  • Command word structure As shown in Table 7, respectively, corresponding to frame access, frame break, and power acquisition:
  • Intelligent terminal reply As shown in Table 8, the frame access, frame break, and power acquisition are respectively performed.
  • FIG. 9 is a schematic diagram of a control structure of a battery module of the present invention.
  • Command Word Name Battery Control Protocol.
  • Command Word Description This protocol mainly describes the charging/uncharging control of the battery module, and the manner in which the power is acquired.
  • Command word structure As shown in Table 9, respectively, the battery is charged, not charged, and the power is obtained.
  • Intelligent terminal reply As shown in Table 10, the battery is charged, not charged, and the power is obtained.
  • the user mainly controls the use of the battery module.
  • the battery module can be controlled to charge the module frame; or when the smart terminal (such as a mobile phone) has insufficient power, the battery module can be controlled.
  • the smart terminal is charged.
  • Command Word Name U disk control protocol.
  • Command word description This protocol mainly describes U disk online monitoring, U disk password input, U disk read and write control methods.
  • Command word structure as shown in Table 11, respectively, corresponding to U disk detection, U disk password matching, U disk data reading and writing.
  • Intelligent terminal reply As shown in Table 12, corresponding to U disk detection, U disk password matching, U disk data reading and writing.
  • Usage scenario Here, the user mainly interacts with the U disk module.
  • the frame is inserted into the U disk, the user is prompted to insert a large-capacity storage device, and the user performs corresponding operations.
  • the U disk password is matched with the background, and the U disk data is read and written. This is placed in the cloud, and the user controls by sending corresponding commands.
  • Command Word Name Air, Water Sensor Control Protocol.
  • Command Word Description This protocol mainly describes the online detection of air and water sensor modules, as well as the way in which data and all data are acquired.
  • Command word structure As shown in Table 13, respectively, the module detects, acquires data once, and summarizes data.
  • Intelligent terminal reply as shown in Table 14, respectively, corresponding module detection, acquisition of data, data summary
  • FIG. 11 is a schematic diagram of a Bluetooth headset control structure according to the present invention.
  • Command Word Name Bluetooth Headset Control Protocol.
  • Command Word Description This protocol mainly describes the online detection of Bluetooth headset module, the charging mode of headset charging and non-charging.
  • Command word structure as shown in Table 15, respectively, module detection, module charging, no charging
  • FIG. 12 is a schematic diagram of a control structure of a wristband module of the present invention.
  • Command Word Description This protocol mainly describes the control method of the wristband module online detection, wristband data acquisition, wristband charging and non-charging.
  • Command word structure as shown in Table 17, respectively, module detection, charging, no charging, and data reading.
  • Intelligent terminal reply As shown in Table 18, the module detects, charges, does not charge, and reads data respectively.
  • Usage scenario Here is mainly the interaction between the smart terminal and the wristband module.
  • the module framework can detect the existence of the wristband, and then the smart terminal can control the framework to charge the wristband, and the smart terminal needs the wristband. After the data, you can send an instruction to read the data.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本发明涉及一种通信接口及通信方法。该通信接口包括:设置在功能模块上的第一接口和设置在模块平台上的第二接口,第一接口和第二接口相匹配,第一接口和第二接口为8引脚接口。该通信接口用于功能模块与模块平台之间的连接与通信,通信接口通过预设数据帧传输数据,预设数据帧包括:前导字段、命令码字段、序列号字段、数据长度字段、数据内容字段、检验码字段。通过实施本发明,可实现功能模块的热插接、识别、接驳、通信,方便智能终端的功能扩展,满足用户个性化需求。

Description

一种通信接口及通信方法 技术领域
[0001] 本发明涉及智能终端通信领域, 更具体地说, 涉及一种通信接口及通信方法。
背景技术
[0002] 智能终端在人们的日常生活中有着广泛的应用, 也具有越来越多的功能。 例如 , 智能手机、 智能手表、 智能眼镜等, 极大的方便了人们的生产生活。 但是, 限于体积、 成本以及标准化生产, 目前的智能终端在出厂吋已限定硬件结构, 从而限制其功能, 导致功能有限, 且不能拓展, 不能满足用户的功能扩展需求 以及个性化需求。
[0003] 目前, 为使智能终端具有更多的功能, 已有智能终端通过自带的接口外界功能 模块, 来扩展智能终端的功能。 例如, 智能手机通过 USB接口连接银行卡刷卡设 备。 但这种方式具有一定局限性, 能够连接功能模块的数量有限, 且连接的功 能模块的种类也有限制, 不能满足人们的需求。 并且, 连接后美观性差, 使智 能终端的操作也不方便。
技术问题
[0004] 本发明要解决的技术问题在于, 针对现有技术的上述智能终端功能有限, 扩展 接口不方便的缺陷, 提供一种通信接口及通信方法。
问题的解决方案
技术解决方案
[0005] 本发明解决其技术问题所采用的技术方案是: 构造一种通信接口, 所述通信接 口用于功能模块与模块平台之间的连接与通信, 所述通信接口通过预设数据帧 传输数据, 所述预设数据帧包括: 前导字段、 命令码字段、 序列号字段、 数据 长度字段、 数据内容字段、 检验码字段; 其中,
[0006] 所述前导字段为同步头, 用于标明数据流的流动方向;
[0007] 所述命令码字段为所述功能模块和模块平台之间的通信命令;
[0008] 所述序列号字段为自动生成的序列号, 对应的回复命令采用同样的序列号; [0009] 所述数据内容字段为传输数据内容;
[0010] 所述数据长度字段为所述传输数据内容的长度;
[0011] 所述检验码字段用于对所述预设数据帧进行校验。
[0012] 优选地, 本发明所述的通信接口, 所述通信接口包括: 设置在所述功能模块上 的第一接口和设置在所述模块平台上的第二接口, 所述第一接口和所述第二接 口相匹配;
[0013] 所述第一接口和第二接口为 8引脚接口, 包括: 第一引脚 VIN、 第二引脚 DET0 、 第三引脚 DET1、 第四弓 I脚 VOUT、 第五弓 I脚 GND、 第六引脚 DM、 第七引脚 D P、 第八引脚 GND;
[0014] 所述第一引脚 VIN用于所述功能模块的电源接入;
[0015] 所述第二弓 I脚 DET0和第三引脚 DET1用于对所述功能模块进行分类;
[0016] 所述第四引脚 VOUT用于所述功能模块的电源输出;
[0017] 所述第五弓 I脚 GND和第八弓 I脚 GND接地;
[0018] 所述第六弓 I脚 DM和第七弓 I脚 DP用于传输数据内容。
[0019] 优选地, 本发明所述的通信接口, 所述第一接口和第二接口的 8个引脚成两排 分布, 每排四个引脚, 每排内的引脚之间间隔相等; 或所述第一接口和第二接 口的 8个引脚成一排分布;
[0020] 根据所述第二弓 I脚 DET0和第三引脚 DET1的阻抗高低将所述功能模块分为四类
[0021] 第一类: 所述功能模块为空模块或闲置模块, 无信号进入或输出;
[0022] 第二类: 所述功能模块为第一类供电模块, 所述第一类供电模块需所述模块平 台供电;
[0023] 第三类: 所述功能模块为第二类供电模块, 所述第二类供电模块需所述模块平 台供电;
[0024] 第四类: 所述功能模块为电池或充电设备。
[0025] 另, 本发明还提供一种功能模块与模块框架的通信方法, 功能模块使用上述的 通信接口连接模块框架, 所述模块框架用于连接智能终端, 所述通信接口使用 的通信协议包括: 叩门协议、 模块控制协议、 数据交换协议; [0026] 所述叩门协议用于功能模块的发现探测; 所述模块控制协议用于设置所述功能 模块的配置及调节的命令类型; 所述数据交换协议用于数据的下载和上传。
[0027] 优选地, 本发明所述的功能模块与模块框架通信方法, 所述功能模块与模块框 架之间的通信包括:
[0028] S1 : 所述功能模块插接在所述模块框架后, 所述模块框架对所述功能模块进行 模块类型识别, 且在识别过程中, 所述模块框架不为所述功能模块供电;
[0029] S2: 所述模块框架识别所述功能模块的类型后, 为所述功能模块进行供电和 / 或接驳操作;
[0030] S3: 所述功能模块发送所述叩门协议至所述模块框架;
[0031] S4: 所述模块框架根据所述叩门协议与所述功能模块建立通信连接。
[0032] 优选地, 本发明所述的功能模块与模块框架通信方法, 所述通信接口通过预设 数据帧传输数据, 在所述预设数据帧中: 前导字段、 命令码字段、 序列号字段 、 数据长度字段、 以及检验码字段的数据长度为 1字节, 数据内容字段的数据长 度为 N字节, N为自然数;
[0033] 所述检验码字段通过 BCC校验方式进行校验。
[0034] 优选地, 本发明所述的功能模块与模块框架通信方法, 所述模块框架设置有至 少一个用于安装所述功能模块的插槽, 所述功能模块通过一个或多个所述插槽 与所述模块框架连接。
[0035] 另本发明还提供一种模块框架与智能终端的通信方法, 使用上述的通信接口, 智能终端安装有用于管理模块框架和功能模块的管理 APP;
[0036] 所述智能终端与模块框架进行通信, 所述模块框架通过所述通信接口与所述功 能模块进行通信。
[0037] 优选地, 本发明所述的模块框架与智能终端的通信方法, 所述通信接口通过预 设数据帧传输数据, 在所述预设数据帧中: 前导字段、 命令码字段、 序列号字 段、 数据长度字段、 以及检验码字段的数据长度为 4字节, 数据内容字段的数据 长度为 N字节, N为自然数;
[0038] 所述检验码字段通过 CRC校验方式进行校验。
[0039] 优选地, 本发明所述的模块框架与智能终端的通信方法, 所述命令码字段包括 : 所述智能终端向所述模块框架发起连接的连接请求命令字段、 所述智能终端 向所述模块框架发起断幵连接的断幵连接命令字段、 由所述模块框架间隔预设 吋间发出的同步命令字段;
[0040] 所述智能终端包括: 智能手机、 智能手环、 智能眼镜;
[0041] 所述智能终端使用 Android操作系统、 IOS操作系统、 Windows操作系统、 Linux 操作系统。
发明的有益效果
有益效果
[0042] 实施本发明的一种通信接口及通信方法, 具有以下有益效果: 该通信接口包括 : 设置在功能模块上的第一接口和设置在模块平台上的第二接口, 第一接口和 第二接口相匹配, 第一接口和第二接口为 8引脚接口。 该通信接口用于功能模块 与模块平台之间的连接与通信, 通信接口通过预设数据帧传输数据, 预设数据 帧包括: 前导字段、 命令码字段、 序列号字段、 数据长度字段、 数据内容字段 、 检验码字段。 通过实施本发明, 实现功能模块的插接、 识别、 接驳、 通信, 方便智能终端的功能扩展, 满足用户个性化需求。
对附图的简要说明
附图说明
[0043] 下面将结合附图及实施例对本发明作进一步说明, 附图中:
[0044] 图 1是本发明通信接口连通功能模块和模块平台的结构示意图;
[0045] 图 2a和图 2b是本发明一种通信接口的引脚结构图;
[0046] 图 3是本发明模块平台与功能模块的连接方式示意图;
[0047] 图 4是本发明一种通信接口传输数据的预设数据帧格式图;
[0048] 图 5是本发明功能模块与模块框架的通信过程示意图;
[0049] 图 6是本发明功能模块与模块框架通信方法流程示意图;
[0050] 图 7是本发明一种模块框架与智能终端的系统结构示意图;
[0051] 图 8是本发明模块框架与智能终端的结构示意图;
[0052] 图 9是本发明电池模块控制结构示意图;
[0053] 图 10是本发明空气、 水模块控制结构示意图; [0054] 图 11为本发明蓝牙耳机控制结构示意图;
[0055] 图 12为本发明手环模块控制结构示意图。
实施该发明的最佳实施例
本发明的最佳实施方式
[0056] 为了对本发明的技术特征、 目的和效果有更加清楚的理解, 现对照附图详细说 明本发明的具体实施方式。
[0057] 图 1是本发明通信接口连通功能模块和模块平台的结构示意图。
[0058] 具体的, 本发明的通信接口用于连接并实现模块平台和功能模块之间的通信。
优选地, 智能终端包括但不限于智能手机、 智能手环、 智能眼镜等; 智能终端 使用 Android操作系统、 IOS操作系统、 Windows操作系统、 Linux操作系统等。 功能模块包括但不限于: 电池模块、 空气模块、 水模块、 手环模块、 蓝牙耳机 模块、 定位模块、 距离检测模块、 温度检测模块、 存储模块、 NFC模块、 无线充 电模块等。
[0059] 该通信接口包括: 设置在功能模块上的第一接口和设置在模块平台上的第二接 口, 且第一接口和第二接口相匹配。 模块平台可包括多个第二接口, 模块平台 通过每个第二接口连接功能模块的第一接口, 实现一个功能模块的扩展。
[0060] 作为选择, 第一接口和第二接口为 8引脚接口, 包括: 第一引脚 VIN、 第二引 脚 DET0、 第三引脚 DET1、 第四弓 13却 VOUT、 第五弓 13却 GND、 第六引脚 DM、 第 七引脚 DP、 第八引脚 GND。 以下对每个引脚的功能进行限定:
[0061] 第一引脚 VIN用于功能模块的电源接入, 用于第一类功能模块和第二类功能模 块使用, 第一类功能模块和第二类功能模块的划分通过第二引脚 DET0和第三引 脚 DET1实现。
[0062] 第二弓 I脚 DET0和第三引脚 DET1用于对功能模块进行分类, 根据第二弓 |脚 DET
0和第三引脚 DET1的阻抗高低将功能模块分为四类:
[0063] 第一类功能模块: 功能模块为空模块或闲置模块, 该类模块只需插接在模块平 台上, 无信号进入或输出。
[0064] 第二类功能模块: 功能模块为第一类供电模块, 该类模块需要模块平台为其提 供电气特性, 即提供电能和进行通信。 优选地, 如果模块平台为模块框架, 而 该模块框架用于连接智能终端, 则第二类功能模块直接接驳到模块框架上使用
[0065] 第三类功能模块: 功能模块为第二类供电模块, 该类模块需要模块平台为其提 供电气特性, 即提供电能和进行通信。 优选地, 如果模块平台为模块框架, 而 该模块框架用于连接智能终端, 则第二类功能模块直接接驳到智能终端上使用 。 例如, 第三类功能模块为存储模块, 则该存储模块如果将数据通过模块框架 处理后再转给智能终端, 会导致数据传输速率较慢, 且对模块框架的处理器的 要求比较高, 导致成本上升, 所以, 此类模块需直接和智能终端进行数据交互 , 不需要中间转接, 从而提高数据传输速率。
[0066] 第四类功能模块: 功能模块为电池或充电设备, 同吋可通过 VIN来给电池充电
[0067] 第四引 3却 VOUT用于功能模块的电源输出;
[0068] 第五弓 I脚 GND和第八弓 I脚 GND接地;
[0069] 第六弓 I脚 DM和第七弓 I脚 DP用于传输数据内容。
[0070] 可以理解的, 上述通信接口的 8个引脚的排列顺序可根据需要进行调整, 本发 明对此不做限定, 其引脚数量和功能与本发明相同的, 都属于本发明的保护范 围。
[0071] 图 2a和图 2b是本发明一种通信接口的引脚结构图。
[0072] 具体的, 该图 2a中, 第一接口的 8个引脚和第二接口的 8个引脚相对应。 第一接 口和第二接口的 8个引脚成两排分布, 每排四个引脚, 每排内的引脚之间间隔相 等。 或, 在图 2b中, 第一接口和第二接口的 8个引脚成一排分布, 即 8个引脚成 一排排列。 可以理解, 该通信接口的 8个引脚的分布可根据功能模块和模块平台 的形状和连接位置进行适应性调整。
[0073] 图 3是本发明模块平台与功能模块的连接方式示意图。
[0074] 具体的, 模块平台上设置多个第二接口, 每个第二接口对应一个用于安装功能 模块的插槽, 插槽成平行设置, 功能模块通过一个或多个插槽与模块框架连接 。 功能模块插入插槽中, 通过其第一接口连接模块平台的第二接口, 从而实现 与模块平台的连接。 可选的, 功能模块可以是一个插槽插接一个功能模块, 也 可以是一个模块占用多个插槽。 例如图 3中, 模块平台设置有四个第二接口, 对 应有四个插槽, 可以是一个功能模块对应一个插槽的单插槽功能模块, 也可以 是一个功能模块对应两个插槽的二合一接口, 还可以是一个功能模块对应四个 插槽的四合一接口。 可以理解的, 当一个模块对应多个插槽吋, 其第一接口可 为一个或多个。
[0075] 作为选择, 本发明中的功能模块可为单一功能或多种功能, 可根据需要进行组 合。 如果是单一功能模块, 则仅需要一个第一接口; 如果是多功能模块, 则可 有多个第一接口。
[0076] 图 4是本发明一种通信接口传输数据的预设数据帧格式图。
[0077] 具体的, 通信接口用于功能模块与模块平台之间的连接与通信, 通信接口通过 预设数据帧传输数据, 预设数据帧包括: 前导字段 (前导) 、 命令码字段 (命 令字段) 、 序列号字段 (序号) 、 数据长度字段 (数据长度) 、 数据内容字段 (数据) 、 检验码字段 (校验和) ; 其中,
[0078] 前导字段为同步头, 用于标明数据流的流动方向, 其字节固定, 传输方式有两 种: 一种是模块平台向功能模块发起, 另一种是功能模块向模块平台发起。
[0079] 命令码字段为功能模块和模块平台之间的通信命令, 作为通信命令, 本发明设 置有命令列表, 该命令列表分别存储于功能模块和模块平台中, 供编码和解码 使用。
[0080] 序列号字段为模块平台和功能模块组成的系统自动生成的序列号, 对应的回复 命令采用同样的序列号, 只有发起者才拥有系统生成的序列号。
[0081] 数据内容字段为传输数据内容, 该传输数据内容包括模块平台向功能模块发送 的命令和数据、 以及功能模块向模块平台发送的采集数据。 例如, 功能模块采 集的温度数据、 定位信息等。
[0082] 数据长度字段为传输数据内容的长度, 数据内容的长度可根据需要进行设置, 能够满足数据传输要求即可; 例如, 255字节、 1024字节等。
[0083] 检验码字段用于对预设数据帧进行校验。 在预设数据帧传输完成后, 需要检测 该数据帧在传输过程中是否出现错误、 以及通过校验进行数据修正。 本发明不 对数据校验的方式进行限定, 能够进行数据校验即可。 例如, 使用 CRC校验 (C yclic Redundancy Check, 循环冗余校验码) 或 BCC校验 (Block Check Character
, 信息组校验码) 。
[0084] 图 5是本发明功能模块与模块框架的通信过程示意图。
[0085] 具体的, 功能模块使用上述的通信接口连接模块框架, 模块框架用于连接智能 终端, 通信接口使用的通信协议包括: 叩门协议、 模块控制协议、 数据交换协 议。
[0086] 叩门协议用于功能模块的发现探测, 叩门协议的数据定义为: 数据类型 (1字 节) +模块支持的数据模式 (1字节) +2字节 (扩展) 。 例如, 叩门协议如表 1所 示:
[0087] 表 1
[] [表 1]
Figure imgf000010_0001
[0090] 模块控制协议用于设置功能模块的配置及调节的命令类型;
[0091] 数据交换协议用于数据的下载和上传。
[0092] 图 6是本发明功能模块与模块框架通信方法流程示意图。
[0093] 具体的, 本发明的功能模块与模块框架通信方法, 模块框架与功能模块之间采 用 HID (Human Interface Device) 协议作为底层通讯基础协议, 应用数据包采用 预设数据帧。 功能模块与模块框架之间的通信包括以下步骤:
[0094] S1 : 功能模块插接在模块框架后, 模块框架对功能模块进行模块类型识别, 且 在识别过程中, 模块框架不为功能模块供电;
[0095] S2: 模块框架识别功能模块的类型后, 为功能模块进行供电和 /或接驳操作;
[0096] S3: 功能模块发送叩门协议至模块框架;
[0097] S4: 模块框架根据叩门协议与功能模块建立通信连接。
[0098] 优选地, 用于命令框架和功能模块的通信接口通过预设数据帧传输数据, 该预 设数据帧的长度不大于 260字节, 采用小端模式。 具体的, 在预设数据帧中: 前 导字段、 命令码字段、 序列号字段、 数据长度字段、 以及检验码字段的数据长 度为 1字节, 数据内容字段的数据长度为 N字节, N为自然数。
[0099] 前导字段为同步头, 用于标明数据流的流动方向, 其字节固定, 传输方式有两 种: 一种是模块框架向功能模块发起, 另一种是功能模块向模块框架发起。
[0100] 命令码字段为功能模块和模块框架之间的通信命令, 作为通信命令, 本发明设 置有命令列表, 该命令列表分别存储于功能模块和模块框架中, 供编码和解码 使用。
[0101] 序列号字段为模块框架和功能模块组成的系统自动生成的序列号, 对应的回复 命令采用同样的序列号, 只有发起者才拥有系统生成的序列号。
[0102] 数据内容字段为传输数据内容, 该传输数据内容包括模块框架向功能模块发送 的命令和数据、 以及功能模块向模块框架发送的采集数据。 例如, 功能模块采 集的温度数据、 定位信息等。
[0103] 数据长度字段为传输数据内容的长度, 最长为 255字节。
[0104] 检验码字段用于对预设数据帧进行校验。 在预设数据帧传输完成后, 需要检测 该数据帧在传输过程中是否出现错误、 以及通过校验进行数据修正。 检验码字 段通过 BCC校验方式进行校验。
[0105] 以下通过空气模块和手环模块对上述原理进行进一步说明。
[0106] 对于空气模块, 该空气模块在上电后需要上报叩门协议, 叩门协议中数据如上 定义。
[0107] 空气模块采用物联网模块的命令码, 所有的命令码定义在 0X10-0X1F之间的值
, 后期增加命令吋在此区间规定相应命令的值。
[0108] 命令名称: 获取当前空气指标数据。 [0109] 命令码值: 0X10。
[0110] 命令描述: 获取空气模块此吋空气各指标数据值。
[0111] 应用场景:框架通过此指令与空气模块通信, 获取此吋空气相关数据。
[0112] 获取数据格式如表 3所示:
[0113] 表 3
[] [表 3]
Figure imgf000012_0001
[0114] 返回数据格式如表 4所示:
[0115] 表 4
[] [表 4]
Figure imgf000012_0002
[0116] 数据格式定义:
[0117] 空气返回数据: 小端 4字节空气数据, 或者 OxFFFFxxxx, 其中 OxFFFF表明是错 误返回, XXXX表明错误码。
[0118] 对于手环模块, 该手环模块在上电后需要上报叩门协议, 叩门协议中数据如上 定义。
[0119] 将手环模块所有的命令码定义在 0X20~0X2F之间的值, 后期增加命令吋在此区 间规定相应命令的值。
[0120] 命令名称: 获取手环数据。
[0121] 命令码值: 0X20。
[0122] 命令描述: 获取手环模块的数据。
[0123] 应用场景:框架通过此指令下载手环的所有数据。
[0124] 获取数据格式如表 5所示:
[0125] 表 5
[] [表 5]
Figure imgf000013_0001
[0126] 返回数据格式图表 6所示:
[0127] 表 6
[] [表 6]
Figure imgf000013_0002
[0128] 数据格式定义:
[0129] 空气返回数据: 长度由模块返回, 错误吋返回 4字节 OxFFFFxxxx, 其中 OxFFFF 表明是错误返回, XXXX表明错误码。
[0130] 图 7是本发明一种模块框架与智能终端的系统结构示意图。
[0131] 具体的, 功能模块通过本发明的通信接口与模块框架建立连接并通信, 模块框 架连接智能终端并通信。 例如, 智能终端为智能手机, 模块框架为手机背壳。 功能模块和模块框架之间使用上述的通信接口, 智能终端安装有用于管理模块 框架和功能模块的管理 APP。
[0132] 智能终端与模块框架进行通信, 模块框架通过通信接口与功能模块进行通信。
[0133] 优选地, 本发明的模块框架与智能终端的通信方法, 通信接口通过预设数据帧 传输数据, 在预设数据帧中: 前导字段、 命令码字段、 序列号字段、 数据长度 字段、 以及检验码字段的数据长度为 4字节, 数据内容字段的数据长度为 N字节 , N为自然数。
[0134] 前导字段为同步头, 用于标明数据流的流动方向, 其字节固定, 传输方式有两 种: 一种是模块框架向智能终端发起, 另一种是智能终端向模块框架发起。
[0135] 命令码字段为功能模块和模块框架之间的通信命令, 作为通信命令, 本发明设 置有命令列表, 该命令列表分别存储于功能模块、 模块框架和智能终端中, 供 编码和解码使用。
[0136] 序列号字段为智能终端、 模块框架、 以及功能模块组成的系统自动生成的序列 号, 对应的回复命令采用同样的序列号, 只有发起者才拥有系统生成的序列号
[0137] 数据内容字段为传输数据内容, 该传输数据内容包括模块平台向功能模块发送 的命令和数据、 以及功能模块向模块平台发送的采集数据。 例如, 功能模块采 集的温度数据、 定位信息等。
[0138] 数据长度字段为传输数据内容的长度, 数据内容的长度不大于 1024字节。 优选 地, 如果数据长度大于 1024字节, 则采用分帧连接即可。
[0139] 检验码字段用于对预设数据帧进行校验。 在预设数据帧传输完成后, 需要检测 该数据帧在传输过程中是否出现错误、 以及通过校验进行数据修正。 检验码字 段通过 CRC校验方式进行校验。
[0140] 优选地, 命令码字段包括: 智能终端向模块框架发起连接的连接请求命令字段 , 例如, android主机检测到模块框架后发起, 等模块框架响应后才能幵展后续 业务査询, 该字段值为 0x4E584E43。 智能终端向模块框架发起断幵连接的断幵 连接命令字段; 例如, android主机要断幵模块框架后发起, 等模块框架响后就 不能传输后续命令字段, 该字段值为 0x45534C43, 或检测到模块框架拔掉后, 自动为 CLOSE状态。 由模块框架间隔预设吋间发出的同步命令字段, 例如, 由 框架自动定吋每 5秒发起, 该字段值为 0x434E5953, 如未收到该字段就表示连接 有异常。
[0141] 以下通过实施例对智能终端、 模块框架、 以及功能模块组成的系统进行详细说 明。
[0142] 图 8是本发明模块框架与智能终端的结构示意图。
[0143] 命令字名称: 模块框架控制协议。
[0144] 命令字描述: 该协议主要描述模块框架接入检测、 框架电量获取的控制方式。
[0145] 命令字结构: 如表 7所示, 分别对应框架接入、 框架断幵、 电量获取:
[0146] 表 7
[] [表 7]
Figure imgf000015_0001
[0147] 智能终端回复: 如表 8所示, 分别对应框架接入、 框架断幵、 电量获取。
[0148] 表 8
[] 幽
Figure imgf000015_0002
[0149] 使用场景: 用户幵始将模块框架接入智能终端 (例如手机) 的吋候, 需要与智 能终端进行连接判断。 或者用户从智能终端取下模块框架的吋候, 需要与智能 终端进行断幵判断。 另外, 用户想知道模块框架电量是否充足, 如不充足, 可 以进行充电的操作。
[0150] 图 9是本发明电池模块控制结构示意图。
[0151] 命令字名称: 电池控制协议。
[0152] 命令字描述: 该协议主要描述电池模块的充电 /不充电控制, 以及电量获取的 方式。 [0153] 命令字结构: 如表 9,分别对应电池充电、 不充电、 获取电量。
[0154] 表 9
[] 幽
Figure imgf000016_0001
[0155] 智能终端回复: 如表 10, 分别对应电池充电、 不充电、 获取电量。
[0156] 表 10
[] [表 10]
Figure imgf000016_0002
[0157] 使用场景: 这里主要是用户控制电池模块的使用, 当模块框架电量不足吋, 可 以控制电池模块对模块框架进行充电; 或者当智能终端 (例如手机) 电量不足 吋, 可以控制电池模块对智能终端进充电。 另外还可以获取电池模块的电量, 每次只需要将电池模块进行充电就行。
[0158] 关于 U盘控制协议。
[0159] 命令字名称: U盘控制协议。 [0160] 命令字描述: 该协议主要描述 U盘在线监测, U盘密码输入, U盘读写等控制方 式。
[0161] 命令字结构: 如表 11, 分别对应 U盘检测、 U盘密码匹配、 U盘数据读写。
[0162] 表 11
[] [表 11]
Figure imgf000017_0001
[0163] 智能终端回复: 如表 12, 分别对应 U盘检测、 U盘密码匹配、 U盘数据读写。
[0164] 表 12
[] [表 12]
Figure imgf000017_0002
[0165] 使用场景: 这里主要是用户与 U盘模块进行交互, 当框架插入 U盘吋, 会提示 用户有大容量存储设备插入, 用户则进行相应的操作。 U盘密码与后台进行匹配 , 以及 U盘数据的读写这个都是放在云端, 用户通过发送相应的指令进行控制。
[0166] 图 10是本发明空气、 水模块控制结构示意图。 [0167] 命令字名称: 空气、 水类传感器控制协议。
[0168] 命令字描述: 该协议主要描述空气、 水类传感器模块的在线检测、 以及一次数 据和所有数据的获取的方式。
[0169] 命令字结构: 如表 13, 分别对应模块检测、 获取一次数据、 数据汇总。
[0170] 表 13
[] [表 13]
Figure imgf000018_0001
[0171] 智能终端回复: 如表 14, 分别对应模块检测、 获取一次数据、 数据汇总
[0172] 表 14
[] [表 14]
Figure imgf000018_0002
使用场景: 这里主要是用户与空气、 水传感器模块之间的交互。 当插入空气、 水传感器模块后, 会进行相应的检测并提示用户。 当用户想知道现在的空气、 水质的话, 可以进行一次数据査询, 或者可以通过数据汇总了解一天 24小吋的 空气、 水质数据波动图。
[0174] 图 11为本发明蓝牙耳机控制结构示意图。
[0175] 命令字名称: 蓝牙耳机控制协议。
[0176] 命令字描述: 该协议主要描述蓝牙耳机模块在线检测、 耳机充电与不充电的控 制方式。
[0177] 命令字结构: 如表 15, 分别对应模块检测、 模块充电、 不充电
[0178] 表 15
[] [表 15]
Figure imgf000019_0001
[0179] 智能终端回复: 如表 16
[0180] 表 16
[] [表 16]
Figure imgf000019_0002
[0181] 使用场景: 这里主要是用户可以将蓝牙耳机插入框架, 当框架检测到耳机插入 吋, 就会通知用户是否需要进行充电。
[0182] 图 12为本发明手环模块控制结构示意图。
[0183] 命令字名称: 手环控制协议。
[0184] 命令字描述: 该协议主要描述手环模块在线检测、 手环数据获取、 手环充电与 不充电的控制方式。
[0185] 命令字结构: 如表 17, 分别对应模块检测、 充电、 不充电、 数据读取。
[0186] 表 17
[] [表 17]
Figure imgf000020_0001
[0187] 智能终端回复: 如表 18, 分别对应模块检测、 充电、 不充电、 数据读取。
[0188] 表 18
[]
[表 18]
Figure imgf000021_0001
[0189] 使用场景: 这里主要是智能终端与手环模块之间的交互, 首先, 模块框架可以 检测手环的存在, 然后智能终端可以控制框架给手环进行充电操作, 当智能终 端需要手环的数据吋, 可以发送指令进行数据的读取操作。
[0190] 通过实施本发明, 实现功能模块的插接、 识别、 接驳、 通信, 方便智能终端的 功能扩展, 满足用户个性化需求。 同吋, 在保证协议的安全性和完备性的前提 下, 更注重效率。 符合物联网的轻量级、 及吋响应的需求。
[0191] 以上实施例只为说明本发明的技术构思及特点, 其目的在于让熟悉此项技术的 人士能够了解本发明的内容并据此实施, 并不能限制本发明的保护范围。 凡跟 本发明权利要求范围所做的均等变化与修饰, 均应属于本发明权利要求的涵盖 范围。

Claims

权利要求书
[权利要求 1] 一种通信接口, 其特征在于, 所述通信接口用于功能模块与模块平台 之间的连接与通信, 所述通信接口通过预设数据帧传输数据, 所述预 设数据帧包括: 前导字段、 命令码字段、 序列号字段、 数据长度字段
、 数据内容字段、 检验码字段; 其中,
所述前导字段为同步头, 用于标明数据流的流动方向;
所述命令码字段为所述功能模块和模块平台之间的通信命令; 所述序列号字段为自动生成的序列号, 对应的回复命令采用同样的序 列号;
所述数据内容字段为传输数据内容;
所述数据长度字段为所述传输数据内容的长度; 所述检验码字段用于对所述预设数据帧进行校验。
[权利要求 2] 根据权利要求 1所述的通信接口, 其特征在于, 所述通信接口包括: 设置在所述功能模块上的第一接口和设置在所述模块平台上的第二接 口, 所述第一接口和所述第二接口相匹配;
所述第一接口和第二接口为 8引脚接口, 包括: 第一引脚 VIN、 第二 弓 I脚 DET0、 第三引脚 DET1、 第四弓 I脚 VOUT、 第五弓 |脚 GND、 第六 引脚 DM、 第七引脚 DP、 第八引脚 GND;
所述第一弓 I脚 VIN用于所述功能模块的电源接入; 所述第二弓 I脚 DET0和第三引脚 DET1用于对所述功能模块进行分类; 所述第四弓 I脚 VOUT用于所述功能模块的电源输出;
所述第五弓 I脚 GND和第八弓 I脚 GND接地;
所述第六弓 I脚 DM和第七弓 I脚 DP用于传输数据内容。
[权利要求 3] 根据权利要求 2所述的通信接口, 其特征在于, 所述第一接口和第二 接口的 8个引脚成两排分布, 每排四个引脚, 每排内的引脚之间间隔 相等; 或所述第一接口和第二接口的 8个引脚成一排分布; 根据所述第二弓 I脚 DET0和第三引脚 DET1的阻抗高低将所述功能模块 分为四类: 第一类: 所述功能模块为空模块或闲置模块, 无信号进入或输出; 第二类: 所述功能模块为第一类供电模块, 所述第一类供电模块需所 述模块平台供电; 第三类: 所述功能模块为第二类供电模块, 所述第二类供电模块需所 述模块平台供电; 第四类: 所述功能模块为电池或充电设备。
一种功能模块与模块框架的通信方法, 其特征在于, 功能模块使用权 利要求 1-3任一项所述的通信接口连接模块框架, 所述模块框架用于 连接智能终端, 所述通信接口使用的通信协议包括: 叩门协议、 模块 控制协议、 数据交换协议;
所述叩门协议用于功能模块的发现探测; 所述模块控制协议用于设置 所述功能模块的配置及调节的命令类型; 所述数据交换协议用于数据 的下载和上传。
根据权利要求 4所述的功能模块与模块框架通信方法, 其特征在于, 所述功能模块与模块框架之间的通信包括:
S1 : 所述功能模块插接在所述模块框架后, 所述模块框架对所述功能 模块进行模块类型识别, 且在识别过程中, 所述模块框架不为所述功 能模块供电;
S2: 所述模块框架识别所述功能模块的类型后, 为所述功能模块进行 供电和 /或接驳操作;
S3: 所述功能模块发送所述叩门协议至所述模块框架;
S4: 所述模块框架根据所述叩门协议与所述功能模块建立通信连接。 根据权利要求 4所述的功能模块与模块框架通信方法, 其特征在于, 所述通信接口通过预设数据帧传输数据, 在所述预设数据帧中: 前导 字段、 命令码字段、 序列号字段、 数据长度字段、 以及检验码字段的 数据长度为 1字节, 数据内容字段的数据长度为 N字节, N为自然数; 所述检验码字段通过 BCC校验方式进行校验。
根据权利要求 4所述的功能模块与模块框架通信方法, 其特征在于, 所述模块框架设置有至少一个用于安装所述功能模块的插槽, 所述功 能模块通过一个或多个所述插槽与所述模块框架连接。
一种模块框架与智能终端的通信方法, 其特征在于, 使用权利要求 1-
3任一项所述的通信接口, 智能终端安装有用于管理模块框架和功能 模块的管理 APP;
所述智能终端与模块框架进行通信, 所述模块框架通过所述通信接口 与所述功能模块进行通信。
根据权利要求 8所述的模块框架与智能终端的通信方法, 其特征在于 , 所述通信接口通过预设数据帧传输数据, 在所述预设数据帧中: 前 导字段、 命令码字段、 序列号字段、 数据长度字段、 以及检验码字段 的数据长度为 4字节, 数据内容字段的数据长度为 N字节, N为自然数 所述检验码字段通过 CRC校验方式进行校验。
根据权利要求 9所述的模块框架与智能终端的通信方法, 其特征在于 , 所述命令码字段包括: 所述智能终端向所述模块框架发起连接的连 接请求命令字段、 所述智能终端向所述模块框架发起断幵连接的断幵 连接命令字段、 由所述模块框架间隔预设吋间发出的同步命令字段; 所述智能终端包括: 智能手机、 智能手环、 智能眼镜;
所述智能终端使用 Android操作系统、 IOS操作系统、 Windows操作系 统、 Linux操作系统。
PCT/CN2017/099350 2017-08-28 2017-08-28 一种通信接口及通信方法 Ceased WO2019041104A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/099350 WO2019041104A1 (zh) 2017-08-28 2017-08-28 一种通信接口及通信方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/099350 WO2019041104A1 (zh) 2017-08-28 2017-08-28 一种通信接口及通信方法

Publications (1)

Publication Number Publication Date
WO2019041104A1 true WO2019041104A1 (zh) 2019-03-07

Family

ID=65524740

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/099350 Ceased WO2019041104A1 (zh) 2017-08-28 2017-08-28 一种通信接口及通信方法

Country Status (1)

Country Link
WO (1) WO2019041104A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1999062229A1 (en) * 1998-05-22 1999-12-02 Winnet Mcs, Inc. Method and apparatus for baseband transmission between a top floor unit and an outdoor unit in a terminal for a wireless metropolitan area network
CN1615634A (zh) * 2002-08-28 2005-05-11 英特尔公司 用于主机与调制解调器之间通信的系统和方法
CN105356901A (zh) * 2015-11-19 2016-02-24 宁波力芯科信息科技有限公司 一种模块化移动电子设备
CN107592411A (zh) * 2017-08-28 2018-01-16 杭州来布科技有限公司 一种通信接口及通信方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1999062229A1 (en) * 1998-05-22 1999-12-02 Winnet Mcs, Inc. Method and apparatus for baseband transmission between a top floor unit and an outdoor unit in a terminal for a wireless metropolitan area network
CN1615634A (zh) * 2002-08-28 2005-05-11 英特尔公司 用于主机与调制解调器之间通信的系统和方法
CN105356901A (zh) * 2015-11-19 2016-02-24 宁波力芯科信息科技有限公司 一种模块化移动电子设备
CN107592411A (zh) * 2017-08-28 2018-01-16 杭州来布科技有限公司 一种通信接口及通信方法

Similar Documents

Publication Publication Date Title
TWI338222B (en) Method and system for allowing a media player to transfer digital audio to an accessory
KR102275720B1 (ko) 블루투스 통신방법 및 블루투스 통신디바이스
CN105188022B (zh) 无线路由设备和通信方法
CN111209026B (zh) 移动终端、电源适配器及其升级方法
US20040122649A1 (en) Wireless cable replacement for computer peripherals using a master adapter
WO2016179817A1 (zh) 快速充电方法、电源适配器和移动终端
CN113949116B (zh) 一种数据传输方法及装置
CN107453428B (zh) 一种自动识别苹果和安卓设备的方法
KR20160062543A (ko) 근접 네트워크 구성 방법 및 그 전자 장치
CN103973643A (zh) 智能协议转换器
CN105898893B (zh) 一种移动终端与物联网设备全双工通信的方法
WO2004059916A2 (en) Wireless cable replacement for computer peripherals
US9591105B2 (en) Communication apparatus, communication system, communication method, and program for improved data transfer efficiency
CN114297126B (zh) 一种基于充电线缆的数据传输方法及电子设备
WO2019019050A1 (zh) 无线通信配对方法、无线接收设备和无线发射设备、系统
CN107592411B (zh) 一种通信接口及通信方法
WO2022012644A1 (zh) 一种基于充电线缆的数据传输方法及电子设备
CN105208517B (zh) 无线路由设备和通信方法
JP4491146B2 (ja) 電子装置におけるバッテリと通信手段への通信手段の同期方法、及び装置、及びバッテリ
CN112070938B (zh) 一种智能门禁配置设备及智能门禁配置系统
WO2019041104A1 (zh) 一种通信接口及通信方法
CN103152464A (zh) 通过无线方式获取固话来电信息的设备、方法和系统
CN101516088A (zh) 一种数据传输的方法及系统、一种服务器及移动通信终端
CN116612625A (zh) 一种无线网络通信模组及电子设备
US20170041450A1 (en) Multipin Variable Rate Interface

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: 17923616

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: 17923616

Country of ref document: EP

Kind code of ref document: A1