Method, device and equipment for implementing encoding and decoding based on USB differential signal line

Through the hardware encoding and decoding method based on USB differential signal lines, the problem of slow software encoding and decoding and resource occupation is solved, a fast encoding and decoding process is realized, and the upgrade of multiple protocols is supported.

CN112559422BActive Publication Date: 2024-10-29SHENZHEN CHIPSVISION MICRO CO LTD
View PDF 16 Cites 0 Cited by

Patent Information

Application Number
CN202011553034.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-24
Publication Date
2024-10-29
Estimated Expiration
2040-12-24

AI Technical Summary

Technical Problem

In the existing technology, software is used for encoding and decoding, which is slow and takes up system resources, increasing the complexity of the software.

Method used

A hardware encoding and decoding method based on USB differential signal lines is used to decode and encode data through USB D+ and D- signal lines. The hardware unit is used to encode and decode the data part, and the decoded data is handed over to the software for processing.

Benefits of technology

It improves the decoding speed, does not occupy system resources, is more flexible, supports multiple protocols, and facilitates protocol upgrades.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112559422B_ABST
    Figure CN112559422B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device and equipment for implementing encoding and decoding based on a USB differential signal line. The USB differential signal line includes a USB D+ signal line and a USB D- signal line. The method includes: detecting a data receiving instruction, acquiring data through the USB D- signal line; decoding and storing the data according to a preset decoding rule; detecting a data sending instruction, encoding the data according to a preset encoding rule, and sending the encoded data to a designated device through the USB D- signal line. The embodiment of the present invention uses hardware for encoding and decoding, which can improve the decoding speed and does not occupy system resources. The hardware only encodes and decodes the data part, and the data application part is handled by the software. It is more flexible, supports multiple protocols, and can easily upgrade the protocol.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a method, device and equipment for implementing encoding and decoding based on a USB differential signal line. Background Art

[0002] Coding is the process of converting information from one form or format to another. It is also called the code of computer programming language, abbreviated as coding. It uses a predetermined method to encode text, numbers or other objects into digital form, or convert information and data into a specified electrical pulse signal. Coding is widely used in electronic computers, televisions, remote controls and communications. Coding is the process of converting information from one form or format to another. Decoding is the reverse process of coding.

[0003] In the prior art, software is used for encoding and decoding, but software encoding and decoding has the problems of slow speed, occupying system resources, and increasing software complexity.

[0004] Therefore, the prior art still needs to be improved and developed. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, the purpose of the present invention is to provide a method, device and equipment for implementing encoding and decoding based on USB differential signal lines, aiming to solve the technical problems in the prior art of using software for encoding and decoding, which has slow speed, occupies system resources and increases software complexity.

[0006] The technical solution of the present invention is as follows:

[0007] A method for implementing encoding and decoding based on a USB differential signal line, wherein the USB differential signal line includes a USB D+ signal line and a USB D- signal line, and the method includes:

[0008] Detects the data receiving instruction and obtains data through the USB D-signal line;

[0009] Decode and store the data according to preset decoding rules;

[0010] The data transmission instruction is detected, the data is encoded according to the preset encoding rules, and the encoded data is sent to the designated device through the USB D-signal line.

[0011] Furthermore, the method is used to encode and decode fast charging protocol data, and the fast charging protocol data includes ping packets and data packets.

[0012] Further preferably, the decoding and storing of data according to a preset decoding rule comprises:

[0013] The high and low levels are parsed according to the preset decoding rules, converted into corresponding data according to the protocol and stored.

[0014] Further preferably, encoding the data according to a preset encoding rule includes:

[0015] Get the data to be sent, convert the data into high and low levels according to the preset protocol, and complete the encoding.

[0016] Preferably, sending the encoded data to a designated device via a USB D-signal line comprises:

[0017] Get the type of device and send the encoded data to the specified device through the USB D-signal line according to the type of device.

[0018] Furthermore, if the type of the device is a master device, the encoded data is sent to the designated device via the USB D-signal line according to the state of the device.

[0019] Get the start status configured by the user and start sending pings;

