A bus multi-protocol conversion control method, device, equipment and storage medium

By implementing multi-protocol conversion control in the bus module and dynamically acquiring and converting protocol device type codes, the problem of single-protocol limitation in the existing technology is solved, multi-protocol support and user selection are facilitated, and equipment costs are reduced.

CN118368346BActive Publication Date: 2024-08-30SHENZHEN SANMING ELECTRIC CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410767023.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-08-30
Estimated Expiration
2044-06-14

AI Technical Summary

Technical Problem

Existing bus modules can only support one network protocol, resulting in users needing to purchase multiple devices to adapt to multiple protocols, which increases costs, and numerous models make selection difficult.

Method used

By implementing a multi-protocol conversion control method in the bus module, the wireless master station is used to receive messages, determine whether the target address is in the same network, dynamically obtain the protocol device type code, realize the conversion of the primary target address to the actual target address, and perform the conversion according to the preset Set the protocol format to send the message.

Benefits of technology

It realizes the multi-protocol integration and conversion control of the bus module, improves the portability and versatility of user selection, and reduces the number and cost of equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118368346B
    Figure CN118368346B
Patent Text Reader

Abstract

The present invention discloses a bus multi-protocol conversion control method, device, equipment and storage medium. The present invention controls the wireless master station in the bus module to receive the first message, determines whether the primary target address of the first message and the wireless master station are in the same network; controls the wireless master station to send the first message; writes the first message sent by the wireless master station into the sending buffer area of ​​the bus module; dynamically obtains the first protocol device type code in the bus module, and sends the first message to the buffer partition of the first bus master station; polls the first bus master station to confirm that the first message is received; obtains the actual target address of the first message, and waits for address conversion; determines the mapping relationship to realize the conversion from the primary target address to the actual target address; sends the first message to the actual target address according to the preset first bus protocol format. The present invention can realize multi-protocol integration and conversion control of the bus module, has a wide range of use scenarios, strong versatility, and high portability for user selection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of bus control technology, and in particular to a bus multi-protocol conversion control method, device, equipment and storage medium. Background Art

[0002] The bus module, also known as the bus device, can control the bus and is the bottom-level data communication network in the field of automation. The bus module is used in the production site to connect the intelligent field equipment and the automatic control system with a two-way transmission and branch structure communication network, and can exchange data with other communicative devices.

[0003] The bus module is provided with at least one communication network port, which is connected to the host control system for data transmission. In the prior art, the network protocols covered by the bus module generally include EtherCAT bus protocol, CC-LINK bus protocol, Profinet bus protocol, ModbusTCP bus protocol, CANopen bus protocol, DeviceNet bus protocol, etc. In the existing bus module, each device is only provided with one bus protocol, so when users purchase bus module devices, they need to purchase multiple bus devices to meet the use requirements of adapting to multiple bus protocols, which increases costs.

[0004] In addition, since the bus modules of each bus protocol are often named according to the bus protocol category, the number of input terminals and output terminals, the named models are too many, which makes it difficult for users to select models. Therefore, it is an urgent problem for technicians in this field to invent a multi-protocol integrated conversion control circuit that can integrate multiple bus protocols on a bus module. Summary of the invention

[0005] In view of the above defects, the embodiments of the present invention provide a bus multi-protocol conversion control method, device, equipment and storage medium to solve the problems existing in the prior art.

[0006] In order to solve the above technical problems, an embodiment of the present invention provides a bus multi-protocol conversion control method, the method comprising:

[0007] Controlling the wireless master station in the bus module to receive the first message, and determining whether the primary target address of the first message and the wireless master station are in the same network;

[0008] If the primary target address of the first message and the wireless master station are in the same network, controlling the wireless master station to send the first message;

[0009] Writing the first message sent by the wireless master station into the sending buffer area of ​​the bus module;

[0010] Dynamically obtain a first protocol device type code in the bus module, and send the first message to a buffer partition of the first bus master station according to the first protocol device type code;

[0011] Controlling the wireless master station to poll the first bus master station to confirm that the first bus master station has received the first message;

[0012] obtaining an actual target address of the first message according to the first bus master station, and waiting for address conversion;

[0013] Determine a mapping relationship between the primary target address and the actual target address, and implement conversion from the primary target address to the actual target address;

[0014] The first message is sent to the actual target address according to a preset first bus protocol format.

[0015] Preferably, the bus multi-protocol conversion control method further includes:

[0016] Dynamically obtain a second protocol device type code in the bus module, and send the first message to a buffer partition of a second bus master station according to the second protocol device type code;

