A data transmission method, device, medium and product

Through the four-time mobile phone system between the master and slave devices, the problem of data loss in multiple data transmissions is solved, and the reliability and mutual trust interconnection of data transmission are realized.

CN120295958BActive Publication Date: 2025-08-05SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510788370.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2025-08-05
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 data loss caused by abnormalities during multiple data transmissions.

Method used

Through the four-time mobile phone system between the master and slave devices, including read and write request confirmation, target virtual channel determination, execution result storage, trapped data retransmission and refresh signal interaction, the reliability of data transmission is ensured.

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 CN120295958B_ABST
    Figure CN120295958B_ABST
Patent Text Reader

Abstract

The present invention discloses a data transmission method, device, medium and product, which relate to the field of communication technology. The method comprises: a master end sends a read / write request to a slave end, and after receiving a confirmation reception signal from the slave end, determines a target virtual channel from a plurality of virtual channels, sends a channel identifier of the target virtual channel and a read / write request to the slave end, and upon receiving an execution result and a channel identifier returned by the slave end, stores the execution result in a cache via the target virtual channel corresponding to the channel identifier; the execution result is generated when the slave end performs a read / write operation based on the read / write request; a refresh request generated by the slave end based on a retained data list after the read / write operation is completed is obtained, and a refresh confirmation signal is returned to the slave end so that the slave end retransmits the retained data to the master end and updates the retained data list; the updated retained data list sent by the slave end after the retransmission operation is completed is obtained, and a refresh completion signal is returned to the slave end. The reliability of multiple data transmissions is improved based on a four-way handshake 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 technology, and in particular to a data transmission method, device, medium and product. Background Art

[0002] A SoC (System on Chip) is a highly integrated integrated circuit design that combines all the key components of a computer or other electronic system onto a single chip. Within an SoC, the on-chip bus (OCB) enables fast data exchange between the processor, memory, and peripherals, supporting concurrent communication among multiple modules and meeting the demands of complex systems.

[0003] Among them, the bus handshake mechanism within the chip is a protocol used to control data transmission, ensuring reliable and efficient data transmission between the sender and receiver. Common handshake mechanisms include the VALID / READY protocol, in which the sender uses the VALID signal to indicate that the data is ready, and the receiver uses the READY signal to indicate that it can receive the data. When the VALID and READY signals are high at the same time, the sender transmits the data to the receiver, and the data transmission is completed. This handshake mechanism supports bidirectional flow control, where the sender controls the timing of transmission and the receiver controls the receiving speed to avoid data congestion and loss. However, this handshake mechanism can only guarantee the reliability of a single data transmission. If an abnormality occurs in the data transmission and the data is not fully transmitted, since this handshake mechanism does not provide a corresponding solution, it will cause 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 a four-way handshake between a master device and a slave device. The specific solution is as follows:

[0006] In a first aspect, the present invention provides a data transmission method, applied to a master device, comprising:

[0007] Sending a read / write request to a slave device, and determining a target virtual channel from a plurality of virtual channels after receiving a confirmation reception signal from the slave device based on the read / write request reply;

[0008] The channel identifier and read / write request of the target virtual channel are sent to the slave device side, so that when the execution result and channel identifier returned by the slave device side 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 side performs the corresponding data read / write operation based on the read / write request;

[0009] Obtain a refresh request generated by the slave device based on the retained data list after completing the data read and write operation, and reply a refresh confirmation signal to the slave device so that the slave device can resend the retained data to the master device and update the retained data list; the retained data list is used to record the information of each retained data;

[0010] Get the updated retained data list sent by the slave after the resend operation is completed, and reply the refresh completion signal to the slave.

[0011] Optionally, the master device and the slave device communicate with each other via an intra-chip bus;

[0012] Accordingly, the slave device resends the stranded data to the master device, including:

[0013] The slave device uses the bus's transmission bandwidth to splice the stranded data and resends the spliced data to the master device.

[0014] Optionally, determining a target virtual channel from multiple virtual channels includes:

[0015] Obtaining the data to be read and written from the corresponding cache based on the read and write request;

[0016] A target virtual channel is determined from a plurality of virtual channels according to the data to be read or written and the credit signal.

[0017] Optionally, determining a target virtual channel from a plurality of virtual channels according to each to-be-read / written data and a credit signal includes:

[0018] Allocating a first target virtual channel for each data to be read or written from a plurality of virtual channels, and storing each data to be read or written in the corresponding first target virtual channel;

[0019] A second target virtual channel having a credit count not less than a preset count is determined from the plurality of virtual channels according to the credit signal, so that the data to be read or written stored in the first target virtual channel is outputted via the second target virtual channel.

[0020] Optionally, the channel identifier and read / write request of the target virtual channel are sent to the slave device, including:

[0021] The channel identifiers of the first target virtual channel and the second target virtual channel, and a read / write request including the to-be-read / written data output by the second target virtual channel are sent to the slave device end.

[0022] Optionally, the refresh request is a request generated from the device side based on whether there is information about retained data in the retained data list; wherein, if there is no information about retained data in the retained data list, no refresh request is generated; if there is information about retained data in the retained data list, a refresh request is generated.

[0023] Optionally, the data transmission method of the present invention further includes:

[0024] When the retention cache and the local cache in the slave device reach their respective cache thresholds, a back pressure signal sent from the slave device is obtained;

[0025] When the number of channels used by several virtual channels reaches a preset number and each buffer in the master device reaches its corresponding buffer threshold, a back pressure signal is sent to the host computer so that the host computer stops sending data to the master device.

[0026] Among them, the retention cache is used to store retention data; the local cache is used to store data generated by the device itself and data obtained from the outside.

[0027] Optionally, before sending the back pressure signal to the host computer, the following steps are also included:

[0028] When the number of channels in use reaches a preset number, a back pressure signal is sent to the secondary data cache in the master device via the primary list cache in the master device to prohibit the secondary data cache from sending data to a number of virtual channels;

[0029] When the secondary data cache reaches the corresponding cache threshold, the back pressure cache in the master device is enabled based on the back pressure signal, so as to receive the data sent by the host computer through the enabled back pressure cache;

[0030] When the back pressure buffer reaches the corresponding buffer threshold, the back pressure signal is sent to the host computer.

[0031] Among them, the first-level list cache is used to store the second-level data cache, the status information of the master device and the slave device; the second-level data cache is used to store the data generated by the master device itself and the data obtained from the outside.

[0032] Optionally, the data transmission method of the present invention further includes:

[0033] When a preset change event is detected, or when a new slave device is detected, the first-level list cache is updated;

[0034] 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.

[0035] Optionally, the status information of any object includes the object identifier, the occupied space identifier, the channel identifier of the virtual channel, and a status field set; any object is any object in 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.

[0036] Optionally, the status field set of any object includes a data status identifier for the 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 completely free space; the fragmented free space identifier is used to identify the proportion of fragmented free space in the cache of any object; the fragmented free space is the block space containing free address segments in each block space; each block space is the space obtained by dividing the cache of any object; and data is stored in the adjacent addresses before and after the free address segment.

[0037] Optionally, the status information of any object also includes a custom field associated with a fragmented free space identifier;

[0038] Correspondingly, when it is necessary to write target data into the cache of any object, based on the custom field and fragmented free space identifier, each free address segment is determined 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, the target data is written into the target free address segment.

[0039] In a second aspect, the present invention provides an electronic device, comprising:

[0040] Memory for storing computer programs;

[0041] A processor is used to execute a computer program to implement the steps of the aforementioned data transmission method.

[0042] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the aforementioned data transmission method when the computer program is executed by a processor.

[0043] In a fourth aspect, the present invention provides a computer program product, comprising a computer program / instruction, which implements the steps of the aforementioned data transmission method when executed by a processor.

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

[0045] Beneficial effect: The master device sends a read / write request to the slave device and receives a confirmation signal from the slave device. This is the first handshake between the master and slave devices. 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. Afterwards, 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 from the slave device. This is the second handshake between the master and slave devices. The purpose of the second handshake is to enable the master device to read and write data from the slave device. Next, after finishing the data read and write operation, the slave end generates a refresh request based on the retained data list and sends it to the master end, and receives the confirmation refresh signal replied by the master end. This is the third handshake between the master end and the slave end. The purpose of the third handshake is to resend the retained data that needs to be sent to the master end from the slave end to the master end, solve the problem that the slave end has data that has not been sent to the master end after the abnormal end of the data read and write operation, avoid data loss during the transmission process, and improve the reliability of data transmission. Finally, the slave end sends the retained data list to the master end, and receives the refresh completion signal replied by the master end. This is the fourth handshake between the master end and the slave end. The purpose of the fourth handshake is to enable the slave end to synchronize the current situation of the internal retained data to the master end. In this way, the present invention can ensure the mutual trust and interconnection between the master end and the slave end through the four-way handshake between the master end and the slave end, and can also ensure the reliability of multiple data transmissions between the master end and the slave end. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0047] Figure 1 A flow chart of a data transmission method provided by an embodiment of the present invention;

[0048] Figure 2 A virtual channel selection flow chart provided by an embodiment of the present invention;

[0049] Figure 3 A multi-level cache back pressure flow chart provided by an embodiment of the present invention;

[0050] Figure 4 A schematic diagram of a status field set provided by an embodiment of the present invention;

