A CNC equipment data collection and instruction issuing system

Through the architecture of adapter cluster, proxy cluster and cloud platform, the problems of inconsistent data formats and low communication efficiency of CNC equipment are solved, and efficient and reliable data collection and instruction issuance are achieved to adapt to dynamic changes in equipment in the factory.

CN113965608BActive Publication Date: 2025-08-05EPIC HUST TECH WUHAN
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111018881.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-31
Publication Date
2025-08-05
Estimated Expiration
2041-08-31

AI Technical Summary

Technical Problem

The existing CNC equipment data collection and instruction issuance technologies have problems such as inconsistent data format, low communication efficiency, high cost, complex organizational structure, and difficult understanding, especially when large-scale deployment of factories.

Method used

Adopt the architecture of adapter cluster, proxy cluster and cloud platform, obtain device information through the metadata request interface, encapsulate data in a unified format, and provide load balancing and fault tolerance mechanisms to support dynamic changes of equipment and persistent storage.

Benefits of technology

It realizes efficient collection of equipment data and issuance of instructions, reduces resource overhead, supports data collection of multiple equipment types, improves communication efficiency and system reliability, and adapts to dynamic changes in equipment in the factory.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113965608B_ABST
    Figure CN113965608B_ABST
Patent Text Reader

Abstract

The present invention relates to a numerical control equipment data collection and instruction issuance system, comprising an adapter cluster, an agent cluster and a cloud platform; the adapter requests the agent to obtain the metadata of the numerical control equipment through a metadata request interface; based on the metadata, an embedded process is called to collect the data produced by the numerical control equipment directly connected to it, the numerical control equipment production data is packaged in a unified format and serialized, and transmitted to the agent through a numerical control equipment production data sending interface; the agent collects and processes the numerical control equipment generated data sent by the adapter, and simultaneously issues the metadata of the numerical control equipment; the cloud platform receives the equipment instructions issued by the operator, and after completing the addressing of the numerical control equipment, sends the numerical control equipment execution instructions to the adapter cluster, and caches or stores the metadata and the numerical control equipment production data; the system has reliability, effectiveness and low resource overhead and can collect multiple types of data on multiple devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent numerical control machine tools, and in particular to a numerical control equipment data collection and instruction issuing system. Background Art

[0002] With the introduction of guidance for the groupization and scale-up of CNC equipment, coupled with the vigorous advancement of measures such as supply-side reform, a single factory may host production across the entire industrial chain. This means a wide variety of interconnected equipment operates within the factory. Industrial CNC equipment is provided by multiple manufacturers, resulting in varying data formats and varying data requirements. Therefore, organically integrating the diverse equipment across the industrial chain has become a challenging task.

[0003] The existing mainstream CNC equipment collection and instruction issuance technologies are mainly based on the MT-Connect protocol and OPC UA protocol.

[0004] The MT-Connect protocol is a data and information exchange standard described by a manufacturing-related data dictionary. It supports request / response and publish / subscribe communication models. Communication between the host computer and the device follows a request / response model, with the device and adapter acting as publishers, the proxy device acting as the exchange middleware, and the server cluster receiving data by subscribing to the proxy device's topics. The proxy device supports HTTP, using a RESTful interface for communication, through which data requests are made to the device. The request body consists of text data in XML format. Due to historical reasons, XML data has a low effective information ratio, consumes a lot of network I / O resources, and serialization and deserialization of data place certain demands on edge device performance.

[0005] The OPC UA protocol describes relationships between CNC devices through mutual references. It does not explicitly restrict circular object references, making data parsing difficult in extreme cases. Distributed deployment was not considered in the protocol's initial design, resulting in high costs for large-scale factory deployment, complex organizational structures, and difficulty understanding. The protocol's underlying communication protocol is relatively outdated, leading to poor communication performance and complex communication behaviors. Numerous historical issues have led to poor development performance and performance in the cloud-native and microservices era. Summary of the Invention

[0006] In response to the technical problems existing in the prior art, the present invention provides a numerical control equipment data collection and instruction issuance system, which completes the service discovery of device communication and the efficient implementation of communication components, and provides basic data services for upper-level applications.

