CN116131402B - Method and device for identifying UFCS protocol waveform based on I/O port - Google Patents

Method and device for identifying UFCS protocol waveform based on I/O port Download PDF

Info

Publication number
CN116131402B
CN116131402B CN202310095659.9A CN202310095659A CN116131402B CN 116131402 B CN116131402 B CN 116131402B CN 202310095659 A CN202310095659 A CN 202310095659A CN 116131402 B CN116131402 B CN 116131402B
Authority
CN
China
Prior art keywords
signal
sequence
ufcs
protocol
operation result
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.)
Active
Application number
CN202310095659.9A
Other languages
Chinese (zh)
Other versions
CN116131402A (en
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.)
Unicmicro Guangzhou Co ltd
Original Assignee
Unicmicro Guangzhou 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 Unicmicro Guangzhou Co ltd filed Critical Unicmicro Guangzhou Co ltd
Priority to CN202310095659.9A priority Critical patent/CN116131402B/en
Publication of CN116131402A publication Critical patent/CN116131402A/en
Application granted granted Critical
Publication of CN116131402B publication Critical patent/CN116131402B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Communication Control (AREA)
  • Maintenance And Management Of Digital Transmission (AREA)

Abstract

本发明公开了一种基于IO端口识别UFCS协议波形的方法及装置,所述方法包括:对目标端口的信号翻转情况进行实时监测;其中,当所述目标端口的信号发生翻转时,记录定时器的时钟值;基于每一所述时钟值生成信号翻转序列并对所述信号翻转序列中的每一所述时钟值进行前向差值运算,并根据每一所述差值运算结果生成时间长度序列;逐一将每一所述差值运算结果与UFCS协议波形的波特率集进行匹配,根据预设规则对匹配成功的所述差值运算结果进标识,生成关于UFCS协议波形的信号序列。本发明可以用于实现对UFCS协议波形的软解码。

The invention discloses a method and device for identifying UFCS protocol waveforms based on IO ports. The method includes: monitoring the signal inversion of the target port in real time; wherein, when the signal of the target port inverts, the recording timer clock value; generate a signal flip sequence based on each clock value and perform a forward difference operation on each clock value in the signal flip sequence, and generate a time length based on each difference operation result Sequence: Match each difference operation result with the baud rate set of the UFCS protocol waveform one by one, mark the successfully matched difference operation results according to preset rules, and generate a signal sequence about the UFCS protocol waveform. The present invention can be used to realize soft decoding of UFCS protocol waveforms.

Description

一种基于I/O端口识别UFCS协议波形的方法及装置A method and device for identifying UFCS protocol waveform based on I/O port

技术领域Technical field

本发明涉及快速充电技术领域,特别是涉及一种基于IO口识别UFCS协议波形的方法及装置。The present invention relates to the field of fast charging technology, and in particular to a method and device for identifying UFCS protocol waveforms based on an IO port.

背景技术Background technique

近年来,终端快速充电技术迅速发展,尤其在充电速度、充电安全、充电智能管理方面提升显著,快充体验获得了广大用户的广泛认可并已成为手机等智能终端的标配特性。但快充产业长期存在协议互不兼容的问题:不同品牌终端和适配器之间不能有效识别,只能实现较低功率的充电。一方面,用户快充体验受到很大的制约和限制,不兼容问题成为用户的一大痛点。In recent years, terminal fast charging technology has developed rapidly, especially in terms of charging speed, charging safety, and intelligent charging management. The fast charging experience has been widely recognized by users and has become a standard feature of smart terminals such as mobile phones. However, the fast charging industry has long had the problem of protocol incompatibility: terminals and adapters of different brands cannot be effectively identified, and only lower power charging can be achieved. On the one hand, users’ fast charging experience is greatly restricted and restricted, and incompatibility issues have become a major pain point for users.

UFCS是由信通院、华为、OPPO、vivo、小米牵头,联合矽力杰、瑞芯微、立辉科技、昂宝电子等多家终端、芯片企业和产业界伙伴共同努力完成的新一代融合快充协议。该协议旨在制定移动终端的融合快速充电标准,解决互配快充不兼容问题,为终端使用者创造快速、安全、兼容的充电使用环境。但目前实现UFCS融合快充协议大多为将解码方式集成在MCU芯片中,通过协议识别电路对充电接口中各引脚的信号变化进行采样识别的硬解码方法,灵活性较低。UFCS is a new generation of integrated fast technology led by the Academy of Information and Communications Technology, Huawei, OPPO, vivo, Xiaomi, and joint efforts by many terminal and chip companies and industry partners such as Silicon Power, Rockchip, Lihui Technology, and Angbao Electronics. charge agreement. The agreement aims to formulate integrated fast charging standards for mobile terminals, solve the problem of incompatibility of mutual fast charging, and create a fast, safe and compatible charging environment for end users. However, the current implementation of UFCS integrated fast charging protocols is mostly a hard decoding method that integrates the decoding method in the MCU chip and uses the protocol identification circuit to sample and identify the signal changes of each pin in the charging interface, which has low flexibility.

发明内容Contents of the invention

本申请提供了一种基于I/O端口识别UFCS协议波形的方法及装置,用于实现对UFCS协议波形的软解码。This application provides a method and device for identifying UFCS protocol waveforms based on I/O ports, which are used to implement soft decoding of UFCS protocol waveforms.

第一方面,本申请提供了一种基于I/O端口识别UFCS协议波形的方法,包括:In the first aspect, this application provides a method for identifying UFCS protocol waveforms based on I/O ports, including:

对目标端口的信号翻转情况进行实时监测;其中,当所述目标端口的信号发生翻转时,记录定时器的时钟值;Monitor the signal inversion of the target port in real time; wherein, when the signal of the target port inverts, the clock value of the timer is recorded;

基于每一所述时钟值生成信号翻转序列并对所述信号翻转序列中的每一所述时钟值进行前向差值运算,并根据每一差值运算结果生成时间长度序列;Generate a signal flip sequence based on each clock value and perform a forward difference operation on each clock value in the signal flip sequence, and generate a time length sequence based on the result of each difference operation;

逐一将每一所述差值运算结果与UFCS协议波形的波特率集进行匹配,根据预设规则对匹配成功的所述差值运算结果进标识,生成关于UFCS协议波形的信号序列。Match each of the difference operation results with the baud rate set of the UFCS protocol waveform one by one, mark the successfully matched difference operation results according to the preset rules, and generate a signal sequence related to the UFCS protocol waveform.

