Remote equipment monitoring method of numerical control system and data processing method of remote equipment

The UDP protocol transmits binary data and image unique identifiers in segments, and uses red and black trees or hash table storage in local devices, which solves the problem of image packet loss in CNC systems and realizes the efficiency of remote real-time monitoring and maintenance improvement .

CN119105382APending Publication Date: 2024-12-10GREE ELECTRIC APPLIANCE INC OF ZHUHAI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411440280.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

When using UDP for image transmission in existing CNC systems, excessive image data packets are too large, which leads to a problem of packet loss.

Method used

UDP protocol is used to transmit binary data and the unique identifier of the current image in segments, and use red and black tree model or hash table to store and display segmented data in local devices to reduce packet loss and realize remote real-time monitoring of CNC machine tools. running status.

Benefits of technology

Through segmented transmission and red-black tree/hash table storage, packet loss is reduced, remote monitoring and maintenance efficiency of CNC machine tools is improved, and the problem of excessive bandwidth consumption is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119105382A_ABST
    Figure CN119105382A_ABST
Patent Text Reader

Abstract

The invention provides a remote equipment monitoring method of a numerical control system and a data processing method of remote equipment. According to the remote equipment monitoring method of the numerical control system, the remote equipment adopts the UDP protocol to carry out segmented transmission on the binary data and the unique identifier of the current image, so that the condition of packet loss in transmission is reduced; in addition, the local equipment adopts a red-black tree model or a hash table to store the image represented by the segmented data based on the unique identifier of the current image and displays the image represented by the segmented data, so that debugging personnel can remotely monitor the running state of the numerical control machine tool in real time, and troubleshooting and maintenance are facilitated; therefore, the problem of data packet loss caused by the fact that the occupied bandwidth is large due to the fact that the image data packet is too large when the image is transmitted by using the UDP in the existing scheme is solved.
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 systems, and in particular to a remote device monitoring method for a numerical control system and a data processing method for a remote device. Background Art

[0002] CNC system (CNC) is an important part of modern manufacturing industry, which processes parts precisely through computer control. Remote control system is a technology that connects remote devices with local devices through the network, allowing users to operate and control remote devices (Linux side) on local devices (PC side). In some cases, CNC machine tools may be in some special or dangerous environments, such as high temperature, high pressure or harmful gases. Through the remote control system, operators can perform remote operations in a safe environment, avoiding the risk of direct contact with dangerous environments, and improving the safety and reliability of operations;

[0003] The remote control system also facilitates troubleshooting and maintenance. It can monitor multiple operating systems or devices at the same time, and operation and maintenance personnel can remotely access devices, modify configurations, and upgrade software.

[0004] The existing solution uses UDP for image transmission. When sending images, the image data packets are too large, which occupies more bandwidth and causes data packet loss. Summary of the invention

[0005] The main purpose of the present application is to provide a remote device monitoring method for a numerical control system and a data processing method for a remote device, so as to at least solve the problem that in the existing solution, UDP is used for image transmission, and when sending images, the image data packet is too large, so more bandwidth is occupied, thereby causing data packet loss.

[0006] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a remote equipment monitoring method for a numerical control system is provided, comprising: receiving segmented data sent by a remote device using a UDP protocol, and parsing the segmented data to determine a unique identifier of a current image, wherein the segmented data includes binary data and a unique identifier of the current image; using a red-black tree model or a hash table to store an image represented by the segmented data based on the unique identifier of the current image and display the image represented by the segmented data.

[0007] Optionally, a red-black tree model is used to store the image represented by the segmented data based on the current image unique identifier, including: determining whether the state of the target image in the red-black tree model is a receiving state based on the current image unique identifier, and the target image is the image represented by the segmented data; when it is determined that the state of the target image in the red-black tree model is the receiving state, storing the target image in the red-black tree model to update the current number of fragments and image data related to the target image in the red-black tree model.

[0008] Optionally, when it is determined that the state of the target image in the red-black tree model is a non-receiving state, the method further includes: inserting a new image item into the red-black tree model, and when the number of keys in the red-black tree model is greater than a preset number, deleting the first item of the red-black tree model.

[0009] Optionally, displaying the image represented by the segmented data includes: displaying the target image on a window when the target image has been received.

