Data transmission method and device, medium and product

通过主设备端与从设备端之间的四次握手机制,解决了多次数据传输中因异常导致的数据丢失问题,实现了数据传输的可靠性和互信互联。

CN120295958AActive Publication Date: 2025-07-11SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510788370.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2025-07-11
Estimated Expiration
2045-06-13

AI Technical Summary

Technical Problem

The existing VALID/READY mobile phone system can only ensure the reliability of a single data transmission, and cannot solve the problem of incomplete data transmission caused by abnormalities during multiple data transmissions, resulting in data loss and affecting the next transmission.

Method used

Through the four-time mobile phone system between the master and slave devices, including read and write request confirmation, execution result transmission, lagged data list refresh request and lagged data retransmission, ensuring the reliability of data transmission.

Benefits of technology

It improves the reliability of multiple data transmissions, avoids data loss, and ensures mutual trust and interconnection between the master and slave devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120295958A_ABST
    Figure CN120295958A_ABST
Patent Text Reader

Abstract

Disclosed are a data transmission method, device, medium and product, which relate to the technical field of communications, comprising: a master end sending a read-write request to a slave end, so as to determine a target virtual channel from a plurality of virtual channels after receiving a confirmation reception signal replied by the slave end, and sending a channel identifier of the target virtual channel and the read-write request to the slave end, when the execution result and the channel identifier returned by the slave end are received, the execution result is stored in the cache through the target virtual channel corresponding to the channel identifier; the execution result is generated when the slave end executes read-write operation based on the read-write request; obtaining a refresh request generated by the slave end based on the retention data list after finishing the read-write operation, and replying a refresh confirmation signal to the slave end, so that the slave end retransmits the retention data to the master end and updates the retention data list; and acquiring an updated retention data list sent by the slave end after ending the retransmission operation, and replying a refresh completion signal to the slave end. And the reliability of multiple data transmission is improved based on four handshakes between the master end and the slave end.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technologies, and particularly to a data transmission method, device, medium and product. Background Art

[0002] An SoC (System on Chip) chip is a highly integrated integrated circuit design that can integrate all key components of a computer or other electronic system onto a single chip. In an SoC chip, an on-chip bus can achieve fast data exchange between a processor and a memory and peripherals, support concurrent communication of multiple modules, and meet the requirements of complex systems.

[0003] Among them, the bus handshaking mechanism within the chip is a protocol for controlling data transmission, ensuring reliable and efficient data transmission between a sender and a receiver. Common handshaking mechanisms include the VALID / READY protocol, where the sender indicates that the data is ready through the VALID signal, and the receiver indicates that it can receive the data through the READY signal. When both the VALID and READY signals are high, the sender transmits the data to the receiver, and at this time, the data transmission is completed. This handshaking mechanism supports two-way flow control. The sender controls the sending timing, and the receiver controls the receiving speed to avoid data congestion and loss. However, this handshaking mechanism can only ensure the reliability of a single data transmission. If an exception occurs during this data transmission and the data is not fully transmitted, since this handshaking mechanism does not provide a corresponding solution, it will cause the problem of data loss during the transmission process and affect the next data transmission.

[0004] It can be seen that how to improve the reliability of multiple data transmissions is a problem that those skilled in the art need to solve. Summary of the Invention

[0005] The purpose of the embodiments of the present invention is to provide a data transmission method, device, medium and product that can improve the reliability of multiple data transmissions based on the four-way handshake between the master device end and the slave device end. The specific solutions are as follows:

[0006] In a first aspect, the present invention provides a data transmission method applied to the master device end, including: Sending a read / write request to the slave device end, and after receiving the acknowledgment reception signal replied by the slave device end based on the read / write request, determining a target virtual channel from a plurality of virtual channels; Sending the channel identifier of the target virtual channel and the read / write request to the slave device end, and when obtaining the execution result and the channel identifier returned by the slave device end, storing the execution result into the corresponding cache via the target virtual channel corresponding to the channel identifier; the execution result is the result generated when the slave device end performs corresponding data read / write operations based on the read / write request. Obtain a refresh request generated by the slave device based on the list of stranded data after the data read / write operation is completed, and reply with an acknowledgment refresh signal to the slave device, so that the slave device can retransmit the stranded data to the master device and update the list of stranded data; the list of stranded data is used to record the information of each piece of stranded data; Obtain the updated list of stranded data sent by the slave device after the retransmission operation is completed, and reply with a refresh completion signal to the slave device.

[0007] Optionally, the master device and the slave device communicate with each other through the on-chip bus; Correspondingly, the slave device retransmits the stranded data to the master device, including: The slave device splices each piece of stranded data using the transmission bandwidth of the bus and retransmits the spliced data to the master device.

[0008] Optionally, determining a target virtual channel from several virtual channels includes: Obtain each data to be read / written from the corresponding cache based on the read / write request; Determine a target virtual channel from several virtual channels according to each data to be read / written and the credit signal.

[0009] Optionally, determining a target virtual channel from several virtual channels according to each data to be read / written and the credit signal includes: Allocate a first target virtual channel for each data to be read / written from several virtual channels, and store each data to be read / written in the corresponding first target virtual channel; Determine a second target virtual channel with a credit count not less than a preset count from several virtual channels according to the credit signal, so as to output the data to be read / written stored in the first target virtual channel via the second target virtual channel.

[0010] Optionally, sending the channel identifier of the target virtual channel and the read / write request to the slave device includes: Send the channel identifiers of the first target virtual channel and the second target virtual channel, and the read / write request including the data to be read / written output by the second target virtual channel to the slave device.

