Response transmission method, device, equipment and medium
By using the current record table in the interconnection module of the AXI bus protocol, the problem of the master device receiving sequential responses in multiple identical identifier write transmissions is solved, and the effect of improving write transmission efficiency is achieved.
Patent Information
- Application Number
- CN202510220128.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-06-06
AI Technical Summary
In the AXI bus protocol, when the master device initiates multiple write transmissions of the same identity to multiple slave devices, it must receive a sequential return response, resulting in inefficient write transmission.
By introducing the current record table in the interconnection module, the target transaction identity and the target record are determined, and the target response is cached or returned without waiting for the previous write transmission response to ensure that the response order of the same transaction identity is returned.
It is realized that the write transmission efficiency is improved without affecting the response order, so that the master device can write transmission with multiple slave devices at the same time.
Smart Images

Figure CN120104540A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data transmission, and in particular to a response transmission method, device, equipment and medium. Background Art
[0002] AXI (Advanced eXtensible Interface, a bus protocol) is based on burst transmission and defines the following five independent transmission channels: read address channel, read data channel, write address channel, write data channel, and write response channel. And because the AXI bus protocol is strictly a point-to-point master-slave interface protocol, when multiple peripherals need to interact with each other, such as Figure 1 As shown, one or more master devices can be connected to one or more slave devices by adding an AXI Interconnect module.
[0003] If the master device initiates multiple write transfers with different identifiers to each slave device, the slave device will generate a response and return it to the master device after completing the corresponding write transfer. At this time, the master device is allowed to receive responses returned out of order. However, if the master device initiates multiple write transfers with the same identifier to each slave device, for example, the master device initiates a write transfer to slave device 1, slave device 2, and slave device 3 respectively, and the identifiers of the write transfers are the same, since AXI has an order-preserving function for the same identifier, the master device must receive responses returned in sequence, that is, the order of responses received by the master device must be consistent with the order in which the write transfers were initiated. The data transmission rate between the master device and the slave device and the data processing rate of the slave device may be different. Therefore, at present, the master device generally performs the next write transfer after receiving the response to the previous write transfer. However, if the response to the previous write transfer has not been returned, the next write transfer will be stuck, which seriously affects the subsequent write transfers, resulting in low write transfer efficiency. It can be seen that how to improve the efficiency of write transfers is a problem that technicians in this field need to solve. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a response transmission method, apparatus, device and medium, which can start the next write transmission without obtaining the response of the previous write transmission, thereby improving the efficiency of write transmission while ensuring the sequential return of responses to the same transaction identifier. The specific scheme is as follows:
[0005] In a first aspect, the present invention provides a response transmission method, which is applied to an interconnection module, comprising:
[0006] When the master device performs a data write operation on each slave device through the interconnection module, a target transaction identifier corresponding to the currently acquired target response is determined; the target response is a response generated by the corresponding slave device after completing the corresponding data write operation and transmitted to the interconnection module; the corresponding data write operation and the target response correspond to the same transaction identifier;
[0007] When there are multiple records corresponding to the target transaction identifier in the current record table, the target record is determined from the multiple records based on the device identifier of the corresponding slave device; the current record table includes several records constructed based on the transaction identifier and the device identifier of the slave device, and responses corresponding to the several records are not returned to the master device;
[0008] If the target record is not the earliest record among the multiple records, the target response is cached as the response corresponding to the target record;
[0009] If the target record is the earliest record among multiple records, the target response is taken as the response corresponding to the target record, and the responses corresponding to the continuous records are returned to the main device in chronological order; the continuous record is the earliest continuous record with a corresponding response among multiple records.
[0010] Optionally, before determining the target transaction identifier corresponding to the currently acquired target response, the method further includes:
[0011] When multiple responses are obtained through the write response channels between the multiple slave devices and the interconnection module, the multiple responses currently obtained are sequentially determined as target responses based on the slave devices corresponding to the multiple responses currently obtained, using a preset polling rule;
[0012] The preset polling rule is a polling rule determined based on a preset slave device processing sequence.
[0013] Optionally, after determining the target transaction identifier corresponding to the currently acquired target response, the method further includes:
[0014] Count the number of records in the current record table that correspond to the target transaction identifier;
[0015] If the number of records is greater than one, it is determined that there are multiple records corresponding to the target transaction identifier in the current record table;
[0016] If the number of entries is equal to one, it is determined that there is a record corresponding to the target transaction identifier in the current record table, and the target response is returned to the master device, and the record corresponding to the target transaction identifier is cleared from the current record table.
[0017] Optionally, the target response is used as a response corresponding to the target record, and each response corresponding to the consecutive record is returned to the master device in chronological order, including:
[0018] Taking the target response as a response corresponding to the target record, and in the process of returning responses to multiple records, returning the response corresponding to the target record to the master device;
[0019] Clear target records from the current record table and multiple records respectively, so as to update the current record table and multiple records;
[0020] Query the earliest current record to be judged from the updated multiple records, and determine whether the current record to be judged has a corresponding response;
[0021] If there is a response corresponding to the current record to be determined, suspending the acquisition of the response from the slave device, reading the response corresponding to the current record to be determined from the cache, and returning the read response corresponding to the current record to be determined to the master device;
[0022] Clear the current record to be determined from the updated current record table and the updated multiple records respectively, so as to update the current record table and the multiple records, and then jump again to the step of querying the current record to be determined with the earliest time from the updated multiple records;
[0023] If the current record to be determined has no corresponding response or the updated multiple records are empty, the response return process for the multiple records is terminated, and the acquisition of the response from the slave device continues.
[0024] Optionally, in the process of the master device performing a data writing operation on each slave device through the interconnection module, the process includes:
[0025] Determine the target slave device corresponding to the current write operation transaction based on a control signal sent by the master device on the write address channel between the master device and the interconnection module;
[0026] When the channel between the target slave device and the interconnection module meets the preset write condition, the data write address is obtained from the write address channel between the master device and the interconnection module, and the data to be written is obtained from the write data channel between the master device and the interconnection module; the data write address and the data to be written both correspond to the current write operation transaction;
[0027] The data write address and the data to be written are transmitted to the target slave device through the write address channel and the write data channel between the target slave device and the interconnection module, respectively, so that the target slave device performs a data write operation corresponding to the current write operation transaction to write the received data into the corresponding storage space based on the received address.
[0028] Optionally, the data write address and the data to be written are transmitted to the target slave device through a write address channel and a write data channel between the target slave device and the interconnection module, respectively, including:
[0029] The data write address is stored in a write address buffer on the corresponding write address channel through a write address channel between the target slave device and the interconnection module, so that the slave device obtains the data write address from the write address buffer;
[0030] The data to be written is stored in a write data cache on the corresponding write data channel through a write data channel between the target slave device and the interconnection module, so that the slave device obtains the data to be written from the write data cache.
[0031] Optionally, the preset write condition includes that a write address buffer on a write address channel between the target slave device and the interconnection module is empty, and a write data buffer on a write data channel between the target slave device and the interconnection module is not full.
[0032] In a second aspect, the present invention provides a response transmission device, applied to an interconnection module, comprising:
[0033] An identifier determination module is used to determine a target transaction identifier corresponding to a currently acquired target response when the master device performs a data write operation on each slave device through the interconnection module; the target response is a response generated by the corresponding slave device after completing the corresponding data write operation and transmitted to the interconnection module; the corresponding data write operation and the target response correspond to the same transaction identifier;
[0034] A record determination module, used to determine the target record from the multiple records based on the device identification of the corresponding slave device when there are multiple records corresponding to the target transaction identifier in the current record table; the current record table includes several records constructed based on the transaction identifier and the device identification of the slave device, and the responses corresponding to the several records are not returned to the master device;
[0035] A response cache module, for caching a target response as a response corresponding to the target record if the target record is not the earliest record among the multiple records;
[0036] The response returning module is used to take the target response as the response corresponding to the target record if the target record is the earliest record among multiple records, and return the responses corresponding to the continuous records to the main device in chronological order; the continuous record is the continuous record with a corresponding response and the earliest time among multiple records.
[0037] In a third aspect, the present invention provides an electronic device, comprising:
[0038] Memory for storing computer programs;
[0039] The processor is used to execute the computer program to implement the above-mentioned response transmission method.
[0040] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the aforementioned response transmission method when executed by a processor.
[0041] In the present invention, when the master device performs a data write operation on each slave device through an interconnection module, a target transaction identifier corresponding to the currently acquired target response is determined; the target response is a response generated by the corresponding slave device after completing the corresponding data write operation and transmitted to the interconnection module; the corresponding data write operation and the target response correspond to the same transaction identifier; when there are multiple records corresponding to the target transaction identifier in the current record table, the target record is determined from the multiple records based on the device identifier of the corresponding slave device; the current record table includes several records constructed based on the transaction identifier and the device identifier of the slave device, and the responses corresponding to the several records are not returned to the master device; if the target record is not the earliest record in time among the multiple records, the target response is cached as a response corresponding to the target record; if the target record is the earliest record in time among the multiple records, the target response is used as a response corresponding to the target record, and each response corresponding to the continuous record is returned to the master device in chronological order; the continuous record is a continuous record with a corresponding response and the earliest time among the multiple records.
[0042] Beneficial effect: In the process of the master device performing data write operation on each slave device through the interconnection module of the present invention, the interconnection module will obtain the response generated and sent by the slave device after completing the corresponding data write operation, and then determine the corresponding record from the current record table based on the target transaction identifier corresponding to the currently obtained target response, and when there are multiple corresponding records, determine the corresponding target record from the multiple records based on the slave device corresponding to the currently obtained target response. If the target record is not the earliest record in time among the multiple records, in order to ensure that the response with the same transaction identifier can be returned to the master device in sequence, the target response is first temporarily stored as a response corresponding to the target record; if the target record is the earliest record in time among the multiple records, the sequential return of the response to the same transaction identifier can be enabled, that is, the target response is used as the response corresponding to the target record, and each response corresponding to the continuous record with a response and the earliest time among the multiple records is returned to the master device in chronological order, thereby ensuring the sequential return of the response to the same transaction identifier. In this way, the present invention introduces a current record table to ensure the sequential return of responses to the same transaction identifier, so that the next write transfer can be started without obtaining a response to the previous write transfer. That is, the present invention can enable the master device to perform write transfers with multiple slave devices at the same time, greatly improving the efficiency of write transfers. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces 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 paying creative work.
[0044] Figure 1 A schematic diagram of a device connection provided by an embodiment of the present invention;
[0045] Figure 2 A flow chart of a response transmission method provided by an embodiment of the present invention;
[0046] Figure 3 A response transmission flow chart provided by an embodiment of the present invention;
[0047] Figure 4 A schematic diagram of the structure of a response transmission device provided by an embodiment of the present invention;
[0048] Figure 5 A structural diagram of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] In order to ensure that the order of responses received by the master device is consistent with the order in which write transfers are initiated, the master device generally performs the next write transfer after receiving the response to the previous write transfer. However, if the response to the previous write transfer has not been returned, the next write transfer will be stuck, which seriously affects the subsequent write transfers, resulting in low write transfer efficiency. To this end, the present invention provides a response transmission method, which can start the next write transfer without obtaining the response to the previous write transfer, thereby improving the efficiency of write transfers while ensuring the order of responses to the same transaction identifier.
[0051] See also Figure 2 As shown, an embodiment of the present invention provides a response transmission method, which is applied to an interconnection module, including:
[0052] Step S11, when the master device performs a data write operation on each slave device through the interconnection module, determine the target transaction identifier corresponding to the currently obtained target response; the target response is a response generated by the corresponding slave device after completing the corresponding data write operation and transmitted to the interconnection module; the corresponding data write operation and the target response correspond to the same transaction identifier.
[0053] In the embodiment of the present invention, the master device realizes data transmission with one or more slave devices through the interconnection module. Moreover, when the master device performs a data write operation on each slave device through the interconnection module, the slave device generates a response after completing the corresponding data write operation and transmits it to the interconnection module; accordingly, the interconnection module obtains the response transmitted by the slave device and determines the target transaction identifier corresponding to the currently obtained target response.
[0054] Furthermore, before determining the target transaction identifier corresponding to the currently obtained target response, if the interconnection module obtains multiple responses respectively through the write response channels between multiple slave devices and the interconnection module, it is necessary to use a preset polling rule and based on the slave devices corresponding to the multiple responses currently obtained, determine the multiple responses currently obtained as target responses in turn; wherein the preset polling rule is a polling rule determined based on a pre-set slave device processing order.
[0055] Specifically, since there is a write response channel between each slave device and the interconnection module, the interconnection module may obtain responses transmitted by multiple slave devices through their respective write response channels at the same time, that is, the interconnection module may obtain multiple responses at the same time. At this time, it is necessary to further determine the processing order of multiple responses based on the preset polling rules, that is, which response to process first and which response to process later.
[0056] The preset polling rules are specifically polling rules determined based on a preset slave device processing order, wherein the preset slave device processing order can be set by a user, or can be set according to the priority of the slave device (different slave devices correspond to different priorities), or can be set in other ways, which are not limited here.
[0057] In an embodiment of the present invention, in the process of the master device performing a data write operation on each slave device through the interconnection module, the interconnection module needs to first determine the target slave device corresponding to the current write operation transaction based on the control signal sent by the master device on the write address channel between itself and the interconnection module, and when the channel between the target slave device and the interconnection module meets the preset write condition, obtain the data write address from the write address channel between the master device and the interconnection module, and obtain the data to be written from the write data channel between the master device and the interconnection module; wherein the data write address and the data to be written both correspond to the current write operation transaction. Then the interconnection module transmits the data write address and the data to be written to the target slave device through the write address channel and the write data channel between the target slave device and the interconnection module, respectively, so that the target slave device performs the data write operation corresponding to the current write operation transaction, so as to write the received data into the corresponding storage space based on the received address.
[0058] Furthermore, after the interconnection module determines the target slave device corresponding to the current write operation transaction based on the control signal sent by the master device on the write address channel between itself and the interconnection module, if the channel between the target slave device and the interconnection module does not meet the preset write conditions, it is necessary to wait until the channel between the target slave device and the interconnection module meets the preset write conditions, and then obtain the data write address from the write address channel between the master device and the interconnection module, and obtain the data to be written from the write data channel between the master device and the interconnection module.
[0059] It should be noted that after the interconnection module obtains the data write address and the data to be written, it needs to first store the data write address in the write address cache on the corresponding write address channel through the write address channel between the target slave device and the interconnection module, so that the slave device can obtain the data write address from the write address cache; and store the data to be written in the write data cache on the corresponding write data channel through the write data channel between the target slave device and the interconnection module, so that the slave device can obtain the data to be written from the write data cache.
[0060] Since there is no FIFO (First Input First Output) queue in the write address cache on the write address channel between the slave device and the interconnection module, the write address cache can only store one address at a time, while there is a FIFO queue in the write data cache on the write data channel between the slave device and the interconnection module, so the write data cache can store multiple data. Based on this, the setting of the preset write condition specifically includes that the write address cache on the write address channel between the target slave device and the interconnection module is empty, and the write data cache on the write data channel between the target slave device and the interconnection module is not full. In this way, before performing a data write operation on the slave device, the present invention first determines whether the channel between the slave device and the interconnection module meets the preset write condition, so as to avoid writing the address of the next write transfer into the write address cache when the address of the previous write transfer in the write address cache has not been received by the slave device, thereby overwriting the address of the previous write transfer, causing an error in the previous write transfer.
[0061] Step S12: When there are multiple records corresponding to the target transaction identifier in the current record table, determine the target record from the multiple records based on the device identifier of the corresponding slave device; the current record table includes several records constructed based on the transaction identifier and the device identifier of the slave device, and the responses corresponding to the several records are not returned to the master device.
[0062] In an embodiment of the present invention, after determining the target transaction identifier corresponding to the currently obtained target response, it is necessary to search for the record corresponding to the target transaction identifier from the current record table, and when there are multiple records corresponding to the target transaction identifier in the current record table, the target record is determined from the multiple records based on the device identifier of the slave device corresponding to the target response.
[0063] It should be noted that, for the addition of each record in the current record table, specifically, when the interconnection module determines the target slave device corresponding to the current write operation transaction based on the control signal sent by the master device on the write address channel between itself and the interconnection module, a record is constructed according to the transaction identifier corresponding to the current write operation transaction and the device identifier of the target slave device, and the record is added to the current record table to update the current record table. In addition, each record in the current record table has time information, which is information automatically generated when each record is added to the current record table. In this way, the present invention automatically adds and updates the current record table, thereby ensuring that the time sequence of each record in the current record table is consistent with the time sequence of the write operation transaction initiation, so as to achieve the sequential return of responses to the same transaction identifier later.
[0064] According to one of the embodiments, after determining the target transaction identifier corresponding to the currently acquired target response, the number of records corresponding to the target transaction identifier in the current record table is counted, and it is determined whether the number of records corresponding to the target transaction identifier in the current record table is greater than one; if the number is greater than one, it is determined that there are multiple records corresponding to the target transaction identifier in the current record table; if the number is equal to one, it is determined that there is a record corresponding to the target transaction identifier in the current record table. Since responses to different transaction identifiers can be returned out of order, the target response can be directly returned to the master device, and the record corresponding to the target transaction identifier can be cleared from the current record table at the same time.
[0065] Among them, for clearing a record in the current record table, a valid bit can be set for each record in the current record table in advance. When a record needs to be cleared from the current record table, the record can be cleared by clearing the valid bit corresponding to the record in the current record table.
[0066] Step S13: If the target record is not the earliest record among the multiple records, cache the target response as a response corresponding to the target record.
[0067] In an embodiment of the present invention, when the target record is not the earliest record among multiple records, considering that responses to the same transaction identifier must be returned sequentially, the target response can be cached first and used as the response corresponding to the target record.
[0068] Step S14: If the target record is the earliest record among multiple records, the target response is taken as the response corresponding to the target record, and the responses corresponding to the continuous records are returned to the main device in chronological order; the continuous record is the earliest continuous record with a corresponding response among multiple records.
[0069] In an embodiment of the present invention, when the target record is the earliest record among multiple records, the target response can be used as the response corresponding to the target record, and each response corresponding to the earliest consecutive record with a response among the multiple records can be returned to the main device in chronological order.
[0070] For example, if the multiple records include five records, and the time of the first record is earlier than the second record, the time of the second record is earlier than the third record, the time of the third record is earlier than the fourth record, and the time of the fourth record is earlier than the fifth record, if the responses corresponding to the second record and the fourth record have been cached, then when the target record is the first record with the earliest time among the multiple records, the target response is used as the response corresponding to the first record, and the corresponding consecutive records with responses and the earliest time among the five records, that is, the responses corresponding to the first record and the second record are returned to the main device in chronological order.
[0071] Specifically, when the target record is the earliest record among multiple records, the target response is used as the response corresponding to the target record, and in the process of returning the response to multiple records, the response corresponding to the target record is returned to the master device, and the target record is cleared from the current record table and multiple records respectively to update the current record table and multiple records; then the oldest current record to be judged is queried from the updated multiple records, and it is determined whether the current record to be judged corresponds to a response. If the current record to be judged corresponds to a response, the acquisition of the response from the slave device is suspended, and the response corresponding to the current record to be judged is read from the cache, and the read response corresponding to the current record to be judged is returned to the master device, and then the current record to be judged is cleared from the updated current record table and the updated multiple records respectively to update the current record table and multiple records, and jump to the above step of querying the earliest current record to be judged from the updated multiple records. If the current record to be judged does not correspond to a response or the updated multiple records are empty, the response return process for multiple records is terminated, and the acquisition of the response from the slave device continues.
[0072] Beneficial effect: In the process of the master device performing data write operation on each slave device through the interconnection module of the present invention, the interconnection module will obtain the response generated and sent by the slave device after completing the corresponding data write operation, and then determine the corresponding record from the current record table based on the target transaction identifier corresponding to the currently obtained target response, and when there are multiple corresponding records, determine the corresponding target record from the multiple records based on the slave device corresponding to the currently obtained target response. If the target record is not the earliest record in time among the multiple records, in order to ensure that the response with the same transaction identifier can be returned to the master device in sequence, the target response is first temporarily stored as a response corresponding to the target record; if the target record is the earliest record in time among the multiple records, the sequential return of the response to the same transaction identifier can be enabled, that is, the target response is used as the response corresponding to the target record, and each response corresponding to the continuous record with a response and the earliest time among the multiple records is returned to the master device in chronological order, thereby ensuring the sequential return of the response to the same transaction identifier. In this way, the present invention introduces a current record table to ensure the sequential return of responses to the same transaction identifier, so that the next write transfer can be started without obtaining a response to the previous write transfer. That is, the present invention can enable the master device to perform write transfers with multiple slave devices at the same time, greatly improving the efficiency of write transfers.
[0073] See also Figure 3 As shown, an embodiment of the present invention provides a response transmission method, including:
[0074] The master device transmits the data write address to the write address channel between itself and the interconnection module, and transmits the data to be written to the write data channel between itself and the interconnection module by pulling up the vaild signal of the write address channel and the write data channel between itself and the interconnection module.
[0075] The interconnection module pulls down the ready signals of the write address channel and the write data channel between itself and the master device in advance, and determines the target slave device corresponding to the current write operation transaction based on the control signal sent by the master device on the write address channel between itself and the interconnection module. Then the interconnection module determines whether the channel between itself and the target slave device meets the preset write condition; if not, it waits for the channel between itself and the target slave device to meet the preset write condition, and then pulls up the ready signals of the write address channel and the write data channel between itself and the master device to obtain the data write address from the write address channel between itself and the master device, and obtains the data to be written from the write data channel between itself and the master device. At the same time, the interconnection module pulls up the vaild signals of the write address channel and the write data channel between itself and the target slave device to store the data write address in the write address cache on the corresponding write address channel through the write address channel between itself and the target slave device, and stores the data to be written in the write data cache on the corresponding write data channel through the write data channel between itself and the target slave device.
[0076] The target slave device pulls up the ready signals of the write address channel and the write data channel between itself and the interconnection module to obtain the data write address from the write address cache on the write address channel and the data to be written from the write data cache on the write data channel, thereby executing the data write operation corresponding to the current write operation transaction to write the received data into the corresponding storage space based on the received address. Furthermore, the target slave device generates a response after completing the corresponding data write operation and transmits the response to the interconnection module through the write response channel between itself and the interconnection module.
[0077] The interconnection module obtains the response transmitted from the device through the polling arbitration unit, and when there are multiple responses, it determines the multiple responses currently obtained as target responses in turn based on the preset polling rules, and determines the target transaction identifier corresponding to the currently obtained target response, and then sends the target transaction identifier to the query judgment unit in the interconnection module.
[0078] The query judgment unit queries the record corresponding to the target transaction identifier from the current record table, counts the number of records corresponding to the target transaction identifier in the current record table, and then judges whether the number of records corresponding to the target transaction identifier in the current record table is greater than one. If the number is equal to one, it is determined that there is a record corresponding to the target transaction identifier in the current record table. Since responses to different transaction identifiers can be returned in disorder, the target response can be directly sent and stored to the end of the FIFO queue in the interconnection module, so that the FIFO queue returns the stored response to the main device according to the first-in-first-out rule, and at the same time, the record corresponding to the target transaction identifier needs to be cleared from the current record table.
[0079] If the number is greater than one, it is determined that there are multiple records corresponding to the target transaction identifier in the current record table, and the target record is determined from the multiple records based on the device identifier of the slave device corresponding to the target response. If the target record is not the earliest record in the multiple records, the target response is stored in a preset cache as a response corresponding to the target record, and the acquisition of the response from the slave device continues.
[0080] If the target record is the earliest record among multiple records, the target response is taken as the response corresponding to the target record, and in the process of the response continuous return unit returning the response to multiple records, the response corresponding to the target record is sent and stored to the end of the FIFO queue in the interconnection module, so that the FIFO queue returns the stored response to the main device according to the first-in-first-out rule. At the same time, the response continuous return unit clears the target record from the current record table and multiple records respectively to update the current record table and multiple records, and queries the earliest current record to be judged from the updated multiple records, and then determines whether the current record to be judged corresponds to a response. If there is a response corresponding to the current record to be judged, the polling arbitration unit is suspended to suspend the acquisition of the response from the slave device, and the response corresponding to the current record to be judged is read from the preset cache, and the response corresponding to the current record to be judged is sent and stored to the end of the FIFO queue in the interconnection module, so that the FIFO queue returns the stored response to the master device according to the first-in-first-out rule, and at the same time, the current record to be judged is cleared from the updated current record table and the updated multiple records respectively to update the current record table and the multiple records, and then jumps to the above-mentioned step of querying the current record to be judged with the earliest time from the updated multiple records, until there is no response corresponding to the current record to be judged or the updated multiple records are empty, then the response return process for multiple records is ended, and the acquisition of the response from the slave device is started.
[0081] Beneficial effect: In the process of the master device performing data write operation on each slave device through the interconnection module of the present invention, the interconnection module will obtain the response generated and sent by the slave device after completing the corresponding data write operation, and then determine the corresponding record from the current record table based on the target transaction identifier corresponding to the currently obtained target response, and when there are multiple corresponding records, determine the corresponding target record from the multiple records based on the slave device corresponding to the currently obtained target response. If the target record is not the earliest record in time among the multiple records, in order to ensure that the response with the same transaction identifier can be returned to the master device in sequence, the target response is first temporarily stored as a response corresponding to the target record; if the target record is the earliest record in time among the multiple records, the sequential return of the response to the same transaction identifier can be enabled, that is, the target response is used as the response corresponding to the target record, and each response corresponding to the continuous record with a response and the earliest time among the multiple records is returned to the master device in chronological order, thereby ensuring the sequential return of the response to the same transaction identifier. In this way, the present invention introduces a current record table to ensure the sequential return of responses to the same transaction identifier, so that the next write transfer can be started without obtaining a response to the previous write transfer. That is, the present invention can enable the master device to perform write transfers with multiple slave devices at the same time, greatly improving the efficiency of write transfers.
[0082] See also Figure 4 As shown, an embodiment of the present invention provides a response transmission device, which is applied to an interconnection module, including:
[0083] The identifier determination module 11 is used to determine the target transaction identifier corresponding to the currently acquired target response when the master device performs a data write operation on each slave device through the interconnection module; the target response is a response generated by the corresponding slave device after completing the corresponding data write operation and transmitted to the interconnection module; the corresponding data write operation and the target response correspond to the same transaction identifier;
[0084] A record determination module 12 is used to determine the target record from the multiple records based on the device identification of the corresponding slave device when there are multiple records corresponding to the target transaction identifier in the current record table; the current record table includes several records constructed based on the transaction identifier and the device identification of the slave device, and the responses corresponding to the several records are not returned to the master device;
[0085] A response cache module 13, configured to cache a target response as a response corresponding to the target record if the target record is not the earliest record among the multiple records;
[0086] The response returning module 14 is used to take the target response as the response corresponding to the target record if the target record is the earliest record among multiple records, and return each response corresponding to the continuous record to the main device in chronological order; the continuous record is the continuous record with a corresponding response and the earliest time among multiple records.
[0087] Since the embodiments of the device part correspond to the above embodiments, please refer to the description of the embodiments of the method part for the embodiments of the device part, and will not be repeated here.
[0088] Beneficial effect: In the process of the master device performing data write operation on each slave device through the interconnection module of the present invention, the interconnection module will obtain the response generated and sent by the slave device after completing the corresponding data write operation, and then determine the corresponding record from the current record table based on the target transaction identifier corresponding to the currently obtained target response, and when there are multiple corresponding records, determine the corresponding target record from the multiple records based on the slave device corresponding to the currently obtained target response. If the target record is not the earliest record in time among the multiple records, in order to ensure that the response with the same transaction identifier can be returned to the master device in sequence, the target response is first temporarily stored as a response corresponding to the target record; if the target record is the earliest record in time among the multiple records, the sequential return of the response to the same transaction identifier can be enabled, that is, the target response is used as the response corresponding to the target record, and each response corresponding to the continuous record with a response and the earliest time among the multiple records is returned to the master device in chronological order, thereby ensuring the sequential return of the response to the same transaction identifier. In this way, the present invention introduces a current record table to ensure the sequential return of responses to the same transaction identifier, so that the next write transfer can be started without obtaining a response to the previous write transfer. That is, the present invention can enable the master device to perform write transfers with multiple slave devices at the same time, greatly improving the efficiency of write transfers.
[0089] Furthermore, the present application also discloses an electronic device. Figure 5 It is a structural diagram of an electronic device according to an exemplary embodiment, and the content in the figure cannot be regarded as any limitation on the scope of use of this application. The electronic device may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the response transmission method disclosed in any of the aforementioned embodiments. In addition, the electronic device in this embodiment may specifically be an electronic computer.
[0090] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0091] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0092] The operating system 221 is used to manage and control various hardware devices on the electronic device and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the response transmission method performed by the electronic device disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0093] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned disclosed response transmission method. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.
[0094] Furthermore, the present application also discloses a computer program product, including a computer program / instruction; wherein the computer program / instruction, when executed by a processor, implements the aforementioned disclosed response transmission method. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiment, and will not be repeated here.
[0095] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0096] 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 composition and steps of each example have been generally described in the above description according to function. 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 to be beyond the scope of this application.
[0097] The steps of the method or algorithm 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 a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0098] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0099] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article 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 general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A response transmission method, characterized in that: Applicable to interconnect modules, including: When the master device performs a data write operation on each slave device through the interconnection module, determining a target transaction identifier corresponding to a currently acquired target response; the target response is a response generated by the corresponding slave device after completing the corresponding data write operation and transmitted to the interconnection module; the corresponding data write operation and the target response correspond to the same transaction identifier; When there are multiple records corresponding to the target transaction identifier in the current record table, determining the target record from the multiple records based on the device identifier of the corresponding slave device; the current record table includes several records constructed based on the transaction identifier and the device identifier of the slave device, and responses corresponding to the several records are not returned to the master device; If the target record is not the earliest record among the multiple records, cache the target response as a response corresponding to the target record; If the target record is the earliest record among the multiple records, the target response is taken as the response corresponding to the target record, and the responses corresponding to the continuous records are returned to the main device in chronological order; the continuous record is the earliest continuous record with a corresponding response among the multiple records.
2. The response transmission method according to claim 1, characterized in that: Before determining the target transaction identifier corresponding to the currently acquired target response, the method further includes: When a plurality of responses are obtained through the write response channels between the plurality of slave devices and the interconnection module, the plurality of responses currently obtained are sequentially determined as target responses based on the slave devices to which the plurality of responses currently obtained respectively correspond by using a preset polling rule; The preset polling rule is a polling rule determined based on a preset slave device processing order.
3. The response transmission method according to claim 1, characterized in that: After determining the target transaction identifier corresponding to the currently acquired target response, the method further includes: Counting the number of records corresponding to the target transaction identifier in the current record table; If the number is greater than one, determining that there are multiple records corresponding to the target transaction identifier in the current record table; If the number is equal to one, it is determined that there is a record corresponding to the target transaction identifier in the current record table, the target response is returned to the master device, and the record corresponding to the target transaction identifier is cleared from the current record table.
4. The response transmission method according to claim 1, characterized in that: The step of taking the target response as a response corresponding to the target record and returning each response corresponding to the continuous record to the master device in chronological order includes: Taking the target response as a response corresponding to the target record, and in a process of returning responses to the plurality of records, returning the response corresponding to the target record to the master device; clearing the target record from the current record table and the multiple records respectively, so as to update the current record table and the multiple records; Querying the oldest current record to be judged from the updated multiple records, and determining whether the current record to be judged has a corresponding response; If the current record to be determined has a response, suspending the acquisition of the response from the slave device, reading the response corresponding to the current record to be determined from the cache, and returning the read response corresponding to the current record to be determined to the master device; Clearing the current record to be judged from the updated current record table and the updated multiple records respectively, so as to update the current record table and the multiple records, and then jumping back to the step of querying the current record to be judged with the earliest time from the updated multiple records; If the current record to be determined has no corresponding response or the updated multiple records are empty, the response return process for the multiple records is terminated, and the acquisition of the response from the slave device continues.
5. The response transmission method according to any one of claims 1 to 4, characterized in that: The process in which the master device performs a data writing operation on each slave device through the interconnection module includes: Determine a target slave device corresponding to a current write operation transaction based on a control signal sent by the master device on a write address channel between the master device and the interconnection module; When the channel between the target slave device and the interconnection module meets a preset write condition, a data write address is obtained from a write address channel between the master device and the interconnection module, and data to be written is obtained from a write data channel between the master device and the interconnection module; the data write address and the data to be written both correspond to the current write operation transaction; The data write address and the data to be written are respectively transmitted to the target slave device through the write address channel and the write data channel between the target slave device and the interconnection module, so that the target slave device performs a data write operation corresponding to the current write operation transaction to write the received data into the corresponding storage space based on the received address.
6. The response transmission method according to claim 5, characterized in that: The step of transmitting the data writing address and the data to be written to the target slave device through a write address channel and a write data channel between the target slave device and the interconnection module, respectively, comprises: The data write address is stored in a write address cache on the corresponding write address channel through a write address channel between the target slave device and the interconnection module, so that the slave device obtains the data write address from the write address cache; The data to be written is stored in a write data cache on the corresponding write data channel through a write data channel between the target slave device and the interconnection module, so that the slave device obtains the data to be written from the write data cache.
7. The response transmission method according to claim 6, characterized in that: The preset write condition includes that a write address buffer on a write address channel between the target slave device and the interconnection module is empty, and a write data buffer on a write data channel between the target slave device and the interconnection module is not full.
8. A response transmission device, characterized in that: Applicable to interconnect modules, including: an identification determination module, configured to determine a target transaction identification corresponding to a currently acquired target response when the master device performs a data write operation on each slave device through the interconnection module; the target response is a response generated by the corresponding slave device after completing the corresponding data write operation and transmitted to the interconnection module; the corresponding data write operation and the target response correspond to the same transaction identification; a record determination module, configured to determine the target record from the multiple records based on the device identification of the corresponding slave device when there are multiple records corresponding to the target transaction identifier in the current record table; the current record table includes several records constructed based on the transaction identifier and the device identification of the slave device, and responses corresponding to the several records are not returned to the master device; A response cache module, configured to cache the target response as a response corresponding to the target record if the target record is not the earliest record among the multiple records; A response returning module is used to, if the target record is the earliest record among the multiple records, take the target response as the response corresponding to the target record, and return each response corresponding to the continuous record to the main device in chronological order; the continuous record is the earliest continuous record with a corresponding response among the multiple records.
9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the response transmission method according to any one of claims 1 to 7.
10. 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 response transmission method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Data transmission method and device, medium and product
CN120295958A