Method for protocol conversion of multi-source heterogeneous devices based on NC-link

By identifying and constructing protocol data mapping relationships, and using the improved NC-Link protocol model, the protocols of different CNC devices are converted into the NC-Link protocol, which solves the data loss problem and improves the interoperability between devices and the real-time performance of the system.

CN116233272BActive Publication Date: 2025-11-25HUAZHONG UNIV OF SCI & TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310245657.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-14
Publication Date
2025-11-25
Estimated Expiration
2043-03-14

AI Technical Summary

Technical Problem

Existing technologies cannot directly convert protocols between CNC equipment from different manufacturers into the NC-Link protocol, which may lead to data loss and affect the interconnection of equipment in smart factories.

Method used

By acquiring data packets of the protocol to be converted, identifying their characteristics, constructing a protocol data mapping relationship, converting them into NC-Link protocol data packets based on the improved NC-Link protocol model, and performing authentication during connection establishment to ensure security.

Benefits of technology

It achieves data lossless conversion between different protocols, improves the interoperability between CNC equipment and the real-time performance of the system, and reduces the development difficulty of industrial intelligent applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116233272B_ABST
    Figure CN116233272B_ABST
Patent Text Reader

Abstract

The application discloses a multi-source heterogeneous equipment protocol conversion method based on NC-Link, and the method comprises the following steps: obtaining a to-be-converted protocol data packet corresponding to a to-be-converted protocol; and converting the protocol conversion to-be-converted protocol data packet into an NC-Link protocol data packet according to an improved NC-Link protocol model, wherein the improved NC-Link protocol model comprises a protocol data conversion relationship. According to the method, the to-be-converted protocol data packet corresponding to the to-be-converted protocol is obtained, the protocol conversion to-be-converted protocol data packet is converted into the NC-Link protocol data packet according to the improved NC-Link protocol model comprising the protocol data conversion relationship, the other protocol data packet is converted into the NC-Link protocol data packet, data loss is avoided, and the intercommunication between protocols is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of numerical control equipment interconnection, and particularly relates to a multi-source heterogeneous equipment protocol conversion method based on NC-Link. BACKGROUND

[0002] With the development of Internet of Things technology, intelligent manufacturing has become the top priority of the Industry 4.0 strategy. The construction of intelligent factories needs to realize the interconnection of numerical control equipment. The numerical control equipment interconnection protocol, as a protocol for realizing the interconnection between different numerical control equipment, is the key to realizing intelligent manufacturing in industry. At present, the mainstream numerical control equipment interconnection protocols include the numerical control equipment interconnection communication (MT-Connect) protocol and the Open Platform Communications Unified Architecture (OPC UA) protocol from abroad, and the numerical control equipment industrial interconnection communication (NC-Link) protocol from China.

[0003] The NC-Link protocol adaptation and security related technology has certain achievements, and basically realizes the adaptation mode of converting device original data into NC-Link protocol data. However, each major numerical control equipment manufacturer only supports its own proprietary protocol standard, so in a modern intelligent factory, numerical control equipment of different types and manufacturers may support different numerical control protocols. It is currently impossible to convert other protocols into NC-Link protocols, and if the above existing adaptation mode is directly applied to other protocols, data loss may occur.

[0004] The above content is only used to assist in understanding the technical solutions of the present application and does not represent the acknowledgement of the above content as prior art. SUMMARY

[0005] The main purpose of the present application is to provide a multi-source heterogeneous equipment protocol conversion method based on NC-Link, which aims to solve the technical problem that other protocols cannot be converted into NC-Link protocols in the prior art, and direct conversion may cause data loss.

[0006] To achieve the above purpose, the present application provides a multi-source heterogeneous equipment protocol conversion method based on NC-Link, which comprises the following steps:

[0007] Obtain the to-be-converted protocol data packet corresponding to the to-be-converted protocol;

[0008] Convert the to-be-converted protocol data packet into an NC-Link protocol data packet according to the improved NC-Link protocol model, wherein the improved NC-Link protocol model includes a protocol data conversion relationship.

[0009] Optionally, before the obtaining of the to-be-converted protocol data packet corresponding to the to-be-converted protocol, the method further comprises:

[0010] identifying a data packet feature of the to-be-converted protocol;

[0011] constructing a protocol data mapping relationship between the to-be-converted protocol and the NC-Link protocol according to the identification result;

[0012] constructing an improved NC-Link protocol model based on the protocol data mapping relationship.

[0013] Optionally, the constructing of the protocol data mapping relationship between the to-be-converted protocol and the NC-Link protocol according to the identification result comprises:

[0014] constructing a node mapping relationship and a function mapping relationship between the to-be-converted protocol and the NC-Link protocol according to the identification result;

[0015] determining the protocol data mapping relationship between the to-be-converted protocol and the NC-Link protocol according to the node mapping relationship and the function mapping relationship.

[0016] Optionally, the constructing of the improved NC-Link protocol model based on the protocol data mapping relationship comprises:

[0017] constructing an initial NC-Link model based on a preset NC-Link model;

[0018] constructing the improved NC-Link protocol model according to the protocol data mapping relationship and the initial NC-Link model.