[0007] According to a first aspect of the present invention, a system for collecting data and issuing instructions for numerical control equipment is provided, comprising: an adapter cluster, an agent cluster, and a cloud platform; the adapter cluster comprises a plurality of adapters, and the agent cluster comprises a plurality of agents;

[0008] Each of the adapters is directly connected to each numerical control device and is connected to the agent via network communication; the agent cluster is directly connected to the data storage unit; the communication interface between the adapter and the agent includes a metadata request interface and a numerical control device production data transmission interface;

[0009] The adapter requests the proxy through the metadata request interface to obtain metadata of the CNC device, wherein the metadata describes the hierarchical relationship between the CNC device and the components and data sources, and defines the field names, units, and data types generated by the CNC device; based on the metadata, the adapter calls the embedded process to collect data produced by the CNC device directly connected to it, encapsulates the CNC device production data in a unified format, and then serializes the data, which is then transmitted to the proxy through the CNC device production data sending interface;

[0010] The agent collects and processes the data generated by the numerical control device sent by the adapter, and simultaneously sends metadata of the numerical control device;

[0011] The cloud platform receives the device instructions issued by the operator, completes the addressing of the CNC device, sends the CNC device execution instructions to the adapter cluster, and caches or stores the metadata and CNC device production data.

[0012] On the basis of the above technical solution, the present invention can also make the following improvements.

[0013] Optionally, the data sent by the adapter to the agent through the CNC equipment production data sending interface includes: the adapter ID, device ID, component ID, data item ID, Unix standard time millisecond timestamp and payload of the CNC equipment production data;

[0014] When the adapter makes a request to the agent through the metadata request interface, the request sent is a metadata ID.

[0015] Optionally, the communication interface between the adapter and the agent further includes an authentication interface, a subscription interface and a numerical control device data sending interface;

[0016] The adapter sends the account and password to the agent through the authentication interface for authentication, and the agent returns the authentication result through the authentication interface;

[0017] The adapter cluster sends streaming request information containing a subscription operation to the proxy cluster through the subscription interface, and the proxy cluster publishes response information containing a push message to the adapter through the subscription interface;

[0018] The data sent by the adapter to the agent through the numerical control device data sending interface includes: message types of all data except the production data of the numerical control device, Unix standard time millisecond timestamps, and payloads.

[0019] Optionally, the processing of the adapter includes:

[0020] Run initialization and load the corresponding module into memory;

[0021] Read the configuration file to obtain basic operation information;

[0022] Acquire metadata of the numerical control device according to basic device information;

[0023] Starting an embedded process responsible for communicating with the numerical control device and establishing a communication channel with the embedded process;

[0024] Identify the equipment, components and data items to which the CNC equipment production data belongs;

[0025] Dividing and uniformly formatting the production data of the numerical control equipment in binary format;

[0026] The uniformly formatted production data of the numerical control equipment is serialized and waits for data transmission.

[0027] Optionally, the adapter provides routing services for the production data of the numerical control device and periodically opens a new data buffer to exchange with the original data buffer.

[0028] Optionally, the adapter caching and releasing the production data of the numerical control device includes:

[0029] Opening a data buffer for each component and its corresponding data item according to the metadata;

[0030] After collecting the production data of the numerical control equipment, write it into the corresponding data buffer; if the corresponding data buffer is not found, output an error log;

[0031] Configure a timer for each data buffer and put it into the time stack;

[0032] The timer periodically triggers the CNC equipment to upload production data;

[0033] Generate a new data buffer, and atomically swap the data buffer with the new data buffer;

[0034] Check whether the metadata is valid, and if valid, format the CNC equipment production data according to a unified format;

[0035] The production data of the numerical control device is serialized and then written into the channel.

[0036] Optionally, the metadata is a tree data structure, supporting dynamic migration and adjustment of devices; the adapter identifies the CNC device according to the corresponding metadata, and generates a CNC device instance according to the identification, wherein the device instance includes: an adapter object, a device object, and a component object;

[0037] The adapter object consists of an adapter ID, name, adapter type, summary comment, runtime monitored device ID, and user-defined device configuration. When the adapter accesses the metadata, it queries the process-unique device hash table. If there is no corresponding key-value pair in the device hash table, the agent initiates a query request and writes the request result to the device hash table.