[0011] Optionally, the refresh request is a request generated by the slave device based on the information on whether there is stranded data in the list of stranded data; wherein, if there is no information on stranded data in the list of stranded data, no refresh request is generated, and if there is information on stranded data in the list of stranded data, a refresh request is generated.

[0012] Optionally, the data transmission method of the present invention further includes: When the stranded cache and the local cache in the slave device reach their respective cache thresholds, obtain the backpressure signal sent by the slave device; When the channel usage quantities of a number of virtual channels reach a preset quantity and the caches in the master device end reach their respective corresponding cache thresholds, an anti-pressure signal is sent to the host computer so that the host computer stops sending data to the master device end; Among them, the retention cache is used to store retention data; the local cache is used to store data generated by the slave device end itself and data obtained from the outside.

[0013] Optionally, before sending the anti-pressure signal to the host computer, it further includes: When the channel usage quantity reaches the preset quantity, the anti-pressure signal is sent to the secondary data cache in the master device end via the primary list cache in the master device end to prohibit the secondary data cache from sending data to a number of virtual channels; When the secondary data cache reaches the corresponding cache threshold, the anti-pressure cache in the master device end is enabled based on the anti-pressure signal to receive the data sent by the host computer through the enabled anti-pressure cache; When the anti-pressure cache reaches the corresponding cache threshold, the operation of sending the anti-pressure signal to the host computer is triggered; Among them, the primary list cache is used to store the status information of the secondary data cache, the master device end and the slave device end; the secondary data cache is used to store the data generated by the master device end itself and the data obtained from the outside.

[0014] Optionally, the data transmission method of the present invention further includes: When a preset change event is detected, or when a new slave device end is detected to be accessed, the primary list cache is updated; Among them, the preset change event is an event in which the status information of the secondary data cache, the master device end or the slave device end changes.

[0015] Optionally, the status information of any object includes an object identifier, an occupied space identifier, a channel identifier of a virtual channel, and a set of status fields; any object is any one of the secondary data cache, the master device end and the slave device end; the occupied space identifier is used to identify the size of the space occupied by the status information of any object in the primary list cache.

[0016] Optionally, the set of status fields of any object includes a data status identifier for data to be read and written, a full free space identifier, and a fragmented free space identifier; the full free space identifier is used to identify whether the cache of any object is a completely free space; the fragmented free space identifier is used to identify the proportion of the fragmented free space in the cache of any object; the fragmented free space is a block space containing free address segments among each block space; each block space is a space obtained by partitioning the cache of any object; and data is stored in the addresses adjacent to the free address segments before and after.

[0017] Optionally, the status information of any object further includes a custom field associated with the fragmented free space identifier; Correspondingly, when it is necessary to write target data into the cache of any object, based on the custom field and the fragmented free space identifier, each free address segment is determined from the cache of any object, and after determining the target free address segment capable of completely storing the target data from each free address segment, the target data is written into the target free address segment.

[0018] In a second aspect, the present invention provides an electronic device, including: A memory for storing a computer program; A processor for executing the computer program to implement the steps of the foregoing data transmission method.

[0019] In a third aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the foregoing data transmission method are implemented.

[0020] In a fourth aspect, the present invention provides a computer program product, including computer program / instructions, and when the computer program / instructions are executed by a processor, the steps of the foregoing data transmission method are implemented.

[0021] In the present invention, the master device sends a read / write request to the slave device, and after receiving the acknowledgment reception signal replied by the slave device based on the read / write request, determines the target virtual channel from several virtual channels; sends the channel identifier of the target virtual channel and the read / write request to the slave device, and when obtaining the execution result and the channel identifier returned by the slave device, stores the execution result into the corresponding cache via the target virtual channel corresponding to the channel identifier; the execution result is the result generated when the slave device performs the corresponding data read / write operation based on the read / write request; obtains the refresh request generated by the slave device based on the stranded data list after the data read / write operation ends, and replies an acknowledgment refresh signal to the slave device, so that the slave device retransmits the stranded data to the master device and updates the stranded data list; the stranded data list is used to record the information of each stranded data; obtains the updated stranded data list sent by the slave device after the retransmission operation ends, and replies a refresh completion signal to the slave device.

[0022] Beneficial effects: The master device sends a read / write request to the slave device and receives an acknowledgement signal replied by the slave device. This belongs to the first handshake between the master device and the slave device. The purpose of the first handshake is to determine whether the master device can send the channel identifier and read / write request of the target virtual channel to the slave device, and to determine whether the slave device can receive the channel identifier and read / write request of the target virtual channel sent by the master device. After that, the master device sends the channel identifier and read / write request of the target virtual channel to the slave device and receives the execution result and channel identifier replied by the slave device. This belongs to the second handshake between the master device and the slave device. The purpose of the second handshake is to implement data reading and writing of the master device to the slave device. Next, after finishing the data reading and writing operation, the slave device generates a refresh request based on the retention data list and sends it to the master device, and receives the acknowledgement refresh signal replied by the master device. This belongs to the third handshake between the master device and the slave device. The purpose of the third handshake is to resend the retention data in the slave device that needs to be sent to the master device to the master device, solve the problem that there is data retained in the slave device that has not been sent to the master device after abnormally ending the data reading and writing operation, avoid data loss during the transmission process, and improve the reliability of data transmission. Finally, the slave device sends the retention data list to the master device and receives the refresh completion signal replied by the master device. This belongs to the fourth handshake between the master device and the slave device. The purpose of the fourth handshake is to enable the slave device to synchronize the current situation of the internal retention data to the master device. In this way, through the four handshakes between the master device and the slave device, the present invention can not only ensure the mutual trust and interconnection between the master device and the slave device, but also ensure the reliability of multiple data transmissions between the master device and the slave device. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] To more clearly illustrate the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0024] Figure 1 It is a flowchart of a data transmission method provided by an embodiment of the present invention; Figure 2 It is a flowchart of virtual channel selection provided by an embodiment of the present invention; Figure 3 It is a flowchart of multi-level cache backpressure provided by an embodiment of the present invention; Figure 4 It is a schematic diagram of a set of status fields provided by an embodiment of the present invention; Figure 5 It is a schematic diagram of a first-level list cache provided by an embodiment of the present invention; Figure 6 A data transmission architecture diagram provided by an embodiment of the present invention; Figure 7 A four - way handshake flow chart provided by an embodiment of the present invention; Figure 8 Another four - way handshake flow chart provided by an embodiment of the present invention; Figure 9 A structural diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners

[0025] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present invention.

[0026] The terms "including" and "having" in the specification of the present invention and any deformations related to "including" and "having" are intended to cover non - exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may include steps or units not listed.

[0027] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.

[0028] In the VALID / READY handshake protocol, only the reliability of a single data transmission can be guaranteed. If an exception occurs during this data transmission and the data is not completely transmitted, since this handshake mechanism does not provide a corresponding solution, it will cause the problem of data loss during the transmission process and affect the next data transmission. For this reason, the present invention provides a data transmission method that can improve the reliability of multiple data transmissions based on the four - way handshake between the master device and the slave device.

[0029] See Figure 1 As shown, an embodiment of the present invention provides a data transmission method, which is applied to the master device and includes:

[0030] Step S11: Send a read - write request to the slave device, and after receiving the acknowledgment signal replied by the slave device based on the read - write request, determine a target virtual channel from a plurality of virtual channels.

[0031] In an embodiment of the present invention, the master device obtains a read / write request sent by the host computer and performs a first handshake operation to send the read / write request to the slave device via the on-chip bus; correspondingly, after receiving the read / write request, the slave device determines whether to reply an acknowledgment signal to the master device according to the local cache in the slave device; the master device receives the acknowledgment signal replied by the slave device via the on-chip bus and determines a target virtual channel from a plurality of virtual channels.

[0032] It should be noted that the number of slave devices is at least one, and the slave devices are connected to the master device via the on-chip bus, that is, the master device and the slave devices communicate with each other via the on-chip bus, or in other words, the signal / data transmission between the master device and the slave devices needs to pass through the on-chip bus to be transmitted to the other party.

[0033] Moreover, after receiving the read / write request, the slave device parses the read / write request to determine the cache capacity required for this read / write, and determines whether normal read / write can be performed according to the cache capacity required for this read / write and the free capacity in the local cache. If normal read / write cannot be performed, the rejection signal is returned to the master device via the on-chip bus. If normal read / write can be performed, the acknowledgment signal is returned to the master device via the on-chip bus.

[0034] Specifically, if the cache capacity required for this read / write is greater than the free capacity in the local cache, it is determined that normal read / write cannot be performed; if the cache capacity required for this read / write is less than or equal to the free capacity in the local cache, it is determined that normal read / write can be performed.

[0035] Furthermore, in the process of determining the target virtual channel from a plurality of virtual channels, each data to be read / written is obtained from the corresponding cache based on the read / write request, and the target virtual channel is determined from a plurality of virtual channels according to each data to be read / written and the credit signal.

[0036] Specifically, each data to be read / written is obtained from the corresponding cache based on the read / write request, a first target virtual channel is allocated to each data to be read / written from a plurality of virtual channels, and each data to be read / written is stored in the corresponding first target virtual channel respectively; the second target virtual channel with a credit count not less than the preset count is determined from a plurality of virtual channels according to the credit signal, so as to output the data to be read / written stored in the first target virtual channel via the second target virtual channel.

[0037] It should be noted that for the determination of the first target virtual channel and the determination of the second target virtual channel, there is no order requirement, that is, the first target virtual channel can be determined first and then the second target virtual channel, or the second target virtual channel can be determined first and then the first target virtual channel, or the first target virtual channel and the second target virtual channel can be determined simultaneously.

[0038] Such asFigure 2 As shown, taking the example of obtaining multiple data to be read and written from the corresponding cache at the same moment, virtual channel arbitration is performed on the multiple data to be read and written based on the read and write requests, so as to respectively allocate a first target virtual channel for the multiple data to be read and written from several virtual channels, and then store the multiple data to be read and written into the corresponding first target virtual channels respectively. Determine the credit bits of several virtual channels according to the credit signals, and select a second target virtual channel with the credit bit set to 1, where the credit bit of the virtual channel being set to 1 indicates that the credit count of the virtual channel is not less than a preset count, and the preset count can be set to 0. Then output the data to be read and written stored in the first target virtual channel via the second target virtual channel.

[0039] It should be noted that during the process of outputting the data to be read and written stored in the first target virtual channel via the second target virtual channel, determine the second target virtual channel corresponding to each first target virtual channel based on the overlap situation and / or load situation of the first target virtual channel and the second target virtual channel, and output the data to be read and written stored in the first target virtual channel via the corresponding second target virtual channel. In this way, by considering the overlap situation, the number of times of data transmission between channels can be reduced, and by considering the load situation, the load balance between multiple virtual channels can be guaranteed to a large extent.

[0040] According to one specific implementation manner, when the overlap situation between the first target virtual channel and the second target virtual channel indicates that there is an overlapping channel between the first target virtual channel and the second target virtual channel, for any channel in the first target virtual channel, if any channel is an overlapping channel, then determine the channel in the second target virtual channel that is the same as any channel as the second target virtual channel corresponding to any channel; if any channel is not an overlapping channel, then determine the channel with the smallest current load from the second target virtual channel according to the load situation of the second target virtual channel, and determine the channel with the smallest current load as the second target virtual channel corresponding to any channel.

