Batch data transmission method

Data collected by the client and batch transmitted to the server in the cache queue, the server load and network congestion caused by high-frequency data transmission of 3D printing equipment are solved, and the stable, fast and complete data transmission is achieved.

CN119094484APending Publication Date: 2024-12-06XIAN BRIGHT ADDTIVE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411221071.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

When existing 3D printing equipment transmits high frequency data, it leads to excessive load on the server side, network congestion, low transmission efficiency and data incompleteness.

Method used

The client collects real-time data and writes it to the cache queue, and uses asynchronous threads to batch transmit to the server. If the transmission fails, the breakpoint storage local database is to be retransmitted, and the communication connection is maintained through heartbeat detection.

Benefits of technology

It reduces the server load, avoids network congestion, improves transmission efficiency and data integrity, and ensures high performance, fast and stable transmission of 3D equipment data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094484A_ABST
    Figure CN119094484A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of additive manufacturing, and relates to a batch data transmission method, which comprises the following steps that: 1) a client establishes communication connection with a server; (2) the client side collects real-time data in the forming process through a collector and writes the real-time data into a cache queue; 3) the client transmits the real-time data in the cache queue to the server in batches; 4) judging whether the real-time data is successfully transmitted or not, and if so, continuing the step 3) until the real-time data is completely transmitted; and if not, carrying out breakpoint cache data storage on the real-time data to be transmitted. According to the batch data transmission method, the transmission frequency from the client to the server can be reduced, the load of the server can be reduced, network congestion is avoided, the transmission efficiency is improved, and occupied resources are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of additive manufacturing and relates to a method for transmitting batch data, and in particular to a method for transmitting batch data of an industrial Internet 3D printing device to the outside world. Background Art

[0002] In the prior art, the real-time data collected by the 3D printing device is transmitted externally. The data transmission method is based on the frequency of the real-time data collection of the device, and multiple threads are directly called to transmit to the external server. When there are multiple device clients and high-frequency transmission, a large amount of concurrency will be caused. In this case, the server may not be able to process it in a timely and effective manner, which will cause the external server to be overloaded, causing the server to crash and lose data. Network congestion will also cause low transmission efficiency and high resource usage. Summary of the invention

[0003] In order to solve the above technical problems existing in the background technology, the present invention provides a batch data transmission method which can reduce the transmission frequency from the client to the server, reduce the server load, avoid network congestion, improve transmission efficiency and reduce resource occupation.

[0004] In order to achieve the above object, the present invention adopts the following technical solution:

[0005] A batch data transmission method, characterized in that: the batch data transmission method comprises the following steps:

[0006] 1) The client establishes a communication connection with the server;

[0007] 2) The client collects real-time data of the printing process through the collector and writes it into the cache queue;

[0008] 3) The client transfers the real-time data in the cache queue to the server in batches.

[0009] The above client collects real-time data of the printing process through the collector and writes it into the cache queue, including:

[0010] 2.1) The client collects real-time data during the printing process at a fixed frequency through the collector;

[0011] 2.2) The client pre-processes the collected real-time data;

[0012] 2.3) The client writes the pre-processed real-time data into the cache queue.

[0013] In the above step 2.1), the real-time data is a combination of one or more types of device data, print data and alarm data.

[0014] The above step 2.3) uses an asynchronous thread to write the real-time data into the client cache queue.

[0015] The above step 3) is specifically:

[0016] 3.1) The client cyclically reads real-time data from the cache queue through the collector;

[0017] 3.2) The client calls the server interface and sends the read real-time data in batches to the server.

[0018] When the above-mentioned client cyclically reads real-time data from the cache queue through the collector, it also determines the length of data stored in the cache queue. If the length of data stored in the cache queue is equal to or exceeds the preset data length of the cache queue, the data stored in the cache queue is batch read with the preset data length as the reading unit; if the length of data stored in the cache queue is less than the preset data length of the cache queue, the data is not read and waits for the next data reading.

[0019] The above method also includes: when the client transmits the real-time data in the cache queue to the server in batches, it is determined whether the real-time data is transmitted successfully. If the real-time data transmission is successful, the batch data transmission ends; if the real-time data transmission fails, the client saves the real-time data to be transmitted as breakpoint cache data.