[0020] Receive the low level state of ping and send the first synchronization code to the specified device;

[0021] After detecting that the master device is successfully synchronized with the designated device, data is sent to the designated device;

[0022] After detecting that the data transmission is completed, a second synchronization code is sent to the designated device;

[0023] After detecting that the master device has successfully synchronized with the specified device, the final ping status is sent to complete sending the encoded data to the specified device.

[0024] Furthermore, if the device type is a slave device, the encoded data is sent to the designated device via the USB D-signal line according to the state of the device.

[0025] Get the start status sent by the master device and start sending ping;

[0026] Receive the low level state of ping and send the third synchronization code to the specified device;

[0027] After detecting that the slave device is successfully synchronized with the specified device, data is sent to the specified device;

[0028] After detecting that the data transmission is completed, a fourth synchronization code is sent to the designated device;

[0029] After detecting that the slave device has successfully synchronized with the specified device, the last ping status is sent to complete sending the encoded data to the specified device.

[0030] Another embodiment of the present invention provides a coding and decoding implementation device based on a USB differential signal line, wherein the USB differential signal line includes a USB D+ signal line and a USB D- signal line, and the device includes:

[0031] A data acquisition module, used for detecting a data receiving instruction and acquiring data through a USB D-signal line;

[0032] A decoding module, used to decode and store data according to preset decoding rules;

[0033] The encoding module is used to detect the data sending instruction, encode the data according to the preset encoding rules, and send the encoded data to the designated device through the USB D-signal line.

[0034] Another embodiment of the present invention provides a coding and decoding implementation device based on a USB differential signal line, the device comprising at least one processor; and

[0035] a memory communicatively connected to the at least one processor; wherein,

[0036] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned encoding and decoding implementation method based on the USB differential signal line.

[0037] Another embodiment of the present invention further provides a non-volatile computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the one or more processors can execute the above-mentioned encoding and decoding implementation method based on the USB differential signal line.

[0038] Beneficial effect: The embodiment of the present invention adopts hardware for encoding and decoding, which can improve the decoding speed and does not occupy system resources. The hardware only encodes and decodes the data part, and the data application part is handled by the software. It is more flexible, supports multiple protocols, and can easily upgrade the protocol. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:

[0040] Figure 1 It is a flow chart of a preferred embodiment of a coding and decoding implementation method based on USB differential signal lines of the present invention;

[0041] Figure 2 A schematic diagram of the encoding processing structure of a preferred embodiment of an encoding and decoding implementation method based on a USB differential signal line of the present invention;

[0042] Figure 3 A schematic diagram of a sequence of a fast charging protocol according to a preferred embodiment of a coding and decoding implementation method based on a USB differential signal line of the present invention;

[0043] Figure 4 A schematic diagram of functional modules of a preferred embodiment of a coding and decoding implementation device based on a USB differential signal line of the present invention;

[0044] Figure 5 The figure is a schematic diagram of the hardware structure of a preferred embodiment of a coding and decoding implementation device based on a USB differential signal line of the present invention. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. The embodiments of the present invention are described below in conjunction with the accompanying drawings.

[0046] The embodiment of the present invention provides a method for implementing encoding and decoding based on a USB differential signal line. Figure 1 , Figure 1 The flowchart of a preferred embodiment of a coding and decoding implementation method based on a USB differential signal line of the present invention. The USB differential signal line includes a USB D+ signal line and a USB D- signal line. Figure 1 As shown, it includes the steps of:

[0047] Step S100, a data receiving instruction is detected, and data is obtained through the USB D-signal line;

[0048] Step S200: Decode and store the data according to a preset decoding rule;

[0049] Step S300: Detect a data transmission instruction, encode the data according to a preset encoding rule, and send the encoded data to a designated device via a USBD- signal line.

