Packet Processing Method and Related Devices
By processing the context information and data packets of multi-level context structure data packets in parallel in a multi-level pipeline architecture, the problem of low packet processing efficiency in the prior art is solved, and efficient packet processing is achieved.
Patent Information
- Application Number
- CN202211119440.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-14
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2042-09-14
AI Technical Summary
In the prior art, the processing efficiency of multi-level context structure data packets is low, resulting in large processing delays and seriously reducing the rate of data packet processing.
It adopts a multi-level flow structure, including context processing flow and data packet processing flow, and improves the efficiency of data packet processing by processing context information and data packets in multiple contexts in parallel.
Parallel processing of multi-level context structure packets is realized, which significantly improves the efficiency of packet processing and reduces processing delay.
Smart Images

Figure CN115499099B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer communication technologies, and particularly relates to a data packet processing method and related devices. Background Art
[0002] In the field of computer communication, when a sender sends a long string of data to the opposite end, it needs to be divided into packets. Generally, packets for processing consecutive tasks maintain a context data locally. The processing flow of data packets mainly includes two steps: reading the context, processing the packet information, and refreshing the context. The subsequent data packet needs to use the context information updated by the previous data packet.
[0003] When information related to multiple data packets needs to be stored in the context, a two - level context structure is used. The first - level context stores the current data packet processing status and the pointer information Ci of the second - level context, and the second - level context stores information related to specific data packets. For such a two - level context, the processing flow is generally divided into three steps: reading the pointer Ci in the first - level context, using Ci to read the second - level context, and processing the packet information and refreshing Ci in the first - level context. However, these three steps need to be executed serially, and only after the three steps are serially completed can the subsequent packets be processed. For example, please refer to Figure 1 , Figure 1 which is a schematic diagram of the process of processing data packets in the normal state in the prior art. The first step is to read the first - level context information to obtain Ci, the second step is to use Ci to read the second - level context information, and the third step is to process the data packet by combining the first - level context and the second - level context and update Ci in the first - level context, and then continue to process the subsequent data packets according to the above process. Please refer to Figure 2 , Figure 2 which is a schematic diagram of the process of processing data packets in the packet - loss state in the prior art. In the third step, it is found that a packet is lost, Ci and Expect_psn (predicted data packet) are not updated, and a repeated request is sent. When the repeated response arrives, the correct processing continues. Obviously, due to serial processing, the subsequent task must wait for the previous task to be completed before it can start processing, and the entire processing flow has a large delay, seriously reducing the rate of processing data packets.
[0004] Therefore, how to effectively improve the processing efficiency of data packets with a multi - level context structure is an urgent problem for those skilled in the art to solve. Summary of the Invention
[0005] The purpose of this application is to provide a data packet processing method, which can effectively improve the processing efficiency of data packets with a multi - level context structure; another purpose of this application is to provide a multi - level pipelined architecture, a data packet processing device, an electronic device, and a computer - readable storage medium, all of which have the above - mentioned beneficial effects.
[0006] In a first aspect, the present application provides a data packet processing method, which is applied to a multi-stage pipeline architecture. The multi-stage pipeline architecture includes a context processing pipeline and a data packet processing pipeline. The last-stage pipeline in the multi-stage pipeline architecture is the data packet processing pipeline, and the other pipelines in the multi-stage pipeline architecture except the last-stage pipeline are the context processing pipelines. The method includes:
[0007] Determine the multi-stage context corresponding to the current data packet. The number of stages of the multi-stage context is the same as the number of stages of the context processing pipeline;
[0008] Use the context processing pipeline to obtain the context information of the corresponding-stage context. The context information includes the content data of the current-stage context;
[0009] Use the data packet processing pipeline to process the current data packet according to the content data of each stage of context.
[0010] Optionally, the context information further includes the pointer data of the next-stage context. The step of using the context processing pipeline to obtain the context information of the corresponding-stage context includes:
[0011] For each context processing pipeline, use the current context processing pipeline to determine the current-stage context corresponding to the current context processing pipeline according to the pointer data obtained by the previous-stage context processing pipeline;
[0012] Read and obtain the context information from the current-stage context.
[0013] Optionally, after using the data packet processing pipeline to process the current data packet according to the content data of each stage of context, it further includes:
[0014] Use the data packet processing pipeline to update the pointer data in each stage of context.
[0015] Optionally, the context information further includes the current prediction state;
[0016] The step of using the data packet processing pipeline to process the current data packet according to the content data of each stage of context includes:
[0017] When the current prediction state is the normal processing state, use the data packet processing pipeline to process the current data packet according to the content data of each stage of context;
[0018] When the current prediction state is the fast rollback state, use the data packet processing pipeline to roll back to process the previous data packet;
[0019] When the current prediction state is the retransmission error deletion state, use the data packet processing pipeline to delete the error data packets, and process the retransmitted data packets when the retransmitted data packets are received.
[0020] Optionally, the pointer data is the sum of the prediction factor of the current-level context and the rollback factor of the next-level context. The prediction factor is the initial prediction pointer of the current-level context, and the rollback factor is the difference between the actual pointer and the rollback pointer of the next-level context.
[0021] The updating of the pointer data in each level of context by using the data packet processing pipeline includes:
[0022] When the current prediction state is the normal processing state, use the data packet processing pipeline to update the pointer data to the pointer data in the multi-level context corresponding to the next data packet.
[0023] When the current prediction state is the fast rollback state or the retransmission error deletion state, use the context processing pipeline to pause the update of the initial prediction pointer, and use the data packet processing pipeline to reset the rollback pointer to the initial prediction pointer.
[0024] When the current prediction state is updated from the retransmission error deletion state to the normal processing state, use the context processing pipeline to resume the update of the initial prediction pointer.
[0025] Optionally, the method further includes:
[0026] When a packet loss is detected by using the data packet processing pipeline, update the normal processing state to the fast rollback state.
[0027] When the retransmitted data packet is received by using the context processing pipeline, update the fast rollback state to the retransmission error deletion state.
[0028] When the retransmitted data packet is received by using the data packet processing pipeline, update the retransmission error deletion state to the normal processing state.
[0029] In a second aspect, the present application also discloses a multi-level pipeline architecture, including a context processing pipeline and a data packet processing pipeline. The last-level pipeline in the multi-level pipeline architecture is the data packet processing pipeline, and the other pipelines in the multi-level pipeline architecture except the last-level pipeline are the context processing pipelines.
[0030] Each of the context processing pipelines is used to obtain context information of the corresponding-level context after determining the multi-level context corresponding to the current data packet; wherein, the context information includes the content data of the current-level context, and the number of levels of the multi-level context is the same as the number of levels of the context processing pipeline.
[0031] The data packet processing pipeline is used to process the current data packet according to the content data of each level of context.
[0032] In a third aspect, the present application also discloses a data packet processing device applied to a multi-level pipeline architecture. The multi-level pipeline architecture includes a context processing pipeline and a data packet processing pipeline. The last-level pipeline in the multi-level pipeline architecture is the data packet processing pipeline, and the other pipelines except the last-level pipeline in the multi-level pipeline architecture are the context processing pipelines. The device includes:
[0033] A determination module, configured to determine the multi-level context corresponding to the current data packet, where the number of levels of the multi-level context is the same as the number of levels of the context processing pipeline;
[0034] An acquisition module, configured to use the context processing pipeline to obtain context information of the corresponding-level context, where the context information includes the content data of the current-level context;
[0035] A processing module, configured to use the data packet processing pipeline to process the current data packet according to the content data of each level of context.
[0036] In a fourth aspect, the present application also discloses an electronic device, including:
[0037] A memory, configured to store a computer program;
[0038] A processor, configured to implement the steps of any of the above-mentioned data packet processing methods when executing the computer program.
[0039] In a sixth aspect, the present application also discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned data packet processing methods are implemented.
[0040] Applying the technical solution provided by the present application, for a data packet with a multi-level context structure, a multi-level pipeline architecture is created. This multi-level pipeline architecture includes the last-level pipeline of the context processing pipeline and other-level pipelines of the data packet processing pipeline. Moreover, the number of context levels of the multi-level context is consistent with the number of pipeline levels of the context processing pipeline, and they correspond to each other. Thus, the context information of the corresponding-level context can be obtained by using the context processing pipeline, and the data packet can be processed by using the data packet processing pipeline, thereby realizing the parallel processing of the multi-level pipeline and effectively improving the processing efficiency of the data packet with the multi-level context structure. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] To more clearly illustrate the technical solutions in the prior art and the embodiments of the present application, the drawings required for description in the prior art and the embodiments of the present application will be briefly introduced below. Of course, the following drawings related to the embodiments of the present application only describe a part of the embodiments in the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to the provided drawings, and the other obtained drawings also fall within the protection scope of the present application.
[0042] Figure 1 It is a schematic flowchart of processing a data packet in the normal state in the prior art;
[0043] Figure 2 It is a schematic flowchart of processing a data packet in the packet loss state in the prior art;
[0044] Figure 3 It is a schematic flowchart of a data packet processing method provided by the present application;
[0045] Figure 4 It is a schematic flowchart of another data packet processing method provided by the present application;
[0046] Figure 5 It is a schematic structural diagram of a multi-level pipeline architecture provided by the present application;
[0047] Figure 6 It is a schematic structural diagram of a data packet processing device provided by the present application;
[0048] Figure 7 It is a schematic structural diagram of an electronic device provided by the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0049] The core of the present application is to provide a data packet processing method, which can effectively improve the processing efficiency of data packets with a multi-level context structure; another core of the present application is to provide a multi-level pipeline architecture, a data packet processing device, an electronic device and a computer-readable storage medium, all of which have the above beneficial effects.
[0050] In order to describe the technical solutions in the embodiments of the present application more clearly and completely, the following will introduce the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part 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 efforts shall fall within the protection scope of the present application.
[0051] The embodiment of the present application provides a data packet processing method.
[0052] Please refer to Figure 3 , Figure 3 which is a schematic flowchart of a data packet processing method provided by the present application. This data packet processing method is applied to a multi-stage pipeline architecture. The multi-stage pipeline architecture includes a context processing pipeline and a data packet processing pipeline. The last-stage pipeline in the multi-stage pipeline architecture is the data packet processing pipeline, and the other pipelines except the last-stage pipeline in the multi-stage pipeline architecture are context processing pipelines. This data packet processing method may include the following S101 to S103.
[0053] First of all, it should be noted that the data packet processing method provided by the embodiment of the present application is applied to a multi-stage pipeline architecture, that is, the implementation processes of S101 and S103 are executed by the multi-stage pipeline architecture. Specifically, the multi-stage pipeline architecture includes a context processing pipeline and a data packet processing pipeline. Among them, the data packet processing pipeline is the last-stage pipeline in the multi-stage pipeline architecture, that is, the last pipeline. All other pipelines except the last-stage pipeline are context processing pipelines. Obviously, the context processing pipeline is mainly used to perform processing operations on the context, and the data packet pipeline is mainly used to perform processing operations on the data packet.
[0054] S101: Determine the multi-level context corresponding to the current data packet. The number of levels of the multi-level context is the same as the number of levels of the context processing pipeline;
[0055] The purpose of this step is to realize the determination of the multi-level context. This multi-level context is the multi-level context corresponding to the current data packet, and this current data packet is the data packet that needs to be processed. Among them, the number of levels of the multi-level context is consistent with the number of levels of the context processing pipeline, and the two correspond to each other. One context processing pipeline is used to process one level of context. It can be understood that the processing operation for the context is mainly to read various data information in the context for subsequent data packet processing.
[0056] S102: Use the context processing pipeline to obtain the context information of the corresponding-level context. The context information includes the content data of the current-level context;
[0057] This step aims to obtain context information. After determining the multi-level context corresponding to the current data packet, the context information of the corresponding-level context can be obtained by using the context processing pipeline. That is to say, the context information of the first-level context can be obtained by using the first-level pipeline (i.e., the first-level context processing pipeline) in the multi-level pipeline architecture, and the context information of the second-level context can be obtained by using the second-level pipeline (i.e., the second-level context processing pipeline), and so on, until all levels of context processing pipelines are executed to obtain the context information of all levels of context in the multi-level context. Among them, the context information mainly includes the content data of the corresponding-level context (i.e., the current-level context corresponding to the current-level context processing pipeline), and this content data is used to implement the processing of the current data packet. Of course, the context information is not limited to this, and other types of data information in the context can also be obtained according to actual needs, and this application does not make any limitations in this regard.
[0058] S103: Use the data packet processing pipeline to process the current data packet according to the content data of each level of context.
[0059] This step aims to implement the processing of the current data packet. After obtaining the content data of each level of context based on the context processing pipelines of each level, the last-level pipeline in the multi-level pipeline architecture, that is, the above-mentioned data packet processing pipeline, can be used to process the current data packet according to the content data of each level of context obtained above, so as to realize the parallel processing of data packets based on the multi-level pipeline architecture.
[0060] It can be seen that the data packet processing method provided by the embodiments of this application creates a multi-level pipeline architecture for data packets with a multi-level context structure. This multi-level pipeline architecture includes the last-level pipeline as the context processing pipeline and other-level pipelines as the data packet processing pipeline, and the number of context levels of the multi-level context is the same as the number of pipeline levels of the context processing pipeline, and the two correspond to each other. Therefore, the context information of the corresponding-level context can be obtained by using the context processing pipeline, and the data packet can be processed by using the data packet processing pipeline, so as to realize the parallel processing of the multi-level pipeline and effectively improve the processing efficiency of the data packets with a multi-level context structure.
[0061] In an embodiment of this application, the context information may further include pointer data of the next-level context. The above-mentioned step of using the context processing pipeline to obtain the context information of the corresponding-level context may include the following steps:
[0062] For each context processing pipeline, use the current context processing pipeline to determine the current-level context corresponding to the current context processing pipeline according to the pointer data obtained by the previous-level context processing pipeline;
[0063] Read and obtain the context information from the current-level context.
[0064] The embodiment of the present application provides a method for implementing the acquisition of context information. Specifically, each level of context may further include pointer data of the next-level context. On this basis, for each level of context processing pipeline, when acquiring the context information of the corresponding level of context, it may first determine the current-level context corresponding to the current context processing pipeline according to the pointer data obtained from the previous-level context processing pipeline of the current-level context processing pipeline (this pointer data is the pointer information of the current-level context corresponding to the current context processing pipeline, which is obtained by the previous-level context processing pipeline reading from the previous-level context), and read from this current-level context to obtain context information including the content data of the current-level context and the pointer data of the next-level context.
[0065] In an embodiment of the present application, after the above-mentioned use of the data packet processing pipeline to process the current data packet according to the content data of each level of context, the following steps may further be included:
[0066] Use the data packet processing pipeline to update the pointer data in each level of context.
[0067] The embodiment of the present application aims to implement the update operation of the pointer data of each level of context. It can be understood that the current multi-level context corresponds to the current data packet, so the pointer data therein also corresponds to the current data packet. After the current data packet is processed, the pointer data in the multi-level context can be updated to the pointer data corresponding to the next data packet, so as to continue to process the next data packet.
[0068] In an embodiment of the present application, the context information may further include the current prediction state;
[0069] The above-mentioned use of the data packet processing pipeline to process the current data packet according to the content data of each level of context may include the following steps:
[0070] When the current prediction state is the normal processing state, use the data packet processing pipeline to process the current data packet according to the content data of each level of context;
[0071] When the current prediction state is the fast rollback state, use the data packet processing pipeline to roll back to process the previous data packet;
[0072] When the current prediction state is the retransmission error correction state, use the data packet processing pipeline to delete the error data packet and process the retransmission data packet when the retransmission data packet is received.
[0073] The embodiment of the present application provides a data packet processing method based on a data packet processing pipeline. Specifically, each level of context may further include the current prediction state of the data packet, and the current prediction state can be updated in real time during the data packet processing based on a multi-level pipeline architecture, so that different forms of data packet processing can be performed for different data packet processing prediction states. Among them, the current prediction state can be divided into a normal processing state, a fast rollback state, and a retransmission error deletion state. The normal processing state is the normal transmission state of the data packet, the fast rollback state is the packet loss state, and the retransmission error deletion state is the state of obtaining the correct retransmitted packet and deleting the error packet.
[0074] In the implementation process, if the current prediction state is the normal processing state, it means that the current data packet transmission is normal, and the data packet processing pipeline can directly perform normal processing on the current data packet according to the content data of each level of context; if the current prediction state is the fast rollback state, the data packet processing pipeline can be used to directly roll back to the processing state of the previous data packet, and no longer process the current data packet until the data packet transmission returns to normal, and then continue the normal data packet processing operation; if the current prediction state is the retransmission error deletion state, it is necessary to first use the data packet processing pipeline to sequentially delete the error data packets during the transmission process until the correct retransmitted data packet is received, and then continue to perform normal processing operations on it. Thus, different forms of data packet processing are realized for different data packet processing prediction states.
[0075] In an embodiment of the present application, the pointer data is the sum of the prediction factor of the current level of context and the rollback factor of the next level of context. The prediction factor is the initial prediction pointer of the current level of context, and the rollback factor is the difference between the actual pointer and the rollback pointer of the next level of context;
[0076] The above-mentioned use of the data packet processing pipeline to update the pointer data in each level of context may include the following steps:
[0077] When the current prediction state is the normal processing state, use the data packet processing pipeline to update the pointer data to the pointer data in the multi-level context corresponding to the next data packet;
[0078] When the current prediction state is the fast rollback state or the retransmission error deletion state, use the context processing pipeline to pause the update of the initial prediction pointer, and use the data packet processing pipeline to reset the rollback pointer to the initial prediction pointer;
[0079] When the current prediction state is updated from the retransmission error deletion state to the normal processing state, use the context processing pipeline to resume the update of the initial prediction pointer.
[0080] The embodiment of the present application provides a method for updating pointer data based on a data packet processing pipeline. First, the pointer data in each level of context is specifically the predicted pointer of the next-level context of the current-level context. Different from the actual pointer, this predicted pointer is composed of the prediction factor (preceding-level factor) of the current-level context and the rollback factor (succeeding-level factor) of the next-level context, which is the sum of the two. Among them, the prediction factor is the initial predicted pointer of the current-level context and can be updated in real time by the context processing pipeline; the rollback factor is the difference between the actual pointer and the rollback pointer of the next-level context, and both can be updated in real time by the data packet processing pipeline. Moreover, in the normal processing state, the initial predicted pointer and the rollback pointer are equal, and the predicted pointer can be kept equal to the actual pointer. Thus, by splitting the context that depends on the preceding and succeeding levels into the preceding-level factor and the succeeding-level factor, and then using the characteristic that the preceding-level factor is not sensitive to real-time of the succeeding-level factor, the serial processing operation is split into a high-speed structure with parallel pipelines for the preceding and succeeding levels, and at the same time, data consistency can also be satisfied, thereby realizing continuous data packet pipeline processing based on preceding-level context prediction and succeeding-level fast error correction.
[0081] Then, in the process of processing data packets based on the data packet processing pipeline, the implementation process of updating the pointer data in each level of context is as follows: If the current prediction state is the normal processing state, it means that there is no abnormality in the current data packet transmission, and the data packet processing pipeline can directly process the current data packet according to the content data of each level of context. After that, since the next data packet needs to be processed, the pointer data can be updated to the pointer data of the multi-level context corresponding to the next data packet to facilitate the processing of the next data packet; If the current prediction state is the fast rollback state or the retransmission and error deletion state, the data packet processing pipeline can be directly rolled back to the processing state of the previous data packet without processing the current data packet. To achieve fast rollback, the context processing pipeline pauses updating the initial predicted pointer to keep it in the correct state, and then the data packet processing pipeline directly resets the rollback pointer to the initial predicted pointer to restore it to the correct state, thus realizing fast rollback; If the current prediction state is updated from the retransmission and error deletion state to the normal processing state, since the initial predicted pointer is in a paused update state in the retransmission and error deletion state, after restoring to the normal processing state, the context processing pipeline can resume the update function of the initial predicted pointer. Thus, the update of the pointer data in the multi-level context is realized.
[0082] In an embodiment of the present application, the data packet processing method may further include the following steps:
[0083] When a packet loss is detected by the data packet processing pipeline, update the normal processing state to the fast rollback state;
[0084] When a retransmitted data packet is received by using the context processing pipeline, update the fast fallback state to the retransmission error deletion state;
[0085] When a retransmitted data packet is received by using the data packet processing pipeline, update the retransmission error deletion state to the normal processing state.
[0086] The embodiment of the present application provides a method for implementing the update of the current prediction state of a data packet. As described above, the current prediction state included in each level of context can be updated in real time during the data packet processing based on the multi-level pipeline architecture. The update method is as follows: The data packet processing pipeline is preset with a packet loss monitoring function. Once a packet loss situation is detected, the current prediction state in each level of context can be updated from the normal processing state to the fast fallback state; The first-level context processing pipeline is preset with a retransmitted packet monitoring function. Once a self-retransmitted data packet arrives, the current prediction state in each level of context can be updated from the fast fallback state to the retransmission error deletion state; The data packet processing pipeline is also preset with a retransmitted packet monitoring function. Once a self-retransmitted data packet arrives, the current prediction state in each level of context can be updated from the retransmission error deletion state to the normal processing state. Thus, the real-time update of the current prediction state of the data packet is realized, which provides convenience for subsequent data packet processing.
[0087] The embodiment of the present application provides another data packet processing method.
[0088] The data packet processing method provided by the embodiment of the present application takes the data packet processing of a two-level context structure as an example. First, the data packet processing flow of the two-level context structure is implemented based on a three-level pipeline structure. There are three processing states in the three-level pipeline structure, including the normal processing state, the fast fallback state, and the retransmission error deletion state. The three-level pipelines are respectively:
[0089] The first-level pipeline: Obtain the information Ci in the first-level context;
[0090] The second-level pipeline: Use Ci to obtain the second-level context;
[0091] The third-level pipeline: Process the data packet by using the first-level context and the second-level context and refresh the information Ci in the first-level context.
[0092] Secondly, regarding the design of the pointer data Ci:
[0093] In the first-level context, use Pre_ci (prediction pointer) to replace Ci (actual pointer), and decompose Pre_ci into a pre-stage factor Ci_prefetch_add and a post-stage factor Ci - Ci_prefetch_sub. Then there is:
[0094] Pre_ci = Ci_prefetch_add + (Ci - Ci_prefetch_sub);
[0095] Among them, the prefix factor Ci_prefetch_add is updated by the first-stage pipeline, and the suffix factors Ci and Ci_prefetch_sub are both updated by the third-stage pipeline. When processing correct data packets, Ci and Ci_prefetch_sub increase simultaneously, and Pre_ci is insensitive to the update times of Ci and Ci_prefetch_sub; when processing lost packets, Ci remains unchanged, and Ci_prefetch_sub is updated to Ci_prefetch_add to achieve predictive fast backoff, and Pre_ci is also insensitive to the update times of Ci and Ci_prefetch_sub.
[0096] Furthermore, regarding the design of three prediction processing states (Ci_prefetch_sta) and data consistency:
[0097] Ci_prefetch_sta = 0 indicates the normal processing state, the first-stage pipeline predicts forward, and the third-stage pipeline processes packets normally;
[0098] Ci_prefetch_sta = 1 indicates the fast backoff state, the first-stage pipeline pauses prediction, and the third-stage pipeline performs fast backoff;
[0099] Ci_prefetch_sta = 2 indicates the retransmission error deletion state, and the first-stage pipeline receives a correct retransmitted packet.
[0100] Among them, the transition from 0 to 1 and from 2 to 0 can only be updated by the third-stage pipeline; the transition from 1 to 2 can only be updated by the first-stage pipeline.
[0101] Finally, please refer to Figure 4 , Figure 4 which is the flowchart of another data packet processing method provided by this application, where:
[0102] The first step and the second step: It is described that when the first-stage pipeline reads Ci_prefetch_sta = 0, it continues to predict forward, updates Ci_add, and the third-stage pipeline processes the expected data packet. At this time, the prediction pointer Pre_Ci is equal to the actual pointer Ci, and after the processing is completed, Ci and Ci_sub are updated and incremented by one simultaneously;
[0103] Third step, fourth step, and fifth step: Describe that packet loss occurs in the third-level pipeline judgment, implement the fast rollback process, set Ci_prefetch_sta from 0 to 1, and reset Ci_prefetch_sub to Ci_prefetch_add; After the first-level pipeline reads Ci_prefetch_sta = 1, stop updating Ci_prefetch_add to ensure Pre_ci = Ci;
[0104] Fifth step, sixth step, and seventh step: Describe that the third-level pipeline clears the data packet with incorrect prediction when Ci_prefetch_sta = 1 or 2; When Ci_prefetch_sta = 2 and a correct retransmission packet is received, set Ci_prefetch_sta from 2 to 0 and start correctly processing the data packet; When the first-level pipeline receives a correct retransmission packet, set Ci_prefetch_sta from 1 to 2 and resume updating Ci_prefetch_add.
[0105] It can be seen that the data packet processing method provided by the embodiments of the present application creates a multi-level pipeline architecture for data packets with a multi-level context structure. This multi-level pipeline architecture includes the last-level pipeline as the context processing pipeline and other-level pipelines as the data packet processing pipelines. Moreover, the number of context levels of the multi-level context is the same as the number of pipeline levels of the context processing pipeline, and the two correspond to each other. Thus, the context information of the corresponding-level context can be obtained by using the context processing pipeline, and the data packet can be processed by using the data packet processing pipeline, thereby realizing the parallel processing of the multi-level pipeline and effectively improving the processing efficiency of the data packets with the multi-level context structure.
[0106] The embodiments of the present application provide a multi-level pipeline architecture.
[0107] Please refer to Figure 5 , Figure 5 , which is a schematic structural diagram of a multi-level pipeline architecture provided by the present application, including a context processing pipeline 100 and a data packet processing pipeline 200. The last-level pipeline in the multi-level pipeline architecture is the data packet processing pipeline 200, and the other-level pipelines in the multi-level pipeline architecture except the last-level pipeline are the context processing pipelines 100;
[0108] Each context processing pipeline 100 is used to obtain the context information of the corresponding-level context after determining the multi-level context corresponding to the current data packet; Among them, the context information includes the content data of the current-level context, and the number of levels of the multi-level context is the same as the number of levels of the context processing pipeline;
[0109] The data packet processing pipeline 200 is used to process the current data packet according to the content data of each level of context.
[0110] It can be seen that the multi-stage pipeline architecture provided by the embodiments of the present application creates a multi-stage pipeline architecture for data packets with a multi-stage context structure. The multi-stage pipeline architecture includes the last-stage pipeline as the context processing pipeline and other stages of pipelines as the data packet processing pipelines. Moreover, the number of context levels of the multi-stage context is the same as the number of pipeline stages of the context processing pipeline, and the two correspond to each other. Thus, the context information of the corresponding-level context can be obtained by using the context processing pipeline, and the data packets can be processed by using the data packet processing pipeline, thereby realizing the parallel processing of the multi-stage pipeline and effectively improving the processing efficiency of the data packets with the multi-stage context structure.
[0111] For the introduction of the multi-stage pipeline architecture provided by the embodiments of the present application, please refer to the above method embodiments, and the present application will not elaborate herein.
[0112] The embodiments of the present application provide a data packet processing device.
[0113] Please refer to Figure 6 , Figure 6 which is a schematic structural diagram of a data packet processing device provided by the present application. The data packet processing device is applied to a multi-stage pipeline architecture. The multi-stage pipeline architecture includes a context processing pipeline and a data packet processing pipeline. The last-stage pipeline in the multi-stage pipeline architecture is the data packet processing pipeline, and other stages of pipelines except the last-stage pipeline in the multi-stage pipeline architecture are the context processing pipelines. The data packet processing device may include:
[0114] A determination module 1, configured to determine the multi-stage context corresponding to the current data packet, where the number of levels of the multi-stage context is the same as the number of pipeline stages of the context processing pipeline;
[0115] An acquisition module 2, configured to obtain the context information of the corresponding-level context by using the context processing pipeline, where the context information includes the content data of the current-level context;
[0116] A processing module 3, configured to process the current data packet according to the content data of each level of context by using the data packet processing pipeline.
[0117] It can be seen that the data packet processing device provided by the embodiments of the present application creates a multi-stage pipeline architecture for data packets with a multi-stage context structure. The multi-stage pipeline architecture includes the last-stage pipeline as the context processing pipeline and other stages of pipelines as the data packet processing pipelines. Moreover, the number of context levels of the multi-stage context is the same as the number of pipeline stages of the context processing pipeline, and the two correspond to each other. Thus, the context information of the corresponding-level context can be obtained by using the context processing pipeline, and the data packets can be processed by using the data packet processing pipeline, thereby realizing the parallel processing of the multi-stage pipeline and effectively improving the processing efficiency of the data packets with the multi-stage context structure.
[0118] In one embodiment of the present application, the context information may further include pointer data of the next-level context. The obtaining module 2 may be specifically configured to, for each context processing stream, use the current context processing stream to determine the current-level context corresponding to the current context processing stream according to the pointer data obtained from the previous-level context processing stream; and read and obtain the context information from the current-level context.
[0119] In one embodiment of the present application, the data packet processing device may further include a pointer update module, configured to update the pointer data in each level of context by using the data packet processing stream after processing the current data packet according to the content data of each level of context by using the data packet processing stream.
[0120] In one embodiment of the present application, the context information may further include the current prediction state. The processing module 3 may be specifically configured to, when the current prediction state is the normal processing state, process the current data packet according to the content data of each level of context by using the data packet processing stream; when the current prediction state is the fast rollback state, use the data packet processing stream to roll back to process the previous data packet; when the current prediction state is the retransmission error correction state, use the data packet processing stream to delete the error data packet, and process the retransmitted data packet when the retransmitted data packet is received.
[0121] In one embodiment of the present application, the pointer data is the sum of the prediction factor of the current-level context and the rollback factor of the next-level context. The prediction factor is the initial prediction pointer of the current-level context, and the rollback factor is the difference between the actual pointer and the rollback pointer of the next-level context. The pointer update module may be specifically configured to, when the current prediction state is the normal processing state, update the pointer data to the pointer data in the multi-level context corresponding to the next data packet by using the data packet processing stream; when the current prediction state is the fast rollback state or the retransmission error correction state, use the context processing stream to pause the update of the initial prediction pointer, and use the data packet processing stream to reset the rollback pointer to the initial prediction pointer; when the current prediction state is updated from the retransmission error correction state to the normal processing state, use the context processing stream to resume the update of the initial prediction pointer.
[0122] In one embodiment of the present application, the data packet processing device may further include a state update module, configured to update the normal processing state to the fast rollback state when a packet loss is detected by using the data packet processing stream; update the fast rollback state to the retransmission error correction state when a retransmitted data packet is received by using the context processing stream; and update the retransmission error correction state to the normal processing state when a retransmitted data packet is received by using the data packet processing stream.
[0123] For the introduction of the device provided in the embodiments of the present application, please refer to the above method embodiments, and the present application will not elaborate herein.
[0124] An embodiment of the present application provides an electronic device.
[0125] Please refer to Figure 7 , Figure 7 , which is a schematic structural diagram of an electronic device provided by the present application. The electronic device may include:
[0126] A memory for storing a computer program;
[0127] A processor that can implement the steps of any of the above packet processing methods when executing the computer program.
[0128] As Figure 7 shown, it is a schematic diagram of the composition structure of an electronic device. The electronic device may include: a processor 10, a memory 11, a communication interface 12, and a communication bus 13. The processor 10, the memory 11, and the communication interface 12 all complete mutual communication through the communication bus 13.
[0129] In an embodiment of the present application, the processor 10 may be a central processing unit (CPU), an application specific integrated circuit, a digital signal processor, a field programmable gate array, or other programmable logic devices, etc.
[0130] The processor 10 may call the program stored in the memory 11. Specifically, the processor 10 may execute the operations in the embodiment of the packet processing method.
[0131] The memory 11 is used to store one or more programs. The program may include program codes, and the program codes include computer operation instructions. In an embodiment of the present application, the memory 11 stores at least a program for implementing the following functions:
[0132] Determine the multi-level context corresponding to the current packet, and the number of levels of the multi-level context is the same as the number of levels of the context processing pipeline;
[0133] Use the context processing pipeline to obtain the context information of the corresponding level context. The context information includes the content data of the current level context;
[0134] Use the packet processing pipeline to process the current packet according to the content data of each level context.
[0135] In a possible implementation manner, the memory 11 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system and application programs required for at least one function, etc.; the data storage area may store the data created during use.
[0136] In addition, the memory 11 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device or other volatile solid-state storage devices.
[0137] The communication interface 12 may be an interface of a communication module for connecting to other devices or systems.
[0138] Of course, it should be noted that Figure 7 the structure shown does not constitute a limitation on the electronic device in the embodiments of the present application. In actual applications, the electronic device may include more or fewer components than Figure 7 those shown, or combine certain components.
[0139] The embodiments of the present application provide a computer-readable storage medium.
[0140] The computer program stored on the computer-readable storage medium provided by the embodiments of the present application, when executed by a processor, can implement the steps of any one of the above data packet processing methods.
[0141] The computer-readable storage medium may include: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
[0142] For the introduction of the computer-readable storage medium provided by the embodiments of the present application, please refer to the above method embodiments, and the present application will not elaborate herein.
[0143] The various embodiments in the specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description in the method part.
[0144] Those skilled in the art can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0145] The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be implemented directly in hardware, in software modules executed by a processor, or in a combination thereof. The software modules may be located in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium well known in the art.
[0146] The technical solutions provided in this application have been introduced in detail above. Specific examples are used herein to illustrate the principles and implementation manners of this application. The description of the above embodiments is only for helping to understand the method and its core idea of this application. It should be noted that for those of ordinary skill in the art, without departing from the principle of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the protection scope of this application.
Claims
1. A data packet processing method, characterized in that, it is applied to a multi-stage pipeline architecture, the multi-stage pipeline architecture includes a context processing pipeline and a data packet processing pipeline, the last stage pipeline in the multi-stage pipeline architecture is the data packet processing pipeline, and the other pipelines in the multi-stage pipeline architecture except the last stage pipeline are the context processing pipelines. The method includes: Determine the multi-level context corresponding to the current data packet, and the number of levels of the multi-level context is the same as the number of levels of the context processing pipeline; Use the context processing pipeline to obtain the context information of the corresponding level context, and the context information includes the content data of the current level context; Use the data packet processing pipeline to process the current data packet according to the content data of each level context; Wherein, the context information further includes the pointer data of the next level context. The step of using the context processing pipeline to obtain the context information of the corresponding level context includes: for each context processing pipeline, use the current context processing pipeline to determine the current level context corresponding to the current context processing pipeline according to the pointer data obtained by the previous level context processing pipeline; read and obtain the context information from the current level context.
2. The method according to claim 1, characterized in that, after using the data packet processing pipeline to process the current data packet according to the content data of each level context, it further includes: Use the data packet processing pipeline to update the pointer data in each level context.
3. The method according to claim 2, characterized in that, the context information further includes the current prediction state; The step of using the data packet processing pipeline to process the current data packet according to the content data of each level context includes: When the current prediction state is the normal processing state, use the data packet processing pipeline to process the current data packet according to the content data of each level context; When the current prediction state is the fast rollback state, use the data packet processing pipeline to roll back to process the previous data packet; When the current prediction state is the retransmission error deletion state, use the data packet processing pipeline to delete the error data packet, and process the retransmitted data packet when the retransmitted data packet is received.
4. The method according to claim 3, characterized in that, the pointer data is the sum of the prediction factor of the current level context and the rollback factor of the next level context. The prediction factor is the initial prediction pointer of the current level context, and the rollback factor is the difference between the actual pointer and the rollback pointer of the next level context; The step of using the data packet processing pipeline to update the pointer data in each level context includes: When the current prediction state is the normal processing state, use the data packet processing pipeline to update the pointer data to the pointer data in the multi-level context corresponding to the next data packet; When the current prediction state is the fast rollback state or the retransmission error deletion state, use the context processing pipeline to pause updating the initial prediction pointer, and use the data packet processing pipeline to reset the rollback pointer to the initial prediction pointer; When the current prediction state is updated from the retransmission error correction state to the normal processing state, the initial prediction pointer is restored and updated by using the context processing pipeline.
5. The method according to claim 3, wherein, it further includes: when a packet loss is detected by using the data packet processing pipeline, updating the normal processing state to the fast fallback state; when the retransmitted data packet is received by using the context processing pipeline, updating the fast fallback state to the retransmission error correction state; when the retransmitted data packet is received by using the data packet processing pipeline, updating the retransmission error correction state to the normal processing state.
6. A multi-stage pipeline architecture, wherein, it includes a context processing pipeline and a data packet processing pipeline. The last-stage pipeline in the multi-stage pipeline architecture is the data packet processing pipeline, and the other pipelines in the multi-stage pipeline architecture except the last-stage pipeline are the context processing pipelines; each of the context processing pipelines is configured to obtain context information of the corresponding-level context after determining the multi-level context corresponding to the current data packet; wherein, the context information includes the content data of the current-level context, and the number of levels of the multi-level context is the same as the number of levels of the context processing pipeline; the data packet processing pipeline is configured to process the current data packet according to the content data of each level of context; wherein, the context information further includes pointer data of the next-level context; the process of obtaining context information of the corresponding-level context includes: for each of the context processing pipelines, using the current context processing pipeline to determine the current-level context corresponding to the current context processing pipeline according to the pointer data obtained by the previous-level context processing pipeline; and reading and obtaining the context information from the current-level context.
7. A data packet processing device, wherein, it is applied to a multi-stage pipeline architecture, the multi-stage pipeline architecture includes a context processing pipeline and a data packet processing pipeline. The last-stage pipeline in the multi-stage pipeline architecture is the data packet processing pipeline, and the other pipelines in the multi-stage pipeline architecture except the last-stage pipeline are the context processing pipelines. The device includes: a determination module, configured to determine the multi-level context corresponding to the current data packet, and the number of levels of the multi-level context is the same as the number of levels of the context processing pipeline; an acquisition module, configured to use the context processing pipeline to obtain context information of the corresponding-level context, and the context information includes the content data of the current-level context; a processing module, configured to use the data packet processing pipeline to process the current data packet according to the content data of each level of context; wherein, the context information further includes pointer data of the next-level context, and the acquisition module is specifically configured to, for each of the context processing pipelines, use the current context processing pipeline to determine the current-level context corresponding to the current context processing pipeline according to the pointer data obtained by the previous-level context processing pipeline; and read and obtain the context information from the current-level context.
8. An electronic device, wherein, it includes: A memory for storing a computer program; A processor for implementing the steps of the data packet processing method according to any one of claims 1 to 5 when executing the computer program.
9. A computer-readable storage medium, characterized in that, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data packet processing method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Method and device for parallel processing
CN102694730A
Cryptographic computing engine for memory load and store units of a microarchitecture pipeline
CN112149151A