[0041] In addition, priorities can be set for several virtual channels respectively, so as to further determine the second target virtual channel corresponding to each first target virtual channel by combining the priority levels of the first target virtual channel and the second target virtual channel. Among them, preferentially select a second target virtual channel for the first target virtual channel with a higher priority. Correspondingly, the second target virtual channel with a higher priority is preferentially selected.

[0042] It should also be noted that if only one data to be read and written is obtained from the corresponding cache at the same moment, there is no need to perform virtual channel arbitration on the data to be read and written, and directly allocate a first target virtual channel for the data to be read and written from several virtual channels.

[0043] Step S12: Send the channel identifier of the target virtual channel and the read / write request to the slave device end, so that when the execution result and the channel identifier returned by the slave device end are obtained, the execution result is stored in the corresponding cache via the target virtual channel corresponding to the channel identifier; the execution result is the result generated when the slave device end performs corresponding data read / write operations based on the read / write request.

[0044] In the embodiment of the present invention, the master device end performs a second handshake operation to send the channel identifiers of the first target virtual channel and the second target virtual channel and the read / write request including the data to be read / written output by the second target virtual channel to the slave device end via the on-chip bus; correspondingly, the slave device end performs corresponding data read / write operations on the local cache based on the read / write request to read / write the data to be read / written in the local cache, and returns the execution result generated when performing the data read / write operation and the channel identifier to the master device end via the on-chip bus; when the master device end receives the execution result and the channel identifier, the execution result is stored in the corresponding cache via the target virtual channel corresponding to the channel identifier.

[0045] It should be noted that the local cache in the slave device end is used to store the data generated by the slave device end itself and the data obtained from the outside; the data obtained from the outside here includes the data obtained from the master device end and the data obtained from the host computer, etc. Moreover, the local cache in the slave device end is implemented using on-chip SRAM (Static Random-Access Memory), and the reading and writing of data are managed through read / write pointers.

[0046] Step S13: Obtain the refresh request generated by the slave device end based on the stranded data list after the data read / write operation ends, and reply an acknowledgment refresh signal to the slave device end, so that the slave device end can retransmit the stranded data to the master device end and update the stranded data list; the stranded data list is used to record the information of each stranded data item.

[0047] In the embodiment of the present invention, after the slave device end normally ends the data read / write operation, it determines whether to generate a refresh request based on the stranded data list; if a refresh request is generated, it performs a third handshake operation to send the refresh request to the master device end via the on-chip bus, and obtains the acknowledgment refresh signal replied by the master device end based on the refresh request, so that when the slave device end receives the acknowledgment refresh signal, it can retransmit the stranded data to the master device end and update the stranded data list. If no refresh request is generated, the third handshake operation is no longer performed, that is, this round of four-way handshake between the master device end and the slave device end is ended.

[0048] Among them, the retained data refers to the data retained in the slave device and needs to be sent to the master device. The reasons for the generation of retained data include, but are not limited to, when the slave device performs a data reading operation, if the data reading operation ends abnormally, the data in the slave device is not completely read to the master device and the parameters of the internal chip bus will be reset to end the four-way handshake of this round. At this time, the slave device continues to read the remaining data from the local cache to the retained cache of the slave device. When performing the third handshake operation of the four-way handshake in the next round, the slave device retransmits the retained data in the retained cache to the master device based on the retained data list.

[0049] It should be noted that considering the actual working conditions of the master device and the slave device, the retained data may be completely retransmitted to the master device during the third handshake operation of a certain round, or only a part of it may be retransmitted to the master device during the third handshake operation of a certain round. In this case, the retained data can also be continuously retransmitted to the master device during the third handshake operation of subsequent rounds until all the retained data is retransmitted to the master device.

[0050] The refresh request is a request generated by the slave device based on the information of whether there is retained data in the retained data list. That is, by judging whether there is information of retained data in the retained data list to determine whether to generate a refresh request. If there is no information of retained data in the retained data list, no refresh request is generated. If there is information of retained data in the retained data list, a refresh request is generated.

[0051] Moreover, the embodiment of the present invention considers that if each piece of retained data is separately sent to the master device through the internal chip bus, it may not fully utilize the transmission bandwidth of the internal chip bus, resulting in bandwidth waste. Therefore, in the embodiment of the present invention, when the slave device receives the confirmation refresh signal, it splices each piece of retained data using the transmission bandwidth of the internal chip bus and retransmits the spliced data to the master device. Among them, the transmission bandwidth of the internal chip bus can be set to 64 bits / 128 bits, etc., so that the spliced data can fully use the transmission bandwidth of the internal chip bus and reduce the number of data transmissions.

[0052] Furthermore, updating the retained data list includes: after the slave device retransmits the retained data to the master device, deleting the information of the retransmitted retained data from the retained data list, so as to update the retained data list. And when new retained data is generated, the information of the newly generated retained data will also be added to the retained data list to update the retained data list.

[0053] Step S14, obtain the updated retained data list sent by the slave device after the retransmission operation ends, and reply a refresh completion signal to the slave device.

[0054] In an embodiment of the present invention, after the slave device finishes the retransmission operation of the stranded data, it performs a fourth handshake operation to send the updated stranded data list to the master device and obtain the refresh completion signal replied by the master device.

[0055] Regarding the end of the retransmission operation, in one case, the master device determines whether to send a retransmission end signal to the slave device based on its own working state and / or the amount of the stranded data retransmitted from the slave device in this round and / or the execution duration of the retransmission operation, so that the slave device ends the retransmission operation based on the retransmission end signal. In another case, the slave device determines whether to end the retransmission operation based on its own working state and / or the amount of the stranded data already retransmitted in this round and / or the execution duration of the retransmission operation. Of course, there can be other cases, and no more examples are given here.

