Laser power data storage and query method based on MySql database

CN122817221APending Publication Date: 2026-09-25NINGDE SKEQI INTELLIGENT EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610227729.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-26
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

[0005]为了解决现有激光功率数据存储方式数据易丢失、激光功率波形数据难以完整存储、仅能存储单一功率数值,数据存储质量、效率低下的问题,本发明提供一种基于MySql数据库的激光功率数据存储及查询方法,实现激光功率波形数据的完整存储,提高数据查询效率和处理精度,保障数据传输与存储的实时性和稳定性,便于焊接质量的全程追溯,进而提升新能源锂电池生产线的产品良率

Benefits of technology

实现激光功率波形数据的完整存储:通过MySql数据库存储激光功率波形数据,将数组转换为二进制数据存入BLOB字段,解决了现有技术无法存储波形数据的问题,实现焊接过程的全程数据追溯,为质量问题分析提供完整的数据支撑;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122817221A_ABST
    Figure CN122817221A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of laser welding data processing, in particular to a laser power data storage and query method based on a MySql database, which comprises the following steps: a power analog quantity of a laser is collected in real time by an application platform, and a laser power waveform is drawn according to the power analog quantity; a laser power waveform data table is established on a MySql service platform, the laser power waveform is transmitted to the laser power waveform data table by the application platform, and unique waveform information index is generated; the laser power waveform stored is filtered by the MySql service platform, laser power data is calculated, and the laser power data is stored in the laser power waveform data table; and the laser power waveform data table is queried through fields; the application can realize complete storage of laser power waveform data, improve data query efficiency and processing precision, guarantee the real-time performance and stability of data transmission and storage, facilitate whole-process tracing of welding quality, and further improve the product yield of a new energy lithium battery production line.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of laser welding data processing technology, specifically relating to a method for storing and querying laser power data based on a MySQL database. Background Technology

[0002] In the production process of new energy lithium battery module packs, laser welding is one of the key processes. The power parameters of the welding terminals directly affect the welding quality. Therefore, it is necessary to collect and store the laser power data for each welding operation for subsequent querying and quality traceability. In existing technologies, laser power data is mainly collected through PLCs (Programmable Logic Controllers) and uploaded to the workshop information control system.

[0003] However, existing technologies have the following significant drawbacks: 1. It cannot store laser power waveform data and can only collect single power values, which makes it impossible to conduct a comprehensive review and detailed analysis of past processing processes afterward. Once welding quality problems occur, it is difficult to trace the root cause of the problem through historical data. 2. There is a possibility of power data loss. Key power parameters of the welding laser are easily missing, making it impossible to achieve full traceability of the welding quality process, which directly affects the product yield of the new energy lithium battery production line. 3. In multi-task parallel processing scenarios, PLC resource allocation is prone to insufficiency, which leads to a decrease in the sampling accuracy of laser power data and a deterioration in real-time performance. This, in turn, causes the failure to detect abnormalities during the welding process, further affecting the stability of product quality.

[0004] To address the aforementioned technical problems, this invention proposes a laser power data storage and query method based on a MySQL database, enabling stable storage, efficient querying, and accurate processing of laser power data. Summary of the Invention

[0005] To address the problems of data loss, incomplete storage of laser power waveform data, and low data storage quality and efficiency caused by existing laser power data storage methods, this invention provides a laser power data storage and query method based on a MySQL database. This method enables complete storage of laser power waveform data, improves data query efficiency and processing accuracy, ensures the real-time performance and stability of data transmission and storage, facilitates full traceability of welding quality, and ultimately improves the product yield of new energy lithium battery production lines.