本申请提供一种基于I/O端口识别UFCS协议波形的装置,通过定时器对目标端口的信号翻转情况进行监测,根据记录的每一时钟值生成关于目标端口翻转情况的时间长度序列。将时间长度序列中的每一差值运算结果与UFCS协议波形的波特率集进行匹配,获取目标端口信号翻转情况与UFCS协议波形的信号关联关系。基于预设规则对匹配成功的差值运算结果进行标识,即可生成关于UFCS协议波形的信号序列,实现对UFXS协议波形的软解码,不需要在MCU中集成芯片也不需要部署波形识别电路,可以减低UFCS协议识别的成本,操作简单。This application provides a device that identifies UFCS protocol waveforms based on I/O ports, monitors the signal flip situation of the target port through a timer, and generates a time length sequence about the target port flip situation based on each recorded clock value. Match each difference operation result in the time length sequence with the baud rate set of the UFCS protocol waveform to obtain the signal correlation between the target port signal inversion and the UFCS protocol waveform. By identifying the successfully matched difference operation results based on preset rules, a signal sequence about the UFCS protocol waveform can be generated to realize soft decoding of the UFXS protocol waveform. There is no need to integrate a chip in the MCU or deploy a waveform recognition circuit. It can reduce the cost of UFCS protocol identification and is easy to operate.

在一种实现方式中,所述对目标端口的信号翻转情况进行实时监测,具体包括:In one implementation, the real-time monitoring of the signal flip situation of the target port specifically includes:

基于第一定时器对所述目标端口的信号进行捕获,当检测到所述信号发生翻转时,记录所述第一定时器的时钟值;Capture the signal of the target port based on the first timer, and when a flip of the signal is detected, record the clock value of the first timer;

基于第二定时器对所述目标端口的信号进行超时识别,当检测距离上次信号发生翻转的时间间隔超过UFCS协议的信号最长脉宽时,结束对所述信号的捕获。Timeout identification is performed on the signal of the target port based on the second timer, and when the time interval from the detection of the last signal flip exceeds the longest pulse width of the signal of the UFCS protocol, the capture of the signal is terminated.

在一种实现方式中,所述基于每一所述时钟值生成信号翻转序列并对所述信号翻转序列中的每一所述时钟值进行前向差值运算,并根据每一差值运算结果生成时间长度序列,具体包括:In one implementation, the signal inversion sequence is generated based on each clock value, a forward difference operation is performed on each clock value in the signal inversion sequence, and the result of each difference operation is Generate a time length sequence, including:

根据所述目标端口的信号翻转顺序,依次记录并基于所述定时器的时钟值,生成信号翻转序列;According to the signal flip sequence of the target port, record in sequence and generate a signal flip sequence based on the clock value of the timer;

将所述信号翻转序列中每相邻两个时钟值中的后一时钟值减去前一时钟值,生成若干差值运算结果;Subtract the previous clock value from the latter clock value of each two adjacent clock values in the signal flip sequence to generate several difference operation results;

根据每一所述差值运算结果生成时间长度序列;其中,每一所述差值运算结果表征一次信号翻转的脉宽。A time length sequence is generated according to each difference operation result; wherein each difference operation result represents the pulse width of a signal flip.

在一种实现方式中,所述逐一将每一所述差值运算结果与UFCS协议波形的波特率集进行匹配,根据预设规则对匹配成功的所述差值运算结果进信息转化,生成关于UFCS协议波形的信号序列,具体包括:In one implementation, each of the difference operation results is matched with the baud rate set of the UFCS protocol waveform one by one, and the successfully matched difference operation results are transformed into information according to preset rules to generate Regarding the signal sequence of the UFCS protocol waveform, it specifically includes:

将每一所述差值运算结果与UFCS协议波形的波特率集进行匹配;Match each difference operation result with the baud rate set of the UFCS protocol waveform;

基于所述差值运算结果匹配的波特率计算所述差值运算结果传输单位比特所需的时间长度结果;Calculate the time length required for transmitting a unit bit by the difference operation result based on the baud rate matched by the difference operation result;

当所述差值运算结果与对应的时间长度结果相等时,将所述差值运算结果标识为0信号;When the difference operation result is equal to the corresponding time length result, the difference operation result is marked as a 0 signal;

当所述差值运算结果为对应的时间长度结果的一半时,将所述差值运算结果标识为半1信号;其中,当两个相邻的所述半1信号时,将两个所述半1信号标识为1信号;When the difference operation result is half of the corresponding time length result, the difference operation result is identified as a half-1 signal; wherein, when two adjacent half-1 signals are present, the two half-1 signals are identified as A half-1 signal is identified as a 1 signal;

基于所述0信号和所述1信号生成关于UFCS协议波形的0-1信号序列。A 0-1 signal sequence regarding the UFCS protocol waveform is generated based on the 0 signal and the 1 signal.

第二方面,本申请提供一种基于I/O端口识别UFCS协议波形的装置,包括端口信号监测模块、第一序列生成模块和第二序列生成模块,具体为:In the second aspect, this application provides a device for identifying UFCS protocol waveforms based on I/O ports, including a port signal monitoring module, a first sequence generation module and a second sequence generation module, specifically:

所述端口信号监测模块用于对目标端口的信号翻转情况进行实时监测;其中,当所述目标端口的信号发生翻转时,记录定时器的时钟值;The port signal monitoring module is used to monitor the signal inversion of the target port in real time; wherein, when the signal of the target port inverts, the clock value of the timer is recorded;

所述第一序列生成模块用于基于每一所述时钟值生成信号翻转序列并对所述信号翻转序列中的每一所述时钟值进行前向差值运算,并根据每一差值运算结果生成时间长度序列;The first sequence generation module is configured to generate a signal inversion sequence based on each of the clock values and perform a forward difference operation on each of the clock values in the signal inversion sequence, and based on each difference operation result Generate time length series;

所述第二序列生成模块用于逐一将每一所述差值运算结果与UFCS协议波形的波特率集进行匹配,根据预设规则对匹配成功的所述差值运算结果进标识,生成关于UFCS协议波形的信号序列。The second sequence generation module is used to match each of the difference operation results with the baud rate set of the UFCS protocol waveform one by one, identify the successfully matched difference operation results according to the preset rules, and generate the relevant Signal sequence of UFCS protocol waveforms.

本申请提供一种基于I/O端口识别UFCS协议波形的装置,通过定时器对目标端口的信号翻转情况进行监测,根据记录的每一时钟值生成关于目标端口翻转情况的时间长度序列。将时间长度序列中的每一差值运算结果与UFCS协议波形的波特率集进行匹配,获取目标端口信号翻转情况与UFCS协议波形的信号关联关系。基于预设规则对匹配成功的差值运算结果进行标识,即可生成关于UFCS协议波形的信号序列,实现对UFXS协议波形的软解码,不需要在MCU中集成芯片也不需要部署波形识别电路,可以减低UFCS协议识别的成本,操作简单。This application provides a device that identifies UFCS protocol waveforms based on I/O ports, monitors the signal flip situation of the target port through a timer, and generates a time length sequence about the target port flip situation based on each recorded clock value. Match each difference operation result in the time length sequence with the baud rate set of the UFCS protocol waveform to obtain the signal correlation between the target port signal inversion and the UFCS protocol waveform. By identifying the successfully matched difference operation results based on preset rules, a signal sequence about the UFCS protocol waveform can be generated to realize soft decoding of the UFXS protocol waveform. There is no need to integrate a chip in the MCU or deploy a waveform identification circuit. It can reduce the cost of UFCS protocol identification and is easy to operate.