[0051] Figure 5 A schematic diagram of a first-level list cache provided by an embodiment of the present invention;

[0052] Figure 6 A data transmission architecture diagram provided by an embodiment of the present invention;

[0053] Figure 7 A four-way handshake flow chart provided in an embodiment of the present invention;

[0054] Figure 8 Another four-way handshake flow chart provided by an embodiment of the present invention;

[0055] Figure 9 A structural diagram of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0056] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.

[0057] The terms "including" and "having," as used in the present description and accompanying drawings, and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements and may include steps or elements that are not listed.

[0058] In order to enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0059] The VALID / READY handshake protocol only guarantees the reliability of a single data transmission. If an anomaly occurs during this data transmission, resulting in incomplete data transmission, this handshake mechanism does not provide a corresponding solution, which may lead to data loss during the transmission process and affect the next data transmission. To this end, the present invention provides a data transmission method that can improve the reliability of multiple data transmissions based on a four-way handshake between a master device and a slave device.

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

[0061] Step S11: Send a read / write request to the slave device, and after receiving a confirmation reception signal from the slave device in response to the read / write request, determine a target virtual channel from a plurality of virtual channels.

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

[0063] It should be noted that there is at least one slave device end, and the slave device end is connected to the master device end through the chip bus, that is, the master device end and the slave device end communicate with each other through the chip bus, or in other words, the signal / data transmission between the master device end and the slave device end needs to pass through the chip bus before it can be transmitted to each other.

[0064] After receiving a read or write request, the slave device analyzes the request to determine the cache capacity required for the read or write. Based on the required cache capacity and the available capacity in the local cache, the slave device determines whether the read or write is possible. If the read or write is not possible, a rejection signal is returned to the master device via the internal bus. If the read or write is possible, a confirmation signal is returned to the master device via the internal bus.

[0065] Specifically, if the cache capacity required for this read and write is greater than the free capacity in the local cache, it is determined that normal read and write is not possible; if the cache capacity required for this read and write is less than or equal to the free capacity in the local cache, it is determined that normal read and write is possible.

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

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

[0068] It should be noted that there is no particular order in which the first target virtual channel and the second target virtual channel are determined. That is, the first target virtual channel may be determined first and then the second target virtual channel, or the second target virtual channel may be determined first and then the first target virtual channel, or the first target virtual channel and the second target virtual channel may be determined simultaneously.

[0069] like Figure 2 As shown, taking the simultaneous acquisition of multiple data to be read or written from a corresponding cache as an example, virtual channel arbitration is performed on the multiple data to be read or written based on the read or write request, and a first target virtual channel is allocated to each of the multiple virtual channels. The multiple data to be read or written are then stored in the corresponding first target virtual channels. The credit bits of the multiple virtual channels are determined based on a credit signal, and a second target virtual channel with a credit bit set to 1 is selected. A credit bit of 1 in a virtual channel indicates that the credit count of the virtual channel is not less than a preset count, which can be set to 0. The data to be read or written stored in the first target virtual channel is then output via the second target virtual channel.

[0070] It should be noted that, in the process of outputting the to-be-read / written data stored in the first target virtual channel via the second target virtual channel, the second target virtual channel corresponding to each first target virtual channel is determined based on the overlap and / or load conditions of the first target virtual channel and the second target virtual channel, and the to-be-read / written data stored in the first target virtual channel is output via the corresponding second target virtual channel. In this way, by considering the overlap, the number of times data is transmitted across channels can be reduced, and by considering the load conditions, load balancing can be largely ensured among the multiple virtual channels.

[0071] According to one specific embodiment, when the overlap 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, the channel in the second target virtual channel that is consistent with the any channel is determined as the second target virtual channel corresponding to the any channel; if any channel is not an overlapping channel, the channel with the smallest current load is determined from the second target virtual channels based on the load condition of the second target virtual channel, and the channel with the smallest current load is determined as the second target virtual channel corresponding to the any channel.

[0072] In addition, priorities can be set for multiple virtual channels, and the second target virtual channels corresponding to the first target virtual channels can be further determined based on the priorities of the first target virtual channels and the second target virtual channels. The second target virtual channels are preferentially selected for the first target virtual channels with higher priorities, and accordingly, the second target virtual channels with higher priorities are preferentially selected.

[0073] It should also be noted that if only one data to be read or written is obtained from the corresponding cache at the same time, there is no need to perform virtual channel arbitration for the data to be read or written. The first target virtual channel can be directly allocated to the data to be read or written from multiple virtual channels.

[0074] Step S12: Send the channel identifier and read / write request of the target virtual channel to the slave device end, so that when the execution result and 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 the corresponding data read / write operation based on the read / write request.