[0017] Controlling the wireless master station to poll the second bus master station to confirm that the second bus master station has received the first message;

[0018] obtaining an actual target address of the first message according to the second bus master station, and waiting for address conversion;

[0019] Determine a mapping relationship between the primary target address and the actual target address, and implement conversion from the primary target address to the actual target address;

[0020] The first message is sent to the actual target address according to a preset second bus protocol format.

[0021] Preferably, the bus multi-protocol conversion control method further includes:

[0022] Controlling the first bus master station in the bus module to receive a second message;

[0023] Controlling the first bus master station to unpack the second message into general data;

[0024] storing the general data in a buffer partition of the first bus master;

[0025] Controlling the microprocessor to call the general data, and transferring the general data to the buffer partition of the third bus master station according to a preset address mapping relationship;

[0026] Controlling the third bus master station to repackage the universal data into a third bus protocol message;

[0027] The third bus protocol message is sent to a preset target address.

[0028] Preferably, before sending the first message to the actual target address according to the preset first bus protocol format, the method includes:

[0029] Determining whether the first message carries an emergency message identifier;

[0030] If the first message carries an emergency message identifier, the first bus master station is controlled to directly operate a sub-node of the first bus master station to transmit the first message.

[0031] Preferably, the dynamically acquiring the first protocol device type code in the bus module and sending the first message to the buffer partition of the first bus master station according to the first protocol device type code comprises:

[0032] Control the bus module to obtain the protocol device type code input from the outside in real time;

[0033] Determine whether the protocol device type code input externally is the same as the previous protocol device type code;

[0034] If they are the same, directly feeding back the protocol device type code to the wireless master station;

[0035] If they are not the same, the protocol device type code input externally covers the previous protocol device type code and is then fed back to the wireless master station.

[0036] Preferably, the determining of the mapping relationship between the primary target address and the actual target address to achieve conversion from the primary target address to the actual target address comprises:

[0037] Reading a structure array in an address translation mapping area in a microprocessor to determine a mapping relationship between the primary target address and the actual target address;

[0038] The conversion from the primary target address to the actual target address is implemented according to the structure array.

[0039] Preferably, the wireless master station in the control bus module receives the first message, and determines whether the primary target address of the first message and the wireless master station are in the same network, including:

[0040] If the primary destination address of the first message is not in the same network as the wireless master station;

[0041] Controlling the wireless master station to poll the network sub-nodes to achieve automatic addressing;

[0042] Implement new network configuration based on the results of automatic addressing;

[0043] If the configuration is successful, the wireless master station is controlled to send the first message.

[0044] In order to solve the above technical problems, an embodiment of the present invention provides a bus multi-protocol conversion control device, the device comprising:

[0045] A network determination module, used for controlling the wireless master station in the bus module to receive the first message, and determining whether the primary target address of the first message and the wireless master station are in the same network;

[0046] a message sending module, for controlling the wireless master station to send the first message if the primary target address of the first message is in the same network as the wireless master station;

[0047] A data writing module, used for writing the first message sent by the wireless master station into the sending buffer area of ​​the bus module;

[0048] A device type code confirmation module is used to dynamically obtain a first protocol device type code in the bus module, and send the first message to a buffer partition of the first bus master station according to the first protocol device type code. The device type code confirmation module includes:

[0049] A protocol device type code confirmation unit, used to control the bus module to obtain an externally input protocol device type code in real time;

[0050] A judging unit, used to judge whether the protocol device type code input externally is the same as the previous protocol device type code;

[0051] A first feedback unit, configured to directly feed back the protocol device type code to the wireless master station if the protocol device type code is the same;

[0052] A second feedback unit is used for overwriting the previous protocol device type code with the protocol device type code input externally and then feeding back to the wireless master station if they are different;

[0053] A polling control module, used for controlling the wireless master station to poll the first bus master station to confirm that the first bus master station has received the first message;

[0054] an actual target address confirmation module, used for obtaining the actual target address of the first message according to the first bus master station, and waiting for address conversion;

[0055] An address conversion module, used to determine a mapping relationship between the primary target address and the actual target address, and to achieve conversion from the primary target address to the actual target address;

[0056] A message sending module, used for sending the first message to the actual target address according to a preset first bus protocol format;

[0057] A wired receiving module, used for controlling the first bus master station in the bus module to receive a second message;

[0058] An unpacking module, used for controlling the first bus master station to unpack the second message into general data;

[0059] A storage module, used for storing the general data in a buffer partition of the first bus master;