[0006] The technical solution of the present invention is as follows: The method for storing and querying laser power data based on a MySQL database includes the following steps: Step 1: Apply for a platform to collect the analog power of the laser in real time, and plot the laser power waveform based on the analog power. Step 2: Create a laser power waveform data table on the MySQL service platform, request the platform to transmit the laser power waveform to the laser power waveform data table, save the initial laser power waveform data table, and generate a unique waveform information index; Step 3: The MySQL service platform filters the stored laser power waveform, uses the difference method to determine the inflection point of the filtered laser power waveform, and confirms the peak based on the inflection point; the data within the peak segment is processed to calculate the filtered laser power data, and stored in the laser power waveform data table. The laser power data will be recalculated after filtering, and its index will be modified according to the filtering type used. Step 4: When querying, users can choose to query the initial laser power waveform data table or the filtered laser power waveform data table. Users can query through the fields in the laser power waveform data table, and the query results will be returned to the application platform.

[0007] Furthermore, the MySQL service platform is composed of a TCP protocol server that listens on port 3002 in the MySQL database.

[0008] Furthermore, the MySQL service platform and the application platform communicate via the TCP protocol.

[0009] Furthermore, the unique waveform information index is generated by the receiving time and the receiving object.

[0010] Furthermore, the MySQL service platform performs filtering processing on the received laser power waveform, specifically by performing median filtering, adaptive filtering, and sliding arithmetic mean filtering on the received laser power waveform to eliminate high-frequency noise and smooth the data.

[0011] Furthermore, the step of using the finite difference method to determine the inflection point of the filtered laser power waveform and confirming the peak based on the inflection point is specifically as follows: the inflection point is found by performing an inflection point search on the filtered data and judging the value obtained by taking the first derivative of the point. The derivative at the current inflection point gradually increases and is greater than If so, the current inflection point is determined to be a low-level inflection point; The derivative at the current inflection point gradually decreases and becomes less than If so, then the current inflection point is determined to be a high-level inflection point; A data segment between two consecutive high-level inflection points is defined as a peak. After identifying the peaks, the arithmetic mean of the peak data is calculated to obtain the average power of the peak. When there are multiple peaks: if the variance of the average power of all peaks is less than 5%, the average power of all peaks is averaged again, and 80% of the second average is recorded as the effective laser power. If the variance of the average power of all peaks is greater than or equal to 5%, it is necessary to judge based on the laser's operating power manually input by the user. The average power data of peaks that differ from the operating power by less than 5% are marked as valid data. All valid data are averaged, and 80% of the average is recorded as the effective laser power. When laser power waveform data is written to the MySQL service platform, it is converted from an array to binary data, then written to the laser power waveform data table and stored in a BLOB type field.

[0012] Furthermore, the fields in the initial laser power waveform data table and the filtered laser power waveform data table include storage date, power waveform information, and laser power data; the laser power data includes maximum laser power, minimum laser power, effective laser power, average laser power, and waveform duration.

[0013] Furthermore, step 1 also includes real-time verification of the laser's connection status. The verification method is as follows: scan the laser's timestamp every 3ms and compare it with the timestamp of the previous acquisition. If the two timestamps are the same, record a connection failure. When the number of connection failures reaches three, it is determined that the laser is disconnected from the acquisition system, data recording is immediately stopped and an alarm signal is issued to remind the staff to handle it in time.

[0014] Furthermore, step 4 specifically involves: querying the MySQL database to find the corresponding laser power waveform data. If the data exists, the query result is returned and sent to the application platform; otherwise, the string "No such laser power waveform" is sent back to the application platform.