[0075] In an embodiment of the present invention, the master device side performs a second handshake operation to send the channel identifiers of the first target virtual channel and the second target virtual channel, and a read / write request containing the data to be read or written output by the second target virtual channel to the slave device side via the intra-chip bus; accordingly, the slave device side performs corresponding data read / write operations on the local cache based on the read / write requests to read / write the data to be read or written in the local cache, and returns the execution result and the channel identifier generated when performing the data read / write operation to the master device side via the intra-chip bus; when the master device side receives the execution result and the channel identifier, it stores the execution result in the corresponding cache via the target virtual channel corresponding to the channel identifier.

[0076] It should be noted that the local cache in the slave device is used to store data generated by the slave device itself as well as data obtained from external sources. Externally obtained data here includes data obtained from the master device and the host computer. Furthermore, the local cache in the slave device is implemented using on-chip SRAM (Static Random-Access Memory), and read and write pointers are used to manage data reading and writing.

[0077] Step S13: Obtain a refresh request generated by the slave device based on the retained data list after completing the data read and write operation, and reply a confirmation refresh signal to the slave device so that the slave device can resend the retained data to the master device and update the retained data list; the retained data list is used to record the information of each retained data.

[0078] In an embodiment of the present invention, after a data read / write operation is normally completed, the slave device determines whether to generate a refresh request based on the retained data list. If a refresh request is generated, a third handshake operation is performed to send the refresh request to the master device via the on-chip bus and obtain a refresh confirmation signal from the master device based on the refresh request. Upon receiving the refresh confirmation signal, the slave device retransmits the retained data to the master device and updates the retained data list. If a refresh request is not generated, the third handshake operation is not performed, thus ending the current round of four-way handshakes between the master and slave devices.

[0079] The retained data refers to the data retained in the slave device and needs to be sent to the master device. The causes of retained data include but are not limited to the following: when the slave device performs a data read operation, due to the abnormal termination of the data read operation, the data in the slave device is not fully read to the master device, and the parameters of the bus in the chip are reset to end the current round of four-way handshake. At this time, the slave device continues to read the remaining data from the local cache to the retained cache of the slave device, so that when the third handshake operation in the next round of four-way handshake is performed, the slave device can resend the retained data in the retained cache to the master device based on the retained data list.

[0080] It should be noted that, considering the actual working conditions of the master device and the slave device, the retained data may be completely resent to the master device in a certain round of the third handshake operation, or only a part of it may be resent to the master device in a certain round of the third handshake operation. In this case, the retained data can continue to be resent to the master device in subsequent rounds of the third handshake operation until all the retained data are resent to the master device.

[0081] A refresh request is generated by the device based on whether there is retained data in the retained data list. Specifically, the device determines whether to generate a refresh request by determining whether there is retained data in the retained data list. If there is no retained data in the retained data list, no refresh request is generated. However, if there is retained data in the retained data list, a refresh request is generated.

[0082] Furthermore, the embodiment of the present invention takes into account that if each piece of retained data is sent to the master device side via the intra-chip bus separately, the transmission bandwidth of the intra-chip bus may not be fully utilized, thereby resulting in bandwidth waste. Therefore, in the embodiment of the present invention, when the slave device side receives the confirmation refresh signal, it uses the transmission bandwidth of the intra-chip bus to splice each piece of retained data, and resends the spliced data to the master device side. Among them, the transmission bandwidth of the intra-chip bus can be set to 64 bits / 128 bits, etc., so that the spliced data can fully utilize the transmission bandwidth of the intra-chip bus, reducing the number of data transmissions.

[0083] Furthermore, updating the retained data list includes: after the slave device retransmits the retained data to the master device, deleting information about the retransmitted retained data from the retained data list, thereby updating the retained data list. Furthermore, when new retained data is generated, information about the newly generated retained data is also added to the retained data list, thereby updating the retained data list.

[0084] Step S14: Obtain the updated retained data list sent by the slave device after completing the retransmission operation, and reply a refresh completion signal to the slave device.

[0085] In the embodiment of the present invention, after completing the retransmission operation on the retained data, the slave device performs a fourth handshake operation to send the updated retained data list to the master device and obtain a refresh completion signal replied by the master device.

[0086] Among them, regarding the termination of the retransmission operation, one case is that the master device determines whether to send a retransmission end signal to the slave device based on its own operating state and / or the amount of retained data retransmitted by the slave device in this round and / or the execution duration of the retransmission operation, so that the slave device terminates the retransmission operation based on the retransmission end signal. Another case is that the slave device determines whether to terminate the retransmission operation based on its own operating state and / or the amount of retained data retransmitted in this round and / or the execution duration of the retransmission operation. Of course, there may be other cases, which will not be explained in detail here.