在一种实现方式中,所述端口信号监测模块用于对目标端口的信号翻转情况进行实时监测,具体包括:In one implementation, the port signal monitoring module is used to monitor the signal flip situation of the target port in real time, specifically including:

基于第一定时器对所述目标端口的信号进行捕获,当检测到所述信号发生翻转时,记录所述第一定时器的时钟值;Capture the signal of the target port based on the first timer, and when a flip of the signal is detected, record the clock value of the first timer;

基于第二定时器对所述目标端口的信号进行超时识别,当检测距离上次信号发生翻转的时间间隔超过UFCS协议的信号最长脉宽时,结束对所述信号的捕获。Timeout identification is performed on the signal of the target port based on the second timer, and when the time interval from the detection of the last signal flip exceeds the longest pulse width of the signal of the UFCS protocol, the capture of the signal is terminated.

在一种实现方式中,所述第一序列生成模块用于基于每一所述时钟值生成信号翻转序列并对所述信号翻转序列中的每一所述时钟值进行前向差值运算,并根据每一差值运算结果生成时间长度序列,具体包括:In one implementation, the first sequence generation module is configured to generate a signal inversion sequence based on each of the clock values and perform a forward difference operation on each of the clock values in the signal inversion sequence, and A time length sequence is generated based on the result of each difference operation, including:

根据所述目标端口的信号翻转顺序,依次记录并基于所述定时器的时钟值,生成信号翻转序列;According to the signal flip sequence of the target port, record in sequence and generate a signal flip sequence based on the clock value of the timer;

将所述信号翻转序列中每相邻两个时钟值中的后一时钟值减去前一时钟值,生成若干差值运算结果;Subtract the previous clock value from the latter clock value of each two adjacent clock values in the signal flip sequence to generate several difference operation results;

根据每一所述差值运算结果生成时间长度序列;其中,每一所述差值运算结果表征一次信号翻转的脉宽。A time length sequence is generated according to each difference operation result; wherein each difference operation result represents the pulse width of a signal flip.

在一种实现方式中,所述第二序列生成模块用于逐一将每一所述差值运算结果与UFCS协议波形的波特率集进行匹配,根据预设规则对匹配成功的所述差值运算结果进标识,生成关于UFCS协议波形的信号序列,具体包括:In one implementation, the second sequence generation module is used to match each of the difference operation results with the baud rate set of the UFCS protocol waveform one by one, and match the successfully matched difference values according to preset rules. The operation results are marked and a signal sequence related to the UFCS protocol waveform is generated, including:

将每一所述差值运算结果与UFCS协议波形的波特率集进行匹配;Match each difference operation result with the baud rate set of the UFCS protocol waveform;

基于所述差值运算结果匹配的波特率计算所述差值运算结果传输单位比特所需的时间长度结果;Calculate the time length required for transmitting a unit bit by the difference operation result based on the baud rate matched by the difference operation result;

当所述差值运算结果与对应的时间长度结果相等时,将所述差值运算结果标识为0信号;When the difference operation result is equal to the corresponding time length result, the difference operation result is marked as a 0 signal;

当所述差值运算结果为对应的时间长度结果的一半时,将所述差值运算结果标识为半1信号;其中,当两个相邻的所述半1信号时,将两个所述半1信号标识为1信号;When the difference operation result is half of the corresponding time length result, the difference operation result is identified as a half-1 signal; wherein, when two adjacent half-1 signals are present, the two half-1 signals are identified as A half-1 signal is identified as a 1 signal;

基于所述0信号和所述1信号生成关于UFCS协议波形的0-1信号序列。A 0-1 signal sequence regarding the UFCS protocol waveform is generated based on the 0 signal and the 1 signal.

第三方面,本申请还提供一种终端设备,包括处理器、存储器以及存储在所述存储器中且被配置为由所述处理器执行的计算机程序,所述处理器执行所述计算机程序时实现如上所述的一种基于I/O端口识别UFCS协议波形的方法。In a third aspect, the present application also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the A method of identifying UFCS protocol waveforms based on I/O ports as described above.

第四方面,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质包括存储的计算机程序,其中,在所述计算机程序运行时控制所述计算机可读存储介质所在设备执行如上所述的一种基于I/O端口识别UFCS协议波形的方法。In a fourth aspect, the present application also provides a computer-readable storage medium. The computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to perform the above. The described method is to identify UFCS protocol waveform based on I/O port.

附图说明Description of drawings

图1是本发明实施例提供的一种基于I/O端口识别UFCS协议波形的方法的流程示意图;Figure 1 is a schematic flow chart of a method for identifying UFCS protocol waveforms based on I/O ports provided by an embodiment of the present invention;

图2是本发明实施例提供的一种基于I/O端口识别UFCS协议波形的装置的模块结构图。Figure 2 is a module structure diagram of a device for identifying UFCS protocol waveforms based on I/O ports provided by an embodiment of the present invention.

具体实施方式Detailed ways

下面结合附图和实施例,对本发明的具体实施方式作进一步详细描述。以下实施例用于说明本发明,但不用来限制本发明的范围。Specific implementations of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are used to illustrate the invention but are not intended to limit the scope of the invention.

本申请的说明书和权利要求书及所述附图中的术语“第一”和“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms “first”, “second”, etc. in the description, claims, and drawings of this application are used to distinguish different objects, rather than describing a specific sequence. Furthermore, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes Other steps or units inherent to such processes, methods, products or devices.

在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those skilled in the art understand, both explicitly and implicitly, that the embodiments described herein may be combined with other embodiments.

实施例1Example 1

参见图1,图1是本发明实施例提供的一种基于I/O端口识别UFCS协议波形的方法的流程示意图。本发明实施例提供一种基于I/O端口识别UFCS协议波形的方法,包括步骤101至步骤103,各项步骤具体如下:Referring to Figure 1, Figure 1 is a schematic flow chart of a method for identifying UFCS protocol waveforms based on I/O ports according to an embodiment of the present invention. The embodiment of the present invention provides a method for identifying UFCS protocol waveforms based on I/O ports, including steps 101 to 103. Each step is specifically as follows:

步骤101:对目标端口的信号翻转情况进行实时监测;其中,当所述目标端口的信号发生翻转时,记录定时器的时钟值;Step 101: Monitor the signal inversion of the target port in real time; when the signal of the target port inverts, record the clock value of the timer;