[0015] Compared with the prior art, the present invention has the following beneficial effects: Complete storage of laser power waveform data: Laser power waveform data is stored in a MySQL database. The array is converted into binary data and stored in a BLOB field, which solves the problem that existing technologies cannot store waveform data. This enables full data traceability of the welding process and provides complete data support for quality problem analysis. Stable and reliable data transmission and storage: The MySQL service platform is composed of a TCP server listening on port 3002, and the TCP protocol is used for data transmission, ensuring the reliability of data transmission; at the same time, a laser connection verification mechanism is added to avoid data loss due to device disconnection, further improving the stability of data storage. High data processing accuracy: It adopts a combination of median filtering, adaptive filtering, and sliding arithmetic mean filtering algorithms to effectively eliminate high-frequency noise and filter abnormal data, making waveform data smoother; by identifying inflection points and peaks through first-order differentiation, it accurately calculates the maximum, minimum, average, and effective laser power, thereby improving the accuracy of data processing; Efficient and convenient query: A unique waveform information index is generated based on the receiving time and the receiving object. Combined with the efficient query capabilities of the MySQL database, the target data can be quickly located, solving the problem of low query efficiency in traditional storage methods. Improve production yield: Through full traceability of waveform data and precise power parameter analysis, abnormalities in the welding process can be detected in a timely manner, enabling real-time shutdown for re-inspection, avoiding the generation of large-scale defective products, and effectively improving the production yield of new energy lithium battery modules. Attached Figure Description

[0016] Figure 1 This is a schematic diagram of the overall process of the present invention; Figure 2 This is the original waveform image in an embodiment of the present invention; Figure 3 This is the image after median filtering in an embodiment of the present invention; Figure 4 The image shown is the adaptively filtered image in this embodiment of the invention; Figure 5 This is the image after filtering with the moving arithmetic mean in an embodiment of the present invention; Figure 6 The images shown are the result of sequential processing using the three filtering methods in this embodiment of the invention. Detailed Implementation

[0017] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.

[0018] See Figure 1 This embodiment uses a central control unit as the application platform to describe the complete workflow. A method for storing and querying laser power data based on a MySQL database includes the following steps: Step 1: Laser power data acquisition and waveform plotting The analog power of the laser is acquired in real time, and the laser power waveform is plotted based on the acquired analog power. See the laser power waveform diagram acquired in this embodiment. Figure 2 Simultaneously, the connection status of the laser is verified in real time. The verification method is as follows: scan the timestamp of the laser every 3ms and compare it with the timestamp of the previous acquisition. If the two timestamps are the same, record a connection failure. When the number of connection failures reaches three, it is determined that the laser is disconnected from the acquisition system, data recording is stopped immediately and an alarm signal is issued to remind the staff to deal with it in time.

[0019] Step 2: MySQL Database Configuration and Data Storage 2.1. Constructing a MySQL service platform: Add a TCP (Transmission Control Protocol) server listening on port 3002 to the MySQL database to form a MySQL service platform; pre-configure the IP address and port number of the specified MySQL service platform on the software of each central control machine, and the central control machine actively initiates a TCP connection to establish a stable communication link between the central control machine and the MySQL service platform.

[0020] 2.2 Create a data table: Create an initial laser power waveform data table in the MySQL service platform. The fields of the data table include storage date, power waveform information, and laser power data. Among them, the laser power data includes maximum laser power, minimum laser power, effective laser power, average laser power, and waveform duration.

[0021] The maximum laser power is the maximum value of the laser power data. If the user queries the raw laser power data, the maximum laser power value may be an anomaly. The minimum laser power is the minimum value among all data that are greater than the effective laser power. The effective laser power is the threshold used to trigger the sensor and PLC (programmable logic controller), which is 80% of the average power by default and can be adjusted by the user. The average laser power is the average power of all effective peak data. The waveform duration is the time it takes for the platform to collect the analog power of the laser.

[0022] 2.3 Data Transmission and Storage: The central control unit transmits the acquired laser power waveform data to the MySQL service platform via the TCP protocol. After receiving the data, the platform uniquely indexes the waveform information based on the data reception time, receiving object, waveform type (raw waveform, median filter, adaptive filter, moving arithmetic mean filter), with the format "T (central control unit sequence) - (data reception time (year / month / day_hour:minute:second)) - (filter type)". For example, when the platform receives data from central control unit No. 31 at 13:00 on February 5, 2026... When inputting waveform data, a string "T31-2026 / 2 / 3_13:00:00-original waveform" is generated as a unique index. The central control unit sequence is automatically assigned by the platform after access. When the platform performs median filtering on the waveform, its index is "T31-2026 / 2 / 3_13:00:00-median filtering". At the same time, the laser power waveform data is converted from array format to binary data and written into the above laser power waveform data table, stored in a BLOB type field, to complete the stable storage of the data.

