Data transmission method and system, AutBus converter and medium
By encapsulating the IIC protocol data into target data packets of the AutBus protocol and forwarding them on the AutBus bus, the problems of low transmission efficiency and short distance of the IIC bus are solved, and more efficient and longer-distance data transmission is achieved.
Patent Information
- Application Number
- CN202411877428.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-03-21
AI Technical Summary
The IIC bus has problems with low transmission efficiency and short transmission distance.
After receiving the IIC protocol data sent by the source device through the first conversion module, the IIC protocol data is encapsulated into a target data packet of the AutBus protocol based on the pre-stored mapping table or the logical address of the destination device, and forwarded to the destination device after the second conversion module is verified and passed.
The AutBus bus protocol is fully utilized to carry and forward IIC protocol data, which improves the transmission efficiency and transmission distance of the IIC network and expands the application range.
Smart Images

Figure CN119676325A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of industrial communication technology, and in particular to a data transmission method, system, AutBus converter and medium. Background Art
[0002] The IIC (or I2C) bus is widely used in various types of integrated circuits, such as sensors, memories, microcontrollers, etc., and is commonly found in consumer electronics, automotive electronics, industrial control, smart homes and other fields.
[0003] However, the IIC bus has the problems of low transmission efficiency and short transmission distance.
[0004] Therefore the prior art still needs to be improved and enhanced. Summary of the invention
[0005] The present application provides a data transmission method, system, AutBus converter and medium, aiming to solve the problems of low transmission efficiency and short transmission distance of IIC bus in the prior art.
[0006] In a first aspect, an embodiment of the present application provides a data transmission method, including:
[0007] After receiving the IIC protocol data sent by the source device using the first conversion module, the IIC protocol data is encapsulated into a target data packet of the AutBus protocol according to a pre-stored mapping table or a logical address of the destination device;
[0008] Verifying the target data packet using a second conversion module;
[0009] The target data packet is forwarded to the destination device by the second conversion module after verification.
[0010] In some embodiments, encapsulating the IIC protocol data into a target data packet of the AutBus protocol according to a pre-stored mapping table or a logical address of a destination device includes:
[0011] The logical address of the source device is used as the source address, the logical address of the destination device is used as the destination address, and the IIC protocol data is used as the data payload, and is encapsulated into an initial data packet of the AutBus protocol to obtain the target data packet.
[0012] In some embodiments, forwarding the target data packet to the destination device includes:
[0013] The target data packet is written into the destination device in single byte by using the second conversion module, and the number of data bytes of the target data packet is recorded.
[0014] In some embodiments, the forwarding of the target data packet to the destination device further includes:
[0015] Using the second conversion module to receive the confirmation signal returned by the destination device, and record the number of the confirmation signals;
[0016] The number of the confirmation signals is compared with the number of recorded data bytes. When they are the same, it indicates that the destination device has successfully received the target data packet.
[0017] In some embodiments, the method according to the pre-stored mapping table or the logical address of the destination device also includes:
[0018] Establish a mapping relationship between the identifier of each conversion module and the logical addresses of all devices connected to it to obtain an initial mapping table;
[0019] The initial mapping tables of all the conversion modules are broadcasted to each other, so as to merge all the initial mapping tables to obtain the pre-stored mapping table.
[0020] In some embodiments, encapsulating the IIC protocol data into a target data packet of the AutBus protocol according to a pre-stored mapping table or a logical address of a destination device further includes:
[0021] Obtaining an identifier of the second conversion module, a logical address of the source device, and a logical address of the destination device described in the pre-stored mapping table;
[0022] The identifier is used as the node address, the logical address is used as the source address, the logical address of the destination device is used as the destination address, and the IIC protocol data is used as the data payload, and is encapsulated into an initial data packet of the AutBus protocol to obtain the target data packet.
[0023] In some embodiments, the verifying the target data packet by using the second conversion module includes:
[0024] Determine whether the destination address of the target data packet is a logical address of a device in the second conversion module in the pre-stored mapping table;
[0025] When the result is yes, it indicates that the target data packet has passed the verification;
[0026] When it is determined that it is not, the target data packet is discarded.
[0027] In a second aspect, an embodiment of the present application provides a data transmission system, including:
[0028] A plurality of conversion modules, a plurality of devices and an AutBus bus; the conversion modules are connected to each other via the AutBus bus, and each of the conversion modules is connected to at least one of the devices; wherein the plurality of conversion modules include: a first conversion module and a second conversion module; the plurality of devices include: a source device and a destination device; the source device is connected to the first conversion module, and the destination device is connected to the second conversion module;
[0029] The first conversion module is used for encapsulating the IIC protocol data into a target data packet of the AutBus protocol according to a pre-stored mapping table or a logical address of a destination device after receiving the IIC protocol data sent by the source device;
[0030] The second conversion module is used to verify the target data packet;
[0031] The second conversion module is further configured to forward the target data packet to the destination device after the verification is passed.
[0032] In a third aspect, an embodiment of the present application provides an AutBus converter, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the data transmission method described above when executed by the processor.
[0033] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which implements the steps of the data transmission method described above when executed by a processor.
[0034] Compared with the prior art, the present application provides a data transmission method, system, AutBus converter and medium. The method encapsulates IIC protocol data into a target data packet of AutBus protocol according to a pre-stored mapping table or a logical address of a destination device through a first conversion module, and forwards it to the corresponding destination device after verification by a second conversion module, thereby making full use of the AutBus bus protocol to carry and forward the IIC protocol data, thereby improving and expanding the IIC network, and effectively improving the transmission efficiency and transmission distance of the IIC network. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1A schematic diagram of the IIC bus data writing process provided by this application;
[0037] Figure 2 A schematic diagram of the IIC bus data reading process provided by this application;
[0038] Figure 3 A schematic diagram of the transmission system architecture of IIC data in the data transmission system provided by this application;
[0039] Figure 4 A flow chart of the data transmission method provided by this application;
[0040] Figure 5 A flow chart for obtaining a pre-stored mapping table in the data transmission method provided by the present application;
[0041] Figure 6 A flow chart of encapsulating a target data packet in the data transmission method provided by the present application;
[0042] Figure 7 A flow chart for verifying a target data packet in the data transmission method provided by the present application;
[0043] Figure 8 A flow chart for determining whether a target data packet is successfully received in the data transmission method provided by the present application;
[0044] Fig. 9 This is a schematic diagram of the first message interaction from an AutBus device to an IIC device in the data transmission method provided by this application;
[0045] Fig.10 This is a schematic diagram of the second message interaction from AutBus device to IIC device in the data transmission method provided in this application. DETAILED DESCRIPTION
[0046] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0047] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0048] Hereinafter, the terms "including", "having" and their cognates used in various embodiments of the present application are intended only to indicate specific features, numbers, steps, operations, elements, components or a combination of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or a combination of the foregoing items or increasing the possibility of one or more features, numbers, steps, operations, elements, components or a combination of the foregoing items. In addition, the terms "first", "second", "third" and the like are only used to distinguish descriptions and cannot be understood as indicating or implying relative importance.
[0049] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.
[0050] AutBus is a time-sensitive broadband bus technology, which is mainly used to solve the problem of low bandwidth of traditional buses in industrial sites and inability to carry real-time and non-real-time at the same time. The AutBus series of standards was developed by the National Industrial Process Measurement, Control and Automation Standardization Technical Committee (SAC / TC124) with the overall support of the Ministry of Industry and Information Technology. It is currently the only two-wire broadband bus international standard based on time-sensitive technology and Internet Protocol Version 6 (IPv6) technology. This series of standards solves the problems of unified addressing and deterministic communication of IPv6, realizes the full IPization of information technology (IT) protocols and operation technology (OT) protocols, supports the interconnection and interoperability of multiple protocols in the field of industrial communications, and the synchronous broadband transmission of big data such as control data, video, and pictures at the control layer, which can effectively meet the communication requirements of intelligent manufacturing such as high bandwidth, low latency, support for TSN (time-sensitive network), deterministic network, high clock accuracy, and high real-time. At present, chips based on this series of standards have been successfully developed and can be widely used in intelligent manufacturing related fields such as smart factories, industrial robots, ships, rails, smart transportation, petrochemicals, clean energy, automotive electronics, aviation and engineering equipment. Among them, the data format of the AutBus bus protocol is shown in Table 1 below.
[0051] Table 1
[0052]
[0053]
[0054] The TYPE values and meanings of DLPDU are shown in Table 2.
[0055] Table 2
[0056]
[0057] The IIC / I2C (Inter-Integrated Circuit) bus is a simple, bidirectional, two-wire synchronous serial bus used for communication between integrated circuits (ICs). This bus has been widely used in electronic device design due to its small number of pins, simple hardware implementation, and strong scalability. It is widely used in various types of integrated circuits, such as sensors, memories, microcontrollers, etc., and is commonly found in consumer electronics, automotive electronics, industrial control, smart homes, and other fields. Among them, the IIC bus write data process is as follows Figure 1 As shown, the IIC bus read data process is as follows Figure 2 shown.
[0058] In the IIC bus, there are one or more master devices and one or more slave devices. The master is responsible for starting and terminating data transfers and generating clock signals; the slave responds to the master's requests. Each slave device has a unique address that is used by the master to address a specific slave. Data transmission usually contains an address byte to specify the target slave, followed by a data byte.
[0059] The characteristics of the IIC bus also include:
[0060] 1. Support multi-master mode, allowing multiple devices to act as hosts at the same time.
[0061] 2. Capable of automatic arbitration, conflicts can be automatically resolved when two or more hosts start data transmission at the same time.
[0062] 3. It has high anti-interference ability and is suitable for use in noisy environments.
[0063] 4. Transmission speeds are usually divided into standard mode (100kbps), fast mode (400kbps), high-speed mode (3.4Mbps) and ultra-fast mode (5Mbps).
[0064] However, the IIC bus transmission efficiency is low and the distance is short. In order to be compatible with the IIC bus transmission mode and improve the IIC transmission efficiency and transmission distance.
[0065] Therefore, the present application provides a data transmission method, system, AutBus converter and medium. The data transmission method encapsulates the received IIC protocol data into a target data packet of the AutBus protocol according to a pre-stored mapping table or a logical address of a destination device through a first conversion module, realizes the carrying of the IIC protocol data by the AutBus bus protocol, and verifies the target data packet through a second conversion module and sends it to the corresponding destination device, thereby greatly improving the transmission efficiency and accuracy, and expanding the IIC protocol network into a dual-protocol network architecture, thereby effectively expanding the scope of application.
[0066] The data transmission method design is described below through some specific embodiments.
[0067] The present application provides a data transmission system, including:
[0068] A plurality of conversion modules, a plurality of devices and an AutBus bus; the conversion modules are connected to each other via the AutBus bus, and each conversion module is connected to at least one device; wherein the plurality of conversion modules include: a first conversion module and a second conversion module; the plurality of devices include: a source device and a destination device; the source device is connected to the first conversion module, and the destination device is connected to the second conversion module.
[0069] The first conversion module is used to receive the IIC protocol data sent by the source device and encapsulate the IIC protocol data into a target data packet of the AutBus protocol according to a pre-stored mapping table or the logical address of the destination device; the second conversion module is used to verify the target data packet; the second conversion module is also used to forward the target data packet to the destination device after the verification is passed.
[0070] Among them, the conversion modules are all AutBus converters, the devices are all IIC devices, and the IIC devices are devices that support the IIC protocol. The AutBus converter and the AutBus bus are used as a bridge to communicate between several IIC devices to build the IIC data transmission system architecture in this application. Please refer to Figure 3 In this application, the source device is IIC device A, the first conversion module is AutBus converter 1, the destination device is IIC device C, and the second conversion module is AutBus converter 3 as an example.
[0071] Exemplarily, after all devices and conversion modules are powered on, two data transmission modes are disclosed in the present application.
[0072] The first transmission method is the mapping method between the AutBus converter and the IIC device ID: the IIC device A (source device) sends the IIC protocol data to the AutBus converter 1 (first conversion module), and the AutBus converter 1 encapsulates the IIC protocol data into a target data packet of the AutBus protocol according to the mapping table in the pre-stored mapping table.
[0073] Then, the AutBus converter 1 transmits the target data packet to the AutBus converter 3 (second conversion module) through the AutBus bus, and the AutBus converter 3 verifies the destination address in the target data packet. When the destination address is verified to be the logical address of one of the devices in the second conversion module, that is, the destination device exists in the devices of the second conversion module, it means that the verification is successful. Finally, the AutBus converter 3 forwards the target data packet to the corresponding destination device.
[0074] The second transmission method is the IIC protocol broadcast method: similarly, the IIC device A (source device) sends the IIC protocol data to the AutBus converter 1 (first conversion module), and the AutBus converter 1 encapsulates the logical address of the destination device and the IIC protocol data together into a target data packet of the AutBus protocol.
[0075] Then, the AutBus converter 1 broadcasts the target data packet to all other conversion modules via the AutBus bus, and when the AutBus converter 3 (the second conversion module) verifies the destination address in the target data packet, it forwards the target data packet to the corresponding destination device.
[0076] It can be understood that in the present application, the IIC protocol data is encapsulated as a target data packet of the AutBus protocol according to the pre-stored mapping table or the logical address of the destination device by the first conversion module, and is forwarded to the corresponding destination device after verification by the second conversion module, thereby making full use of the AutBus bus protocol to carry and forward the IIC protocol data, thereby improving and expanding the IIC network, and effectively improving the transmission efficiency and transmission distance of the IIC network.
[0077] See also Figure 4 , the embodiment of the present application provides a data transmission method, including steps S100-S200:
[0078] S100: After receiving the IIC protocol data sent by the source device using the first conversion module, encapsulate the IIC protocol data into a target data packet of the AutBus protocol according to a pre-stored mapping table or a logical address of the destination device.
[0079] Exemplarily, after the source device sends the IIC protocol data to the first conversion module, in the first transmission mode (mapping method of AutBus converter and IIC device ID), the first conversion module obtains the identifier of the second conversion module connected to the destination device and the logical address of the destination device from the pre-stored mapping table, and encapsulates the identifier and the logical address of the destination device, as well as the IIC protocol data, into a target data packet of the AutBus protocol.
[0080] However, in the second transmission mode (IIC protocol broadcast method), the first conversion module directly encapsulates the logical address of the destination device and the IIC protocol data into a target data packet of the AutBus protocol.
[0081] It can be understood that in the present application, the first conversion module encapsulates the IIC protocol data into a target data packet of the AutBus protocol according to a pre-stored mapping table or the logical address of the destination device, thereby converting the IIC protocol data into a target data packet of the AutBus protocol, thereby providing the possibility for the AutBus bus protocol to carry the IIC protocol data, and providing the possibility for a dual-protocol network architecture of AutBus and IIC.
[0082] For example, in one implementation, see Figure 5 , according to the pre-stored mapping table or the logical address of the destination device, it also includes:
[0083] S80: Establish a mapping relationship between the identifier of each conversion module and the logical addresses of all devices connected thereto to obtain an initial mapping table.
[0084] S90: broadcast the initial mapping tables of all conversion modules to each other, so as to merge all the initial mapping tables to obtain a pre-stored mapping table.
[0085] Among them, all the devices here are IIC devices.
[0086] Exemplarily, when the entire system is powered on and an IIC device is connected to the AutBus converter, each AutBus converter will obtain the logical address of its own IIC device and generate a mapping table between the AutBus device ID and the source logical address of the IIC device, that is, bind the device address of the IIC device on it with its own identification and obtain the initial mapping table of each conversion module.
[0087] Then, the initial mapping tables of all conversion modules are mutually broadcasted, that is, each conversion module transmits its own initial mapping table to all other AutBus devices through the AutBus bus by broadcasting, so as to synchronize the AutBus device with the DEVID address, that is, to merge all the initial mapping tables to obtain the pre-stored mapping table. At this time, the pre-stored mapping table stores the mapping relationship between all AutBus converters and their corresponding connected IIC devices, and each conversion module has the mapping tables of all devices.
[0088] by Figure 3 For example, the pre-stored mapping table of all AutBus devices and their respective IIC devices is shown in Table 3 below.
[0089] Table 3
[0090] AutBus ID IIC DEVID 1 Device address of A 2 B's device address 3 Device address of C, device address of D 4 Device address of E 5 -
[0091] For example, in one implementation, see Figure 6 Step S100: encapsulate the IIC protocol data into a target data packet of the AutBus protocol according to the pre-stored mapping table or the logical address of the destination device, including:
[0092] S111. Obtain an identifier of a second conversion module, a logical address of a source device, and a logical address of a destination device described in a pre-stored mapping table.
[0093] S112, encapsulating the identifier as the node address, the logical address as the source address, the logical address of the destination device as the destination address, and the IIC protocol data as the data payload into an initial data packet of the AutBus protocol to obtain a target data packet.
[0094] Exemplarily, in the first transmission mode, after the first conversion module receives the IIC protocol data sent by the source device, the first conversion module obtains the identifier of the second conversion module, the logical address of the source device and the logical address of the destination device according to the mapping relationship between all devices and their respective conversion modules in the pre-stored mapping table.
[0095] Then, by expanding the TYPE area of the AutBus bus protocol, the reserved field 0x00 of TYPE is used to carry the IIC protocol, so the first conversion module can use the identifier of the second conversion module, the logical address of the source device, the logical address of the destination device and the IIC protocol data as the node address, source address, destination address and data payload in the initial data packet of the AutBus protocol, and obtain the target data packet. The data format of the AutBus bus protocol is shown in Table 4 below.
[0096] Table 4
[0097]
[0098]
[0099] The TYPE values and meanings of DLPDU are shown in Table 5.
[0100] Table 5
[0101]
[0102] The data format of the PAYLOAD (payload, i.e., data load) field in the initial data packet of the AutBus protocol at this time is as shown in Table 6. Then, in the PAYLOAD field in the initial data packet, the identifier of the second conversion module is written into the "Dst_NodeID" (node address) area, the logical address of the source device is written into the "SRC_DEVID" (source address) area, the logical address of the destination device is written into the "DST_DEVID" (destination address) area, and the IIC protocol data is written into the "DATA" (data) area, so as to obtain the target data packet.
[0103] Table 6
[0104]
[0105] ACK: Acknowledgment, Chinese name is confirmation, it is used to indicate the success or failure of data transmission, where ACK_NUM is the length of data successfully read or written.
[0106] For example, in another implementation method, step S110, encapsulating the IIC protocol data into a target data packet of the AutBus protocol according to a pre-stored mapping table or a logical address of the destination device, further includes:
[0107] The logical address of the source device is used as the source address, the logical address of the destination device is used as the destination address, and the IIC protocol data is used as the data payload, which are encapsulated into the initial data packet of the AutBus protocol to obtain the target data packet.
[0108] After the entire system is powered on, each AutBus converter will obtain the logical address of the IIC device connected to it, and broadcast the logical addresses of all IIC devices on the IIC bus to inform all devices existing in each conversion module.
[0109] Exemplarily, in the second transmission mode, after the first conversion module receives the IIC protocol data sent by the source device, the first conversion module directly uses the logical address of the source device, the logical address of the destination device and the IIC protocol data as the source address, destination address and data payload in the initial data packet of the AutBus protocol to obtain the target data packet.
[0110] The data format of the PAYLOAD field in the initial data packet of the AutBus protocol at this time is as shown in Table 7. Then, in the PAYLOAD field in the initial data packet, the logical address of the source device is written into the "SRC_DEVID" area, the logical address of the destination device is written into the "DST_DEVID" area, and the IIC protocol data is written into the "DATA" area, so as to obtain the target data packet.
[0111] Table 7
[0112]
[0113] S200: Verify the target data packet using the second conversion module.
[0114] Exemplarily, after obtaining the target data packet, in the first transmission mode, the first conversion module transmits the target data packet directly and individually (i.e., unicast mode) to the second conversion module via the AutBus bus according to the node address (identifier of the second conversion module) in the target data packet.
[0115] Then, the second conversion module verifies the target data packet according to the mapping table thereon (at this time, the content is equal to the preset mapping table) so as to decide whether to discard or forward the target data packet.
[0116] However, if the target data packet is obtained in the second transmission mode (without the identifier of the second conversion module), then at this time, the first conversion module broadcasts the target data packet to all other conversion modules (including the second conversion module) via the AutBus bus. Then, the second conversion module verifies the destination address in the target data packet according to the logical address of the destination device.
[0117] It can be understood that in the present application, the target data packet is verified by the second conversion module to perform data verification, thereby ensuring the accuracy and efficiency of data transmission.
[0118] For example, in one implementation, see Figure 7 Step S200: Verifying the target data packet using the second conversion module, including:
[0119] S210: Determine whether the destination address of the target data packet is the logical address of the device in the second conversion module in the pre-stored mapping table.
[0120] S220: When the result is yes, it indicates that the target data packet has passed the verification.
[0121] S230: When it is determined that the target data packet is not received, the target data packet is discarded.
[0122] Exemplarily, in the first transmission method, after the second conversion module receives the target data packet transmitted by the first conversion module, the second conversion module determines, based on its pre-stored mapping table, whether the destination address of the target data packet is the logical address of a device in the second conversion module, that is, verifies whether the destination address of the target data packet is the same as the logical address of one of the devices on the second conversion module.
[0123] If the verification result is yes, it means that the target data packet is verified, so the target data packet is forwarded to the corresponding device, that is, the destination device. If the verification result is no, the target data packet is discarded.
[0124] The data transmission method of the embodiment of the present application uses the first conversion module to encapsulate the IIC protocol data into a target data packet of the AutBus protocol according to the identifier of the second conversion module in the pre-stored mapping table and the logical address of the destination device. The second conversion module verifies the target data packet according to the pre-stored mapping table and forwards it to the destination device after the verification is passed, thereby realizing the use of the AutBus bus protocol to carry the IIC protocol data, adopting a network architecture combining AutBus devices and IIC devices, and making full use of the high-speed transmission advantages of AutBus devices, thereby effectively improving the transmission efficiency and accuracy. In addition, the transmission distance of the IIC network is expanded from several meters to 500 meters, and the bandwidth is expanded from several Mbps to 100Mbps, thereby effectively improving the problems of short transmission distance, small transmission bandwidth and low transmission efficiency of the IIC network.
[0125] S300: After the verification is passed, the target data packet is forwarded to the destination device using the second conversion module.
[0126] Exemplarily, in the first transmission mode, the second conversion module compares the destination address of the target data packet with the source address of the device stored in the mapping relationship of the second conversion module in the preset mapping table. If the destination address is the same as the source address of one of the devices in the mapping relationship, the verification is successful, that is, the destination device exists in the second conversion module.
[0127] However, in the second transmission mode, the second conversion module directly compares the destination address of the target data packet with the logical address of the destination device. If they are the same, it means that the verification is successful.
[0128] Then, after verification, the target data packet is sent to the corresponding device, that is, the destination device.
[0129] It can be understood that by sending the verified data packets to the corresponding devices, accurate forwarding is achieved, thereby improving the accuracy of data transmission.
[0130] For example, in another implementation method, forwarding a target data packet to a destination device includes:
[0131] The target data packet is written into the destination device in single byte by using the second conversion module, and the number of data bytes of the target data packet is recorded.
[0132] Exemplarily, in the second transmission mode, the second conversion module writes the target data packet into the destination device in single byte, records the number of data bytes of the target data packet, and then fills the number of data bytes into the "LEN" area of Table 7.
[0133] For example, in another implementation, see Figure 8 , forwarding the target data packet to the destination device, followed by:
[0134] S301. Utilize a second conversion module to receive confirmation signals returned by a destination device, and record the number of confirmation signals.
[0135] S302: Compare the number of confirmation signals with the number of recorded data bytes. If they are the same, it indicates that the destination device has successfully received the target data packet.
[0136] Exemplarily, in the second transmission mode, after the second conversion module forwards the target data packet to the destination device, the destination device returns an acknowledgment signal (ACK) to the second conversion module, and the second conversion module records the number of acknowledgment signals.
[0137] Then, the number of confirmation signals is compared with the number of data bytes: if they are the same, it means that the writing is successful. After that, the second conversion module sends a stop bit through the first conversion module to the source IIC device to complete the entire interaction of writing multiple bytes of data.
[0138] However, if the number of confirmation signals is not the same as the number of data bytes, the target data packet is discarded, indicating that the write fails. At this time, the second conversion module continuously sends two stop bits to the source IIC device.
[0139] Among them, in the second transmission method in the present application, the entire process of transmitting data from the source device to the destination device includes a write data operation from the source device to the destination device, and a read data operation from the source device to the destination device.
[0140] During the writing operation of the IIC device to the AutBus bus, the AutBus bus simulates the IIC bus to cache all the IIC data (i.e., IIC protocol data) that the source IIC device needs to write into the message (i.e., the initial data packet of the AutBus protocol) to obtain the target data packet, and records the number of bytes of the target data packet that needs to be written and fills it into LEN.
[0141] During the AutBus bus write operation to the IIC device, the AutBus bus writes the IIC data message (i.e. the target data packet) to the target IIC device as a single byte, and then records the number of ACK (confirmation signal) returned each time the write is completed. If the number of ACKs received is the same as the LEN (number of data bytes), it means that the write is successful. Then the source IIC message of the AutBus bus is returned.
[0142] However, the process of reading data from the source device to the destination device is as follows:
[0143] First, the source IIC device sends a read instruction to the source AutBus converter. The read instruction is a multi-byte read request message, and its format is shown in Table 8 below, so that the source AutBus converter obtains the number of IIC bytes to be read from the destination device and records it in the source AutBus converter. The AutBus bus simulates the IIC bus to cache the read request message into the message, and fills the length of the read data into the LEN area in Table 7. Among them, the LEN field value is the value of the IIC read byte recorded locally.
[0144] Table 8
[0145]
[0146] The meanings of the fields in the request message are shown in Table 9 below.
[0147] Table 9
[0148]
[0149]
[0150] Then, after receiving the message of reading multiple bytes, the destination AutBus converter connected to the destination IIC device performs a conventional IIC bus multi-byte read operation with the destination IIC device, and saves the read data to the DATA field in Table 7, that is, the IIC data read by the AutBus bus according to the length of the LEN value is filled into the message. In addition, an ACK is sent to the destination device once for each byte read, and the ACK field in the message is incremented by 1, and then returned to the source AutBus converter connected to the source IIC device after the reading is completed;
[0151] Finally, after the source AutBus converter receives the message, the source IIC device also performs the conventional IIC bus multi-byte read operation, thereby completing the multi-byte read and write.
[0152] In each read or write operation, when the destination device responds to the source device and the data transmission is completed, the destination device will send a stop signal (Stop Condition) to the source device, and then the first conversion module will respond to the stop information to end the communication. At other times, the first conversion module will not respond to the stop information transmitted by the destination device.
[0153] Among them, in the process of transmitting data from the source device to the destination device, there are two kinds of interaction processes between the IIC device and the AutBus device: one is that after the source IIC device and the AutBus device complete the batch message interaction, it is forwarded to the destination AutBus device (second conversion module) through the source AutBus device (first conversion module). After the destination AutBus device receives the encapsulated IIC message, it parses and converts it into the IIC protocol and sends it to the attached destination IIC device. Among them, the first message interaction diagram of the AutBus device to the IIC device is as follows: Fig. 9 As shown in the figure, IIC device 1 is used as the source device and IIC device 2 is used as the destination device; the other is that after the source IIC device sends a message, the source AutBus device encapsulates the IIC data and forwards it to the destination AutBus device. After receiving the message, the destination AutBus device parses and restores the IIC data, and then sends it to the attached destination IIC device, that is, only one IIC message is encapsulated in each AutBus message. Among them, the second message interaction diagram of the AutBus device to the IIC device is shown in the figure. Fig.10 shown.
[0154] Among them, the process of the destination device responding to the source device in the present application is similar to the process of the source device transmitting the message to the destination device mentioned above, and will not be further introduced here.
[0155] The present application also provides an AutBus converter. Exemplarily, the AutBus converter includes a processor and a memory, wherein the memory stores a computer program, and the processor runs the computer program to enable the AutBus converter to execute the functions of each module in the above-mentioned data transmission method or the above-mentioned data transmission system.
[0156] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU) and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or at least one of other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.
[0157] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.
[0158] The present application also provides a computer-readable storage medium for storing the computer program used in the above-mentioned AutBus converter. For example, the computer-readable storage medium may include but is not limited to: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0159] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0160] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0161] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application.
[0162] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A data transmission method, characterized in that: include: After receiving the IIC protocol data sent by the source device using the first conversion module, the IIC protocol data is encapsulated into a target data packet of the AutBus protocol according to a pre-stored mapping table or a logical address of the destination device; Verifying the target data packet using a second conversion module; The target data packet is forwarded to the destination device by the second conversion module after verification.
2. The data transmission method according to claim 1, characterized in that: The step of encapsulating the IIC protocol data into a target data packet of the AutBus protocol according to a pre-stored mapping table or a logical address of a destination device comprises: The logical address of the source device is used as the source address, the logical address of the destination device is used as the destination address, and the IIC protocol data is used as the data payload, and is encapsulated into an initial data packet of the AutBus protocol to obtain the target data packet.
3. The data transmission method according to claim 2, characterized in that: The forwarding of the target data packet to the destination device includes: The target data packet is written into the destination device in single byte by using the second conversion module, and the number of data bytes of the target data packet is recorded.
4. The data transmission method according to claim 3, characterized in that: The step of forwarding the target data packet to the destination device further comprises: Using the second conversion module to receive the confirmation signal returned by the destination device, and record the number of the confirmation signals; The number of the confirmation signals is compared with the number of recorded data bytes. When they are the same, it indicates that the destination device has successfully received the target data packet.
5. The data transmission method according to claim 1, characterized in that: The method further includes: Establish a mapping relationship between the identifier of each conversion module and the logical addresses of all devices connected to it to obtain an initial mapping table; The initial mapping tables of all the conversion modules are broadcasted to each other, so as to merge all the initial mapping tables to obtain the pre-stored mapping table.
6. The data transmission method according to claim 5, characterized in that: The step of encapsulating the IIC protocol data into a target data packet of the AutBus protocol according to the pre-stored mapping table or the logical address of the destination device further comprises: Obtaining an identifier of the second conversion module, a logical address of the source device, and a logical address of the destination device described in the pre-stored mapping table; The identifier is used as the node address, the logical address is used as the source address, the logical address of the destination device is used as the destination address, and the IIC protocol data is used as the data payload, and is encapsulated into an initial data packet of the AutBus protocol to obtain the target data packet.
7. The data transmission method according to claim 6, characterized in that: The verifying the target data packet by using the second conversion module includes: Determine whether the destination address of the target data packet is a logical address of a device in the second conversion module in the pre-stored mapping table; When the result is yes, it indicates that the target data packet has passed the verification; When it is determined that it is not, the target data packet is discarded.
8. A data transmission system, characterized in that: include: Several conversion modules, several devices and AutBus bus; The conversion modules are connected via the AutBus bus, and each of the conversion modules is connected to at least one of the devices; wherein the plurality of conversion modules include: a first conversion module and a second conversion module; the plurality of devices include: a source device and a destination device; the source device is connected to the first conversion module, and the destination device is connected to the second conversion module; The first conversion module is used for encapsulating the IIC protocol data into a target data packet of the AutBus protocol according to a pre-stored mapping table or a logical address of a destination device after receiving the IIC protocol data sent by the source device; The second conversion module is used to verify the target data packet; The second conversion module is further configured to forward the target data packet to the destination device after the verification is passed.
9. An AutBus converter, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the data transmission method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the steps of the data transmission method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
NTB cross-host domain verification system and method, computer equipment and medium
CN120358173A
Control method of protocol conversion device, protocol conversion device and storage medium
CN120475079A