步骤102:基于每一所述时钟值生成信号翻转序列并对所述信号翻转序列中的每一所述时钟值进行前向差值运算,并根据每一差值运算结果生成时间长度序列;Step 102: Generate a signal inversion sequence based on each clock value, perform a forward difference operation on each clock value in the signal inversion sequence, and generate a time length sequence based on the result of each difference operation;

步骤103:逐一将每一所述差值运算结果与UFCS协议波形的波特率集进行匹配,根据预设规则对匹配成功的所述差值运算结果进标识,生成关于UFCS协议波形的信号序列。Step 103: Match each difference operation result with the baud rate set of the UFCS protocol waveform one by one, mark the successfully matched difference operation results according to the preset rules, and generate a signal sequence about the UFCS protocol waveform. .

本发明实施例中,目标端口指的是MCU用于解码UFCS协议的端口。根据协议时间运行情况,会在目标端口D+/D-上收发UFCS协议信号,目标端口根据充当的设备类型分时做发送和收发,充当充电设备时,D-为发送端,D+为接收端;充当供电设备时D-为接收端,D+为发送端。当目标端口需要接收时将该端口设置为模拟输入,且将其设置为定时器捕获。需要说明的是,D+/D-仅是目标端口的一种编号表示方法,也可将其描述为DP/DM,在此不做限定。In the embodiment of the present invention, the target port refers to the port used by the MCU to decode the UFCS protocol. According to the protocol time operation, UFCS protocol signals will be sent and received on the target port D+/D-. The target port will send and receive in time according to the type of device it serves. When acting as a charging device, D- is the sending end and D+ is the receiving end; When acting as a power supply device, D- is the receiving end and D+ is the transmitting end. When the target port needs to receive, set the port to an analog input and set it to a timer capture. It should be noted that D+/D- is only a numbering method for the target port. It can also be described as DP/DM, which is not limited here.

一实施例中,所述对目标端口的信号翻转情况进行实时监测,具体包括:基于第一定时器对所述目标端口的信号进行捕获,当检测到所述信号发生翻转时,记录所述第一定时器的时钟值;基于第二定时器对所述目标端口的信号进行超时识别,当检测距离上次信号发生翻转的时间间隔超过UFCS协议的信号最长脉宽时,结束对所述信号的捕获。本发明实施例中,通过MCU定时器对目标端口的信号进行捕捉,捕获类型可自定义设置为上升沿捕获、下降沿捕获或双边沿捕获。通过一个定时器记录目标端口信号翻转的情况,当目标端口的端口电平发生翻转时产生中断,进入中断函数后记录此时定时器的时钟值。若定时器MCU为16bit,则定时器的时钟数值范围为[0,65535],当定时器在时钟值327时发生I/O口电平翻转,此时在进入中断后记录下327这个值。中断发生后定时器的时钟值继续递增,当定时器的值在1088时再次发生I/O口电平翻转,则再记录下1088这个值。依次类推,记录下每次发生电平翻转时定时器的值。本发明实施例中,在通过第一定时器开启信号捕获的同时还通过第二定时器进行超时识别。每当第一定时器发生电平翻转时,第二定时器即时清零。当检测到距离上次电平翻转超过UFCS协议里的信号最长脉宽后仍无翻转时,判定本次信号接收结束,开始对接收到的各个定时器的时钟值进行解码。In one embodiment, the real-time monitoring of the signal inversion of the target port specifically includes: capturing the signal of the target port based on a first timer, and recording the first timer when an inversion of the signal is detected. A clock value of a certain timer; timeout identification is performed on the signal of the target port based on the second timer. When the time interval from the detection of the last signal flip exceeds the longest pulse width of the signal of the UFCS protocol, the signal is terminated. of capture. In the embodiment of the present invention, the signal of the target port is captured through the MCU timer, and the capture type can be customized to rising edge capture, falling edge capture, or dual edge capture. A timer is used to record the signal inversion of the target port. When the port level of the target port is inverted, an interrupt is generated. After entering the interrupt function, the clock value of the timer at this time is recorded. If the timer MCU is 16bit, the timer clock value range is [0, 65535]. When the timer reaches a clock value of 327, the I/O port level flip occurs. At this time, the value 327 is recorded after entering the interrupt. After the interrupt occurs, the clock value of the timer continues to increase. When the timer value is 1088, the I/O port level flip occurs again, and the value 1088 is recorded again. By analogy, record the value of the timer each time a level flip occurs. In the embodiment of the present invention, while starting signal capture through the first timer, timeout identification is also performed through the second timer. Whenever a level flip occurs in the first timer, the second timer is cleared immediately. When it is detected that the last level flip has exceeded the longest pulse width of the signal in the UFCS protocol and there is still no flip, it is determined that the current signal reception has ended, and decoding of the received clock values of each timer begins.

一实施例中,所述基于每一所述时钟值生成信号翻转序列并对所述信号翻转序列中的每一所述时钟值进行前向差值运算,并根据每一差值运算结果生成时间长度序列,具体包括:根据所述目标端口的信号翻转顺序,依次记录并基于所述定时器的时钟值,生成信号翻转序列;将所述信号翻转序列中每相邻两个时钟值中的后一时钟值减去前一时钟值,生成若干差值运算结果;根据每一所述差值运算结果生成时间长度序列;其中,每一所述差值运算结果表征一次信号翻转的脉宽。根据目标端口的信号翻转顺序,依次记录定时器的时钟值,当一次信号接收结束后,生成本次接收信号的信号翻转序列。将序列中每相邻两个时钟值中的后一时钟值减去时钟值,两个时钟值间的差值表示一次信号翻转的脉宽。将生成的信号翻转序列中每一时钟值进行前向差值运算,即可生成关于信号翻转的时间长度序列。In one embodiment, the signal inversion sequence is generated based on each clock value, a forward difference operation is performed on each clock value in the signal inversion sequence, and a time is generated based on each difference operation result. The length sequence specifically includes: sequentially recording and generating a signal inversion sequence based on the clock value of the timer according to the signal inversion sequence of the target port; converting the last two adjacent clock values in the signal inversion sequence into One clock value is subtracted from the previous clock value to generate several difference operation results; a time length sequence is generated according to each difference operation result; wherein each difference operation result represents the pulse width of a signal flip. According to the signal flip sequence of the target port, the clock value of the timer is recorded in sequence. When the signal reception is completed, the signal flip sequence of the current received signal is generated. Subtract the clock value from the last two adjacent clock values in the sequence. The difference between the two clock values represents the pulse width of a signal flip. By performing a forward difference operation on each clock value in the generated signal flip sequence, a time length sequence of signal flips can be generated.

