Search

CN-115988110-B - Inter-chip communication method and storage medium

CN115988110BCN 115988110 BCN115988110 BCN 115988110BCN-115988110-B

Abstract

The application discloses an inter-chip communication method and a storage medium, and relates to the technical field of communication. The inter-chip communication method comprises the steps of packaging slave computer data through a first communication protocol layer of a slave computer to obtain a first protocol packet, packaging the first protocol packet through a first data link layer of the slave computer to obtain a first data packet, pulling an active data sending pin of the slave computer to a low level so that a host computer detects the low level and reads the slave computer data according to the low level, and sending the first data packet to the host computer. The inter-chip communication method can ensure timeliness of data transmission and enable data interaction to be quicker.

Inventors

  • LIN TENGWEI
  • HUANG WENPAN
  • HUO YAOGUANG
  • HUANG BINGXIN

Assignees

  • 深圳市新国都支付技术有限公司

Dates

Publication Date
20260505
Application Date
20221220

Claims (5)

  1. 1. An inter-chip communication method, which is applied to a slave, comprising: packaging the data of the slave machine through a first communication protocol layer of the slave machine to obtain a first protocol packet; packaging the first protocol packet through a first data link layer of the slave machine to add a first check domain, a first frame header and a first control domain to the first protocol packet so as to obtain a first data packet; Pulling the active data-up pin of the slave to a low level so that the master detects the low level and reads the slave data according to the low level; Transmitting the first data packet to the host; when the first data link layer does not receive a first management frame of the host within a preset time threshold, recording the slave data sent at this time as abnormal data, and retransmitting the first data packet through the first data link layer; when the number of retransmission times is larger than a preset first number threshold, determining that the data transmission fails, recording the failure reason and accumulating the failure times; and when the received first management frame represents the receiving failure of the host, determining that the data transmission fails, recording the failure reason and accumulating the failure times.
  2. 2. The method of inter-chip communication according to claim 1, wherein the method further comprises: receiving a second data packet sent by the host through the first data link layer; Sequentially carrying out analysis processing through the first data link layer and the first communication protocol layer to obtain first target data; and generating a second management frame and sending the second management frame to the host.
  3. 3. An inter-chip communication method, applied to a host, comprising: When the level signal of the active data-up pin of the slave is detected to be low level, receiving a first data packet sent by the slave through a second data link layer; Analyzing the first data packet sequentially through a second data link layer and a second communication protocol layer of the host to obtain second target data, wherein the second data link layer analyzes the first data packet by removing a first check domain, a first frame header and a first control domain in the first data packet; Generating a first management frame and sending the first management frame to the slave; packaging the host data through a second communication protocol layer of the host to obtain a second protocol packet; packaging the second protocol packet through a second data link layer of the host to obtain a second data packet; Transmitting the second data packet to a slave; When the second data link layer does not receive the second management frame of the slave machine within a preset time threshold, recording the host data sent this time as abnormal data, retransmitting the second data packet through the second data link layer, when the retransmission frequency is larger than a preset second frequency threshold, determining to send data failure, recording failure reasons and accumulating failure frequencies, and when the received second management frame represents the failure of the slave machine in receiving, determining to send data failure, recording failure reasons and accumulating failure frequencies.
  4. 4. The method of inter-chip communication according to claim 3, further comprising: And when the failure times are greater than a preset third time threshold, pulling the I/O pin of the slave to a low level so that the slave is restarted according to the low level.
  5. 5. A computer readable storage medium having stored thereon computer executable instructions for causing a computer to perform the method of any one of claims 1 to 4.

Description

Inter-chip communication method and storage medium Technical Field The present application relates to the field of communications technologies, and in particular, to an inter-chip communication method and a storage medium. Background In the related art, in order to meet the requirement of more functions, electronic devices are generally provided with a plurality of chips, and data transmission is generally required between the chips to facilitate the cooperation. Currently, in order to realize data transmission between chips, it is generally required to determine a communication mode first, and then perform data transmission according to the communication mode. The common communication mode is an active mode or a low-power consumption mode, and in the two modes, one chip is usually used as a host, and the other chip is usually used as a slave, when the host enters a dormant state, if the slave needs to perform data transmission, the host needs to wait for the host to enter a working state autonomously, which causes the problem of delay of data receiving by the host and is unfavorable for timeliness of data transmission. Therefore, how to ensure timeliness of data transmission becomes a technical problem to be solved. Disclosure of Invention The present application aims to solve at least one of the technical problems existing in the prior art. Therefore, the application provides the inter-chip communication method and the storage medium, which can ensure the timeliness of data transmission and enable data interaction to be quicker. An inter-chip communication method according to an embodiment of the first aspect of the present application is applied to a slave, and the method includes: packaging the data of the slave machine through a first communication protocol layer of the slave machine to obtain a first protocol packet; packaging the first protocol packet through a first data link layer of the slave machine to obtain a first data packet; Pulling the active data-up pin of the slave to a low level so that the master detects the low level and reads the slave data according to the low level; and sending the first data packet to the host. The inter-chip communication method at least has the advantages that firstly, the data of the slave machine are packaged through the first communication protocol layer of the slave machine to obtain a first protocol packet, secondly, the first protocol packet is packaged through the first data link layer of the slave machine to obtain a first data packet, afterwards, the active data-sending pin of the slave machine is pulled to a low level, so that the host machine detects the low level and reads the data of the slave machine according to the low level, and finally, the first data packet is sent to the host machine. According to the inter-chip communication method, the active data-sending pin arranged on the slave is pulled to the low level, and when the master detects that the active data-sending pin is at the low level, the data sent by the slave can be actively read, that is, compared with the traditional method that the master automatically triggers the master to enter the working mode through software, the master can enter the working mode more quickly through a hardware passive triggering mode, the time required for data transmission is shortened, and therefore the data has a faster interaction frequency in the same time. Therefore, the inter-chip communication method can ensure the timeliness of data transmission and enable data interaction to be quicker. According to some embodiments of the application, the method further comprises: when the first data link layer does not receive a first management frame of the host within a preset time threshold, recording the slave data sent at this time as abnormal data, and retransmitting the first data packet through the first data link layer; when the number of retransmission times is larger than a preset first number threshold, determining that the data transmission fails, recording the failure reason and accumulating the failure times. According to some embodiments of the application, the method further comprises: and when the received first management frame represents the receiving failure of the host, determining that the data transmission fails, recording the failure reason and accumulating the failure times. According to some embodiments of the application, the method further comprises: receiving a second data packet sent by the host through the first data link layer; Sequentially carrying out analysis processing through the first data link layer and the first communication protocol layer to obtain first target data; and generating a second management frame and sending the second management frame to the host. An inter-chip communication method according to an embodiment of the second aspect of the present application is applied to a host, and the method includes: When the level signal of the active data-up pin of the slav