[0019] Optionally, before the obtaining of the to-be-converted protocol data packet corresponding to the to-be-converted protocol, the method further comprises:

[0020] determining a connection establishment mode through the improved NC-Link protocol model;

[0021] establishing a connection based on the connection establishment mode and a server corresponding to the to-be-converted protocol;

[0022] Correspondingly, the obtaining of the to-be-converted protocol data packet corresponding to the to-be-converted protocol comprises:

[0023] obtaining the to-be-converted protocol data packet corresponding to the to-be-converted protocol through the connection.

[0024] Optionally, the determining of the connection establishment mode through the improved NC-Link protocol model comprises:

[0025] determining the to-be-converted protocol and a server address corresponding to the to-be-converted protocol according to a protocol parameter of a method object of the improved NC-Link protocol model.

[0026] determine the connection establishment mode according to the to-be-converted protocol and the server address corresponding to the to-be-converted protocol.

[0027] Optionally, the determining the connection establishment mode according to the to-be-converted protocol and the server address corresponding to the to-be-converted protocol comprises:

[0028] determining the request authentication information according to the to-be-converted protocol;

[0029] determining the connection establishment mode according to the request authentication information, the to-be-converted protocol and the server address corresponding to the to-be-converted protocol, so that the server selects a corresponding security policy to perform identity authentication according to the connection establishment mode.

[0030] In addition, to achieve the above object, the application further provides a multi-source heterogeneous device protocol conversion device based on NC-Link, which comprises:

[0031] a data acquisition module, configured to acquire a to-be-converted protocol data packet corresponding to a to-be-converted protocol;

[0032] a protocol conversion module, configured to convert the to-be-converted protocol data packet into an NC-Link protocol data packet according to an improved NC-Link protocol model, wherein the improved NC-Link protocol model comprises a protocol data conversion relationship.

[0033] In addition, to achieve the above object, the application further provides a multi-source heterogeneous device protocol conversion device based on NC-Link, which comprises a memory, a processor and a multi-source heterogeneous device protocol conversion program based on NC-Link stored in the memory and capable of running on the processor, wherein the multi-source heterogeneous device protocol conversion program based on NC-Link is configured to implement the steps of the multi-source heterogeneous device protocol conversion method based on NC-Link.

[0034] In addition, to achieve the above object, the application further provides a storage medium, wherein the storage medium stores a multi-source heterogeneous device protocol conversion program based on NC-Link, and the multi-source heterogeneous device protocol conversion program based on NC-Link implements the steps of the multi-source heterogeneous device protocol conversion method based on NC-Link when executed by a processor.

[0035] The application converts the to-be-converted protocol data packet into an NC-Link protocol data packet according to the improved NC-Link protocol model, wherein the improved NC-Link protocol model comprises a protocol data conversion relationship. The application realizes conversion of other protocol data packets into NC-Link protocol data packets and does not cause data loss, thereby improving the interoperability between protocols. BRIEF DESCRIPTION OF DRAWINGS

[0036] Figure 1 FIG. 1 is a structural schematic diagram of an NC-Link-based multi-source heterogeneous device protocol conversion device according to an embodiment of the application;

[0037] Figure 2 FIG. 2 is a flowchart of an NC-Link-based multi-source heterogeneous device protocol conversion method according to a first embodiment of the application;

[0038] Figure 3 FIG. 3 is a flowchart of an NC-Link-based multi-source heterogeneous device protocol conversion method according to a second embodiment of the application;

[0039] Figure 4 FIG. 4 is a diagram of an added protocol parameter of an NC-Link-based multi-source heterogeneous device protocol conversion method according to the application;

[0040] Figure 5 FIG. 5 is an example diagram of an args parameter of an NC-Link-based multi-source heterogeneous device protocol conversion method according to the application;

[0041] Figure 6 FIG. 6 is a diagram of an added data type parameter of an NC-Link-based multi-source heterogeneous device protocol conversion method according to the application;

[0042] Figure 7 FIG. 7 is an example diagram of a data type parameter of an NC-Link-based multi-source heterogeneous device protocol conversion method according to the application;

[0043] Figure 8 FIG. 8 is an example diagram of a special identification parameter of an NC-Link-based multi-source heterogeneous device protocol conversion method according to the application;

[0044] Figure 9 FIG. 9 is a flowchart of an NC-Link-based multi-source heterogeneous device protocol conversion method according to a third embodiment of the application;

[0045] Figure 10The improved NC-Link protocol model protocol conversion flowchart of the NC-Link based multi-source heterogeneous device protocol conversion method of the present application;

[0046] Figure 11 The structural block diagram of the first embodiment of the NC-Link based multi-source heterogeneous device protocol conversion device of the present application. DETAILED DESCRIPTION

[0047] It should be understood that the specific embodiments described herein are merely exemplary and not intended to limit the present application.

[0048] Referring to Figure 1 , Figure 1 The NC-Link based multi-source heterogeneous device protocol conversion device structure schematic diagram of the hardware running environment involved in the embodiment scheme of the present application.