[0038] The device object consists of a device ID, name, device type, summary comment, device group, device component ID, device component configuration, and data items used for data collection; the device object identifies the specific type and structure of the data generated by the CNC device;

[0039] The component object consists of a component ID, name, component type, summary comment, and data information object; the component is the smallest independent node divided in the protocol, and the component object records the type of data and collection cycle that the component will collect.

[0040] Optionally, the system provides a load balancing and fault tolerance mechanism for the interaction between the agent cluster and the adapter cluster.

[0041] This paper presents a data collection and command distribution system for CNC equipment. Based on the current state of industrial internet research and practical operational scenarios, it examines the data types generated by factory CNC equipment and the smart factory, and proposes metadata suitable for the NC-Link protocol. This metadata is defined using proto3 and generates corresponding multi-platform interfaces. It describes the hierarchical relationships between CNC equipment, components, and data sources, and defines the field names, units, and data types generated by the equipment.

[0042] Research and develop communication interfaces and adapters for each role to process and apply metadata. Metadata is parsed hierarchically, initiating data processing, parsing, and collection for corresponding components and data items based on the metadata. This shields underlying data type differences, enabling compatibility with devices that generate a variety of data encodings. Furthermore, data communication details are shielded, providing basic control and communication services for devices to meet the needs of smart factories.

[0043] When a CNC machine part is damaged and replaced with a spare, the user operates the cloud platform, the cluster is responsible for sending data, and the adapter parses and updates the metadata, thus supporting dynamic changes to the equipment and providing persistent storage.

[0044] CNC devices connect to the cluster through a proxy, which centrally maintains device routing information. The cloud platform generates control commands for the corresponding devices based on user instructions and routes them to the adapter. The adapter then sends the command data to the CNC device. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 This is a structural diagram of a numerical control equipment data collection and instruction issuing system provided by an embodiment of the present invention;

[0046] Figure 2 This is a schematic diagram of the interaction between modules in a numerical control equipment data collection and instruction issuance system provided by an embodiment of the present invention;

[0047] Figure 3 This is a schematic diagram of a metadata structure of a numerical control device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0048] The principles and features of the present invention are described below with reference to the accompanying drawings. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.

[0049] The present invention provides a numerical control equipment data collection and instruction issuing system that adopts a hierarchical architecture design and uses a layered design concept to achieve high cohesion and low coupling within each layer. Figure 1 The figure shows a schematic diagram of the structure of a numerical control equipment data collection and instruction issuing system provided by the present invention. Figure 1 As shown in Figure 1, the system consists of a device layer, an adapter layer, a proxy layer, and an application development layer. The dubbo-go protocol is used as the basic protocol to provide services.

[0050] The device layer consists of industrial equipment such as CNC machine tools and edge devices. The data format and communication specifications are generally defined by their manufacturers, and it supports native device hardware development and communicates through hardware terminals or RS232 serial port protocols.

[0051] The adapter layer needs to shield the upper layers from differences in device-defined protocols and adopt a custom numerical control model for data organization. Furthermore, the adapter layer needs to implement functions such as distributed concurrency, device routing and naming services, device health monitoring, service registration and discovery, and edge device interconnection and communication.

[0052] The proxy layer collects data sent by the NC-Link protocol adaptation layer and provides routing and forwarding for CNC equipment communication. The proxy needs to complete functions such as service degradation, traffic routing, data persistence, and data flooding monitoring.

[0053] The application layer is responsible for data processing and storage, providing a web-based platform for data display, device behavior operation, and device control, and providing data access methods for data analysis and intelligent control, such as manufacturing execution application systems, enterprise resource planning application systems, and big data analysis platforms.

[0054] The basic service layer, composed of protocols such as dubbo-go, provides naming services, routing, service discovery, security authentication, and operation monitoring NC-Link interactive information model.

[0055] Cloud platform load data storage and caching.

[0056] Database storage. The database storage design uses a database client to implement read-write separation and load balancing. The database proxy can optionally implement database sharding. The device ID is recommended as the sharding key. The proxy implements database read-write separation.