[0087] After receiving the retained data list sent by the slave device, the master device can determine the information of the retained data in the slave device based on the retained data list, for example, how many retained data are included in the slave device, the size of each retained data, etc., and then return the refresh completion signal to the slave device to end this round of four-way handshake between the master device and the slave device.

[0088] In order to solve the problem of decreased data transmission performance caused by bus congestion, the present invention further designs a multi-level cache back pressure mechanism to dynamically adjust the data transmission rate in combination with the four-way handshake to ensure efficient operation under peak load.

[0089] Specifically, when the retention cache and local cache in the slave device reach their respective cache thresholds, the master device receives a backpressure signal from the slave device. When the number of virtual channels in use reaches a preset number and each cache in the master device reaches its corresponding cache threshold, the master device sends a backpressure signal to the host computer, causing the host computer to stop sending data to the master device. The retention cache in the slave device is used to store retained data, while the local cache in the slave device is used to store data generated by the slave device itself and data obtained from external sources.

[0090] More specifically, after the master device side obtains the back pressure signal sent from the slave device side, when the number of channel usage of several virtual channels reaches a preset number, the master device side sends the back pressure signal to the secondary data cache in the master device side via the first-level list cache in the master device side to prohibit the secondary data cache from sending data to several virtual channels; and when the secondary data cache reaches the corresponding cache threshold, the back pressure cache in the master device side is enabled based on the back pressure signal to receive the data sent by the upper computer through the enabled back pressure cache; and when the back pressure cache reaches the corresponding cache threshold, the operation of sending the back pressure signal to the upper computer is triggered so that the upper computer stops sending data to the master device side.

[0091] Among them, the first-level list cache in the master device side is used to store the second-level data cache, the status information of the master device side and the slave device side; the second-level data cache in the master device side is used to store the data generated by the master device side itself and the data obtained from the outside, and the data obtained from the outside here includes but is not limited to the data obtained from the slave device side and the data obtained from the host computer.

[0092] like Figure 3As shown, the multi-level cache backpressure mechanism considers the slave device as the lower layer, the master device as the middle layer, and the host computer as the upper layer. Furthermore, each cache in each device has its own corresponding cache threshold. Specifically, when the retained cache in the slave device reaches the corresponding cache threshold of 0, and the local cache in the slave device reaches the corresponding cache threshold of 1, the slave device sends a backpressure signal to the master device. After receiving the back pressure signal sent from the slave device, the master device sends a back pressure signal to the first-level list cache in the master device when the number of channel usage of several virtual channels reaches a preset number of 2. The control logic of the first-level list cache then sends the back pressure signal to the second-level data cache in the master device. At this time, after receiving the back pressure signal, the second-level data cache stops sending data to the virtual channel, and when the second-level data cache reaches the corresponding cache threshold of 3, the back pressure cache in the master device is enabled based on the back pressure signal, and the data sent by the host computer is received through the enabled back pressure cache; finally, when the back pressure cache reaches the corresponding cache threshold of 4, the back pressure signal is sent to the host computer so that the host computer stops sending data to the master device.

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

[0094] Since the first-level list cache is used to store the status information of the second-level data cache, the master device side and the slave device side, the master device side updates the first-level list cache when it detects a preset change event or detects that a new slave device side has been connected; wherein the preset change event is an event in which the status information of the second-level data cache, the master device side or the slave device side changes.

[0095] It should be noted that after each handshake operation, the status information of the secondary data cache, the master device side or the slave device side will basically change. Therefore, after each handshake operation, the primary list cache will basically be updated.

[0096] For any object in the secondary data cache, the master device side and the slave device side, it is recorded as any object. The status information of any object stored in the primary list cache includes the object identifier, the occupied space identifier, the channel identifier of the virtual channel, and the status field set.

[0097] The object identifier occupies 8 bits, with different objects corresponding to different object identifiers. The space occupied identifier occupies 4 bits and is used to identify the amount of space occupied by the state information of any object in the first-level list cache. The channel identifier of the virtual channel also occupies 4 bits. The status field set occupies 8 bits.

[0098] The status field set for any object includes a data status identifier for the data to be read or 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 completely free; the fragmented free space identifier is used to identify the proportion of fragmented free space in the cache of any object; fragmented free space is the block space containing free address segments in each block space; each block space is the space obtained by partitioning the cache of any object; and data is stored in the adjacent addresses before and after the free address segment.