[0049] As Figure 1 shown, the NC-Link based multi-source heterogeneous device protocol conversion device can include a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 can include a display screen, an input unit such as a keyboard, and can also include a standard wired interface, a wireless interface. The network interface 1004 can optionally include a standard wired interface, a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 can be a high-speed random access memory (RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a magnetic disk memory. The memory 1005 can also be a storage device independent of the aforementioned processor 1001.

[0050] Those skilled in the art can understand that Figure 1 the structure shown in the foregoing description does not constitute a limitation on the NC-Link based multi-source heterogeneous device protocol conversion device, and can include more or fewer components than the illustrated components, or combine certain components, or different component arrangements.

[0051] As Figure 1 shown, the memory 1005 as a storage medium can include an operating system, a network communication module, a user interface module, and an NC-Link based multi-source heterogeneous device protocol conversion program.

[0052] In Figure 1 The network interface 1004 is mainly used for data communication with the network server, and the user interface 1003 is mainly used for data interaction with the user. The processor 1001 and the memory 1005 in the NC-Link based multi-source heterogeneous device protocol conversion device can be arranged in the NC-Link based multi-source heterogeneous device protocol conversion device. The NC-Link based multi-source heterogeneous device protocol conversion device calls the NC-Link based multi-source heterogeneous device protocol conversion program stored in the memory 1005 through the processor 1001, and executes the NC-Link based multi-source heterogeneous device protocol conversion method provided by the embodiment of the application.

[0053] The embodiment of the application provides a NC-Link based multi-source heterogeneous device protocol conversion method. Figure 2 Figure 2 The flowchart of the first embodiment of the NC-Link based multi-source heterogeneous device protocol conversion method is shown.

[0054] In the embodiment, the NC-Link based multi-source heterogeneous device protocol conversion method comprises the following steps:

[0055] Step S10: Obtain the protocol data packet to be converted corresponding to the protocol to be converted.

[0056] It should be noted that the execution subject of the method of the embodiment can be a computing service device with data processing, network communication and program running functions, such as a mobile phone, a tablet computer, a server device, etc. It can also be an NC-Link adapter device with the same or similar functions of the NC-Link based multi-source heterogeneous device protocol conversion. The NC-Link adapter will be taken as an example for description in the embodiment and the following embodiments.

[0057] It should be noted that the protocol to be converted can be an MT-Connect protocol or an OPC UA protocol, or other numerical control device interconnection protocols other than the NC-Link protocol, which is not limited here.

[0058] It can be understood that the protocol data packet to be converted can be a data packet encapsulated in the data format of the protocol to be converted. The data packet can be used to describe the model data packet of all or part of the node data of the numerical control device corresponding to the protocol to be converted.

[0059] ​Taking the MT-Connect protocol as an example, the MT-Connect protocol data packet can be a model data packet in an extensible markup language (XML) for describing a numerical control device corresponding to the MT-Connect protocol. The XML language mainly includes Header and Devices elements. The Header element is a description header of the XML data packet, and is used to record basic information of the data packet, such as creation time, version number, and execution standard. The Devices element includes one or more Device elements. The Device element is used to describe device information, and is composed of four sub-elements, namely Components, DataItems, and the like. The Components element is used to describe structural information of the numerical control device, and includes corresponding Component elements according to the number of components of the numerical control device to be described. The Component element is used to represent a component of the device, and the number and types of sub-elements included in the Component element are different according to different component types. The MT-Connect uniformly specifies the type, semantics, and sub-elements included in the Component element by adopting a data dictionary.

[0060] Taking the OPC UA protocol as an example, the OPC UA protocol data packet can be a data packet for describing the numerical control device by using object-oriented technology. The protocol maps the numerical control device into a corresponding object model, and the object model is composed of three parts of variables, methods and events, and the object model constitutes the OPC UA protocol data packet. Among them, the variable is used to record the current or historical data of the numerical control device, the method is used to control the numerical control device, and the event is used to alarm the abnormal state of the numerical control device. In the OPC UA protocol, the object is composed of nodes, and the nodes are connected through references (Reference) to form a network structure. The network formed by the connection is also called address space (address space). When the OPC UA client needs to obtain the data of the specified component or node of the numerical control device, it will send a request to the OPC UA server, and the OPC UA server will search from the starting node of the address space top-down to find the node specified by the OPC UA client, and return the information to the OPC UA client in the unit of node. The OPC UA protocol converts the numerical control device model into the node address space through the operation, so that a unified data structure and transmission mode can be used to operate the numerical control device.

[0061] It can be understood that the obtained to-be-converted protocol data packet can be obtained by sending a request to the server corresponding to the to-be-converted protocol, so that the server corresponding to the to-be-converted protocol feeds back the to-be-converted protocol data packet. It can also be obtained by subscribing to the specified node of the numerical control device through the message subscription and publishing technology, so that the server corresponding to the to-be-converted protocol publishes the to-be-converted protocol data packet including the data of the specified node.

[0062] Step S20: converting the to-be-converted protocol data packet into an NC-Link protocol data packet according to the improved NC-Link protocol model, wherein the improved NC-Link protocol model includes a protocol data conversion relationship.

[0063] It can be understood that the NC-Link protocol is a numerical control equipment industrial communication protocol developed by the China Machine Tool and Tool Building Association. The protocol is based on the characteristics of MT-Connect and OPC UA, and is a two-way control protocol that can read and control numerical control equipment data. In the definition of the numerical control equipment model, NC-Link uses the hierarchical description method of MT-Connect to describe numerical control equipment and establishes a numerical control equipment model definition specification. Unlike MT-Connect, NC-Link uses JSON format to describe numerical control equipment. When describing numerical control equipment and its components, no start and end tags are needed, making the NC-Link equipment model definition file more concise and smaller in size. In addition, in data acquisition, the NC-Link returns only the data item content in the corresponding message, unlike MT-Connect, which returns an 11ML document. This makes NC-Link less bandwidth-intensive for the system when transmitting data, improving system real-time performance. NC-Link uses the Publish / Subscribe and Request / Response communication mode based on OPC UA. The interface in the NC-Link protocol completes the corresponding task through this communication mode. In the NC-Link protocol, there are four commonly used interfaces: model detection, data query, data download, and data sampling. The model detection interface is used to obtain the model file of the specified numerical control equipment, the data query interface is used to query the current value of the specified data item, the data download interface is used to set the value of the specified data item, and the data sampling interface is used to continuously obtain the data of the specified sampling channel. NC-Link has unified specifications for the instruction names and parameter formats of the above interfaces, making it more convenient for manufacturers to develop NC-Link application systems and reducing the development difficulty of industrial intelligent applications.

[0064] It is worth noting that the improved NC-Link protocol model can be constructed based on the NC-Link protocol numerical control equipment model definition specification, and then the protocol data packet to be converted is parsed. According to the description of the numerical control equipment in the protocol data packet to be converted, the description of the numerical control equipment is mapped to the initial model. Since different protocols have different data storage formats, objects or attributes representing similar meanings in different formats can be one-to-one correspondence, and a protocol data conversion relationship can be established. The improved NC-Link protocol model is generated according to the protocol data conversion relationship.

[0065] It can be understood that converting the to-be-converted protocol data packet into an NC-Link protocol data packet according to the improved NC-Link protocol model can be converting the to-be-converted protocol data packet into a data packet conforming to the data format of the NC-Link protocol according to the protocol data conversion relationship.

[0066] In the first embodiment, the method comprises the following steps: obtaining a to-be-converted protocol data packet corresponding to a to-be-converted protocol; and converting the to-be-converted protocol data packet into an NC-Link protocol data packet according to an improved NC-Link protocol model, wherein the improved NC-Link protocol model comprises a protocol data conversion relationship. Since the to-be-converted protocol data packet is converted into an NC-Link protocol data packet according to the improved NC-Link protocol model comprising the protocol data conversion relationship, the other protocol data packet is converted into an NC-Link protocol data packet, and no data loss occurs, and the intercommunication between protocols is improved.

[0067] Reference Figure 3 , Figure 3 FIG. 2 is a flowchart of a second embodiment of the NC-Link-based multi-source heterogeneous device protocol conversion method according to the present application.

[0068] Further, before obtaining the to-be-converted protocol data packet corresponding to the to-be-converted protocol, the improved NC-Link protocol model needs to be constructed according to the node data of the numerical control device of the to-be-converted protocol. Therefore, based on the first embodiment, the present embodiment further comprises the following steps before step S10:

[0069] Step S01: identifying the data packet features of the to-be-converted protocol.

[0070] It can be understood that the data packet features can be features identifying the protocol type of the data packet of the current to-be-converted protocol, and the data packet features can be identified according to the characteristics of the structured data of the to-be-converted protocol. For example, the header part of the 11ml data packet of the MT-Connect protocol records the creation time, version number, execution standard and other information of the data packet, and the endpoint connected when the OPC UA protocol server starts the service identifies the information of the OPC UA service, and the protocol type to which the current data packet belongs can be known by identifying the above features.

[0071] Step S02: constructing a protocol data mapping relationship between the to-be-converted protocol and the NC-Link protocol according to the identification result.

[0072] It can be understood that the identification result can be a protocol type to which the data packet of the protocol to be converted belongs, and after the protocol type of the data packet is determined, the protocol data mapping relationship can be constructed according to the data format of the protocol to be converted and the data format of the NC-Link protocol. For example, the NC-Link protocol model can be in the format of a json object to describe the numerical control equipment, which can be composed of a device object, a data object, a sampling channel object and a method object. If the identified protocol is the MT-Connect protocol, the format of the data packet of the protocol to be converted is the format of the 11ML language, and contains Header and Devices parts. The Devices part includes multiple Device elements for describing the information of the numerical control equipment, each of which is composed of four sub-elements of Components, DataItems and the like, for describing the detailed data of each node of the numerical control equipment. Then, the protocol data mapping relationship can be that each field in the data structure of the MT-Connect protocol corresponds to a specified field in the data structure of the NC-Link protocol. Specifically, the mapping relationship between the fields can be set according to the similarity of the meanings in the data structures of the NC-Link protocol and the protocol to be converted, which is not limited here.

[0073] Further, in order to make the converted protocol data mapping relationship more accurate and improve the reliability of the improved NC-Link protocol model, the step S02 includes: constructing a node mapping relationship and a function mapping relationship between the protocol to be converted and the NC-Link protocol according to the identification result; determining the protocol data mapping relationship between the protocol to be converted and the NC-Link protocol according to the node mapping relationship and the function mapping relationship.

[0074] It can be understood that the node can be a component of the numerical control equipment, for example, multiple tools, drill bits, partitions and the like on the numerical control machine tool. The node is described by the data structure in the data packet, which can include node identification, node name, data type of the node, whether it is modifiable and the like. Since different protocols describe the data structure of the node differently, the attributes with similar meanings in the data structures of the NC-Link protocol and the protocol to be converted can be mapped according to the meaning of each attribute of the data structure, which can be that multiple fields of the protocol to be converted are mapped into one or more specified fields of the NC-Link protocol, that is, the node mapping relationship is constructed.

[0075] It should be understood that after the node of the protocol to be converted is mapped to the node of the NC-Link protocol according to the node mapping relationship, read and write operations can be performed on the converted node, and therefore the read and write function functions corresponding to the converted node can be constructed, that is, the constructed function functions and the nodes of the protocol to be converted constitute the corresponding function mapping relationship.

[0076] Furthermore, in order to construct a more complete improved NC-Link protocol model, step S02 also includes: constructing an initial NC-Link model based on a preset NC-Link model; and constructing an improved NC-Link protocol model according to the protocol data mapping relationship and the initial NC-Link model.

[0077] Understandably, the default NC-Link model can be a model customized by R&D personnel according to the NC-Link protocol CNC equipment model specification. It can be described using JSON object format, including parts such as root object, device object, component object, data object, sampling channel object, and method object.

[0078] The root object `configs` is an array of data objects or method objects, describing various configuration details of the root object. It is the outermost object of the default NC-Link model. For example, method objects are used to describe CNC machine tool data.

[0079] {"id":"method001","name":"ftpcall","type":"METHOD","description":"...","args":{"protocol":"FTP","address":"10.10.565.1.21","user":"user111","password":"1111"}}. Device objects describe the configuration, components, and available data items of a CNC machine tool or its auxiliary equipment. Component objects describe the component information within a device object; component objects can contain other component objects. Data objects describe various parameters and all sampleable data in a pre-defined NC-Link model file, for example, {"id":"010305","name":"feed rate","type":"FEED_OVERRIDE",...}. Sampling channel objects describe the currently sampleable data and sampling period; method objects describe the currently defined methods.

[0080] It is worth noting that the initial NC-Link model can be based on the preset NC-Link model, with the addition of parameters to describe the protocol to be converted and the corresponding CNC equipment.

[0081] Specifically, because the default NC-Link model provides access to the raw data of CNC machine tools through the / args parameter of the method object under the root object, it cannot identify and provide access methods for structured data of other protocols such as MT-Connect or OPC UA. Therefore, asFigure 4 As shown in the preset NC-Link model, a protocol / protocol parameter is added in the method object of the preset NC-Link model, which is used to mark the protocol type supported by the NC-Link model file. The value of the parameter can be a protocol name such as “NC-Link”, “MT-Connect” or “OPC UA”.

[0082] Meanwhile, according to the protocol / protocol parameter, the / args parameter corresponds to different values, such as Figure 5 As shown in the figure, for example, when the protocol / protocol is MT-Connect, the / args parameter can at least include internal parameter fields such as protocol, address, port and operation, which are used to describe the MT-Connect interface access method and parameters; when the protocol / protocol is OPC UA, the / args parameter can at least include internal parameter fields such as protocol, address and port, which are used to describe the interface access method and parameters of the OPC UA service.

[0083] In addition, in the preset NC-Link model, the data object can be used as a basic unit for describing node information. In order to adapt the node identification when the to-be-converted protocol is converted into the NC-Link protocol, a special identification / identity parameter can also be added in the data object of the preset NC-Link model, as shown in the figure. Figure 6 As shown in the figure, the definition of the data type / datatype is modified, and a special identification / identity parameter is added.

[0084] Specifically, the modification of the data type / datatype is as shown in the figure. Figure 7 As shown in the figure, when the protocol / protocol in the method object is MT-Connect, the data type / datatype of the data object can be Samples, Events, Condition or other custom types, which are used to identify the MT-Connect node data type during NC-Link adaptation. When the protocol / protocol in the method object is OPC UA, the data type / datatype of the data object can be UA_TYPES_INT32, UA_TYPES_FLOAT, UA_TYPES_STRING, UA_TYPES_BOOLEAN, UA_TYPES_DATETIME or other custom types, which are used to identify the OPC UA node data type during NC-Link adaptation.

[0085] Meanwhile, since the identification and query method of nodes of MT-Connect and OPC UA protocol are inconsistent with the NC-Link protocol, a special identity / identity is added to provide the parameter identity of the corresponding node of MT-Connect and OPC UA when the NC-Link is adapted, as shown in the following table. When the protocol / protocol of the method object is MT-Connect, the special identity / identity of the data object can at least include the mtId parameter, and optionally include the mtLocate parameter and other custom parameters. When the protocol / protocol of the method object is OPC UA, the special identity / identity of the data object can at least include the namespace, IdentifierType and Identifier parameters, and optionally include other parameters. Figure 8

[0086] It should be understood that after the above-mentioned modified parameters and added parameters are made on the basis of the preset NC-Link model, an initial NC-Link model is obtained. According to the protocol / protocol parameter of the method object and the special identity / identity parameter of the data object of the improved NC-Link model, the node mapping relationship and the function mapping relationship between the data packet of MT-Connect, OPC UA protocol or other protocol and the NC-Link protocol are constructed, and the model constructed according to the protocol data mapping relationship and the initial NC-Link model is the improved NC-Link protocol model.

[0087] Step S03: constructing an improved NC-Link protocol model based on the protocol data mapping relationship.

[0088] It can be understood that the improved NC-Link protocol model can be an initial model constructed based on the NC-Link protocol numerical control equipment model definition specification, and a model generated after the data of the protocol to be converted is mapped to the initial model based on the protocol data mapping relationship.

[0089] In the second embodiment, the data packet characteristics of the protocol to be converted are identified, the protocol data mapping relationship between the protocol to be converted and the NC-Link protocol is constructed according to the identification result, and the improved NC-Link protocol model is constructed based on the protocol data mapping relationship. In this embodiment, the protocol type to which the data packet of the protocol to be converted belongs is determined by identifying the data packet characteristics of the protocol to be converted, the protocol data mapping relationship is constructed according to the protocol type, and the improved NC-Link protocol model is constructed according to the protocol data mapping relationship. Before the data packet of the protocol to be converted corresponding to the protocol to be converted is obtained, the improved NC-Link protocol model is constructed to realize protocol conversion.

[0090] Reference​Figure 9 , Figure 9 Figure 2 is a flowchart of a third embodiment of the NC-Link based multi-source heterogeneous device protocol conversion method of the present application.

[0091] Further, the server of the protocol to be converted and the connection establishment mode need to be determined, and the protocol data packet corresponding to the protocol to be converted is obtained after the connection with the server is established. Therefore, based on the first embodiment, the present embodiment further includes, before the step S10:

[0092] Step S04: determining the connection establishment mode through the improved NC-Link protocol model.

[0093] It can be understood that the protocol / protocol parameter in the method object of the improved NC-Link protocol model can determine the protocol type to which the numerical control device described by the current model belongs, and different protocols correspond to different servers and different connection modes. The services can be accessed externally through the port opening service, or the remote desktop connection server.

[0094] Further, the server of the protocol to be converted and the connection establishment mode need to be determined, and the protocol data packet corresponding to the protocol to be converted is obtained after the connection with the server is established. Therefore, based on the first embodiment, the present embodiment further includes, before the step S10:

[0095] It can be understood that the protocol / protocol parameter in the method object of the improved NC-Link protocol model can determine the protocol type to which the numerical control device described by the current model belongs, and different protocols correspond to different servers and different connection modes. The services can be accessed externally through the port opening service, or the remote desktop connection server.

[0096] Further, considering the security problem when establishing connection between different protocols, the request authentication information for authentication can be sent before establishing connection, so that the server corresponding to the to-be-converted protocol is more secure when establishing connection. Therefore, the step S04 further comprises: determining the request authentication information according to the to-be-converted protocol; determining the connection establishment mode according to the request authentication information, the to-be-converted protocol and the server address corresponding to the to-be-converted protocol, so that the server selects the corresponding security policy for identity authentication according to the connection establishment mode.

[0097] It can be understood that, since the servers of different protocols are provided with corresponding security policies for identity authentication, malicious access and attacks are avoided, for example, MT-Connect implements security policy through external SSL (Secure Sockets Layer secure socket protocol), OPC UA can have multiple security policies to choose from, such as Basic128sa15, Basic256, Basic256Sha256, Aes128_sha256_RsaOaep, etc., and the server selects the security policy and performs identity authentication in the process of protocol connection establishment. Therefore, the security policy of the to-be-converted protocol can be determined according to the to-be-converted protocol, the request authentication information containing identity information is set according to the security policy, and the connection establishment mode is determined according to the request authentication information, the to-be-converted protocol and the server address corresponding to the to-be-converted protocol.

[0098] Step S05: establishing connection with the server corresponding to the to-be-converted protocol based on the connection establishment mode.

[0099] Here, the present embodiment is described in combination with specific examples, as shown in Figure 10 Fig. 1, taking MT-Connect protocol data packet, OPC UA protocol data packet and NC-Link protocol data packet as examples, the complete process of protocol conversion based on the improved NC-Link protocol model, wherein, first, the characteristics of the to-be-converted protocol data packet are identified, after identifying the protocol type, modeling is performed according to different protocols to obtain the improved NC-Link protocol model; connection is established according to the improved NC-Link protocol model and the to-be-converted protocol to obtain data for protocol conversion, and node data reading and writing of the numerical control equipment are performed.

[0100] Further, after establishing a connection with the server corresponding to the protocol to be converted, the data of the specified node in the numerical control device can be subscribed to the server, and the sampling frequency can be set so that the server publishes the data of the specified node according to the sampling frequency. For example, there is a tool node on the numerical control device, the node id is 000001, the operation contains cutting, the operation is performed by adjusting the offset, and the value of the offset in the preset time is 30-40-30. The sampling data of the node is subscribed, and the sampling frequency is set to 1 second. Therefore, every second, a data packet including the data of the node is received.

[0101] In addition, the sampling data can also be written by calling the function interface provided by the numerical control device of the protocol to be converted. The modification data packet sent by the receiving agent can be parsed to obtain the node to be modified and the specific value, and the function interface can be called to control the node of the numerical control machine tool.

[0102] In the third embodiment, a connection establishment mode is determined based on the improved NC-Link protocol model, and a connection is established with the server corresponding to the protocol to be converted. In this embodiment, the connection establishment mode is determined based on the improved NC-Link protocol model, and a connection is established with the server corresponding to the protocol to be converted. After establishing the connection with the server, the protocol to be converted is obtained. The protocol to be converted is converted into an NC-Link protocol data packet based on the improved NC-Link protocol model.

[0103] In addition, the present application also provides a storage medium, wherein the storage medium stores an NC-Link based multi-source heterogeneous device protocol conversion program. When the NC-Link based multi-source heterogeneous device protocol conversion program is executed by a processor, the steps of the NC-Link based multi-source heterogeneous device protocol conversion method described above are implemented.

[0104] Figure 11 The structure block diagram of the first embodiment of the NC-Link based multi-source heterogeneous device protocol conversion device of the present application is shown in FIG. 1.

[0105] As shown in FIG. 1, the NC-Link based multi-source heterogeneous device protocol conversion device provided by the embodiments of the present application comprises: Figure 11

[0106] The data acquisition module 1101 is configured to acquire a protocol to be converted data packet corresponding to a protocol to be converted.

[0107] The protocol conversion module 1102 is configured to convert the protocol to be converted data packet into an NC-Link protocol data packet according to an improved NC-Link protocol model, wherein the improved NC-Link protocol model comprises a protocol data conversion relationship. ​

[0108] The embodiment obtains a to-be-converted protocol data packet corresponding to a to-be-converted protocol, and converts the to-be-converted protocol data packet into an NC-Link protocol data packet according to an improved NC-Link protocol model, wherein the improved NC-Link protocol model comprises a protocol data conversion relationship. The embodiment realizes conversion of other protocol data packets into NC-Link protocol data packets, and does not cause data loss, thereby improving the interoperability between protocols.

[0109] In an embodiment, the data acquisition module 1101 is further configured to identify a data packet feature of the to-be-converted protocol, construct a protocol data mapping relationship between the to-be-converted protocol and the NC-Link protocol according to the identification result, and construct an improved NC-Link protocol model based on the protocol data mapping relationship.

[0110] In an embodiment, the data acquisition module 1101 is further configured to construct a node mapping relationship and a function mapping relationship between the to-be-converted protocol and the NC-Link protocol according to the identification result, and determine the protocol data mapping relationship between the to-be-converted protocol and the NC-Link protocol according to the node mapping relationship and the function mapping relationship.

[0111] In an embodiment, the data acquisition module 1101 is further configured to construct an initial NC-Link model based on a preset NC-Link model, and construct an improved NC-Link protocol model according to the protocol data mapping relationship and the initial NC-Link model.

[0112] In an embodiment, the data acquisition module 1101 is further configured to determine a connection establishment mode through the improved NC-Link protocol model, establish a connection based on the connection establishment mode and a server corresponding to the to-be-converted protocol, and accordingly, the to-be-converted protocol data packet corresponding to the to-be-converted protocol is obtained through the connection.

[0113] In an embodiment, the data acquisition module 1101 is further configured to determine the to-be-converted protocol and a server address corresponding to the to-be-converted protocol according to a protocol parameter of a method object of the improved NC-Link protocol model, and determine a connection establishment mode according to the to-be-converted protocol and the server address corresponding to the to-be-converted protocol.

[0114] In an embodiment, the data acquisition module 1101 is further configured to determine request authentication information according to the to-be-converted protocol; determine a connection establishment manner according to the request authentication information, the to-be-converted protocol, and a server address corresponding to the to-be-converted protocol, so that the server selects a corresponding security policy according to the connection establishment manner to perform identity authentication.

[0115] Other embodiments of the NC-Link-based multi-source heterogeneous device protocol conversion device or implementation methods thereof are described above, and will not be repeated here.

[0116] It should be noted that, in this document, the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or system that includes a list of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent in such a process, method, article, or system. Without more limitations, the element defined by the phrase "comprising a" does not exclude the presence of additional identical elements in the process, method, article, or system that includes the element.

[0117] The above-mentioned embodiment numbers of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.

[0118] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be realized by means of software and necessary general hardware platforms, of course, they can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, an optical disk), and includes a plurality of instructions for making a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in various embodiments of the present application.