[0057] The proxy is responsible for data persistence. Database components are managed by a connection pool. After completing database authentication and basic information, the database connection is reused. The database driver implements read-write separation to improve data concurrency. The ID design also considers future database sharding expansion. The database proxy should implement distributed message storage for database shards.

[0058] Topic-based message queue. Kafka or Rocket MQ is generally used for storage. To support distributed multi-machine expansion, topic messages should be stored in the message queue. For point-to-point message sending between agents. The general behavior is: the sender sends a message to the topic subscribed by the receiver, and the receiver is declared in the message. The adapter subscribes to the agent, and the agent subscribes to the topic. After receiving the message from the message queue, the agent starts the coroutine, which checks whether the destination adapter exists in the subscription maintained by the topic, and discards it if it does not exist. If it exists or is multicast, then the data is written to the coroutine responsible for maintaining the subscription of the agent. The data is sent by the coroutine.

[0059] Naming service. This solves service disclosure, discovery, and encryption authentication issues. It provides trusted authentication, service discovery, and keepalive functionality for proxy data processing, format conversion, and forwarding. It shields the underlying implementation protocols and communication modes from both communicating parties, ultimately eliminating the need for additional logic processing in upper-level code after changing the underlying communication protocol. Furthermore, this section, through a review of the naming service architecture and call chain, illustrates the specific methods for unifying the abstract interface between callers and callees, the adapter's call process for the proxy, and the embedding of load balancing algorithms and fault tolerance mechanisms.

[0060] Specifically, the system includes: an adapter cluster, an agent cluster and a cloud platform; the adapter cluster includes multiple adapters, and the agent cluster includes multiple agents.

[0061] Each adapter is directly connected to each CNC device and connected to the agent through network communication; the agent cluster is directly connected to the data storage unit; the communication interface between the adapter and the agent includes a metadata request interface and a CNC device production data sending interface.

[0062] It can be understood that in the specific implementation, the connection and communication methods between the adapter cluster, the proxy cluster and the data storage unit can be: the proxy cluster and the adapter cluster are connected to communicate through the network infrastructure, among which the CNC equipment and the adapter cluster usually adopt serial port protocols such as RS232 for communication, the adapter cluster and the proxy cluster usually adopt the gRPC protocol based on the HTTP2.0 protocol for communication, and the proxy cluster and the cloud platform usually communicate through native TCP and data frames, HTTP protocol or Redission protocol.

[0063] The adapter requests the metadata of the CNC equipment from the agent through the metadata request interface. The metadata describes the hierarchical relationship between the CNC equipment and the components and data sources, and defines the field names, units and data types generated by the CNC equipment. Based on the metadata, the adapter calls the embedded process to collect the data produced by the CNC equipment directly connected to it, encapsulates the CNC equipment production data in a unified format and serializes it, and transmits it to the agent through the CNC equipment production data sending interface.

[0064] The agent collects and processes the data generated by the CNC device sent by the adapter, and at the same time sends the metadata of the CNC device.

[0065] The cloud platform receives the device instructions issued by the operator, completes the CNC device addressing, sends the CNC device execution instructions to the adapter cluster, and caches or stores the metadata and CNC device production data.

[0066] This invention discloses a data collection and instruction distribution system for numerical control equipment. The system comprises an agent cluster, an adapter cluster, and a cloud platform. The agent cluster collects and processes device data in a unified format sent by the adapter cluster. The adapter cluster requests device metadata from the agent cluster, then invokes an embedded program based on the metadata to collect raw data, converts it into a unified format, and uploads it. The cloud platform provides data persistence services and caches and stores intermediate messages and data. The system is reliable, efficient, and has low resource overhead, enabling diverse data collection on a variety of devices.

[0067] Example 1

[0068] The embodiment 1 provided by the present invention is an embodiment of a numerical control equipment data collection and instruction issuing system provided by the present invention, such as Figure 2 The figure shows the interaction diagram of each module in a numerical control equipment data collection and instruction issuing system provided by an embodiment of the present invention, combined with Figure 1 and Figure 2 It can be seen that this embodiment includes: an adapter cluster, an agent cluster and a cloud platform; the adapter cluster includes multiple adapters, and the agent cluster includes multiple agents.