一实施例中,所述逐一将每一所述差值运算结果与UFCS协议波形的波特率集进行匹配,根据预设规则对匹配成功的所述差值运算结果进信息转化,生成关于UFCS协议波形的信号序列,具体包括:将每一所述差值运算结果与UFCS协议波形的波特率集进行匹配;基于所述差值运算结果匹配的波特率计算所述差值运算结果传输单位比特所需的时间长度结果;当所述差值运算结果与对应的时间长度结果相等时,将所述差值运算结果标识为0信号;当所述差值运算结果为对应的时间长度结果的一半时,将所述差值运算结果标识为半1信号;其中,当两个相邻的所述半1信号时,将两个所述半1信号标识为1信号;基于所述0信号和所述1信号生成关于UFCS协议波形的0-1信号序列。本发明实施例中,将生成的每一差值运算结果与UFCS协议波形的波特率集进行匹配。UFCS协议波形为Training序列(0xAA)+数据帧(UFCS协议有四种波特率)。若匹配成功,则根据匹配结果计算该差值运算结果传输1bit需要的时间。优选的,若差值运算结果的匹配的波特率为为115200,则每bit时间为1000000us/115200=8.6us。作为本发明设实施例的一个优化方案,可以将时间长度序列中最小的脉宽长度是否为8.6us,判断其余差值运算结果的波特率是否为115200。当差值运算结果的脉宽长度为传输1bit时间长度时,将所述差值运算结果,即脉宽标识为0信号,当所述差值运算结果的脉宽长度为传输1bit时间长度的一半时,则将该差值运算结果标识为半1信号。若存在两个相邻的半1信号时,则将两个半1信号标识为1个1信号。当对时间长度序列中的每一差值运算结果标识完成后,即可生成关于UFCS协议波形的0-1信号序列。In one embodiment, each of the difference operation results is matched with the baud rate set of the UFCS protocol waveform one by one, and the successfully matched difference operation results are transformed into information according to preset rules to generate information about UFCS The signal sequence of the protocol waveform specifically includes: matching each difference operation result with the baud rate set of the UFCS protocol waveform; calculating and transmitting the difference operation result based on the baud rate matched by the difference operation result. The time length result required for unit bit; when the difference operation result is equal to the corresponding time length result, the difference operation result is marked as a 0 signal; when the difference operation result is the corresponding time length result When half of , the difference operation result is identified as a half 1 signal; wherein, when there are two adjacent half 1 signals, the two half 1 signals are identified as 1 signals; based on the 0 signal and the 1 signal to generate a 0-1 signal sequence regarding the UFCS protocol waveform. In the embodiment of the present invention, each generated difference operation result is matched with the baud rate set of the UFCS protocol waveform. The UFCS protocol waveform is Training sequence (0xAA) + data frame (UFCS protocol has four baud rates). If the match is successful, the time required to transmit 1 bit of the difference operation result is calculated based on the matching result. Preferably, if the matching baud rate of the difference operation result is 115200, then each bit time is 1000000us/115200=8.6us. As an optimization solution of the embodiment of the present invention, it can be determined whether the minimum pulse width length in the time length sequence is 8.6us and whether the baud rate of the remaining difference operation results is 115200. When the pulse width length of the difference operation result is the transmission time length of 1 bit, the difference operation result, that is, the pulse width is marked as a 0 signal. When the pulse width length of the difference operation result is half of the 1 bit transmission time length, , the difference operation result is marked as a half-1 signal. If there are two adjacent half-1 signals, the two half-1 signals are identified as one 1 signal. After the identification of each difference operation result in the time length sequence is completed, a 0-1 signal sequence related to the UFCS protocol waveform can be generated.

本发明实施例中,还提供了一种基于I/O端口识别UFCS协议的设备,包括处理器、存储器以及存储在存储器中且被配置为由处理器执行的计算机程序,处理器执行计算机程序时实现上述的基于I/O端口识别UFCS协议波形的方法。In an embodiment of the present invention, a device for identifying the UFCS protocol based on I/O ports is also provided, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program Implement the above method of identifying UFCS protocol waveforms based on I/O ports.

本发明实施例中,还提供了一种计算机可读存储介质,计算机可读存储介质包括存储的计算机程序,其中,在计算机程序运行时控制计算机可读存储介质所在设备执行上述的基于I/O端口识别UFCS协议。In an embodiment of the present invention, a computer-readable storage medium is also provided. The computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the above I/O-based The port identifies the UFCS protocol.

示例性的,所述计算机程序可以被分割成一个或多个模块,所述一个或者多个模块被存储在所述存储器中,并由所述处理器执行,以完成本发明。所述一个或多个模块可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序在基于I/O端口识别UFCS协议设备中的执行过程。Exemplarily, the computer program can be divided into one or more modules, and the one or more modules are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of completing specific functions. The instruction segments are used to describe the execution process of the computer program in the device that identifies the UFCS protocol based on the I/O port.

所述基于I/O端口识别UFCS协议的设备可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述基于I/O端口识别UFCS协议的设备可包括,但不仅限于,处理器、存储器、显示器。本领域技术人员可以理解,上述部件仅仅是基于I/O端口识别UFCS协议的设备的示例,并不构成对基于扫描设备的数据收集的设备的限定,可以包括比所述部件更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述基于I/O端口识别UFCS协议的设备还可以包括输入输出设备、网络接入设备、总线等。The device that recognizes the UFCS protocol based on I/O ports can be computing devices such as desktop computers, notebooks, handheld computers, and cloud servers. The device that recognizes the UFCS protocol based on the I/O port may include, but is not limited to, a processor, a memory, and a display. Those skilled in the art can understand that the above-mentioned components are only examples of devices that identify the UFCS protocol based on I/O ports, and do not constitute a limitation on devices that collect data based on scanning devices. They may include more or less than the above-mentioned components. components, or a combination of certain components, or different components. For example, the device that recognizes the UFCS protocol based on the I/O port may also include input and output devices, network access devices, buses, etc.

所称处理器可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital SignalProcessor,DSP)、专用集成电路(Application Specific IntegratedCircuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等,所述处理器是所述基于I/O端口识别UFCS协议的设备的控制中心,利用各种接口和线路连接整个所述基于I/O端口识别UFCS协议的设备的各个部分。The so-called processor can be a central processing unit (Central Processing Unit, CPU), or other general-purpose processor, digital signal processor (Digital Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable Gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can be any conventional processor, etc. The processor is the control center of the device that recognizes the UFCS protocol based on the I/O port and is connected using various interfaces and lines. The various parts of the device are identified throughout the I/O port-based I/O port identification UFCS protocol.

所述存储器可用于存储所述计算机程序和/或模块,所述处理器通过运行或执行存储在所述存储器内的计算机程序和/或模块,以及调用存储在存储器内的数据,实现所述基于扫描设备的数据收集的设备的各种功能。所述存储器可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、文字转换功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、文字消息数据等)等。此外,存储器可以包括高速随机存取存储器,还可以包括非易失性存储器,例如硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory may be used to store the computer program and/or module, and the processor implements the method based on running or executing the computer program and/or module stored in the memory and calling data stored in the memory. Scan device data to collect various features of the device. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playback function, a text conversion function, etc.), etc.; the storage data area may store Data created based on the use of mobile phones (such as audio data, text message data, etc.), etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card , Flash Card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