[0060] A mapping module, used for controlling the microprocessor to call the general data, and transferring the general data to the buffer partition of the third bus master station according to a preset address mapping relationship;

[0061] A packet assembly module, used for controlling the third bus master station to re-pack the general data into a third bus protocol message;

[0062] The wired sending module is used to send the third bus protocol message to a preset target address.

[0063] To solve the above technical problems, an embodiment of the present invention provides a bus multi-protocol conversion control device, comprising: at least one microprocessor, at least one memory, and computer program instructions stored in the memory. When the computer program instructions are executed by the microprocessor, the method of the first aspect in the above embodiment is implemented.

[0064] To solve the above technical problem, an embodiment of the present invention provides a storage medium on which computer program instructions are stored. When the computer program instructions are executed by a microprocessor, the method of the first aspect in the above embodiment is implemented.

[0065] In summary, the embodiments of the present invention provide a bus multi-protocol conversion control method, device, equipment and storage medium. The present invention controls the wireless master station in the bus module to receive the message, determines whether the primary target address of the message is in the same network as the wireless master station; if the primary target address of the message is in the same network as the wireless master station, controls the wireless master station to send the message; writes the message sent by the wireless master station into the sending buffer of the bus module; obtains the first protocol device type code of the first bus master station in the bus module; sends the message in the sending buffer to the buffer partition of the first bus master station according to the first protocol device type code; controls the wireless master station to poll the first bus master station to confirm that the first bus master station receives the message; obtains the actual target address of the message and waits for address conversion; determines the mapping relationship between the primary target address and the actual target address, realizes the conversion from the primary target address to the actual target address; sends the message to the actual target address according to the preset bus protocol format. Therefore, the present invention can realize the multi-protocol integration and conversion control of the bus module, has strong versatility, and improves the portability of user selection. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the following briefly introduces the drawings required for use in the embodiment of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0067] Figure 1 The present invention is a flowchart of a bus multi-protocol conversion control method according to an embodiment of the present invention.

[0068] Figure 2 It is a principle architecture diagram of a bus multi-protocol conversion control method according to an embodiment of the present invention.

[0069] Figure 3 The present invention is a flowchart of a bus multi-protocol conversion control method according to an embodiment of the present invention.

[0070] Figure 4 It is a flow chart of an embodiment of the present invention for dynamically acquiring a first protocol device type code in a bus module and sending a first message to a buffer partition of a first bus master station according to the first protocol device type code.

[0071] Figure 5 It is a flow chart of a control method for a wireless master station in a bus module to receive a first message and determine whether a primary target address of the first message and the wireless master station are in the same network according to an embodiment of the present invention.

[0072] Figure 6 It is a structural schematic diagram of a bus multi-protocol conversion control device according to an embodiment of the present invention.

[0073] Figure 7It is a structural schematic diagram of a bus multi-protocol conversion control device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0074] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and Examples. It should be understood that the specific embodiments described herein are only configured to explain the present invention and are not configured to limit the present invention. For those skilled in the art, the present invention can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present invention by illustrating examples of the present invention.

[0075] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0076] See also Figure 1 , Figure 1 This is a flowchart of a bus multi-protocol conversion control method provided by the present application. The method comprises the following steps:

[0077] S1. Control the wireless master station in the bus module to receive a first message, and determine whether the primary target address of the first message and the wireless master station are in the same network.

[0078] Specifically, the bus module microprocessor of the present application is integrated with an industrial wireless network protocol and an industrial field bus protocol. In this embodiment, the bus module and the host control system such as PLC transmit data via the industrial wireless network protocol, the bus module is connected to the external industrial equipment via the bus network cable, and the bus module and the external industrial equipment transmit data via the industrial field bus protocol, and the bus module plays the role of a data transfer station.

[0079] Specifically, in this embodiment, the wireless master station first receives a message from the host control system, and the wireless master station receives the first message and determines whether the primary target address of the first message is in the same network as the wireless master station. The wireless master station and other industrial field buses are pre-configured, and the primary target address of the first message refers to the IP address of the other industrial field bus connected to the wireless master station.

[0080] S2. If the primary target address of the first message and the wireless master station are in the same network, control the wireless master station to send the first message.

[0081] S3. Write the first message sent by the wireless master station into the sending buffer area of ​​the bus module.

[0082] Specifically, in this embodiment, a sending buffer is set in the microprocessor of the bus module, and the sending buffer is used to temporarily store the data to be forwarded by the wireless master station. After the wireless master station confirms that the primary target address of the first message is under the child node of the wireless master station, the wireless master station forwards the message from the host control system to the sending buffer of the bus module.

