CN116131402A - 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
CN116131402A
CN116131402A CN202310095659.9A CN202310095659A CN116131402A CN 116131402 A CN116131402 A CN 116131402A CN 202310095659 A CN202310095659 A CN 202310095659A CN 116131402 A CN116131402 A CN 116131402A
Authority
CN
China
Prior art keywords
signal
ufcs
sequence
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.)
Granted
Application number
CN202310095659.9A
Other languages
Chinese (zh)
Other versions
CN116131402B (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

Images

Landscapes

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

Abstract

The invention discloses a method and a device for identifying UFCS protocol waveforms based on IO ports, wherein the method comprises the following steps: 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; and 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. The invention can be used for realizing soft decoding of the UFCS protocol waveform.

Description

Method and device for identifying UFCS protocol waveform based on I/O port
Technical Field
The invention relates to the technical field of quick charging, in particular to a method and a device for identifying UFCS protocol waveforms based on an IO port.
Background
In recent years, the rapid charging technology of terminals is rapidly developed, particularly, the charging speed, the charging safety and the charging intelligent management are obviously promoted, and the rapid charging experience is widely accepted by the majority of users and becomes the standard characteristic of intelligent terminals such as mobile phones. However, the fast charging industry has the problem of mutually incompatible protocols for a long time: the different brands of terminals and the adapter cannot be effectively identified, and only low-power charging can be realized. On the one hand, the quick charging experience of the user is greatly restricted and limited, and the incompatibility problem becomes a great pain point of the user.
UFCS is a new generation of fusion fast-charging protocol which is made by communication institute, huacheng, OPPO, vivo, millet pulling head, and multiple terminals such as Siderurger, ruifeng micro-technology, lihui electronic, chip enterprises and industry partners. The protocol aims to formulate a fusion rapid charging standard of the mobile terminal, solve the problem of incompatibility of the inter-working rapid charging and create a rapid, safe and compatible charging use environment for the terminal user. However, the current method for realizing the UFCS fusion fast charging protocol is mainly a hard decoding method of integrating a decoding mode into an MCU chip and sampling and identifying signal changes of all pins in a charging interface through a protocol identification circuit, so that the flexibility is low.
Disclosure of Invention
The application provides a method and a device for identifying UFCS protocol waveforms based on an I/O port, which are used for realizing soft decoding of UFCS protocol waveforms.
In a first aspect, the present application provides a method for identifying a UFCS protocol waveform based on an I/O port, including:
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;
and 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.
The utility model provides a device based on I/O port discernment UFCS protocol waveform monitors the signal upset condition of target port through the timer, generates the time length sequence that is about target port upset condition according to each clock value of record. And matching each difference value operation result in the time length sequence with the baud rate set of the UFCS protocol waveform to obtain the signal association relation between the signal overturn condition of the target port and the UFCS protocol waveform. The difference value operation result successfully matched is identified based on a preset rule, so that a signal sequence related to the UFCS protocol waveform can be generated, soft decoding of the UFCS protocol waveform is realized, a chip is not required to be integrated in an MCU, a waveform identification circuit is not required to be deployed, the cost of UFCS protocol identification can be reduced, and the operation is simple.
In one implementation manner, the monitoring the signal flip condition of the target port in real time specifically includes:
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.
In one implementation manner, the generating a signal flip sequence based on each clock value, performing a forward difference operation on each clock value in the signal flip sequence, and generating a time length sequence according to each difference operation result specifically includes:
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.
In one implementation manner, the matching of each difference value operation result with the baud rate set of the UFCS protocol waveform is performed one by one, and the information conversion is performed on the difference value operation result successfully matched according to a preset rule, so as to generate a signal sequence related to the UFCS protocol waveform, which specifically includes:
matching each difference value operation result 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.
In a second aspect, the present application provides an apparatus for identifying a UFCS protocol waveform based on an I/O port, including a port signal monitoring module, a first sequence generating module, and a second sequence generating module, specifically:
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, and identifying the successfully matched difference value operation result according to a preset rule to generate a signal sequence related to the UFCS protocol waveform.
The utility model provides a device based on I/O port discernment UFCS protocol waveform monitors the signal upset condition of target port through the timer, generates the time length sequence that is about target port upset condition according to each clock value of record. And matching each difference value operation result in the time length sequence with the baud rate set of the UFCS protocol waveform to obtain the signal association relation between the signal overturn condition of the target port and the UFCS protocol waveform. The difference value operation result successfully matched is identified based on a preset rule, so that a signal sequence related to the UFCS protocol waveform can be generated, soft decoding of the UFCS protocol waveform is realized, a chip is not required to be integrated in an MCU, a waveform identification circuit is not required to be deployed, the cost of UFCS protocol identification can be reduced, and the operation is simple.
In one implementation manner, the port signal monitoring module is configured to monitor a signal inversion condition of a target port in real time, and specifically includes:
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.
In one implementation manner, the first sequence generating module is configured to generate a signal flip sequence based on each clock value, perform a forward difference operation on each clock value in the signal flip sequence, and generate a time length sequence according to each difference operation result, and specifically includes:
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.
In one implementation manner, the second sequence generating module is configured to match each difference value operation result with a baud rate set of the UFCS protocol waveform one by one, identify the difference value operation result that is successfully matched according to a preset rule, and generate a signal sequence related to the UFCS protocol waveform, and specifically includes:
matching each difference value operation result 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.
In a third aspect, the present application also provides 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 a method of identifying UFCS protocol waveforms based on I/O ports as described above when executing the computer program.
In a fourth aspect, the present application further provides a computer readable storage medium, where the computer readable storage medium includes a stored computer program, where when the computer program runs, the computer readable storage medium is controlled to execute a method for identifying a UFCS protocol waveform based on an I/O port as described above.
Drawings
Fig. 1 is a flow chart of a method for identifying UFCS protocol waveforms based on an I/O port according to an embodiment of the present invention;
fig. 2 is a block diagram of an apparatus for identifying UFCS protocol waveforms based on an I/O port according to an embodiment of the present invention.
Detailed Description
The following describes in further detail the embodiments of the present invention with reference to the drawings and examples. The following examples are illustrative of the invention and are not intended to limit the scope of the invention.
The terms first and second and the like in the description and in the claims of the present application and in the drawings are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearances of such phrases 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 of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
Example 1
Referring to fig. 1, fig. 1 is a flow chart of a method for identifying UFCS protocol waveforms based on an I/O port according to an embodiment of the present invention. The embodiment of the invention provides a method for identifying UFCS protocol waveforms based on an I/O port, which comprises steps 101 to 103, wherein the steps are as follows:
step 101: 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;
step 102: 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;
step 103: and 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.
In the embodiment of the invention, the target port refers to a port of the MCU for decoding the UFCS protocol. Receiving and transmitting UFCS protocol signals on a target port D+/D-according to the protocol time operation condition, wherein the target port performs time-sharing transmission and receiving according to the type of the equipment serving as the target port, and D-is a transmitting end and D+ is a receiving end when the target port serves as charging equipment; d-is a receiving end when the power supply device is used, and D+ is a transmitting end. The target port is set to analog input when it needs to receive and set to timer capture. It should be noted that d+/D-is only one number indicating method of the destination port, and may be described as DP/DM, which is not limited herein.
In an embodiment, the monitoring the signal flip condition of the target port in real time specifically includes: 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. In the embodiment of the invention, the MCU timer is used for capturing the signal of the target port, and the capturing type can be set as rising edge capturing, falling edge capturing or double edge capturing in a self-defined manner. And recording the signal overturn condition of the target port through a timer, generating interruption when the port level of the target port is overturned, and recording the clock value of the timer after entering an interruption function. If the timer MCU is 16 bits, the timer has a clock value range of [0, 65535], and when the timer toggles the I/O port level at clock value 327, this value is recorded 327 after an interrupt is entered. The timer clock value continues to increment after the interrupt occurs, and when the timer value again toggles the I/O port level at 1088, the value is recorded 1088 again. And so on, the value of the timer is recorded each time a level flip occurs. In the embodiment of the invention, the signal capturing is started through the first timer and the overtime identification is also performed through the second timer. The second timer is cleared immediately whenever a level flip occurs in the first timer. And when the fact that the signal is still not turned after the last level turning exceeds the longest pulse width of the signal in the UFCS protocol is detected, judging that the signal reception is finished, and starting to decode the received clock value of each timer.
In an embodiment, the generating a signal flip sequence based on each clock value, performing a forward difference operation on each clock value in the signal flip sequence, and generating a time length sequence according to each difference operation result specifically includes: 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. And according to the signal turning sequence of the target port, sequentially recording the clock value of the timer, and generating the signal turning sequence of the current received signal after the signal reception is finished. Subtracting the clock value from the next clock value in every two adjacent clock values in the sequence, wherein the difference between the two clock values represents the pulse width of one signal inversion. And carrying out forward difference value operation on each clock value in the generated signal inversion sequence, so as to generate a time length sequence related to signal inversion.
In an embodiment, the matching each difference operation result with the baud rate set of the UFCS protocol waveform one by one, and converting information of the successfully matched difference operation result according to a preset rule, so as to generate a signal sequence related to the UFCS protocol waveform, which specifically includes: matching each difference value operation result 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. In the embodiment of the invention, each generated difference value operation result is matched with the baud rate set of the UFCS protocol waveform. The UFCS protocol waveform is a Training sequence (0 xAA) + data frame (UFCS protocol has four baud rates). If the matching is successful, calculating the time required for transmitting the 1bit of the difference operation result according to the matching result. Preferably, if the baud rate of the matching of the difference operation result is 115200, the bit time is 1000000 us/115200=8.6 us. As an optimization scheme of the embodiment of the invention, whether the minimum pulse width length in the time length sequence is 8.6us or not can be judged, and whether the baud rate of the rest difference operation results is 115200 or not can be judged. When the pulse width length of the difference operation result is the transmission 1bit time length, the difference operation result, namely the pulse width is marked as a 0 signal, and when the pulse width length of the difference operation result is half the transmission 1bit time length, the difference operation result is marked as a half 1 signal. If there are two adjacent half 1 signals, then the two half 1 signals are identified as 1 signal. When each difference operation result in the time length sequence is identified, a 0-1 signal sequence related to the UFCS protocol waveform can be generated.
The embodiment of the invention also provides equipment for identifying the UFCS protocol based on the I/O port, which comprises a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, wherein the method for identifying the UFCS protocol waveform based on the I/O port is realized when the processor executes the computer program.
In an embodiment of the present invention, a computer readable storage medium is further provided, where the computer readable storage medium includes a stored computer program, and when the computer program runs, a device where the computer readable storage medium is located is controlled to execute the above UFCS protocol based on I/O port identification.
The computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to accomplish the present invention, for example. The one or more modules may be a series of computer program instruction segments capable of performing specific functions for describing the execution of the computer program in a UFCS protocol device based on I/O port identification.
The device based on the UFCS protocol can be a computing device such as a desktop computer, a notebook computer, a palm computer and a cloud server. The device that recognizes the UFCS protocol based on the I/O port may include, but is not limited to, a processor, memory, display. It will be appreciated by those skilled in the art that the above components are merely examples of devices that identify UFCS protocol based on I/O ports and do not constitute a limitation of devices that collect data based on scanning devices, and may include more or fewer components than those described, or may combine certain components, or different components, e.g., the devices that identify UFCS protocol based on I/O ports may also include input-output devices, network access devices, buses, etc.
The processor may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital SignalProcessor, DSP), application specific integrated circuits (Application Specific IntegratedCircuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, which is a control center of the device based on the I/O port identification UFCS protocol, and which connects various parts of the entire device based on the I/O port identification UFCS protocol using various interfaces and lines.
The memory may be used to store the computer program and/or modules, and the processor may implement various functions of the scanning device-based data collection device by running or executing the computer program and/or modules stored in the memory and invoking data stored in the memory. 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 (such as a sound playing function, a text conversion function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data, text message data, etc.) created according to the use of the cellular phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid-state storage device.
Wherein the device integrated module based on the I/O port identification UFCS protocol may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a stand alone product. Based on this understanding, the present invention may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and the computer program may implement the steps of each method embodiment described above when executed by a processor. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
The embodiment of the invention provides a method for identifying UFCS protocol waveforms based on an I/O port, which monitors the signal overturn condition of a target port through a timer and generates a time length sequence related to the overturn condition of the target port according to each recorded clock value. And matching each difference value operation result in the time length sequence with the baud rate set of the UFCS protocol waveform to obtain the signal association relation between the signal overturn condition of the target port and the UFCS protocol waveform. The difference value operation result successfully matched is identified based on a preset rule, so that a signal sequence related to the UFCS protocol waveform can be generated, soft decoding of the UFCS protocol waveform is realized, a chip is not required to be integrated in an MCU, a waveform identification circuit is not required to be deployed, the cost of UFCS protocol identification can be reduced, and the operation is simple.
Example 2
Referring to fig. 2, fig. 2 is a block diagram of an apparatus for identifying UFCS protocol waveforms based on an I/O port according to an embodiment of the present invention. The embodiment of the invention provides a device for identifying UFCS protocol waveforms based on an I/O port, which comprises a port signal monitoring module 201, a first sequence generating module 202 and a second sequence generating module 203, and specifically comprises the following steps:
the port signal monitoring module 201 is configured to monitor a signal inversion condition of a 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 202 is configured to generate a signal flip sequence based on each clock value, perform a forward difference operation on each clock value in the signal flip sequence, and generate a time length sequence according to each difference operation result;
the second sequence generating module 203 is configured 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 result according to a preset rule, and generate a signal sequence related to the UFCS protocol waveform.
In an embodiment, the port signal monitoring module is configured to monitor a signal inversion condition of a target port in real time, and specifically includes: 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.
In an embodiment, the first sequence generating module is configured to generate a signal flip sequence based on each clock value, perform a forward difference operation on each clock value in the signal flip sequence, and generate a time length sequence according to each difference operation result, and specifically includes: 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.
In an embodiment, the second sequence generating module is configured to match each of the difference operation results with a baud rate set of the UFCS protocol waveform one by one, identify the difference operation result successfully matched according to a preset rule, and generate a signal sequence related to the UFCS protocol waveform, and specifically includes: matching each difference value operation result 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.
It will be clear to those skilled in the art that, for convenience and brevity of description, reference may be made to the corresponding process in the foregoing method embodiment for the specific working process of the above-described apparatus, which is not described herein again.
The embodiment of the invention provides a device for identifying UFCS protocol waveforms based on an I/O port, which monitors the signal overturn condition of a target port through a timer and generates a time length sequence related to the overturn condition of the target port according to each recorded clock value. And matching each difference value operation result in the time length sequence with the baud rate set of the UFCS protocol waveform to obtain the signal association relation between the signal overturn condition of the target port and the UFCS protocol waveform. The difference value operation result successfully matched is identified based on a preset rule, so that a signal sequence related to the UFCS protocol waveform can be generated, soft decoding of the UFCS protocol waveform is realized, a chip is not required to be integrated in an MCU, a waveform identification circuit is not required to be deployed, the cost of UFCS protocol identification can be reduced, and the operation is simple.
The foregoing is merely a preferred embodiment of the present invention, and it should be noted that modifications and substitutions can be made by those skilled in the art without departing from the technical principles of the present invention, and these modifications and substitutions should also be considered as being within the scope of the present invention.

Claims (10)

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;
and 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.
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 method for identifying UFCS protocol waveforms based on I/O ports as claimed in claim 1, wherein said matching each of said difference operation results with a baud rate set of UFCS protocol waveforms one by one, converting information of said difference operation results successfully matched according to a preset rule, generating a signal sequence related to UFCS protocol waveforms, specifically comprises:
matching each difference value operation result 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 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, and identifying the successfully matched difference value operation result according to a preset rule to generate a signal sequence related to the UFCS protocol waveform.
6. The device for identifying UFCS protocol waveforms based on an I/O port as claimed in claim 5, 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.
7. The apparatus for identifying UFCS protocol waveforms based on an I/O port of claim 5, 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.
8. The apparatus for identifying UFCS protocol waveforms based on I/O ports of claim 5, wherein said second sequence generating module is configured to match each of said difference operation results with a baud rate set of UFCS protocol waveforms one by one, identify said difference operation results successfully matched according to a preset rule, and generate a signal sequence related to UFCS protocol waveforms, and specifically comprises:
matching each difference value operation result 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.
9. 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 4 when the computer program is executed by the processor.
10. 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 I/O ports as claimed in any of claims 1 to 4.
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 true CN116131402A (en) 2023-05-16
CN116131402B 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 (7)

* 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
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

Patent Citations (7)

* 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
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
CN116131402B (en) 2024-01-02

Similar Documents

Publication Publication Date Title
CN107256707B (en) Voice recognition method, system and terminal equipment
EP3179596A1 (en) Charging method, mobile terminal, and charging device
CN104147780B (en) A kind of method and user terminal for switching game terminal
CN107657973A (en) Text and audio mix display methods, device, terminal device and storage medium
CN107257417A (en) Message prompt method and terminal, computer installation and computer-readable recording medium
CN111431734A (en) Network distribution method of intelligent equipment and related device
CN102202132B (en) Method, system and equipment for initializing networking equipment
CN106782604A (en) The processing method of speech message, device and its electronic equipment
US20230140279A1 (en) Inter-processor communication method, electronic assembly, and electronic device
CN109951400A (en) Instruction sending method, device, electronic equipment and the readable storage medium storing program for executing of terminal
CN111356117A (en) Voice interaction method and Bluetooth device
CN105117121A (en) Help seeking method of smartwatch and smartwatch
CN107592427B (en) Mode switching method, terminal device and computer readable storage medium
CN110796096B (en) Training method, device, equipment and medium for gesture recognition model
CN108363628A (en) Message treatment method, device, terminal and computer readable storage medium
CN116131402B (en) Method and device for identifying UFCS protocol waveform based on I/O port
CN108986809B (en) Portable equipment and awakening method and device thereof
CN112711955B (en) NFC information transmission method, NFC information transmission device and terminal
CN115986887A (en) Charging method and device and electronic equipment
CN106508105B (en) For RF identification read write line to label information transferring method
CN110909359A (en) Communication method based on dual-system architecture and terminal equipment
CN108255561B (en) The processing method of blank screen, device and computer readable storage medium when page switching
CN109582253A (en) A kind of connection method of blue-tooth printer, device, printer and storage medium
CN104615271A (en) Processing method for KVM (Kernel-based Virtual Machine) and processing device for KVM
CN109286559B (en) Information transmission method, device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
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