其中,所述基于I/O端口识别UFCS协议的设备集成的模块如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一个计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。Wherein, if the device integration module that recognizes the UFCS protocol based on the I/O port is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention can implement all or part of the processes in the methods of the above embodiments, and can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer can When the program is executed by the processor, the steps of each of the above method embodiments can be implemented. Wherein, the computer program includes computer program code, which may be in the form of source code, object code, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media, etc. It should be noted that the content contained in the computer-readable medium can be appropriately added or deleted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium Excludes electrical carrier signals and telecommunications signals. Persons of ordinary skill in the art can understand and implement the method without any creative effort.

本发明实施例提供一种基于I/O端口识别UFCS协议波形的方法,通过定时器对目标端口的信号翻转情况进行监测,根据记录的每一时钟值生成关于目标端口翻转情况的时间长度序列。将时间长度序列中的每一差值运算结果与UFCS协议波形的波特率集进行匹配,获取目标端口信号翻转情况与UFCS协议波形的信号关联关系。基于预设规则对匹配成功的差值运算结果进行标识,即可生成关于UFCS协议波形的信号序列,实现对UFXS协议波形的软解码,不需要在MCU中集成芯片也不需要部署波形识别电路,可以减低UFCS协议识别的成本,操作简单。Embodiments of the present invention provide a method for identifying UFCS protocol waveforms based on I/O ports. The signal flip situation of the target port is monitored through a timer, and a time length sequence about the target port flip situation is generated based on each recorded clock value. Match each difference operation result in the time length sequence with the baud rate set of the UFCS protocol waveform to obtain the signal correlation between the target port signal inversion and the UFCS protocol waveform. By identifying the successfully matched difference operation results based on preset rules, a signal sequence about the UFCS protocol waveform can be generated to realize soft decoding of the UFXS protocol waveform. There is no need to integrate a chip in the MCU or deploy a waveform recognition circuit. It can reduce the cost of UFCS protocol identification and is easy to operate.

实施例2Example 2

参见图2,图2是本发明实施例提供的一种基于I/O端口识别UFCS协议波形的装置的模块结构图。本发明实施例提供一种基于I/O端口识别UFCS协议波形的装置,包括端口信号监测模块201、第一序列生成模块202和第二序列生成模块203,具体为:Referring to Figure 2, Figure 2 is a module structure diagram of a device for identifying UFCS protocol waveforms based on I/O ports provided by an embodiment of the present invention. The embodiment of the present invention provides a device for identifying UFCS protocol waveforms based on I/O ports, including a port signal monitoring module 201, a first sequence generation module 202 and a second sequence generation module 203, specifically:

所述端口信号监测模块201用于对目标端口的信号翻转情况进行实时监测;其中,当所述目标端口的信号发生翻转时,记录定时器的时钟值;The port signal monitoring module 201 is used to monitor the signal inversion of the target port in real time; wherein, when the signal of the target port inverts, the clock value of the timer is recorded;

所述第一序列生成模块202用于基于每一所述时钟值生成信号翻转序列并对所述信号翻转序列中的每一所述时钟值进行前向差值运算,并根据每一差值运算结果生成时间长度序列;The first sequence generation module 202 is configured to generate a signal inversion sequence based on each clock value and perform a forward difference operation on each clock value in the signal inversion sequence, and perform a forward difference operation based on each difference operation. The result is a time length sequence;

所述第二序列生成模块203用于逐一将每一所述差值运算结果与UFCS协议波形的波特率集进行匹配,根据预设规则对匹配成功的所述差值运算结果进标识,生成关于UFCS协议波形的信号序列。The second sequence generation module 203 is used to match each of the difference operation results with the baud rate set of the UFCS protocol waveform one by one, mark the successfully matched difference operation results according to the preset rules, and generate Signal sequence regarding UFCS protocol waveforms.

一实施例中,所述端口信号监测模块用于对目标端口的信号翻转情况进行实时监测,具体包括:基于第一定时器对所述目标端口的信号进行捕获,当检测到所述信号发生翻转时,记录所述第一定时器的时钟值;基于第二定时器对所述目标端口的信号进行超时识别,当检测距离上次信号发生翻转的时间间隔超过UFCS协议的信号最长脉宽时,结束对所述信号的捕获。In one embodiment, the port signal monitoring module is used to monitor the signal inversion of the target port in real time, which specifically includes: capturing the signal of the target port based on a first timer. When the signal inversion is detected, When, record the clock value of the first timer; perform timeout identification on the signal of the target port based on the second timer, when the time interval from the last signal flip exceeds the longest pulse width of the signal of the UFCS protocol , ending the capture of the signal.

一实施例中,所述第一序列生成模块用于基于每一所述时钟值生成信号翻转序列并对所述信号翻转序列中的每一所述时钟值进行前向差值运算,并根据每一差值运算结果生成时间长度序列,具体包括:根据所述目标端口的信号翻转顺序,依次记录并基于所述定时器的时钟值,生成信号翻转序列;将所述信号翻转序列中每相邻两个时钟值中的后一时钟值减去前一时钟值,生成若干差值运算结果;根据每一所述差值运算结果生成时间长度序列;其中,每一所述差值运算结果表征一次信号翻转的脉宽。In one embodiment, the first sequence generation module is configured to generate a signal inversion sequence based on each clock value and perform a forward difference operation on each clock value in the signal inversion sequence, and perform a forward difference operation based on each clock value. A difference operation result generates a time length sequence, which specifically includes: sequentially recording and generating a signal inversion sequence based on the clock value of the timer according to the signal inversion sequence of the target port; converting each adjacent signal in the signal inversion sequence Subtract the previous clock value from the latter clock value of the two clock values to generate several difference operation results; generate a time length sequence according to each difference operation result; wherein each difference operation result represents one time The pulse width of the signal flip.