[0020] The above-mentioned client stores the real-time data to be transmitted in a breakpoint cache data. Specifically, the client stores the real-time data to be transmitted in a local database through a collector. After waiting for the communication connection to be normal, the collector reads the real-time data to be transmitted stored in the local database, and transmits the real-time data to be transmitted to the server in batches.

[0021] After waiting for the communication connection to be normal, before the collector reads the real-time data to be transmitted stored in the local database, the collector queries the local database whether the real-time data to be transmitted exists; after the real-time data to be transmitted is transmitted in batches to the server, the local database deletes the real-time data to be transmitted that has been transmitted to the server.

[0022] After the client and the server establish a communication connection, a heartbeat detection is started between the client and the server through an asynchronous thread. If the heartbeat detection is normal, the communication connection is normal; if the heartbeat detection is abnormal, the communication connection is abnormal.

[0023] The advantages of the present invention are:

[0024] The present invention provides a batch data transmission method, including: 1) establishing a communication connection between a client and a server; 2) the client collects real-time data of the printing process through a collector and writes it into a cache queue; 3) the client transmits the real-time data in the cache queue to the server in batches. The present invention collects real-time data and stores it in a local cache area through a data collector on the device, stores it in a data structure of a local queue, and takes it out in batches after accumulating a certain amount of data. According to the data effectiveness and the memory allocation and occupancy of the equipment industrial computer, a delay time is set, and the batch transmission is regularly transmitted to the cloud platform server; network communication problems or server crashes cause data transmission failures, and the data is stored in a local file database during the failure, and the database file data is read in batches and retransmitted to ensure data integrity. The present invention solves the problems of high server load, low transmission efficiency due to network congestion, incomplete data, and high configuration required by the server in the prior art. Therefore, the present invention is that a large amount of data collected by the device during the 3D device printing process can be transmitted to the cloud platform server in batches, quickly, stably, and completely, and data is provided for the platform equipment status monitoring, fault diagnosis, predictive maintenance and other functional modules; it is convenient for users to understand the equipment status and production situation at any time. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a logic block diagram of the batch data transmission method provided by the present invention;

[0026] Figure 2 It is a flow chart of the batch data transmission method provided by the present invention. DETAILED DESCRIPTION

[0027] At present, the real-time data collected by 3D printing equipment is transmitted externally. The data transmission method is based on the frequency of real-time data collection by the device, and multi-threaded direct calls are made to transmit to the external server. When there are multiple device clients and high-frequency transmission, a large amount of concurrency will be caused. In this case, the server may not be able to process it in a timely and effective manner, which will cause the external server to be overloaded, causing the server to crash and lose data. Network congestion will also cause low transmission efficiency and high resource usage.

[0028] In order to solve the above problems, the present invention provides a batch data transmission method to reduce the transmission frequency from the client to the server, reduce the server load, avoid network congestion, improve transmission efficiency, and reduce occupied resources.

[0029] In the present invention, the client refers to the printing device end, and the client operating environment can be a netframework 4.5.1+windows7 system. The server refers to the server of external users, and the server operating environment can be a netframework4.7.2+windows server 2016.

[0030] See also Figure 1 ,The data simulator and collector are both modules deployed on the client, and the cloud platform is the server. The data simulator is a module that can generate real-time data of the client, that is, the real-time data generated by the printing device during printing; the collector is a module that collects real-time data, and the collector can collect real-time data of the client from the data simulator; the server is the receiver of real-time data, which can analyze and display real-time data.

[0031] The collector on the client can collect the client's real-time data (i.e., the real-time data of the printing device) at a fixed frequency and write the real-time data into the cache queue. When the length of the data stored in the cache queue reaches a certain value, more real-time data can be read and transmitted in batches to the server. If the network connection fails or the data transmission fails, the collector can store the real-time data in a local database (such as the SQLite database, which is a lightweight relational database with the characteristics of low resource usage, simple and easy to use, cross-platform, efficient and reliable). After waiting for normal communication, the collector reads the real-time data from the local database and transmits it in batches to the server.

[0032] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0033] See also Figure 2 The present invention provides a batch data transmission method, the method comprising:

[0034] Step 1: The client establishes a communication connection with the server.