[0099] like Figure 4 As shown, the data status identifiers for data to be read and written include a data status identifier for data to be written and a data status identifier for data to be read. Each data status identifier occupies 2 bits and includes four status conditions: 00, 01, 10, and 11. 00 indicates an occupied state, 01 indicates waiting for writing / waiting for reading, 10 indicates waiting for clearing, and 11 indicates waiting for external handshake refresh. The full free space identifier occupies 1 bit, and a 0 indicates partially free space, while a 1 indicates completely free space. Taking the example of dividing a cache into eight blocks, the fragmented free space identifier occupies 3 bits, including eight cases: 000, 001, 010, 011, 100, 101, 110, and 111. Among them, 000 indicates no fragmented free space, 001 indicates 1 / 8 fragmented free space, 010 indicates 2 / 8 fragmented free space, 011 indicates 3 / 8 fragmented free space, 100 indicates 4 / 8 fragmented free space, 101 indicates 5 / 8 fragmented free space, 110 indicates 6 / 8 fragmented free space, and 111 indicates 7 / 8 fragmented free space.

[0100] It should be noted that, in addition to being able to divide a cache into eight blocks, it can also be divided into four blocks, sixteen blocks, etc. In this case, the number of bits occupied by the fragmented free space identifier needs to be adjusted accordingly according to the number of blocks.

[0101] Furthermore, for a free address segment, data is stored in the addresses before and after the free address segment, while no data is stored in the free address segment. For example, the address range of block A is 0x0001-0x1110. If data is stored in address 0x0001, no data is stored in address 0x0010-0x0100, and data is stored in address 0x0101-0x1110, then address 0x0010-0x0100 is a free address segment, and accordingly, block A is a fragmented free space.

[0102] Taking the master device side as an example, the data status identification for the data to be written is illustrated. When the master device side wants to write data to the slave device side, the master device side is initially in state 11, and after completing the first handshake operation between the master device side and the slave device side, the master device side switches to state 01 and starts to obtain the data to be written from the secondary data cache or the back pressure cache. When the data to be written is obtained, the master device side switches to state 00, and when performing the second handshake operation to send the data to be written to the slave device side, the master device side switches to state 10, and after completing the second handshake operation, the master device side switches to state 11.

[0103] In addition, the state information of any object stored in the first-level list cache also 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, the first-level list cache is as follows: Figure 5 As shown, each row represents the status information of an object.

[0104] Accordingly, when target data needs to be written to the cache of any object, the free address segments in the cache of any object are determined based on the custom field and the fragmented free space identifier. After a target free address segment that can completely store the target data is determined from the free address segments, the target data is written to the target free address segment. In this way, the embodiment of the present invention can fully utilize the fragmented free space in the cache and improve cache utilization.

[0105] Beneficial effect: The master device sends a read / write request to the slave device and receives a confirmation signal from the slave device. This is the first handshake between the master and slave devices. 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. Afterwards, 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 from the slave device. This is the second handshake between the master and slave devices. The purpose of the second handshake is to enable the master device to read and write data from the slave device. Next, after finishing the data read and write operation, the slave end generates a refresh request based on the retained data list and sends it to the master end, and receives the confirmation refresh signal replied by the master end. This is the third handshake between the master end and the slave end. The purpose of the third handshake is to resend the retained data that needs to be sent to the master end from the slave end to the master end, solve the problem that the slave end has data that has not been sent to the master end after the abnormal end of the data read and write operation, avoid data loss during the transmission process, and improve the reliability of data transmission. Finally, the slave end sends the retained data list to the master end, and receives the refresh completion signal replied by the master end. This is the fourth handshake between the master end and the slave end. The purpose of the fourth handshake is to enable the slave end to synchronize the current situation of the internal retained data to the master end. In this way, the present invention can ensure the mutual trust and interconnection between the master end and the slave end through the four-way handshake between the master end and the slave end, and can also ensure the reliability of multiple data transmissions between the master end and the slave end.

[0106] by Figure 6 and Figure 7 As an example, a data transmission method proposed in an embodiment of the present invention is described in detail.

[0107] In the first handshake operation, the master device sends a read / write request (also known as a handshake signal) to the slave device via the chip's internal bus using the handshake mechanism. The slave device receives the read / write request through the handshake mechanism and responds with a confirmation signal (also known as a handshake signal) to the master device via the chip's internal bus. After receiving the confirmation signal from the slave device through the handshake mechanism, the master device determines that the first handshake operation has concluded.

[0108] After completing the first handshake operation, the master device updates the first-level list cache and sends a feedback signal to the bus master sending logic. It also obtains the data to be read and written from the second-level data cache / back pressure cache based on the read and write requests, and outputs it to the bus master sending logic through the target virtual channel.

[0109] In the second handshake operation, the bus master end sending logic outputs the channel identifier of the target virtual channel and the read / write request containing the data to be read / written in parallel to the slave device end via the on-chip bus. After the slave device end 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 end receiving logic, it performs corresponding data read / write operations on the local cache based on the read / write requests to read / write the data to be read / written in the local cache, and outputs the execution result generated when executing the data read / write operation and the channel identifier of the target virtual channel in parallel to the master device end via the on-chip bus through the bus slave end feedback logic. When the master device end receives the execution result and the channel identifier of the target virtual channel through the bus master end receiving 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.