[0056] After receiving the stranded data list sent by the slave device, the master device can determine the information of the stranded data in the slave device according to the stranded data list. For example, how many pieces of stranded data are included in the slave device, the size of each piece of stranded data, etc. Then, the master device returns the refresh completion signal to the slave device to end the four-way handshake between the master device and the slave device in this round.

[0057] In order to solve problems such as the possible decline in data transmission performance caused by bus congestion, the present invention further designs a multi-level cache backpressure mechanism to dynamically adjust the data transmission rate in combination with the four-way handshake to ensure efficient operation under peak load.

[0058] Specifically, when the stranded cache and the local cache in the slave device reach their respective cache thresholds, the master device obtains the backpressure signal sent by the slave device, and when the number of channel usages of several virtual channels reaches a preset number and the caches in the master device reach their respective cache thresholds, the master device sends the backpressure signal to the host computer so that the host computer stops sending data to the master device. Among them, the stranded cache in the slave device is used to store the stranded data; the local cache in the slave device is used to store the data generated by the slave device itself and the data obtained from the outside.

[0059] More specifically, after the master device receives the backpressure signal sent by the slave device, when the number of used channels in several virtual channels reaches the preset number, the master device sends the backpressure signal to the secondary data cache in the master device through the primary list cache in the master device to prohibit the secondary data cache from sending data to the several virtual channels; when the secondary data cache reaches the corresponding cache threshold, the backpressure cache in the master device is enabled based on the backpressure signal to receive the data sent by the host computer through the enabled backpressure cache; when the backpressure cache reaches the corresponding cache threshold, the operation of sending the backpressure signal to the host computer is triggered so that the host computer stops sending data to the master device.

[0060] Among them, the primary list cache in the master device is used to store the state information of the secondary data cache, the master device, and the slave device; the secondary data cache in the master device is used to store the data generated by the master device itself and the data obtained from the outside, where the data obtained from the outside includes but is not limited to the data obtained from the slave device and the data obtained from the host computer.

[0061] As Figure 3 shown, the multi-level cache backpressure mechanism regards the slave device as the lower layer, the master device as the middle layer, and the host computer as the upper layer, and each cache in each device corresponds to an independent cache threshold. Specifically, when the retention cache in the slave device reaches the corresponding cache threshold 0 and the local cache in the slave device reaches the corresponding cache threshold 1, the slave device sends a backpressure signal to the master device. After the master device receives the backpressure signal sent by the slave device, when the number of used channels in several virtual channels reaches the preset number 2, the master device sends the backpressure signal to the primary list cache in the master device, and the control logic of the primary list cache sends the backpressure signal to the secondary data cache in the master device. At this time, after the secondary data cache receives the backpressure signal, it stops sending data to the virtual channels and enables the backpressure cache in the master device based on the backpressure signal when the secondary data cache reaches the corresponding cache threshold 3, and receives the data sent by the host computer through the enabled backpressure cache; finally, when the backpressure cache reaches the corresponding cache threshold 4, the backpressure signal is sent to the host computer so that the host computer stops sending data to the master device.

[0062] It should be noted that the cache threshold corresponding to each cache can be designed as 90% of the total capacity of each cache. In this way, in the embodiment of the present invention, when the cache in each layer is close to the corresponding cache threshold, the upper layer is notified to stop or slow down data transmission, thereby avoiding data loss or overflow.

[0063] Since the primary list cache is used to store the status information of the secondary data cache, the master device side, and the slave device side, when the master device side detects a preset change event or detects the access of a new slave device side, the primary list cache is updated. Among them, the preset change event is an event in which the status information of the secondary data cache, the master device side, or the slave device side changes.

[0064] It should be noted that after each handshake operation, it will basically bring an event in which the status information of the secondary data cache, the master device side, or the slave device side changes. Therefore, after each handshake operation, it is basically accompanied by an update of the primary list cache.

[0065] For any one of the secondary data cache, the master device side, and the slave device side, denoted as any object, the status information of any object stored in the primary list cache includes an object identifier, an occupied space identifier, a channel identifier of a virtual channel, and a set of status fields.

[0066] Among them, the object identifier occupies 8 bits, and different objects correspond to different object identifiers. The occupied space identifier occupies 4 bits and is used to identify the size of the space occupied by the status information of any object in the primary list cache. The channel identifier of the virtual channel also occupies 4 bits. The set of status fields occupies 8 bits.

[0067] And the set of status fields of any object includes a data status identifier for data to be read and written, a full free space identifier, and a fragmented free space identifier. Among them, the full free space identifier is used to identify whether the cache of any object is completely free space; the fragmented free space identifier is used to identify the proportion of the fragmented free space in the cache of any object; the fragmented free space is a block space that contains free address segments in each block space; each block space is a space obtained by partitioning the cache of any object; and data is stored in the addresses adjacent to the free address segments before and after.

[0068] Such as Figure 4As shown, the data status identifiers for the data to be read and written include the data status identifier for the data to be written and the data status identifier for the data to be read. Each data status identifier occupies 2 bits. Moreover, each data status identifier includes four status cases: 00, 01, 10, and 11. 00 indicates the occupied state, 01 indicates waiting to be written / waiting to be read, 10 indicates waiting to be cleared, and 11 indicates waiting for external handshake refresh. The fully idle space identifier occupies 1 bit, and setting it to 0 indicates a non-fully idle space, while setting it to 1 indicates a fully idle space. Taking the example of dividing a certain cache into eight block spaces, the fragmented idle space identifier occupies 3 bits and includes eight cases: 000, 001, 010, 011, 100, 101, 110, and 111. Among them, 000 indicates no fragmented idle space, 001 indicates having 1 / 8 fragmented idle space, 010 indicates having 2 / 8 fragmented idle space, 011 indicates having 3 / 8 fragmented idle space, 100 indicates having 4 / 8 fragmented idle space, 101 indicates having 5 / 8 fragmented idle space, 110 indicates having 6 / 8 fragmented idle space, and 111 indicates having 7 / 8 fragmented idle space.