[0119] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent flow transformation made by using the content of the present application specification and drawings, or directly or indirectly applied to other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for NC-Link based multi-source heterogeneous device protocol conversion, characterized in that, The method comprises the following steps: Obtaining a to-be-converted protocol data packet corresponding to a to-be-converted protocol; Converting the to-be-converted protocol data packet into an NC-Link protocol data packet according to an improved NC-Link protocol model, wherein the improved NC-Link protocol model comprises a protocol data conversion relationship; Before the step of obtaining the to-be-converted protocol data packet corresponding to the to-be-converted protocol, the method further comprises the following steps: Identifying a data packet feature of the to-be-converted protocol to obtain an identification result, wherein the to-be-converted protocol is an MT-Connect protocol or an OPC UA protocol; When a header part comprising at least one of a creation time, a version number and an execution standard is identified in the to-be-converted protocol data packet, the identification result is that the to-be-converted protocol is the MT-Connect protocol; When OPC UA service identification information is identified in a connection endpoint of a protocol server in the to-be-converted protocol data packet, the identification result is that the to-be-converted protocol is the OPC UA protocol; Mapping a plurality of fields of the to-be-converted protocol into one or more fields of an NC-Link protocol according to a first data structure for node description of the MT-Connect protocol or a second data structure for node description of the OPC UA protocol to form a node mapping relationship; Mapping a node of the to-be-converted protocol to a node of the NC-Link protocol according to the node mapping relationship to obtain a converted node; Constructing a read-write function function corresponding to the converted node, and constructing a function mapping relationship between the read-write function function and the node of the to-be-converted protocol; Determining a protocol data mapping relationship between the to-be-converted protocol and the NC-Link protocol according to the node mapping relationship and the function mapping relationship; Constructing an improved NC-Link protocol model based on the protocol data mapping relationship.