[0023] Step 3: Laser power data processing The MySQL service platform performs filtering and feature extraction on the received laser power waveform data. The specific process is as follows: 3.1 Filtering: See Figure 3-5 The waveform data was processed sequentially using three algorithms: median filtering, adaptive filtering, and moving arithmetic mean filtering, to eliminate high-frequency noise and smooth the data. The final filtered image is shown below. Figure 6 As shown.

[0024] Median filtering: Sort N samples of data, extract the median value or remove the maximum and minimum values, calculate the average of the remaining data as the output, and filter out outlier data; Adaptive filtering: This method dynamically adjusts filter parameters based on the characteristics of the input signal. By iteratively adjusting the filter coefficients, it minimizes the mean square error between the output signal and the desired signal. Its algorithm principle satisfies the following: y(n)=W T (n)x(n) e(n) = d(n) - y(n) W(n+1) = W(n) + 2μe(n)x(n) Where x(n) is the input signal, d(n) is the reference signal, e(n) is the error signal, y(n) is the output signal, and W(n) is the filter coefficient at time n. T (n) is the matrix transpose of W(n), and μ is the step size factor; Sliding arithmetic mean filtering: Based on a fixed window sliding across a signal sequence, the average of all data points within the window is calculated as the output point after each movement. The core calculation formula is: y[n]=(1 / M)×Σx[k] Where M is the window size, and Σx[k] represents the sum of data within the window as k traverses from n-M+1 to n.

[0025] 3.2 Inflection Point and Peak Identification: Inflection points are identified in the filtered, smoothed data. An approximate slope is obtained by taking the first derivative of the data points, and the inflection point is determined based on the slope change. When the derivative of the data points gradually increases and is greater than When the value is approximately 0.577, this point is determined to be a low-level inflection point; When the derivative of the data points gradually decreases and is less than When this point is reached, it is determined to be a high-level inflection point; The data segment between two consecutive high-level inflection points is defined as a peak.

[0026] 3.3 Power parameter calculation: Calculate the arithmetic mean of the data within each peak segment to obtain the average power of that peak; Then, based on preset conditions, the average power of all peaks is screened and calculated to obtain the effective laser power; Meanwhile, the maximum and minimum laser power are extracted based on the peak segment data, and the average laser power is calculated by combining the duration of the entire waveform. When there are multiple peaks: if the average power variance of all peaks is less than 5%, then the average power of all peaks is averaged again, and 80% of the second average is recorded as the effective laser power; if the average power variance of all peaks is greater than or equal to 5%, it is necessary to judge based on the laser's operating power manually input by the user, mark the average power data of peaks that differ from the operating power by less than 5% as valid data, average all valid data, and record 80% of the average value as the effective laser power. The laser power data obtained from the above calculations are stored in the filtered laser power waveform data table and associated with the corresponding waveform data.

[0027] The initial laser power waveform data table and the filtered laser power waveform data table contain the same fields, but the initial laser power waveform data table stores the unfiltered laser power data, while the filtered laser power waveform data table stores the filtered laser power data.

[0028] Step 4: Laser power data query When the central control unit initiates a query request, it sends the query instruction and query conditions (such as storage date, unique waveform information index, etc.) to the MySQL service platform via the TCP protocol. The MySQL service platform iterates through the initial laser power waveform data table or the filtered laser power waveform data table according to the query conditions to find the corresponding laser power waveform data and associated power parameters: If matching data is found, the waveform data (after being converted from binary to array) and various power parameters are returned to the application platform via the TCP protocol; If no matching data is found, the application platform will be returned a message indicating "No such laser power waveform" via TCP protocol.