[0069] Each adapter is directly connected to each numerical control device and is connected to the agent through network communication; the agent cluster is directly connected to the data storage unit.

[0070] As can be understood, the present invention provides a system for collecting and issuing numerical control equipment data, allowing data to reuse underlying network links. Compared to the traditional request-response model, it supports the division of requests and responses into multiple data frames, thereby avoiding long channel congestion and enabling bidirectional data flow transmission. Services and interfaces are defined based on the channel. The interfaces for communication between the adapter and the agent include a metadata request interface, a numerical control equipment production data transmission interface, an authentication interface, a subscription interface, and a numerical control equipment data transmission interface.

[0071] In a possible embodiment, the adapter sends the account and password to the agent through the authentication interface for authentication, and the agent returns the authentication result through the authentication interface.

[0072] The authentication interface uses a simple account and password for authentication in advance. The authentication return result includes the basic return result. The basic return result includes the error code defined for this interface, which is used to identify server exceptions.

[0073] The adapter cluster sends streaming request information containing subscription operations to the proxy cluster through the subscription interface, and the proxy cluster publishes response information containing push messages to the adapter through the subscription interface.

[0074] The subscription interface is a streaming request-response interface. The RESTful over HTTP protocol does not define its behavior specifications. This subscription interface shields upper-level developers from the underlying implementation details. It is encapsulated based on the streaming request-response model in the request-response model. Its basic design principle is to treat the subscription operation as a request and the active publishing (pushing) of messages by the proxy cluster as a response. The main difference from traditional responses is that the response is a streaming response. The proxy cluster sends events in sequence, and the adapter cluster processes the received messages according to certain rules. For each received data, it is used as a closure parameter to execute the corresponding developer-defined logic.

[0075] The data sent by the adapter to the agent through the CNC device data sending interface includes: message types of all data except CNC device production data, Unix standard time millisecond timestamp and payload.

[0076] The data sending interface of CNC equipment is the main communication interface when the equipment is running. It is responsible for sending all data except production data to the agent, such as the execution status of the command issued by the agent. The data sent includes the message type, Unix standard time millisecond timestamp and payload. The data type should be globally unified and should be defined in constants. Payloads can be parsed on the server side. Payloads are of bytes type and do not require additional description. The type determines the parsing method and processing method of payloads. In theory, the agent is not allowed to initiate requests to the adapter. However, similar functions are generally implemented by the agent sending commands to the command channel subscribed by the agent through the adapter. After receiving the subscription message, the adapter parses and processes it and sends the processing results to the adapter by calling this interface.

[0077] The data sent by the adapter to the agent through the CNC equipment production data sending interface includes: adapter ID, equipment ID, component ID, data item ID, Unix standard time millisecond timestamp and payload of CNC equipment production data.

[0078] The CNC equipment production data sending interface is the main calling interface when the equipment is running. It is only responsible for sending data. The data it sends includes the adapter ID, device ID, component ID, data item ID, Unix standard time millisecond timestamp and payload. In order to ensure forward compatibility, the payload does not require the type to be map<string,any> (here any should be a trivial type), but allows the appearance of value types such as json value. However, since json value is difficult to parse and the adapter is difficult to parse all types of data. Therefore, developers are expected to adopt a flat data interface, and the data type is determined by the data item ID. If multiple groups of data can be distinguished by the key name in the payloads plus a subscript, this also makes it easy for the data to be persisted in OLTP and OLAP databases for analysis by upper-level applications.

[0079] When the adapter makes a request to the broker through the metadata request interface, the request sent is the metadata ID.

[0080] The metadata request interface is called by the adapter to request metadata from the agent. The request contains a metadata ID, which must contain a non-null ID for at least one metadata type. There are six metadata types. The adapter operates by loading metadata. When the adapter begins running, it can obtain the device ID and agent ID through environment variables or other means. Using the tree structure composed of these IDs, the adapter retrieves the component ID and its corresponding metadata. This interface response is inert and does not proactively send metadata that may be needed.