[0010] Optionally, after displaying the image represented by the segmented data, the method further comprises: deleting the corresponding item of the target image in the red-black tree model.

[0011] Optionally, receiving segmented data sent by a remote device using the UDP protocol includes: receiving the segmented data including a total number of fragments, a current fragment number and corresponding data sent by the remote device using the UDP protocol.

[0012] Optionally, receiving segmented data sent by a remote device using the UDP protocol includes: receiving the segmented data whose data size is an integral multiple of 1024 and is sent by the remote device using the UDP protocol.

[0013] Optionally, the method further includes: determining that the type of the current event is a mouse event or a keyboard event; and using the UDP protocol to send the type, coordinates and window size of the current event to the remote device.

[0014] According to another aspect of the present application, a data processing method for a remote device is provided, comprising: performing smooth scaling processing on a current image captured by the remote device, and saving it as a file in PNG format to obtain an intermediate file; converting the intermediate file into binary data and generating a unique identifier for the current image, and using the UDP protocol to send the segmented data to a local device, wherein the segmented data includes the binary data and the unique identifier for the current image, the local device parses the segmented data to determine the unique identifier for the current image, and the local device uses a red-black tree model or a hash table to store the image represented by the segmented data based on the unique identifier for the current image and display the image represented by the segmented data.

[0015] Optionally, the method also includes: receiving indication data sent by the local device using the UDP protocol, the indication data including the type, coordinates and window size of the current event, the type of the current event being a mouse event or a keyboard event; writing the indication data into a corresponding event file in the input subsystem of the remote device to execute the mouse event or the keyboard event.

[0016] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the methods described.

[0017] According to another aspect of the present application, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the steps of any one of the methods described are implemented.

[0018] According to another aspect of the present application, a numerical control system is provided, which includes: a local device and multiple remote devices, wherein the local device communicates with all the remote devices respectively, the local device is used to execute any one of the remote device monitoring methods of the numerical control system, and the remote device is used to execute any one of the data processing methods of the remote device.

[0019] By applying the technical solution of the present application, since the remote device uses the UDP protocol to transmit the binary data and the unique identifier of the current image in segments, the packet loss during transmission is reduced. In addition, the local device uses a red-black tree model or a hash table to store and display the image represented by the segmented data based on the unique identifier of the current image, so that the debugging personnel can remotely monitor the operating status of the CNC machine tool in real time, which is beneficial to troubleshooting and maintenance, and thus solves the problem of the existing solution using UDP for image transmission, and when sending images, the image data packet is too large, which occupies more bandwidth, thereby causing data packet loss. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0021] Figure 1 A schematic flow chart of a remote device monitoring method for a numerical control system provided according to an embodiment of the present application is shown;

[0022] Figure 2 A schematic diagram showing the principle of inserting segmented data using an offset according to an embodiment of the present application is shown;

[0023] Figure 3 A schematic flow chart of another method for remote device monitoring of a numerical control system provided according to an embodiment of the present application is shown;

[0024] Figure 4 A schematic flow chart of a part related to mouse events or keyboard events in another method for remote device monitoring of a numerical control system provided according to an embodiment of the present application is shown;

[0025] Figure 5 A structural block diagram of a local device provided according to an embodiment of the present application is shown;

[0026] Figure 6 A schematic diagram showing a flow chart of a data processing method of a remote device provided according to an embodiment of the present application;

[0027] Figure 7 A structural block diagram of a remote device provided according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0028] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0029] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0031] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:

[0032] A red-black tree is a self-balancing binary search tree that adds a storage bit to each node to indicate the color of the node, which can be red or black. By using some specific rules to keep the tree balanced, the red-black tree can maintain good performance when inserting and deleting nodes. It is a commonly used data structure and is widely used in the field of computer science, such as in the scheduling algorithm of the operating system and the index structure of the database system.

[0033] UDP is short for User Datagram Protocol, which is a connectionless, simple network transmission protocol. UDP does not guarantee the reliability and order of data transmission, nor does it provide a congestion control mechanism, so packet loss or disorder may occur during data transmission. UDP is usually used to transmit applications on the network that have high real-time requirements and less stringent requirements on data accuracy, such as audio and video streams.