[0069] It should be noted that in addition to dividing a certain cache into eight block spaces, it can also be divided into four, sixteen, etc. At this time, it is also necessary to correspondingly adjust the number of bits occupied by the fragmented idle space identifier according to the number of divided blocks.

[0070] Moreover, for the idle address segment, data is stored in the addresses adjacent to the front and back of the idle address segment, while no data is stored in the idle address segment. For example, if the address range of block A space is 0x0001 - 0x1110, and if data is stored in address 0x0001, no data is stored in 0x0010 - 0x0100, and data is stored in 0x0101 - 0x1110, then 0x0010 - 0x0100 is the idle address segment. Correspondingly, block A space is the fragmented idle space.

[0071] Taking the master device side as an example, an example is given to illustrate the data status identifier for the data to be written. When the master device side wants to write data to the slave device side, the master device side is initially in the 11 state. After completing the first handshake operation between the master device side and the slave device side, the master device side switches to the 01 state and starts to obtain the data to be written from the secondary data cache or the backpressure cache. When the data to be written is obtained, the master device side switches to the 00 state. When performing the second handshake operation to send the data to be written to the slave device side, the master device side switches to the 10 state. After completing the second handshake operation, the master device side switches to the 11 state.

[0072] In addition, the status information of any object stored in the first-level list cache further includes a custom field associated with the fragmented free space identifier; this custom field occupies 4 bits and is used to determine the free address segment in the cache of any object in combination with the fragmented free space identifier. Based on this, as shown in the first-level list cache Figure 5 each row represents the status information of an object.

[0073] Correspondingly, when it is necessary to write target data into the cache of any object, based on the custom field and the fragmented free space identifier, determine each free address segment from the cache of any object, and after determining the target free address segment that can completely store the target data from each free address segment, write the target data into the target free address segment. In this way, the embodiments of the present invention can make full use of the fragmented free space in the cache and improve the cache utilization rate.

[0074] Beneficial effects: The master device sends a read / write request to the slave device and receives an acknowledgment signal replied by the slave device. This belongs to the first handshake between the master device and the slave device. The purpose of the first handshake is to determine whether the master device can send the channel identifier and read / write request of the target virtual channel to the slave device, and to determine whether the slave device can receive the channel identifier and read / write request of the target virtual channel sent by the master device. After that, the master device sends the channel identifier and read / write request of the target virtual channel to the slave device and receives the execution result and channel identifier replied by the slave device. This belongs to the second handshake between the master device and the slave device. The purpose of the second handshake is to implement data reading and writing of the master device to the slave device. Next, after the slave device finishes the data reading and writing operation, it generates a refresh request based on the retention data list and sends it to the master device, and receives an acknowledgment refresh signal replied by the master device. This belongs to the third handshake between the master device and the slave device. The purpose of the third handshake is to resend the retention data that needs to be sent to the master device in the slave device to the master device, solve the problem that there is untransmitted data retained inside the slave device after the data reading and writing operation ends abnormally, avoid data loss during the transmission process, and improve the reliability of data transmission. Finally, the slave device sends the retention data list to the master device and receives a refresh completion signal replied by the master device. This belongs to the fourth handshake between the master device and the slave device. The purpose of the fourth handshake is to enable the slave device to synchronize the current situation of the internal retention data to the master device. In this way, through the four handshakes between the master device and the slave device, the present invention can not only ensure the mutual trust and interconnection between the master device and the slave device, but also ensure the reliability of multiple data transmissions between the master device and the slave device.

[0075] Taking Figure 6 and Figure 7 as examples, a data transmission method proposed by the embodiments of the present invention will be elaborated in detail.

[0076] In the first handshake operation, the master device sends a read / write request (i.e., a handshake signal) to the slave device via the on-chip bus through the handshake mechanism. The slave device receives the read / write request through the handshake mechanism and replies with an acknowledgment reception signal (i.e., a handshake signal) to the master device via the on-chip bus. After the master device obtains the acknowledgment reception signal replied by the slave device through the handshake mechanism, it determines that the first handshake operation has ended.

[0077] After the master device ends the first handshake operation, it updates the primary list cache, sends a logical transmission feedback signal to the bus master, and obtains the data to be read / written from the secondary data cache / backpressure cache based on the read / write request, and outputs it to the bus master transmission logic through the target virtual channel.

[0078] In the second handshake operation, the bus master transmission logic outputs the channel identifier of the target virtual channel and the read / write request containing the data to be read / written to the slave device in parallel via the on-chip bus. After the slave device receives the channel identifier of the target virtual channel and the read / write request containing the data to be read / written through the bus slave reception logic, it performs corresponding data read / write operations on the local cache based on the read / write request to read / write the data to be read / written in the local cache, and outputs the execution result generated during the data read / write operation and the channel identifier of the target virtual channel to the master device in parallel via the on-chip bus through the bus slave feedback logic. When the master device receives the execution result and the channel identifier of the target virtual channel through the bus master reception logic, it stores the execution result in the secondary data cache / backpressure cache via the target virtual channel and determines that the second handshake operation has ended.

