Protocol conversion device, system and method, terminal device and storage medium
By designing protocol conversion equipment, using AUTBUS and SPI interface modules for data analysis and conversion, the problem of inconsistent communication protocols between devices in industrial automation systems is solved, and efficient data exchange and system stability are achieved.
Patent Information
- Application Number
- CN202510057345.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-04-25
AI Technical Summary
In the field of industrial automation, diversified device interfaces and communication protocols lead to poor data exchange between devices, affecting production efficiency and system stability.
A protocol conversion device is designed, including an SPI interface module, a control module and an AUTBUS interface module. Data is received through the AUTBUS interface module and parsed, SPI data frames are generated, and output to the SPI bus through the SPI interface module. At the same time, the device can also convert the SPI data frame into an AUTBUS data frame and output it to the AUTBUS bus.
It realizes seamless docking and efficient conversion between the AUTBUS bus and the SPI bus, solves the needs of data exchange and communication between different devices, and improves the compatibility and flexibility of the system.
Smart Images

Figure CN119892945A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication protocol technology, and in particular to a protocol conversion device, system, method, terminal device and storage medium. Background Art
[0002] In the field of industrial automation, production systems are becoming increasingly complex and intelligent, and seamless communication between devices has become crucial. Faced with diverse device interfaces and communication protocols, how to ensure that various devices can exchange data smoothly has become the key to improving production efficiency and ensuring stable system operation. Therefore, it is particularly important to study and implement conversion technology between different communication protocols. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a protocol conversion device, system, method, terminal device and storage medium, which can effectively solve the problems of how to improve the production efficiency and system stability of the production system.
[0004] In a first aspect, an embodiment of the present application provides a protocol conversion device, including an SPI interface module, a control module and an AUTBUS interface module;
[0005] The AUTBUS interface module is used to receive first data on the AUTBUS bus and transmit the first data to the control module;
[0006] The control module is used for parsing the first data based on the AUTBUS protocol to obtain an SPI data frame, and storing the SPI data frame in a buffer;
[0007] The control module is also used to output the SPI data frame in the buffer to the SPI bus via the SPI interface module at a preset time.
[0008] In some embodiments, the parsing and processing the first data based on the AUTBUS protocol to obtain an SPI data frame includes:
[0009] The first data is parsed according to the AUTBUS protocol format of the AUTBUS protocol to obtain a target address and valid data, and the valid data is used as the SPI data frame; the target address is an SPI device corresponding to the SPI data frame.
[0010] In some embodiments, the protocol conversion device further includes:
[0011] The SPI interface module is used to receive the second data on the SPI bus and transmit the second data to the control module;
[0012] The control module is used for encapsulating the second data based on the AUTBUS protocol to obtain an AUTBUS data frame, and the AUTBUS data frame is stored in a buffer;
[0013] The control module is also used to output the AUTBUS data frame in the buffer to the AUTBUS bus via the AUTBUS interface module.
[0014] In some embodiments, encapsulating the second data based on the AUTBUS protocol to obtain an AUTBUS data frame includes:
[0015] Constructing a frame header and a frame tail according to the AUTBUS protocol format requirements of the AUTBUS protocol, filling the destination address and the source address in the frame header, and placing the second data in the frame tail;
[0016] The frame header and the frame trailer are encapsulated into the AUTBUS data frame.
[0017] In a second aspect, an embodiment of the present application provides a protocol conversion system, including an AUTBUS device, an AUTBUS device, an SPI device, and a protocol conversion device;
[0018] The AUTBUS device is connected to the second end of the protocol conversion device via AUTBUS bus communication; the SPI device is connected to the first end of the protocol conversion device via SPI bus communication;
[0019] The AUTBUS device outputs first data to the AUTBUS bus; the protocol conversion device converts the first data into an SPI data frame, and outputs the SPI data frame to the SPI device at a first preset time.
[0020] In some embodiments, the protocol conversion system further includes:
[0021] The SPI device outputs second data to the protocol conversion device via the SPI bus;
[0022] The protocol conversion device converts the second data into an AUTBUS data frame, and outputs the AUTBUS data frame to the AUTBUS bus at a second preset time so as to be read by the AUTBUS device.
[0023] In a third aspect, an embodiment of the present application provides a protocol conversion method, which is applicable to the above-mentioned protocol conversion system, and the method includes:
[0024] The protocol conversion device processes the first data output by the AUTBUS device to obtain an SPI data frame, and outputs the SPI data frame to the SPI device at a first preset time;
[0025] Alternatively, the protocol conversion device processes the second data output by the SPI device to obtain an AUTBUS data frame, and outputs the AUTBUS data frame to the AUTBUS bus at a second preset time.
[0026] In some embodiments, the protocol conversion method further includes:
[0027] Controlling a chip select signal of the SPI device to be in a first level state, and establishing communication between the SPI device and the protocol conversion device;
[0028] At a preset time, the SPI device starts to output the first data to the protocol conversion device or the protocol conversion device starts to output the SPI data frame to the SPI device; the preset time is when the protocol conversion device completes the encapsulation of the destination address and the source address;
[0029] When the SPI device finishes outputting the first data, the chip selection signal of the SPI device is controlled to be in a second level state, thereby terminating the communication between the SPI device and the protocol conversion device.
[0030] In a fourth aspect, an embodiment of the present application provides a terminal device, the terminal device comprising a processor and a memory, the memory storing a computer program, and the processor being used to execute the computer program to implement the above-mentioned protocol conversion method.
[0031] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which implements the above-mentioned protocol conversion method when executed on a processor.
[0032] The embodiments of the present application have the following beneficial effects:
[0033] The protocol conversion device of the present application can realize the conversion processing and transmission of data on the two buses through the AUTBUS interface module, control module and SPI interface module, and realizes seamless connection and efficient conversion between two different bus protocols to meet the needs of data exchange and communication between different devices in a complex system. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] 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.
[0035] Figure 1An application scenario diagram of the SPI communication process of an embodiment of the present application is shown;
[0036] Figure 2 A topological structure diagram of a protocol conversion system in an embodiment of the present application is shown;
[0037] Figure 3 A structural block diagram of a protocol conversion device in an embodiment of the present application is shown;
[0038] Figure 4 The structure diagram of the AUTBUS protocol format in the embodiment of the present application is shown;
[0039] Figure 5 A flow chart of a protocol conversion method in an embodiment of the present application is shown.
[0040] Description of main component symbols:
[0041] 10-AUTBUS device; 20-AUTBUS master station; 30-SPI device; 40-protocol conversion device; 41-SPI interface module; 42-control module; 43-AUTBUS interface module. DETAILED DESCRIPTION
[0042] 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.
[0043] 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.
[0044] Hereinafter, the terms "including", "having" and their cognates that can be 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.
[0045] 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.
[0046] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0047] Converting widely used serial communication protocols into specific industrial bus protocols can not only enhance the compatibility and flexibility of production systems, but also reduce the difficulty of production system integration and improve overall performance.
[0048] The industrial fieldbus AUTBUS uses a two-wire medium and can support a maximum bandwidth of 100Mbps. It can provide fixed-bandwidth data services and variable-bandwidth data services for periodic / non-periodic real-time data and non-real-time data. The AUTBUS bus also uses advanced time-sensitive network technology to achieve high-precision clock synchronization, providing a strong guarantee for real-time data transmission in industrial sites. In terms of network topology, AUTBUS supports linear bus and ring topology bus network topologies. At the same time, it can also carry data transmission of Ethernet services of GB / T15629.3 and application services such as IPv6, with strong compatibility. However, AUTBUS is mainly used in industrial automation systems with high bandwidth, low latency and long-distance communication. In simple and short-distance application scenarios, the advantages of AUTBUS may not be obvious, and may even be too complicated and costly.
[0049] The SPI (Serial Peripheral Interface) is a synchronous serial communication interface widely used between microcontrollers and peripheral devices. It adopts master-slave mode and is mainly used for low-speed communication. The transmission rate is usually between 100kbps and 10Mbps. It is a standard, low-cost and reliable interface between microcontrollers and peripherals. SPI is a high-speed, full-duplex synchronous serial communication protocol. The communication process is as follows: Figure 1As shown in the figure, the SCLK (Serial Clock) pin is used to provide a clock signal to synchronize data transmission; the MOSI (Master Out Slave In) pin is used for the master device to send data to the slave device; the MISO (Master In Slave Out) pin is used for the slave device to send data to the master device; the SS (Slave Select) / CS (Chip Select) pin is used to select a specific slave device for communication. However, due to factors such as signal delay, signal attenuation and clock jitter, the SPI bus itself has certain limitations on transmission distance; and as the transmission distance increases, problems such as signal delay, signal attenuation and clock jitter will become more significant, thereby affecting the quality and stability of data transmission.
[0050] In view of the complementarity between the advantages and problems of the above-mentioned AUTBUS bus and SPI bus, the present application proposes a technical solution for protocol conversion between the AUTBUS bus and the SPI bus, which can solve the problem of limited transmission distance of the traditional SPI bus. At the same time, it provides a more efficient, economical and adaptable solution to the complexity and high cost that may exist in certain specific application scenarios of the AUTBUS bus.
[0051] The protocol conversion system is described below in conjunction with some specific embodiments.
[0052] Figure 2 A topological structure diagram of a protocol conversion system in an embodiment of the present application is shown. Exemplarily, the protocol conversion system includes an AUTBUS master station 20, an AUTBUS device 10, a plurality of SPI devices 30, and a protocol conversion device 40 corresponding to each SPI device 30; the AUTBUS device is communicatively connected to the AUTBUS master station via an AUTBUS bus, and the SPI device 30 is communicatively connected to a first end of the protocol conversion device 40, and a second end of the protocol conversion device 40 is connected to the AUTBUS device via the AUTBUS bus.
[0053] The AUTBUS master station 20 is the control and management center of the protocol conversion system, responsible for the configuration, monitoring and management of the entire AUTBUS bus system; it has powerful processing capabilities and rich interface resources, and can realize centralized control and time synchronization of various devices that communicate with each other in the protocol conversion system. The AUTBUS master station 20 communicates with each device through the AUTBUS bus, sends corresponding control instructions to each device, and receives status information of each device, thereby realizing real-time monitoring and scheduling of the entire industrial automation control process.
[0054] In some embodiments, the AUTBUS device 10 is a master station (management node) or terminal node in the protocol conversion system, and communicates with the protocol conversion device through the AUTBUS bus. The AUTBUS device 10 can be an industrial automation device such as a sensor, an actuator, a controller, etc., which sends and / or receives data according to the AUTBUS protocol to achieve interoperability and control between the AUTBUS device 10 and other devices in the protocol conversion system.
[0055] In some embodiments, the SPI device 30 communicates with the protocol conversion device (i.e., the AUTBUS-SPI gateway device) through its SPI interface; the SPI device 30 is generally used for data transmission and reception, and has the characteristics of high-speed, full-duplex, and synchronous communication. The protocol conversion device 40 is the core of the entire protocol conversion system, responsible for converting the first data on the AUTBUS bus into the SPI protocol format, i.e., the SPI data frame, and outputting the SPI data frame to the SPI device 30 at a first preset time; at the same time, the second data output by the SPI device 30 is converted into the AUTBUS protocol format, i.e., the AUTBUS data frame, and outputs the AUTBUS data frame to the AUTBUS bus at a second preset time. The protocol conversion device 40 implements a bridge between two different bus protocols, allowing originally incompatible devices to communicate with each other.
[0056] In some embodiments, the AUTBUS device 10 outputs the first data to the AUTBUS bus; the protocol conversion device 40 processes the first data to obtain an SPI data frame, and when obtaining AUTBUS bus resources, the SPI data frame is sent to the SPI device, thereby realizing that the first data output by the AUTBUS device 10 is sent to the corresponding SPI device after being processed by the protocol conversion device. At the same time, the second data output by the SPI device 30 is processed by the protocol conversion device to obtain an AUTBUS data frame, and the AUTBUS data frame is sent to the AUTBUS bus. When obtaining AUTBUS bus resources, the AUTBUS data frame on the AUTBUS bus will be read by the corresponding AUTBUS device 10, so that the AUTBUS device 10 can accurately obtain the second data of the corresponding SPI device.
[0057] In the protocol conversion system of this embodiment, the SPI device 30 receives and sends data as a slave device, the protocol conversion device 40 is the core of the protocol conversion system, that is, the AUTBUS-SPI gateway device to realize protocol conversion, the AUTBUS device 10 participates in bus communication as a terminal node, the AUTBUS master station 20 configures, monitors and manages each device in the system, and the AUTBUS bus is used as a communication medium to connect each device; through mutual communication and collaboration, each device realizes seamless conversion between different bus protocols, thereby forming an efficient and reliable industrial automation communication system.
[0058] In some embodiments, Figure 3 As shown, the protocol conversion device includes an SPI interface module 41, a control module 42 and an AUTBUS interface module 43; wherein the SPI interface module 41 is connected to the SPI bus via MOSI, MISO, SCLK clock lines and SS / CS chip select signal lines.
[0059] Exemplarily, the protocol conversion device completes the data transmission process of converting the SPI bus to the AUTBUS bus as follows: the SPI interface module 41 receives the second data on the SPI bus and transmits the second data to the control module 42; the control module 42 receives the second data from the SPI interface module 41, and then Figure 4 The AUTBUS protocol format structure shown in the figure encapsulates the second data, wherein the encapsulation process is: constructing a frame header and a frame trailer according to the AUTBUS protocol format requirements, and filling the destination address (i.e. Figure 4 Destination NAOID in the Figure 4 The source NAOID in the frame is placed, the second data is placed in the DTU at the end of the frame; the frame header and the frame end are encapsulated into an AUTBUS data frame. The encapsulated AUTBUS data frame is stored in the buffer; when the AUTBUS bus resource is obtained, the control module 42 reads the AUTBUS data frame from the buffer, and sends the AUTBUS data frame to the AUTBUS interface module 43, and the AUTBUS data frame is output to the AUTBUS bus via the AUTBUS interface module 43.
[0060] Exemplarily, the data transmission process of the protocol conversion device completing the conversion of the AUTBUS bus into the SPI bus is as follows: the AUTBUS interface module 43 receives the first data on the AUTBUS bus, and transmits the first data to the control module 42; the control module 42 parses the first data according to the AUTBUS protocol, obtains the target address and valid data, and uses the valid data as an SPI data frame, and the SPI data frame is stored in a buffer; when the AUTBUS bus resources are obtained, the SPI data frame in the buffer is output to the SPI bus via the SPI interface module 41, that is, the SPI interface module 41 receives the SPI data frame in the buffer, and outputs the SPI data frame to the corresponding SPI device via the SPI bus.
[0061] The protocol conversion system of this embodiment adopts a linear network topology. Of course, it can also adopt a connection method based on a ring, star or other bus network topology, which can realize the protocol conversion between the AUTBUS bus and the SPI bus.
[0062] In view of the fact that the SPI bus is known for its high-speed transmission capability, and the AUTBUS bus also has efficient data processing capabilities, the protocol conversion device in this embodiment ensures efficient, reliable and long-distance transmission of data on the AUTBUS bus by optimizing the data encapsulation and parsing process while maintaining the high-speed transmission characteristics of the SPI bus. In industrial automation systems, when there may be incompatibility issues between old and new equipment during equipment upgrades or renovations, the protocol conversion device allows access to the AUTBUS bus by adding a protocol conversion device while retaining the original SPI bus equipment, thereby avoiding large-scale equipment replacement and reducing upgrade costs, making the application of the AUTBUS bus in specific scenarios more economical and feasible, thereby providing users with more flexible and diverse industrial automation communication options.
[0063] Figure 5 A flow chart of a protocol conversion method in an embodiment of the present application is shown. Exemplarily, the protocol conversion method includes the following steps:
[0064] S100, controlling a chip select signal of the SPI device to be in a first level state, and establishing communication between the SPI device and a protocol conversion device.
[0065] In some embodiments, before all SPI devices are powered on, a unique ID of each SPI device is set, and the chip select signal of the SPI device is controlled to be at a low level, so that the SPI device establishes communication with the protocol conversion device.
[0066] S200, at a preset time, the SPI device starts to output second data to the protocol conversion device; or the protocol conversion device starts to output SPI data frames to the SPI device.
[0067] In some embodiments, after establishing communication, the protocol conversion device needs to encapsulate the destination NAOID and source NAOID of communication, and after the encapsulation is completed, the SPI device starts to transmit its first data to the protocol conversion device. For example, the SPI device starts to send a clock signal (SCLK) and sends the second data to the protocol conversion device bit by bit through the MOSI line; the protocol conversion device returns data to the SPI device through the MISO line; that is, the communication process between the SPI device and the protocol conversion device is full-duplex.
[0068] S300, when the first data or SPI data frame is outputted, the chip selection signal of the SPI device is controlled to be in a second level state, thereby terminating the communication between the SPI device and the protocol conversion device.
[0069] In some embodiments, in order to maintain low power consumption, when no communication transmission is required between the SPI device and the protocol conversion device, the chip select signal of the SPI device is controlled to be high level, thereby terminating the communication between the SPI device and the protocol conversion device.
[0070] S400, processing the first data output by the AUTBUS device to obtain an SPI data frame, and outputting the SPI data frame to the SPI device at a first preset time.
[0071] In some embodiments, the AUTBUS interface module 43 of the protocol conversion device receives the first data of the specified time slot on the AUTBUS bus, and the control module 42 parses the first data to extract key information therein, such as the destination NAOID, the source NAOID and the data of the DTU part, wherein the data of the DTU part is valid data, and the valid data is used as an SPI data frame, and the parsed SPI data frame is output to the SPI bus through the SPI interface module 41 to be sent to the corresponding SPI device. During the sending process, it is necessary to ensure that the data on the MOSI signal line is stably and reliably transmitted within each clock cycle of the SCLK signal.
[0072] S500, processing the second data output by the SPI device to obtain an AUTBUS data frame, and outputting the AUTBUS data frame to the AUTBUS bus at a second preset time.
[0073] In some embodiments, since the second data output by the SPI device is usually a raw byte stream and has no fixed frame structure, the protocol conversion device constructs a frame header and a frame trailer according to the AUTBUS protocol format requirements of the AUTBUS protocol, fills the destination address and the source address in the frame header, places the second data in the DTU at the end of the frame, and then encapsulates the frame header and the frame trailer into an AUTBUS data frame. The encapsulated AUTBUS data frame is placed in a buffer, and when the AUTBUS bus resources are obtained, the AUTBUS data frame is transmitted to the AUTBUS bus to be read by the corresponding AUTBUS device. It can also be described as that the SPI interface module of the protocol conversion device obtains the second data on the SPI bus, the control module converts the second data into an AUTBUS data frame, and the AUTBUS interface module outputs the AUTBUS data frame to the AUTBUS bus.
[0074] The protocol conversion method of this embodiment realizes seamless connection and efficient conversion between two different bus protocols to meet the needs of data exchange and communication between different devices in a complex system, improve the overall compatibility and flexibility of the system, and promote technological progress and application expansion in the fields of industrial automation and the Internet of Things.
[0075] The present application also provides a terminal device, which exemplarily includes a processor and a memory, wherein the memory stores a computer program, and the processor runs the computer program to enable the terminal device to perform the above-mentioned protocol conversion method. For example, the terminal device can be some repeaters, converters, etc., which complete the conversion between two protocols and realize the transmission of data between different devices.
[0076] 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.
[0077] 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.
[0078] The present application also provides a computer-readable storage medium for storing the computer program used in the above-mentioned terminal device. For example, the computer-readable storage medium may include, but is not limited to, various media that can store program codes, such as 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.
[0079] 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, a program segment or a part of a 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.
[0080] 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.
[0081] 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.
[0082] 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 protocol conversion device, characterized in that: Including SPI interface module, control module and AUTBUS interface module; The AUTBUS interface module is used to receive first data on the AUTBUS bus and transmit the first data to the control module; The control module is used for parsing the first data based on the AUTBUS protocol to obtain an SPI data frame, and storing the SPI data frame in a buffer; The control module is also used to output the SPI data frame in the buffer to the SPI bus via the SPI interface module at a preset time.
2. The protocol conversion device according to claim 1, characterized in that: The step of parsing the first data based on the AUTBUS protocol to obtain an SPI data frame includes: The first data is parsed according to the AUTBUS protocol format of the AUTBUS protocol to obtain a target address and valid data, and the valid data is used as the SPI data frame; the target address is an SPI device corresponding to the SPI data frame.
3. The protocol conversion device according to claim 1, characterized in that: Also includes: The SPI interface module is used to receive the second data on the SPI bus and transmit the second data to the control module; The control module is used for encapsulating the second data based on the AUTBUS protocol to obtain an AUTBUS data frame, and the AUTBUS data frame is stored in a buffer; The control module is also used to output the AUTBUS data frame in the buffer to the AUTBUS bus via the AUTBUS interface module.
4. The protocol conversion device according to claim 3, characterized in that: The encapsulating the second data based on the AUTBUS protocol to obtain an AUTBUS data frame includes: Constructing a frame header and a frame tail according to the AUTBUS protocol format requirements of the AUTBUS protocol, filling the destination address and the source address in the frame header, and placing the second data in the frame tail; The frame header and the frame trailer are encapsulated into the AUTBUS data frame.
5. A protocol conversion system, characterized in that: Including AUTBUS devices, AUTBUS devices, SPI devices and protocol conversion devices; The AUTBUS device is connected to the second end of the protocol conversion device through the AUTBUS bus; the SPI device is connected to the first end of the protocol conversion device through the SPI bus; The AUTBUS device outputs first data to the AUTBUS bus; The protocol conversion device converts the first data into an SPI data frame, and outputs the SPI data frame to the SPI device at a first preset time.
6. The protocol conversion system according to claim 5, characterized in that: Also includes: The SPI device outputs second data to the protocol conversion device via the SPI bus; The protocol conversion device converts the second data into an AUTBUS data frame, and outputs the AUTBUS data frame to the AUTBUS bus at a second preset time so as to be read by the AUTBUS device.
7. A protocol conversion method, characterized in that: Applicable to the protocol conversion system according to claim 5 or 6, the method comprising: The protocol conversion device processes the first data output by the AUTBUS device to obtain an SPI data frame, and outputs the SPI data frame to the SPI device at a first preset time; Alternatively, the protocol conversion device processes the second data output by the SPI device to obtain an AUTBUS data frame, and outputs the AUTBUS data frame to the AUTBUS bus at a second preset time.
8. The protocol conversion method according to claim 7, characterized in that: Also includes: Controlling a chip select signal of the SPI device to be in a first level state, and establishing communication between the SPI device and the protocol conversion device; At a preset time, the SPI device starts to output the first data to the protocol conversion device or the protocol conversion device starts to output the SPI data frame to the SPI device; The preset time is when the protocol conversion device completes the encapsulation of the destination address and the source address; When the SPI device finishes outputting the first data, the chip selection signal of the SPI device is controlled to be in a second level state, thereby terminating the communication between the SPI device and the protocol conversion device.
9. A terminal device, characterized in that: The terminal device comprises a processor and a memory, the memory stores a computer program, and the processor is used to execute the computer program to implement the protocol conversion method described in claim 7 or 8.
10. A computer-readable storage medium, characterized in that: The computer program stores a computer program, which, when executed on a processor, implements the protocol conversion method according to claim 7 or 8.
Citation Information
Cited By
Rapid message forwarding method and device, storage medium and electronic equipment
CN121462683A