[0083] S4. Dynamically obtain a first protocol device type code in the bus module, and send the first message to the buffer partition of the first bus master station according to the first protocol device type code.

[0084] Specifically, in this embodiment, different bus masters are distinguished by protocol device type codes. For example, the first bus master is a Modbus protocol master, and the protocol device type code is 00. The microprocessor of the bus module writes the type definition of the first bus master in a configuration file of the internal memory.

[0085] Specifically, each master station protocol is converted through a protocol device type code. In one embodiment, an encoder is provided on the bus module body, and the user inputs a protocol type selection signal through the encoder, and the microprocessor in the bus module performs signal analysis to determine the bus protocol type code pointed to by the protocol type selection signal. After determining the protocol device type code, the microprocessor of the bus module sends the first message to the buffer partition of the first bus master station corresponding to the protocol device type code. Therefore, the bus module of the present application can integrate multiple bus protocols, and the user can independently realize the conversion of the bus protocol according to the use requirements, and the portability is high.

[0086] In another embodiment, the bus module can also be connected to the mobile terminal through a wireless main station. The user can input the protocol type selection signal through the APP or mini program on the mobile terminal. The bus module remotely receives the protocol type selection signal. The input method of the protocol type selection signal is not specifically limited here.

[0087] It is worth noting that in the present application, the subnode of the wireless master station is connected to multiple wired bus master stations, and each bus master station is provided with a separate buffer partition for storing the message data sent by the microprocessor of the bus module. Therefore, when the bus master station sends the message data to the external slave station device, it can quickly locate the message data and directly distribute the corresponding message data from the separate buffer partition of each bus module, thereby improving the communication rate.

[0088] Specifically, in this embodiment, in each different usage scenario, the user first needs to connect the bus module and the PLC host control system and external industrial equipment through the corresponding bus network cable. Therefore, before the bus module officially starts working, it is necessary to rotate the encoder according to the different usage scenarios to input the corresponding protocol type selection signal.

[0089] It is understandable that the protocol type selection signal input by the user changes in real time, so that the microprocessor in the bus module of the present application dynamically obtains the first protocol device type code so as to accurately send the message to the buffer partition of the corresponding bus master station.

[0090] S5. Control the wireless master station to poll the first bus master station to confirm that the first bus master station has received the first message.

[0091] S6. Obtain the actual target address of the first message according to the first bus master station, and wait for address conversion.

[0092] Specifically, in this embodiment, the wireless master station polls the first bus master station, and if the first bus master station does not receive the message, a retransmission mechanism is triggered to ensure that the first message is sent to the buffer partition of the first bus master station.

[0093] Specifically, in this embodiment, if the first bus master receives the first message, the first bus master obtains the network source address and the target address of the first message and waits for address conversion.

[0094] Specifically, the first bus master station in the present application can be set to one of EtherCAT protocol master station, CC-LINK protocol master station, Profinet protocol master station, ModbusTCP protocol master station, CANopen protocol master station, DeviceNet protocol master station, Profibus protocol master station or Can protocol master station, which is not specifically limited here. Taking Modbus protocol master station as an example, Modbus protocol is a commonly used communication protocol in industry. Modbus protocol includes RTU, ASCI, TCP. In the Modbus / TCP network, the Modbus bus master station is used to receive messages from different network devices. When the Modbus bus master station receives a message, it is necessary to determine the source address and destination address of the message in order to correctly process and forward the message.

[0095] Specifically, the Modbus / TCP protocol is based on the TCP / IP network and uses IP addresses and port numbers to identify devices in the network. However, the Modbus protocol itself uses device addresses, which are usually values ​​between 0 and 247, which were defined in the Modbus serial communication era. Therefore, when the Modbus protocol is transmitted over a TCP / IP network, the IP address and port number need to be converted to the Modbus device address, or vice versa. Therefore, when the Modbus / TCP master receives a message, it obtains the actual target address of the first message and waits for the address conversion, thereby ensuring that the first message can be correctly and securely transmitted and processed in a complex network environment.

[0096] S7. Determine a mapping relationship between the primary target address and the actual target address to achieve conversion from the primary target address to the actual target address.

[0097] Specifically, in this embodiment, the primary target address is the IP address and port number of the first bus master station to which the wireless master station is connected, and the actual target address is the device address of the external industrial device, namely the Modbus slave station. It can be understood that the mapping relationship between the primary target address and the actual target address is preset and stored inside the microprocessor of the bus module for the bus master station to call.

[0098] S8. Send the first message to the actual target address according to the preset first bus protocol format.