2. The method of claim 1, wherein the NC-Link based multi-source heterogeneous device protocol conversion method is characterized by, The step of constructing the improved NC-Link protocol model based on the protocol data mapping relationship comprises the following steps: Constructing an initial NC-Link model based on a preset NC-Link model; Constructing the improved NC-Link protocol model according to the protocol data mapping relationship and the initial NC-Link model.

3. The method of claim 1, wherein the NC-Link based multi-source heterogeneous device protocol conversion method is characterized by, Before the step of obtaining the to-be-converted protocol data packet corresponding to the to-be-converted protocol, the method further comprises the following steps: Determining a connection establishment mode through the improved NC-Link protocol model; Establishing a connection based on the connection establishment mode and a server corresponding to the to-be-converted protocol; Correspondingly, the step of obtaining the to-be-converted protocol data packet corresponding to the to-be-converted protocol comprises the following step: Obtaining the to-be-converted protocol data packet corresponding to the to-be-converted protocol through the connection.

4. The method of claim 3, wherein the NC-Link based multi-source heterogeneous device protocol conversion method is characterized by, The step of determining the connection establishment mode through the improved NC-Link protocol model comprises the following steps: Determining the to-be-converted protocol and a server address corresponding to the to-be-converted protocol according to a protocol parameter of a method object of the improved NC-Link protocol model; Determining the connection establishment mode according to the to-be-converted protocol and the server address corresponding to the to-be-converted protocol.