[0050] In specific implementation, the encoding and decoding method based on the USB differential signal line of the embodiment of the present invention works in a simplex mode, and the USB differential signal line refers to the two data lines D+ and D- of the USB interface. Figure 2As shown in the dotted box in . The codec unit includes a receiving FIFO (RX_FIFO), a receiving control (RX_CONTROL), a transmitting FIFO (TX_FIFO), a transmitting control (TX_CONTROL), a register (REG_WR) for interacting with software, and a data sampling clock generator (CLK_GEN). The data receiving process of the embodiment of the present invention is the decoding process, and the data sending process is the encoding process.

[0051] When a data receiving instruction is detected, that is, decoding is required, the received data is obtained through the USB D-channel, the data is decoded according to the preset decoding rules and placed in the FIFO. When a data sending instruction is detected, that is, encoding is required, the data is taken out from the FIFO and encoded according to the preset encoding rules, and the encoded data is sent to the designated device through the USB D-signal line. The designated device refers to the data sending object.

[0052] The embodiment of the present invention uses hardware for encoding and decoding, which can improve the decoding speed and does not occupy system resources. The hardware only encodes and decodes the data part, and does not parse the decoded data. The parsed data is handed over to the software for processing. This is more flexible, supports multiple protocols, and can easily upgrade the protocol. The embodiment of the present invention supports both the host end and the slave end through software configuration. The encoding and decoding process does not require software intervention.

[0053] Furthermore, the encoding and decoding implementation method based on the USB differential signal line of the embodiment of the present invention is used to encode and decode the fast charging protocol data, and the fast charging protocol data includes a ping packet and a data packet.

[0054] In specific implementation, the charger circuit based on the PD protocol can keep the AC / DC part unchanged, but replace the PD protocol controller with a fast charging protocol controller. Fast charging protocol data includes ping packets and data packets. The ping packet is used to determine whether the local host can successfully exchange (send and receive) data packets with another host. Based on the returned information, it can be inferred whether the voltage and current parameters are set correctly, whether the operation is normal, and whether the network is unobstructed.

[0055] like Figure 3 Shown is a schematic diagram of the sequence of the fast charging protocol. Figure 3MPING refers to the duration of MAST PING; SPING refers to the duration of slave PING, Mdata refers to the duration of mast data, and Sdata refers to the duration of slave data. From the sequence point of view, the protocol is divided into ping packets and data packets. A data packet is 9 bits, 8 bits of data + 1 bit of check bit. Each data packet has an identification code at the sender, and the last byte of data also has an identification code. Based on the above characteristics, this method uses a counter to sample. When the sampled signal jumps, the counter is cleared.

[0056] When the data sampling clock generator is equal to the duration of ping, ping is received; when the counter is equal to the duration of identification code, the data receiving state is entered. After receiving the last bit, if the identification code is continued to be received, the data is put into FIFO and the next byte data is continued to be received; if the next ping is received, the reception is ended. The duration of ping refers to the time when ping is sent, which is determined by the standard. The identification code time is the identification code time, which is different from the ping sending time and is also determined by the standard.

[0057] Furthermore, the data is decoded and stored according to a preset decoding rule, including:

[0058] The high and low levels are parsed according to the preset decoding rules, converted into corresponding data according to the protocol and stored.

[0059] In specific implementation, decoding is a data receiving process, which is to analyze the high and low levels, convert them into corresponding data according to a preset protocol, and put these data into FIFO.

[0060] Furthermore, the data is encoded according to a preset encoding rule, including:

[0061] Get the data to be sent, convert the data into high and low levels according to the preset protocol, and complete the encoding.

[0062] In specific implementation, encoding refers to the sending process, sending the width of high and low levels according to the protocol requirements, taking data in the FIFO and converting them into high and low levels and sending them out.

[0063] Further, the encoded data is sent to a designated device via a USB D-signal line, including:

[0064] Get the type of device and send the encoded data to the specified device through the USB D-signal line according to the type of device.

[0065] In specific implementation, the device may be a master device or a slave device. According to the different data packet sending processes of the master device or the slave device, the encoded data is sent to the designated device through the D-channel of the USB.

[0066] Furthermore, if the device type is a master device, the encoded data is sent to the designated device via the USB D-signal line according to the state of the device.

[0067] Get the start status configured by the user and start sending pings;