[0099] Specifically, after the conversion from the primary target address to the actual target address is completed, the first bus master station encapsulates the first message into a preset first bus protocol format, and sends the first message to the device address of the external industrial device, ie, the Modbus slave station.

[0100] Therefore, in this embodiment, the host control system first communicates with the bus module through the wireless master station to forward the first message; after the wireless master station receives the first message, it polls the wireless network sub-node and sends the first message to the first bus master station through the microprocessor, and the first bus master station then transmits the message data to the external industrial equipment.

[0101] In summary, the present application provides a bus multi-protocol conversion control method. In this scheme, by controlling the wireless master station in the bus module to receive the message, it is determined whether the primary target address of the message is in the same network as the wireless master station; if the primary target address of the message is in the same network as the wireless master station, the wireless master station is controlled to send the message; the message sent by the wireless master station is written into the sending buffer area of ​​the bus module; the first protocol device type code of the first bus master station in the bus module is obtained; according to the first protocol device type code, the message in the sending buffer is sent to the buffer partition of the first bus master station; the wireless master station is controlled to poll the first bus master station to confirm that the first bus master station has received the message; the actual target address of the message is obtained, and the address conversion is waited for; the mapping relationship between the primary target address and the actual target address is determined to realize the conversion from the primary target address to the actual target address; the message is sent to the actual target address according to the preset bus protocol format. Therefore, the present invention can realize the multi-protocol integration and conversion control of the bus module, has strong versatility, and improves the portability of user selection.

[0102] Based on the above embodiments:

[0103] See also Figure 2 , Figure 2 A schematic diagram of the principle architecture of a bus multi-protocol conversion control method provided in this application.

[0104] As a preferred embodiment, a bus multi-protocol conversion control method further includes:

[0105] The second protocol device type code in the bus module is dynamically acquired, and the first message is sent to the buffer partition of the second bus master station according to the second protocol device type code.

[0106] Specifically, in this embodiment, different bus masters are distinguished by protocol device type codes. For example, the second bus master is a Profibus protocol master, and the protocol device type code is 01. The microprocessor of the bus module writes the type definition of the second bus master in a configuration file of the internal memory.

[0107] Specifically, the second bus master station in the present application can be set to one of EtherCAT protocol master station, CC-LINK protocol master station, Profinet protocol master station, ModbusTCP protocol master station, CANopen protocol master station, DeviceNet protocol master station, Profibus protocol master station or Can protocol master station, without specific limitation here.

[0108] Specifically, when the bus protocol type code pointed to by the protocol type selection signal input by the user through the encoder is the bus protocol type code of the second bus master, the microprocessor of the bus module sends the first message to the buffer partition of the second bus master.

[0109] The wireless master station is controlled to poll the second bus master station to confirm that the second bus master station has received the first message.

[0110] The actual target address of the first message is obtained according to the second bus master station, and the address conversion is waited for.

[0111] Determine the mapping relationship between the primary target address and the actual target address, and realize the conversion from the primary target address to the actual target address.

[0112] The first message is sent to the actual target address according to the preset second bus protocol format.

[0113] Therefore, in this embodiment, the host control system first communicates with the bus module through the wireless master station to forward the first message; after receiving the first message, the wireless master station polls the wireless network sub-node and sends the first message to the second bus master station through the microprocessor, and the second bus master station then transmits the message data to the external industrial device. It can be understood that the data transmission process between the wireless master station, the microprocessor, and the second bus master station is the same as the data transmission process between the wireless master station, the microprocessor, and the first bus master station, and will not be repeated here.

[0114] See also Figure 3 , Figure 3 A flowchart of a bus multi-protocol conversion control method provided in this application.

[0115] As a preferred embodiment, a bus multi-protocol conversion control method further includes:

[0116] S1', controlling the first bus master station in the bus module to receive the second message.

[0117] Specifically, in this embodiment, the host control system communicates with the bus module through the first bus master station, and the first bus master station receives the second message sent by the host control system.

[0118] S2', controlling the first bus master station to unpack the second message into universal data.

[0119] Specifically, in this embodiment, the first bus master station communicates with the microprocessor of the bus module to exchange data. The first bus master station is used to implement protocol data packaging and protocol data unpacking. The first bus master station can receive the corresponding protocol message from the external bus and unpack the protocol message into general data. In addition, the first bus master station can also receive the general data sent from the microprocessor, and send it to the external bus after protocol packaging.

[0120] S3', store the common data in the buffer partition of the first bus master.

[0121] Specifically, after the first bus master unpacks the second message into general data, the general data is stored in a buffer partition of the first bus master, waiting to be called by the microprocessor.