[0034] As introduced in the background technology, the numerical control system (CNC) is an important part of the modern manufacturing industry, which processes parts precisely through computer control. The remote control system is a technology that connects the remote device with the local device through the network, so that the user can operate and control the remote device (Linux side) on the local device (PC side). In some cases, the CNC machine tool may be in some special or dangerous environments, such as high temperature, high pressure or the presence of harmful gases. Through the remote control system, the operator can perform remote operation in a safe environment, avoiding the risk of direct contact with the dangerous environment, and improving the safety and reliability of the operation. In order to solve the problem that the existing solution uses UDP for image transmission, the image data packet is too large when sending the image, which occupies more bandwidth, thereby causing the problem of data packet loss, the embodiment of the present application provides a remote device monitoring method of a numerical control system and a data processing method of a remote device.

[0035] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0036] In this embodiment, a remote equipment monitoring method for a numerical control system is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0037] Figure 1 FIG. 1 is a flow chart of a remote device monitoring method for a numerical control system provided according to an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:

[0038] Step S101, receiving segmented data sent by a remote device using a UDP protocol, and parsing the segmented data to determine a unique identifier of a current image, wherein the segmented data includes binary data and the unique identifier of the current image;

[0039] Specifically, the remote device performs smooth scaling processing on the current image collected by the remote device, and saves it as a file in PNG format to obtain an intermediate file, and converts the intermediate file into binary data and generates a unique identifier of the current image, and uses the UDP protocol to send the segmented data to the local device; the main device receives the segmented data sent by the remote device using the UDP protocol, and parses the segmented data to determine the unique identifier of the current image;

[0040] Reasons for converting binary data: Due to the large amount of data, the data will be transmitted in segments to reduce packet loss during transmission.

[0041] When each image is transmitted, a digital label is generated as the image identification (that is, the unique identification of the current image). Then, when each fragment of the image is transmitted, the digital label of the image, the total number of fragments, the current fragment number and the corresponding data are added. The size of each fragment data (excluding the last fragment) is 4096 bytes, and the data size of the last fragment is less than or equal to 4096 bytes.

[0042] Step S102: using a red-black tree model or a hash table to store the image represented by the segmented data based on the unique identifier of the current image and display the image represented by the segmented data.

[0043] In the above steps, since the remote device uses the UDP protocol to transmit the binary data and the unique identifier of the current image in segments, the packet loss during transmission is reduced. In addition, the local device uses a red-black tree model or a hash table to store and display the image represented by the segmented data based on the unique identifier of the current image, so that the debugging personnel can remotely monitor the operating status of the CNC machine tool in real time, which is beneficial to troubleshooting and maintenance, thereby solving the problem of using UDP for image transmission in the existing solution. When sending images, the image data packet is too large, which occupies more bandwidth, thereby causing data packet loss.

[0044] The red-black tree in the receiving end buffer can be replaced with a hash table for storage. Compared with the red-black tree, the average time complexity of the hash table in inserting, deleting, and searching operations is more efficient. However, the storage of the hash table is unordered, so a flag or queue needs to be added to assist in recording which item is inserted first in the hash table, and to delete and update when the number of received pictures exceeds the set upper limit.

[0045] The local device defines a structure ImageData to store image information (total number of slices, current number of slices, image data), and defines a red-black tree to store the received information.

[0046] In one embodiment of the present application, a red-black tree model is used to store the image represented by the segmented data based on the unique identifier of the current image, including:

[0047] According to the unique identifier of the current image, determining whether the state of the target image in the red-black tree model is a receiving state, the target image being the image represented by the segmented data;

[0048] When it is determined that the state of the target image in the red-black tree model is the receiving state, the target image is stored in the red-black tree model to update the current number of slices and image data related to the target image in the red-black tree model.

[0049] Specifically, whether the state of the target image in the red-black tree model is the receiving state is determined by the current image unique identifier. When it is determined that the state of the target image in the above red-black tree model is the above receiving state, it is determined that the image data needs to be updated, and the above target image is stored in the above red-black tree model to update the current number of fragments and image data related to the above target image in the above red-black tree model.

[0050] The image data is stored in a dynamic array, which will automatically expand or shrink when needed to adapt to the size change of the data. The internal storage space of the dynamic data is continuous, so the starting address of the array is the head address, and the offset is used to manage and access the data more efficiently.