[0081] The adapter requests the metadata of the CNC equipment from the agent through the metadata request interface. The metadata describes the hierarchical relationship between the CNC equipment and the components and data sources, and defines the field names, units and data types generated by the CNC equipment. Based on the metadata, the adapter calls the embedded process to collect the data produced by the CNC equipment directly connected to it, encapsulates the CNC equipment production data in a unified format and serializes it, and transmits it to the agent through the CNC equipment production data sending interface.

[0082] In one possible embodiment, the adapter requests the agent to obtain metadata of the CNC device and then loads the metadata; calls a streaming data processor to read and divide the data generated by the CNC device, collects the collected data generated by the CNC device, and uploads the data units and types. Specifically, the adapter's processing includes:

[0083] Run initialization and load the corresponding modules into memory.

[0084] Read the configuration file to obtain basic running information.

[0085] Get the metadata of CNC equipment based on the basic information of the equipment.

[0086] Start the embedded process responsible for communicating with the CNC device and establish a communication channel with the embedded process.

[0087] Identify the equipment, components and data items to which CNC equipment production data belongs.

[0088] The production data of CNC equipment in binary format is divided and uniformly formatted.

[0089] The uniformly formatted production data of CNC equipment is serialized and waits for data transmission.

[0090] In one possible embodiment, the adapter provides routing services for CNC equipment production data and periodically opens new data buffers to exchange with existing data buffers to ensure data atomicity. Specifically, the adapter caches and releases CNC equipment production data including:

[0091] A data buffer is opened for each component and its corresponding data items based on the metadata.

[0092] After collecting the production data of the CNC equipment, it is written into the corresponding data buffer; if the corresponding data buffer is not found, an error log is output; the adapter reads and counts the error log records and sends a warning.

[0093] Configure a timer for each data buffer and put it into the time pile.

[0094] The timer periodically triggers the upload of production data of CNC equipment.

[0095] Generates a new data buffer and atomically swaps the data buffer with the new data buffer.

[0096] Check whether the metadata is valid. If valid, format the CNC equipment production data according to the unified format.

[0097] Serialize the production data of the CNC equipment and write it into the channel.

[0098] The agent collects and processes the data generated by the CNC device sent by the adapter, and at the same time sends the metadata of the CNC device.

[0099] The cloud platform receives the device instructions issued by the operator, completes the CNC device addressing, sends the CNC device execution instructions to the adapter cluster, and caches or stores the metadata and CNC device production data.

[0100] It is understandable that if Figure 3 The figure shows a schematic diagram of a metadata structure of a numerical control device provided by an embodiment of the present invention, combined with Figure 3It can be seen that the metadata is a tree data structure that supports dynamic migration and adjustment of devices; the adapter identifies the CNC device according to the corresponding metadata and generates a CNC device instance based on the identification. The device instance includes: adapter object, device object and component object.

[0101] An adapter object consists of an adapter ID, name, adapter type, summary comment, runtime monitored device IDs, and user-defined device configuration. The device configuration file determines how the device is started, monitored, and interacts with metadata. When accessing metadata, the adapter queries the process's unique device hash table. If the device hash table doesn't contain a corresponding key-value pair, the agent initiates a query and writes the result to the device hash table.

[0102] A device object consists of a device ID, name, device type, summary comment, device group, device component ID, device component configuration, and data items used for data collection. Similar to the adapter structure, it reads the component configuration and determines the component startup method and message processing method. The data items it holds should be pointers, and each data item should be globally unique. The device object identifies the specific type and structure of the data generated by the CNC device. Similarly, component metadata is managed by a globally unique component hash table.

[0103] A component object consists of a component ID, name, component type, summary comment, and data information object. A component is the smallest independent node in the protocol, and a component object records the type of data and collection cycle that the component will collect.

[0104] All data belongs to a component, a component belongs to a device, and a device belongs to an adapter. This relationship is not a strong association, but allows for dynamic migration.

