CN116561045B - Dual-processor inter-core communication method and device, TBOX and storage medium - Google Patents

Dual-processor inter-core communication method and device, TBOX and storage medium Download PDF

Info

Publication number
CN116561045B
CN116561045B CN202310540640.0A CN202310540640A CN116561045B CN 116561045 B CN116561045 B CN 116561045B CN 202310540640 A CN202310540640 A CN 202310540640A CN 116561045 B CN116561045 B CN 116561045B
Authority
CN
China
Prior art keywords
data
frame
processor
incomplete
data 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
CN202310540640.0A
Other languages
Chinese (zh)
Other versions
CN116561045A (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.)
Chongqing Selis Phoenix Intelligent Innovation Technology Co ltd
Original Assignee
Chongqing Selis Phoenix Intelligent Innovation Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing Selis Phoenix Intelligent Innovation Technology Co ltd filed Critical Chongqing Selis Phoenix Intelligent Innovation Technology Co ltd
Priority to CN202310540640.0A priority Critical patent/CN116561045B/en
Publication of CN116561045A publication Critical patent/CN116561045A/en
Application granted granted Critical
Publication of CN116561045B publication Critical patent/CN116561045B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • G06F15/17Interprocessor communication using an input/output type connection, e.g. channel, I/O port
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application relates to the field of basic communication equipment, and provides a dual-processor inter-core communication method, a device, a TBOX and a storage medium. The method comprises the following steps: receiving encapsulation data transmitted by a first processor, wherein the encapsulation data is obtained by encapsulation based on a package protocol which is negotiated in advance by the first processor and a second processor; if the package data comprises the incomplete data frame, pushing the incomplete data frame into a secondary cache pool; performing frame breaking splicing processing or frame missing continuous transmission processing or frame error retransmission processing according to the incomplete data frames to obtain complete data frames, and pushing the complete data frames out of a secondary buffer pool; and unpacking the complete data frame to obtain unpacked data. The method and the device can realize stable transmission of data/information between the dual processors of the TBOX, reduce the consumption of IO resources and greatly reduce the communication cost.

Description

