A data exchange device
By introducing a multi-port processing module and data switching core design into the Shaq bus network, parallel processing of base packets is realized, data switching efficiency and throughput are improved, and the problem of low switch processing efficiency is solved.
Patent Information
- Application Number
- CN202410585372.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-11
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2044-05-11
AI Technical Summary
In Shaq bus network, the switch can only handle one data exchange task at the same time, resulting in low data exchange efficiency between terminals.
It provides a data exchange device, including multiple port processing modules and data exchange cores, and performs preliminary processing of the base packet and determines the target module identification through the preprocessing sub-module, reduces the processing workload of the data exchange core, and realizes parallel processing and efficient data exchange.
It improves the data throughput and efficiency of data switching devices, reduces the processing pressure of data switching cores, and ensures the real-time and certainty of the network.
Smart Images

Figure CN118200259B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and more specifically, to a data exchange device. Background Art
[0002] With the development of bus technology, a free-topology, automatically reconfiguring network, SharkNet, has emerged. Compared to other fieldbuses, SharkNet terminals require frequent data communication, resulting in a large amount of data exchange.
[0003] On the Shaker bus, data exchange between devices is typically accomplished through switches. Specifically, a switch connects to several terminals via ports, sequentially receiving base packets from each terminal, processing them, and then sending them to their destination terminals, completing the data exchange task.
[0004] Since the switch can only handle one data exchange task at a time, the data exchange efficiency between the terminals is low. Therefore, how to improve the data exchange efficiency on the Shaker bus has become a problem that needs to be solved urgently by those skilled in the art. Summary of the Invention
[0005] In view of the above problems, the present application is proposed to provide a data exchange device to implement data exchange tasks between terminals and improve data exchange efficiency.
[0006] The specific plan is as follows:
[0007] A data exchange device is provided, comprising:
[0008] A plurality of port processing modules and a data exchange core are preset, the data exchange device is applied to a data exchange system using the Shaker bus protocol, the data exchange system further comprises the plurality of preset terminals, the plurality of preset terminals are connected one by one to the plurality of preset port processing modules; in the data exchange system, the terminals transmit in units of base packets of a preset length;
[0009] The port processing module includes: a pre-processing submodule;
[0010] The pre-processing submodule is configured to: receive a base packet sent by the terminal connected to the port processing module; determine whether the base packet meets the direct processing conditions of the port processing module at least based on the mode field of the base packet; if so, directly process the base packet; if not, determine the destination module identifier corresponding to the base packet based on the destination address field in the base packet; wherein the destination module identifier is an identifier of a module within the data switching device;
[0011] The data exchange core is configured to: obtain, from the pre-processing sub-modules of the respective pre-processing sub-modules of the preset plurality of port processing modules, a base packet to be processed by the data exchange core and a destination module identifier corresponding to the base packet, and process the obtained base packet so that the base packet is transmitted to a module corresponding to the destination module identifier corresponding to the base packet;
[0012] The port processing module also includes: a post-processing submodule;
[0013] The post-processing submodule is used to receive the basic packet forwarded by the component module of the data exchange device, so as to provide the basic packet to the terminal connected to the port processing module for acquisition.
[0014] By utilizing the above technical solution, the data exchange device provided by this application can include multiple port processing modules and a data exchange core. The device can be applied to a data exchange system that uses the Shaker bus protocol. The system can also include multiple terminals, with different terminals connected to different port processing modules. When processing a data exchange task, the data exchange device has each port processing module process the basic packets associated with the terminal to which it is connected. Taking any port processing module as an example, this port processing module may include a pre-processing sub-module and a post-processing sub-module. The pre-processing sub-module receives the base packet sent by the terminal to which this port processing module is connected. If the base packet meets the direct processing condition of this port processing module, that is, if this port processing module is able to process the base packet, the base packet is directly processed. Otherwise, it indicates that the base packet needs to be processed by other component modules of the data exchange device. Based on this, the destination module identifier is determined according to the destination address field of the base packet; the data exchange kernel obtains the base packet to be processed and the corresponding destination module identifier from the pre-processing sub-module in each port processing module, and processes the base packet so that the base packet is transmitted to the module corresponding to the destination module identifier corresponding to the base packet; the post-processing sub-module in this port processing module can be used to: receive the base packet forwarded by the component modules of the data exchange device (such as other port processing modules and data exchange kernel in the data exchange device) for acquisition by the terminal to which this port processing module is connected, thereby realizing the data exchange task between the terminals. Since the preliminary processing of the base packets sent by the terminal and the determination of the destination port identifier are mainly completed independently in advance by each port processing module, the above-mentioned data exchange device can realize parallel processing of the base packets sent by each terminal, thereby improving processing efficiency; in addition, in the data exchange device provided in the embodiment of the present application, the digital exchange core only performs corresponding processing based on the base packets provided by each pre-processing sub-module and its corresponding destination module identifier, reducing the processing workload of the data exchange core, thereby increasing the data throughput of the data exchange device and improving data exchange efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present application. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:
[0016] Figure 1 A schematic diagram of the structure of a data exchange device provided in an embodiment of the present application;
[0017] Figure 2 The following is an example of a data exchange process diagram. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0019] The present application provides a data exchange device that can be used to implement data exchange tasks between different terminals and improve data exchange efficiency.
[0020] Figure 1 1 is a structural diagram of a data exchange device according to an embodiment of the present application. The device may include a data exchange core 10 and a preset number of port processing modules 11 to 1n, wherein n represents the preset number. The data exchange device can be applied to a data exchange system using the SharkNet protocol, wherein the SharkNet can also be referred to as a free topology automatic reconstruction network. Based on this, illustratively, the preset number can be greater than 2 and less than or equal to 32. The data exchange system may also include the preset number of terminals, the preset number of terminals and the preset number of port processing modules being connected one by one, and different terminals being connected to different port processing modules.
[0021] Next, taking the port processing module 1i (i∈{1, 2, .., n}) as an example, the port processing module in the data exchange device provided in the embodiment of the present application is described; wherein, the port processing module 1i can be connected to the terminal i in the data exchange system.
[0022] The port processing module 1i may include a pre-processing sub-module 1i1. The pre-processing sub-module 1i1 may be connected to the terminal i via the receiving port of the port processing module 1i. The pre-processing sub-module 1i1 is also connected to the data exchange core 10. The pre-processing sub-module may be used to execute a pre-processing process. Specifically, the pre-processing process may include:
[0023] Step S101: Receive a basic packet sent by the terminal i connected to the port processing module 1i.
[0024] It's important to note that according to the Shak Bus protocol, all transmitted packets are reduced to packets of a preset length, known as base packets, and these base packets have a certain degree of independence. Furthermore, current switches are configured to process 10-byte packets at a time, so the preset length can be 10 bytes. Depending on the type, Shak Bus protocol packets can be either message packets or data packets.
[0025] Table 1
[0026]
[0027] Typically, a message packet consists of a base packet. Table 1 illustrates a format definition for a message packet, which may include: a 1-byte mode field MF, a 2-byte source address field SA, a 2-byte destination address field DA, a 1-byte register address RA, a 2-byte parameter word PD, a 1-byte control word CD, and a 1-byte checksum field VF. Specifically, the mode field indicates the type and function of the base packet. The mode word in the mode field can be used to indicate the instruction function corresponding to the base packet. The source address field indicates the address of the network node to which the device sending the base packet is connected. The address of the network node to which the device is connected can be referred to as the device address. The destination address field represents the address of the device receiving the base packet. The parameter word indicates the status and size of the signal contained in the register. The control information in the control word can indicate the auxiliary operation command executed by the device receiving the base packet. The checksum field is used by the device receiving the base packet to verify the accuracy of the base packet. For example, the message packet may be a command for implementing functions such as time synchronization, port scanning, channel checking, or system reconfiguration.
[0028] Table 2
[0029]
[0030] A data packet can be composed of an unlimited number of base packets. Table 2 illustrates a data packet format definition. The base packets that make up a data packet can include a data start packet, a data continuation packet, and a data end packet. The format definition of the data start packet can refer to the format definition of the message packet described above. The mode field in the data start packet can be 0x09, the data continuation packet can include a 1-byte mode field (for example, 0x1E) and 9 bytes of data, and the data end packet can include a 1-byte mode field (for example, 0x07) and 9 bytes of data or user-defined information. It should be noted that when transmitting a data packet, the receiving device only performs a cyclic redundancy check (CRC) on the check field in the data start packet. In addition, the receiving device can determine the size of the data packet based on the data start packet and data end packet. Optionally, the number of data continuation packets in a data packet can be less than or equal to 256 to avoid adverse effects on the network's data transmission performance due to excessively long data packets.
[0031] Based on this, the base packet type can be determined according to the mode field. If the mode field is 0x09, 0x1E or 0x07, the base packet is a data packet, otherwise it is a message packet.
[0032] Step S102 , determining whether the base packet meets the direct processing conditions of the port processing module 1 i ; if so, executing step S103 ; if not, executing step S104 .
[0033] Step S103: directly process the base package.
[0034] Step S104: Determine the destination module identifier corresponding to the base package according to the destination address field in the base package.
[0035] It should be noted that if the base packet meets the direct processing conditions of the port processing module 1i, it indicates that the base packet is a message packet that can be directly processed by the port processing module 1i, and the pre-processing sub-module 1i1 in the port processing module 1i directly processes the base packet; otherwise, it indicates that other modules in the data exchange device need to process the base packet and the base packet needs to be forwarded to other port processing modules or data exchange cores in the data exchange device. The pre-processing sub-module 1i1 determines the destination module identifier corresponding to the base packet based on the destination address field in the base packet, wherein the destination module identifier is an identifier of a component module of the data exchange device, which is used to represent a module in the data exchange device. In other words, the module corresponding to the destination module identifier can be a module in the data exchange core and the preset number of port processing modules. The correspondence between the destination address field of the base packet and the module identifier can be determined at least based on the connection relationship between the preset number of port processing modules and the preset number of terminals. For example, the port processing module to which the terminal corresponding to the destination address field of a base packet is connected can be determined as the destination module corresponding to the base packet, and the identifier of the port processing module can be determined as the destination module identifier corresponding to the base packet.
[0036] In addition, the base packet being processed by the pre-processing submodule 1i1 and the determined destination module identifier corresponding to the base packet can be acquired by the data exchange core 10 to perform data exchange.
[0037] The data exchange kernel 10 can be used to: obtain from the pre-processing sub-modules of each of the preset several port processing modules: the base packet to be processed by the data exchange kernel and the destination module identifier corresponding to the base packet; and process the obtained base packet so that the base packet is transmitted to the module corresponding to the destination module identifier corresponding to the base packet.
[0038] It should be noted that the data exchange core 10 sequentially obtains and processes the base packets to be forwarded received by each port processing module. That is, at any given moment, the data exchange core 10 can obtain a combination of a base packet and a destination module identifier corresponding to the base packet from the preprocessing submodule of at most one port processing module. After obtaining a base packet and a destination module identifier corresponding to the base packet, the core 10 processes the obtained base packet and, after processing is complete, obtains the next combination of a base packet and a destination module identifier corresponding to the base packet.
[0039] The preprocessing submodule can prepare the parameters required by the data exchange core when performing forwarding and other operations to the best of its ability. Based on this, the above-mentioned data exchange core does not need to perform complex processing on the basic packets that need to be forwarded received by each port processing module, and only needs to process the basic packets accordingly according to the obtained destination module identifier. In other words, the workload of the data exchange core in the embodiment of the present application is relatively small. Based on this, the data exchange core is less likely to be busy, and the basic packets that need to be forwarded received by each port processing module are less likely to be backlogged in the data exchange core, which helps to improve data exchange efficiency.
[0040] The port processing module 1i may further include: a post-processing submodule 1i2, the post-processing submodule 1i2 is connected to the data exchange core 10, and the post-processing submodule is also connected to the terminal i connected to the port processing module 1i through the sending port of the port processing module 1i.
[0041] The post-processing submodule 1i2 can be used to: receive basic packets forwarded by the constituent modules of the data exchange device (including the data exchange kernel 10 and each port processing module 1j (j∈{1, 2, .., n} and j≠i)) for acquisition by the terminal connected to this port processing module.
[0042] The data exchange device provided herein may include multiple port processing modules and a data exchange core. The device may be applied to a data exchange system utilizing the Shaker bus protocol. The system may also include multiple terminals, each of which is connected to a different port processing module. When processing a data exchange task, the data exchange device processes a base packet associated with the terminal to which it is connected, with each port processing module processing the base packet. Taking any port processing module as an example, this port processing module may include a pre-processing sub-module and a post-processing sub-module. The pre-processing sub-module receives the base packet sent by the terminal to which this port processing module is connected. If the base packet meets the direct processing condition of this port processing module, that is, if this port processing module is able to process the base packet, the base packet is directly processed. Otherwise, it indicates that the base packet needs to be processed by other component modules of the data exchange device. Based on this, the destination module identifier is determined according to the destination address field of the base packet; the data exchange kernel obtains the base packet to be processed and the corresponding destination module identifier from the pre-processing sub-module in each port processing module, and processes the base packet so that the base packet is transmitted to the module corresponding to the destination module identifier corresponding to the base packet; the post-processing sub-module in this port processing module can be used to receive the base packet forwarded by the component modules of the data exchange device (that is, other port processing modules or data exchange kernel in the data exchange device) for acquisition by the terminal to which this port processing module is connected, thereby realizing the data exchange task between the terminals. Because the initial processing of base packets sent by terminals and the determination of destination port identifiers are primarily pre- and independently performed by each port processing module, the aforementioned data exchange device can achieve parallel processing of base packets sent by each terminal, thereby improving processing efficiency. Furthermore, in the data exchange device provided in the embodiments of the present application, the digital exchange core only processes the base packets provided by each pre-processing submodule and their corresponding destination module identifiers, reducing the processing workload of the data exchange core, thereby increasing the data throughput of the data exchange device and improving data exchange efficiency. Furthermore, the delay from receiving to forwarding a base packet is calculable, and in some scenarios, the delay jitter is minimal, thereby effectively ensuring the real-time and deterministic nature of the Shaker bus network.
[0043] The following describes the structure and functions of the pre-processing submodules in each port processing module.
[0044] In some embodiments provided in the present application, the pre-processing submodule may include: a pre-storage memory and a pre-processor.
[0045] The pre-memory can be connected to the terminal connected to the port processing module via the receiving port of the port processing module. That is, the pre-memory can be configured on the connection line between the receiving port of the port processing module to which it belongs and the pre-processor in the port processing module. The pre-memory can be used to receive and store basic packets sent by the terminal for retrieval by the pre-processor.
[0046] Optionally, when a base packet is stored in the pre-memory, the pre-memory may provide a signal indicating that a base packet to be processed currently exists, so that the pre-processor can obtain and process the base packet stored in the pre-memory.
[0047] The preprocessor is connected to the data exchange core. The preprocessor can be used to obtain and process the base packet stored in the pre-memory memory. Specifically, it can be used to: obtain the base packet stored in the pre-memory memory, and determine whether the base packet meets the direct processing conditions of the current port processing module at least based on the mode field of the base packet; if so, directly process the base packet; if not, determine the destination module identifier corresponding to the base packet based on the destination address field in the base packet, so that the data exchange core can obtain the base packet and the destination module identifier corresponding to the base packet.
[0048] The specific process of the preprocessor processing the base packet may refer to the above description of the preprocessing submodule.
[0049] On the basis of the above, in order to achieve timely processing of important base packets, the pre-memory may include: several sub-memories corresponding to different processing priorities; the receiving port may be pre-configured to achieve: storing the received base packet into the sub-memory corresponding to the processing priority of the base packet in the pre-memory; the preprocessor may be pre-configured to: give priority to processing base packets with high processing priorities. For example, when there are multiple sub-memories providing signals for characterizing the current existence of base packets to be processed, the base packet is preferentially obtained from the sub-memory corresponding to the higher processing priority.
[0050] Since the base packets transmitted in the Shak bus only include two base packet types, data packets and message packets, and base packets of different base packet types correspond to different processing priorities, based on this, in a possible implementation method, the pre-memory may include: several sub-memories corresponding to different base packet types.
[0051] Among them, the base packet type may include at least two types, namely data packets and message packets; on this basis, different processing priorities can also be configured for data packets and message packets carrying different information. In addition, the various memories involved in the examples of this application can all be first-in, first-out memories FIFO (first in, first out). When a base packet is stored in the FIFO, a pending identification can be provided to the processor connected thereto to indicate that there is currently a pending base packet. It should be noted that the first-in, first-out memory FIFO can write to the cache at the receiving bit rate at the receiving end and can read out the cache at the sending bit rate at the sending end. In other words, the read and write rates of the first-in, first-out memory FIFO depend on the device or module connected thereto. Therefore, the first-in, first-out memory FIFO can be used to achieve rate matching between different modules or ports.
[0052] Optionally, the basic packet types may include: message packets, high-priority data packets and low-priority data packets, wherein the message packets correspond to the highest processing priority and the low-priority data packets correspond to the lowest processing priority.
[0053] Based on the above, the receiving port can be pre-configured to comply with a receiving port protocol. The receiving port protocol can be: when a base packet is received by the receiving port, the base packet type is determined based on at least the mode field of the base packet, and the base packet is stored in a sub-memory of the pre-memory corresponding to the base packet type. This protocol can achieve the task of dividing data and messages in the information flow.
[0054] Optionally, when a base packet is received, the base packet can be verified first. If the verification fails, it is discarded. If the verification passes, the base packet type of the base packet is determined at least based on the mode field of the base packet, and the base packet is stored in the sub-memory in the pre-memory corresponding to the base packet type of the base packet.
[0055] Exemplarily, when the base packet type includes data packets and message packets, the receiving port can determine whether the base packet is a data packet or a message packet based on the mode field of the base packet. When the base packet type includes message packets, high-priority data packets, and low-priority data packets, the receiving port can first determine whether the base packet is a data packet or a message packet based on the mode field of the base packet. When it is determined that the base packet is a data packet, the receiving port can then determine whether it is a high-priority data packet or a low-priority data packet based on the relevant fields in the base packet. For a data start packet, the base packet type to which the base packet belongs can be determined based on the priority flag therein. For a data continuation packet or a data end packet, the base packet type to which the base packet belongs can be determined based on the base packet type to which the corresponding data start packet belongs.
[0056] Based on the above, the process of the preprocessor obtaining the base package stored in the pre-memory device may include:
[0057] According to the processing priority corresponding to each base package type, the plurality of sub-memories corresponding to different base package types are polled in sequence until a base package is obtained.
[0058] It should be noted that the above-mentioned sequential polling can occur after processing a base packet that does not meet the direct processing conditions of the port processing module. The above-mentioned data exchange device can implement priority scheduling of input base packets by using three sub-memories corresponding to three processing priorities and a pre-processor polling mechanism.
[0059] In addition, since the above scheme processes in units of fixed-length base packets, and different types of base packets have different priorities, there is no need to add auxiliary management bytes to achieve the insertion of high-priority base packets into low-priority base packet streams (such as inserting message packets into data packet streams) for processing, thereby achieving priority processing of high-priority base packets.
[0060] In some embodiments provided herein, the process of the preprocessing submodule or the preprocessor in the preprocessing submodule determining whether the base packet meets the direct processing condition of the port processing module based on at least the mode field of the base packet may include steps AB:
[0061] Step A: Determine the base package type of the base package according to the mode domain of the base package.
[0062] Specifically, if the base packet is a data packet, it indicates that the base packet does not meet the direct processing conditions of the port processing module, and then the destination module identifier corresponding to the base packet is determined according to the destination address field in the base packet. According to the different data packet types, the following can be executed: exemplarily, for a data start packet, wait for the establishment of a transmission pipeline or wait for the data exchange kernel to forward; for a data continuous packet or a data receiving packet, directly forward from the established transmission pipeline or wait for the data exchange kernel to forward; if the base packet is a message packet, execute step B.
[0063] Step B: judging whether the basic packet is a message packet that can be directly processed by the port processing module according to the mode field of the basic packet and the destination address field of the basic packet.
[0064] If the judgment result of step B is yes, it indicates that the base packet meets the direct processing conditions of the port processing module; otherwise, it indicates that the base packet does not meet the direct processing conditions of the port processing module. Then, the destination module identifier corresponding to the base packet is determined according to the destination address field in the base packet, and waits for data exchange kernel processing.
[0065] In a possible implementation, the message packets that need to be processed by the data exchange core, that is, the message packets whose destination address field is the data exchange device, can be set as message packets that can be directly processed by the port processing module to reduce the message processing pressure of the data exchange core.
[0066] In another possible implementation, the message packet whose destination address field is the data exchange device can be set as a message packet that cannot be directly processed by this port processing module, that is, a basic packet that needs to be processed by other component modules of the data exchange device (such as another port processing module or data exchange core), and the message packet is processed by other component modules.
[0067] Illustratively, in some embodiments provided herein, the process of the preprocessing submodule or the preprocessor in the preprocessing submodule determining the destination module identifier corresponding to the base packet according to the destination address field in the base packet may include step CE:
[0068] Step C: Determine whether the destination address field in the base packet matches the address field of the data exchange device; if so, execute step D; if not, execute step E.
[0069] Step D: Determine the identifier of the data exchange kernel as the destination module identifier corresponding to the base package.
[0070] Step E: query the routing table of the data exchange system to determine the destination terminal corresponding to the destination address field of the base packet, and determine the identifier of the port processing module connected to the destination terminal as the destination module identifier corresponding to the base packet. Optionally, the destination module identifier can be a destination port number.
[0071] In the above scheme, the data exchange core processes the message packets whose destination address field is the address of the data exchange device, which can reduce the message packet processing pressure of the preprocessing submodule of each port processing module, and each preprocessing submodule can promptly process the basic packets that are more relevant to the port processing module.
[0072] In some other embodiments provided in the present application, the data exchange device may further include a local port processing module.
[0073] The local port processing module may also be referred to as a local port processing module, and may be configured to process a message packet whose destination address field is the address of the data switching device.
[0074] On the basis of the above, the process of the pre-processing submodule or the pre-processor in the pre-processing submodule determining the destination module identifier corresponding to the base packet according to the destination address field in the base packet may include steps FH:
[0075] Step F: Determine whether the destination address field in the base packet matches the address field of the data exchange device; if so, execute step G; if not, execute step H.
[0076] Step G: determining the identifier of the local port processing module as the destination module identifier corresponding to the base packet;
[0077] Step H: query the routing table of the data exchange system to determine the destination terminal corresponding to the destination address field of the base packet, and determine the identifier of the port processing module connected to the destination terminal as the destination module identifier corresponding to the base packet.
[0078] Based on the above, in one possible implementation, the local port processing module may include a local memory and a local processor; wherein the local memory is connected to the data exchange core and the local processor. The local memory may be configured to receive and store basic packets forwarded by the data exchange core; and the local processor may be configured to process the basic packets stored in the local memory.
[0079] Optionally, the data exchange core may be configured to poll the local port processing module and the preset number of port processing modules according to a preset polling order, and the local processor may be directly connected to the data exchange core to output the processing result of the local processor accordingly.
[0080] The above-mentioned solution uses a separate local port processing module to process the message packet whose destination address field is the address of the data exchange device, so that the data exchange core only needs to forward the obtained base packet according to the destination module identifier of the obtained base packet, thereby reducing the processing pressure of the data exchange core and improving the data exchange efficiency to a certain extent.
[0081] In some embodiments provided in the present application, the pre-processing submodule may also be used to cache one or more historical query records.
[0082] The historical query record is a record generated from the destination address field of the base packet and the destination module identifier corresponding to the base packet after the pre-processing submodule determines the identifier of the port processing module connected to the destination terminal as the destination module identifier corresponding to the base packet. In other words, based on one or more historical query records, a correspondence between one or more sets of destination address fields and destination module identifiers for the most recent query can be obtained. Exemplarily, the one or more historical query records can be five historical query records.
[0083] Based on the above, the pre-processing submodule can also be used to perform the following steps:
[0084] Step I: When the destination address field in the base packet does not match the address field of the data exchange device, query the one or more historical query records cached by this module based on the destination address field in the base packet.
[0085] If the query is successful, step J is executed; if the query is unsuccessful, the above step of querying the routing table of the data exchange system to determine the destination terminal corresponding to the destination address field of the base packet is executed.
[0086] Step J: Determine the destination module identifier corresponding to the base package according to the query result.
[0087] By using the above-mentioned cache mechanism, the query time of the pre-processing submodule can be reduced, the processing efficiency of the pre-processing submodule can be improved, and thus the data exchange efficiency can be improved.
[0088] The following describes the data exchange mechanism within the data exchange kernel and the data exchange device provided in the embodiments of the present application.
[0089] In some embodiments provided herein, the data exchange core obtains, from the pre-processing sub-modules of the respective pre-processing sub-modules of the preset port processing modules, a base packet to be processed by the data exchange core and a destination module identifier corresponding to the base packet. The process of processing the obtained base packet may include:
[0090] Step K: Check whether there is a base packet to be processed by the data exchange kernel and a destination module identifier corresponding to the base packet in the preprocessor of the port processing module corresponding to the current polling position; if so, execute step L first and then execute step M; if not, execute step M directly.
[0091] The data exchange core may be pre-configured with the polling order of each port processing module constituting the data exchange device, and subsequent polling is performed according to the polling order.
[0092] Step L: Obtain the base package and the destination module identifier corresponding to the base package, and process the obtained base package.
[0093] Step M: update the current polling order according to the preset polling orders of the preset number of port processing modules, and return to execute the step of querying whether there is a base packet to be processed by the data exchange kernel and a destination module identifier corresponding to the base packet in the preprocessor of the port processing module corresponding to the current polling order.
[0094] By means of the above-mentioned data exchange kernel polling mechanism, equal opportunities can be guaranteed among the various port processing modules in the data exchange device, and the basic packets from various port processing modules to be processed by the data exchange kernel can be fairly processed by the data exchange kernel, thereby ensuring the data exchange efficiency of the entire data exchange system.
[0095] In some embodiments provided in the present application, the mode field of the base packet may be: a mode field value corresponding to a message packet, a data start packet, a data continuation packet, or a data end packet.
[0096] Based on the above, the pre-processing submodule can also be used to perform the following steps:
[0097] In the case that the basic packet does not meet the direct processing condition of the current port processing module, it is determined whether the basic packet is a basic packet to be processed by the data exchange core.
[0098] The base packet to be processed by the data exchange core is a base packet whose mode field is a mode field value corresponding to a message packet or a data start packet, and whose destination address field is a destination address field value that does not correspond to the address field of the current port processing module. In other words, in some embodiments provided herein, based on the base packet type, a base packet that does not meet the direct processing conditions of the current port processing module may be a message packet, a data start packet, a data continuation packet, or a data end packet; however, the base packet to be processed by the data exchange core may be a message packet or a data start packet.
[0099] If the result of the judgment in the above step N is yes, then the step of determining the destination module identifier corresponding to the base packet based on the destination address field in the base packet is executed. If the result of the judgment in the above step N is no, then the mode field representing the base packet is the mode field value corresponding to the data continuation packet or the data end packet, and the base packet is transmitted according to the transmission path of the data start packet corresponding to the base packet.
[0100] Based on the above, taking a base packet as an example, the process of the data exchange kernel processing the obtained base packet may include:
[0101] In the case where the obtained base packet is a message packet, the post-processing submodule of the port processing module corresponding to the destination module identifier of the base packet is output to the base packet;
[0102] In the case where the acquired base packet is a data start packet, a pipeline is established from the port processing module corresponding to the current polling position to the post-processing sub-module of the port processing module corresponding to the destination module identifier of the base packet, so that the pre-processing sub-module of the port processing module corresponding to the current polling position can transmit the base packet and its corresponding data continuation packet and data end packet through the pipeline.
[0103] Based on this, the pre-processing submodule can also be used to cancel the pipeline of the port processing module after the data end packet is transmitted.
[0104] The above-mentioned data exchange device provides two data exchange mechanisms. Specifically, for a message packet to be processed by the data exchange core, the data exchange core directly forwards the message packet to the port processing module corresponding to its destination port processing module identifier, or directly processes the message packet; for a data start packet to be processed by the data exchange core, the data exchange core instructs to establish: a pipeline between the port processing module providing the data start packet and the port processing module corresponding to the destination module identifier of the data start packet, for transmitting the data start packet and the subsequent data continuation packet and data end packet. Exemplarily, the pipeline can be a pipeline between the pre-processing submodule of a port processing module and the post-processing submodule of another port processing module. With the above-mentioned scheme, the data packet can be directly transmitted through the data exchange core bypassing the establishment of an independent pipeline, so that the data exchange core can focus on the transmission of the message packet, which can reduce the uncertainty delay caused by the data exchange core transmitting the data packet to a certain extent, thereby increasing the data exchange device's processing certainty of the message packet.
[0105] It can greatly improve transmission efficiency and further reduce the workload and processing pressure of the data exchange core.
[0106] It should be noted that, for the preprocessing submodule or the preprocessor in the preprocessing submodule, if the base packet currently being processed is a base packet that meets the direct processing conditions of this port, then the next base packet can be obtained and processed after the base packet is directly processed. If the base packet currently being processed is a message packet to be processed by the data exchange kernel, then the next base packet can be obtained and processed after the data exchange kernel obtains the base packet and its destination module identifier; if the base packet currently being processed is a data start packet to be processed by the data exchange kernel, then the next base packet can be obtained and processed after the data start packet is output through the pipeline, wherein, before the transmission of the data end packet corresponding to the data start packet is completed, only the message packet or the data continuation packet or data end packet corresponding to the data start packet can be obtained and processed, and other data start packets cannot be processed, that is, data packets and message packets can be mixed and transmitted; if the base packet currently being processed is a data continuation packet, then the next base packet can be obtained and processed after the data continuation packet is output through the pipeline; if the base packet currently being processed is a data end packet, then the next base packet can be obtained and processed after the data end packet is output through the pipeline and the pipeline is canceled.
[0107] Furthermore, a port processing module can have at most one pipeline connected to another port processing module at any given time. Specifically, if the acquired base packet is a data initiation packet, and the port processing module corresponding to the destination module identifier of the base packet already has a pipeline connected to another module, establishing the pipeline will fail, and the data exchange core can be configured to wait for a retry. The data exchange core can also be configured to return the acquired base packet and its destination module identifier, and then query the next port processing module to ensure the overall data exchange efficiency of the data exchange system.
[0108] The aforementioned data exchange device can utilize the pre-processing submodules of each port processing module to pre-analyze and process received base packets, employing different processing methods for different types of base packets. This significantly improves the data exchange device's switching efficiency by providing only the base packets that need to be forwarded directly to the data exchange core or forwarding them through a pipeline established by the data exchange core.
[0109] Based on the above-mentioned basic packet switching mechanism, in some embodiments provided in this application, the post-processing submodule may include: a message post-storage and a data post-storage.
[0110] It should be noted that the post-message memory can be used to receive and store basic packets forwarded by the data exchange core; the post-data memory can be used to receive and store basic packets transmitted through a pipeline. The post-message memory and the post-data memory can be connected to the terminal connected to the port processing module via the send port of the port processing module. The output priority of the post-message memory is higher than the output priority of the post-data memory, so that the terminal can preferentially obtain the basic packets stored in the post-message memory.
[0111] By means of the above-mentioned post-processing submodule and pre-processing submodule, the pre-processing submodule is equipped with sub-memories corresponding to different processing priorities and a pre-processor configured with a priority polling mechanism, which can realize the priority reception, processing and sending of message packets, and can realize the response to message packets at any time, thereby ensuring the real-time nature of important basic packets.
[0112] For example, assuming that the first terminal, the second terminal, and the third terminal communicate through the data exchange device provided in an embodiment of the present application, the first terminal is connected to the port processing module 1 (corresponding to identifier 1) in the data exchange device, the second terminal is connected to the port processing module 2 (corresponding to identifier 2) in the data exchange device, and the third terminal is connected to the port processing module 3 (corresponding to identifier 3) of the data exchange device. Figure 2 An example of a data exchange process diagram, combined with Figure 2As shown, the first terminal sends the first basic packet, the second basic packet, the third basic packet and the fourth basic packet in sequence, which are received and stored by the pre-memory in the pre-processing submodule of the port processing module 1, wherein the first basic packet is a data start packet to be sent to the second terminal, the second basic packet is a data continuous packet corresponding to the first basic packet, the third basic packet is a message packet to be sent to the third terminal, and the fourth basic packet is a data end packet corresponding to the first basic packet; the preprocessor in the pre-processing submodule of the port processing module 1 obtains the first basic packet from the pre-memory when it is idle, determines that the first basic packet is a basic packet to be processed by the data exchange kernel, and the corresponding destination module identifier is identified as 2; and then waits for the data exchange kernel to poll. When the data exchange kernel polls the port processing module 1, the data exchange kernel obtains the first basic packet and identification 2 from the port processing module 1, and instructs the port processing module 1 to establish a pipeline to the port processing module 2 corresponding to identification 2; after the pipeline is established, the port processing module 1 sends the first basic packet through the pipeline, and the port processing module 2 receives the first basic packet through the pipeline for the second terminal to obtain; the preprocessor in the port processing module 1 obtains and processes the new basic packet. Since the second basic packet is a data continuous packet, the third basic packet is a message packet, the fourth basic packet is a data end packet, and the third basic packet is a data end packet. It has a higher priority. Therefore, the preprocessor in the port processing module 1 obtains and processes the third basic packet first, determines that the third basic packet is the basic packet to be processed by the data exchange kernel, and the corresponding destination module identifier is identifier 3; then waits for the data exchange kernel to poll. When the data exchange kernel polls the port processing module 1, the data exchange kernel obtains the third basic packet and identifier 3 from the port processing module 1, and the data exchange kernel forwards the third basic packet to the port processing module 3 for the third terminal to obtain; the preprocessor in the port processing module 1 obtains and processes the new basic packet. Since the second basic packet is a data continuous packet and the fourth basic packet is a data end packet, The two packets have the same priority. Based on the first-in-first-out principle, the preprocessor in the port processing module 1 preferentially obtains the second basic packet, determines that the second basic packet is a data continuation packet corresponding to the first basic packet, and forwards the second basic packet to the port processing module 2 through the existing pipeline for acquisition by the second terminal; then the preprocessor in the port processing module 1 obtains the fourth basic packet, determines that the fourth basic packet is a data end packet corresponding to the first basic packet, and forwards the fourth basic packet to the port processing module 2 through the existing pipeline for acquisition by the second terminal; and, after transmitting the fourth basic packet, the port processing module 1 cancels the pipeline to the port processing module 2 corresponding to the identifier 2.
[0113] Based on the above content, the port processing module can give priority to processing message packets with higher priorities, thereby improving the command response speed in the data exchange system to a certain extent; in addition, the data exchange device can transmit data packets through a bypass pipe, reducing the forwarding processing pressure of the data exchange core. Since the data packet transmission process through the pipe and the forwarding process of the data exchange core are independent of each other and do not interfere with each other, they can be carried out in parallel, thereby further speeding up the data exchange device's processing speed of the message packet. Since the data packet is not transmitted through the data exchange core, the message packet is less interfered with when transmitted through the data exchange core, thereby ensuring the real-time and deterministic processing of the message packet by the data exchange device; and, when transmitting a data packet composed of multiple base packets, the data continuation packet and the data end packet can be directly transmitted through the pipe, which reduces the processing workload of the port processing module for the data continuation packet and the data end packet to a certain extent, and improves the data packet exchange efficiency.
[0114] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0115] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referenced to each other.
[0116] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data exchange device, characterized in that: The device comprises a plurality of preset port processing modules and a data exchange core. The data exchange device is applied to a data exchange system using the Shaker bus protocol. The data exchange system further comprises a plurality of preset terminals, wherein the plurality of preset terminals are connected one by one to the plurality of preset port processing modules. In the data exchange system, the terminals transmit data in units of base packets of a preset length. The port processing module includes: a pre-processing submodule; The pre-processing submodule is configured to: receive a base packet sent by the terminal connected to the port processing module; determine whether the base packet meets the direct processing conditions of the port processing module at least based on the mode field of the base packet; if so, directly process the base packet; if not, determine the destination module identifier corresponding to the base packet based on the destination address field in the base packet; wherein the destination module identifier is an identifier of a module within the data switching device; The data exchange core is configured to: obtain, from the pre-processing sub-modules of the respective pre-processing sub-modules of the preset plurality of port processing modules, a base packet to be processed by the data exchange core and a destination module identifier corresponding to the base packet, and process the obtained base packet so that the base packet is transmitted to a module corresponding to the destination module identifier corresponding to the base packet; The port processing module also includes: a post-processing submodule; The post-processing submodule is used to: receive the basic packet forwarded by the component module of the data exchange device for acquisition by the terminal connected to the port processing module; The process of the pre-processing submodule determining whether the base packet meets the direct processing condition of the port processing module at least according to the mode field of the base packet includes: Determining the base package type of the base package according to the mode domain of the base package; If the base packet is a data packet, it indicates that the base packet does not meet the direct processing conditions of the port processing module; If the base packet is a message packet, then based on the mode field of the base packet and the destination address field of the base packet, it is determined whether the base packet is a message packet that can be directly processed by the current port processing module. If so, it indicates that the base packet meets the direct processing conditions of the current port processing module; otherwise, it indicates that the base packet does not meet the direct processing conditions of the current port processing module.
2. The data exchange device according to claim 1, characterized in that The data exchange core obtains from the pre-processing sub-modules of the preset port processing modules: a base packet to be processed by the data exchange core and a destination module identifier corresponding to the base packet, and processes the obtained base packet, including: querying whether there is a base packet to be processed by the data exchange core and a destination module identifier corresponding to the base packet in the preprocessor of the port processing module corresponding to the current polling position; If so, obtaining the base packet and the destination module identifier corresponding to the base packet, processing the obtained base packet, updating the current polling order according to the preset polling orders of the preset number of port processing modules, and returning to the step of querying whether the preprocessor of the port processing module corresponding to the current polling order has the base packet to be processed by the data exchange core and the destination module identifier corresponding to the base packet; If it does not exist, update the current polling position according to the preset polling positions of the preset number of port processing modules, and return to the step of querying whether there is a base packet to be processed by the data exchange kernel and the destination module identifier corresponding to the base packet in the preprocessor of the port processing module corresponding to the current polling position.
3. The data exchange device according to claim 2, characterized in that: The mode domain of the base packet is: a mode domain field value corresponding to a message packet, a data start packet, a data continuation packet or a data end packet; The pre-processing submodule is further used for: If the base packet does not meet the direct processing conditions of the port processing module, determining whether the base packet is a base packet to be processed by the data exchange core; wherein the base packet to be processed by the data exchange core is a base packet whose mode field is a mode field value corresponding to a message packet or a data start packet, and whose destination address field is a destination address field value that does not correspond to the address field of the port processing module; If yes, then executing the step of determining the destination module identifier corresponding to the base package according to the destination address field in the base package; If not, the mode field representing the base packet is the mode field value corresponding to the data continuation packet or the data end packet, and the base packet is transmitted according to the transmission path of the data start packet corresponding to the base packet; The process of the data exchange kernel processing the acquired base packet includes: In the case where the obtained base packet is a message packet, the post-processing submodule of the port processing module corresponding to the destination module identifier of the base packet is output to the base packet; In the case where the acquired base packet is a data start packet, a pipeline is established from the port processing module corresponding to the current polling position to the post-processing submodule of the port processing module corresponding to the destination module identifier corresponding to the base packet, so that the pre-processing submodule of the port processing module corresponding to the current polling position transmits the base packet and its corresponding data continuation packet and data end packet through the pipeline; The pre-processing submodule is further configured to cancel the pipeline of the port processing module after the data end packet is transmitted.
4. The data exchange device according to claim 3, characterized in that: The post-processing submodule includes: a message post-storage memory and a data post-storage memory; The post-message memory is used to receive and store the basic packets forwarded by the data exchange core; The data post-storage is used to receive and store the base packet transmitted through the pipeline; The message post-memory and the data post-memory are connected to the terminal connected to the port processing module through the sending port of the port processing module, and the output priority of the message post-memory is higher than the output priority of the data post-memory, so that the terminal can preferentially obtain the basic packet stored in the message post-memory.
5. The data exchange device according to claim 1, characterized in that: The pre-processing submodule includes: a pre-storage device and a pre-processor; The pre-storage is connected to the terminal connected to the port processing module via the receiving port of the port processing module, and the pre-storage is used to: receive and store the basic packet sent by the terminal for the pre-processor to obtain; The preprocessor is used to: obtain the base packet stored in the pre-memory device, and determine whether the base packet meets the direct processing conditions of the current port processing module at least based on the mode field of the base packet; if so, directly process the base packet; if not, determine the destination module identifier corresponding to the base packet based on the destination address field in the base packet, so that the data exchange core can obtain the base packet and the destination module identifier corresponding to the base packet.
6. The data exchange device according to claim 5, characterized in that: The pre-memory includes: a plurality of sub-memories corresponding to different base packet types; The receiving port is pre-configured to comply with a receiving port protocol, wherein upon receiving a base packet at the receiving port, the base packet type is determined based on at least a mode field of the base packet, and the base packet is stored in a sub-memory in the pre-memory corresponding to the base packet type. The process of the preprocessor acquiring the base package stored in the pre-storage memory includes: polling the plurality of sub-memories corresponding to the different base package types in sequence according to the processing priority corresponding to the base package types until a base package is obtained; The basic packet types include: message packets, high-priority data packets and low-priority data packets. The message packets correspond to the highest processing priority, and the low-priority data packets correspond to the lowest processing priority.
7. The data exchange device according to any one of claims 1 to 6, characterized in that: The data exchange device also includes a local port processing module; The process of the pre-processing submodule determining the destination module identifier corresponding to the base packet according to the destination address field in the base packet includes: Determining whether the destination address field in the base packet matches the address field of the data switching device; If yes, the identifier of the local port processing module is determined as the destination module identifier corresponding to the base packet; If not, query the routing table of the data exchange system to determine the destination terminal corresponding to the destination address field of the base packet, and determine the identifier of the port processing module connected to the destination terminal as the destination module identifier corresponding to the base packet; The local port processing module includes a local memory and a local processor; The local memory is used to receive and store the basic packets forwarded by the data exchange kernel; The local processor is used to process the base package stored in the local memory.
8. The data exchange device according to claim 7, characterized in that: The pre-processing submodule is further configured to: cache one or more historical query records, wherein the historical query record is a record generated by the destination address field of the base packet and the destination module identifier corresponding to the base packet after the identifier of the port processing module connected to the destination terminal is determined as the destination module identifier corresponding to the base packet; The pre-processing submodule is further used for: In the case where the destination address field in the base packet does not match the address field of the data exchange device, querying the one or more historical query records cached by the module according to the destination address field in the base packet; If the query is successful, the destination module identifier corresponding to the base package is determined according to the query result; If the query does not hit the target, the step of querying the routing table of the data exchange system to determine the destination terminal corresponding to the destination address field of the base packet is executed.
9. The data exchange device according to any one of claims 1 to 6, characterized in that: The process of the pre-processing submodule determining the destination module identifier corresponding to the base packet according to the destination address field in the base packet includes: Determining whether the destination address field in the base packet matches the address field of the data switching device; If yes, the identifier of the data exchange kernel is determined as the destination module identifier corresponding to the base package; If not, query the routing table of the data exchange system to determine the destination terminal corresponding to the destination address field of the base packet, and determine the identifier of the port processing module connected to the destination terminal as the destination module identifier corresponding to the base packet.
Citation Information
Patent Citations
Debugging method, device and system and data set generation method and device
CN113364747A
High-speed routing communication system and method based on GPU and particle swarm optimization algorithm
CN114944999A