Data forwarding method and apparatus, and electronic device and storage medium
By segmenting data packets and dynamically managing transmission channels, the problem of low data transfer efficiency in mixed demand scenarios is solved, achieving a highly efficient data transmission method suitable for large-scale chip scenarios.
Patent Information
- Application Number
- PCT/CN2025/075092
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-08-19
- Filing Date
- 2025-01-26
- Publication Date
- 2026-02-26
AI Technical Summary
Existing technologies lack data transfer methods suitable for mixed needs, resulting in inefficiency and insufficient parallelism in large data packet transmission scenarios and CPU data transmission scenarios.
The data packets obtained after data packet segmentation contain at least one data slice and forwarding information. The transmission channel is opened and closed based on a single data packet, supporting single data slice and multi-data packet forwarding, which is suitable for large chip scenarios.
It improves the parallelism and forwarding efficiency of the routing network, reduces the time wasted on pathfinding and response packets, and enhances the overall data transmission efficiency.
Smart Images

Figure CN2025075092_26022026_PF_FP_ABST
Abstract
Description
Data transfer method and device, electronic device and storage medium
[0001] The present application claims priority to the Chinese patent application No. 202411140424.8, filed on August 19, 2024, and entitled "A data transfer method, device, electronic device and storage medium", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0002] The present application relates to the technical field of data transmission, in particular to a data transfer method, a data transfer device, an electronic device and a storage medium. BACKGROUND
[0003] Data transfer generally refers to the transmission of data in a routing network, which is an important stage of data transmission.
[0004] Currently, there are two ways of data transfer, the first one is multi-packet mode, which specifically sends a path exploration information packet (or data slice) first to open the transmission channel from the data sending end to the data receiving end and retains the control right of the transmission channel, and the path exploration information packet (or data slice) returns a response information packet to notify the data sending end to start data transmission until all data transmission is completed. The second one is single data slice mode, which specifically each data slice contains complete transfer information, and only one data slice is transmitted at a time, which is directly transferred in the routing network at one time and does not need to open the control right of the transmission channel in advance.
[0005] However, the first mode is mainly used in large data packet transmission scenarios, and the second mode is mainly used in CPU (Central Processing Unit) data transmission scenarios, and there is currently a lack of data transfer mode that can be used in mixed demand scenarios. SUMMARY
[0006] The above description is only a summary of the technical solutions of the present application. In order to more clearly understand the technical means of the present application, the following specific embodiments of the present application can be implemented according to the content of the specification, and in order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the following specific embodiments of the present application are described.
[0007] In view of the above problems, the present application is proposed to provide a data transfer method to overcome the above problems or at least partially solve the above problems, so as to perform data transfer in mixed demand scenarios.
[0008] In a first aspect, the present application provides a data transfer method, comprising:
[0009] The data packet is divided into a data packet segment, the data packet segment includes at least one data slice and transfer information, the transfer information includes transfer start point identity information, transfer end point identity information and route control information, the route control information includes a next output port of the data packet segment, the data slice includes position information of the data slice in the data packet segment and data to be transferred, and the position information includes one of head information, tail information and intermediate information.
[0010] The transmission channel of the next output port is opened.
[0011] After the data slice including the tail information in the data packet segment enters the transmission channel, the transmission channel is closed.
[0012] In a second aspect, the present application provides a data transfer device, comprising:
[0013] The data packet is divided into a data packet segment, the data packet segment includes at least one data slice and transfer information, the transfer information includes transfer start point identity information, transfer end point identity information and route control information, the route control information includes a next output port of the data packet segment, the data slice includes position information of the data slice in the data packet segment and data to be transferred, and the position information includes one of head information, tail information and intermediate information.
[0014] The transmission channel of the next output port is opened.
[0015] After the data slice including the tail information in the data packet segment enters the transmission channel, the transmission channel is closed.
[0016] In a third aspect, the present application provides an electronic device, comprising a processor, a memory and a computer program stored in the memory and executable on the processor, when the processor executes the program, the data transfer method is realized.
[0017] In a fourth aspect, the present application provides a readable storage medium, when the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the data transfer method.
[0018] In a fifth aspect, the present application provides a computer program product, comprising instructions, when the instructions are executed by the processor in the electronic device, the electronic device executes the data transfer method in any one of the preceding aspects.
[0019] The present application includes the following advantages:
[0020] In the present application, the data packet is sliced to obtain a data package, the data package includes at least one data slice and transfer information, in the case that only one data package is obtained after the data packet is sliced, and the data package only includes one data slice, it is a single data slice mode transfer, in the case that at least two data packages are obtained after the data packet is sliced, and each data package includes at least one data slice, it is a multi-data packet mode transfer, therefore, the transfer mode of the present application is suitable for both single data slice mode transfer and multi-data packet mode transfer, that is, it supports flexible data slicing, and can be applied in large chip scenarios with mixed single data slice mode transfer and multi-data packet mode transfer requirements. At the same time, for the multi-data package mode, the data slice including the tail information in the data package is the last data slice of the data package, and the data slice including the tail information in the data package enters the transmission channel, that is, the last data slice of the data package has entered the transmission channel, and there is no data slice in the data package to be transferred for the transmission channel, so the transmission channel is closed. That is, the closing of the transmission channel is judged by whether a single data package still needs the transmission channel, and the transmission channel does not need to be kept until all data slices in the entire data packet are transmitted, thereby making the waiting time of other data packets for the authorization of the transmission channel shorter, the parallel degree of the entire routing network is greatly improved, and the transfer efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.
[0022] FIG. 1 shows a step flowchart of an embodiment of a data transfer method of the present application;
[0023] FIG. 2 shows a schematic diagram of a data packet of the present application;
[0024] FIG. 3 shows a flowchart of a data transfer of the related art;
[0025] FIG. 4 shows a routing network of the present application;
[0026] FIG. 5 shows a step flowchart of another embodiment of a data transfer method of the present application;
[0027] FIG. 6 shows a structural block diagram of an embodiment of a data transfer device of the present application;
[0028] FIG. 7 is a structural diagram of a computing processing device or an electronic device provided by an embodiment of the present application;
[0029] FIG. 8 is a schematic diagram of a storage unit for storing a computer program product according to an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0031] Those skilled in the art should understand that, in the disclosure of the present application, the terms "first", "second", "third", "fourth", "fifth" and the like are only used to distinguish different structures, and do not limit the number, connection relationship and the like of the specific structures; in addition, the orientation or position relationship indicated by "longitudinal", "transverse", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer" and the like is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present application and simplifying the description, and does not indicate or imply that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, therefore the above terms cannot be understood as a limitation on the present application.
[0032] One of the core ideas of the embodiments of the present application is that the data packet is sliced to obtain a data package, the data package includes at least one data slice and transfer information. In the case that only one data package is obtained after the data packet slicing, and the data package only includes one data slice, it is a single data slice mode transfer. In the case that at least two data packages are obtained after the data packet slicing, and each data package includes at least one data slice, it is a multi-data packet mode transfer. Therefore, the transfer mode of the present application is suitable for single data slice mode transfer and multi-data packet mode transfer, that is, it supports flexible data slicing, and can be applied in large chip scenarios with mixed single data slice mode transfer and multi-data packet mode transfer requirements. At the same time, for the multi-data package mode, the data slice including the tail information in the data package is the last data slice of the data package. The data slice including the tail information in the data package enters the transmission channel, that is, the last data slice of the data package has entered the transmission channel. For the transmission channel, there is no data slice in the data package to be transferred, and the transmission channel is closed. That is, the closing of the transmission channel is based on whether a single data package still needs the transmission channel. The transmission channel does not need to be kept until all data slices in the entire data packet are transmitted. Therefore, the waiting time of other data packets for the authorization of the transmission channel is shorter, the parallelism of the entire routing network is greatly improved, and the transfer efficiency is improved.
[0033] Referring to FIG. 1, the data transfer method can specifically include the following steps.
[0034] Step 101, obtaining one data package obtained by slicing a data packet; the data package includes at least one data slice and transfer information; the transfer information includes transfer start point identity information, transfer end point identity information and routing control information; the routing control information includes a next output port of the data package; the data slice includes position information of the data slice in the data package and to-be-transferred data; the position information includes one of head information, tail information and intermediate information.
[0035] The size of a data packet is less than or equal to the size of a data package, and the size of a data slice is less than or equal to the size of a data package. The size of a data packet is not specifically limited, the size of a data package is not specifically limited, and the size of a data slice is not specifically limited. The data packet is a data block transferred in the network on a chip, and is generally an integer multiple of the channel data width of the hardware design. The network on a chip includes a router, which is a basic component of the network on a chip and is used for temporary storage and transfer of data. The execution subject of data transfer in this application can be the router, and the execution subject of step 101 can be a router buffer, which is a logical functional block for temporary storage of data packets, data packages, and data slices in the router hardware. The router buffer can receive and cache data slices sent by upstream routers or designs, generally using a first-in, first-out strategy, and can cache F data slices according to hardware design requirements, where F is a natural number.
[0036] The first number of data packages obtained by slicing the data packet is not specifically limited, and the third number of data slices included in a data package is not specifically limited. For example, slicing the data packet obtains a data package, and the data package includes only one data slice. For another example, slicing the data packet obtains at least two data packages, and each data package includes at least one data slice.
[0037] The transfer information is not specifically limited to a specific location in the data package. The transfer information can include transfer start point identity information, transfer end point identity information, and router control information. The transfer start point identity information represents the identity of the transfer starting point of the data to be transferred, and the transfer end point identity information represents the identity of the end point to which the data to be transferred is to be transferred. The transfer start point identity information can be an encoding domain segment of the transfer start point, and the transfer end point identity information can be an encoding domain segment of the transfer end point. The router control information includes the next output port of the data package, specifically the output port to which the data package needs to be transferred next. The router control information can also include router network control or function related signal domain segments, such as transfer priority, and the router control information is not specifically limited.
[0038] A data slice is the minimum unit of data transferred in a network-on-chip, generally the channel width of hardware design. A data slice includes position information of the data slice in the data packet and data to be transferred, the position information including one of head information, tail information and intermediate information. In the case that the position information of a data slice is head information, the data slice is the first data slice or head data slice in the data packet. In the case that the position information of a data slice is tail information, the data slice is the last data slice or tail data slice in the data packet. In the case that the position information of a data slice is intermediate information, the data slice is an intermediate data slice in the data packet. In the case that a data packet includes a head data slice, intermediate data slices and a tail data slice, the intermediate data slices are between the head data slice and the tail data slice, and the number of the head data slice is one and the number of the tail data slice is one. The data to be transferred refers to at least part of data to be transferred from a transfer starting point to a transfer ending point.
[0039] The innermost dashed line box in FIG. 2 represents a data packet, and the small circles in FIG. 2 represent omissions. For example, referring to FIG. 2, the data packet is divided into A data packets, where A is a natural number greater than 2, the first data packet is data packet 1, the last data packet is data packet A, and at least one intermediate data packet is data packet 2 to data packet A-1. Data packet 1 includes B data slices, where B is a natural number greater than 3. Data slice 1 in the data packet is a head data slice, and the position information of data slice 1 includes head information, or the position information of data slice 1 is position information including head information. Data slice 2 to data slice B-1 in the data packet are intermediate data slices, and the position information of data slice 2 includes intermediate information, or the position information of data slice 2 is position information including intermediate information. Data slice 2 to data slice C-1 in the data packet are intermediate data slices, and the position information of data slice 2 includes intermediate information, or the position information of data slice 2 is position information including intermediate information. Data slice B or data slice C in the data packet is a tail data slice, and the position information of data slice B or data slice C includes tail information, or the position information of data slice B or data slice C is position information including tail information. C is a natural number greater than 3.
[0040] Step 102, opening the transmission channel of the next output port.
[0041] Here, the authorization of the transmission channel of the next output port can be obtained, and the use right of the transmission channel of the next output port can be obtained. The transmission channel of the next output port is opened, and the transmission channel of the next output port can transfer data.
[0042] Step 103, after the data slice including the tail information in the data packet enters the transmission channel, the transmission channel is closed.
[0043] In the present application, at least two data packets are obtained by cutting a data packet, and each data packet includes at least one data slice. The data transfer process of the present application is as follows: the first data packet of the data packet is obtained, the transmission channel of the next output port of the first data packet is opened, and then the head data slice, the middle data slice and the tail data slice are sequentially transferred from the head data slice of the first data packet using the transmission channel. After the tail data slice including the tail information in the first data packet enters the transmission channel, the authorization of the transmission channel is closed, and arbitration logic can be initiated for the second data packet. The data slice including the tail information in the data packet enters the transmission channel, that is, 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 to be transferred, and the transmission channel is closed. That is, the closing of the transmission channel is judged by whether a single data packet still needs the transmission channel. The transmission channel does not need to be kept until all data slices in the entire data packet are transmitted, thereby making the authorization time of the transmission channel for other data packets shorter, greatly improving the parallelism of the entire routing network and improving the transfer efficiency.
[0044] For example, for FIG. 2, if the data packet 1 is obtained in step 101, the transmission channel of the next output port of the data packet 1 is opened, and then the data slice 1, the data slice 2, the data slice 3, …, the data slice B-1 are sequentially transferred from the head data slice of the data packet 1, that is, the data slice 1, using the transmission channel. After the tail data slice B including the tail information in the data packet 1 enters the transmission channel, the authorization of the transmission channel is closed, and arbitration logic can be initiated for the data packet 2. Therefore, after the data packet 1 in the data packet is transferred, other data packets can obtain the use right of the transmission channel, without waiting for all data slices in the data packet to be transferred, thereby making the authorization time of the transmission channel for other data packets shorter, greatly improving the parallelism of the entire routing network and improving the transfer efficiency.
[0045] In the present application, only one data packet is obtained by cutting a data packet, and the data packet only includes one data slice. The data transfer process of the present application is as follows: the data packet is obtained, the position information in the data slice is the head information, and since the data packet 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 packet is opened, and the only one data slice in the data packet enters the transmission channel, and then the transmission channel is closed.
[0046] In summary, the delivery mode of the present application is suitable for single data slice delivery and multi-data packet delivery, that is, it supports flexible data slicing and can be applied in large chip scenarios with mixed single data slice delivery and multi-data packet delivery requirements. At the same time, for multi-data packet delivery, 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 delivered, so the transmission channel is closed. That is, the closing 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 making the authorization time of other data packets waiting for the transmission channel shorter, greatly improving the parallelism of the entire routing network, and improving the delivery efficiency. At the same time, since each data packet contains delivery information, and the closing of the transmission channel is based on whether a single data packet still needs the transmission channel, for multi-data packet delivery, there is no need to additionally send a route discovery information packet and no need to additionally return a response information packet, reducing the time waste caused by the delivery of the route discovery information packet and the response information packet.
[0047] The outermost dashed box in FIG. 3 represents the delivery process of the related art. The small circles in FIG. 3 represent omissions. More specifically, in the large data packet delivery scenario, according to the related art, a route discovery information packet (or data slice) is first sent to open the transmission channel from the data sending end to the data receiving end and to retain control of the transmission channel. The route discovery information packet returns a response information packet to notify the data sending end to start data transmission until completion, and then a release information packet is sent to notify the end of the control of the transmission channel. The related art has the following problems. The additional sending of the route discovery information packet and the return of the response information packet require time to be wasted for transmission, and the transmission channel of the data packet needs to be maintained until the entire data packet is 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.
[0048] To solve the technical problems of the prior art, in the present application, the closing 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 making the authorization time of other data packets waiting for the transmission channel shorter, greatly improving the parallelism of the entire routing network, and improving the delivery efficiency. At the same time, since each data packet contains delivery information, and the closing of the transmission channel is based on whether a single data packet still needs the transmission channel, for multi-data packet delivery, there is no need to additionally send a route discovery information packet and no need to additionally return a response information packet, reducing the time waste caused by the delivery of the route discovery information packet and the response information packet.
[0049] Figure 4 is an example of a routing network of the present application. The main hardware of the routing network shown in Figure 4 can include routing buffers, crossbars, N / W / S direction ports, device ports and arbitration logic, etc. The routing buffer is used to receive and buffer data slices sent by upstream routing or design. Generally, the first-in-first-out strategy is adopted. Depending on the hardware design requirements, F data slices can be buffered, where F is a natural number. The crossbar is a controllable switch channel of multiple data input channels and multiple data output channels. For example, the crossbar of the E direction port in Figure 4 is controlled by the channel opening signal to transfer the data slice sent from the N / W / S direction port and the device port. The arbitration logic selects one data slice for transfer. The arbitration logic can determine that one of the channel request signals of the crossbar of the same direction port simultaneously arriving at the arbitration logic has the right to use the current crossbar according to certain rules. For example, the routing buffers of the device port, the W / S / N direction ports all send the arbitration logic the right to use the crossbar of the E direction port. The arbitration logic determines that the W port receives the channel acquisition signal. In the case that the routing buffer downstream of the E direction port can receive, the channel opening signal controls the crossbar to output the data slice in the W routing buffer in the next clock. In the signal combination, the 'channel request signal' is the signal sent by the routing buffer to the arbitration logic to request the right to use the crossbar. The 'channel acquisition signal' is the signal sent by the arbitration logic to the routing buffer to indicate whether the routing buffer has the right to use the crossbar. The 'channel opening signal' is the signal sent by the arbitration logic to the crossbar to open the authorized channel.
[0050] The specific implementation process of the network routing shown in Figure 4 can be as follows. When the data slice of the first data packet arrives at the routing buffer, the arbitration logic sends the 'channel request signal' according to the routing algorithm and the transfer information to determine which output port. When the arbitration logic acquires the right to use the crossbar of the output port, the arbitration logic receives the 'channel acquisition signal' and prepares to output the first data slice (i.e. the head data slice) in the next clock. At the same time, the arbitration logic sends the 'channel opening signal' to the crossbar to prepare to open the channel of the crossbar corresponding to the output port in the next clock. Under the premise that the downstream routing buffer has space to store the data slice, the current routing is output in the next clock. Subsequently, the authorization of the crossbar channel is maintained, and the intermediate data slices (e.g. the second to B-1th intermediate data slices in Figure 2) of the first data packet containing intermediate information are continuously output under the premise that the downstream routing buffer has capacity. When the tail data slice (e.g. the tail data slice represented by B in Figure 2) of the first data packet containing tail information is to be output, the tail data slice is the last data slice of the first data packet. When the current routing is to be output, the transmission channel authorization of the current data packet (i.e. the first data packet) is ended. At the same time, the arbitration process of the arbitration logic is initiated for the next data packet (i.e. the second data packet).
[0051] Figure 5 shows a flow chart of steps of another embodiment of the data transfer method of the present application. Referring to Figure 5, the data transfer method can include the following steps.
[0052] Step 201, dividing a data packet composed of all data that needs to be transferred from the same transfer starting point to the same transfer ending point at the current time into at least one data sub-packet.
[0053] All data that needs to be transferred from the same transfer starting point to the same transfer ending point at the current time is all data that needs to be transmitted in the current transmission task from the same transfer starting point to the same transfer ending point at the current time. All data that needs to be transferred from the same transfer starting point to the same transfer ending point at the current time is actual effective data that needs to be transferred from the same transfer starting point to the same transfer ending point at the current time. The size of the data packet is not specifically limited. For example, the data packet contains T bits of data. For example, in the example shown in Figure 2, all the data to be transferred in the data sub-packet 1 to the data sub-packet A forms all data that needs to be transferred from the same transfer starting point to the same transfer ending point at the current time.
[0054] Step 202, setting the first identity number of the first data sub-packet in the data packet as the first total number of data sub-packets in the data packet; or setting the first identity number of the first data sub-packet in the data packet as the first total number minus 1.
[0055] The first identity number of the first data sub-packet is used to uniquely determine the first data sub-packet in the data packet. The first identity number of the first data sub-packet in the data packet is the first total number of data sub-packets in the data packet, or the first identity number of the first data sub-packet in the data packet is the first total number minus 1, that is, the first identity number of the first data sub-packet in the data packet and the first total number of data sub-packets in the data packet have a strong association, and the first total number of data sub-packets in the data packet can be accurately determined through the first identity number. The first identity number of the first data sub-packet in the data packet can not only be used to indicate the data sub-packet in the data packet, but also be used to indicate the first total number of data sub-packets in the data packet, thereby saving space and time for the transmission of actual effective data and improving the transfer efficiency.
[0056] For example, for the example shown in FIG. 2, the first total number of data packets in the data packet is A, and here the first identity number of the first data packet in the data packet is set as A or A-1. The first identity number A or A-1 can not only represent that the data packet is the first data packet in the data packet, but also represent that there are A data packets in the data packet. Therefore, the first total number A of data packets in the data packet does not need to be set additionally, which saves space and time for the transmission of actual effective data, and improves the transmission efficiency.
[0057] It should be noted that whether the first identity number is set for the second data packet to the last data packet in the data packet is not limited. For example, the first identity number of each data packet in the data packet is sequentially reduced by 1 from the first data packet. That is, for the example shown in FIG. 2, the first identity number of the first data packet in the data packet is set as A or A-1, the first identity number of the second data packet in the data packet is set as A-1 or A-2, and the first identity number of the A-th data packet in the data packet is set as 1 or 0.
[0058] In step 203, the first identity number is stored in the data packet.
[0059] The first identity number of the first data packet in the data packet is stored in the data packet, which is used to represent that the data packet is the first data packet in the data packet, and the data packet contains the first identity number or the first identity number plus one data packet.
[0060] Optionally, the step 203 can include: storing the first identity number in the transmission information of the data packet; or the data packet includes a head data slice, the position information of the head data slice is the head information, and the first identity number is stored in the position information of the head data slice of the data packet. The first identity number is stored separately from the transmission data, which ensures the accuracy of the transmission data, and the transmission data is easy to obtain at the receiving end.
[0061] Optionally, referring to FIG. 2, the data packet comprises a head data slice, a tail data slice and at least one intermediate data slice. The position information of the head data slice is head information, the position information of the tail data slice is tail information, and the position information of the intermediate data slice is intermediate information. The intermediate data slice comprises a first intermediate data slice (i.e. data slice 2), which is adjacent to the head data slice (i.e. data slice 1) in the data packet. The method can further comprise setting a second identity number of the first intermediate data slice (i.e. data slice 2) in the data packet to a second total number of intermediate data slices in the data packet, or setting the second identity number of the first intermediate data slice (i.e. data slice 2) in the data packet to the second total number minus 1, and storing the second identity number in the first intermediate data slice. Specifically, in a data packet, the head data slice and the tail data slice are both only one and have relatively fixed positions, and only the number of intermediate data slices varies greatly. The second identity number is used to uniquely determine the first intermediate data slice in the data packet. The second identity number of the first intermediate data slice in the data packet is the second total number of intermediate data slices in the data packet, or the second identity number of the first intermediate data slice in the data packet is the second total number minus 1. That is, the second identity number of the first intermediate data slice in the data packet and the second total number of intermediate data slices in the data packet have a strong association. The second total number of intermediate data slices in the data packet is accurately determined through the second identity number. The second identity number of the first intermediate data slice in the data packet can not only be used to accurately represent the first intermediate data slice in the data packet, but also be used to represent the second total number of intermediate data slices in the data packet. Therefore, the second total number of intermediate data slices in the data packet does not need to be additionally set in the intermediate data slice, which saves space and time for the transmission of actual effective data and improves the transmission efficiency.
[0062] For example, in FIG. 2, each of the data packet 1 to the data packet A-1 includes a head data slice (i.e., the data slice 1), a tail data slice (i.e., the data slice B), and at least one intermediate data slice (i.e., the data slice 2 to the data slice B-1). The intermediate data slice includes a first intermediate data slice (i.e., the data slice 2) which is adjacent to the head data slice (i.e., the data slice 1). Each of the data packet 1 to the data packet A-1 includes B-2 intermediate data slices (i.e., the data slice 2 to the data slice B-1). The second identity number of the first intermediate data slice (i.e., the data slice 2) in each of the data packet 1 to the data packet A-1 is set as the second total number B-2 of the intermediate data slices (i.e., the data slice 2 to the data slice B-1) in the data packet 1 to the data packet A-1. The second identity number of the first intermediate data slice (i.e., the data slice 2) in each of the data packet 1 to the data packet A-1 can be used not only to accurately represent the first intermediate data slice (i.e., the data slice 2) in the data packet 1 to the data packet A-1, but also to represent the second total number of the intermediate data slices in the data packet 1 to the data packet A-1. Therefore, the second total number of the intermediate data slices in the data packet 1 to the data packet A-1 does not need to be additionally set in the intermediate data slices, which saves space and time for the transmission of actual effective data and improves the transmission efficiency.
[0063] For another example, in FIG. 2, the data packet A includes a head data slice (i.e., the data slice 1), a tail data slice (i.e., the data slice C), and at least one intermediate data slice (i.e., the data slice 2 to the data slice C-1). The intermediate data slice includes a first intermediate data slice (i.e., the data slice 2) which is adjacent to the head data slice (i.e., the data slice 1). The data packet A includes C-2 intermediate data slices (i.e., the data slice 2 to the data slice C-1). The second identity number of the first intermediate data slice (i.e., the data slice 2) in the data packet A is set as the second total number C-2 or C-3 of the intermediate data slices (i.e., the data slice 2 to the data slice C-1) in the data packet A. The second identity number of the first intermediate data slice (i.e., the data slice 2) in the data packet A can be used not only to accurately represent the first intermediate data slice (i.e., the data slice 2) in the data packet A, but also to represent the second total number of the intermediate data slices in the data packet A. Therefore, the second total number of the intermediate data slices in the data packet A does not need to be additionally set in the intermediate data slices, which saves space and time for the transmission of actual effective data and improves the transmission efficiency. It should be noted that C is a natural number and C is less than or equal to B.
[0064] Optionally, the second identity number can be stored in the position information of the first intermediate data slice (i.e., data slice 2), and the second identity number is stored separately from the to-be-transferred data of the first intermediate data slice, so as to ensure the accuracy of the transferred data and facilitate the obtaining of the transferred data at the receiving end.
[0065] Optionally, referring to FIG. 2, the storage capacities of the first data subpackage (i.e., data subpackage 1) to the penultimate data subpackage (i.e., data subpackage A-1) are equal, and the processing modes of the first data subpackage to the penultimate data subpackage are compatible, so that the transfer efficiency is high. The storage capacity of the last data subpackage (i.e., data subpackage A) is less than or equal to the storage capacity of the first data subpackage (i.e., data subpackage 1) in the data package, and the data slicing mode can be applied to a wider range of data sizes of data packages.
[0066] Optionally, referring to FIG. 2, the storage capacities of the data slices corresponding to the data package are equal, and the operations on the data slices are compatible, so that the transfer efficiency is high. The third number of data slices of the first data subpackage (i.e., data subpackage 1) to the penultimate data subpackage (i.e., data subpackage A-1) is equal, such as B in FIG. 2, and the operations on the first data subpackage to the penultimate data subpackage are compatible, so that the transfer efficiency is high. The third number of data slices of the last data subpackage (i.e., data subpackage A) is C in FIG. 2, which is less than or equal to the third number of data slices of the first data subpackage (i.e., data subpackage 1) in the data package, which is B in FIG. 2. That is, C≤B, and in the case that C and B are not equal, the specific difference between C and B is not limited. This mode can be applied to a wider range of data sizes of data packages.
[0067] Optionally, referring to FIG. 2, the storage capacities of the position information in the data slices corresponding to the data package are equal, and the processing modes of the position information in the data slices corresponding to the data package are approximately the same, so that the transfer efficiency is high and alignment is facilitated. For example, in FIG. 2, the storage capacities of the position information in the data slices corresponding to the data package are all D bits, such as 2 bits.
[0068] Optionally, referring to FIG. 2, the storage capacities of the transfer information in the data subpackages obtained by slicing the data package are equal, and the processing modes of the transfer information in the data subpackages obtained by slicing the data package are approximately the same, so that the transfer efficiency is high and alignment is facilitated.
[0069] Optionally, referring to FIG. 2, the storage capacity of the data to be transferred in each data slice corresponding to the data packet is equal, and the processing manner of the data to be transferred in each data slice corresponding to the data packet is substantially the same, so that the transfer efficiency is high and alignment is facilitated.
[0070] Optionally, referring to FIG. 2, the data packet includes a head data slice (i.e., data slice 1), and the position information of the head data slice is head information, that is, the head data slice is the first data slice in the data packet. The transfer information of the data packet is located in the head data slice (i.e., data slice 1) of the data packet. Specifically, in the present application, the transfer information of the data packet is set in the head data slice (i.e., data slice 1) of the data packet, which facilitates routing.
[0071] Step 204: obtaining a data packet obtained by slicing a data packet; the data packet includes at least one data slice and transfer information; the transfer information includes transfer start point identity information, transfer end point identity information and routing control information; the routing control information includes a next output port of the data packet; the data slice includes position information of the data slice in the data packet and data to be transferred; the position information includes one of head information, tail information and intermediate information.
[0072] Step 205: opening a transmission channel of the next output port.
[0073] Step 206: closing the transmission channel after the data slice including the tail information in the data packet enters the transmission channel.
[0074] Here, steps 204 to 206 can refer to the related description of the foregoing steps 101 to 103, and achieve the same or similar beneficial effects. To avoid repetition, the details are not described here.
[0075] In summary, the data transfer method provided by the present application is applicable to single data slice mode transfer and multiple data packet mode transfer, that is, it supports flexible data slices and can be applied in large chip scenarios with mixed single data slice mode transfer and multiple data packet mode transfer requirements. At the same time, according to the chip design requirements, the data packet and its data slices can be dynamically and flexibly sliced.
[0076] It should be noted that at the data receiving end, the actual effective data can be restored by using a processing manner corresponding to the transfer method, and no specific limitation is made.
[0077] It should be noted that, for the method embodiments, the series of acts combined are described for simplicity, but those skilled in the art should know that the application embodiments are not limited to the order of the acts described, because according to the application embodiments, certain steps can be performed in other order or at the same time. Secondly, those skilled in the art should know that the embodiments described in the specification are all preferred embodiments, and the acts involved are not necessarily the application embodiments.
[0078] Referring to FIG. 6, FIG. 6 shows a structural block diagram of an embodiment of a data forwarding device of the application, which can specifically include the following modules:
[0079] The obtaining module 301 is configured to obtain a data packet segment obtained by segmenting a data packet; the data packet segment includes at least one data slice and forwarding information; the forwarding information includes forwarding start point identity information, forwarding end point identity information and routing control information; the routing control information includes a next output port of the data packet segment; the data slice includes position information of the data slice in the data packet segment and data to be forwarded; the position information includes one of head information, tail information and intermediate information;
[0080] The opening module 302 is configured to open a transmission channel of the next output port;
[0081] The closing module 303 is configured to close the transmission channel after the data slice including the tail information in the data packet segment enters the transmission channel.
[0082] Optionally, the device further includes a segmenting module configured to segment a data packet composed of all data to be forwarded from a same forwarding start point to a same forwarding end point at a current time into at least one data packet segment;
[0083] The first identity number setting module is configured to set a first identity number of a first data packet segment in the data packet as a first total number of data packet segments in the data packet; or, set the first identity number of the first data packet segment in the data packet as the first total number minus 1;
[0084] The first identity number storage module is configured to store the first identity number in the data packet segment.
[0085] Optionally, the first identity number storage module is specifically configured to store the first identity number in the forwarding information of the data packet segment; or,
[0086] The data packet segment includes a head data slice, and the position information of the head data slice is head information; the first identity number storage module is specifically configured to store the first identity number in the position information of the head data slice of the data packet segment.
[0087] Optionally, the data packet 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 head information; the position information of the tail data slice is tail information; the position information of the intermediate data slice is intermediate information; the intermediate data slice includes: a first intermediate data slice, in the data packet, the first intermediate data slice is adjacent to the head data slice; the data transfer module further includes:
[0088] a second identity number setting module, configured to set the second identity number of the first intermediate data slice in the data packet as a second total number of intermediate data slices in the data packet; or, set the second identity number of the first intermediate data slice in the data packet as the second total number minus 1;
[0089] a second identity number storage module, configured to store the second identity number into the first intermediate data slice.
[0090] Optionally, the second identity number storage module includes:
[0091] a second identity number storage submodule, configured to store the second identity number into the position information of the first intermediate data slice.
[0092] Optionally, in each data packet obtained by cutting the data packet, the size of the first data packet to the second last data packet is equal.
[0093] In each data packet obtained by cutting the data packet, the size of the last data packet is less than or equal to the size of the first data packet in the data packet.
[0094] Optionally, the size of each data slice corresponding to the data packet is equal.
[0095] In each data packet obtained by cutting the data packet, the third number of data slices of the first data packet to the second last data packet is equal.
[0096] In each data packet obtained by cutting the data packet, the third number of data slices of the last data packet is less than or equal to the third number of data slices of the first data packet in the data packet.
[0097] Optionally, the storage capacity of the position information in each data slice corresponding to the data packet is equal; and / or,
[0098] In each data packet obtained by cutting the data packet, the storage capacity of the transfer information is equal; and / or,
[0099] The storage capacity of the data to be transferred in each data slice corresponding to the data packet is equal; and / or,
[0100] The data packet includes a head data slice, and position information of the head data slice is head information; and the transfer information of the data packet is located in the head data slice of the data packet.
[0101] The present application further provides a readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute steps of each embodiment of the data transfer method.
[0102] The present application further provides a computer program product, including instructions, when the instructions are executed by a processor in an electronic device, the electronic device executes steps of any one of the foregoing embodiments of the data transfer method.
[0103] Each embodiment in the present specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other.
[0104] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, device, or computer program product. Therefore, the embodiments of the present application can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can be in the form of a computer program product implemented on one or more computer usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
[0105] The embodiments of the present application are described with reference to flowcharts and / or block diagrams according to the method, terminal device (system), and computer program product of the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of the flows and / or blocks in the flowchart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data transmission terminal device processor to produce a machine, so that the instructions executed by the computer or other programmable data transmission terminal device processor produce a device for implementing the functions specified in one or more flows in the flowchart and / or one or more blocks in the block diagram.
[0106] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart or flowsheets and / or block or blocks of the block diagrams.
[0107] These program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart or flowsheets and / or block or blocks of the block diagrams.
[0108] While preferred embodiments of the application have been described, those skilled in the art will recognize that additional modifications and variations can be made thereto without departing from the scope of the application. It is therefore intended that the appended claims cover all such modifications and variations as fall within the scope of the application.
[0109] Embodiments of various components of the present application can be implemented in hardware, software, or a combination thereof, and can be implemented with one or more computer programs or code segments. It will be appreciated that one or more computer programs or code segments that, when executed by one or more processors, can provide the functionality described herein can be stored in a computer-readable medium. Computer-readable media includes both computer storage media and communication media. Storage media includes volatile and non-volatile, removable and non-removable media implemented in any technology for the purpose of storing information such as computer readable instructions, data structures, program modules or other data. The computer storage media includes, but is not limited to, RAM, ROM, EEPROM, solid state drives (SSDs), flash memory, phase-change memory ("PCM"), or other memory technology, CD-ROM, digital versatile disks ("DVD") or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information. Communication media includes any medium that can be used to carry desired program code in the form of computer readable instructions, data structures or other data, including, but not limited to, the Internet, wireless media, and local- or wide-area computer networks.
[0110] For example, Fig. 7 shows a computing processing device or an electronic device which can implement the method according to the present application. The computing processing device conventionally comprises a processor 1010 and a computer program product or a computer readable medium in the form of a memory 1020. The memory 1020 can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. The memory 1020 has a storage space 1030 for program codes 1031 for performing any of the method steps in the above described methods. For example, the storage space 1030 for program codes can comprise individual program codes 1031 for implementing the various steps in the above described methods, respectively. These program codes can be read from or written to one or more computer program products. These computer program products comprise program code carriers such as hard disks, compact disks (CDs), memory cards, or floppy disks. Such computer program products are typically portable or stationary memory units as described with reference to Fig. 8. The memory unit can have a storage section, a storage space, etc. arranged similarly to the memory 1020 in the computing processing device of Fig. 7. The program codes can be compressed, for example, in a suitable form. Typically, the memory unit comprises computer readable codes 1031', i.e. codes which can be read by a processor such as 1010, which, when run by the computing processing device, cause the computing processing device to perform the various steps in the above described methods.
[0111] Finally, it should be noted that the above embodiments are merely intended to illustrate the technical solutions of the present application, but not to limit it; even though the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method of data transfer, wherein, The method comprises: obtaining a data packet segment obtained by slicing a data packet; the data packet segment comprises at least one data slice and transfer information; the transfer information comprises transfer start point identity information, transfer end point identity information and route control information; the route control information comprises a next output port of the data packet segment; the data slice comprises position information of the data slice in the data packet segment and data to be transferred; the position information comprises one of head information, tail information and intermediate information; opening a transmission channel of the next output port; after a data slice including the tail information in the data packet segment enters the transmission channel, closing the transmission channel; in a case where only one data packet segment is obtained after slicing a data packet and the data packet segment comprises only one data slice, the data is transferred in a single data slice mode; in a case where at least two data packet segments are obtained after slicing a data packet and each data packet segment comprises at least one data slice, the data is transferred in a multiple data packet mode.
2. The data forwarding method of claim 1, wherein, The method further comprises: slicing a data packet comprising all data to be transferred from a same transfer start point to a same transfer end point at a current time into at least one data packet segment; setting a first identity number of a first data packet segment in the data packet as a first total number of data packet segments in the data packet; or setting the first identity number of the first data packet segment as the first total number minus 1; storing the first identity number in the first data packet segment.
3. The data forwarding method of claim 2, wherein, The storing of the first identity number in the first data packet segment comprises: storing the first identity number in transfer information of the first data packet segment; or the first data packet segment comprises a head data slice, and the position information of the head data slice is head information; the first identity number is stored in the position information of the head data slice of the first data packet segment.
4. The data forwarding method of claim 1, wherein, The data packet segment comprises a head data slice, a tail data slice and at least one intermediate data slice; the position information of the head data slice is head information; the position information of the tail data slice is tail information; the position information of the intermediate data slice is intermediate information; the intermediate data slice comprises a first intermediate data slice, which is adjacent to the head data slice in the data packet segment; the method further comprises: setting a second identity number of the first intermediate data slice in the data packet segment as a second total number of intermediate data slices in the data packet segment; or setting the second identity number of the first intermediate data slice in the data packet segment as the second total number minus 1; storing the second identity number in the first intermediate data slice.
5. The data forwarding method of claim 4, wherein, The storing of the second identity number in the first intermediate data slice comprises: storing the second identity number in the position information of the first intermediate data slice.
6. The data forwarding method of claim 1, wherein, In each data packet segment obtained by slicing a data packet, sizes of a first data packet segment to a penultimate data packet segment are equal; in each data packet segment obtained by slicing a data packet, a size of a last data packet segment is less than or equal to a size of a first data packet segment in the data packet.
7. The data forwarding method of claim 1, wherein, The size of each data slice corresponding to the data packet is equal; The third number of data slices of the first data packet to the second last data packet in each data packet obtained by the data packet segmentation is equal; The third number of data slices of the last data packet in each data packet obtained by the data packet segmentation is less than or equal to the third number of data slices of the first data packet in the data packet.
8. The data forwarding method of claim 1, wherein, The storage capacity of the position information in each data slice corresponding to the data packet is equal; And / or, The storage capacity of the transfer information in each data packet obtained by the data packet segmentation is equal; And / or, The storage capacity of the data to be transferred in each data slice corresponding to the data packet is equal; And / or, The data packet includes a head data slice, and the position information of the head data slice is head information; The transfer information of the data packet is located in the head data slice of the data packet.
9. A data transfer apparatus, wherein, Comprising: An acquisition module configured to acquire a data packet obtained by data packet segmentation; The data packet includes at least one data slice and transfer information; the transfer information includes transfer start point identity information, transfer end point identity information and routing control information; the routing control information includes a next output port of the data packet; the data slice includes position information of the data slice in the data packet and data to be transferred; the position information includes one of head information, tail information and intermediate information; An opening module configured to open a 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 packet enters the transmission channel; In the case that only one data packet is obtained after data packet slicing, and the data packet includes only one data slice, it is a single data slice mode transfer; in the case that at least two data packets are obtained after data packet slicing, and each data packet includes at least one data slice, it is a multiple data packet mode transfer.
10. An electronic device, comprising: Comprising: 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, wherein, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the data transfer method according to any one of claims 1 to 8.
12. A computer program product, wherein, Comprising instructions, when the instructions are executed by the processor in the electronic device, the electronic device executes the data transfer method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Data subpackage transmission method and device, computer equipment and storage medium
CN112468407A
Data forwarding method and device, electronic equipment and storage medium
CN118677858A
Data enqueuing method, data dequeuing method, and queue management circuit
US20180159802A1
Switching system
WO2022174408A1
Methods and apparatuses for slice scheduling
WO2024036460A1