Data transfer method, device, electronic device and storage medium
The data transfer method based on packet segmentation and tail information judgment solves the problem of low network parallelism in mixed demand scenarios, improves transfer efficiency and network parallelism, and is suitable for large chip scenarios.
Patent Information
- Application Number
- CN202411140424.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-08-19
AI Technical Summary
Existing technologies lack data transfer methods suitable for mixed needs, especially in scenarios involving large data packets and CPU data transfer, resulting in low network parallelism and inefficiency.
Data packet segmentation technology is used to generate data packets containing forwarding information. After the data slice containing tail information in the data packet enters the transmission channel, the channel is closed. The decision is based solely on whether a single data packet is needed, thus avoiding keeping the channel open until all data slices are completed.
It improves the parallelism and forwarding efficiency of the routing network, reduces the time wasted in pathfinding and response packets, and is suitable for mixed scenarios with single data slices and multiple data packets.
Smart Images

Figure CN118677858B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data transmission, and in particular to a data transfer method, a data transfer device, an electronic device and a storage medium. Background Art
[0002] Data transfer usually refers to the transmission of data in a routing network and is an important stage in data transmission.
[0003] At present, there are usually two ways of data transfer. The first is the multi-data packet method, which is to send a pathfinding information packet (or data slice) to open the transmission channel from the data sender to the data receiver and retain the control of the transmission channel. The pathfinding information packet (or data slice) returns a response information packet to notify the data sender and start data transmission until all data transmission is completed. The second is the single data slice method. Specifically, each data slice contains complete transfer information, and only one data slice is transmitted at a time. It is directly transferred in the routing network at one time and does not need to open the control of the transmission channel in advance.
[0004] However, the first method mentioned above is mainly used in large data packet transmission scenarios, and the second method mentioned above is mainly used in CPU (central processing unit) data transmission scenarios. Currently, there is a lack of data transfer methods that are generally applicable to scenarios with mixed requirements. Summary of the invention
[0005] In view of the above problems, embodiments of the present invention are proposed to provide a data transfer method that overcomes the above problems or at least partially solves the above problems, so as to perform data transfer in a scenario with mixed requirements.
[0006] In a first aspect, the present invention provides a data transfer method, comprising:
[0007] A data subpacket obtained by dividing a data packet is obtained; the data subpacket includes: at least one data slice and forwarding information; the forwarding information includes: forwarding starting point identity information, forwarding end point identity information and routing control information; the routing control information includes: the next output port of the data subpacket; the data slice includes: position information of the data slice in the data subpacket and data to be forwarded; the position information includes: one of the header information, the tail information and the intermediate information;
[0008] Opening a transmission channel of the next output port;
[0009] After the data slice including the tail information in the data packet enters the transmission channel, the transmission channel is closed.
[0010] In a second aspect, the present invention provides a data transfer device, comprising:
[0011] The acquisition module is used to acquire a data subpacket obtained by segmenting a data packet; the data subpacket includes: at least one data slice and forwarding information; the forwarding information includes: forwarding starting point identity information, forwarding end point identity information and routing control information; the routing control information includes: the next output port of the data subpacket; the data slice includes: the position information of the data slice in the data subpacket and the data to be forwarded; the position information includes: one of the header information, the tail information and the intermediate information;
[0012] An opening module, used for opening the transmission channel of the next output port;
[0013] The closing module is used to close the transmission channel after the data slice including the tail information in the data packet enters the transmission channel.
[0014] In a third aspect, the present invention provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned data transfer method when executing the program.
[0015] In a fourth aspect, the present invention provides a readable storage medium, which enables the electronic device to execute the above-mentioned data transfer method when instructions or transactions in the storage medium are executed by a processor of the electronic device.
[0016] In a fifth aspect, the present invention provides a computer program product, comprising instructions or transactions, which, when executed by a processor in an electronic device, enable the electronic device to execute any one of the aforementioned data transfer methods.
[0017] The present invention includes the following advantages:
[0018] In the present invention, after the data packet is sliced, a data subpacket is obtained, and the data subpacket includes: at least one data slice and forwarding information. After the data packet is sliced, only one data subpacket is obtained, and the data subpacket only includes one data slice, which is a single data slice mode forwarding. After the data packet is sliced, at least two data subpackets are obtained, and each data subpacket includes at least one data slice, which is a multi-data packet mode forwarding. Therefore, the forwarding method of the present application is applicable to both single data slice mode forwarding and multi-data packet mode forwarding, that is, it supports elastic data slicing, and can be applied in large chip scenarios with mixed single data slice mode forwarding and multi-data packet mode forwarding requirements. At the same time, for the multi-data packet mode, the data slice including the tail information in the data subpacket is the last data slice of the data subpacket. The data slice including the tail information in the data subpacket enters the transmission channel, that is, the last data slice of the data subpacket has entered the transmission channel. For the transmission channel, there are no data slices in the data subpacket that need to be forwarded, and the transmission channel is closed. That is to say, the closure of the transmission channel is based on whether a single data packet still needs the transmission channel. The transmission channel does not need to be maintained until all data slices in the entire data packet are transmitted. As a result, the waiting time for other data packets to be authorized by the transmission channel is shorter, the parallelism of the entire routing network is greatly improved, and the transfer efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0020] Figure 1 A flow chart showing the steps of an embodiment of a data transfer method of the present invention is shown;
[0021] Figure 2 A schematic diagram of a data packet of the present invention is shown;
[0022] Figure 3 A schematic diagram showing a data transfer process of the related art is shown;
[0023] Figure 4 A routing network of the present invention is shown;
[0024] Figure 5 A flowchart showing another data transfer method embodiment of the present invention is shown;
[0025] Figure 6 A structural block diagram of a data transfer device embodiment of the present invention is shown;
[0026] Figure 7 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0027] 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 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.
[0028] One of the core concepts of the embodiment of the present invention is that after the data packet is sliced, a data subpacket is obtained, and the data subpacket includes: at least one data slice and forwarding information. After the data packet is sliced, only one data subpacket is obtained, and the data subpacket only includes one data slice, which is a single data slice mode forwarding. After the data packet is sliced, at least two data subpackets are obtained, and each data subpacket includes at least one data slice, which is a multi-data packet mode forwarding. Therefore, the forwarding method of the present application is applicable to both single data slice mode forwarding and multi-data packet mode forwarding, that is, it supports elastic data slicing and can be applied in large chip scenarios with mixed single data slice mode forwarding and multi-data packet mode forwarding requirements. At the same time, for the multi-data packet mode, the data slice including the tail information in the data subpacket is the last data slice of the data subpacket. The data slice including the tail information in the data subpacket enters the transmission channel, that is, the last data slice of the data subpacket has entered the transmission channel. For the transmission channel, there are no data slices in the data subpacket that need to be forwarded, and the transmission channel is closed. That is to say, the closure of the transmission channel is based on whether a single data packet still needs the transmission channel. The transmission channel does not need to be maintained until all data slices in the entire data packet are transmitted. As a result, the waiting time for other data packets to be authorized by the transmission channel is shorter, the parallelism of the entire routing network is greatly improved, and the transfer efficiency is improved.
[0029] Reference Figure 1 , the data transfer method may specifically include the following steps.
[0030] Step 101, obtaining a data subpacket obtained by segmenting a data packet; the data subpacket includes: at least one data slice and forwarding information; the forwarding information includes: forwarding starting point identity information, forwarding end point identity information and routing control information; the routing control information includes: the next output port of the data subpacket; the data slice includes: the position information of the data slice in the data subpacket and the data to be forwarded; the position information includes: one of the header information, the tail information and the intermediate information.
[0031] Here, the size of a data subpacket is less than or equal to the size of a data packet (Package), and the size of a data slice is less than or equal to the size of a data subpacket. There is no specific limitation on the size of a data packet, nor on the size of a data subpacket, nor on the size of a data slice. A data packet is a block of data transferred and transmitted in the on-chip network, which is generally an integer multiple of the channel data width designed by the hardware. The on-chip network includes a router, which is a basic component of the on-chip network and is used for temporary storage and transfer of data. The executor of data transfer in the present application may be the router, and the executor of step 101 may be a router buffer, which is a logical functional block for temporary storage of data packets, data subpackets, and data slices in the router hardware. The router buffer can receive and cache data slices sent by the upstream router or design, generally using a first-in-first-out strategy, and can cache F data slices depending on the hardware design requirements, where F is a natural number.
[0032] The first number of data subpackets obtained by segmenting the data packet is not specifically limited, and the third number of data slices included in one data subpacket is not specifically limited. For example, after the data packet is segmented, one data subpacket is obtained, and the data subpacket only includes one data slice. For another example, after the data packet is segmented, at least two data subpackets are obtained, and each data subpacket includes at least one data slice.
[0033] The specific location of the transfer information in the data packet is not specifically limited. The transfer information here may include: transfer starting point identity information, transfer end point identity information and routing control information. The transfer starting point identity information is used to characterize the identity of the transfer starting point of the data to be transferred, and the transfer end point identity information is used to characterize the identity of the end point to which the data to be transferred is to be transferred. The transfer starting point identity information may be the coding domain of the transfer starting point, and the transfer end point identity information may be the coding domain of the transfer end point. The routing control information includes: the next output port of the data packet, specifically the output port to which the data packet needs to be transferred next. The routing control information may also include routing network control or function-related signal domains, etc. For example, the routing network control or function-related signal domains may be the priority of the transfer, etc. The routing control information is not specifically limited.
[0034] A data slice is the smallest data unit for transmission in an on-chip network, which is generally the channel width designed by the hardware. A data slice includes: the position information of the data slice in the data subpacket and the data to be transferred. The position information includes: one of the header information, the tail information and the intermediate information. When the position information of a data slice is the header information, the data slice is the first data slice or the head data slice in the data subpacket. When the position information of a data slice is the tail information, the data slice is the last data slice or the tail data slice in the data subpacket. When the position information of a data slice is the intermediate information, the data slice is the intermediate data slice in the data subpacket. When a data subpacket includes a head data slice, an intermediate data slice and a tail data slice, the intermediate data slice is located between the head data slice and the tail data slice. The number of head data slices in the data subpacket is one, and the number of tail data slices is one. The data to be transferred refers to at least part of the data that needs to be transferred from the transfer starting point to the transfer end point.
[0035] Figure 2 The outermost dashed box represents a data packet. Figure 2 The small circle in the figure indicates omission. Figure 2 , Figure 2 The data packet is divided into A data subpackets, where A is a natural number greater than 2, wherein the first data subpacket is data subpacket 1, the last data subpacket is data subpacket A, and at least one intermediate data subpacket is data subpacket 2 to data subpacket A-1. Data subpacket 1 includes B data slices, where B is a natural number greater than 3. Data slice 1 in the data subpacket is the head data slice, and the position information of data slice 1 includes the header information, or the position information of data slice 1 is the position information including the header information. Data slice 2 to data slice B-1 in the data subpacket are intermediate data slices, and the position information of data slice 2 includes the intermediate information, or the position information of data slice 2 is the position information including the intermediate information. Data slice 2 to data slice C-1 in the data subpacket are intermediate data slices, and the position information of data slice 2 includes the intermediate information, or the position information of data slice 2 is the position information including the intermediate information. The data slice B or the data slice C in the data packet is the tail data slice, and the location information of the data slice B or the data slice C includes the tail information, or the location information of the data slice B or the data slice C is the location information including the tail information. Here, C is a natural number greater than 3.
[0036] Step 102: Open the transmission channel of the next output port.
[0037] Here, the authorization of the transmission channel of the next output port may be obtained, and the right to use the transmission channel of the next output port may be obtained. Once the transmission channel of the next output port is opened, the transmission channel of the next output port may transfer data.
[0038] Step 103: After the data slice including the tail information in the data packet enters the transmission channel, close the transmission channel.
[0039] In the present application, at least two data subpackets are obtained after the data packet is split, and each data subpacket includes at least one data slice. The data transfer process of the present application is: obtain the first data subpacket of the data packet, open the transmission channel of the next output port of the first data subpacket, and then use the transmission channel to transfer the head data slice, the middle data slice, and the tail data slice in sequence from the head data slice of the first data subpacket. After the tail data slice including the tail information in the first data subpacket enters the transmission channel, the authorization of the transmission channel is closed, and the arbitration logic can be initiated for the second data subpacket at the same time. The data slice including the tail information in the data subpacket enters the transmission channel, which means that the last data slice of the data subpacket has entered the transmission channel. For the transmission channel, there is no data slice in the data subpacket that needs to be transferred, and the transmission channel is closed. That is to say, the closure of the transmission channel is based on whether a single data subpacket still needs the transmission channel. The transmission channel does not need to be maintained until all the data slices in the entire data packet are transmitted, thereby shortening the time for other data packets to wait for the authorization of the transmission channel, greatly improving the parallelism of the entire routing network, and improving the transfer efficiency.
[0040] For example, for Figure 2 If step 101 obtains data packet 1, the transmission channel of the next output port of data packet 1 is opened, and then the transmission channel is used to sequentially transfer data slice 1, data slice 2, data slice 3 ... data slice B-1 starting from the head data slice of data packet 1, i.e., data slice 1. After the tail data slice B including the tail information in data packet 1 enters the transmission channel, the authorization of the transmission channel is closed, and the arbitration logic can be initiated for data packet 2 at the same time. Therefore, after the data packet 1 in the data packet is transferred, other data packets may obtain the right to use the transmission channel without waiting until all the data slices of the data packet are transferred. This shortens the time other data packets wait for the authorization of the transmission channel, greatly improves the parallelism of the entire routing network, and improves the transfer efficiency.
[0041] In the present application, only one data subpacket is obtained when the data packet is split, and the data subpacket only includes one data slice. The data transfer process of the present application is: the data subpacket is obtained, and the position information of the data slice in the data subpacket is the header information. Since the data subpacket only contains one data slice, the data slice is both the head data slice and the tail data slice. The transmission channel of the next output port of the data subpacket is opened, and after the only one data slice in the data subpacket enters the transmission channel, the transmission channel is closed.
[0042] In summary, the transfer method of the present application is applicable to both single data slice transfer and multi-data packet transfer, that is, it supports elastic data slicing, and can be applied in large chip scenarios with mixed single data slice transfer and multi-data packet transfer requirements. At the same time, for the multi-data packet mode, the last data slice of the data packet has entered the transmission channel. For the transmission channel, there is no data slice in the data packet that needs to be transferred, and the transmission channel is closed. That is to say, the closure of the transmission channel is based on whether a single data packet still needs the transmission channel. The transmission channel does not need to be maintained until all data slices in the entire data packet are transmitted, thereby shortening the time for other data packets to wait for the authorization of the transmission channel, greatly improving the parallelism of the entire routing network, and improving the transfer efficiency. At the same time, since each data packet contains transfer information, and the closure of the transmission channel is based on whether a single data packet still needs the transmission channel, there is no need to send additional pathfinding information packets or return additional response information packets for the multi-data packet transfer mode, reducing the time waste caused by the transfer of pathfinding information packets and response information packets.
[0043] Figure 3 The data transfer process represented by the related technology inside the outermost dotted box is Figure 3 The small circle in the figure indicates omission. More specifically, in the large data packet transfer scenario, refer to Figure 3 In the related art, a pathfinding information packet (or data slice) is first sent out to open the transmission channel from the data sending end to the data receiving end and retain the control of the transmission channel. The pathfinding information packet returns a response information packet to notify the data sending end to start data transmission until it is completed. After completion, a release information packet is sent out to notify the end of the control of the transmission channel. The related art has the following problems: additionally sending out pathfinding information packets and returning response information packets wastes time, and the transmission channel of the data packet needs to be maintained until the data packet is completely transmitted. Other data packets in the entire network need to wait for the control of the transmission channel, resulting in a significant reduction in the parallelism of the entire network and low efficiency.
[0044] In response to the technical problems existing in the prior art, in this application, the closure of the transmission channel is based on whether a single data packet still needs the transmission channel. The transmission channel does not need to be maintained until all data slices in the entire data packet are transmitted, thereby shortening the time other data packets wait for the authorization of the transmission channel, greatly improving the parallelism of the entire routing network, and improving the transfer efficiency. At the same time, since each data packet contains transfer information, and the closure of the transmission channel is based on whether a single data packet still needs the transmission channel, there is no need to send out additional pathfinding information packets or return additional response information packets for the multi-data packet transfer method, reducing the time waste caused by the transfer of pathfinding information packets and response information packets.
[0045] Figure 4 An example of a routing network of this application is shown in FIG. Figure 4 The main hardware of the routing network shown may include: routing buffers, crossbar switches, N / W / S direction ports, device ports, and arbitration logic. The routing buffer is used to receive and cache data slices sent by upstream routing or design, generally using a first-in first-out strategy. Depending on the hardware design requirements, F data slices can be cached, where F is a natural number. A crossbar switch is a controllable switch channel for multiple data input channels and multiple data output channels, for example, Figure 4 The cross switch of the E direction port is controlled by the channel opening signal to transfer the data slices sent from the N / W / S direction port and the device port, and the arbitration logic selects a data slice for transfer. The arbitration logic can determine according to certain rules which of the several channel request signals of the cross switch that arrive at the same direction port at the same time obtains the right to use the current cross switch. For example, the routing buffers of the device port and the direction port W / S / N all send the cross switch use right of the direction port E to the arbitration logic. The arbitration logic determines a selection, such as the W port receives the channel acquisition signal. If the routing buffer downstream of the direction port E can receive it, the channel opening signal controls the cross switch to output the data slice in the W routing buffer in the next clock. In the signal combination, the 'channel request signal' is a signal sent by the routing buffer to the arbitration logic to request the right to use the cross switch, the 'channel acquisition signal' is a signal sent by the arbitration logic to the routing buffer to determine whether to obtain the right to use the cross switch, and the 'channel opening signal' is sent by the arbitration logic to the cross switch to open the authorized channel.
[0046] Figure 4The specific implementation process of the network routing shown can be that when the data slice of the first data subpacket of the data packet arrives at the routing buffer, the routing algorithm and the forwarding information are used to determine to which output port the arbitration logic corresponding to the output port sends a 'channel request signal'. After the arbitration obtains the channel authorization of the cross switch of the output port, the 'channel acquisition signal' sent by the arbitration logic is received to prepare to output the first data slice (i.e., the head data slice) at the next clock; at the same time, the arbitration logic also sends a 'channel opening signal' to the cross switch, preparing to open the channel of the corresponding output port cross switch at the next clock; on the premise that the downstream routing buffer has space to temporarily store the data slice, the current route is output at the next clock, and then the authorization of the cross switch channel is maintained, and the intermediate data slice with intermediate information (such as the first data subpacket) of the first data subpacket is continuously output on the premise that the downstream routing buffer has capacity. Figure 2 the 2nd to B-1th intermediate data slices of the first data packet); the tail data slice containing tail information in the first data packet (such as Figure 2 When the tail data slice indicated by B in the figure is about to be output, the tail data slice is the last data slice of the first data packet. When the route is about to be output, the transmission channel authorization of the current data packet (i.e., the first data packet) is ended, and at the same time, the arbitration process of the arbitration logic is initiated for the next data packet (i.e., the second data packet).
[0047] Figure 5 A flow chart showing another embodiment of a data transfer method of the present invention is shown. Figure 5 , the data transfer method may specifically include the following steps.
[0048] Step 201: split a data packet consisting of all data that needs to be transferred from the same transfer starting point to the same transfer end point at the current moment into at least one data sub-packet.
[0049] All data that needs to be transferred from the same transfer starting point to the same transfer end point at the current moment is all data that needs to be transferred from the same transfer starting point to the same transfer end point at the current moment. All data that needs to be transferred from the same transfer starting point to the same transfer end point at the current moment is the actual valid data that needs to be transferred from the same transfer starting point to the same transfer end point at the current moment. There is no specific limitation on the size of the data packet. For example, the data packet contains T bits of data in total. For example, Figure 2 In the example shown, all the data to be transferred in data sub-packet 1 to data sub-packet A constitute all the data that needs to be transferred from the same transfer starting point to the same transfer end point at the current moment.
[0050] Step 202: Set the first identity number of the first data subpacket in the data packet to the first total number of data subpackets in the data packet; or, set the first identity number of the first data subpacket in the data packet to the first total number minus 1.
[0051] The first identity number of the first data subpacket is used to uniquely identify the first data subpacket in the data packet. The first identity number of the first data subpacket in the data packet is the first total number of data subpackets in the data packet, or the first identity number of the first data subpacket in the data packet is the first total number minus 1, that is, the first identity number of the first data subpacket in the data packet and the first total number of data subpackets in the data packet are strongly associated, and the first total number of data subpackets in the data packet can be accurately determined by the first identity number. The first identity number of the first data subpacket in the data packet can not only be used to characterize the data subpacket in the data packet, but also can be used to characterize the first total number of data subpackets in the data packet, and thus, there is no need to additionally set the first total number of data subpackets in the data packet in the data subpacket, which saves space and time for the transmission of actual valid data and has higher transfer efficiency.
[0052] For example, for Figure 2 In the example shown, the first total number of data subpackets in the data packet is A. Here, the first identity number of data subpacket 1 in the data packet is set to A or A-1. The first identity number A or A-1 can not only represent that the data subpacket is the first data subpacket in the data packet, but also represent that there are a total of A data subpackets in the data packet. Therefore, there is no need to additionally set the first total number A of data subpackets in the data packet, which saves space and time for the transmission of actual valid data and improves the transfer efficiency.
[0053] It should be noted that whether the first identity number is set from the second data subpacket to the last data subpacket in the data packet is not specifically limited. For example, starting from the first data subpacket in the data packet, the first identity number of each data subpacket decreases by 1. That is, for Figure 2 In the example shown, the first identity number of data subpacket 1 in the data packet is set to A or A-1, the first identity number of data subpacket 2 in the data packet is set to A-1 or A-2... the first identity number of data subpacket A in the data packet is set to 1 or 0.
[0054] Step 203: Store the first identity number into the data sub-package.
[0055] The first identity number of the first data subpacket in the data packet is stored in the data subpacket, which is used to indicate at the receiving end that the data subpacket is the first data subpacket of the data packet, and the data packet contains the first identity number or the first identity number plus 1 data subpacket.
[0056] Optionally, step 203 may include: storing the aforementioned first identity number in the forwarding information of the data subpacket; or, the data subpacket includes: a header data slice, the location information of the header data slice is the header information, the first identity number is stored in the location information of the header data slice of the data subpacket, and the first identity number is stored separately from the data to be forwarded, so as to ensure the accuracy of the forwarded data and make it easy for the receiving end to obtain the forwarded data.
[0057] Optional, see Figure 2 , the data subpacket includes: a head data slice, a tail data slice and at least one intermediate data slice. The position information of the head data slice is the head information, the position information of the tail data slice is the tail information, and the position information of the intermediate data slice is the intermediate information. The intermediate data slice includes: a first intermediate data slice (i.e., data slice 2), in which the first intermediate data slice (i.e., data slice 2) is adjacent to the head data slice (i.e., data slice 1). The method may also include: setting the second identity number of the first intermediate data slice (i.e., data slice 2) in the data subpacket to the second total number of intermediate data slices in the data subpacket; or, setting the second identity number of the first intermediate data slice (i.e., data slice 2) in the data subpacket to the second total number minus 1, and storing the second identity number in the first intermediate data slice. Specifically, in a data subpacket, there is only one head data slice and one tail data slice, and their positions are relatively fixed, and only the number of intermediate data slices varies greatly. The second identity number here is used to uniquely identify the first intermediate data slice in the data subpacket. The second identity number of the first intermediate data slice in the data subpacket is the second total number of intermediate data slices in the data subpacket, or the second identity number of the first intermediate data slice in the data subpacket is the second total number minus 1, that is, the second identity number of the first intermediate data slice in the data subpacket and the second total number of intermediate data slices in the data subpacket are strongly correlated, and the second total number of intermediate data slices in the data subpacket is accurately determined by the second identity number. The second identity number of the first intermediate data slice in the data subpacket can not only be used to accurately characterize the first intermediate data slice in the data subpacket, but also can be used to characterize the second total number of intermediate data slices in the data subpacket, and thus, there is no need to additionally set the second total number of intermediate data slices in the data subpacket in the intermediate data slice, which saves space and time for the transmission of actual valid data and has higher transfer efficiency.
[0058] For example, Figure 2In the example, data subpacket 1 to data subpacket A-1 each include a head data slice (i.e., data slice 1), a tail data slice (i.e., data slice B), and at least one intermediate data slice (i.e., data slice 2 to data slice B-1). The intermediate data slices include a first intermediate data slice (i.e., data slice 2), and the first intermediate data slice (i.e., data slice 2) is adjacent to the head data slice (i.e., data slice 1). For data subpacket 1 to data subpacket A-1, each includes B-2 intermediate data slices (i.e., data slice 2 to data slice B-1). The second identity number of the first intermediate data slice (i.e., data slice 2) in data subpacket 1 to data subpacket A-1 is set to the second total number B-2 of the intermediate data slices in data subpacket 1 to data subpacket A-1 (i.e., data slice 2 to data slice B-1). The second identity number of the first intermediate data slice (i.e., data slice 2) in data subpacket 1 to data subpacket A-1 can not only be used to accurately characterize the first intermediate data slice (i.e., data slice 2) in data subpacket 1 to data subpacket A-1, but also can be used to characterize the second total number of intermediate data slices in data subpacket 1 to data subpacket A-1. Therefore, there is no need to additionally set the second total number of intermediate data slices in the data subpacket in the intermediate data slice, which saves space and time for the transmission of actual valid data and has higher transfer efficiency.
[0059] For another example, Figure 2 In the example, data packet A includes a head data slice (i.e., data slice 1), a tail data slice (i.e., data slice C), and at least one intermediate data slice (i.e., data slice 2 to data slice C-1). The intermediate data slices include a first intermediate data slice (i.e., data slice 2), and the first intermediate data slice (i.e., data slice 2) is adjacent to the head data slice (i.e., data slice 1). Data packet A includes C-2 intermediate data slices (i.e., data slice 2 to data slice C-1). The second identity number of the first intermediate data slice (i.e., data slice 2) in data subpacket A is set to the second total number C-2 or C-3 of the intermediate data slices (i.e., data slice 2 to data slice C-1) in data subpacket A. The second identity number of the first intermediate data slice (i.e., data slice 2) in data subpacket A can not only be used to accurately characterize the first intermediate data slice (i.e., data slice 2) in the data subpacket A, but also can be used to characterize the second total number of intermediate data slices in the data subpacket A. Thus, there is no need to set the second total number of intermediate data slices in the data subpacket A in the intermediate data slices, which saves space and time for the transmission of actual valid data and has higher transmission efficiency. It should be noted that C is a natural number here, and C is less than or equal to B.
[0060] Optionally, the second identity number can be stored in the location information of the first intermediate data slice (i.e., data slice 2), and the second identity number can be stored separately from the data to be transferred of the first intermediate data slice to ensure the accuracy of the transferred data and make it easy for the receiving end to obtain the transferred data.
[0061] Optional, see Figure 2 , among the data packets obtained by segmenting the data packet, the storage capacity of the first data packet (i.e., data packet 1) to the second-to-last data packet (i.e., data packet A-1) is equal, and the processing methods of the first data packet to the second-to-last data packet are roughly compatible, and the transfer efficiency is high. Among the data packets obtained by segmenting the data packet, the storage capacity of the last data packet (i.e., data packet A) is less than or equal to the storage capacity of the first data packet (i.e., data packet 1) in the data packet. This data slicing method can adapt to data packets of a wider data size and has a wide range of applications.
[0062] Optional, see Figure 2 , the storage capacity of each data slice corresponding to the data packet is equal, the operations for each data slice are roughly compatible, and the transfer efficiency is high. In each data packet obtained by segmenting the data packet, the third number of data slices from the first data packet (i.e., data packet 1) to the second to last data packet (i.e., data packet A-1) is equal, such as Figure 2 The operations from the first data packet to the second-to-last data packet are roughly compatible, and the transfer efficiency is high. Among the data packets obtained by data packet segmentation, the third number of data slices of the last data packet (i.e., data packet A) is as follows Figure 2 The third number of data slices is C, which is less than or equal to the first data packet (i.e., data packet 1) in the data packet. Figure 2 In other words, C≤B. When C and B are not equal, there is no specific limit on how much smaller C is than B. This method can be adapted to data packets of a wider data size and has a wide range of applications. C, A, and B here can be set based on actual data transfer requirements, etc., and there is no specific limit on this.
[0063] Optional, see Figure 2 , the storage capacity of the position information in each data slice corresponding to the data packet is equal, and the processing method of the position information in each data slice corresponding to the data packet is roughly the same, which has high transfer efficiency and is conducive to alignment. For example, Figure 2 In each data slice corresponding to the data packet, the storage capacity of the location information is D bits. For example, only 2 bits can be used to represent the location information.
[0064] Optional, see Figure 2In each data sub-packet obtained by segmenting the data packet, the storage capacity of the forwarding information is equal, and the processing method of the forwarding information in each data sub-packet obtained by segmenting the data packet is roughly the same, the forwarding efficiency is high, and it is conducive to alignment.
[0065] Optional, see Figure 2 In each data slice corresponding to the data packet, the storage capacity of the data to be transferred is equal, and the processing method of the data to be transferred in each data slice corresponding to the data packet is roughly the same, the transfer efficiency is high, and it is conducive to alignment.
[0066] Optional, see Figure 2 The data subpacket includes: a header data slice (i.e., data slice 1), the location information of the header data slice is the header information, that is, the header data slice is the first data slice in a data subpacket. The forwarding information of the data subpacket is located in the header data slice (i.e., data slice 1) of the data subpacket. Specifically, in the present application, a data subpacket basically starts from the header data slice, and the forwarding information of the data subpacket is set in the header data slice (i.e., data slice 1) of the data subpacket to facilitate routing.
[0067] Step 204, obtaining a data subpacket obtained by splitting the data packet; the data subpacket includes: at least one data slice and forwarding information; the forwarding information includes: forwarding starting point identity information, forwarding end point identity information and routing control information; the routing control information includes: the next output port of the data subpacket; the data slice includes: the position information of the data slice in the data subpacket and the data to be forwarded; the position information includes: one of the header information, the tail information and the intermediate information.
[0068] Step 205: Open the transmission channel of the next output port.
[0069] Step 206: After the data slice including the tail information in the data packet enters the transmission channel, close the transmission channel.
[0070] Here, steps 204 to 206 may refer to the related records of the aforementioned steps 101 to 103, and can achieve the same or similar beneficial effects, which will not be described again here to avoid repetition.
[0071] In summary, the data transfer method provided by the present application is applicable to both single data slice transfer and multi-data packet transfer, that is, it supports elastic data slicing and can be applied to large chip scenarios with mixed single data slice transfer and multi-data packet transfer requirements. At the same time, data packets and their data slices can be dynamically and flexibly divided according to chip design requirements.
[0072] It should be noted that, at the data receiving end, a processing method corresponding to the transfer method can be used to restore the actual valid data, and there is no specific limitation on this.
[0073] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0074] Reference Figure 6 , Figure 6 The structure block diagram of a data transfer device embodiment of the present invention is shown, which may specifically include the following modules:
[0075] The acquisition module 301 is used to acquire a data subpacket obtained by segmenting a data packet; the data subpacket includes: at least one data slice and forwarding information; the forwarding information includes: forwarding starting point identity information, forwarding end point identity information and routing control information; the routing control information includes: the next output port of the data subpacket; the data slice includes: the position information of the data slice in the data subpacket and the data to be forwarded; the position information includes: one of the header information, the tail information and the intermediate information;
[0076] An opening module 302 is used to open the transmission channel of the next output port;
[0077] The closing module 303 is used to close the transmission channel after the data slice including the tail information in the data packet enters the transmission channel.
[0078] Optionally, the device further comprises: a segmentation module, configured to segment a data packet consisting of all data that needs to be transferred from the same transfer starting point to the same transfer end point at the current moment into at least one data sub-packet;
[0079] A first identity number setting module, used to set the first identity number of the first data subpacket in the data packet to the first total number of data subpackets in the data packet; or set the first identity number of the first data subpacket in the data packet to the first total number minus 1;
[0080] The first identity number storage module is used to store the first identity number in the data sub-packet.
[0081] Optionally, the first identity number storage module is specifically used to store the first identity number in the forwarding information of the data subpacket; or,
[0082] The data subpacket includes: a header data slice, the location information of the header data slice is the header information; the first identity number storage module is specifically used to store the first identity number in the location information of the header data slice of the data subpacket.
[0083] Optionally, the data subpacket includes: a header data slice, a tail data slice and at least one intermediate data slice; the location information of the header data slice is header information; the location information of the tail data slice is tail information; the location information of the intermediate data slice is intermediate information; the intermediate data slice includes: a first intermediate data slice, in the data subpacket, the first intermediate data slice is adjacent to the header data slice; the data transfer module also includes:
[0084] A second identity number setting module, used to set the second identity number of the first intermediate data slice in the data subpacket to the second total number of intermediate data slices in the data subpacket; or set the second identity number of the first intermediate data slice in the data subpacket to the second total number minus 1;
[0085] The second identity number storage module is used to store the second identity number in the first intermediate data slice.
[0086] Optionally, the second identity number storage module includes:
[0087] The second identity number storage submodule is used to store the second identity number in the location information of the first intermediate data slice.
[0088] Optionally, among the data subpackets obtained by segmenting the data packet, the sizes of the first data subpacket to the second to last data subpacket are equal;
[0089] Among the data subpackets obtained by segmenting the data packet, the size of the last data subpacket is less than or equal to the size of the first data subpacket in the data packet.
[0090] Optionally, the sizes of the data slices corresponding to the data packets are equal;
[0091] In each data subpacket obtained by segmenting the data packet, the third number of data slices from the first data subpacket to the second to last data subpacket is equal;
[0092] In each data subpacket obtained by segmenting the data packet, the third number of data slices of the last data subpacket is less than or equal to the third number of data slices of the first data subpacket in the data packet.
[0093] Optionally, the storage capacity of the location information in each data slice corresponding to the data packet is equal; and / or,
[0094] The storage capacity of the forwarding information in each data subpacket obtained by segmenting the data packet is equal; and / or,
[0095] In each data slice corresponding to the data packet, the storage capacity of the data to be transferred is equal; and / or,
[0096] The data subpacket includes: a header data slice, the location information of the header data slice is header information; the forwarding information of the data subpacket is located in the header data slice of the data subpacket.
[0097] Figure 7 is a structural diagram of an electronic device provided by an embodiment of the present invention. Figure 7 The present invention also provides an electronic device, see Figure 7 , including: a processor 501, a memory 502, and a computer program 5021 stored in the memory and executable on the processor, wherein the processor implements the steps of each embodiment of the above-mentioned data transfer when executing the program.
[0098] The present invention also provides a readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the steps of each embodiment of the above-mentioned data transfer method.
[0099] The present invention also provides a computer program product, including instructions or transactions, which, when executed by a processor in an electronic device, enable the electronic device to execute any step of the aforementioned data transfer method embodiments.
[0100] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0101] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0102] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data transmission terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data transmission terminal device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0103] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data transmission terminal device to operate in a predictable manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0104] These computer program instructions can also be loaded onto a computer or other programmable data transmission terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0105] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0106] 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 terminal 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 terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0107] The data transfer method and device, an electronic device and a storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, 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 invention.
Claims
1. A data transfer method, characterized in that: include: Obtain a data sub-packet obtained by splitting the data packet; The data subpacket includes: at least one data slice and forwarding information; the forwarding information includes: forwarding starting point identity information, forwarding end point identity information and routing control information; the routing control information includes: the next output port of the data subpacket; the data slice includes: the position information of the data slice in the data subpacket and the data to be forwarded; the position information includes: one of the header information, the tail information and the intermediate information; Opening a transmission channel of the next output port; After the data slice including the tail information in the data subpacket enters the transmission channel, closing the transmission channel; When only one data subpacket is obtained after data packet slicing, and the data subpacket only includes one data slice, it is transferred in single data slice mode; when at least two data subpackets are obtained after data packet slicing, and each data subpacket includes at least one data slice, it is transferred in multi-data packet mode.
2. The data transfer method according to claim 1, characterized in that: The method further comprises: Splitting a data packet consisting of all data that needs to be transferred from the same transfer starting point to the same transfer end point at the current moment into at least one data sub-packet; Setting the first identity number of the first data subpacket in the constituted data packet to the first total number of data subpackets in the constituted data packet; or setting the first identity number of the first data subpacket in the constituted data packet to the first total number minus 1; The first identity number is stored in the first data sub-packet.
3. The data transfer method according to claim 2, characterized in that: The step of storing the first identity number in the first data sub-packet includes: storing the first identity number in the forwarding information of the first data subpacket; or, The first data subpacket includes: a header data slice, and the location information of the header data slice is the header information; the first identity number is stored in the location information of the header data slice of the first data subpacket.
4. The data transfer method according to claim 1, characterized in that: The data subpacket includes: a header data slice, a tail data slice and at least one intermediate data slice; the location information of the header data slice is header information; the location information of the tail data slice is tail information; the location information of the intermediate data slice is intermediate information; the intermediate data slice includes: a first intermediate data slice, in the data subpacket, the first intermediate data slice is adjacent to the header data slice; the method further includes: Setting the second identity number of the first intermediate data slice in the data subpacket to the second total number of intermediate data slices in the data subpacket; or setting the second identity number of the first intermediate data slice in the data subpacket to the second total number minus 1; The second identity number is stored in the first intermediate data slice.
5. The data transfer method according to claim 4, characterized in that: The storing the second identity number into the first intermediate data slice includes: The second identity number is stored in the location information of the first intermediate data slice.
6. The data transfer method according to claim 1, characterized in that: The sizes of the first data packet to the second to last data packet in each data packet obtained by segmenting the data packet are equal; Among the data subpackets obtained by segmenting the data packet, the size of the last data subpacket is less than or equal to the size of the first data subpacket in the data packet.
7. The data transfer method according to claim 1, characterized in that: The sizes of the data slices corresponding to the data packets are equal; In each data subpacket obtained by segmenting the data packet, the third number of data slices from the first data subpacket to the second to last data subpacket is equal; In each data subpacket obtained by segmenting the data packet, the third number of data slices of the last data subpacket is less than or equal to the third number of data slices of the first data subpacket in the data packet.
8. The data transfer method according to claim 1, characterized in that: The storage capacity of the location information in each data slice corresponding to the data packet is equal; and / or, The storage capacity of the transferred information in each data subpacket obtained by dividing the data packet is equal; and / or, In each data slice corresponding to the data packet, the storage capacity of the data to be transferred is equal; and / or, The data subpacket includes: a header data slice, the location information of the header data slice is the header information; The forwarding information of the data packet is located in the header data slice of the data packet.
9. A data transfer device, characterized in that: include: An acquisition module, used for acquiring a data sub-packet obtained by segmenting a data packet; The data subpacket includes: at least one data slice and forwarding information; the forwarding information includes: forwarding starting point identity information, forwarding end point identity information and routing control information; the routing control information includes: the next output port of the data subpacket; the data slice includes: the position information of the data slice in the data subpacket and the data to be forwarded; the position information includes: one of the header information, the tail information and the intermediate information; An opening module, used for opening the transmission channel of the next output port; A closing module, configured to close the transmission channel after a data slice including the tail information in the data subpacket enters the transmission channel; When only one data subpacket is obtained after data packet slicing, and the data subpacket only includes one data slice, it is transferred in single data slice mode; when at least two data subpackets are obtained after data packet slicing, and each data subpacket includes at least one data slice, it is transferred in multi-data packet mode.
10. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the data transfer method according to any one of claims 1 to 8 when executing the program.
11. A readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the data transfer method according to any one of claims 1 to 8.
12. A computer program product, characterized in that The method comprises instructions, which, when executed by a processor in an electronic device, enable the electronic device to execute the data transfer method according to any one of claims 1 to 8.