[0105] In the embodiment provided by the present invention, when a part of a component is damaged, it is replaced with a spare part. The user operates the cloud platform, and the cloud platform finds the adapter to which it belongs based on the device ID. The cloud platform generates a metadata change message, which contains the target agent ID, and then sends the message to the message queue. All agents read the message and check whether the target adapter exists in the adapter subscribed to the topic on the agent. If not, the message is discarded. If so, a metadata change message is sent. The adapter updates the metadata after parsing. It is worth mentioning that the cloud platform will write the change to the database for persistence. Even if the device is offline, the latest metadata will be obtained when it is reconnected. At this point, the metadata update is completed.

[0106] When a repaired part is installed on a new machine, the data generated will contain new equipment information. Through appropriate processing and analysis, the operating status and historical records of the same part that has worked on different equipment can be maintained.

[0107] In one possible embodiment, the system provides a load balancing and fault tolerance mechanism for the interaction between the agent cluster and the adapter cluster.

[0108] The system selects appropriate load balancing and fault tolerance mechanisms for the cluster, provides several common load balancing algorithms, and sets a more appropriate load balancing strategy based on the direct connection mode. At the same time, it refers to the design and implementation of mainstream fault tolerance mechanisms, allowing the system to modify the number of retries and select the failed retry strategy through the configuration file, and has made certain optimizations for cross-computer room issues. It provides a sticky load balancing algorithm to reduce the frequent reset and establishment of underlying links and maintain the communication status of the adapter cluster and the agent cluster. It is transparent to the upper-layer application. An embodiment of the system selecting a load balancing algorithm may include the following steps:

[0109] S1. Get the method name and service name. Use the service name as the key to check whether there is a cached selector.

[0110] S2. Calculate the CRC32 checksum of the given callee metadata. The calculation process is to serialize each caller metadata, perform CRC32 calculation on the resulting byte stream, and use the result as a hash code for comparison.

[0111] S3. Compare the hash code of the selector obtained in step S1 with the hash code obtained in step S2. If they are consistent, the selector gives the selection result and returns it.

[0112] S4. If they are inconsistent, check whether the historical callee selected in the selector exists in the currently callable callees. If so, update the selector hash value to the hash value of the callee.

[0113] S5. If it does not exist or the selector does not exist, generate a new selector

[0114] S6. Generate a selector. Using the IP address and port number of each callee, along with a uniform hash offset, as keys, the calculated hash values are stored in a hash table and a variable-length array. The hash table key is the calculated hash value, and the value is the corresponding callee. After obtaining the hash values for all callees, sort the variable-length array to construct a hash ring. This completes selector generation.

[0115] As can be understood, the present invention addresses the shortcomings of the background technology and proposes a system for collecting and issuing numerical control equipment data. Based on the current state of industrial internet research and practical work scenarios, this system studies the data types generated by factory numerical control equipment and smart factories, and proposes metadata suitable for the NC-Link protocol. This metadata is defined using proto3 and generates corresponding multi-platform interfaces. It describes the hierarchical relationship between numerical control equipment, components, and data sources, and defines the field names, units, and data types generated by the equipment.

[0116] Research and develop communication interfaces and adapters for each role to process and apply metadata. Metadata is parsed hierarchically, initiating data processing, parsing, and collection for corresponding components and data items based on the metadata. This shields underlying data type differences, enabling compatibility with devices that generate a variety of data encodings. Furthermore, data communication details are shielded, providing basic control and communication services for devices to meet the needs of smart factories.

[0117] When a CNC machine part is damaged and replaced with a spare, the user operates the cloud platform, the cluster is responsible for sending data, and the adapter parses and updates the metadata, thus supporting dynamic changes to the equipment and providing persistent storage.

[0118] CNC devices connect to the cluster through a proxy, which centrally maintains device routing information. The cloud platform generates control commands for the corresponding devices based on user instructions and routes them to the adapter. The adapter then sends the command data to the CNC device.

[0119] It should be noted that, in the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0120] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0121] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded computer, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0122] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0123] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0124] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0125] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.

Claims