[0079] In the third handshake operation, after the slave device normally ends the data read / write operation, it determines whether to generate a refresh request based on the stranded data list; if a refresh request is generated, it sends the refresh request (i.e., a handshake signal) to the master device via the on-chip bus through the handshake mechanism. The master device receives the refresh request through the handshake mechanism and replies with an acknowledgment refresh signal (i.e., a handshake signal) to the slave device via the on-chip bus. After the slave device obtains the acknowledgment refresh signal through the handshake mechanism, it retransmits the stranded data in the stranded cache to the master device in parallel via the on-chip bus through the bus slave feedback logic, and updates the stranded data list at the same time until the retransmission operation ends, so as to end the third handshake operation.

[0080] In the fourth handshake operation, after the slave device ends the retransmission operation, it outputs the updated stranded data list to the master device in parallel via the on-chip bus through the bus slave feedback logic. After the master device receives the stranded data list, it replies with a refresh completion signal to the slave device through the handshake mechanism. After the slave device receives the refresh completion signal, it determines that the fourth handshake operation has ended.

[0081] Furthermore, as Figure 8 shown, for the four-way handshake between the master device and the slave device, the on-chip bus initially remains in the idle state. When the first handshake signal from the master device is received, the on-chip bus is enabled, and then the four-way handshake operations between the master device and the slave device are sequentially executed using the on-chip bus. Among them, if a handshake interruption occurs during the execution of the first handshake operation, the on-chip bus is controlled to switch to the idle state. If a handshake interruption occurs during the execution of the second and third handshake operations, the on-chip bus is controlled to switch to the reset state. After resetting the parameters of the on-chip bus, the on-chip bus is controlled to switch to the idle state. If the data read / write operation is normally completed during the execution of the second handshake operation, it is determined whether to generate a refresh request by checking whether there is information about remaining data in the remaining data list. If a refresh request is generated, the third handshake operation is continued. If no refresh request is generated, the third handshake operation is not executed, that is, this round of four-way handshake between the master device and the slave device ends, and the on-chip bus is controlled to switch to the idle state.

[0082] Beneficial effects: The master device sends a read / write request to the slave device and receives an acknowledgment signal replied by the slave device. This belongs to the first handshake between the master device and the slave device. The purpose of the first handshake is to determine whether the master device can send the channel identifier and read / write request of the target virtual channel to the slave device, and to determine whether the slave device can receive the channel identifier and read / write request of the target virtual channel sent by the master device. After that, the master device sends the channel identifier and read / write request of the target virtual channel to the slave device and receives the execution result and channel identifier replied by the slave device. This belongs to the second handshake between the master device and the slave device. The purpose of the second handshake is to realize data reading and writing of the master device to the slave device. Next, after finishing the data reading and writing operation, the slave device generates a refresh request based on the retained data list and sends it to the master device, and receives an acknowledgment refresh signal replied by the master device. This belongs to the third handshake between the master device and the slave device. The purpose of the third handshake is to resend the retained data that needs to be sent to the master device in the slave device to the master device, solve the problem that there is retained data in the slave device that has not been sent to the master device after abnormally ending the data reading and writing operation, avoid data loss during the transmission process, and improve the reliability of data transmission. Finally, the slave device sends the retained data list to the master device and receives a refresh completion signal replied by the master device. This belongs to the fourth handshake between the master device and the slave device. The purpose of the fourth handshake is to enable the slave device to synchronize the current situation of the internal retained data to the master device. In this way, through the four handshakes between the master device and the slave device, the present invention can not only ensure the mutual trust and interconnection between the master device and the slave device, but also ensure the reliability of multiple data transmissions between the master device and the slave device.

[0083] Further, the embodiment of the present application also discloses an electronic device. Figure 9 It is a structural diagram of an electronic device shown according to an exemplary embodiment. The content in the figure should not be considered as any limitation on the scope of use of the present application. The electronic device may specifically include: at least one processor 11, at least one memory 12, a power supply 13, a communication interface 14, an input / output interface 15, and a communication bus 16. Among them, the memory 12 is used to store a computer program, and the computer program is loaded and executed by the processor 11 to implement the relevant steps in the data transmission method disclosed in any of the foregoing embodiments. In addition, the electronic device in this embodiment may specifically be an electronic computer.

[0084] In this embodiment, the power supply 13 is used to provide operating voltages for each hardware device on the electronic device; the communication interface 14 can create a data transmission channel between the electronic device and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and specific limitations thereof are not provided herein; the input / output interface 15 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application requirements, and specific limitations thereof are not provided herein.

[0085] In addition, the memory 12, as a carrier for resource storage, can be a read-only memory, a random access memory, a magnetic disk, an optical disc, etc., and the resources stored thereon can include an operating system 121, a computer program 122, etc., and the storage method can be transient storage or permanent storage.

[0086] Among them, the operating system 121 is used to manage and control each hardware device and the computer program 122 on the electronic device, and it can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the data transmission method executed by the electronic device disclosed in any of the foregoing embodiments, the computer program 122 can further include computer programs that can be used to complete other specific tasks.

[0087] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the data transmission method disclosed above is implemented. For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details are not described herein again.

[0088] Furthermore, this application also discloses a computer program product, including a computer program / instructions; wherein, when the computer program / instructions are executed by a processor, the data transmission method disclosed above is implemented. For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details are not described herein again.

[0089] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and reference can be made to the description in the method part for related parts.

[0090] Those skilled in the art may further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered as exceeding the scope of this application.

[0091] The steps of the methods or algorithms described in combination with the embodiments disclosed herein can be directly implemented by hardware, software modules executed by a processor, or a combination of both. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0092] Finally, it should also be noted that in this document, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.

[0093] The technical solution provided in this application has been introduced in detail above. Specific examples have been used herein to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to this application.

Claims