[0051] The receiving end (ie, the local device) receives the segmented data including the total number of fragments, the current fragment number, and the corresponding data sent by the remote device using the UDP protocol.

[0052] After receiving the data packet, the receiver obtains the digital label of the image from it, and then searches the red-black tree for the corresponding image structure (value) through the digital label (key). The header address of the image data can be obtained in the structure, and the offset of the slice data can be obtained by multiplying the current slice number by 4096 (the size of each slice).

[0053] The offset is Figure 2 As shown, the current image data has segment 1 data and segment 2 data, and segment 3 data needs to be inserted according to the offset, where the offset = (number of segments - 1) × data length.

[0054] For example: if the current slice number is 0, the data offset is 0, and the header address of the obtained image data is 0x700000 (hexadecimal), then the storage space of the image slice is 0x700000 (hexadecimal) to 0x700000 (hexadecimal) + 4096 (binary). If the current slice number is 2, the storage space of the image slice is 0x700000 (hexadecimal) + 2*4096 to 0x700000 (hexadecimal) + 3*4096 (binary).

[0055] In one embodiment of the present application, when it is determined that the state of the target image in the red-black tree model is a non-receiving state, the method further includes:

[0056] A new image item is inserted into the red-black tree model, and when the number of keys in the red-black tree model is greater than a preset number, the first item of the red-black tree model is deleted.

[0057] After receiving each set of image slice data, the receiver uses the image's digital number to find out whether the image has been stored in the red-black tree. If not, an item is inserted into the red-black tree and checked whether there are more than ten items stored in the red-black tree. If there are more than ten items, the first inserted item among the ten items is deleted. If the image is stored in the red-black tree, the corresponding item is found from the red-black tree, and its current number of slices and image data are updated. The updated current number of slices is compared with the total number of slices. If they are equal, the data is restored to an image in PNG format and displayed on the PC. The item is deleted from the red-black tree so that other image data can be stored later.

[0058] After the structure is updated, it is judged whether the update item has been received. If the image has been received, it is displayed on the PC window and the item is deleted from the red-black tree. When the number of images stored in the red-black tree is greater than the set upper limit, the red-black tree is searched to find the key and value corresponding to the first received image and remove it from the red-black tree to implement the first-in-first-out principle.

[0059] In one embodiment of the present application, displaying an image represented by the segmented data includes:

[0060] When the reception of the target image is completed, the target image is displayed on the window.

[0061] Compare the updated current number of slices with the total number of slices. If they are equal, restore the data to a PNG format image and display it on the PC.

[0062] In one embodiment of the present application, after displaying the image represented by the segmented data, the method further includes:

[0063] Delete the items corresponding to the above target image in the above red-black tree model.

[0064] Delete the corresponding item of the target image from the red-black tree so that other image data can be stored later.

[0065] In one embodiment of the present application, receiving segmented data sent by a remote device using a UDP protocol includes:

[0066] The above-mentioned segmented data with a data size that is an integral multiple of 1024 (ie, 4096) is received and sent by the above-mentioned remote device using the above-mentioned UDP protocol.

[0067] In one embodiment of the present application, the above method further includes:

[0068] Determine whether the current event type is a mouse event or a keyboard event;

[0069] The type, coordinates and window size of the current event are sent to the remote device using the UDP protocol.

[0070] Specifically, the remote operation instructions (mouse events, keyboard events) of the PC are converted into data packets through the UDP communication protocol and sent to the Linux server. The server parses the operation instructions from the data packets and writes them into the event file corresponding to the Linux operating subsystem. The mouse events and keyboard events are simulated through the Linux driver. This solves the problem of high operation and maintenance costs caused by the need for operation and maintenance personnel to be on site when the CNC machine tools are configured or the software is upgraded. The operation and maintenance personnel can complete the configuration modification and software upgrade of the CNC machine tools online through the remote control system.

[0071] When the CNC machine tool is in some dangerous environment or the operator needs to perform some dangerous operations, dangerous problems may occur. Through the present invention, remote operation can be achieved through the remote control system, avoiding the dangers that may be encountered in direct contact, and improving the safety and reliability of the operation.

[0072] The server obtains the local host window size and the client window size to complete the conversion of the coordinates from the client to the server (converted in proportion).