[0122] S4', controlling the microprocessor to call the general data, and transferring the general data to the buffer partition of the third bus master station according to the preset address mapping relationship.

[0123] Specifically, in this embodiment, the buffer partition of the first bus master is expanded to become a part of the microprocessor storage area, which can be uniformly addressed. The microprocessor then calls the data of the buffer partition of the first bus master and transfers it to the buffer partition of the third bus master according to the preset address mapping relationship.

[0124] S5', controlling the third bus master station to repackage the common data into a third bus protocol message.

[0125] S6', sending the third bus protocol message to the preset target address.

[0126] Specifically, the third bus master repackages the common data into a third bus protocol message, and sends it to the external bus supporting the protocol communication through the third bus protocol.

[0127] As a preferred embodiment, before sending the first message to the actual target address according to the preset first bus protocol format, the method includes:

[0128] Determining whether the first message carries an emergency message identifier;

[0129] If the first message carries an emergency message identifier, the first bus master station is controlled to directly operate the sub-node of the first bus master station to transmit the first message.

[0130] Specifically, in this embodiment, after the address conversion is completed, the first bus master station determines the nature of the first message. If the first message carries an emergency message identifier, the first bus master station is controlled to directly operate the child node of the first bus master station and preferentially transmit the first message. If the first message is a normal message, it is sent and transmitted in sequence.

[0131] See also Figure 4 , Figure 4 A flowchart of dynamically obtaining a first protocol device type code in a bus module and sending a first message to a buffer partition of a first bus master station according to the first protocol device type code is provided in the present application.

[0132] As a preferred embodiment, dynamically acquiring the first protocol device type code in the bus module, and sending the first message to the buffer partition of the first bus master station according to the first protocol device type code includes:

[0133] S41, controlling the bus module to obtain the protocol device type code of the external input in real time;

[0134] S42, determining whether the protocol device type code input externally is the same as the previous protocol device type code;

[0135] S43, if they are the same, directly feed back the protocol device type code to the wireless master station;

[0136] S44. If they are not the same, the protocol device type code input externally is overwritten with the previous protocol device type code and then fed back to the wireless master station.

[0137] Therefore, the present application can obtain the protocol device type code in a timely manner after the user changes the required protocol type, so that the message can be accurately sent to the buffer partition of the corresponding bus master station.

[0138] As a preferred embodiment, determining the mapping relationship between the primary target address and the actual target address, and implementing the conversion from the primary target address to the actual target address includes:

[0139] Reading a structure array in an address translation mapping area in a microprocessor to determine a mapping relationship between a primary target address and an actual target address;

[0140] The conversion from the primary target address to the actual target address is implemented based on the structure array.

[0141] See also Figure 5 , Figure 5 A flow chart of a control bus module provided in the present application for receiving a first message from a wireless master station and determining whether a primary target address of the first message and the wireless master station are in the same network.

[0142] As a preferred embodiment, controlling the wireless master station in the bus module to receive the first message, and determining whether the primary target address of the first message and the wireless master station are in the same network includes:

[0143] S11, if the primary target address of the first message is not in the same network as the wireless master station;

[0144] S12, controlling the wireless master station to poll the network sub-nodes to achieve automatic addressing;

[0145] S13, realizing a new network configuration according to the result of automatic addressing;

[0146] S14. If the configuration is successful, control the wireless master station to send the first message.

[0147] Specifically, in this embodiment, if the configuration information of the wireless master station is unknown, or when other slave stations conflict with the addresses of the master stations in the bus module, the wireless master station of the present application can automatically address and complete the configuration.

[0148] See also Figure 6 The embodiment of the present invention provides a bus multi-protocol conversion control device, the device comprising:

[0149] A network determination module, used for controlling the wireless master station in the bus module to receive the first message, and determining whether the primary target address of the first message and the wireless master station are in the same network;

[0150] a message sending module, for controlling the wireless master station to send the first message if the primary target address of the first message is in the same network as the wireless master station;

[0151] A data writing module, used for writing the first message sent by the wireless master station into the sending buffer area of ​​the bus module;

[0152] A device type code confirmation module is used to dynamically obtain a first protocol device type code in the bus module, and send the first message to a buffer partition of the first bus master station according to the first protocol device type code. The device type code confirmation module includes:

[0153] A protocol device type code confirmation unit, used to control the bus module to obtain an externally input protocol device type code in real time;

[0154] A judging unit, used to judge whether the protocol device type code input externally is the same as the previous protocol device type code;