[0110] In the third handshake operation, after the slave device successfully completes the data read and write operation, it determines whether to generate a refresh request based on the retained data list. If a refresh request is generated, the refresh request (i.e., the handshake signal) is sent 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 responds with a refresh confirmation signal (i.e., the handshake signal) to the slave device via the on-chip bus. After receiving the refresh confirmation signal through the handshake mechanism, the slave device uses the bus slave feedback logic to retransmit the retained data in the retention buffer to the master device via the on-chip bus in parallel, while simultaneously updating the retained data list. This completes the retransmission operation, thus concluding the third handshake operation.

[0111] In the fourth handshake, after the slave completes the retransmission operation, it uses the bus slave feedback logic to output the updated retained data list in parallel to the master via the chip's internal bus. After receiving the retained data list, the master sends a refresh completion signal to the slave through the handshake mechanism. Upon receiving the refresh completion signal, the slave determines that the fourth handshake has concluded.

[0112] Further, such as Figure 8As shown, for the four-way handshake between the master device end and the slave device end, the chip bus starts to be in an idle state, and when the first handshake signal of the master device end is obtained, the chip bus is enabled, and then the chip bus is used to sequentially perform the four-way handshake operations between the master device end and the slave device end. Wherein, if a handshake interrupt occurs during the execution of the first handshake operation, the chip bus is controlled to switch to an idle state. If a handshake interrupt occurs during the execution of the second handshake operation and the third handshake operation, the chip bus is controlled to switch to a reset state, so that after resetting the various parameters of the chip bus, the chip bus is controlled to switch to an idle state. If the data read and write operation is normally completed during the execution of the second handshake operation, it is determined whether a refresh request is generated by judging whether there is information about the retained data in the retained data list. If a refresh request is generated, the third handshake operation is continued. If a refresh request is not generated, the third handshake operation is no longer performed, that is, the four-way handshake between the current round of the master device end and the slave device end is terminated, and the chip bus is controlled to switch to an idle state.

[0113] Beneficial effect: The master device sends a read / write request to the slave device and receives a confirmation signal from the slave device. This is the first handshake between the master and slave devices. 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. Afterwards, 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 from the slave device. This is the second handshake between the master and slave devices. The purpose of the second handshake is to enable the master device to read and write data from the slave device. Next, after finishing the data read and write operation, the slave end generates a refresh request based on the retained data list and sends it to the master end, and receives the confirmation refresh signal replied by the master end. This is the third handshake between the master end and the slave end. The purpose of the third handshake is to resend the retained data that needs to be sent to the master end from the slave end to the master end, solve the problem that the slave end has data that has not been sent to the master end after the abnormal end of the data read and write operation, avoid data loss during the transmission process, and improve the reliability of data transmission. Finally, the slave end sends the retained data list to the master end, and receives the refresh completion signal replied by the master end. This is the fourth handshake between the master end and the slave end. The purpose of the fourth handshake is to enable the slave end to synchronize the current situation of the internal retained data to the master end. In this way, the present invention can ensure the mutual trust and interconnection between the master end and the slave end through the four-way handshake between the master end and the slave end, and can also ensure the reliability of multiple data transmissions between the master end and the slave end.

[0114] Furthermore, the embodiment of the present application also discloses an electronic device, Figure 9 This is a block diagram of an electronic device according to an exemplary embodiment. The contents of the diagram should not be construed as limiting the scope of use of this application. The electronic device may 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. The memory 12 is used to store a computer program, which is loaded and executed by the processor 11 to implement the relevant steps of the data transmission method disclosed in any of the aforementioned embodiments. In addition, the electronic device in this embodiment may specifically be an electronic computer.

[0115] In this embodiment, the power supply 13 is used to provide operating voltage for various hardware devices on the electronic device; the communication interface 14 can create a data transmission channel between the electronic device and external devices. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 15 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.

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

[0117] The operating system 121 is used to manage and control the hardware devices on the electronic device and the computer program 122, which can be Windows Server, NetWare, Unix, Linux, etc. In addition to including a computer program capable of implementing the data transmission method performed by the electronic device disclosed in any of the aforementioned embodiments, the computer program 122 can further include a computer program capable of implementing other specific tasks.

[0118] 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 aforementioned data transmission method is implemented. The specific steps of this method can be referred to the corresponding contents disclosed in the aforementioned embodiments and will not be repeated here.

[0119] Furthermore, the present application also discloses a computer program product, including a computer program / instructions; wherein, when executed by a processor, the computer program / instructions implement the aforementioned disclosed data transmission method. The specific steps of this method can be referred to the corresponding contents disclosed in the aforementioned embodiments and will not be repeated here.