5. The method of claim 4, wherein the NC-Link based multi-source heterogeneous device protocol conversion method is characterized by, The step of determining the connection establishment mode according to the to-be-converted protocol and the server address corresponding to the to-be-converted protocol comprises the following steps: Determining request authentication information according to the to-be-converted protocol; According to the request authentication information, the to-be-converted protocol, and the server address corresponding to the to-be-converted protocol, a connection establishment mode is determined, so that the server selects a corresponding security policy according to the connection establishment mode to perform identity authentication.

6. An NC-Link based multi-source heterogeneous device protocol conversion apparatus, configured to perform the NC-Link based multi-source heterogeneous device protocol conversion method according to any one of claims 1 to 5; characterized in that, The device comprises: The data acquisition module is configured to acquire a to-be-converted protocol data packet corresponding to the to-be-converted protocol. The protocol conversion module is configured to convert the to-be-converted protocol data packet into an NC-Link protocol data packet according to an improved NC-Link protocol model, wherein the improved NC-Link protocol model comprises a protocol data conversion relationship.

7. A multi-source heterogeneous device protocol conversion device based on NC-Link, characterized in that, The device comprises a memory, a processor, and an NC-Link-based multi-source heterogeneous device protocol conversion program stored in the memory and executable on the processor, and the NC-Link-based multi-source heterogeneous device protocol conversion program is configured to implement the steps of the NC-Link-based multi-source heterogeneous device protocol conversion method according to any one of claims 1 to 5.

8. A storage medium, characterized by The storage medium stores an NC-Link-based multi-source heterogeneous device protocol conversion program, and the NC-Link-based multi-source heterogeneous device protocol conversion program implements the steps of the NC-Link-based multi-source heterogeneous device protocol conversion method according to any one of claims 1 to 5 when executed by the processor.