[0029] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for storing and querying laser power data based on a MySQL database, characterized in that, Includes the following steps: Step 1: Apply for a platform to collect the analog power of the laser in real time, and plot the laser power waveform based on the analog power. Step 2: Create a laser power waveform data table on the MySQL service platform, request the platform to transmit the laser power waveform to the laser power waveform data table, save the initial laser power waveform data table, and generate a unique waveform information index; Step 3: The MySQL service platform filters the stored laser power waveform, uses the difference method to determine the inflection point of the filtered laser power waveform, and confirms the peak based on the inflection point; the data within the peak segment is processed to calculate the filtered laser power data, and stored in the laser power waveform data table. The laser power data will be recalculated after filtering, and its index will be modified according to the filtering type used. Step 4: When querying, users can choose to query the initial laser power waveform data table or the filtered laser power waveform data table. Users can query through the fields in the laser power waveform data table, and the query results will be returned to the application platform.

2. The laser power data storage and query method based on a MySQL database according to claim 1, characterized in that, The MySQL service platform consists of a TCP protocol server that listens on port 3002 within the MySQL database.

3. The laser power data storage and query method based on a MySQL database according to claim 1, characterized in that, The MySQL service platform and the application platform communicate via the TCP protocol.

4. The laser power data storage and query method based on a MySQL database according to claim 1, characterized in that, The unique waveform information index is generated by the receiving time and the receiving object.

5. The laser power data storage and query method based on a MySQL database according to claim 1, characterized in that, The MySQL service platform performs filtering on the received laser power waveform, specifically by performing median filtering, adaptive filtering, and sliding arithmetic mean filtering on the received laser power waveform to eliminate high-frequency noise and smooth the data.

6. The laser power data storage and query method based on a MySQL database according to claim 1, characterized in that, The step of determining the inflection point of the filtered laser power waveform using the difference method and confirming the peak based on the inflection point is as follows: the inflection point is found by performing an inflection point search on the filtered data and judging the value obtained by taking the first derivative of the point. The derivative at the current inflection point gradually increases and is greater than If so, the current inflection point is determined to be a low-level inflection point; The derivative at the current inflection point gradually decreases and becomes less than If so, then the current inflection point is determined to be a high-level inflection point; A data segment between two consecutive high-level inflection points is defined as a peak. After identifying the peak, the arithmetic mean of the peak segment data is calculated to obtain the average power of the peak. When there are multiple peaks: if the average power variance of all peaks is less than 5%, then the average power of all peaks is averaged again, and 80% of the second average is recorded as the effective laser power; if the average power variance of all peaks is greater than or equal to 5%, it is necessary to judge based on the laser's operating power manually input by the user, mark the average power data of peaks that differ from the operating power by less than 5% as valid data, average all valid data, and record 80% of the average value as the effective laser power. When laser power waveform data is written to the MySQL service platform, it is converted from an array to binary data, then written to the laser power waveform data table and stored in a BLOB type field.

7. The laser power data storage and query method based on a MySQL database according to claim 1, characterized in that, The fields in the initial laser power waveform data table and the filtered laser power waveform data table include storage date, power waveform information, and laser power data; the laser power data includes maximum laser power, minimum laser power, effective laser power, average laser power, and waveform duration.

8. The laser power data storage and query method based on a MySQL database according to claim 1, characterized in that, Step 1 also includes real-time verification of the laser's connection status. The verification method is as follows: scan the laser's timestamp every 3ms and compare it with the timestamp of the previous acquisition. If the two timestamps are the same, record a connection failure. When the number of connection failures reaches three, it is determined that the laser is disconnected from the acquisition system, data recording is stopped immediately and an alarm signal is issued to remind the staff to handle it in time.

9. The laser power data storage and query method based on a MySQL database according to claim 1, characterized in that, Step 4 specifically involves: querying the MySQL database to find the corresponding laser power waveform data. If the data exists, the query result is returned and sent to the application platform; otherwise, the string "No such laser power waveform" is sent back to the application platform.