[0155] A first feedback unit, configured to directly feed back the protocol device type code to the wireless master station if the protocol device type code is the same;

[0156] A second feedback unit is used for overwriting the previous protocol device type code with the protocol device type code input externally and then feeding back to the wireless master station if they are different;

[0157] A polling control module, used for controlling the wireless master station to poll the first bus master station to confirm that the first bus master station has received the first message;

[0158] an actual target address confirmation module, used for obtaining the actual target address of the first message according to the first bus master station, and waiting for address conversion;

[0159] An address conversion module, used to determine a mapping relationship between the primary target address and the actual target address, and to achieve conversion from the primary target address to the actual target address;

[0160] A message sending module, used for sending the first message to the actual target address according to a preset first bus protocol format;

[0161] A wired receiving module, used for controlling the first bus master station in the bus module to receive a second message;

[0162] An unpacking module, used for controlling the first bus master station to unpack the second message into general data;

[0163] A storage module, used for storing the general data in a buffer partition of the first bus master;

[0164] A mapping module, used for controlling the microprocessor to call the general data, and transferring the general data to the buffer partition of the third bus master station according to a preset address mapping relationship;

[0165] A packet assembly module, used for controlling the third bus master station to re-pack the general data into a third bus protocol message;

[0166] The wired sending module is used to send the third bus protocol message to a preset target address.

[0167] In addition, combined Figure 1 The bus multi-protocol conversion control method described in the embodiment of the present invention can be implemented by a network bus multi-protocol conversion control device. Figure 7 A schematic diagram of the hardware structure of a bus multi-protocol conversion control device provided in an embodiment of the present invention is shown.

[0168] The bus multi-protocol conversion control device may include a microprocessor 401 and a memory 402 storing computer program instructions.

[0169] Specifically, the microprocessor 401 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiment of the present invention.

[0170] The memory 402 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 402 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 402 may be inside or outside the data processing device. In a specific embodiment, the memory 402 is a non-volatile solid-state memory. In a specific embodiment, the memory 402 includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM) or a flash memory or a combination of two or more of these.

[0171] The microprocessor 401 implements any one of the bus multi-protocol conversion control methods in the above embodiments by reading and executing computer program instructions stored in the memory 402 .

[0172] In one example, the bus multi-protocol conversion control device may further include a communication interface 403 and a bus 410. Figure 7 As shown, the microprocessor 401, the memory 402, and the communication interface 403 are connected via a bus 410 and communicate with each other.

[0173] The communication interface 403 is mainly used to implement the communication between the modules, devices, units and / or equipment in the embodiment of the present invention.

[0174] Bus 410 includes hardware, software or both, and the components of bus multi-protocol conversion control device are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 410 may include one or more buses. Although the embodiment of the present invention describes and shows a specific bus, the present invention considers any suitable bus or interconnection.

[0175] In addition, in combination with a bus multi-protocol conversion control method in the above embodiment, an embodiment of the present invention can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by a microprocessor, any bus multi-protocol conversion control method in the above embodiment is implemented.

[0176] It should also be noted that the exemplary embodiments mentioned in the present invention describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in a different order from the embodiments, or several steps can be performed simultaneously.

[0177] The above is only a specific implementation of the present invention. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be covered within the protection scope of the present invention.

Claims

1. A bus multi-protocol conversion control method, It is characterized in that The bus multi-protocol conversion control method comprises: Controlling the wireless master station in the bus module to receive the first message, and determining whether the primary target address of the first message and the wireless master station are in the same network; If the primary target address of the first message and the wireless master station are in the same network, controlling the wireless master station to send the first message; Writing the first message sent by the wireless master station into the sending buffer area of ​​the bus module; Dynamically acquiring a first protocol device type code in the bus module, and sending the first message to a buffer partition of a first bus master station according to the first protocol device type code, comprising: Control the bus module to obtain the protocol device type code input from the outside in real time; Determine whether the protocol device type code input externally is the same as the previous protocol device type code; If they are the same, directly feeding back the protocol device type code to the wireless master station; If they are not the same, the protocol device type code input externally covers the previous protocol device type code and then feeds back to the wireless master station; Controlling the wireless master station to poll the first bus master station to confirm that the first bus master station has received the first message; obtaining an actual target address of the first message according to the first bus master station, and waiting for address conversion; Determine a mapping relationship between the primary target address and the actual target address, and implement conversion from the primary target address to the actual target address; Sending the first message to the actual target address according to a preset first bus protocol format; The bus multi-protocol conversion control method also includes: Controlling the first bus master station in the bus module to receive a second message; Controlling the first bus master station to unpack the second message into general data; storing the general data in a buffer partition of the first bus master; Controlling the microprocessor to call the general data, and transferring the general data to the buffer partition of the third bus master station according to a preset address mapping relationship; Controlling the third bus master station to repackage the universal data into a third bus protocol message; The third bus protocol message is sent to a preset target address.