[0035] In some embodiments, the client can send a request message to the server, and the request message includes the IP address and port number of the server. After the server receives the request message, it returns a response message to the client. After the client receives the response message, the client and the server establish a network connection. In other embodiments, the IP address and port number of the server can be directly configured on the client. After the configuration is successful, the client and the server establish a network connection. Exemplarily, the client and the server can use the http protocol to establish a communication connection, or they can use other communication protocols to establish a communication connection, which is not limited in this application.

[0036] After the client and the server establish a network connection, a heartbeat detection can be enabled between the client and the server to determine whether the network connection between the client and the server is normal by sending a detection message at a fixed frequency. For example, it is generally considered that communication is restored to normal when the heartbeat detection is normal.

[0037] Step 2: The client collects real-time data of the printing process through the collector and writes it into the cache queue.

[0038] After the client establishes a communication connection with the server, the client can collect real-time data at a fixed frequency through the collector. Real-time data refers to various types of data generated by the client (i.e., printing device) during the printing process, including but not limited to device data, printing data, and alarm data. Among them, device data refers to the monitoring item data related to the device, printing data refers to the process data and task-related data during the printing process, and alarm data refers to abnormal data when the device monitoring item exceeds the maximum and minimum limits.

[0039] Exemplarily, the fixed frequency of collecting real-time data may be once per second, or other frequencies, which are not limited in the present invention as long as they meet the technical requirements. If the collector does not collect real-time data within 1 second or the collected real-time data does not change, the real-time data collection stops.

[0040] The collector of the client writes the collected real-time data into the cache queue. The cache queue is a data structure for storing data set on the client. In some embodiments, before writing the real-time data into the cache queue, the collector may also pre-process the real-time data, and the pre-processing includes: deleting blank data, deleting duplicate data, etc.

[0041] Step 3: The client transfers the real-time data in the cache queue to the server in batches.

[0042] When the client transfers the real-time data in the cache queue to the server in batches, it must first read the real-time data of the preset data length from the cache queue through the collector.

[0043] The collector cyclically reads real-time data from the cache queue. In some embodiments, the collector can also determine the length of data stored in the cache queue when cyclically reading real-time data. If the length of data stored in the cache queue is equal to or exceeds the preset data length of the cache queue, data with the preset data length is read in batches; if the length of data stored in the cache queue is less than the preset data length of the cache queue, the real-time data is not read temporarily, and the collector waits for the next time to read the real-time data.

[0044] It is understandable that, since the amount of data collected per unit time for the same device is basically the same, the preset frequency of the collector reading data from the cache queue can be set based on the preset data length of the cache queue. The preset data length of the cache queue is limited by the client hardware device. Generally speaking, the preset data length of the cache queue is smaller than the maximum value of the data that the cache queue can store.

[0045] The client transmits the real-time data in batches to the server. In some embodiments, the client transmits the real-time data of a preset data length read from the cache queue to the server in batches through the collector.

[0046] The client calls the cloud platform server interface and sends the read real-time data of preset data length to the server in batches. The client can transmit real-time data in batches via the http protocol.

[0047] Exemplarily, an appropriate encoding method (such as UTF-8) may be used during the sending process to ensure correct transmission of data.

[0048] If the client sends print data to the server, the data sent includes the factory ID, equipment ID, parameter ID, real-time value, parameter type, receiving time, level, and remarks; the response message sent by the server to the client may include a return code, timestamp, and exception information.

[0049] If the client sends alarm data to the server, the data sent includes plant ID, equipment ID, parameter ID, real-time value, parameter type, receiving time, level, and remarks; the response message sent by the server to the client may include return code, timestamp, return information, and equipment information object.

[0050] If the client sends device data to the server, the data sent includes plant ID, device ID, parameter ID, real-time value, parameter type, receiving time, level, and remarks; the response message sent by the server to the client may include return code, timestamp, and return information.

[0051] In some embodiments, when the client transmits the real-time data in the cache queue to the server in batches, the client can determine whether the real-time data is transmitted successfully. If the real-time data transmission is successful, the batch data transmission ends; if the real-time data transmission fails, the client will save the real-time data to be transmitted as breakpoint cache data.