1. A data transmission method, characterized in that, Applied to the master device side, including: Sending a read / write request to the slave device side, and after receiving the acknowledgment reception signal replied by the slave device side based on the read / write request, determining a target virtual channel from a plurality of virtual channels; Sending the channel identifier of the target virtual channel and the read / write request to the slave device side, and when obtaining the execution result returned by the slave device side and the channel identifier, storing the execution result in the corresponding cache via the target virtual channel corresponding to the channel identifier; the execution result is the result generated when the slave device side performs corresponding data read / write operations based on the read / write request; Obtaining a refresh request generated by the slave device side based on the retention data list after ending the data read / write operation, and replying an acknowledgment refresh signal to the slave device side, so that the slave device side re-transmits the retention data to the master device side and updates the retention data list; the retention data list is used to record the information of each piece of retention data; Obtaining the updated retention data list sent by the slave device side after ending the re-transmission operation, and replying a refresh completion signal to the slave device side.

2. The data transmission method according to claim 1, wherein The master device side communicates with the slave device side through an on-chip bus; Correspondingly, the slave device side re-transmits the retention data to the master device side, including: The slave device side splices each piece of retention data using the transmission bandwidth of the bus, and re-transmits the spliced data to the master device side.

3. The data transmission method according to claim 1, characterized in that, Determining a target virtual channel from a plurality of virtual channels, including: Obtaining each data to be read / written from the corresponding cache based on the read / write request; Determining a target virtual channel from a plurality of virtual channels according to each data to be read / written and the credit signal.

4. The data transmission method according to claim 3, characterized in that The determining a target virtual channel from a plurality of virtual channels according to each data to be read / written and the credit signal includes: Allocating a first target virtual channel for each data to be read / written from the plurality of virtual channels, and storing each data to be read / written in the corresponding first target virtual channel; Determining a second target virtual channel with a credit count not less than a preset count from the plurality of virtual channels according to the credit signal, so as to output the data to be read / written stored in the first target virtual channel via the second target virtual channel.

5. The data transmission method according to claim 4, characterized in that, Sending the channel identifier of the target virtual channel and the read / write request to the slave device side, including: Sending the channel identifiers of the first target virtual channel and the second target virtual channel, and the read / write request including the data to be read / written output by the second target virtual channel to the slave device side.

6. The data transmission method according to claim 1, wherein The refresh request is a request generated by the slave device side based on the information on whether there is retention data in the retention data list; wherein, if there is no information on retention data in the retention data list, the refresh request is not generated, and if there is information on retention data in the retention data list, the refresh request is generated.

7. The data transmission method according to any one of claims 1 to 6, characterized in that Also including: When the retention cache and the local cache in the slave device side reach their respective cache thresholds, obtaining a backpressure signal sent by the slave device side; When the number of channels used in the several virtual channels reaches a preset number and the caches in the master device end reach their respective cache thresholds, send the backpressure signal to the host computer so that the host computer stops sending data to the master device end; Among them, the retention cache is used to store the retention data; the local cache is used to store the data generated by the slave device end itself and the data obtained from the outside.

8. The data transmission method according to claim 7, wherein Before sending the backpressure signal to the host computer, it further includes: When the number of channels used reaches the preset number, send the backpressure signal to the secondary data cache in the master device end via the primary list cache in the master device end to prohibit the secondary data cache from sending data to the several virtual channels; When the secondary data cache reaches the corresponding cache threshold, enable the backpressure cache in the master device end based on the backpressure signal to receive the data sent by the host computer through the enabled backpressure cache; When the backpressure cache reaches the corresponding cache threshold, trigger the operation of sending the backpressure signal to the host computer; Among them, the primary list cache is used to store the status information of the secondary data cache, the master device end, and the slave device end; the secondary data cache is used to store the data generated by the master device end itself and the data obtained from the outside.

9. The data transmission method according to claim 8, wherein It further includes: When a preset change event is detected, or when a new slave device end is detected to be connected, update the primary list cache; Among them, the preset change event is an event in which the status information of the secondary data cache, the master device end, or the slave device end changes.

10. The data transmission method according to claim 8, wherein, The status information of any object includes an object identifier, an occupied space identifier, a channel identifier of a virtual channel, and a set of status fields; the any object is any one of the secondary data cache, the master device end, and the slave device end; the occupied space identifier is used to identify the size of the space occupied by the status information of the any object in the primary list cache.

11. The data transmission method according to claim 10, wherein The set of status fields of the any object includes a data status identifier for data to be read and written, a full free space identifier, and a fragmented free space identifier; the full free space identifier is used to identify whether the cache of the any object is completely free space; the fragmented free space identifier is used to identify the proportion of the fragmented free space in the cache of the any object; the fragmented free space is a block space containing free address segments in each block space; the each block space is a space obtained by partitioning the cache of the any object; and, there is data stored in the addresses adjacent to the free address segments before and after.

12. The data transmission method according to claim 11, wherein The status information of the any object further includes a custom field associated with the fragmented free space identifier; Correspondingly, when it is necessary to write target data into the cache of the any object, based on the custom field and the fragmented free space identifier, determine each of the free address segments from the cache of the any object, and after determining a target free address segment that can completely store the target data from each of the free address segments, write the target data into the target free address segment.

13. An electronic device, characterized in that, It includes: A memory for storing a computer program; A processor for executing the computer program to implement the steps of the data transmission method according to any one of claims 1 to 12.

14. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the data transmission method according to any one of claims 1 to 12 are implemented.

15. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by a processor, the steps of the data transmission method according to any one of claims 1 to 12 are implemented.

Citation Information

Patent Citations

  • Data transmission method between master and slave equipments through bus

    CN101477505A

  • Method and device for scheduling cache

    CN102223510A

  • CPU cache flushing to persistent memory

    CN111684422A

  • Monitoring data cache flashing method and device and medium

    CN119065612A

  • Response transmission method, device, equipment and medium

    CN120104540A