[0120] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.

[0121] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

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

[0123] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only 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 terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0124] The above is a detailed introduction to the technical solution provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the ideas of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A data transmission method, characterized in that: Applied to the main device side, including: Sending a read / write request to a slave device end, and determining a target virtual channel from a plurality of virtual channels after receiving a confirmation reception signal from the slave device end based on the read / write request reply; The channel identifier of the target virtual channel and the read / write request are sent 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 the corresponding data read / write operation based on the read / write request; Obtaining a refresh request generated by the slave device based on the retained data list after completing the data read and write operation, and replying a refresh confirmation signal to the slave device so that the slave device retransmits the retained data to the master device and updates the retained data list; the retained data list is used to record information about each retained data; The updated retained data list sent by the slave device after the retransmission operation is completed is obtained, and a refresh completion signal is replied to the slave device.

2. The data transmission method according to claim 1, wherein: The master device end and the slave device end communicate with each other via an in-chip bus; Accordingly, the slave device resends the retained data to the master device, including: The slave device uses the transmission bandwidth of the bus to splice the stranded data and resends the spliced data to the master device.

3. The data transmission method according to claim 1, wherein: Determining a target virtual channel from a plurality of virtual channels includes: Obtaining each to-be-read / written data from a corresponding cache based on the read / write request; A target virtual channel is determined from a plurality of virtual channels according to the data to be read or written and the credit signal.

4. The data transmission method according to claim 3, wherein: The step of determining a target virtual channel from a plurality of virtual channels according to the data to be read or written and the credit signal includes: Allocating a first target virtual channel for each of the data to be read or written from the plurality of virtual channels, and storing each of the data to be read or written in the corresponding first target virtual channel; A second target virtual channel having a credit count not less than a preset count is determined from the plurality of virtual channels according to the credit signal, so as to output the to-be-read / written data 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: The sending of the channel identifier of the target virtual channel and the read / write request to the slave device includes: The channel identifiers of the first target virtual channel and the second target virtual channel, and the read / write request including the to-be-read / written data output by the second target virtual channel are sent to the slave device end.

6. The data transmission method according to claim 1, wherein: The refresh request is a request generated by the slave device based on whether there is information about retained data in the retained data list; wherein, if there is no information about retained data in the retained data list, the refresh request is not generated; if there is information about retained data in the retained 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 includes: When the retention cache and the local cache in the slave device reach their respective corresponding cache thresholds, obtaining a back pressure signal sent by the slave device; When the number of channel usage of the plurality of virtual channels reaches a preset number and each buffer in the master device reaches its corresponding buffer threshold, sending the back pressure signal to the host computer so that the host computer stops sending data to the master device; The retention cache is used to store the retention data; the local cache is used to store the data generated by the device itself and the data obtained from the outside.

8. The data transmission method according to claim 7, characterized in that: Before sending the back pressure signal to the host computer, the method further includes: When the number of channels in use reaches a preset number, sending the back pressure signal to the secondary data cache in the master device via the primary list cache in the master device to prohibit the secondary data cache from sending data to the plurality of virtual channels; When the secondary data cache reaches a corresponding cache threshold, enabling the back pressure cache in the master device based on the back pressure signal, so as to receive data sent by the host computer through the enabled back pressure cache; When the back pressure buffer reaches a corresponding buffer threshold, triggering the operation of sending the back pressure signal to the host computer; The first-level list cache is used to store the status information of the second-level data cache, the master device end and the slave device end; the second-level data cache is used to store data generated by the master device end itself and data obtained from the outside.

9. The data transmission method according to claim 8, characterized in that: Also includes: When a preset change event is detected, or when a new slave device is detected, the first-level list cache is updated; The preset change event is an event in which status information of the secondary data cache, the master device, or the slave device changes.

10. The data transmission method according to claim 8, characterized in that: The status information of any object includes an object identifier, an occupied space identifier, a channel identifier of a virtual channel, and a status field set; 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 status field set of any object includes a data status identifier for the 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 fragmented free space in the cache of any object; the fragmented free space is a block space containing a free address segment in each block space; each block space is a space obtained by dividing the cache of any object; and data is stored in the adjacent addresses before and after the free address segment.

12. The data transmission method according to claim 11, characterized in that: The state 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 one of the objects, based on the custom field and the fragmented free space identifier, each of the free address segments is determined from the cache of any one of the objects, and after determining the target free address segment that can completely store the target data from each of the free address segments, the target data is written into the target free address segment.

13. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to execute 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 The computer-readable storage medium stores a computer program, 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

  • Method and device for scheduling cache

    CN102223510A

  • Monitoring data cache flashing method and device and medium

    CN119065612A