[0052] Usually, after receiving the real-time data from the client, the server will send a response message; in some cases, if the server sends a response message to the client, it is considered that the data batch transmission is successful; if the server does not send a response message to the client, it is considered that the data batch transmission has failed; in other cases, if the server sends a "transmission successful" response message to the client, it is considered that the data batch transmission is successful; if the server sends a "transmission failed" response message to the client, it is considered that the data batch transmission has failed. The client determines whether the real-time data is successfully transmitted based on the response message of the server. If the transmission is successful, the batch data transmission ends; if the transmission fails, the client can save the real-time data to be transmitted as a breakpoint cache data.

[0053] For example, if the transmission fails, the client can store the real-time data to be transmitted in the local database through the collector, and after waiting for the communication to be normal, the client can transmit the real-time data to be transmitted read from the local database to the server in batches through the collector. Specifically, after the communication is restored to normal, the client can query the local database through the collector, and when it is found that there is real-time data to be transmitted, the collector can read the real-time data to be transmitted and transmit it in batches to the server. After the transmission is completed, the local database can delete the batch data to be transmitted that has been transmitted, thereby saving database space.

[0054] The transmission failure includes a communication connection failure or a data transmission failure. For example, it can be considered that the failure of the heartbeat detection three times in a row is a communication connection failure, and the failure of the data transmission response result three times in a row is a data transmission failure.

Claims

1. A bulk data transmission method, Features: The bulk data transmission method comprises the following steps: 1) The client establishes a communication connection with the server; 2) The client collects real-time data of the printing process through the collector and writes it into the cache queue; 3) The client transfers the real-time data in the cache queue to the server in batches.

2. The bulk data transmission method according to claim 1, Features: The client collects real-time data of the printing process through the collector and writes it into the cache queue, including: 2.1) The client collects real-time data during the printing process at a fixed frequency through the collector; 2.2) The client pre-processes the collected real-time data; 2.3) The client writes the pre-processed real-time data into the cache queue.

3. The bulk data transmission method according to claim 2, Features: In the step 2.1), the real-time data is a combination of one or more of device data, print data and alarm data.

4. The bulk data transmission method according to claim 3, Features: The step 2.3) uses an asynchronous thread to write the real-time data into the client cache queue.

5. The bulk data transmission method according to claim 4, Features: The step 3) is specifically: 3.1) The client cyclically reads real-time data from the cache queue through the collector; 3.2) The client calls the server interface and sends the read real-time data in batches to the server.

6. The bulk data transmission method according to claim 5, Features: When the client cyclically reads real-time data from the cache queue through the collector, it also determines the length of data stored in the cache queue. If the length of data stored in the cache queue is equal to or exceeds the preset data length of the cache queue, the data stored in the cache queue is batch read with the preset data length as the reading unit; if the length of data stored in the cache queue is less than the preset data length of the cache queue, the data is not read and waits for the next data reading.

7. The method for transmitting bulk data according to any one of claims 1 to 6, It is characterized in that The method further comprises: When the client transfers the real-time data in the cache queue to the server in batches, it determines whether the real-time data is transmitted successfully. If the real-time data transmission is successful, the batch data transmission ends; if the real-time data transmission fails, the client saves the real-time data to be transmitted as breakpoint cache data.

8. The bulk data transmission method according to claim 7, Features: The client performs breakpoint cache data preservation for the real-time data to be transmitted. Specifically, the client stores the real-time data to be transmitted in a local database through a collector. After waiting for the communication connection to be normal, the collector reads the real-time data to be transmitted stored in the local database and transmits the real-time data to be transmitted to the server in batches.

9. The bulk data transmission method according to claim 8, Features: After waiting for the communication connection to be normal, before the collector reads the real-time data to be transmitted stored in the local database, the collector queries the local database whether the real-time data to be transmitted exists; after the real-time data to be transmitted is transmitted in batches to the server, the local database deletes the real-time data to be transmitted that has been transmitted to the server.

10. The bulk data transmission method according to claim 1, Features: After the client and the server establish a communication connection, a heartbeat detection is started between the client and the server through an asynchronous thread. If the heartbeat detection is normal, the communication connection is normal; if the heartbeat detection is abnormal, the communication connection is abnormal.