[0073] About red-black trees and hash values:

[0074] In the present invention, the receiving end needs to frequently perform insertion and deletion operations on the cache area. In theory, the average time complexity of the red-black tree for insertion and deletion operations is O(log n), while the average time complexity of the hash table for insertion and deletion is O(1), but in the worst case it may reach O(n), which depends on the solution to the hash conflict and the control of the load factor.

[0075] In the present invention, when the data of an image is lost and the first inserted image needs to be found for deletion (case 1), the first inserted item in the cache needs to be found and deleted. For the red-black tree, because its storage is ordered, it is only necessary to delete the head data of the red-black tree when searching and deleting, while the hash table needs other data structures to assist, such as creating a queue to record which image data comes in first, and sorting the order of image entry through the queue, because when the first item needs to be deleted, the search and deletion speed of the red-black tree is much faster than that of the hash table, and it takes up less space (because the hash table needs the assistance of the queue).

[0076] However, when the image data needs to be deleted after the image is reorganized (case 2), the search speed of the hash table is better than that of the red-black tree, because the red-black tree needs to find the item to be deleted through sequential traversal, while the hash table can be directly indexed by key value, which takes less time than the red-black tree;

[0077] Although the occurrence frequency of situation 2 in the present invention exceeds that of situation 1, the present invention takes into account that the sending end may send images with the same name, which will seriously affect the storage performance of the hash table. It will be better to use a red-black tree as the data cache area.

[0078] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the remote device monitoring method of the numerical control system of the present application will be described in detail below in combination with specific embodiments.

[0079] This embodiment relates to a specific remote device monitoring method of a numerical control system, such as Figure 3 As shown, including:

[0080] The remote device performs smooth scaling processing on the current image collected by the remote device, and saves it as a file in PNG format to obtain an intermediate file;

[0081] The remote device converts the intermediate file into binary data and generates a unique identifier for the current image, and uses the UDP protocol to send the segmented data to the local device;

[0082] The local device receives the segmented data sent by the remote device using the UDP protocol, and parses the segmented data to determine the unique identifier of the current image. The segmented data includes binary data and the unique identifier of the current image; the binary data includes the total number of fragments, the current fragment number, and the segmented data of the corresponding data;

[0083] The local device determines whether the state of the target image is a receiving state in the red-black tree model according to the unique identifier of the current image, and the target image is an image represented by segmented data;

[0084] When the local device determines that the state of the target image in the red-black tree model is a receiving state, the local device stores the target image in the red-black tree model to update the current number of slices and image data related to the target image in the red-black tree model;

[0085] The local device deletes the corresponding item of the target image in the red-black tree model;

[0086] When the target image has been received, the local device displays the target image on the window;

[0087] When it is determined that the state of the target image in the red-black tree model is not being received, a new image item is inserted into the red-black tree model, and the number of keys in the red-black tree model is greater than a preset number (i.e., 10), the local device deletes the first item of the red-black tree model.

[0088] The part of mouse event or keyboard event is as follows Figure 4 As shown, including:

[0089] The local device determines that the type of the current event is a mouse event or a keyboard event;

[0090] The local device uses the UDP protocol to send the type, coordinates and window size of the current event to the remote device.

[0091] The remote device receives the indication data sent by the local device using the UDP protocol, the indication data including the type, coordinates and window size of the current event, the type of the current event being a mouse event or a keyboard event;

[0092] The remote device writes the indication data into a corresponding event file in the input subsystem of the remote device to execute the mouse event or the keyboard event.

[0093] Mouse events represent operations performed by the user using the mouse, and keyboard events represent operations performed by the user using the keyboard.

[0094] Since the remote device uses the UDP protocol to transmit the binary data and the unique identifier of the current image in segments, packet loss during transmission is reduced. In addition, the local device uses a red-black tree model or a hash table to store and display the image represented by the segmented data based on the unique identifier of the current image, so that the debugging personnel can remotely monitor the operating status of the CNC machine tool in real time, which is beneficial to troubleshooting and maintenance, thereby solving the problem of using UDP for image transmission in the existing solution. When sending images, the image data packet is too large, which occupies more bandwidth, thereby causing data packet loss.