[0068] Receive the low level state of ping and send the first synchronization code to the specified device;

[0069] After detecting that the master device is successfully synchronized with the designated device, data is sent to the designated device;

[0070] After detecting that the data transmission is completed, a second synchronization code is sent to the designated device;

[0071] After detecting that the master device has successfully synchronized with the specified device, the final ping status is sent to complete sending the encoded data to the specified device.

[0072] In specific implementation, the transmission is divided into master device and slave device. The master device can be abbreviated as master, and the slave device can be abbreviated as slave. As a master device, the transmission process is as follows: the user sends a ping, waits to receive the ping sent by the slave, sends data, and the data length is controlled by the FIFO data. When the FIFO is empty after the last data is sent, the data transmission ends. Send ping, wait for the ping sent by the slave, wait for the data sent by the slave, wait for the ping sent by the slave, send ping, wait for the slave to send ping, and the transmission ends.

[0073] Furthermore, if the device type is a slave device, the encoded data is sent to the specified device through the USB D-signal line according to the state of the device.

[0074] Get the start status sent by the master device and start sending ping;

[0075] Receive the low level state of ping and send the third synchronization code to the specified device;

[0076] After detecting that the slave device is successfully synchronized with the specified device, data is sent to the specified device;

[0077] After detecting that the data transmission is completed, a fourth synchronization code is sent to the designated device;

[0078] After detecting that the slave device has successfully synchronized with the specified device, the last ping status is sent to complete sending the encoded data to the specified device.

[0079] In specific implementation, if the device is a slave device, the sending process is as follows:

[0080] Waiting for the master to send a ping, the slave sends a ping, waiting for the master to send data and ping; the slave sends a ping, and then the slave sends data. The data length is controlled by the FIFO data. When the FIFO is empty after the last data is sent, the data sending is completed, and the slave sends a ping again; the master waiting to receive sends a ping, and the slave sends a ping, and the sending is completed.

[0081] In a further embodiment, according to the characteristics of the protocol, multiple synchronization codes are used. One bit of data may have 2 synchronization codes or 3 synchronization codes, which is determined according to the data level state. In this embodiment, 3 synchronization codes are used as an example for introduction, and when sending, they are divided into 16 states. The 16 states are as follows:

[0082] State 1: IDLE, sending is in dormant state;

[0083] State 2: START, starts sending pings; when acting as a master, it is configured to this state by the user. When acting as a slave, it enters this state after receiving a ping.

[0084] State 3: SEND_LOW, sending the low level part of ping; this state jumps into from the START state and sends the low level of ping;

[0085] State 4: WAIT_PING_ACK, waiting for the intermediate ping;

[0086] State 5: REC_LOW1, waiting to receive low state 1; low state 1 refers to the time when the transmitter must actively drive the bus low after the ping transmission is completed;

[0087] State 6: REC_LOW2, waiting to receive low level state 2; low level state 2 refers to the transaction interval time, such as data preparation time after receiving data;

[0088] State 7: TSYNC0, sending synchronization code 0; TSYNC0 means sending the first bit of synchronization code 0;

[0089] State 8: TSYNC1, sending synchronization code 1; TSYNC1 means sending the synchronization code 1 of the first bit;

[0090] State 9: TSYNC2, sending synchronization code 2; TSYNC2 means sending the synchronization code 2 of the first bit;

[0091] State 10: TSYNC3, sending synchronization code 3; TSYNC3 means sending the synchronization code 3 of the following bits;

[0092] State 11: TSYNC4, sending synchronization code 4; TSYNC4 means sending the synchronization code 4 of the following bits;

[0093] State 12: TSYNC5, sending synchronization code 5; TSYNC5 means sending the synchronization code 5 of the following bits;

[0094] State 13: REC_DATA, receiving data state;

[0095] State 14: SEND_LOW1, sending low level state 1;

[0096] State 15: TX_BIT, sending data state;

[0097] State 16: EOP_PING, sending the last ping state.