1. A numerical control equipment data collection and instruction issuing system, characterized in that: The system includes: an adapter cluster, an agent cluster and a cloud platform; the adapter cluster includes multiple adapters, and the agent cluster includes multiple agents; Each of the adapters is directly connected to each numerical control device and is connected to the agent via network communication; the agent cluster is directly connected to the data storage unit; the communication interface between the adapter and the agent includes a metadata request interface and a numerical control device production data transmission interface; The adapter requests the proxy through the metadata request interface to obtain metadata of the CNC device, wherein the metadata describes the hierarchical relationship between the CNC device and the components and data sources, and defines the field names, units, and data types generated by the CNC device; based on the metadata, the adapter calls the embedded process to collect data produced by the CNC device directly connected to it, encapsulates the CNC device production data in a unified format, and then serializes the data, which is then transmitted to the proxy through the CNC device production data sending interface; The agent collects and processes the data generated by the numerical control device sent by the adapter, and simultaneously sends metadata of the numerical control device; The cloud platform receives the device instructions issued by the operator, completes the addressing of the CNC device, sends the CNC device execution instructions to the adapter cluster, and caches or stores the metadata and CNC device production data; The communication interface between the adapter and the agent also includes an authentication interface, a subscription interface and a numerical control device data transmission interface; The adapter sends the account and password to the agent through the authentication interface for authentication, and the agent returns the authentication result through the authentication interface; The adapter cluster sends streaming request information containing a subscription operation to the proxy cluster through the subscription interface, and the proxy cluster publishes response information containing a push message to the adapter through the subscription interface; The data sent by the adapter to the agent through the numerical control device data transmission interface includes: message types, Unix standard time millisecond timestamps and payloads of all data except the production data of the numerical control device; The metadata is a tree data structure that supports dynamic migration and adjustment of devices; the adapter identifies the CNC device according to the corresponding metadata and generates a CNC device instance based on the identification. The device instance includes: an adapter object, a device object, and a component object; The adapter object consists of an adapter ID, name, adapter type, summary comment, runtime monitored device ID, and user-defined device configuration. When the adapter accesses the metadata, it queries the process-unique device hash table. If there is no corresponding key-value pair in the device hash table, the agent initiates a query request and writes the request result to the device hash table. The device object consists of a device ID, name, device type, summary comment, device group, device component ID, device component configuration, and data items used for data collection; the device object identifies the specific type and structure of the data generated by the CNC device; The component object consists of a component ID, name, component type, summary comment, and data information object; the component is the smallest independent node divided in the protocol, and the component object records the type of data and collection cycle that the component will collect.

2. The system according to claim 1, wherein: The data sent by the adapter to the agent through the CNC equipment production data sending interface includes: the adapter ID, device ID, component ID, data item ID, Unix standard time millisecond timestamp and payload of the CNC equipment production data; When the adapter makes a request to the agent through the metadata request interface, the request sent is a metadata ID.

3. The system according to claim 1, wherein: The processing of the adapter includes: Run initialization and load the corresponding module into memory; Read the configuration file to obtain basic operation information; Acquire metadata of the numerical control device according to basic device information; Starting an embedded process responsible for communicating with the numerical control device and establishing a communication channel with the embedded process; Identify the equipment, components and data items to which the CNC equipment production data belongs; Dividing and uniformly formatting the production data of the numerical control equipment in binary format; The uniformly formatted production data of the numerical control equipment is serialized and waits for data transmission.

4. The system according to claim 1, wherein: The adapter provides routing services for the production data of the numerical control equipment and periodically opens a new data buffer to exchange with the original data buffer.

5. The system according to claim 4, characterized in that The adapter caches and releases the production data of the numerical control equipment, including: Opening a data buffer for each component and its corresponding data item according to the metadata; After collecting the production data of the numerical control equipment, write it into the corresponding data buffer; if the corresponding data buffer is not found, output an error log; Configure a timer for each data buffer and put it into the time stack; The timer periodically triggers the CNC equipment to upload production data; Generate a new data buffer, and atomically swap the data buffer with the new data buffer; Check whether the metadata is valid, and if valid, format the CNC equipment production data according to a unified format; The production data of the numerical control device is serialized and then written into the channel.

6. The system according to claim 1, wherein: The system provides load balancing and fault tolerance mechanisms for the interaction between the agent cluster and the adapter cluster.

Citation Information

Patent Citations

  • Power big data-oriented cross-database association retrieval method

    CN107766451A

  • Terminal equipment networking reference model and interaction method thereof

    CN112615935A