[0095] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0096] The embodiment of the present application also provides a local device. It should be noted that the local device of the embodiment of the present application can be used to execute the remote device monitoring method for a numerical control system provided by the embodiment of the present application. The local device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions thereof will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the local device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0097] The following is an introduction to the local device provided in the embodiments of the present application.

[0098] Figure 5 is a structural block diagram of a local device provided according to an embodiment of the present application. Figure 5 As shown, the local devices include:

[0099] The receiving unit 51 is used to receive the segmented data sent by the remote device using the UDP protocol, and parse the segmented data to determine the unique identifier of the current image, wherein the segmented data includes binary data and the unique identifier of the current image;

[0100] The first processing unit 52 is used to store the image represented by the segmented data based on the unique identifier of the current image by using a red-black tree model or a hash table and display the image represented by the segmented data.

[0101] The above-mentioned local device, since the remote device adopts the UDP protocol to transmit the binary data and the above-mentioned current image unique identifier in segments, the packet loss during transmission is reduced. In addition, the local device adopts a red-black tree model or a hash table to store and display the image represented by the above-mentioned segmented data based on the above-mentioned current image unique identifier, so that the debugging personnel can remotely monitor the operating status of the CNC machine tool in real time, which is conducive to troubleshooting and maintenance, and thus solves the problem that the existing solution uses UDP for image transmission, and when sending images, the image data packet is too large, which occupies more bandwidth, thereby causing data packet loss.

[0102] In one embodiment of the present application, the first processing unit includes a first processing module and a second processing module.

[0103] The first processing module is used to determine whether the state of the target image in the red-black tree model is a receiving state according to the unique identifier of the current image, and the target image is an image represented by the segmented data;

[0104] The second processing module is used to store the target image in the red-black tree model when it is determined that the state of the target image in the red-black tree model is the receiving state, so as to update the current number of slices and image data related to the target image in the red-black tree model.

[0105] In one embodiment of the present application, the first processing unit includes a third processing module, which, when determining that the state of the target image in the red-black tree model is not in the receiving state,

[0106] The third processing module is used to insert a new image item into the red-black tree model, and when the number of keys in the red-black tree model is greater than a preset number, delete the first item of the red-black tree model.

[0107] In one embodiment of the present application, the first processing unit includes a fourth processing module,

[0108] The fourth processing module is used for displaying the target image on the window when the target image has been received.

[0109] In one embodiment of the present application, the local device further includes a second processing unit, which, after displaying the image represented by the segmented data,

[0110] The second processing unit is used to delete the items corresponding to the target image in the red-black tree model.

[0111] In one embodiment of the present application, the receiving unit includes a first receiving module.

[0112] The first receiving module is used to receive the above-mentioned segmented data including the total number of fragments, the current fragment number and the corresponding data sent by the above-mentioned remote device using the above-mentioned UDP protocol.

[0113] In one embodiment of the present application, the receiving unit includes a second receiving module.

[0114] The second receiving module is used to receive the above-mentioned segmented data with a data size that is an integral multiple of 1024 and sent by the above-mentioned remote device using the above-mentioned UDP protocol.

[0115] In one embodiment of the present application, the local device further includes a determining unit and a third processing unit.

[0116] The determination unit is used to determine whether the type of the current event is a mouse event or a keyboard event;

[0117] The third processing unit is used to send the type, coordinates and window size of the current event to the remote device using the UDP protocol.

[0118] The local device includes a processor and a memory, and the above-mentioned receiving unit and the first processing unit are stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to implement corresponding functions. The above-mentioned modules are all located in the same processor; or, the above-mentioned modules are located in different processors in any combination.

[0119] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the kernel parameters can be adjusted to solve the problem that the existing solution uses UDP for image transmission. When sending images, the image data packet is too large, which occupies more bandwidth, resulting in data packet loss.

[0120] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0121] In this embodiment, a remote device data processing method is provided. Figure 6 is a flow chart of a data processing method of a remote device according to an embodiment of the present application. Figure 6 As shown, the method comprises the following steps:

[0122] Step S601, performing smooth scaling processing on the current image collected by the remote device and saving it as a file in PNG format to obtain an intermediate file;