一实施例中,所述第二序列生成模块用于逐一将每一所述差值运算结果与UFCS协议波形的波特率集进行匹配,根据预设规则对匹配成功的所述差值运算结果进标识,生成关于UFCS协议波形的信号序列,具体包括:将每一所述差值运算结果与UFCS协议波形的波特率集进行匹配;基于所述差值运算结果匹配的波特率计算所述差值运算结果传输单位比特所需的时间长度结果;当所述差值运算结果与对应的时间长度结果相等时,将所述差值运算结果标识为0信号;当所述差值运算结果为对应的时间长度结果的一半时,将所述差值运算结果标识为半1信号;其中,当两个相邻的所述半1信号时,将两个所述半1信号标识为1信号;基于所述0信号和所述1信号生成关于UFCS协议波形的0-1信号序列。In one embodiment, the second sequence generation module is used to match each of the difference operation results with the baud rate set of the UFCS protocol waveform one by one, and match the successfully matched difference operation results according to preset rules. identification, generating a signal sequence about the UFCS protocol waveform, specifically including: matching each difference operation result with the baud rate set of the UFCS protocol waveform; calculating the baud rate based on the difference operation result matching The difference operation result is the time length required to transmit the unit bit; when the difference operation result is equal to the corresponding time length result, the difference operation result is marked as a 0 signal; when the difference operation result When it is half of the corresponding time length result, the difference operation result is identified as a half-1 signal; wherein, when there are two adjacent half-1 signals, the two half-1 signals are identified as a 1 signal. ; Generate a 0-1 signal sequence regarding the UFCS protocol waveform based on the 0 signal and the 1 signal.

所属领域的技术人员可以清楚的了解到,为描述的方便和简洁,上述描述的装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the device described above can be referred to the corresponding process in the foregoing method embodiment, and will not be described again here.

本发明实施例提供一种基于I/O端口识别UFCS协议波形的装置,通过定时器对目标端口的信号翻转情况进行监测,根据记录的每一时钟值生成关于目标端口翻转情况的时间长度序列。将时间长度序列中的每一差值运算结果与UFCS协议波形的波特率集进行匹配,获取目标端口信号翻转情况与UFCS协议波形的信号关联关系。基于预设规则对匹配成功的差值运算结果进行标识,即可生成关于UFCS协议波形的信号序列,实现对UFXS协议波形的软解码,不需要在MCU中集成芯片也不需要部署波形识别电路,可以减低UFCS协议识别的成本,操作简单。Embodiments of the present invention provide a device that identifies UFCS protocol waveforms based on I/O ports, monitors the signal flip situation of the target port through a timer, and generates a time length sequence about the target port flip situation based on each recorded clock value. Match each difference operation result in the time length sequence with the baud rate set of the UFCS protocol waveform to obtain the signal correlation between the target port signal inversion and the UFCS protocol waveform. By identifying the successfully matched difference operation results based on preset rules, a signal sequence about the UFCS protocol waveform can be generated to realize soft decoding of the UFXS protocol waveform. There is no need to integrate a chip in the MCU or deploy a waveform recognition circuit. It can reduce the cost of UFCS protocol identification and is easy to operate.

以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明技术原理的前提下,还可以做出若干改进和替换,这些改进和替换也应视为本发明的保护范围。The above are only preferred embodiments of the present invention. It should be noted that those of ordinary skill in the art can also make several improvements and substitutions without departing from the technical principles of the present invention. These improvements and substitutions It should also be regarded as the protection scope of the present invention.

Claims (8)

1. A method for identifying UFCS protocol waveforms based on an I/O port, comprising:
monitoring the signal turnover condition of the target port in real time; when the signal of the target port is overturned, recording a clock value of a timer;
generating a signal turnover sequence based on each clock value, performing forward difference operation on each clock value in the signal turnover sequence, and generating a time length sequence according to each difference operation result;
matching each difference value operation result with the baud rate set of the UFCS protocol waveform one by one, and marking the successfully matched difference value operation result according to a preset rule to generate a signal sequence related to the UFCS protocol waveform; wherein, each difference value operation result is matched with the baud rate set of the UFCS protocol waveform; calculating a time length result required by the difference operation result to transmit a unit bit based on the baud rate matched with the difference operation result; when the difference value operation result is equal to the corresponding time length result, marking the difference value operation result as a 0 signal; when the difference value operation result is half of the corresponding time length result, the difference value operation result is marked as a half 1 signal; wherein when two adjacent half 1 signals, the two half 1 signals are identified as 1 signals; a 0-1 signal sequence is generated for a UFCS protocol waveform based on the 0 signal and the 1 signal.
2. The method for identifying UFCS protocol waveforms based on I/O ports as claimed in claim 1, wherein said monitoring signal flip condition of the target port in real time specifically comprises:
capturing a signal of the target port based on a first timer, and recording a clock value of the first timer when the signal is detected to overturn;
and carrying out overtime identification on the signal of the target port based on a second timer, and ending capturing the signal when the time interval from the last signal overturn is detected to exceed the longest pulse width of the signal of the UFCS protocol.
3. The method for identifying UFCS protocol waveforms based on an I/O port of claim 1, wherein said generating a signal flip sequence based on each of said clock values and performing a forward difference operation on each of said clock values in said signal flip sequence, and generating a time length sequence based on each difference operation result, specifically comprises:
sequentially recording and generating a signal overturning sequence based on the clock value of the timer according to the signal overturning sequence of the target port;
subtracting the previous clock value from the next clock value in every two adjacent clock values in the signal overturning sequence to generate a plurality of difference value operation results;
generating a time length sequence according to each difference value operation result; each difference operation result represents the pulse width of one signal inversion.
4. The device for identifying the UFCS protocol waveform based on the I/O port is characterized by comprising a port signal monitoring module, a first sequence generating module and a second sequence generating module, and specifically comprises the following steps:
the port signal monitoring module is used for monitoring the signal turnover condition of the target port in real time; when the signal of the target port is overturned, recording a clock value of a timer;
the first sequence generating module is used for generating a signal overturning sequence based on each clock value, carrying out forward difference value operation on each clock value in the signal overturning sequence, and generating a time length sequence according to each difference value operation result;
the second sequence generating module is used for matching each difference value operation result with the baud rate set of the UFCS protocol waveform one by one, marking the successfully matched difference value operation result according to a preset rule, and generating a signal sequence related to the UFCS protocol waveform; wherein, each difference value operation result is matched with the baud rate set of the UFCS protocol waveform; calculating a time length result required by the difference operation result to transmit a unit bit based on the baud rate matched with the difference operation result; when the difference value operation result is equal to the corresponding time length result, marking the difference value operation result as a 0 signal; when the difference value operation result is half of the corresponding time length result, the difference value operation result is marked as a half 1 signal; wherein when two adjacent half 1 signals, the two half 1 signals are identified as 1 signals; a 0-1 signal sequence is generated for a UFCS protocol waveform based on the 0 signal and the 1 signal.
5. The device for identifying UFCS protocol waveforms based on an I/O port as claimed in claim 4, wherein said port signal monitoring module is configured to monitor signal flip conditions of a target port in real time, and specifically comprises:
capturing a signal of the target port based on a first timer, and recording a clock value of the first timer when the signal is detected to overturn;
and carrying out overtime identification on the signal of the target port based on a second timer, and ending capturing the signal when the time interval from the last signal overturn is detected to exceed the longest pulse width of the signal of the UFCS protocol.
6. The apparatus for identifying UFCS protocol waveforms based on an I/O port of claim 4, wherein said first sequence generating module is configured to generate a signal flip sequence based on each of said clock values and perform a forward difference operation on each of said clock values in said signal flip sequence, and generate a time length sequence based on each of the difference operation results, and specifically comprises:
sequentially recording and generating a signal overturning sequence based on the clock value of the timer according to the signal overturning sequence of the target port;
subtracting the previous clock value from the next clock value in every two adjacent clock values in the signal overturning sequence to generate a plurality of difference value operation results;
generating a time length sequence according to each difference value operation result; each difference operation result represents the pulse width of one signal inversion.
7. A terminal device comprising a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, the processor implementing the method of identifying UFCS protocol waveforms based on I/O ports as claimed in any of claims 1 to 3 when the computer program is executed by the processor.
8. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored computer program, wherein the computer program, when run, controls a device in which the computer readable storage medium is located to perform the method of identifying UFCS protocol waveforms based on an I/O port as claimed in any of claims 1 to 3.
CN202310095659.9A 2023-02-06 2023-02-06 Method and device for identifying UFCS protocol waveform based on I/O port Active CN116131402B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310095659.9A CN116131402B (en) 2023-02-06 2023-02-06 Method and device for identifying UFCS protocol waveform based on I/O port

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310095659.9A CN116131402B (en) 2023-02-06 2023-02-06 Method and device for identifying UFCS protocol waveform based on I/O port