Dual-processor inter-core communication method and device, TBOX and storage medium
Technical Field
The present disclosure relates to the field of basic communication devices, and in particular, to a dual processor inter-core communication method, apparatus, TBOX, and storage medium.
Background
The structure of the current dual processor inter-core communication framework of TBox (Telematics BOX) is shown in fig. 1, and the conventional dual processor inter-core communication mechanism is generally implemented by setting a buffer at a transmitting end/receiving end to perform IO buffering and based on UART (Universal Asynchronous Receiver/Transmitter, universal asynchronous receiver Transmitter and Transmitter) and a simple packaging protocol. Wherein the wrapping protocol generally takes the form of a "message header" + "command word" + "data content" + "check" + "message trailer".
The existing dual processor inter-core communication mechanism has at least the following disadvantages: the receiving end/transmitting end only depends on the advantages and disadvantages of buffer design to ensure the stability of data transmission, the consumption of IO resources is large, the anti-interference performance of the communication mechanism is poor, and the data transmission is unstable due to electromagnetic interference and link interference easily; secondly, when the serial port transmission rate is relatively high (for example, 921600bps transmission rate is adopted), the communication mechanism is easy to generate packet loss phenomenon, and can not realize functions of error retransmission, large data packet transmission, long-time reliable connection and the like, and the communication cost is relatively high.
Therefore, the existing dual-processor inter-core communication mechanism still has the problems of unstable data transmission, larger consumption of IO resources and higher communication cost.
Disclosure of Invention
In view of this, the embodiments of the present application provide a dual-processor inter-core communication method, apparatus, TBOX, and storage medium, so as to solve the problems of unstable data transmission, greater consumption of IO resources, and higher communication cost in the dual-processor inter-core communication mechanism in the prior art.
In a first aspect of an embodiment of the present application, there is provided a dual processor inter-core communication method, including:
receiving encapsulation data transmitted by a first processor, wherein the encapsulation data is obtained by encapsulation based on a package protocol which is negotiated in advance by the first processor and a second processor;
if the package data comprises the incomplete data frame, pushing the incomplete data frame into a secondary cache pool;
performing frame breaking splicing processing or frame missing continuous transmission processing or frame error retransmission processing according to the incomplete data frames to obtain complete data frames, and pushing the complete data frames out of a secondary buffer pool;
and unpacking the complete data frame to obtain unpacked data.
In a second aspect of embodiments of the present application, there is provided a dual processor inter-core communication apparatus, including:
the receiving module is configured to receive the encapsulation data transmitted by the first processor, wherein the encapsulation data is obtained by encapsulation based on a package protocol which is negotiated in advance by the first processor and the second processor;
The pushing module is configured to push the incomplete data frame into the secondary cache pool if the package data comprises the incomplete data frame;
the processing module is configured to perform frame breaking and splicing processing or frame missing continuous transmission processing or frame error retransmission processing according to the incomplete data frames so as to obtain complete data frames, and pushing the complete data frames out of the secondary buffer pool;
the unpacking module is configured to unpack the complete data frame to obtain unpacked data.
In a third aspect of embodiments of the present application, a TBOX is provided, including a first processor and a second processor;
the first processor and the second processor perform inter-core communication based on the serial port;
the second processor includes the dual processor inter-core communication device of the second aspect.
In a fourth aspect of the embodiments of the present application, there is provided a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the above method.
Compared with the prior art, the embodiment of the application has the beneficial effects that: according to the technical scheme provided by the embodiment of the application, the data is encapsulated and transmitted by adding the packet protocol which is negotiated in advance between the first processor and the second processor, so that the stability of data transmission can be further improved on the basis of a traditional inter-core communication mechanism based on buffer design, the consumption of IO resources can be reduced, and the traditional low-cost serial port performance is exerted to the greatest extent. Meanwhile, a secondary buffer pool is designed in the second processor and is used for temporarily storing incomplete data frames, and frame breaking splicing processing or frame missing continuous transmission processing or frame error retransmission processing is carried out according to the incomplete data frames, so that stable transmission of large data packets at a higher transmission rate (such as a transmission rate of 921600 bps) can be realized, the packet loss rate in the transmission process is lower, long-time reliable connection between the two processors can be realized, the stability of data transmission between the first processor and the second processor is further improved, and the communication cost can be greatly reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly introduce the drawings that are needed in the embodiments or the description of the prior art, it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a conventional dual processor inter-core communication framework;
FIG. 2 is a schematic diagram of a dual processor inter-core communication framework according to an embodiment of the present application;
FIG. 3 is a flow chart of a dual processor inter-core communication method according to an embodiment of the present application;
fig. 4 is a flow chart of a data/message receiving method according to an embodiment of the present application;
fig. 5 is a flow chart of a data/message sending method according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a dual processor inter-core communication device according to an embodiment of the present application;
FIG. 7 is a schematic illustration of a TBOX structure provided in an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
A method and apparatus for dual processor inter-core communication according to embodiments of the present application will be described in detail below with reference to the accompanying drawings.
FIG. 2 is a schematic diagram of a dual processor inter-core communication framework according to an embodiment of the present application. The dual processor inter-core communication framework includes a first processor 201 (simply "CPU 1"), a second processor 202 (simply "CPU 2"). The first processor 201 and the second processor 202 may be connected through serial communication.
The first processor 201 and the second processor 202 may be processors with different structures and different functions, for example, the first processor 201 is a linux chip, and the second processor 202 is a GPU (Graphics Processing Unit, also called a display core, a visual processor, a display chip or a drawing chip); the processors with different equipment models, identical structures and different functions can also be used.
A second level cache pool is provided in the second processor 202.
Inter-core communication technology (Inter-processor communication, abbreviated as "IPC").
Generally, application scenarios of processors of different functions vary widely. For example, the linux chip is mainly used for running a linux system, the GPU is mainly used for image processing, the singlechip is mainly used as a microcontroller, and the DSP (Digital Signal Processing, digital signal processor) is mainly used for logic processing and the like. In the prior art, if processors with different functions are to be integrated, in order to ensure normal inter-core communication between the processors with different functions, only a specific model or a customized processor is generally selected for integration, so that on one hand, the integration application of the processors with different functions is greatly limited, and on the other hand, the preparation cost of the integrated chip is very high and cannot be popularized and applied.
However, the existing dual-processor inter-core communication mechanism still has the problems of unstable data transmission, larger consumption of IO resources and higher communication cost. Meanwhile, the prior art has few improvements in aspects of retransmission, framing and the like based on serial port design, and has few disclosures of a packet protocol for realizing stable data transmission under high-rate (for example, the transmission rate is 921600 bps) transmission.
In order to solve the problems that the existing dual-processor inter-core communication mechanism still has unstable data transmission, larger consumption of IO resources and higher communication cost, the technical scheme provided by the embodiment of the application is applied to the second processor 202, specifically, the second processor 202 receives the encapsulation data transmitted by the first processor 201, and the encapsulation data is obtained by encapsulating based on the encapsulation protocol pre-negotiated between the first processor 201 and the second processor 202; if the encapsulated data includes an incomplete data frame, pushing the incomplete data frame into the secondary buffer pool 2021; performing frame breaking and splicing processing or frame missing continuous transmission processing or frame error retransmission processing according to the incomplete data frames to obtain complete data frames, and pushing the complete data frames out of the secondary buffer pool 2021; and unpacking the complete data frame to obtain unpacked data. According to the technical scheme provided by the embodiment of the application, the IPC communication guarantee mechanism is added between the first processor and the second processor, and adopts the pre-negotiated packet protocol to perform data encapsulation and transmission, so that the stability of data transmission can be further improved on the basis of the traditional inter-core communication mechanism based on buffer design, the consumption of IO resources can be reduced, and the traditional low-cost serial port performance is exerted to the greatest extent. Meanwhile, a secondary buffer pool is designed in the second processor and is used for temporarily storing the incomplete data frames, and frame breaking and splicing processing or frame missing continuous transmission processing or frame error retransmission processing are carried out on the incomplete data frames, so that stable transmission of large data packets at a higher transmission rate (such as a transmission rate of 921600 bps) can be realized, the packet loss rate in the transmission process is lower, long-time reliable connection between the two processors can be realized, the stability of data transmission between the first processor and the second processor is further improved, and the communication cost can be greatly reduced.
It should be noted that the specific types and combinations of the first processor 201 and the second processor 202 may be adjusted according to the actual requirements of the application scenario, which is not limited in the embodiment of the present application.
Fig. 3 is a flow chart of a dual processor inter-core communication method according to an embodiment of the present application. The dual processor inter-core communication method of fig. 3 may be performed by the second processor 202 of fig. 2. As shown in fig. 3, the dual processor inter-core communication method includes:
in step S301, the encapsulated data transmitted from the first processor is received, and the encapsulated data is obtained by encapsulating the encapsulated data based on a packet protocol pre-negotiated between the first processor and the second processor.
In one embodiment, the packet protocol includes a frame delimiter, a data length after framing header, a message attribute, a message ID, a message stream number, an original data length, original data, and a check code; the message attributes include the number of fragments, the fragment number, and the acknowledgement signal.
The frame delimiter field is a delimiter for a data frame, and may also be referred to as a frame header, for marking the beginning of the header of a complete data frame. In the packet protocol, the first 6 bytes may be set as the frame delimiter.
The data length after the frame header is used for marking how much data is after the frame header, and calculating a complete frame. In this packet protocol, the data length after framing header may be marked with two bytes.
Message attributes, which may be marked in two bytes. The meaning of the message attributes is illustrated in table 1 below.
TABLE 1 meaning description of message attributes
Bit (Bit) 12~15 8~11 4~7 3 0~2
Description of the meanings Reservation of Number of fragments Fragment serial number ACK Encryption method
The number of fragments is used for indicating how many fragments of data are split into to be transmitted by the first processor for transmission. For example, one data to be transmitted is split into 3 pieces of data to be transmitted, and then the number of pieces is 3.
And the slice sequence number is used for indicating the sequence number of the slice data, for example, splitting one data to be transmitted into 3 slice data (such as splitting slice data 1, slice data 2 and slice data 3) for transmission, so that the slice sequence number is 1 representing slice data 1, the slice sequence number is 2 representing slice data 2 and the slice sequence number is 3 representing slice data 3.
The fragment sequence numbers are numbered from 1, and if the data (message) to be transmitted has no fragment, the fragment number and the fragment sequence number are both 1.
The acknowledgement signal, ACK (Acknowledgement) signal, acknowledges the character and in data communication the receiver sends a transmission class control character to the sender. This bit "1" indicates that the counterpart is required to respond to the ACK response, and "0" indicates that the counterpart is not required to respond to the ACK response.
The message attributes may also include encryption, bit0-Bit2 are data encryption identification bits. In some embodiments, when the three bits are all 0, it is indicated that the message body is not encrypted; when bit1 is 1, it indicates that the message body is encrypted (e.g., encrypted by RSA algorithm).
Bit12 to Bit15 are reserved.
Message IDs, corresponding to the IDs of the respective messages, occupy two Bytes (Bytes) for extending the nesting of protocols.
Message stream number, which is two Bytes, is used to indicate what piece of information the current message belongs to sent by the first processor (sender).
The original data length, namely the payload data length, is limited by the singlechip and the drive configuration, and has effective payload data with different sizes. The calculation formula is as follows: maximum transmit Buffer-17 = payload length.
Raw data, i.e., payload data. In order to make data transmission more reliable, the original data is transmitted in batches, and certain auxiliary information such as the size of data volume, check bits (check codes) and the like is added to the head and tail of each batch of data, so that the method is equivalent to adding some jackets to the batched original data, the jackets play a role in marking the original data so that the original data is not easy to lose, and a basic transmission unit called a data frame or a data packet of a transmission channel is formed by adding a "jacket" to one batch of data.
Table 2 is a data frame structure of a packet protocol according to an embodiment of the present application.
TABLE 2
As an example, assuming that the data to be transmitted is "12345", the current network condition is good, and the data size is suitable, the data may be successfully received by the second processor 202 once and completely, and the first processor 201 may encapsulate the data to be transmitted as "12345" into "framing header+after-framing header data length+message id+message attribute+message serial number+payload data length+payload data (" 12345 ") +check Code" according to the above-mentioned packet protocol; the encapsulated data is then sent to the second processor 202.
In step S302, if the package data includes the incomplete data frame, the incomplete data frame is pushed into the secondary buffer pool.
Encapsulated data, which may include one or more frames of data. The data frame may be a complete data frame or an incomplete data frame.
As an example, assuming that a complete data frame contains N bytes, then a data frame containing < N bytes is an incomplete data frame. For example, assuming that the complete data frame is "header+header data length+message id+message attribute+message running number+payload data length+payload data (" 12345 ") +check Code", if the second processor 202 receives the data frame that is "header+header data length+message id+message attribute+message running number+payload data length+payload data (" 1234 ") +check Code)", that is, the partial Payload data is lost, the data frame received by the second processor 202 is an incomplete data frame.
Step S303, performing frame breaking and splicing processing or frame missing continuous transmission processing or frame error retransmission processing according to the incomplete data frame to obtain a complete data frame, and pushing the complete data frame out of the secondary buffer pool.
Step S304, unpacking the complete data frame to obtain unpacked data.
The unpacking data is the data to be transmitted before the first processor does not adopt the package protocol to conduct package.
According to the technical scheme provided by the embodiment of the application, the data is encapsulated and transmitted by adding the packet protocol which is negotiated in advance between the first processor and the second processor, so that the stability of data transmission can be further improved on the basis of a traditional inter-core communication mechanism based on buffer design, the consumption of IO resources can be reduced, and the traditional low-cost serial port performance is exerted to the greatest extent. Meanwhile, a secondary buffer pool is designed in the second processor and is used for temporarily storing the incomplete data frames, and frame breaking and splicing processing or frame missing continuous transmission processing or frame error retransmission processing are carried out on the incomplete data frames, so that stable transmission of large data packets at a higher transmission rate (such as a transmission rate of 921600 bps) can be realized, the packet loss rate in the transmission process is lower, long-time reliable connection between the two processors can be realized, the stability of data transmission between the first processor and the second processor is further improved, and the communication cost can be greatly reduced.
In some embodiments, the frame breaking and splicing process or the frame missing continuous transmission process or the frame error retransmission process is performed according to the incomplete data frame, which specifically includes:
acquiring a serial number of a residual frame message of a residual data frame, a data length after framing a header and an original data length;
acquiring a previous frame message serial number of a previous data frame of the incomplete data frame and a subsequent frame message serial number of a subsequent data frame;
judging whether the residual frame message serial number is a continuous serial number according to the residual frame message serial number, the previous frame message serial number and the next frame message serial number;
if the serial number of the residual frame information is a continuous serial number, the incomplete data frame has no disordered data, and the incomplete data frame is determined to be only missing part of original data according to the data length after the frame header is fixed and the original data length, the incomplete data frame is determined to be a broken frame, and broken frame splicing processing is carried out according to the incomplete data frame;
if the serial number of the residual frame information is a discontinuous serial number, the incomplete data frame has no disorder data, and the incomplete data frame is determined to be only missing part of original data according to the data length after the frame header is fixed and the original data length, the incomplete data frame is determined to be a missing frame, and frame missing continuous transmission processing is carried out according to the incomplete data frame;
if the serial number of the residual frame information is a discontinuous serial number, and the information head of the incomplete data frame is damaged and lost according to the data length after the frame head is fixed and the original data length, the incomplete data frame is determined to be an error frame, and error frame retransmission processing is carried out according to the incomplete data frame.
The residual frame message stream number indicates what piece of information the residual data frame belongs to transmitted by the first processor 201.
The preceding frame message stream number indicates what piece of information the preceding data frame in the incomplete data frame belongs to transmitted by the first processor 201.
The post-frame message stream number indicates what piece of information the first processor 201 transmits in the data frame following the incomplete data frame.
As an example, assuming that the data to be transmitted is "H12345R H12345R H12345R H12345RH12345R", where one complete data frame includes Payload data "H12345R", the data to be transmitted may be divided into 5 complete data frames with message flows having numbers of 1, 2, 3, 4, and 5, respectively. If the first processor 201 splits the data to be transmitted into two pieces of data, namely, the piece of data 01"H12345R H12345R H123" and the piece of data 02"45R H12345R H12345R", the two pieces of data are respectively encapsulated into two pieces of encapsulated data according to the above-mentioned encapsulation protocol, and then transmitted to the second processor 202.
The following describes the second processor 202 receiving the encapsulated data "H12345R H12345R H" in detail. The encapsulated data "H12345R H12345R H" includes two complete data frames of "H12345R" and one incomplete data frame of "H123".
If the serial number of the residual frame message of the incomplete data frame "H123" is 3, the serial number of the previous frame message of the previous data frame "H12345R" is 2, and the next data frame is null, i.e. the received data frames of the encapsulated data are continuous serial numbers, and it is determined that the incomplete data frame only lacks part of the original data according to the data length after the frame header of the incomplete data frame "H123" and the original data length, then it may be determined that the incomplete data frame "H123" is a broken frame.
If the serial number of the residual frame message of the incomplete data frame "H123" is 3, the serial number of the previous frame message of the previous data frame "H12345R" is 1, and the next data frame is null, that is, the received data frame of the encapsulated data is a discontinuous serial number, and it is determined that the incomplete data frame only lacks part of the original data according to the data length after the frame header of the incomplete data frame "H123" and the original data length, it may be determined that the fragmented data 01 leaks, and the incomplete data frame "H123" is a broken frame.
If the serial number of the residual frame message of the incomplete data frame 'H123' is 3, the serial number of the previous frame message of the previous data frame 'H12345R' is 1, the next data frame is empty, namely the received data frame of the encapsulation data is a discontinuous serial number, and the message header of the incomplete data frame is damaged and lost according to the data length after the frame header is fixed and the original data length, the incomplete data frame 'H123' can be judged to be an error frame.
In some embodiments, the frame breaking and splicing process is performed on the incomplete data frame to obtain a complete data frame, which specifically includes:
determining the data type and the frame tail data of the incomplete data frame;
searching the data frames to be spliced, which are the same as the data types and are matched with the frame tail data, in the secondary buffer pool;
and splicing the incomplete data frame and the data frame to be spliced to obtain a complete data frame.
The data type indicates which type of vehicle-mounted function data or control data the malfunctioned data frame belongs to. Such as door control data, window control data, vehicle air conditioning control data, vehicle entertainment function data, and the like.
The frame tail data is mainly used for indicating the position of the broken frame.
As an example, if it is determined that the incomplete data frame "H123" is a broken frame through the above steps, it is further determined to which type of in-vehicle function data or control data the incomplete data frame "H123" belongs, and it is determined to which end-of-frame data. For example, the incomplete data frame "H123" belongs to window control data, and its frame tail data is the fourth data bit "3" in the third message. Next, the second processor 202 may search the second level buffer pool for whether there is a data frame to be spliced that matches the fourth data bit "3" in the third message, i.e., whether there is a data frame of the fourth message and the first data bit is "4", from among the incomplete data frames belonging to the window control data. If the second level buffer pool has the incomplete data frame "45R", the data frame is the fourth message and the first data bit is "4", the incomplete data frame "45R" may be determined as the data frame to be spliced. Then, the incomplete data frame 'H123' and the incomplete data frame '45R' are spliced to obtain a complete data frame 'H12345R', and the complete data frame 'H12345R' is pushed out of the secondary buffer pool so as to further unpack the complete data frame 'H12345R' to obtain unpacked data.
According to the technical scheme provided by the embodiment of the application, after receiving the encapsulated data sent by the first processor, the second processor judges that the encapsulated data contains incomplete data frames, and the incomplete data frames are broken frames, the incomplete data frames are pushed into the secondary buffer pool, then broken frame splicing processing is carried out on the incomplete data frames in the secondary buffer pool according to the first-in first-out principle, after the splicing is successful, the spliced complete data frames are pushed out of the secondary buffer pool, so that the complete data frames enter a main thread for unpacking processing, and unpacking data are obtained.
In some embodiments, the frame missing continuous transmission process is performed according to the incomplete data frame to obtain a complete data frame, which specifically includes:
returning a residual frame continuous transmission instruction to the first processor, wherein the residual frame continuous transmission instruction comprises a frame missing position, so that the first processor determines continuous transmission data based on the frame missing position and returns the continuous transmission data;
when the continuous transmission data is received, the incomplete data frame and the continuous transmission data are assembled into a complete data frame.
As an example, if the second processor 202 determines that the residual frame message stream number is a discontinuous stream number through the above steps, it may determine that the slice data 01 is missing (i.e. lacks some data frames), and then may return a residual frame continuous transmission instruction to the first processor 201, where the residual frame continuous transmission instruction includes a missing frame position, i.e. the message stream number of the data frame that is not received. For example, the sequence number of the residual frame message of the incomplete data frame "H123" is 3, and the sequence number of the previous frame message of the previous data frame is 1, so that it can be determined that the received slice data 01 lacks the second message, that is, the data frame with the sequence number of 2 is not received. At this point, the second processor 202 may return a residual frame retransmission instruction containing "lack second message" to the first processor 201. After receiving the residual frame continuous transmission instruction, the first processor 201 searches the data frame with message serial number of 2 from the data backup pool, assembles the data frame into continuous transmission data, and returns the continuous transmission data to the second processor 202. And if the continuous transmission data is determined to be a complete data frame, unpacking the complete data frame to obtain unpacked data.
As another example, if the second processor 202 determines that the serial number of the residual frame message of the residual data frame "H123" is a serial number and determines that the residual data frame only lacks part of the original data according to the data length after the frame header and the original data length, then the residual data frame "H123" is determined as a missing frame. The second processor 202 returns a residual frame-continuing instruction including the missing frame position of the residual data frame "H123", i.e., the data loss start position, which is the fourth data bit "3" in this example, to the first processor 201. After receiving the residual frame continuous transmission instruction, the first processor 201 searches the data frame with the message serial number of 2 from the data backup pool, intercepts the data from the next data bit to the last data bit of the fourth data bit of '3', and encapsulates the continuous transmission data to be transmitted to the second processor 202. After receiving the continuous transmission data "45R", the second processor 202 splices the incomplete data frame "H123" and the continuous transmission data "45R" to obtain a complete data frame "H12345R", and pushes the complete data frame "H12345R" out of the secondary buffer pool.
According to the technical scheme provided by the embodiment of the application, when the second processor determines that the incomplete data frame is the missing frame or the currently received encapsulated data missing frame, the residual frame continuous transmission instruction is returned to the first processor, so that the first processor only needs to retransmit part of the lost encapsulated data frame or part of the original data lost by the incomplete data frame to the second processor again, and does not need to retransmit all data of the encapsulated data or the incomplete data frame, and performance loss caused by retransmitting all data again can be avoided.
The missing frame reissue only needs reissue the message/data not received by the second processor, and the message which is received currently can be saved. For example, one complete data frame should have 500 bytes of data, but the last ten data of the data frame received by the second processor is lost. In the conventional mode, the complete 500 bytes of data need to be retransmitted, but the frame missing reissue technical means provided in the embodiment of the present application may only need to transmit 10 bytes of data that are not received by the second processor. Therefore, compared with the traditional mode, the data transmission rate performance can be improved by approximately 10 times by the technical means of frame missing and concurrent transmission, and the improvement is very important for TBOX.
In some embodiments, the error frame retransmission process is performed according to the incomplete data frame to obtain a complete data frame, which specifically includes:
and returning a complete retransmission instruction to the first processor so that the first processor retransmits the complete data frame corresponding to the incomplete data frame, and eliminates the incomplete data frame, wherein the complete retransmission instruction comprises the incomplete frame message serial number of the incomplete data frame.
As an example, if the second processor 202 determines that the serial number of the residual frame message of the residual data frame "H123" is a discontinuous serial number and the header of the residual data frame "H123" is damaged and lost (e.g. the content corresponding to any one or more of bytes 0-15 in table 2 is damaged (e.g. garbled) or lost), the residual data frame "H123" is a wrong frame. At this time, the second processor 202 may return a full retransmission instruction including the residual frame message stream number "3" of the residual data frame to the first processor 201; and simultaneously, clearing the incomplete data frame 'H123' from the secondary cache pool. Upon receiving the full retransmission instruction, the first processor 201 searches the data backup pool for a complete data frame with message sequence number "3", and repackages the complete data frame and transmits the complete data frame to the second processor 202.
Meanwhile, since the incomplete frame message stream number of the incomplete data frame "H123" is a discontinuous stream number, the second processor 202 needs to return the incomplete frame transmission instruction to the first processor 201, so that the first processor retransmits the data frame with the message stream number of "2".
It can be appreciated that if the serial number of the residual frame message is a serial number and the header of the residual data frame is damaged and lost, a complete retransmission command may be returned to the first processor 201 only, so that the first processor 201 retransmits the complete data frame corresponding to the residual data frame.
For the long-time-consuming business such as car window lifting, tail gate lifting angle adjustment, air conditioner adjustment and the like, timely network fault discovery is an important means for improving user perception. According to the technical scheme provided by the embodiment of the application, if the message header of the incomplete data frame is damaged and lost according to the data length after the frame header is fixed and the original data length, the current data link is possibly damaged due to external interference, and at the moment, the second processor can return a complete retransmission instruction containing attribute parameters such as the message ID, the message serial number and the like of the incomplete data frame to the first processor, so that the first processor can retransmit the current message in time without waiting until the second processor returns an ACK response to be overtime, and then the retransmission is carried out, and therefore the data/message transmission response efficiency under a severe network environment can be obviously improved.
In some embodiments, in step S302, the method includes:
if the encapsulated data comprises at least one complete data frame and at least one incomplete data frame, classifying the encapsulated data to obtain a complete data frame set and an incomplete data frame set;
pushing the complete data frame set into a first thread for unpacking treatment to obtain unpacked data;
pushing the incomplete data frame set into the storage pool through the second thread, and pushing the incomplete data frame set into the secondary cache pool from the storage pool.
As an example, the second processor 202 receives the encapsulated data "H12345R H12345R H" will be described in detail. The encapsulated data "H12345R H12345R H" includes two complete data frames of "H12345R" and one incomplete data frame of "H123". The encapsulated data "H12345RH12345R H123" is classified to obtain a complete data frame set and a incomplete data frame set. The complete data frame set comprises two complete data frames of 'H12345R' and 'H12345R', and the incomplete data frame set comprises one incomplete data frame of 'H123'.
Pushing two complete data frames of H12345R and H12345R into a first thread to carry out unpacking treatment to obtain unpacked data. Pushing the incomplete data frame 'H123' into a second thread, pushing the incomplete data frame into a storage pool through the second thread, pushing the incomplete data frame into a secondary buffer pool from the storage pool according to the first-in first-out principle, then processing according to the incomplete data frame, performing frame breaking splicing processing or frame missing continuous transmission processing or frame error retransmission processing according to the steps, so as to obtain a complete data frame, and pushing the complete data frame out of the secondary buffer pool.
Fig. 4 is a schematic flow chart of a data/message receiving method according to an embodiment of the present application. The data/message receiving method may be performed by the second processor 202 of fig. 1. The data/message receiving method comprises the following steps:
step S401, receiving the package data transmitted from the first processor 201;
step S402, judging whether the package data is enough to form more than or equal to 1 complete data frame according to a package protocol;
step S403, if the package data is enough to form more than or equal to 1 complete data frame, classifying the package data to obtain a complete data frame set and a incomplete data frame set;
step S404, pushing the complete data frame set into a first thread for unpacking processing to obtain unpacked data;
step S405, pushing the incomplete data frame set into a storage pool through a second thread, and then pushing the incomplete data frame set into a secondary cache pool from the storage pool;
step S406, judging the attribute of the incomplete data frame in the incomplete data frame set according to the serial number of the incomplete message of the incomplete data frame in the incomplete data frame set, the data length after framing, the original data length, the serial number of the previous frame message of the previous data frame and the serial number of the subsequent frame message of the subsequent data frame;
Step S407, if the incomplete data frame is determined to be a broken frame, performing broken frame splicing processing on the incomplete data frame, and pushing the complete data frame successfully spliced out of a secondary buffer pool;
step S408, if the package data is determined to be frame missing or the incomplete data frame is frame missing, frame missing continuous transmission processing is carried out according to the incomplete data frame;
step S409, if the incomplete data frame is determined to be an error frame, performing error frame retransmission processing according to the incomplete data frame, and cleaning the incomplete data frame from the secondary buffer pool.
In some embodiments, the first processor 201 may transmit data to the second processor 202 according to the data/message transmission flow as shown in fig. 5, according to the current network conditions and the size of the data/message to be transmitted.
In an embodiment, if the current network condition is good and the data size of the data to be transmitted is suitable, the data can be received successfully by the receiving end completely at one time, and then the data to be transmitted can be encapsulated by using a pre-negotiated packet protocol (as shown in table 2 above) of the first processor 201 and the second processor 202, so as to obtain encapsulated data, and then the encapsulated data is sent to the second processor 202 at one time. The first processor 201 will synchronize storing the encapsulated data backup in the data backup pool when sending the encapsulated data to the second processor 202. After receiving the ACK response returned by the second processor 202, the first processor 201 determines the type of the ACK response, and if the type of the ACK response is that the ACK is successfully received, the encapsulated data in the data backup pool is cleaned.
In another embodiment, if the current network condition is good, but the data of the data to be transmitted is too large and needs to be sent in a fragmented manner, the data to be transmitted may be split first to obtain a plurality of fragmented data, and then each fragmented data is encapsulated by using the above-mentioned encapsulation protocol to obtain a plurality of encapsulated data (fragmented packets). After each time a fragment packet is sent to the second processor 202, the fragment packet is backed up into the data backup pool, the next fragment packet can be continuously sent without waiting for the second processor 202 to return the ACK response of the fragment packet, and the fragment packet is synchronously backed up into the data backup pool, so that the effect of parallel sending is achieved, and the efficiency of data transmission is improved.
In yet another embodiment, if the current network is unstable, the time difference is good during the sending of the fragmented packets, so that part of the data of a fragmented packet is lost during the transmission (e.g. part of the payload data is lost). At this time, after receiving the slice packet, if the second processor 202 determines that the slice packet is a missing frame, the second processor feeds back the current frame tail data and the residual frame continuous transmission instruction to the first processor 201. After receiving the feedback from the first processor 201, the second processor 202 finds the backup data of the fragment packet in the data backup pool, locates to the beginning data position of the missing frame, cuts out the data from the beginning data position to the last data position of the data frame, determines the partial data as continuous transmission data, and transmits the continuous transmission data to the second processor 202.
In this way, the first processor 201 only needs to retransmit the lost part of the data of the slice packet to the second processor 202, instead of retransmitting all the data of the slice packet, so that performance loss caused by retransmitting all the data of the slice packet again can be avoided.
In still another embodiment, if the current network is bad, for example, the package data sent by the first processor 201 cannot be received and resolved by the second processor 202 due to electromagnetic interference, link interference or network anomaly, the second processor 202 may feed back a complete retransmission instruction to the first processor 201 when determining that the package data is a wrong frame, where the complete retransmission instruction includes attribute parameters such as a message ID, a message serial number, and the like of the package data. After receiving the complete retransmission instruction, if the network is restored to be normal, the first processor 201 may find backup data of the encapsulated data from the data backup pool, and immediately send the backup data to the second processor 202, without waiting until the ACK response returned by the second processor 202 is judged to be overtime, and then performing complete retransmission. Therefore, the response efficiency of message transmission in a severe network environment can be obviously improved. If the network is in a bad condition, the method waits until the ACK response returned by the second processor 202 is judged to be overtime, and then performs complete retransmission.
In summary, the technical solution provided in this embodiment of the present application, by adopting a specific packet protocol between the first processor and the second processor and combining with a series of mechanisms that ensure stable transmission such as a message queue and a data slicing technology, can bring the performance of the conventional low-cost serial port into play extremely, and by introducing a second-level buffer pool into the second processor to process the incomplete data frame, three technical means of general frame breaking and splicing, frame missing and frame missing retransmission are upgraded, so that the conventional pain points such as unstable data/message transmission, easy packet loss when the rate is too large are well improved, the requirement that the cost needs to be reduced (the price is reduced by about 10 times compared with that of the conventional reliable ethernet network) is very met, and the consumption of IO resources (the cost is reduced by about 5 times, the area of the PCB board layout is greatly reduced), the reliability (compared with the conventional method, the stable operation can be performed at the rate of 921600bps and the low-level failure rate can be controlled within the acceptable range), the user experience (such as the message can be actively requested to be retransmitted when the failure occurs, and the message is always sent at the maximum limit) is avoided.
Any combination of the above optional solutions may be adopted to form an optional embodiment of the present application, which is not described herein in detail.
The following are device embodiments of the present application, which may be used to perform method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
Fig. 6 is a schematic structural diagram of a dual-processor inter-core communication device according to an embodiment of the present application. As shown in fig. 5, the dual processor inter-core communication device includes:
the receiving module 601 is configured to receive the encapsulated data transmitted by the first processor, where the encapsulated data is obtained by encapsulating the encapsulated data based on a packet protocol that is pre-negotiated by the first processor and the second processor; the packet protocol comprises a frame delimiter field, a data length after framing header, a message attribute, a message ID, a message serial number, an original data length, original data and a check code; the message attribute comprises a fragment number, a fragment sequence number and a confirmation signal;
a pushing module 602 configured to push the incomplete data frame into the secondary cache pool if the encapsulated data includes the incomplete data frame;
the processing module 603 is configured to perform frame breaking and splicing processing, frame missing continuous transmission processing or frame error retransmission processing according to the incomplete data frame so as to obtain a complete data frame, and push the complete data frame out of the secondary buffer pool;
The unpacking module 604 is configured to unpack the complete data frame to obtain unpacked data.
According to the technical scheme provided by the embodiment of the application, the data is encapsulated and transmitted by adding the packet protocol which is negotiated in advance between the first processor and the second processor, so that the stability of data transmission can be further improved on the basis of a traditional inter-core communication mechanism based on buffer design, the consumption of IO resources can be reduced, and the traditional low-cost serial port performance is exerted to the greatest extent. Meanwhile, a secondary buffer pool is designed in the second processor and is used for temporarily storing the incomplete data frames, and frame breaking and splicing processing or frame missing continuous transmission processing or frame error retransmission processing are carried out on the incomplete data frames, so that stable transmission of large data packets at a higher transmission rate (such as a transmission rate of 921600 bps) can be realized, the packet loss rate in the transmission process is lower, long-time reliable connection between the two processors can be realized, the stability of data transmission between the first processor and the second processor is further improved, and the communication cost can be greatly reduced.
In some embodiments, the processing module 603 includes:
the first acquisition unit is configured to acquire a residual frame message serial number, a data length after framing header and an original data length of a residual data frame;
A second acquisition unit configured to acquire a preceding frame message running number of a preceding data frame of the incomplete data frame and a following frame message running number of a following data frame;
the judging unit is configured to judge whether the residual frame message serial number is a continuous serial number according to the residual frame message serial number, the previous frame message serial number and the next frame message serial number;
the first processing unit is configured to determine that the incomplete data frame is a broken frame if the serial number of the incomplete frame message is a continuous serial number and the incomplete data frame is determined to be only missing part of original data according to the data length after the frame header is fixed and the original data length, and to perform broken frame splicing processing on the incomplete data frame;
the second processing unit is configured to determine that the encapsulated data leaks frames if the serial number of the residual frame message is a discontinuous serial number, or determine that the incomplete data frame is a frame leaking frame if the serial number of the residual frame message is a continuous serial number and only a part of original data is lost according to the data length after the frame header is fixed and the original data length; carrying out frame missing continuous transmission processing according to the incomplete data frame;
and the third processing unit is configured to determine that the incomplete data frame is an error frame if the serial number of the incomplete frame message is a discontinuous serial number, and determine that the message header of the incomplete data frame is damaged and lost according to the data length after the frame header is fixed and the original data length, and perform error frame retransmission processing according to the incomplete data frame.
In some embodiments, the processing module 603 includes:
a determining unit configured to determine a data type and end-of-frame data of the incomplete data frame;
the searching unit is configured to search the data frames to be spliced, which are the same as the data types and are matched with the frame tail data, in the secondary cache pool;
and the splicing unit is configured to splice the incomplete data frame and the data frame to be spliced to obtain a complete data frame.
According to the technical scheme provided by the embodiment of the application, after receiving the encapsulated data sent by the first processor, the second processor judges that the encapsulated data contains incomplete data frames, and the incomplete data frames are broken frames, the incomplete data frames are pushed into the secondary buffer pool, then broken frame splicing processing is carried out on the incomplete data frames in the secondary buffer pool according to the first-in first-out principle, after the splicing is successful, the spliced complete data frames are pushed out of the secondary buffer pool, so that the complete data frames enter a main thread for unpacking processing, and unpacking data are obtained.
In some embodiments, the processing module 603 includes:
the first response unit is configured to return a residual frame continuous transmission instruction to the first processor, wherein the residual frame continuous transmission instruction comprises a frame missing position, so that the first processor determines continuous transmission data based on the frame missing position and returns the continuous transmission data;
And an assembling unit configured to assemble the incomplete data frame and the continuous transmission data into one complete data frame when the continuous transmission data is received.
According to the technical scheme provided by the embodiment of the application, when the second processor determines that the incomplete data frame is the missing frame or the currently received encapsulated data missing frame, the first processor returns the incomplete frame continuous transmission instruction to the first processor through the first response unit, so that the first processor only needs to retransmit a part of lost data frame of the encapsulated data or a part of lost original data of the incomplete data frame to the second processor again, and does not need to retransmit all data of the encapsulated data or the incomplete data frame, and performance loss caused by retransmitting all data again can be avoided.
In some embodiments, the processing module 603 includes:
and the second response unit is configured to return a complete retransmission instruction to the first processor so that the first processor retransmits the complete data frame corresponding to the incomplete data frame and clears the incomplete data frame, and the complete retransmission instruction comprises the incomplete frame message serial number of the incomplete data frame.
According to the technical scheme provided by the embodiment of the application, if the message header of the incomplete data frame is damaged and lost according to the data length after the frame header is fixed and the original data length, the current data link is possibly damaged due to external interference, and at the moment, the second processor can return a complete retransmission instruction containing attribute parameters such as the message ID, the message serial number and the like of the incomplete data frame to the first processor, so that the first processor immediately retransmits the current message without waiting until the second processor returns an ACK response to be overtime, and then resends the message, thereby obviously improving the data/message transmission response efficiency under a severe network environment.
In some embodiments, push module 602 includes:
the classification unit is configured to classify the encapsulated data to obtain a complete data frame set and a incomplete data frame set if the encapsulated data comprises at least one complete data frame and at least one incomplete data frame;
the unpacking unit is configured to push the complete data frame set into the first thread to carry out unpacking processing to obtain unpacked data;
and the pushing unit is configured to push the incomplete data frame set into the storage pool through the second thread and push the incomplete data frame set into the secondary cache pool from the storage pool.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic of each process, and should not limit the implementation process of the embodiment of the present application in any way.
Fig. 7 is a schematic structural diagram of a TBOX according to an embodiment of the present application. As shown in fig. 7, the TBOX includes: a first processor 201 and a second processor 202; the first processor 201 and the second processor 202 perform inter-core communication based on serial ports; the second processor 202 includes a dual processor inter-core communication device as shown in fig. 6.
According to the technical scheme provided by the embodiment of the application, the data is encapsulated and transmitted by adding the packet protocol which is negotiated in advance between the first processor and the second processor, so that the stability of data transmission can be further improved on the basis of a traditional inter-core communication mechanism based on buffer design, the consumption of IO resources can be reduced, and the traditional low-cost serial port performance is exerted to the greatest extent. Meanwhile, a secondary buffer pool is designed in the second processor and is used for temporarily storing incomplete data frames, and frame breaking splicing processing or frame missing continuous transmission processing or frame error retransmission processing is carried out according to the incomplete data frames, so that stable transmission of large data packets at a higher transmission rate (such as a transmission rate of 921600 bps) can be realized, the packet loss rate in the transmission process is lower, long-time reliable connection between the two processors can be realized, the stability of data transmission between the first processor and the second processor is further improved, and the communication cost can be greatly reduced.
Fig. 8 is a schematic diagram of an electronic device 8 provided in an embodiment of the present application. As shown in fig. 8, the electronic device 8 of this embodiment includes: a processor 801, a memory 802, and a computer program 803 stored in the memory 802 and executable on the processor 801. The steps of the various method embodiments described above are implemented by the processor 801 when executing the computer program 803. Alternatively, the processor 801, when executing the computer program 803, performs the functions of the modules/units of the apparatus embodiments described above.
The electronic device 8 may be a desktop computer, a notebook computer, a palm computer, a cloud server, or the like. The electronic device 8 may include, but is not limited to, a processor 801 and a memory 802. It will be appreciated by those skilled in the art that fig. 8 is merely an example of the electronic device 8 and is not limiting of the electronic device 8 and may include more or fewer components than shown, or different components.
The processor 801 may be a central processing unit (Central Processing Unit, processor) or other general purpose processor, digital signal processor (Digital Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like.
The memory 802 may be an internal storage unit of the electronic device 8, for example, a hard disk or a memory of the electronic device 8. The memory 802 may also be an external storage device of the electronic device 8, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device 8. Memory 802 may also include both internal storage units and external storage devices for electronic device 8. The memory 802 is used to store computer programs and other programs and data required by the electronic device.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application implements all or part of the flow in the methods of the above embodiments, or may be implemented by a computer program to instruct related hardware, and the computer program may be stored in a computer readable storage medium, where the computer program may implement the steps of the respective method embodiments described above when executed by a processor. The computer program may comprise computer program code, which may be in source code form, object code form, executable file or in some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying 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 (Random Access Memory, RAM), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the content of the computer readable medium can be appropriately increased or decreased according to the requirements of the jurisdiction's jurisdiction and the patent practice, for example, in some jurisdictions, the computer readable medium does not include electrical carrier signals and telecommunication signals according to the jurisdiction and the patent practice.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (8)

1. The inter-core communication method of the dual processors is characterized by being applied to a second processor, wherein a second-level cache pool is arranged in the second processor; the method comprises the following steps:
receiving encapsulation data transmitted by a first processor, temporarily storing the encapsulation data in a buffer area, wherein the encapsulation data is obtained by encapsulation based on a package protocol which is negotiated in advance by the first processor and a second processor; the package protocol comprises a frame delimiter domain, a data length after framing, a message attribute, a message ID, a message serial number, an original data length, original data and a check code; the message attribute comprises a fragment number, a fragment sequence number and a confirmation signal;
Reading the encapsulated data from the buffer area and judging whether the encapsulated data comprises incomplete data frames or not;
if the package data comprises the incomplete data frame, pushing the incomplete data frame into a secondary cache pool;
performing frame breaking and splicing processing or frame missing continuous transmission processing or frame error retransmission processing according to the incomplete data frames to obtain complete data frames, and pushing the complete data frames out of the secondary buffer pool;
unpacking the complete data frame to obtain unpacked data;
if the encapsulated data includes an incomplete data frame, pushing the incomplete data frame into a secondary cache pool, including:
if the encapsulated data comprises at least one complete data frame and at least one incomplete data frame, classifying the encapsulated data to obtain a complete data frame set and an incomplete data frame set;
pushing the complete data frame set into a first thread for unpacking treatment to obtain unpacked data;
pushing the incomplete data frame set into a storage pool through a second thread, and pushing the incomplete data frame set into a secondary cache pool from the storage pool.
2. The method according to claim 1, wherein performing a frame breaking splice process or a frame missing continuous transmission process or a frame missing retransmission process according to the incomplete data frame comprises:
Acquiring a residual frame message serial number, a data length after framing header and an original data length of the residual data frame;
acquiring a previous frame message serial number of a previous data frame of the incomplete data frame and a subsequent frame message serial number of a subsequent data frame;
judging whether the residual frame message serial number is a continuous serial number according to the residual frame message serial number, the previous frame message serial number and the next frame message serial number;
if the serial number of the residual frame message is a continuous serial number, and the incomplete data frame is determined to be only missing part of original data according to the data length after the frame header is fixed and the original data length, determining that the incomplete data frame is a broken frame, and performing broken frame splicing processing according to the incomplete data frame;
if the residual frame message serial number is a discontinuous serial number, determining that the encapsulated data is frame missing, or if the residual frame message serial number is a continuous serial number, determining that the incomplete data frame only lacks part of original data according to the data length after the frame header is fixed and the original data length, and determining that the incomplete data frame is frame missing; performing frame missing continuous transmission processing according to the incomplete data frame;
if the serial number of the residual frame information is a discontinuous serial number, and the information head of the incomplete data frame is damaged and lost according to the data length after the frame head is fixed and the original data length, the incomplete data frame is determined to be an error frame, and error frame retransmission processing is carried out according to the incomplete data frame.
3. The method according to claim 1 or 2, wherein performing a frame breaking and splicing process according to the incomplete data frame to obtain a complete data frame comprises:
determining the data type and the frame tail data of the incomplete data frame;
searching a data frame to be spliced, which is the same as the data type and is matched with the frame tail data, in the secondary buffer pool;
and splicing the incomplete data frame and the data frame to be spliced to obtain a complete data frame.
4. The method according to claim 1 or 2, wherein performing frame missing continuous transmission processing according to the incomplete data frame to obtain a complete data frame comprises:
returning a residual frame continuous transmission instruction to a first processor, wherein the residual frame continuous transmission instruction comprises a frame missing position, so that the first processor determines continuous transmission data based on the frame missing position and returns the continuous transmission data;
and when the continuous transmission data is received, the incomplete data frame and the continuous transmission data are assembled into a complete data frame.
5. The method according to claim 1 or 2, wherein performing a frame-error retransmission process according to the incomplete data frame to obtain a complete data frame comprises:
And returning a complete retransmission instruction to the first processor so that the first processor retransmits a complete data frame corresponding to the incomplete data frame and clears the incomplete data frame, wherein the complete retransmission instruction comprises a incomplete frame message serial number of the incomplete data frame.
6. A dual processor inter-core communication device, comprising:
the receiving module is configured to receive the encapsulation data transmitted by the first processor, temporarily store the encapsulation data in a buffer area, and encapsulate the encapsulation data based on a packet protocol which is negotiated in advance by the first processor and the second processor; a second-level cache pool is arranged in the second processor; the package protocol comprises a frame delimiter domain, a data length after framing, a message attribute, a message ID, a message serial number, an original data length, original data and a check code; the message attribute comprises a fragment number, a fragment sequence number and a confirmation signal;
a judging module configured to read the package data from the buffer area and judge whether the package data includes a malformed data frame;
the pushing module is configured to push the incomplete data frame into a secondary cache pool if the package data comprises the incomplete data frame;
The processing module is configured to perform frame breaking and splicing processing or frame missing continuous transmission processing or frame error retransmission processing according to the incomplete data frames so as to obtain complete data frames, and push the complete data frames out of the secondary buffer pool;
the unpacking module is configured to unpack the complete data frame to obtain unpacked data;
if the encapsulated data includes an incomplete data frame, pushing the incomplete data frame into a secondary cache pool, including:
if the encapsulated data comprises at least one complete data frame and at least one incomplete data frame, classifying the encapsulated data to obtain a complete data frame set and an incomplete data frame set;
pushing the complete data frame set into a first thread for unpacking treatment to obtain unpacked data;
pushing the incomplete data frame set into a storage pool through a second thread, and pushing the incomplete data frame set into a secondary cache pool from the storage pool.
7. A TBOX comprising a first processor and a second processor;
the first processor and the second processor perform inter-core communication based on serial ports;
the second processor includes the dual processor inter-core communication device of claim 6.
8. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method according to any one of claims 1 to 5.
CN202310540640.0A 2023-05-12 2023-05-12 Dual-processor inter-core communication method and device, TBOX and storage medium Active CN116561045B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310540640.0A CN116561045B (en) 2023-05-12 2023-05-12 Dual-processor inter-core communication method and device, TBOX and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310540640.0A CN116561045B (en) 2023-05-12 2023-05-12 Dual-processor inter-core communication method and device, TBOX and storage medium

Publications (2)

Publication Number Publication Date
CN116561045A CN116561045A (en) 2023-08-08
CN116561045B true CN116561045B (en) 2024-03-29

Family

ID=87496051

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310540640.0A Active CN116561045B (en) 2023-05-12 2023-05-12 Dual-processor inter-core communication method and device, TBOX and storage medium

Country Status (1)

Country Link
CN (1) CN116561045B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102510323A (en) * 2011-09-22 2012-06-20 航天科工惯性技术有限公司 Frame identifying method for serial data
CN102591291A (en) * 2012-02-27 2012-07-18 固高科技(深圳)有限公司 Industrial controller and human-machine interface bidirectional data transmission system and method
CN108268420A (en) * 2016-12-31 2018-07-10 智车优行科技(北京)有限公司 Communication means, processor and electronic equipment between processor
CN110990328A (en) * 2019-10-23 2020-04-10 武汉光庭信息技术股份有限公司 Method and system for reliable communication between dual processors of TBox
CN113676736A (en) * 2020-05-13 2021-11-19 华为技术有限公司 Data frame transmission method and communication device
CN113783662A (en) * 2021-11-12 2021-12-10 中国信息通信研究院 Adaptive data transmission method and device, computer equipment and readable storage medium
CN115733898A (en) * 2021-08-31 2023-03-03 华为技术有限公司 Data transmission method and related equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102510323A (en) * 2011-09-22 2012-06-20 航天科工惯性技术有限公司 Frame identifying method for serial data
CN102591291A (en) * 2012-02-27 2012-07-18 固高科技(深圳)有限公司 Industrial controller and human-machine interface bidirectional data transmission system and method
CN108268420A (en) * 2016-12-31 2018-07-10 智车优行科技(北京)有限公司 Communication means, processor and electronic equipment between processor
CN110990328A (en) * 2019-10-23 2020-04-10 武汉光庭信息技术股份有限公司 Method and system for reliable communication between dual processors of TBox
CN113676736A (en) * 2020-05-13 2021-11-19 华为技术有限公司 Data frame transmission method and communication device
CN115733898A (en) * 2021-08-31 2023-03-03 华为技术有限公司 Data transmission method and related equipment
CN113783662A (en) * 2021-11-12 2021-12-10 中国信息通信研究院 Adaptive data transmission method and device, computer equipment and readable storage medium

Also Published As

Publication number Publication date
CN116561045A (en) 2023-08-08

Similar Documents

Publication Publication Date Title
US11792114B2 (en) System and method for facilitating efficient management of non-idempotent operations in a network interface controller (NIC)
CN107835040B (en) Data communication method, equipment and storage medium based on Bluetooth
CN111786748B (en) Data retransmission method and system, network card, device, server and storage medium
US11695669B2 (en) Network interface device
US9003053B2 (en) Message acceleration
US7580406B2 (en) Remote direct memory access segment generation by a network controller
US7710968B2 (en) Techniques to generate network protocol units
CN111327603B (en) Data transmission method, device and system
US20080002578A1 (en) Network with a constrained usage model supporting remote direct memory access
US20170353385A1 (en) Techniques for forwarding or receiving data segments associated with a large data packet
US20070074092A1 (en) Techniques to determine integrity of information
US8166227B2 (en) Apparatus for processing peripheral component interconnect express protocol
WO2018018627A1 (en) Data transmission method and system, and receiving device
CN111343148A (en) FGPA communication data processing method, system and device
WO2023124098A1 (en) Method and communication apparatus for generating and sending acknowledgment frame in ieee 802.15.4 network
CN114978433A (en) Data transmission method, device, equipment, storage medium and computer program product
KR20200139059A (en) Controller diagnostic device and method thereof
CN116561045B (en) Dual-processor inter-core communication method and device, TBOX and storage medium
CN110958216B (en) Secure online network packet transmission
CN110830386B (en) Message order preserving method, device and system
CN115913473B (en) Data selective retransmission method and system, storage medium and electronic equipment thereof
WO2020063501A1 (en) Method for transmitting confirmation message, and communication device
US8904062B2 (en) Network control model driver
US20230208676A1 (en) Data communication method and apparatus, electronic device, and storage medium
US9661110B2 (en) System and method for enabling channel access enhancements in existing communication networks

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
TA01 Transfer of patent application right

Effective date of registration: 20240116

Address after: No. 13 Xingxiang Road, Zengjia Town, High tech Zone, Shapingba District, Chongqing, 400039

Applicant after: Chongqing Selis Phoenix Intelligent Innovation Technology Co.,Ltd.

Address before: 610095 No. 2901, floor 29, unit 1, building 1, No. 151, Tianfu Second Street, high tech Zone, China (Sichuan) pilot Free Trade Zone, Chengdu, Sichuan Province

Applicant before: Chengdu Thalys Technology Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant