Data Processing Method, Apparatus, Electronic Device and Computer-Readable Storage Medium

By dividing data sets and assigning processing tasks according to transmission channel and request type identification in a multi-core processor, the problem of low utilization of processor cores is solved, and more efficient data processing is achieved and network burden is reduced.

CN115361210BActive Publication Date: 2025-08-05Fisherman Information Technology Co Ltd
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211001479.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-19
Publication Date
2025-08-05
Estimated Expiration
2042-08-19

AI Technical Summary

Technical Problem

In the prior art, when data processing is performed through a multi-core processor, the processor core utilization rate is low.

Method used

By dividing the to-processed data packets into multiple data sets according to the transmission channel identification, and assigning the data sets to different processor cores for processing according to the preset binding relationship, the transmission order of the data packets is determined based on the request type identification and the packet generation time.

Benefits of technology

It improves the processor core utilization and data processing efficiency of multi-core processors, and reduces the network burden during data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115361210B_ABST
    Figure CN115361210B_ABST
Patent Text Reader

Abstract

The present application discloses a data processing method, device, electronic device and computer-readable storage medium. The method includes: obtaining N data packets to be processed, wherein each data packet to be processed contains at least a transmission channel identifier and a request type identifier; dividing the N data packets to be processed into M data sets according to the transmission channel identifier; determining the target processor core corresponding to each data set from multiple processor cores according to a preset binding relationship; processing the data set entering the target processor core according to the request type identifier to obtain at least one target data packet corresponding to each data set; determining the sending time of sending the target data packet to the target device according to the request type identifier and the generation time of the target data packet. The present application solves the technical problem of low processor core utilization in the prior art when performing data processing through a multi-core processor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of data processing and network security, and more specifically, to a data processing method, device, electronic device, and computer-readable storage medium. Background Art

[0002] IPSec VPN is a VPN (virtual private network) technology that uses the IPSec (internet protocol security) protocol to achieve remote access. When processing data packets through IPSec VPN, the first-in-first-out principle must be maintained. That is, the first received data packet is processed and forwarded first. Only under this principle can optimal data transmission be achieved. Otherwise, data packet retransmission may occur, increasing the network burden.

[0003] To ensure the order in which packets are processed, conventional techniques typically employ a synchronous processing approach. This involves a single processor core processing all packets. Upon receiving a packet, the processor core immediately processes it. After processing is complete, the processor core forwards the corresponding target packet before processing the next packet. Because this synchronous approach utilizes only one processor core, the other processor cores remain idle, resulting in low processor core utilization.

[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention

[0005] The embodiments of the present application provide a data processing method, device, electronic device and computer-readable storage medium to at least solve the technical problem of low processor core utilization when processing data through a multi-core processor in the prior art.

[0006] According to one aspect of an embodiment of the present application, a data processing method is provided, including: obtaining N data packets to be processed, wherein each data packet to be processed includes at least a transmission channel identifier and a request type identifier, the transmission channel identifier is used to distinguish the device sending the data packet to be processed, and the request type identifier is used to characterize the data processing request type corresponding to the data packet to be processed; dividing the N data packets to be processed into M data sets according to the transmission channel identifier, wherein each data set includes at least one data packet to be processed, and at least one data packet to be processed has the same transmission channel identifier; determining the target processor core corresponding to each data set from multiple processor cores according to a preset binding relationship, wherein the preset binding relationship is used to characterize the correspondence between the transmission channel identifier and the processor core identifier, and the processor core identifier is used to distinguish different processor cores; performing data processing on the data set entering the target processor core according to the request type identifier to obtain at least one target data packet corresponding to each data set, wherein one data packet to be processed corresponds to one target data packet; determining the sending time of sending the target data packet to the target device according to the request type identifier and the generation time of the target data packet.

[0007] Furthermore, the data processing method also includes: determining X processor cores from the plurality of processor cores as target processor cores, wherein each target processor core is used to process at least one data set from the M data sets; and determining the target processor core corresponding to each data set based on a transmission channel identifier corresponding to each data set and a preset binding relationship.

[0008] Furthermore, the data processing method also includes: after determining the target processor core corresponding to each data set from multiple processor cores according to a preset binding relationship, obtaining the reception time when the target network card receives the data packet to be processed, wherein the target network card is used to receive the data packet to be processed and send the data packet to be processed to the target processor core; determining the arrangement order of at least one data packet to be processed in each data set according to the order of reception time; and caching at least one data packet to be processed as a target sequence according to the arrangement order based on the target processor core.

[0009] Furthermore, the data processing method also includes: determining F processor cores from multiple processor cores as first processor cores, wherein the first processor core and the target processor core are independent of each other; identifying the request type identifier of each data packet to be processed in the target sequence based on the first processor core; and performing data processing on each data packet to be processed according to the request type identifier to obtain a target data packet corresponding to each data packet to be processed.

[0010] Furthermore, the data processing method also includes: determining J processor cores from multiple processor cores as second processor cores, wherein the second processor core is independent of the target processor core and the first processor core; after the first processor core generates a target data packet, determining the target data packet as a data packet to be sent based on the second processor core; determining that the data packet to be processed corresponding to the data packet to be sent is the first data packet, and determining that the target sequence where the first data packet is located is the sequence to be processed; and determining the sending time of the data packet to be sent based on the request type identifier of the first data packet and the generation time of the data packet to be sent.

[0011] Furthermore, the data processing method also includes: determining a first subsequence from the sequence to be processed based on the request type identifier of the first data packet, wherein the request type identifier of the data packet to be processed in the first subsequence is the same as the request type identifier of the first data packet; detecting whether a second data packet exists in the first subsequence, wherein the reception time of the second data packet is earlier than the reception time of the first data packet, and the target data packet corresponding to the second data packet has not yet been generated; if the second data packet does not exist in the first subsequence, determining the generation time of the data packet to be sent as the sending time of the data packet to be sent; if the second data packet exists in the first subsequence, determining the sending time of the data packet to be sent based on the generation time of the first target data packet, wherein the first target data packet is the target data packet corresponding to the second data packet.

[0012] Furthermore, the data processing method also includes: detecting whether a first target data packet is generated; after the first target data packet is generated, determining the generation time of the first target data packet as a first time, wherein the first time is also the sending time of the first target data packet; determining the sending time of the data packet to be sent based on the first time, wherein the sending time of the data packet to be sent is later than the first time.

[0013] According to another aspect of an embodiment of the present application, a data processing device is further provided, including: an acquisition module, configured to acquire N data packets to be processed, wherein each data packet to be processed includes at least a transmission channel identifier and a request type identifier, the transmission channel identifier being used to distinguish a device sending the data packet to be processed, and the request type identifier being used to characterize a data processing request type corresponding to the data packet to be processed; a division module, configured to divide the N data packets to be processed into M data sets according to the transmission channel identifier, wherein each data set includes at least one data packet to be processed, and at least one data packet to be processed has the same transmission channel identifier; a first determination module, configured to determine a target processor core corresponding to each data set from a plurality of processor cores according to a preset binding relationship, wherein the preset binding relationship is used to characterize a correspondence between the transmission channel identifier and the processor core identifier, and the processor core identifier is used to distinguish different processor cores; a data processing module, configured to perform data processing on the data set entering the target processor core according to the request type identifier to obtain at least one target data packet corresponding to each data set, wherein one data packet to be processed corresponds to one target data packet; and a second determination module, configured to determine a sending time for sending the target data packet to a target device according to the request type identifier and a generation time of the target data packet.

[0014] According to another aspect of an embodiment of the present application, a computer-readable storage medium is further provided, in which a computer program is stored. The computer program is configured to execute the above-mentioned data processing method when it is run.

[0015] According to another aspect of an embodiment of the present application, an electronic device is also provided, which includes one or more processors; a storage device for storing one or more programs, which, when the one or more programs are executed by the one or more processors, enables the one or more processors to run the programs, wherein the programs are configured to execute the above-mentioned data processing method when running.

[0016] In the present application, N data packets to be processed are divided into M data sets according to the transmission channel identifier. First, N data packets to be processed are obtained. Then, the N data packets to be processed are divided into M data sets according to the transmission channel identifier. The target processor core corresponding to each data set is determined from multiple processor cores according to the preset binding relationship. The data set entering the target processor core is processed according to the request type identifier to obtain at least one target data packet corresponding to each data set. Then, the sending time of sending the target data packet to the target device is determined according to the request type identifier and the generation time of the target data packet. Each data packet to be processed includes at least a transmission channel identifier and a request type identifier. The transmission channel identifier is used to distinguish the device sending the data packet to be processed, and the request type identifier is used to characterize the data processing request type corresponding to the data packet to be processed. Each data set contains at least one data packet to be processed, and at least one data packet to be processed has the same transmission channel identifier. The preset binding relationship is used to characterize the correspondence between the transmission channel identifier and the processor core identifier. The processor core identifier is used to distinguish different processor cores. One data packet to be processed corresponds to one target data packet.

[0017] From the above content, it can be seen that the present application divides N data packets to be processed into M data sets according to the transmission channel identifiers of the data packets to be processed, and uses the processor core corresponding to each data set to process the data packets in the data set. Since the data packets with different transmission channel identifiers come from different devices, the data packets in different data sets may not follow the first-in-first-out principle. On this basis, using different processor cores to process different data sets can not only improve data processing efficiency, but also improve the utilization rate of the processor cores of multi-core processors.

[0018] It can be seen that through the technical solution of the present application, the purpose of utilizing multiple processor cores of the processor to process data is achieved, thereby realizing the effect of improving data processing efficiency, and further solving the technical problem of low processor core utilization when processing data through a multi-core processor in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0020] Figure 1 is a flowchart of an optional data processing method according to an embodiment of the present application;

[0021] Figure 2 is a schematic diagram of a target network card processing data according to an embodiment of the present application;

[0022] Figure 3 This is a schematic diagram of processor core division according to an embodiment of the present application;

[0023] Figure 4 is a flowchart of another optional data processing method according to an embodiment of the present application;

[0024] Figure 5 is a schematic diagram of an optional data processing device according to an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] Example 1

[0028] According to an embodiment of the present application, an embodiment of a data processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0029] In addition, it should be noted that a data processing device can serve as the execution subject of the data processing method of the embodiment of the present application. The data processing device includes at least a target network card and a multi-core processor. Specifically, the target network card is a network card that supports multi-network card queuing, which is used to receive N data packets to be processed and send the N data packets to be processed to the multi-core processor. A multi-core processor is a processor with multiple processor cores as understood by those skilled in the art.

[0030] Figure 1 is a flow chart of an optional data processing method according to an embodiment of the present application, such as Figure 1 As shown, the method includes the following steps:

[0031] Step S101: Obtain N data packets to be processed.

[0032] In step S101, each data packet to be processed includes at least a transmission channel identifier and a request type identifier. The transmission channel identifier is used to distinguish the device that sends the data packet to be processed, and the request type identifier is used to represent the data processing request type corresponding to the data packet to be processed.

[0033] Specifically, the above-mentioned N can be any value, and this application does not impose any special restrictions on this. The above-mentioned transmission channel identifiers include but are not limited to SPI (serial peripheral interface) numbers, HASH (src\dis) numbers and other identifiers. It should be noted that the pending data packets with different transmission channel identifiers come from different devices. In addition, the request type identifier of each pending data packet represents the data processing request type corresponding to the pending data packet, wherein the data processing request type includes but is not limited to data encryption request, data decryption request and data verification request.

[0034] Step S102: Divide N data packets to be processed into M data sets according to the transmission channel identifiers.

[0035] In step S102, each data set includes at least one data packet to be processed, and the transmission channel identifier of the at least one data packet to be processed is the same. The value of M and the value of N may be the same or different.

[0036] Specifically, the target network card, as a data processing device that exchanges data with external devices, has the feature of supporting multi-network card queuing. Generally speaking, the target network card has multiple data channels for transmitting data packets to be processed. At the same time, the target network card can also group N data packets to be processed entering the data channel according to the transmission channel identifier of the data packets to be processed, thereby obtaining M data sets.

[0037] In an optional embodiment, Figure 2 A schematic diagram of a target network card processing data according to an embodiment of the present application is shown. Figure 2 As shown, in Figure 2 Three data channels are shown, namely channel 1, channel 2 and channel 3. Assume that there are 6 pending data packets entering the target network card through channel 1 and channel 2 respectively. The target network card recognizes that the SPI number of 4 pending data packets among the 6 pending data packets is SPI1, and the SPI number of 2 pending data packets is SPI2. On this basis, the target network card will divide the 4 pending data packets with SPI number SPI1 into data set A, and divide the 2 pending data packets with SPI number SPI2 into data set B.

[0038] Step S103 : determining a target processor core corresponding to each data set from the plurality of processor cores according to a preset binding relationship.

[0039] In step S103, the preset binding relationship is used to represent the correspondence between the transmission channel identifier and the processor core identifier, and the processor core identifier is used to distinguish different processor cores.

[0040] Optionally, in order to increase the number of processor cores of the processor, the data processing device divides the multiple processor cores of the processor into three groups according to the processor core identifiers. Figure 3 As shown, assuming that the processor has seven processor cores, processor cores 1 and 2 can be combined into a target processor core group, processor cores 3, 4, and 5 into a first processor core group, and the remaining processor cores 6 and 7 into a second processor core group. Each processor core in the target processor core group is a target processor core; each processor core in the first processor core group is a first processor core; and each processor core in the second processor core group is a second processor core.

[0041] Optionally, according to the preset binding relationship, each target processor core is used to receive the corresponding multiple data packets to be processed, and cache the received multiple data packets to be processed as a target sequence according to the order in which the data packets to be processed are received. Figure 2 As shown, the target processor core 1 corresponds to the data set with SPI number SPI1, and receives the above-mentioned data set A; the target processor core 2 corresponds to the data set with SPI number SPI2 and the data set with SPI number SPI3. Therefore, the target processor core 2 can receive two data sets, namely the above-mentioned data set B and data set C, among which the SPI numbers of the data packets to be processed in data set C are all SPI3.

[0042] Step S104 : processing the data set entering the target processor core according to the request type identifier to obtain at least one target data packet corresponding to each data set.

[0043] In step S104, a data packet to be processed corresponds to a target data packet.

[0044] Optionally, each data set contains at least one data packet to be processed, and the request type identifier of at least one data packet to be processed may be different. Therefore, the data processor device may call multiple first processor cores in the working processor core group to process the data packets to be processed in the data set in parallel. For example, if the request type of data packet A to be processed is a data encryption request, the first processor core will perform data encryption processing on data packet A to be processed to obtain target data packet A; if the request type of data packet B to be processed is a data decryption request, the first processor core will perform data decryption processing on data packet B to obtain target data packet B.

[0045] It's important to note that because the transmission channel identifiers for different data sets are different, Data Set A and Data Set B are independent of each other. The data in each data set originates from different devices. This means that the first processor core does not need to consider the order in which Data Set A is processed relative to Data Set B, and the two data sets do not need to follow the first-in, first-out principle. Consequently, the data processing device can use different first processor cores to process the two data sets, thereby improving data processing efficiency and utilizing idle processor cores.

[0046] Step S105 : determining a sending time of sending the target data packet to the target device according to the request type identifier and the generation time of the target data packet.

[0047] In step S105, for a data set, since there may be multiple data packets to be processed with different request type identifiers in a data set, the data processing device needs to ensure that the target data packets corresponding to the multiple data packets to be processed of the same request type are sent according to the first-in-first-out principle, so as to ensure that the order in which the target device receives the multiple target data packets is correct, thereby reducing the network burden during data transmission.

[0048] It should be noted that, as those skilled in the art know, if the order of multiple target data packets received by the target device is wrong, the target device needs to rearrange the multiple target data packets before processing the target data packets, or require the sending device to resend the target data packets. In either case, it will cause congestion in the data transmission network, thereby increasing the network burden during the data transmission process. In addition, since data packets of different request types do not affect each other, target data packets of different request types are also independent of each other. The data processing device can also ignore the sending order when sending target data packets of different request types. Therefore, the data processing device in this application only needs to ensure that the target data packets corresponding to the to-be-processed data packets of the same request type in the same data set are sent according to the first-in-first-out principle, that is, it can achieve the effect of improving data processing efficiency while ensuring that the network burden is not increased.

[0049] Based on the contents of the above steps S101 to S105, it can be seen that in the present application, by dividing N data packets to be processed into M data sets according to the transmission channel identifier, firstly, N data packets to be processed are obtained, then the N data packets to be processed are divided into M data sets according to the transmission channel identifier, and the target processor core corresponding to each data set is determined from multiple processor cores according to the preset binding relationship, so that the data set entering the target processor core is processed according to the request type identifier, and at least one target data packet corresponding to each data set is obtained, and then the sending time of sending the target data packet to the target device is determined according to the request type identifier and the generation time of the target data packet. In which, each data packet to be processed includes at least a transmission channel identifier and a request type identifier, the transmission channel identifier is used to distinguish the device sending the data packet to be processed, and the request type identifier is used to characterize the data processing request type corresponding to the data packet to be processed; each data set contains at least one data packet to be processed, and at least one data packet to be processed has the same transmission channel identifier; the preset binding relationship is used to characterize the correspondence between the transmission channel identifier and the processor core identifier, and the processor core identifier is used to distinguish different processor cores; one data packet to be processed corresponds to one target data packet.

[0050] From the above content, it can be seen that the present application divides N data packets to be processed into M data sets according to the transmission channel identifiers of the data packets to be processed, and uses the processor core corresponding to each data set to process the data packets in the data set. Since the data packets with different transmission channel identifiers come from different devices, the data packets in different data sets may not follow the first-in-first-out principle. On this basis, using different processor cores to process different data sets can not only improve data processing efficiency, but also improve the utilization rate of the processor cores of multi-core processors.

[0051] It can be seen that through the technical solution of the present application, the purpose of utilizing multiple processor cores of the processor to process data is achieved, thereby realizing the effect of improving data processing efficiency, and further solving the technical problem of low processor core utilization when processing data through a multi-core processor in the prior art.

[0052] In an optional embodiment, the data processing device determines X processor cores from a plurality of processor cores as target processor cores, and determines the target processor core corresponding to each data set based on a transmission channel identifier corresponding to each data set and a preset binding relationship. Each target processor core is configured to process at least one of the M data sets.

[0053] Optional, Figure 4 A flow chart of an optional data processing method according to an embodiment of the present application is shown. Figure 4 As shown in the example, assume that 10 pending data packets enter the target gateway. The target gateway identifies that 4 pending data packets have the SPI number SPI1, 5 pending data packets have the SPI number SPI2, and 1 pending data packet has the SPI number SPI3. The preset binding relationship constrains SPI1 to correspond to processor core 1, and SPI2 and SPI3 to correspond to processor core 2. Therefore, the target gateway groups the 4 pending data packets with SPI number SPI1 into data set A, the 5 pending data packets with SPI number SPI2 into data set B, and the 1 pending data packet with SPI number SPI3 into data set C. Data set A is sent to processor core 1, and data sets B and C are sent to processor core 2.

[0054] In an optional embodiment, after determining the target processor core corresponding to each data set from multiple processor cores based on a preset binding relationship, the data processing device obtains the reception time when the target network card receives the data packet to be processed, and determines the arrangement order of at least one data packet to be processed in each data set based on the order of the reception times, thereby caching the at least one data packet to be processed into a target sequence based on the arrangement order according to the target processor core. The target network card is configured to receive the data packet to be processed and send the data packet to be processed to the target processor core.

[0055] Optional, such as Figure 4As shown, taking data set A as an example, data set A includes data packet 1 to be processed, data packet 2 to be processed, data packet 3 to be processed, and data packet 4 to be processed. Among them, according to the chronological order of reception time of the four data packets to be processed, the arrangement order of the four data packets to be processed is: data packet 1 to be processed, data packet 2 to be processed, data packet 4 to be processed, and data packet 3 to be processed. Based on this arrangement order, the target processor core will cache a target sequence [data packet 1 to be processed, data packet 2 to be processed, data packet 4 to be processed, and data packet 3 to be processed].

[0056] In an optional embodiment, the data processing device further determines F processor cores from the plurality of processor cores as first processor cores, where the first processor cores are independent of the target processor core. The data processing device then identifies the request type identifier of each pending data packet in the target sequence based on the first processor core, and processes each pending data packet based on the request type identifier to obtain a target data packet corresponding to each pending data packet.

[0057] Optional, such as Figure 4 As shown, processor core 3, processor core 4 and processor core 5 of the processor are the first processor core. Taking data set A as an example, after the first processor core obtains the above-mentioned target sequence [data packet to be processed 1, data packet to be processed 2, data packet to be processed 4, data packet to be processed 3], the second processor core will identify the request type identifier of each data packet to be processed in the target sequence. Assuming that the request types of data packet to be processed 1, data packet to be processed 2 and data packet to be processed 4 are all data encryption requests, and the request type of data packet to be processed 3 is a data decryption request, the first processor core will perform data encryption processing on data packet to be processed 1, data packet to be processed 2 and data packet to be processed 4 respectively to obtain the corresponding target data packet 1, target data packet 2 and target data packet 4. At the same time, the first processor core will also perform data decryption processing on data packet to be processed 3 to obtain target data packet 3.

[0058] It should be noted that, since data set B, data set C, and data set A are independent of each other, processor core 3, processor core 4, and processor core 5 can process the three data sets simultaneously.

[0059] In an optional embodiment, the data processing device further determines J processor cores from the plurality of processor cores as second processor cores, and after the first processor core generates a target data packet, determines the target data packet as a to-be-sent data packet based on the second processor core, then determines the to-be-processed data packet corresponding to the to-be-sent data packet as the first data packet, and determines the target sequence in which the first data packet resides as the to-be-processed sequence, and finally determines the sending time of the to-be-sent data packet based on the request type identifier of the first data packet and the generation time of the to-be-sent data packet. The second processor core is independent of the target processor core and the first processor core.

[0060] Optionally, the second processor core first determines a first subsequence from the sequence to be processed based on the request type identifier of the first data packet, wherein the request type identifier of the data packet to be processed in the first subsequence is the same as the request type identifier of the first data packet. Then, the second processor core detects whether there is a second data packet in the first subsequence, wherein the reception time of the second data packet is earlier than the reception time of the first data packet, and the target data packet corresponding to the second data packet has not yet been generated. Finally, in the case that the second data packet does not exist in the first subsequence, the second processor core determines the generation time of the data packet to be sent as the sending time of the data packet to be sent; in the case that the second data packet exists in the first subsequence, the second processor core determines the sending time of the data packet to be sent based on the generation time of the first target data packet, wherein the first target data packet is the target data packet corresponding to the second data packet.

[0061] Optional, such as Figure 4 As shown, processor core 6 and processor core 7 are the second processor cores. Taking data set A as an example, after the first processor core generates target data packet 2, the second processor core first determines the generation time of target data packet 2, and determines that data packet 2 to be processed is the first data packet. The target sequence of the data packets to be processed [data packet to be processed 1, data packet to be processed 2, data packet to be processed 4, data packet to be processed 3] is the sequence to be processed. It is known that the request type of data packet to be processed 2 is a data encryption request, and the request types of data packet to be processed 1 and data packet to be processed 4 are also data encryption requests. Therefore, the first subsequence should be [data packet to be processed 1, data packet to be processed 2, data packet to be processed 4].

[0062] Furthermore, the reception time of the pending data packet 1 is earlier than the reception time of the pending data packet 2. If the target data packet 1 corresponding to the pending data packet 1 has not been generated at this time, the second processor core will determine that the pending data packet 1 is the second data packet. At this time, the second processor core will prohibit sending the target data packet 2, but will only send the target data packet 2 after the target data packet 1 is generated and sent first, thereby ensuring that the target data packets corresponding to the pending data packets of the same request type under the same data set are sent according to the first-in-first-out principle.

[0063] In addition, if target data packet 1 has been generated and sent when target data packet 2 is generated, the second processor core can directly determine the generation time of target data packet 2 as the sending time of target data packet 2, that is, there is no need to wait and it can be sent directly to the target device.

[0064] In an optional embodiment, when there is a second data packet in the first subsequence, the second processor core detects whether the first target data packet is generated. After the first target data packet is generated, the second processor core determines that the generation time of the first target data packet is the first time, and determines the sending time of the data packet to be sent based on the first time, wherein the first time is also the sending time of the first target data packet, and the sending time of the data packet to be sent is later than the first time.

[0065] Optional, such as Figure 4 As shown, according to the first subsequence [data packet to be processed 1, data packet to be processed 2, data packet to be processed 4], if target data packet 1 (corresponding to the first target data packet) has not been generated after target data packet 2 is generated, the second processor core will prohibit sending the target data packet, and the second processor core will monitor in real time whether the first processor core has generated target data packet 1. Assuming that the generation time of target data packet 1 is the first time T1, then T1 is also the sending time of target data packet 1. The second processor core will send target data packet 1 before sending target data packet 2.

[0066] Furthermore, after determining that the target data packet 1 is successfully sent, the second processor core determines the current time as the sending time of the target data packet 2, and sends the target data packet 2 to the target device.

[0067] It is easy to notice that if the order of multiple target data packets received by the target device is wrong, the target device needs to rearrange the multiple target data packets before processing the target data packets, or require the sending device to resend the target data packets. In either case, it will cause congestion in the data transmission network, thereby increasing the network burden during the data transmission process. In addition, since data packets of different request types do not affect each other, target data packets of different request types are also independent of each other. The data processing device can also ignore the sending order when sending target data packets of different request types. Therefore, the data processing device in this application only needs to ensure that the target data packets corresponding to the to-be-processed data packets of the same request type in the same data set are sent according to the first-in-first-out principle, that is, it can achieve the effect of improving data processing efficiency while ensuring that the network burden is not increased, thereby achieving the purpose of fully utilizing the multiple processor cores of the multi-core processor.

[0068] Example 2

[0069] According to an embodiment of the present application, a data processing device is further provided, wherein: Figure 5 is a schematic diagram of an optional data processing device according to an embodiment of the present application, such as Figure 5 As shown, the apparatus includes: an acquisition module 501 for acquiring N data packets to be processed, wherein each data packet to be processed includes at least a transmission channel identifier and a request type identifier, the transmission channel identifier being used to distinguish a device sending the data packet to be processed, and the request type identifier being used to characterize a data processing request type corresponding to the data packet to be processed; a division module 502 for dividing the N data packets to be processed into M data sets based on the transmission channel identifier, wherein each data set includes at least one data packet to be processed, and at least one data packet to be processed has the same transmission channel identifier; a first determination module 503 for determining a target processor core corresponding to each data set from a plurality of processor cores based on a preset binding relationship, wherein the preset binding relationship is used to characterize a correspondence between the transmission channel identifier and the processor core identifier, and the processor core identifier is used to distinguish different processor cores; a data processing module 504 for performing data processing on the data set entering the target processor core based on the request type identifier to obtain at least one target data packet corresponding to each data set, wherein one data packet to be processed corresponds to one target data packet; and a second determination module 505 for determining a sending time for sending the target data packet to a target device based on the request type identifier and the generation time of the target data packet.

[0070] It should be noted that the above-mentioned acquisition module 501, division module 502, first determination module 503, data processing module 504 and second determination module 505 correspond to steps S101 to S105 in the above-mentioned embodiment 1. The examples and application scenarios implemented by the five modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned embodiment 1.

[0071] Optionally, the first determination module includes: a first determination unit and a second determination unit. The first determination unit is configured to determine X processor cores from a plurality of processor cores as target processor cores, wherein each target processor core is configured to process at least one of the M data sets; and the second determination unit is configured to determine the target processor core corresponding to each data set based on a transmission channel identifier corresponding to each data set and a preset binding relationship.

[0072] Optionally, the data processing device further includes: a first acquisition module, a third determination module, and a cache module. The first acquisition module is configured to acquire the time at which a target network card receives a data packet to be processed, wherein the target network card is configured to receive the data packet to be processed and send the data packet to be processed to a target processor core; the third determination module is configured to determine the arrangement order of at least one data packet to be processed in each data set based on the order of the reception times; and the cache module is configured to cache the at least one data packet to be processed as a target sequence according to the arrangement order of the target processor core.

[0073] Optionally, the data processing module further includes: a third determination unit, an identification unit, and a data processing unit. The third determination unit is configured to determine, from a plurality of processor cores, F processor cores as the first processor core, wherein the first processor core and the target processor core are independent of each other; the identification unit is configured to identify the request type identifier of each data packet to be processed in the target sequence based on the first processor core; and the data processing unit is configured to perform data processing on each data packet to be processed based on the request type identifier to obtain a target data packet corresponding to each data packet to be processed.

[0074] Optionally, the second determination module further includes: a fourth determination unit, a fifth determination unit, a sixth determination unit, and a seventh determination unit. The fourth determination unit is configured to determine J processor cores from a plurality of processor cores as second processor cores, wherein the second processor core is independent of the target processor core and the first processor core; the fifth determination unit is configured to determine, after the first processor core generates a target data packet, that the target data packet is a data packet to be sent based on the second processor core; the sixth determination unit is configured to determine that the data packet to be processed corresponding to the data packet to be sent is the first data packet, and to determine that the target sequence in which the first data packet is located is the sequence to be processed; and the seventh determination unit is configured to determine the sending time of the data packet to be sent based on the request type identifier of the first data packet and the generation time of the data packet to be sent.

[0075] Optionally, the seventh determination unit includes: a first determination subunit, a detection unit, a second determination subunit, and a third determination subunit. The first determination subunit is configured to determine a first subsequence from a sequence to be processed according to a request type identifier of a first data packet, wherein the request type identifier of the data packet to be processed in the first subsequence is the same as the request type identifier of the first data packet; the detection unit is configured to detect whether a second data packet exists in the first subsequence, wherein the receiving time of the second data packet is earlier than the receiving time of the first data packet, and the target data packet corresponding to the second data packet has not yet been generated; the second determination subunit is configured to determine, if the second data packet does not exist in the first subsequence, that the generation time of the data packet to be sent is the sending time of the data packet to be sent; and the third determination subunit is configured to determine, if the second data packet exists in the first subsequence, that the sending time of the data packet to be sent according to the generation time of the first target data packet, wherein the first target data packet is the target data packet corresponding to the second data packet.

[0076] Optionally, the third determination sub-unit includes: a detection sub-module, a first sub-module, and a second sub-module. The detection sub-module is used to detect whether a first target data packet is generated; the first sub-module is used to determine, after the first target data packet is generated, that the generation time of the first target data packet is a first time, wherein the first time is also the sending time of the first target data packet; and the second sub-module is used to determine the sending time of the data packet to be sent based on the first time, wherein the sending time of the data packet to be sent is later than the first time.

[0077] Example 3

[0078] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the data processing method in the above-mentioned embodiment 1 when running.

[0079] Example 4

[0080] According to another aspect of an embodiment of the present application, an electronic device is also provided, which includes one or more processors; a storage device for storing one or more programs, which, when the one or more programs are executed by one or more processors, enables the one or more processors to run the programs, wherein the programs are configured to execute the data processing method in the above-mentioned embodiment 1 when running.

[0081] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0082] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0083] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0084] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected to achieve the purpose of the present embodiment according to actual needs.

[0085] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0086] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program code.

[0087] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A data processing method, characterized in that: include: Obtain N data packets to be processed, wherein each data packet to be processed includes at least a transmission channel identifier and a request type identifier, wherein the transmission channel identifier is used to distinguish a device that sends the data packet to be processed, and the request type identifier is used to indicate a data processing request type corresponding to the data packet to be processed; Dividing the N data packets to be processed into M data sets according to the transmission channel identifier, wherein each data set contains at least one data packet to be processed, and the at least one data packet to be processed has the same transmission channel identifier; Determining a target processor core corresponding to each data set from a plurality of processor cores according to a preset binding relationship, wherein the preset binding relationship is used to characterize a correspondence between a transmission channel identifier and a processor core identifier, and the processor core identifier is used to distinguish different processor cores; Processing the data set entering the target processor core according to the request type identifier to obtain at least one target data packet corresponding to each data set, wherein one data packet to be processed corresponds to one target data packet; determining a sending time for sending the target data packet to a target device according to the request type identifier and a generation time of the target data packet; Among them, data processing is performed on the data set entering the target processor core according to the request type identifier to obtain at least one target data packet corresponding to each data set, including: obtaining the reception time when the target network card receives the data packet to be processed, wherein the target network card is used to receive the data packet to be processed and send the data packet to be processed to the target processor core; determining the arrangement order of at least one data packet to be processed in each data set according to the sequence of the reception times; caching the at least one data packet to be processed as a target sequence according to the arrangement order according to the target processor core; determining F processor cores from the multiple processor cores as the first processor core, wherein the first processor core and the target processor core are independent of each other; identifying the request type identifier of each data packet to be processed in the target sequence according to the first processor core; and performing data processing on each data packet to be processed according to the request type identifier to obtain a target data packet corresponding to each data packet to be processed.

2. The method according to claim 1, characterized in that Determining a target processor core corresponding to each data set from a plurality of processor cores according to a preset binding relationship includes: Determining X processor cores from the plurality of processor cores as the target processor cores, wherein each target processor core is configured to process at least one data set from the M data sets; The target processor core corresponding to each data set is determined according to the transmission channel identifier corresponding to each data set and the preset binding relationship.

3. The method according to claim 1, characterized in that Determining, according to the request type identifier and the generation time of the target data packet, a sending time of sending the target data packet to a target device, including: Determine J processor cores from the plurality of processor cores as second processor cores, wherein the second processor cores are independent of the target processor core and the first processor core; After the first processor core generates a target data packet, determining the target data packet as a data packet to be sent according to the second processor core; Determining that the data packet to be processed corresponding to the data packet to be sent is a first data packet, and determining that the target sequence where the first data packet is located is a sequence to be processed; The sending time of the data packet to be sent is determined according to the request type identifier of the first data packet and the generation time of the data packet to be sent.

4. The method according to claim 3, characterized in that Determining a sending time of the data packet to be sent according to the request type identifier of the first data packet and the generation time of the data packet to be sent, including: determining a first subsequence from the sequence to be processed according to the request type identifier of the first data packet, wherein the request type identifier of the data packets to be processed in the first subsequence is the same as the request type identifier of the first data packet; detecting whether a second data packet exists in the first subsequence, wherein a receiving time of the second data packet is earlier than a receiving time of the first data packet, and a target data packet corresponding to the second data packet has not yet been generated; If the second data packet does not exist in the first subsequence, determining the generation time of the data packet to be sent as the sending time of the data packet to be sent; In the case that the second data packet exists in the first subsequence, the sending time of the data packet to be sent is determined according to the generation time of the first target data packet, wherein the first target data packet is the target data packet corresponding to the second data packet.

5. The method according to claim 4, characterized in that: When the second data packet exists in the first subsequence, determining the sending time of the to-be-sent data packet according to the generation time of the first target data packet includes: detecting whether the first target data packet is generated; After the first target data packet is generated, determining the generation time of the first target data packet as a first time, wherein the first time is also the sending time of the first target data packet; The sending time of the data packet to be sent is determined according to the first time, wherein the sending time of the data packet to be sent is later than the first time.

6. A data processing device, characterized in that: include: an acquisition module, configured to acquire N data packets to be processed, wherein each data packet to be processed includes at least a transmission channel identifier and a request type identifier, wherein the transmission channel identifier is used to distinguish a device that sends the data packet to be processed, and the request type identifier is used to characterize a data processing request type corresponding to the data packet to be processed; a dividing module, configured to divide the N data packets to be processed into M data sets according to the transmission channel identifier, wherein each data set contains at least one data packet to be processed, and the at least one data packet to be processed has the same transmission channel identifier; a first determining module, configured to determine a target processor core corresponding to each data set from a plurality of processor cores according to a preset binding relationship, wherein the preset binding relationship is used to characterize a correspondence between a transmission channel identifier and a processor core identifier, and the processor core identifier is used to distinguish different processor cores; a data processing module, configured to process the data set entering the target processor core according to the request type identifier to obtain at least one target data packet corresponding to each data set, wherein one data packet to be processed corresponds to one target data packet; a second determining module, configured to determine a sending time for sending the target data packet to a target device according to the request type identifier and a generation time of the target data packet; Among them, the data processing device also includes: a first acquisition module, used to obtain the reception time when the target network card receives the data packet to be processed, wherein the target network card is used to receive the data packet to be processed and send the data packet to be processed to the target processor core; a third determination module, used to determine the arrangement order of at least one data packet to be processed in each data set according to the sequence of the reception times; a cache module, used to cache the at least one data packet to be processed as a target sequence according to the arrangement order based on the target processor core; a third determination unit, used to determine F processor cores from the multiple processor cores as the first processor core, wherein the first processor core and the target processor core are independent of each other; an identification unit, used to identify the request type identifier of each data packet to be processed in the target sequence based on the first processor core; a data processing unit, used to perform data processing on each data packet to be processed according to the request type identifier to obtain a target data packet corresponding to each data packet to be processed.

7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the data processing method according to any one of claims 1 to 5 when run.

8. An electronic device, characterized in that: The electronic device includes one or more processors; a storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to run the programs, wherein the programs are configured to execute the data processing method described in any one of claims 1 to 5 when run.

Citation Information

Patent Citations

  • Method for internal business processing and load balancing for platform

    CN102323897A