[0098] It can be seen from the above method embodiments that the present invention provides a coding and decoding implementation method based on a USB differential signal line, which uses hardware for coding and decoding, can improve the decoding speed, does not occupy system resources, and the hardware only encodes and decodes the data part, and the data application part is handled by the software. It is more flexible, supports multiple protocols, and can easily upgrade the protocol.

[0099] It should be noted that there is not necessarily a certain order between the above-mentioned steps. A person skilled in the art can understand, based on the description of the embodiments of the present invention, that in different embodiments, the above-mentioned steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.

[0100] Another embodiment of the present invention provides a coding and decoding implementation device based on a USB differential signal line, wherein the USB differential signal line includes a USB D+ signal line and a USB D- signal line. Figure 4 As shown, the device 1 comprises:

[0101] A data acquisition module 11 is used to detect a data receiving instruction and acquire data through a USB D-signal line;

[0102] A decoding module 12, used to decode and store data according to a preset decoding rule;

[0103] The encoding module 13 is used to detect a data transmission instruction, encode the data according to a preset encoding rule, and send the encoded data to a designated device via a USB D-signal line.

[0104] The specific implementation method is shown in the method embodiment, which will not be described in detail here.

[0105] Another embodiment of the present invention provides a coding and decoding implementation device based on a USB differential signal line, such as Figure 5 As shown, the device 10 includes:

[0106] One or more processors 110 and memory 120, Figure 5 A processor 110 is used as an example for description. The processor 110 and the memory 120 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.

[0107] The processor 110 is used to complete various control logics of the device 10, which can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISCMachine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of these components. In addition, the processor 110 can also be any traditional processor, microprocessor or state machine. The processor 110 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP core, or any other such configuration.

[0108] The memory 120, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions corresponding to the encoding and decoding implementation method based on the USB differential signal line in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the device 10 by running the non-volatile software programs, instructions and units stored in the memory 120, that is, implements the encoding and decoding implementation method based on the USB differential signal line in the above method embodiment.

[0109] The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store applications required for operating the device and at least one function; the data storage area may store data created according to the use of the device 10, etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 120 may optionally include a memory remotely arranged relative to the processor 110, and these remote memories may be connected to the device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0110] One or more units are stored in the memory 120, and when executed by one or more processors 110, the encoding and decoding implementation method based on the USB differential signal line in any of the above method embodiments is executed, for example, the above described Figure 1 The method comprises steps S100 to S300.

[0111] An embodiment of the present invention provides a non-volatile computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, for example, to execute the above-described Figure 1 The method comprises steps S100 to S300.

[0112] As an example, the non-volatile storage medium can include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable ROM (EEPROM), or a flash memory. Volatile memory can include a random access memory (RAM) as an external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The disclosed memory components or memories of the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.

[0113] Another embodiment of the present invention provides a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the encoding and decoding implementation method based on the USB differential signal line of the above method embodiment. For example, the above described Figure 1 The method comprises steps S100 to S300.

[0114] The embodiments described above are merely illustrative, in which the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0115] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can exist in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0116] Conditional language such as "can," "can," "might," or "may," among other things, unless specifically stated otherwise or otherwise understood within the context as used, is generally intended to convey that particular embodiments can include (while other embodiments do not) particular features, elements, and / or operations. Thus, such conditional language is also generally intended to imply that features, elements, and / or operations are anyway required for one or more embodiments or that one or more embodiments must include logic for determining, with or without input or prompting, whether such features, elements, and / or operations are included or will be performed in any particular embodiment.

[0117] What has been described herein in this specification and the accompanying drawings includes examples of methods and devices for implementing codecs based on USB differential signal lines. Of course, it is not possible to describe every conceivable combination of elements and / or methods for the purpose of describing the various features of the present disclosure, but it is recognized that many other combinations and permutations of the disclosed features are possible. Therefore, it is apparent that various modifications can be made to the present disclosure without departing from the scope or spirit of the present disclosure. In addition, or in an alternative, other embodiments of the present disclosure may be apparent from consideration of the present specification and the accompanying drawings and from the practice of the present disclosure as presented herein. It is intended that the examples proposed in the present specification and the accompanying drawings are considered to be illustrative and not restrictive in all respects. Although specific terms are employed herein, they are used in a general and descriptive sense and are not used for limiting purposes.