2. A bus multi-protocol conversion control method according to claim 1, It is characterized in that The bus multi-protocol conversion control method also includes: Dynamically obtain a second protocol device type code in the bus module, and send the first message to a buffer partition of a second bus master station according to the second protocol device type code; Controlling the wireless master station to poll the second bus master station to confirm that the second bus master station has received the first message; obtaining an actual target address of the first message according to the second bus master station, and waiting for address conversion; Determine a mapping relationship between the primary target address and the actual target address, and implement conversion from the primary target address to the actual target address; The first message is sent to the actual target address according to a preset second bus protocol format.

3. A bus multi-protocol conversion control method according to claim 1, It is characterized in that Before sending the first message to the actual target address according to the preset first bus protocol format, the method includes: Determining whether the first message carries an emergency message identifier; If the first message carries an emergency message identifier, the first bus master station is controlled to directly operate a sub-node of the first bus master station to transmit the first message.

4. A bus multi-protocol conversion control method according to claim 1, It is characterized in that The determining of the mapping relationship between the primary target address and the actual target address to achieve the conversion from the primary target address to the actual target address includes: Reading a structure array in an address translation mapping area in a microprocessor to determine a mapping relationship between the primary target address and the actual target address; The conversion from the primary target address to the actual target address is implemented according to the structure array.

5. A bus multi-protocol conversion control method according to claim 1, It is characterized in that The wireless master station in the control bus module receives a first message, and determines whether the primary target address of the first message and the wireless master station are in the same network, including: If the primary destination address of the first message is not in the same network as the wireless master station; Controlling the wireless master station to poll the network sub-nodes to achieve automatic addressing; Implement new network configuration based on the results of automatic addressing; If the configuration is successful, the wireless master station is controlled to send the first message.

6. A bus multi-protocol conversion control device, It is characterized in that The device comprises: A network determination module, used for controlling the wireless master station in the bus module to receive the first message, and determining whether the primary target address of the first message and the wireless master station are in the same network; a message sending module, for controlling the wireless master station to send the first message if the primary target address of the first message is in the same network as the wireless master station; A data writing module, used for writing the first message sent by the wireless master station into the sending buffer area of ​​the bus module; A device type code confirmation module is used to dynamically obtain a first protocol device type code in the bus module, and send the first message to a buffer partition of the first bus master station according to the first protocol device type code. The device type code confirmation module includes: A protocol device type code confirmation unit, used to control the bus module to obtain an externally input protocol device type code in real time; A judging unit, used to judge whether the protocol device type code input externally is the same as the previous protocol device type code; A first feedback unit, configured to directly feed back the protocol device type code to the wireless master station if the protocol device type code is the same; A second feedback unit is used for overwriting the previous protocol device type code with the protocol device type code input externally and then feeding back to the wireless master station if they are different; A polling control module, used for controlling the wireless master station to poll the first bus master station to confirm that the first bus master station has received the first message; An actual target address confirmation module, used for obtaining the actual target address of the first message according to the first bus master station, and waiting for address conversion; An address conversion module, used to determine a mapping relationship between the primary target address and the actual target address, and to achieve conversion from the primary target address to the actual target address; A message sending module, used for sending the first message to the actual target address according to a preset first bus protocol format; A wired receiving module, used for controlling the first bus master station in the bus module to receive a second message; An unpacking module, used for controlling the first bus master station to unpack the second message into general data; A storage module, used for storing the general data in a buffer partition of the first bus master; A mapping module, used for controlling the microprocessor to call the general data, and transferring the general data to the buffer partition of the third bus master station according to a preset address mapping relationship; A packet assembly module, used for controlling the third bus master station to re-pack the general data into a third bus protocol message; The wired sending module is used to send the third bus protocol message to a preset target address.

7. A bus multi-protocol conversion control device, It is characterized in that include: At least one microprocessor, at least one memory and computer program instructions stored in the memory, which implement the method according to any one of claims 1 to 5 when the computer program instructions are executed by the microprocessor.

8. A storage medium having computer program instructions stored thereon, It is characterized in that When the computer program instructions are executed by a microprocessor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Industrial wireless network access industrial Ethernet, multi-protocol gateway of field bus and protocol conversion method

    CN101425948A