Publications (2)

Publication Number Publication Date
CN116131402A CN116131402A (en) 2023-05-16
CN116131402B true CN116131402B (en) 2024-01-02

Family

ID=86297083

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310095659.9A Active CN116131402B (en) 2023-02-06 2023-02-06 Method and device for identifying UFCS protocol waveform based on I/O port

Country Status (1)

Country Link
CN (1) CN116131402B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111415109A (en) * 2020-06-09 2020-07-14 中国人民解放军国防科技大学 Data-driven method for evaluating emergency guarantee capability of earth observation satellite power supply system
CN111817924A (en) * 2020-09-01 2020-10-23 深圳芯邦科技股份有限公司 Test method and related equipment
CN113422525A (en) * 2021-06-24 2021-09-21 Tcl空调器(中山)有限公司 PFC circuit control method, device, equipment and computer readable storage medium
CN113535610A (en) * 2021-07-13 2021-10-22 珠海格力电器股份有限公司 Single-wire communication equipment and control method and storage medium thereof
CN114709906A (en) * 2022-05-20 2022-07-05 北京士昌鼎科技有限公司 Charging circuit based on multiple protocols and application method thereof
CN115086454A (en) * 2022-07-21 2022-09-20 北京金橙子科技股份有限公司 Method, system and storage medium for self-adaptive galvanometer control signal interface

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160381563A1 (en) * 2015-06-29 2016-12-29 Freescale Semiconductor, Inc. Low interference cellular data commnunication in unlicensed frequency spectrum

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111415109A (en) * 2020-06-09 2020-07-14 中国人民解放军国防科技大学 Data-driven method for evaluating emergency guarantee capability of earth observation satellite power supply system
CN111817924A (en) * 2020-09-01 2020-10-23 深圳芯邦科技股份有限公司 Test method and related equipment
CN113422525A (en) * 2021-06-24 2021-09-21 Tcl空调器(中山)有限公司 PFC circuit control method, device, equipment and computer readable storage medium
CN113535610A (en) * 2021-07-13 2021-10-22 珠海格力电器股份有限公司 Single-wire communication equipment and control method and storage medium thereof
CN114709906A (en) * 2022-05-20 2022-07-05 北京士昌鼎科技有限公司 Charging circuit based on multiple protocols and application method thereof
CN115086454A (en) * 2022-07-21 2022-09-20 北京金橙子科技股份有限公司 Method, system and storage medium for self-adaptive galvanometer control signal interface

Also Published As

Publication number Publication date
CN116131402A (en) 2023-05-16

Similar Documents

Publication Publication Date Title
CN113872967B (en) Vehicle information transmission method and device, electronic equipment and storage medium
CN112995654A (en) Video playing pause detection method and device, server and readable storage medium
CN102202132B (en) Method, system and equipment for initializing networking equipment
CN111865952A (en) Data processing method, data processing device, storage medium and electronic equipment
WO2022012529A1 (en) Charger, data line and charging device
US9271099B1 (en) Method and apparatus to use audio port to provide power and data communications for peripheral devices
CN108200387A (en) A kind of transmission method of file, system and camera
CN111526068B (en) Fault reporting method and terminal
CN116131402B (en) Method and device for identifying UFCS protocol waveform based on I/O port
CN118890341B (en) Multimodal agent interaction method, device and equipment
CN113485282B (en) Message tracking display method, system, equipment and storage medium for distributed control system
CN114372797A (en) Payment method, apparatus, system, electronic device, and computer-readable storage medium
CN111314375B (en) Medical insurance data adaptation engine, medical insurance data adaptation method, electronic equipment and storage medium
CN113873026A (en) Dynamic timeout response method, device, terminal equipment and storage medium
CN111294241B (en) Configurable Internet of things equipment access method
CN108628789A (en) The method, apparatus and USB device that detection USB device is connect with host
CN108289165B (en) Method and device for realizing camera control based on mobile phone and terminal equipment
CN100356359C (en) Connector between processor and user recognition card
CN104122820A (en) Sensor interface chip and sensor signal detection system
WO2020228451A1 (en) Fast identity online method, fast identity online device and card reader
CN115550117A (en) Signal transmission method and device, storage medium and electronic device of master-slave equipment
CN115378094A (en) Electronic device, charging device, and charging control method
CN113114755A (en) Method and device for smooth switching between devices, electronic device and storage medium
CN113849443A (en) I2C bus signal analysis method, system, terminal and storage medium
CN113141409A (en) Data transmission method and device, terminal equipment and readable 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
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A method and device for identifying UFCS protocol waveforms based on I/O ports

Granted publication date: 20240102

Pledgee: Shanghai Pudong Development Bank Limited by Share Ltd. Guangzhou branch

Pledgor: UNICMICRO (GUANGZHOU) Co.,Ltd.

Registration number: Y2024980014756

PE01 Entry into force of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Granted publication date: 20240102

Pledgee: Shanghai Pudong Development Bank Limited by Share Ltd. Guangzhou branch

Pledgor: UNICMICRO (GUANGZHOU) Co.,Ltd.

Registration number: Y2024980014756