[0123] Step S602: convert the intermediate file into binary data and generate a unique identifier for the current image, and send the segmented data to the local device using the UDP protocol, wherein the segmented data includes the binary data and the unique identifier for the current image. The local device parses the segmented data to determine the unique identifier for the current image. The local device uses a red-black tree model or a hash table to store and display the image represented by the segmented data based on the unique identifier for the current image.

[0124] Since the remote device uses the UDP protocol to transmit the binary data and the unique identifier of the current image in segments, packet loss during transmission is reduced. In addition, the local device uses a red-black tree model or a hash table to store and display the image represented by the segmented data based on the unique identifier of the current image, so that the debugging personnel can remotely monitor the operating status of the CNC machine tool in real time, which is beneficial to troubleshooting and maintenance, thereby solving the problem of using UDP for image transmission in the existing solution. When sending images, the image data packet is too large, which occupies more bandwidth, thereby causing data packet loss.

[0125] In one embodiment of the present application, the above method further includes:

[0126] Receiving indication data sent by the local device using the UDP protocol, the indication data including the type, coordinates and window size of the current event, the type of the current event being a mouse event or a keyboard event;

[0127] The indication data is written into a corresponding event file in the input subsystem of the remote device to execute the mouse event or the keyboard event.

[0128] The present application also provides a remote device, such as Figure 7 As shown, including:

[0129] The fourth processing unit 71 is used to perform smooth scaling processing on the current image collected by the remote device, and save it as a file in PNG format to obtain an intermediate file;

[0130] The fifth processing unit 72 is used to convert the above-mentioned intermediate file into binary data and generate a unique identifier of the current image, and use the UDP protocol to send the segmented data to the local device, wherein the above-mentioned segmented data includes the above-mentioned binary data and the above-mentioned current image unique identifier, the above-mentioned local device parses the above-mentioned segmented data to determine the current image unique identifier, and the above-mentioned local device uses a red-black tree model or a hash table to store the image represented by the above-mentioned segmented data based on the above-mentioned current image unique identifier and display the image represented by the above-mentioned segmented data.

[0131] The remote device further includes a sixth processing unit and a seventh processing unit,

[0132] The sixth processing unit is used to receive the indication data sent by the local device using the UDP protocol, where the indication data includes the type, coordinates and window size of the current event, and the type of the current event is a mouse event or a keyboard event;

[0133] The seventh processing unit is used to write the above-mentioned indication data into the corresponding event file in the input subsystem of the above-mentioned remote device to execute the above-mentioned mouse event or the above-mentioned keyboard event.

[0134] An embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the remote device monitoring method of the numerical control system.

[0135] An embodiment of the present invention provides a processor, and the processor is used to run a program, wherein the remote device monitoring method of the numerical control system is executed when the program is run.

[0136] The embodiment of the present invention provides a device, the device includes a processor, a memory and a program stored in the memory and can be run on the processor, and the processor implements at least the following steps when executing the program: receiving segmented data sent by a remote device using the UDP protocol, parsing the segmented data, determining the unique identifier of the current image, the segmented data includes binary data and the unique identifier of the current image; using a red-black tree model or a hash table to store the image represented by the segmented data based on the unique identifier of the current image and display the image represented by the segmented data. The device in this article can be a server, a PC, a PAD, a mobile phone, etc.

[0137] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that initializes at least the following method steps: receiving segmented data sent by a remote device using a UDP protocol, and parsing the above segmented data to determine a unique identifier of a current image, wherein the above segmented data includes binary data and the above current image unique identifier; using a red-black tree model or a hash table to store the image represented by the above segmented data based on the above current image unique identifier and display the image represented by the above segmented data.

[0138] The present application also provides a numerical control system, which includes: a local device and multiple remote devices, the local device communicates with all the remote devices respectively, the local device is used to execute any one of the remote device monitoring methods of the numerical control system, and the remote device is used to execute any one of the data processing methods of the remote devices.

[0139] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0140] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0141] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, 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 processor, or other programmable data processing device to generate 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 flowchart and / or block diagram. 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.

[0142] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate 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 A function specified in one or more boxes.

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

[0144] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0145] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0146] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0147] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0148] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:

[0149] 1) The remote device monitoring method of the CNC system of the present application uses the UDP protocol to transmit binary data and the above-mentioned current image unique identifier in segments, thereby reducing packet loss during transmission. In addition, the local device uses a red-black tree model or a hash table to store and display the image represented by the above-mentioned segmented data based on the above-mentioned current image unique identifier, so that the debugging personnel can remotely monitor the operating status of the CNC machine tool in real time, which is beneficial to troubleshooting and maintenance, and thus solves the problem that the existing solution uses UDP for image transmission, and when sending images, the image data packet is too large, which occupies more bandwidth, thereby causing data packet loss.

[0150] 2) The data processing method of the remote device of the present application uses the UDP protocol to transmit the binary data and the unique identifier of the current image in segments, thereby reducing the packet loss during transmission. In addition, the local device uses a red-black tree model or a hash table to store and display the image represented by the segmented data based on the unique identifier of the current image, so that the debugging personnel can remotely monitor the operating status of the CNC machine tool in real time, which is beneficial to troubleshooting and maintenance, and thus solves the problem that the existing solution uses UDP for image transmission, and when sending images, the image data packet is too large, which occupies more bandwidth, thereby causing data packet loss.

[0151] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A remote equipment monitoring method for a numerical control system, characterized in that: include: Receiving segmented data sent by a remote device using a UDP protocol, and parsing the segmented data to determine a unique identifier of a current image, wherein the segmented data includes binary data and the unique identifier of the current image; The image represented by the segmented data is stored and displayed based on the unique identifier of the current image using a red-black tree model or a hash table.

2. The method according to claim 1, characterized in that The image represented by the segmented data is stored based on the unique identifier of the current image using a red-black tree model, including: Determine, according to the current image unique identifier, whether the state of a target image in the red-black tree model is a receiving state, the target image being an image represented by the segmented data; When it is determined that the state of the target image in the red-black tree model is the receiving state, the target image is stored in the red-black tree model to update the current number of slices and image data related to the target image in the red-black tree model.

3. The method according to claim 2, characterized in that In the case where it is determined that the state of the target image in the red-black tree model is a non-receiving state, the method further includes: A new image item is inserted into the red-black tree model, and when the number of keys in the red-black tree model is greater than a preset number, the first item of the red-black tree model is deleted.

4. The method according to claim 2, characterized in that: An image representing the segmented data is displayed, comprising: In a case where the target image has been received, the target image is displayed on the window.

5. The method according to claim 2, characterized in that: After displaying the image represented by the segmented data, the method further comprises: Delete the item corresponding to the target image in the red-black tree model.

6. The method according to any one of claims 1 to 5, characterized in that Receive segmented data sent by the remote device using the UDP protocol, including: Receive the segmented data including the total number of fragments, the current fragment number and the corresponding data sent by the remote device using the UDP protocol.

7. The method according to any one of claims 1 to 5, characterized in that Receive segmented data sent by the remote device using the UDP protocol, including: The segmented data with a data size that is an integral multiple of 1024 is received and sent by the remote device using the UDP protocol.

8. The method according to any one of claims 1 to 5, characterized in that The method further comprises: Determine whether the current event type is a mouse event or a keyboard event; The type, coordinates and window size of the current event are sent to the remote device using the UDP protocol.

9. A data processing method of a remote device, characterized in that: include: Smoothly scale the current image collected by the remote device and save it as a PNG format file to obtain an intermediate file; The intermediate file is converted into binary data and a unique identifier of the current image is generated, and the segmented data is sent to a local device using the UDP protocol, wherein the segmented data includes the binary data and the unique identifier of the current image, the local device parses the segmented data to determine the unique identifier of the current image, and the local device uses a red-black tree model or a hash table to store the image represented by the segmented data based on the unique identifier of the current image and display the image represented by the segmented data.

10. The method according to claim 9, characterized in that The method further comprises: Receiving indication data sent by the local device using the UDP protocol, the indication data including the type, coordinates and window size of a current event, the type of the current event being a mouse event or a keyboard event; The indication data is written into a corresponding event file in the input subsystem of the remote device to execute the mouse event or the keyboard event.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 8.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

13. A numerical control system, characterized in that: include: A local device and multiple remote devices, wherein the local device communicates with all the remote devices respectively, the local device is used to execute the method described in any one of claims 1 to 8, and the remote device is used to execute the method described in any one of claims 9 or 10.