Nothing Special   »   [go: up one dir, main page]

CN110445578B - SPI data transmission method and device - Google Patents

SPI data transmission method and device Download PDF

Info

Publication number
CN110445578B
CN110445578B CN201910698023.7A CN201910698023A CN110445578B CN 110445578 B CN110445578 B CN 110445578B CN 201910698023 A CN201910698023 A CN 201910698023A CN 110445578 B CN110445578 B CN 110445578B
Authority
CN
China
Prior art keywords
data
receiving buffer
buffer area
sent
frame
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
CN201910698023.7A
Other languages
Chinese (zh)
Other versions
CN110445578A (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 CN201910698023.7A priority Critical patent/CN110445578B/en
Publication of CN110445578A publication Critical patent/CN110445578A/en
Application granted granted Critical
Publication of CN110445578B publication Critical patent/CN110445578B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0015Systems modifying transmission characteristics according to link quality, e.g. power backoff characterised by the adaptation strategy
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/22Arrangements for detecting or preventing errors in the information received using redundant apparatus to increase reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Communication Control (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses an SPI data transmission method and device. In one embodiment: distributing data to be sent to N data sending buffer areas, wherein N is an integer larger than 1; sending the data to be sent of each data sending buffer area to a data receiving buffer area corresponding to the data sending buffer area so that a receiving end screens the data from at least one data receiving buffer area to obtain a complete data consistent with the data to be sent; wherein, the data sending buffer and the data receiving buffer are both circular buffers. Based on the teaching of the above embodiments, the technical solution of the present invention can improve the data transmission efficiency on the premise of ensuring the integrity of data transmission.

Description

SPI data transmission method and device
Technical Field
The invention relates to the technical field of data transmission, in particular to a method and a device for SPI data transmission.
Background
In the process of SPI (Serial Peripheral Interface) data transmission, a phenomenon of data packet loss often occurs. To solve this problem, the prior art is based on the data transmission process of the SPI connection, and by specifying a flow control, i.e. an acknowledgement mechanism, it is confirmed whether the data frame is correctly received. Although the integrity of the data is ensured to a certain extent, once a certain frame of data is checked incorrectly, the frame of data needs to be requested to be retransmitted, and the process is repeated until all data is completely transmitted, so that the efficiency of SPI data transmission is low.
Disclosure of Invention
The invention aims to provide an SPI data transmission method and device, which can improve the data transmission efficiency on the premise of ensuring the integrity of data transmission.
In order to solve the above technical problem, an embodiment of the present invention provides an SPI data transmission method, including:
distributing data to be sent to N data sending buffer areas, wherein N is an integer larger than 1;
sending the data to be sent of each data sending buffer area to a data receiving buffer area corresponding to the data sending buffer area so that a receiving end screens the data from at least one data receiving buffer area to obtain a complete data consistent with the data to be sent; wherein, the data sending buffer and the data receiving buffer are both circular buffers.
Before distributing the data to be transmitted to the N data transmission buffers, the method further includes:
generating a check code for each frame of data to be transmitted, and adding a frame number to each frame of data, wherein the frame number is represented by M, and M is an integer greater than 0;
after the data to be sent in each data sending buffer is sent to the data receiving buffer corresponding to the data sending buffer, the method further includes:
so that the receiving end checks the check code of each frame data received by each data receiving buffer and discards the data frame which fails the check.
The enabling the receiving end to screen data from at least one data receiving buffer includes: so that the receiving end takes out the buffered data frame from the first data receiving buffer, and then screens the data according to the mode of taking out the missing data frame in the N-1 data receiving buffer from the Nth data receiving buffer.
At the receiving end, screening data from at least one data receiving buffer, further comprising: when the receiving end takes out the data from the previous data receiving buffer and skips the next data receiving buffer, the receiving end clears all the data in the previous data receiving buffer; and when the receiving end can not obtain a complete data consistent with the data to be sent after screening the data from the first data receiving buffer area to the Nth data receiving buffer area in sequence, repeating the steps until obtaining a complete data consistent with the data to be sent.
And each frame data of the data sending buffer area and the data receiving buffer area is arranged according to the ascending sequence of the frame number.
In order to solve the same technical problem, an embodiment of the present invention further provides an SPI data transmission method, including: receiving data to be sent from N data sending buffer areas of a sending end, and caching the data to be sent in a data receiving buffer area corresponding to each data sending buffer area;
screening data from at least one data receiving buffer area so as to obtain a complete data consistent with the data to be sent; wherein, the data sending buffer and the data receiving buffer are both circular buffers.
The check code of each frame of data received by each data receiving buffer is checked, and the data frames failing the check are discarded.
The screening data from at least one data receiving buffer comprises: and taking out the buffered data frames from the first data receiving buffer, and then screening the data in a mode of taking out the missing data frames in the (N-1) th data receiving buffer from the Nth data receiving buffer.
Screening data from the at least one data receive buffer, further comprising: when the previous data receiving buffer zone takes out data and skips the next data receiving buffer zone, all the data of the previous data receiving buffer zone is cleared; and when the data are screened from the first data receiving buffer area to the Nth data receiving buffer area in sequence, and a complete data consistent with the data to be sent cannot be obtained, repeating the steps until the complete data consistent with the data to be sent is obtained.
As an improvement of the foregoing solution, another embodiment of the present invention correspondingly provides an SPI data transmission device, including:
the data distribution unit is used for distributing data to be sent to N data sending buffer areas, wherein N is an integer larger than 1;
the data sending unit is used for sending the data to be sent of each data sending buffer area to the data receiving buffer area corresponding to the data sending buffer area so that the receiving end screens the data from at least one data receiving buffer area to obtain a complete data consistent with the data to be sent; wherein, the data sending buffer and the data receiving buffer are both circular buffers.
The device comprises a preprocessing unit, a detection unit and a processing unit, wherein the preprocessing unit is used for generating a check code for each frame of data to be sent and adding a frame number to each frame of data, the frame number is represented by M, and M is an integer greater than 0;
the data sending unit is further configured to enable the receiving end to check the check code of each frame of data received by each data receiving buffer, and discard the data frames failing in checking.
As an improvement of the foregoing solution, another embodiment of the present invention correspondingly provides an SPI data transmission device, including:
the data receiving unit is used for receiving data to be sent from N data sending buffer areas of the sending end and caching the data to be sent in a data receiving buffer area corresponding to each data sending buffer area;
the data screening unit is used for screening data from at least one data receiving buffer area so as to obtain a complete data consistent with the data to be sent; wherein, the data sending buffer and the data receiving buffer are both circular buffers.
And the data checking unit is used for checking the check code of each frame of data received by each data receiving buffer area and discarding the data frames which fail to be checked.
Compared with the prior art, the SPI data transmission method and the SPI data transmission device have the advantages that a double-buffer mechanism is realized by adopting N data sending buffer areas and N data receiving buffer areas, and a receiving end is enabled to screen data from at least one data receiving buffer area until complete data consistent with the data to be transmitted is obtained, so that the integrity of data transmission is guaranteed; when the data packet loss occurs, the packet loss data can be screened from the standby data receiving buffer area, so that the problem of low efficiency caused by adopting a response mechanism under the packet loss condition in the prior art is solved, and the data transmission efficiency is further improved.
Another embodiment of the present invention 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, wherein the processor, when executing the computer program, implements the SPI data transmission method according to any one of the above.
Another embodiment of the present invention provides a server, including:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the SPI data transmission method as in any one of the above.
Another embodiment of the present invention provides a computer-readable storage medium, which includes a stored computer program, where when the computer program runs, the apparatus where the computer-readable storage medium is located is controlled to execute any one of the SPI data transmission methods described above.
Drawings
Fig. 1 is a schematic flowchart of an SPI data transmission method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of an SPI data transmission method according to another embodiment of the present invention;
fig. 3 is a flow chart of an SPI data transmission method according to an embodiment of the present invention;
fig. 4 is another flowchart of an SPI data transmission method according to an embodiment of the present invention;
fig. 5 is a flowchart of an SPI data transmission method according to an embodiment of the present invention;
fig. 6 is a block diagram of a process of an SPI data transmission device according to an embodiment of the present invention;
fig. 7 is a block diagram of a process of an SPI data transmission device according to another embodiment of the present invention;
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, 3 and 4, the method comprises:
s001: distributing data to be sent to N data sending buffer areas, wherein N is an integer larger than 1;
s002: sending the data to be sent of each data sending buffer area to a data receiving buffer area corresponding to the data sending buffer area so that a receiving end screens the data from at least one data receiving buffer area to obtain a complete data consistent with the data to be sent; the data sending buffer area and the data receiving buffer area are both circular buffer areas, wherein the circular buffer areas are used for sending, receiving, checking and the like of data in a first-in first-out mode.
In this embodiment, before step S001, a check code is generated for each frame of data to be transmitted, so that the receiving end checks whether the received data is correct according to the check code; and adding a frame number to each frame of data, wherein the frame number is represented by M, and M is an integer greater than 0.
In this embodiment, the step S002 further includes: after the data to be sent in each data sending buffer area is sent to the data receiving buffer area corresponding to the data sending buffer area, the receiving end verifies the check code of each frame of data received by each data receiving buffer area according to the ascending sequence of the frame number, and discards the data frame which fails in verification.
In this embodiment, the step S002 further includes: the receiving end takes out the buffered data frame from the first data receiving buffer area, and then screens the data according to the mode of taking out the missing data frame in the N-1 th data receiving buffer area from the Nth data receiving buffer area, so as to screen the lost data in the next data receiving buffer area when the lost packet occurs, thereby realizing the integrity of data transmission, and no response mechanism is needed, thereby improving the efficiency of data transmission.
In this embodiment, the step S002 further includes: when the receiving end takes out the data from the previous data receiving buffer and skips the next data receiving buffer, all the data in the previous data receiving buffer is removed to realize the circular buffer, thereby ensuring the integrity of the data transmission; when the receiving end can not obtain a complete data consistent with the data to be sent after screening the data from the first data receiving buffer area to the Nth data receiving buffer area in sequence, the steps are repeatedly executed until a complete data consistent with the data to be sent is obtained, so that the completeness of data transmission is ensured, and the efficiency of data transmission is further improved by utilizing a double-buffer mechanism.
In this embodiment, each frame data of the data sending buffer and the data receiving buffer is arranged in an ascending order according to the frame number, so as to realize the orderly data transmission process, thereby improving the transmission efficiency.
The SPI data transmission method provided by the embodiment of the invention has the following beneficial effects: the method comprises the steps that data to be sent are distributed to N data sending buffer areas, so that a mode that the N paths carry out SPI data transmission is achieved, and the data sending buffer areas play a buffering role, and therefore the data transmission efficiency is improved; meanwhile, the receiving end screens data from at least one data receiving buffer area to obtain a complete data consistent with the data to be transmitted, so that the completeness of data transmission is ensured, and the buffering effect is realized by setting N data receiving buffer areas, so that the efficiency of data transmission is further improved.
Referring to fig. 2, 3 and 5, the method comprises:
s011: receiving data to be sent from N data sending buffer areas of a sending end, and caching the data to be sent in a data receiving buffer area corresponding to each data sending buffer area;
s012: screening data from at least one data receiving buffer area so as to obtain a complete data consistent with the data to be sent; wherein, the data sending buffer and the data receiving buffer are both circular buffers.
In this embodiment, a double buffering mechanism is implemented by the data sending buffer and the data receiving buffer to implement a buffering function, thereby improving the efficiency of the data transmission process; and screening data from at least one of the N data receiving buffers to obtain a complete data consistent with the data to be sent, so as to ensure the integrity of data transmission, and further improve the efficiency of data transmission on the premise of ensuring the integrity of data transmission.
In this embodiment, the check code of each frame of data received by each data receiving buffer is checked, and the data frame failing to be checked is discarded, so as to ensure that the received data is consistent with the data to be transmitted.
In this embodiment, the step S012 further includes: taking out the buffered data frame from the first data receiving buffer area, and then screening the data according to the mode of taking out the missing data frame in the (N-1) th data receiving buffer area from the Nth data receiving buffer area; when packet loss occurs, the packet loss data can be screened in the next data receiving buffer area, so that the integrity of data transmission is realized, a response mechanism is not required, and the efficiency of data transmission is improved.
In this embodiment, the step S012 further includes: when the previous data receiving buffer zone takes out data and skips the next data receiving buffer zone, all the data of the previous data receiving buffer zone is cleared; when data are screened from the first data receiving buffer area to the Nth data receiving buffer area in sequence, and a complete data consistent with the data to be sent still can not be obtained, the steps are repeatedly executed until a complete data consistent with the data to be sent is obtained, so that the completeness of data transmission is ensured, and the efficiency of data transmission is further improved by utilizing a double-buffer mechanism.
The SPI data transmission method provided by the embodiment of the invention has the following beneficial effects: the method comprises the steps that data to be transmitted sent by N data sending buffer areas of a sending end are received, so that the mode of SPI data transmission through a plurality of paths is realized, when packet loss occurs in a main path in the plurality of paths, general selection of the packet loss data can be performed from a standby path, and therefore the data transmission efficiency is improved on the premise that the data transmission is complete; and the data sending buffer zone plays a buffering role, and the efficiency of data transmission is further improved.
Referring to fig. 6, a flow chart of an SPI data transmission device according to an embodiment of the present invention includes:
the preprocessing unit 61 is configured to generate a check code for each frame of data to be transmitted, and add a frame number to each frame of data, where the frame number is represented by M, and M is an integer greater than 0.
A data distributing unit 62, configured to distribute data to be sent to N data sending buffers, where N is an integer greater than 1.
A data sending unit 63, configured to send the data to be sent in each data sending buffer to a data receiving buffer corresponding to the data sending buffer, so that the receiving end screens data from at least one data receiving buffer, thereby obtaining a complete data that is consistent with the data to be sent; wherein, the data sending buffer and the data receiving buffer are both circular buffers.
The data sending unit 63 is further configured to enable the receiving end to check the check code of each frame of data received by each data receiving buffer, and discard the data frame that fails in checking.
The SPI data transmission device provided by the embodiment of the invention has the following beneficial effects: generating a check code for each frame of the data to be transmitted and adding a frame serial number through the processing unit 61, so that the receiving end carries out sequential verification on the received data according to the sequence of the frame serial numbers to verify that the received data is consistent with the data to be transmitted, thereby ensuring the accuracy and the integrity of the data; meanwhile, data are distributed to N data sending buffer areas through the data distribution unit to achieve multi-path data transmission, data are screened from the data receiving buffer areas in at least one path through the data sending unit, lost data can be screened from the data receiving buffer areas in other paths when packet loss occurs, the data are not required to be fed back to a sender to resend the lost data, and therefore the data transmission efficiency is improved.
Referring to fig. 7, an SPI data transmission device according to another embodiment of the present invention includes:
a data receiving unit 71, configured to receive data to be sent from N data sending buffers at a sending end, and buffer the data to be sent in a data receiving buffer corresponding to each data sending buffer;
a data screening unit 72, configured to screen data from at least one data receiving buffer, so as to obtain a complete data that is consistent with the data to be sent; wherein, the data sending buffer and the data receiving buffer are both circular buffers.
And a data checking unit 73 for checking the check code of each frame of data received by each data receiving buffer and discarding the data frames failing the checking.
The SPI data transmission device provided by the embodiment of the invention has the following beneficial effects: the data receiving unit receives data sent by N data sending buffer areas of a sending end to realize a multi-channel data transmission mode, and buffers the data in the data sending buffer area and the data receiving buffer area to realize a buffering effect, so that the data transmission efficiency is improved; meanwhile, data screening is carried out on the data receiving buffer area in at least one of the multiple channels through the data screening unit so as to obtain a piece of complete data consistent with the data to be sent, and when packet loss occurs, packet loss data can be screened from other data receiving buffer areas, so that a response mechanism is reduced, and the efficiency of data transmission can be improved on the premise of ensuring the integrity of data transmission.
An embodiment of the present invention further provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, where the processor implements the SPI data transmission method according to any one of the above descriptions when executing the computer program. Such as step S001 shown in fig. 1. Alternatively, the processor implements the functions of the modules/units in the above device embodiments, such as the data transmission unit, when executing the computer program.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory and executed by the processor to implement the invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used for describing the execution process of the computer program in the SPI data transmission terminal device.
The SPI data transmission terminal equipment can be computing equipment such as a desktop computer, a notebook computer, a palm computer and an intelligent tablet. The SPI data transmission terminal equipment can comprise, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the above components are merely examples of the SPI data transmission terminal device, and do not constitute a limitation of the SPI data transmission terminal device, and may include more or less components than the above, or combine some components, or different components, for example, the SPI data transmission terminal device may further include an input-output device, a network access device, a bus, and the like.
An embodiment of the present invention further provides a server, including:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the SPI data transmission method as in any one of the above.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc., and the processor is a control center of the SPI data transmission terminal device and connects various parts of the entire SPI data transmission device by using various interfaces and lines.
The storage device may be configured to store the computer program and/or module, and the processor may implement various functions of the voice endpoint detection apparatus by running or executing the computer program and/or module stored in the memory and calling data stored in the memory. The storage device 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, an image playing function, etc.) required by at least one function, and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
Wherein, the module/unit integrated with the SPI data transmission terminal device may be stored in a computer readable storage medium if it is implemented in the form of a software functional unit and sold or used as an independent product. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, etc. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that the above-described device embodiments are merely illustrative, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be 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 the present embodiment. In addition, in the drawings of the embodiment of the apparatus provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, and may be specifically implemented as one or more communication buses or signal lines. One of ordinary skill in the art can understand and implement it without inventive effort.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (5)

1. An SPI data transmission method is characterized by comprising the following steps:
distributing data to be sent to N data sending buffer areas, wherein N is an integer larger than 1;
sending the data to be sent of each data sending buffer area to a data receiving buffer area corresponding to the data sending buffer area so that a receiving end screens the data from at least one data receiving buffer area to obtain a complete data consistent with the data to be sent; wherein, the data sending buffer and the data receiving buffer are both circular buffers;
before distributing the data to be transmitted to the N data transmission buffers, the method further includes:
generating a check code for each frame of data to be transmitted, and adding a frame number to each frame of data, wherein the frame number is represented by M, and M is an integer greater than 0;
after the data to be sent in each data sending buffer is sent to the data receiving buffer corresponding to the data sending buffer, the method further includes:
so that the receiving end checks the check code of each frame of data received by each data receiving buffer area and discards the data frame which fails in checking;
the enabling the receiving end to screen data from at least one data receiving buffer includes: the receiving end takes out the buffered data frame from the first data receiving buffer zone, and then screens the data according to the mode of taking out the missing data frame in the N-1 data receiving buffer zone from the Nth data receiving buffer zone;
at the receiving end, screening data from at least one data receiving buffer, further comprising: when the receiving end takes out the data from the previous data receiving buffer and skips the next data receiving buffer, the receiving end clears all the data in the previous data receiving buffer; and when the receiving end can not obtain a complete data consistent with the data to be sent after screening the data from the first data receiving buffer area to the Nth data receiving buffer area in sequence, repeating the steps until obtaining a complete data consistent with the data to be sent.
2. The SPI data transmission method according to claim 1, wherein each frame data of said data transmission buffer and said data reception buffer is arranged in ascending order of frame number.
3. An SPI data transmission method is characterized by comprising the following steps:
receiving data to be sent from N data sending buffer areas of a sending end, and caching the data to be sent in a data receiving buffer area corresponding to each data sending buffer area;
screening data from at least one data receiving buffer area so as to obtain a complete data consistent with the data to be sent; wherein, the data sending buffer and the data receiving buffer are both circular buffers;
checking the check code of each frame of data received by each data receiving buffer area, and discarding the data frame which fails in checking;
the screening data from at least one data receiving buffer comprises: taking out the buffered data frame from the first data receiving buffer area, and then screening the data according to the mode of taking out the missing data frame in the (N-1) th data receiving buffer area from the Nth data receiving buffer area;
screening data from the at least one data receive buffer, further comprising: when the previous data receiving buffer zone takes out data and skips the next data receiving buffer zone, all the data of the previous data receiving buffer zone is cleared; and when the data are screened from the first data receiving buffer area to the Nth data receiving buffer area in sequence, and a complete data consistent with the data to be sent cannot be obtained, repeating the steps until the complete data consistent with the data to be sent is obtained.
4. An SPI data transmission device, comprising:
the data distribution unit is used for distributing data to be sent to N data sending buffer areas, wherein N is an integer larger than 1;
the data sending unit is used for sending the data to be sent of each data sending buffer area to the data receiving buffer area corresponding to the data sending buffer area so that the receiving end screens the data from at least one data receiving buffer area to obtain a complete data consistent with the data to be sent; wherein, the data sending buffer and the data receiving buffer are both circular buffers;
the device comprises a preprocessing unit, a detection unit and a processing unit, wherein the preprocessing unit is used for generating a check code for each frame of data to be sent and adding a frame number to each frame of data, the frame number is represented by M, and M is an integer greater than 0;
the data sending unit is further configured to:
the receiving end checks the check code of each frame of data received by each data receiving buffer area and discards the data frame which fails in checking;
enabling a receiving end to take out the cached data frames from the first data receiving buffer area, and then screening data according to the mode of taking out the missing data frames in the (N-1) th data receiving buffer area from the Nth data receiving buffer area;
when the receiving end takes out the data from the previous data receiving buffer and skips the next data receiving buffer, all the data in the previous data receiving buffer is cleared; and when the receiving end can not obtain a complete data consistent with the data to be sent after screening the data from the first data receiving buffer area to the Nth data receiving buffer area in sequence, repeating the steps until obtaining a complete data consistent with the data to be sent.
5. An SPI data transmission device, comprising:
the data receiving unit is used for receiving data to be sent from N data sending buffer areas of the sending end and caching the data to be sent in a data receiving buffer area corresponding to each data sending buffer area;
the data screening unit is used for screening data from at least one data receiving buffer area so as to obtain a complete data consistent with the data to be sent; wherein, the data sending buffer and the data receiving buffer are both circular buffers;
the data checking unit is used for checking the check code of each frame of data received by each data receiving buffer area and discarding the data frame which fails in checking;
the data screening unit is further configured to:
taking out the buffered data frame from the first data receiving buffer area, and then screening the data according to the mode of taking out the missing data frame in the (N-1) th data receiving buffer area from the Nth data receiving buffer area;
when the previous data receiving buffer zone takes out data and skips the next data receiving buffer zone, all the data of the previous data receiving buffer zone is cleared; and when the data are screened from the first data receiving buffer area to the Nth data receiving buffer area in sequence, and a complete data consistent with the data to be sent cannot be obtained, repeating the steps until the complete data consistent with the data to be sent is obtained.
CN201910698023.7A 2019-07-29 2019-07-29 SPI data transmission method and device Active CN110445578B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910698023.7A CN110445578B (en) 2019-07-29 2019-07-29 SPI data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910698023.7A CN110445578B (en) 2019-07-29 2019-07-29 SPI data transmission method and device

Publications (2)

Publication Number Publication Date
CN110445578A CN110445578A (en) 2019-11-12
CN110445578B true CN110445578B (en) 2020-06-23

Family

ID=68432464

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910698023.7A Active CN110445578B (en) 2019-07-29 2019-07-29 SPI data transmission method and device

Country Status (1)

Country Link
CN (1) CN110445578B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114942900A (en) * 2021-09-29 2022-08-26 太初(无锡)电子科技有限公司 Double-buffer data serial sending method for embedded system
CN115776357A (en) * 2022-11-22 2023-03-10 厦门鸿谷智芯科技有限公司 Method and device for realizing transparent transmission quality improvement of Can data

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1761237A (en) * 2005-11-04 2006-04-19 清华大学 System for transmitting data frame of Etheent based on insertion between frames
CN101072087A (en) * 2007-06-15 2007-11-14 南京恩瑞特实业有限公司 Method for realizing multi-link redundancy based on buffer management
CN101719809A (en) * 2009-11-25 2010-06-02 中兴通讯股份有限公司 Method and system for recovering lost media data packet
CN102118434A (en) * 2010-12-28 2011-07-06 华为技术有限公司 Data packet transmission method and device
CN104462008A (en) * 2014-12-05 2015-03-25 三星半导体(中国)研究开发有限公司 Physical-memory-shared multi-processor communication system and communication method thereof

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8429329B2 (en) * 2007-10-17 2013-04-23 Micron Technology, Inc. Serial interface NAND
CN101667451B (en) * 2009-09-11 2012-05-09 西安电子科技大学 Data buffer of high-speed data exchange interface and data buffer control method thereof
CN103312606A (en) * 2013-05-23 2013-09-18 杭州卓沃电子商务有限公司 Wireless Mesh network routing based on multi-path concurrence and method thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1761237A (en) * 2005-11-04 2006-04-19 清华大学 System for transmitting data frame of Etheent based on insertion between frames
CN101072087A (en) * 2007-06-15 2007-11-14 南京恩瑞特实业有限公司 Method for realizing multi-link redundancy based on buffer management
CN101719809A (en) * 2009-11-25 2010-06-02 中兴通讯股份有限公司 Method and system for recovering lost media data packet
CN102118434A (en) * 2010-12-28 2011-07-06 华为技术有限公司 Data packet transmission method and device
CN104462008A (en) * 2014-12-05 2015-03-25 三星半导体(中国)研究开发有限公司 Physical-memory-shared multi-processor communication system and communication method thereof

Also Published As

Publication number Publication date
CN110445578A (en) 2019-11-12

Similar Documents

Publication Publication Date Title
CN110750341B (en) Task scheduling method, device, system, terminal equipment and storage medium
KR102499335B1 (en) Neural network data processing apparatus, method and electronic device
CN107342848B (en) Self-adaptive code stream transmission method, device and equipment
CN110445578B (en) SPI data transmission method and device
CN109905412B (en) Network data parallel encryption and decryption processing method, device and medium
US11671678B2 (en) Method and device, equipment, and storage medium for data processing
CN112068739A (en) Infrared touch response method, device and storage medium
US20170235689A1 (en) Method, apparatus, communication equipment and storage media for determining link delay
CN110602338B (en) Audio processing method, device, system, storage medium and equipment
CN110022534B (en) Data transmission method and device based on multicast
CN112422485A (en) Communication method and device of transmission control protocol
US8259609B2 (en) Modem and packet processing method
CN115941907A (en) RTP data packet sending method, system, electronic equipment and storage medium
CN113242473B (en) Data processing method, system, data acquisition equipment and readable storage medium
CN107276620B (en) Earphone data transmission method, terminal equipment and computer readable storage medium
CN111641530B (en) Method, device, terminal and storage medium for realizing accelerated forwarding
CN108259381B (en) Data frame processing method and device and vehicle-mounted unit
CN116418533A (en) Message transmission method, device and storage medium
CN110018908B (en) Inter-process communication method, electronic equipment and readable storage medium
CN108259393B (en) Out-of-order correcting method and system in a kind of processing of flow data
CN114443525A (en) Data processing system, method, electronic equipment and storage medium
CN110572330A (en) method, device and medium for realizing compatibility of forwarding acceleration function and protocol stack function
CN111405026A (en) Method and device for synchronously controlling volumes of android mobile phone and cloud mobile phone
CN115632681B (en) Signal transmission method, combiner and branching device
CN112152975A (en) Audio data processing method and device

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 of SPI data transmission

Effective date of registration: 20201010

Granted publication date: 20200623

Pledgee: Bank of China Limited Guangzhou Pearl River Branch

Pledgor: UNICMICRO (GUANGZHOU) Co.,Ltd.

Registration number: Y2020440000309

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

Date of cancellation: 20211221

Granted publication date: 20200623

Pledgee: Bank of China Limited Guangzhou Pearl River Branch

Pledgor: UNICMICRO (GUANGZHOU) Co.,Ltd.

Registration number: Y2020440000309

PC01 Cancellation of the registration of the contract for pledge of patent right