Claims

1. A method for implementing encoding and decoding based on a USB differential signal line, wherein the USB differential signal line includes a USB D+ signal line and a USB D- signal line, characterized in that , the method comprises: Detects the data receiving instruction and obtains data through the USB D-signal line; Decode and store the data according to preset decoding rules; Detecting a data transmission instruction, encoding the data according to a preset encoding rule, and sending the encoded data to a designated device via a USB D-signal line; Used to encode and decode fast charging protocol data, wherein the fast charging protocol data includes ping packets and data packets; The step of decoding and storing the data according to a preset decoding rule includes: Analyze the high and low levels according to the preset decoding rules, convert them into corresponding data according to the protocol and store them; The encoding of data according to a preset encoding rule includes: Get the data to be sent, convert the data into high and low levels according to the preset protocol, and complete the encoding.

2. The method for implementing encoding and decoding based on USB differential signal lines according to claim 1, characterized in that: The step of sending the encoded data to a designated device via a USB D-signal line includes: Get the type of device and send the encoded data to the specified device through the USB D-signal line according to the type of device.

3. The method for implementing encoding and decoding based on USB differential signal lines according to claim 2, characterized in that: If the device type is a master device, the encoded data is sent to the specified device through the USB D-signal line according to the device status. Get the start status configured by the user and start sending pings; Receive the low level state of ping and send the first synchronization code to the specified device; After detecting that the master device is successfully synchronized with the designated device, data is sent to the designated device; After detecting that the data transmission is completed, a second synchronization code is sent to the designated device; After detecting that the master device has successfully synchronized with the specified device, the final ping status is sent to complete sending the encoded data to the specified device.

4. The method for implementing encoding and decoding based on USB differential signal lines according to claim 3, characterized in that: If the device type is a slave device, the encoded data is sent to the specified device through the USB D-signal line according to the status of the device. Get the start status sent by the master device and start sending ping; Receive the low level state of ping and send the third synchronization code to the specified device; After detecting that the slave device is successfully synchronized with the specified device, data is sent to the specified device; After detecting that the data transmission is completed, a fourth synchronization code is sent to the designated device; After detecting that the slave device has successfully synchronized with the specified device, the last ping status is sent to complete sending the encoded data to the specified device.

5. A coding and decoding implementation device based on USB differential signal line, characterized in that: The USB differential signal line includes a USB D+ signal line and a USB D- signal line, and the device includes: A data acquisition module, used for detecting a data receiving instruction and acquiring data through a USB D-signal line; A decoding module, used to decode and store data according to preset decoding rules; The encoding module is used to detect the data transmission instruction, encode the data according to the preset encoding rules, and send the encoded data to the designated device through the USBD- signal line; Used to encode and decode fast charging protocol data, wherein the fast charging protocol data includes ping packets and data packets; The step of decoding and storing the data according to a preset decoding rule includes: Analyze the high and low levels according to the preset decoding rules, convert them into corresponding data according to the protocol and store them; The encoding of data according to a preset encoding rule includes: Get the data to be sent, convert the data into high and low levels according to the preset protocol, and complete the encoding.

6. A coding and decoding implementation device based on USB differential signal line, characterized in that: The device comprises at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the encoding and decoding implementation method based on the USB differential signal line as described in any one of claims 1-4.

7. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions, which, when executed by one or more processors, enable the one or more processors to execute the encoding and decoding implementation method based on the USB differential signal line as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Ideo encoding device and video decoding device

    CN102870416A

  • Low-voltage differential signaling (LVDS) receiver, transmitter and method for receiving and transmitting LVDS

    CN103024367A

  • Monitoring data conversion device and method of nuclear magnetic resonance logger

    CN104615566A

  • Terminal charging control method and control device and terminal

    CN105656140A

  • Data processing method, host, storage equipment and storage medium

    CN107957917A