Data storage method, device and system, electronic equipment and storage medium

By monitoring and processing diamond wire image data in the diamond wire production line, and using database sessions and ORM objects to achieve real-time uploading, the problem of data loss caused by the easy damage of electronic equipment is solved, and the data transmission efficiency and system reliability are improved.

CN121765103APending Publication Date: 2026-03-31高测(盐城)技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Electronic equipment in diamond wire production lines is prone to damage, which can lead to the loss of diamond wire image data and affect subsequent processing.

Method used

By monitoring the generation of diamond wire images on electronic devices in the diamond wire production line, processing the diamond wire image data, inserting the data into the target ORM object using a database session, and mapping the database table locally through the database engine, the automated real-time uploading of diamond wire image data is achieved.

Benefits of technology

This reduces the risk of diamond wire image data loss, improves the timeliness and reliability of data upload, enhances code readability and maintainability, and reduces the impact on subsequent processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121765103A_ABST
    Figure CN121765103A_ABST
Patent Text Reader

Abstract

The invention provides a data storage method, device and system, electronic equipment and a storage medium, the method is applied to the electronic equipment in a diamond wire production line, and the method comprises the following steps: monitoring whether a diamond wire image is generated or not; under the condition that it is monitored that the diamond wire image is generated, the diamond wire image is processed, and diamond wire image data of the diamond wire image are obtained; creating a database session; inserting the diamond wire image data into a target ORM object, and submitting the target ORM object to a database through the database session; wherein the database is arranged outside the electronic equipment, and the target ORM object is an ORM object into which the diamond wire image data needs to be inserted in all ORM objects mapped to the electronic equipment in the database. According to the invention, the loss risk of diamond wire image data can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data storage technology, and more specifically, to a data storage method, apparatus, system, electronic device, and storage medium. Background Technology

[0002] In diamond wire production lines, electronic devices (such as computers) are typically used to display real-time images of the diamond wire. However, the raw material used in the electroplating process of diamond wire in these lines is mainly diamond micron powder particles. These particles are extremely small in diameter and can easily penetrate into various electronic components (such as hard drives, memory, CPUs, etc.) within the production line's electronic equipment, causing damage to these internal components. Therefore, the electronic equipment on the production line usually needs to be repaired, replaced, or scrapped after a period of use.

[0003] If an electronic device malfunctions during the production cycle of a diamond wire, the diamond wire image data stored locally within the device will be lost, which will affect subsequent processing work based on the diamond wire image data. Summary of the Invention

[0004] The purpose of this application is to provide a data storage method, apparatus, system, electronic device, and storage medium to alleviate the problem in related technologies where the loss of diamond wire image data is easily caused by the easy damage of electronic devices on the production line, thereby affecting subsequent processing work based on the diamond wire image data.

[0005] This application provides a data storage method, including: an electronic device applied in a diamond wire production line, the method comprising: monitoring whether a diamond wire image has been generated; if the diamond wire image is detected as generated, processing the diamond wire image to obtain diamond wire image data; creating a database session; inserting the diamond wire image data into a target ORM (Object Relational Mapping) object, and submitting the target ORM object to the database through the database session; wherein: the database is located outside the electronic device, and the target ORM object is: among all ORM objects mapped from the database to the electronic device, the ORM object into which the diamond wire image data needs to be inserted.

[0006] In the above implementation process, electronic devices located on the diamond wire production line process the generated diamond wire image to obtain diamond wire image data. Then, by mapping ORM objects from various tables in the database locally, the diamond wire image data is inserted into the target ORM object, and the target ORM object is submitted to the database through a database session. This achieves automated real-time uploading of diamond wire image data to the database for storage after image generation. Therefore, the risk of diamond wire image data loss is reduced if electronic devices on the diamond wire production line are damaged due to diamond powder particles, thus minimizing the impact of lost diamond wire image data on subsequent processing. Furthermore, by using local mapping of ORM objects to save data to the database, this solution is more object-oriented, resulting in higher code readability and maintainability.

[0007] Furthermore, before monitoring whether a diamond wire image has been generated, the method further includes: creating a database engine; and using the database engine to locally map the ORM objects of each table in the database.

[0008] In the above implementation, by mapping the ORM objects of each table in the database locally using the database engine before monitoring whether a diamond wire image has been generated, the diamond wire image data can be uploaded to the database immediately through the ORM object when the generation of the diamond wire image is detected, reducing the risk of data loss due to untimely uploading of the diamond wire image data.

[0009] Furthermore, the method is implemented by software running on the electronic device; before creating the database engine, the method further includes: generating and displaying a software icon on the electronic device; the software icon is used to reflect the current running state of the software.

[0010] In the above implementation, by generating and displaying a software icon on the electronic device to reflect the current running status of the software, users can understand the running status of the software in a timely manner through the status of the software icon. This allows for timely intervention and repair when problems occur in the software operation, thereby improving the reliability of real-time uploading of diamond wire image data.

[0011] Furthermore, the software includes a first thread and a second thread; the first thread is used to generate and display a software icon on the electronic device; the second thread is used to: create a database engine, use the database engine to map out the ORM objects of each table in the database respectively; monitor whether a diamond wire image has been generated, and if the diamond wire image is detected to have been generated, process the diamond wire image to obtain the diamond wire image data; and create a database session, insert the diamond wire image data into the target ORM object in the database, and submit the target ORM object to the database through the database session.

[0012] In the above implementation, a first thread generates and displays the software icon, while a second thread creates a database engine. This database engine maps ORM objects to various tables in the database to monitor whether a diamond wire image has been generated. If the diamond wire image is detected, it is processed to obtain diamond wire image data. A database session is created, and the diamond wire image data is inserted into the target ORM object in the database. Finally, the target ORM object is submitted to the database through the database session. In this way, the generation and display of the software icon, which directly affects user experience, is handled by the first thread. Operations related to uploading diamond wire image data, which do not require direct user intervention, are handled entirely by the second thread. This approach ensures smoother operation and a better user experience because the operations related to uploading diamond wire image data are performed by a separate thread, preventing interference with the first thread and ensuring a more timely upload of the diamond wire image data.

[0013] Further, inserting the diamond wire image data into the target ORM object in the database includes: obtaining the target key corresponding to the diamond wire image data; obtaining the target ORM object with the target key from all ORM objects mapped to the electronic device; and inserting the diamond wire image data into the target ORM object.

[0014] It is understandable that file declarations are often used when mapping ORM objects to tables in a database. However, in the application scenario of this application, as diamond wire is continuously produced on the production line, the number of tables required in the database will be very large, and the number of tables required for each production run is not fixed. Mapping using file declarations is prone to errors, leading to the loss of diamond wire image data during upload. Therefore, in the above implementation, each mapped ORM object is labeled using a key. When saving diamond wire image data, the target ORM object is quickly obtained by searching for the ORM object with the target key corresponding to the diamond wire image data. This ensures that the diamond wire image data can be correctly uploaded and saved to the database without file declarations, which is well adapted to the application scenario of this application and reduces the risk of diamond wire image data loss.

[0015] Further, the diamond wire image is processed to obtain diamond wire image data, including: extracting diamond abrasive image data and main wire image data from the diamond wire image; and obtaining the diamond wire image data based on the diamond abrasive image data and the main wire image data.

[0016] In the above implementation, by extracting the diamond abrasive image data and the main wire image data from the diamond wire image as the diamond wire image data, since the diamond wire image occupies a large amount of space as a background, extracting the diamond abrasive image data and the main wire image data to obtain the diamond wire image data for uploading and saving can significantly reduce the size of the diamond wire image data that needs to be uploaded. This reduces the data storage pressure on the database on the one hand, and on the other hand, since the data to be uploaded and saved for each diamond wire image is smaller, it can also improve the data upload efficiency, allowing the diamond wire image data to be uploaded to the database faster and more timely, reducing the risk of data transmission congestion, and further reducing the risk of diamond wire image data loss during the upload process.

[0017] This application embodiment also provides a data storage device applied to an electronic device in a diamond wire production line. The data storage device includes: a monitoring module for monitoring whether a diamond wire image has been generated; an image processing module for processing the diamond wire image to obtain diamond wire image data when the generation of the diamond wire image is detected; a creation module for creating a database session; and a data upload module for inserting the diamond wire image data into a target ORM object and submitting the target ORM object to the database through the database session. The database is located outside the electronic device, and the target ORM object is the ORM object into which the diamond wire image data needs to be inserted among all ORM objects mapped from the database to the electronic device.

[0018] This application also provides an electronic device, including a communication module, a processor, and a memory; the electronic device is communicatively connected to a database located outside the electronic device through the communication module; the processor is used to execute one or more programs stored in the memory to implement any of the above-described data storage methods.

[0019] This application also provides a data storage system, including: a first electronic device and a second electronic device; the first electronic device is disposed outside the diamond wire production line and has a database therein; the second electronic device is disposed in the diamond wire production line and is communicatively connected to the database in the first electronic device; the second electronic device is used to execute any of the above-described data storage methods.

[0020] Furthermore, the first electronic device is also used to notify the diamond wire production line of an anomaly when the database data stops updating.

[0021] In the above implementation, when the production line is in operation, theoretically the second electronic device should continuously upload diamond wire image data to the database in the first electronic device for storage. Once the database data stops updating, it means that there is a high probability that an abnormality has occurred in the diamond wire production line. At this time, the first electronic device will actively send an abnormality notification, which can enable the staff to promptly check the abnormality of the diamond wire production line, thereby eliminating the abnormality in time and improving the safety of the diamond wire production line.

[0022] This application also provides a computer-readable storage medium that stores one or more programs, which can be executed by one or more processors to implement any of the above-described data storage methods. Attached Figure Description

[0023] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 A flowchart illustrating a data storage method provided in an embodiment of this application;

[0025] Figure 2 A flowchart illustrating a specific implementation process provided in this application embodiment;

[0026] Figure 3 A schematic diagram of a diamond wire image provided in an embodiment of this application;

[0027] Figure 4 This is a schematic diagram of the structure of a data storage device provided in an embodiment of this application;

[0028] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0029] Figure 6 This is a schematic diagram of the structure of a data storage system provided in an embodiment of this application. Detailed Implementation

[0030] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0031] Diamond wire production lines typically use electronic devices (such as standalone Windows computers) to display diamond wire images in real time. A typical diamond wire workshop has 40-60 production lines, each further divided into 12 or 16 sub-lines. The raw material used in the electroplating process is primarily diamond micron powder particles, which are extremely small in diameter and easily penetrate various electronic components. This means that the electronic equipment on the production line usually requires repair, replacement, or disposal after a period of use. Furthermore, if the electronic equipment used to store the diamond wire images fails during the production cycle of a diamond wire production line, the diamond wire image data will be lost when the host computer is replaced. This loss of diamond wire image data will affect subsequent processing work based on the diamond wire image data.

[0032] To alleviate the problem of diamond wire image data loss due to the susceptibility of electronic equipment on the production line, which affects subsequent processing based on the diamond wire image data, this application provides a data storage method for electronic equipment in a diamond wire production line. See also... Figure 1As shown, Figure 1 This is a flowchart illustrating the data storage method provided in the embodiments of this application, including:

[0033] S101: Monitor whether a diamond wire image has been generated.

[0034] In this embodiment, "generating a diamond wire image" means that a diamond wire image is input into an electronic device. The diamond wire image can be captured by a camera installed on the production line or by a camera built into the electronic device; there is no limitation on this.

[0035] In this embodiment, the electronic device can specify a storage path for captured diamond wire images. By monitoring whether new diamond wire images are added to this storage path, the device can monitor whether a diamond wire image has been generated. For example, diamond wire images can be stored in a fixed folder within the electronic device. When a new diamond wire image is detected in this folder, it is determined that a new diamond wire image has been generated.

[0036] S102: If a diamond wire image is detected, process the diamond wire image to obtain diamond wire image data.

[0037] In this embodiment of the application, when a diamond wire image is detected to have been generated, processing such as reading the diamond wire image can be performed.

[0038] In one feasible embodiment of this application, the read diamond wire image can be used as diamond wire image data.

[0039] However, uploading the entire diamond wire image as diamond wire image data to the database for storage would require significant network bandwidth due to the large size of the image. Insufficient bandwidth could lead to delayed uploads or even upload failures and data loss. Furthermore, the large size of the diamond wire image data would drastically increase the database's storage requirements.

[0040] Therefore, in another feasible embodiment of this application, diamond wire image data and busbar image data can be extracted from the diamond wire image, and then diamond wire image data can be obtained based on the diamond wire image data and busbar image data.

[0041] In this way, since the diamond wire image occupies a large amount of space as a background, extracting the diamond abrasive image data and the main wire image data to obtain the diamond wire image data for uploading and saving can significantly reduce the size of the diamond wire image data that needs to be uploaded. This reduces the data storage pressure on the database on the one hand, and improves the data upload efficiency by reducing the amount of data to be uploaded and saved for each diamond wire image. This allows the diamond wire image data to be uploaded to the database faster and more timely, reducing the risk of data transmission congestion and further reducing the risk of diamond wire image data loss during the upload process.

[0042] In the above feasible embodiments, the diamond abrasive image data extracted from the diamond wire image may include the position information of the diamond abrasive in the diamond wire image, and the busbar image data extracted from the diamond wire image may include the position information of the busbar in the diamond wire image.

[0043] In the above feasible implementation, the diamond abrasive image data and the busbar image data can be quantized and packaged into a single string as diamond wire image data.

[0044] S103: Create a database session.

[0045] In the embodiments of this application, the database session can be created using, but is not limited to, the sessionmaker (a module for creating sessions between a program and a database) of slqlalchemy (an open-source software that provides ORM tools).

[0046] In this embodiment, the database is located outside the electronic device performing the method provided in this embodiment. For example, the database is located outside the diamond wire production line to prevent damage due to the penetration of diamond microparticles.

[0047] S104: Insert the diamond wire image data into the target ORM object.

[0048] It is understood that there is no timing constraint between steps S104 and S105.

[0049] S105: Submit the target ORM object to the database via a database session.

[0050] In this embodiment of the application, before the electronic device performs step S101 to monitor whether a diamond wire image has been generated, it can first create a database engine, and then use the database engine to map the ORM objects of each table in the database locally.

[0051] For example, a database engine can be created using SQLAlchemy. It's understood that no database connection is created directly at this point; later, the database engine's automap function can be used to automatically map the ORM objects for all tables in the database locally.

[0052] In this embodiment, each table in the database is mapped locally to a corresponding ORM object. This ORM object includes the fields of the corresponding table. When inserting diamond wire image data into the target ORM object, the diamond wire image data can be inserted into each field of the target ORM object according to the data storage requirements of the database.

[0053] For example, assuming the table includes fields A and B, and field A stores diamond abrasive image data while field B stores busbar image data, the mapped ORM object will also include the corresponding structure variables for fields A and B. For any diamond wire image, when uploading the extracted diamond abrasive image data and busbar image data to the database, the diamond abrasive image data is inserted into field A of the target ORM object, and the busbar image data is inserted into field B of the target ORM object.

[0054] In this embodiment, the target ORM object is the ORM object into which the diamond wire image data needs to be inserted, among all ORM objects mapped from the database to the electronic device. It can be understood that in this embodiment, a table storing the diamond wire images produced by the diamond wire production line in this current production run can be pre-defined, thereby automatically determining the target ORM object from all ORM objects. Furthermore, the correspondence between tables and diamond wire images can be pre-defined, for example, pre-defining table A for the first m diamond wire images and table B for the next m diamond wire images, etc., thereby automatically determining the target ORM object from all ORM objects.

[0055] In this embodiment, the correspondence between tables and diamond wire images can be based on a key. The key refers to information that identifies the table or the corresponding ORM object. For example, the key can be the table name; when a table is mapped to an ORM object, the table name can be used as the key of the mapped ORM object.

[0056] In this embodiment, when inserting diamond wire image data into the target ORM object in the database, the target key corresponding to the diamond wire image data can be obtained first. Then, from all ORM objects mapped to the electronic device, the target ORM object with the target key can be obtained, and the diamond wire image data can be inserted into the target ORM object. Compared to the commonly used file declaration method when mapping ORM objects to tables in the database, the above-described key-based upload of diamond wire image data ensures that the diamond wire image data can be correctly uploaded and stored in the database without requiring file declaration. This method is well-suited to the application scenario of this application and reduces the risk of diamond wire image data loss.

[0057] In this embodiment of the application, after the target ORM object is submitted to the database through a database session, the database can extract the inserted data from the target ORM object and write the diamond wire image data into the corresponding fields of the table according to the correspondence between the structure variables in the target ORM object and the fields in the table, thereby realizing data storage.

[0058] In this embodiment of the application, after submitting the target ORM object to the database through the database session, the database session created in step S103 can also be closed.

[0059] In this embodiment, the electronic device can also automatically capture anomalies and attempt to resolve them by rolling back when an anomaly is detected. Anomaly capture may include detecting at least one of the following: whether the diamond wire image was successfully inserted, whether the database session was successfully established, whether the target ORM object after the diamond wire image was inserted was successfully uploaded, etc.

[0060] In the embodiments of this application, the above data storage method can be implemented by deploying software in an electronic device.

[0061] In this embodiment, the software can generate and display a software icon on the electronic device before creating the database engine, and the software icon can reflect the current running status of the software. For example, when the software is running normally, the software icon can be displayed in color, while when the software is malfunctioning, the software icon can be displayed in gray. In this way, by generating and displaying a software icon on the electronic device to reflect the current running status of the software, users can promptly understand the software's running status through the status of the software icon, thereby allowing for timely intervention and repair when problems occur, thus improving the reliability of real-time uploading of diamond wire image data.

[0062] In this embodiment, the software may include a first thread and a second thread. The first thread can be used to generate and display a software icon on an electronic device. The second thread can be used to create a database engine, using the database engine to map ORM objects to various tables in the database; monitor whether a diamond wire image has been generated, and if so, process the diamond wire image to obtain diamond wire image data; and create a database session, insert the diamond wire image data into the target ORM object in the database, and submit the target ORM object to the database through the database session.

[0063] In this embodiment, all operations directly related to user interaction within the software can be executed by the first thread, such as generating and displaying the software icon, displaying the user interface, and executing and responding to user actions. All operations related to uploading diamond wire image data, such as those described above, are handled by the second thread. This approach ensures smoother operation and a better user experience because the operations related to uploading diamond wire image data are executed by a separate thread. Furthermore, the operations of the first thread do not interfere with the second thread's work, allowing for more timely uploading of the diamond wire image data.

[0064] In this embodiment of the application, the first thread can be held by the software interface and the second thread can be held by the watchdog, created by QThread (a class for creating and managing threads).

[0065] Based on the data storage method provided in this application embodiment, electronic devices located in a diamond wire production line process the generated diamond wire image to obtain diamond wire image data. Then, by mapping ORM objects from various tables in the database locally, the diamond wire image data is inserted into the target ORM object, and the target ORM object is submitted to the database through a database session. This achieves automatic real-time uploading of diamond wire image data to the database for storage after the diamond wire image is generated. Therefore, the risk of diamond wire image data loss is reduced when electronic devices in the diamond wire production line are damaged due to diamond powder particles, thus minimizing the impact of diamond wire image data loss on subsequent processing. Furthermore, by saving data to the database through local mapping of ORM objects, this solution is more object-oriented, improving the readability and maintainability of the code. In addition, based on the data storage method provided in this application embodiment, the diamond wire image data can include diamond abrasive image data and busbar image data, but not background data. This significantly reduces the amount of data that needs to be uploaded to the server, improves data transmission efficiency, meets the real-time storage requirements of diamond wire image data, and reduces the storage pressure on the database.

[0066] To facilitate understanding of the solutions in the embodiments of this application, a specific implementation process is used as an example below to further illustrate this application.

[0067] See Figure 2 As shown, the entire process includes:

[0068] 1. Launch the software. At this point, the software will generate a tray icon in the lower right corner of the electronic device's screen.

[0069] At this point, the software will also write startup information to the software log so that it can trace the source of any subsequent anomalies.

[0070] 2. Create a database engine.

[0071] After the software starts, you can use sqlalchemy to create a database engine, but a database connection is not created directly at this time.

[0072] 3. Automatically map ORM objects for all tables in the database based on SQLAlchemy.

[0073] The database engine uses `automap` to automatically map ORM objects for all tables in the database. In the application scenario of this application, as the production of diamond wire continues, the number of tables required in the database will be very large, and the number of tables required for each production run is also variable. Mapping using file declarations is prone to errors. Therefore, file declarations are not used during mapping. Instead, the target ORM object corresponding to each diamond wire image data to be uploaded is found using the key of the ORM object after mapping. The key uses the table name mapped by the ORM object.

[0074] 4. Enable multi-threaded monitoring to achieve real-time monitoring of the generation of diamond wire images.

[0075] The multi-threading includes a first thread and a second thread. The first thread can be held by the software interface, and the second thread can be held by the watchdog, both created by QThread. The first thread is responsible for all operations directly related to user interaction, such as generating and displaying the software icon; the second thread is responsible for all operations related to uploading diamond wire image data, including monitoring whether the diamond wire image has been generated.

[0076] 5. Process the diamond wire image to obtain diamond wire image data.

[0077] In this embodiment of the application, the software can be configured with an image processing module, which can be executed by a second thread to handle the processing of the diamond wire image.

[0078] After detecting the generation of the diamond wire image, the image processing module obtains the newly generated diamond wire image based on the location storage path of the diamond wire image, and then extracts the diamond abrasive image data and the busbar image data from the diamond wire image.

[0079] 6. Create a database session and upload the diamond wire image data.

[0080] The database session is created by SLQLAlchemy's SessionMaker. After creating the database session, the target ORM object with the key corresponding to the diamond wire image can be found, the diamond wire image data can be inserted into the target ORM object, and then submitted to the database through the database session. The database session is then closed.

[0081] 7. Continuously monitor the generation of diamond wire images in real time.

[0082] For example, suppose the diamond wire production line takes a picture like this Figure 3The software monitors the generation of the diamond wire image shown. Based on the image's storage path, it reads the diamond wire image, extracts the diamond abrasive image data (including abrasive location information) and the busbar image data (including busbar location information), and quantizes them into a string. This string is then inserted into the target ORM object and bound via a database session. The database session stores the target ORM object in a MySQL database, completing the real-time storage task.

[0083] The above solution can reduce the risk of losing diamond wire image data. Furthermore, since the diamond wire image data is uploaded to the database for storage in real time, the quality of the entire roll of diamond wire can be evaluated based on the diamond wire image data before the diamond wire production line comes off the production line.

[0084] Based on the same inventive concept, this application also provides a data storage device 400 for use in electronic devices in diamond wire production lines. Please refer to... Figure 4 As shown, Figure 4 It shows the use of Figure 1 The method illustrated uses a data storage device. It should be understood that the specific functions of device 400 are described above; to avoid repetition, detailed descriptions are appropriately omitted here. Device 400 includes at least one software function module that can be stored in memory or embedded in the operating system of device 400 in the form of software or firmware. Specifically:

[0085] See Figure 4 As shown, the device 400 is applied to electronic equipment in a diamond wire production line, including: a monitoring module 401, an image processing module 402, a creation module 403, and a data upload module 404. Wherein:

[0086] Monitoring module 401 is used to monitor whether a diamond wire image has been generated;

[0087] Image processing module 402 is used to process the diamond wire image when the diamond wire image is detected to obtain diamond wire image data.

[0088] Create module 403 to create a database session;

[0089] The data upload module 404 is used to insert the diamond wire image data into the target ORM object and submit the target ORM object to the database through the database session;

[0090] Wherein: the database is set outside the electronic device, and the target ORM object is: among all the ORM objects mapped from the database to the electronic device, the ORM object into which the diamond wire image data needs to be inserted.

[0091] In one feasible embodiment of this application, the creation module 403 is further configured to create a database engine before the monitoring module 401 monitors whether a diamond wire image has been generated;

[0092] The device 400 also includes a mapping module for mapping the ORM objects of each table in the database locally using the database engine.

[0093] In this feasible embodiment, each module within the device 400 is implemented by software running on the electronic device; the device 400 also includes an icon generation module, used to generate and display software icons on the electronic device before the creation module 403 creates the database engine; the software icons are used to reflect the current running status of the software.

[0094] In this feasible embodiment, the software includes a first thread and a second thread;

[0095] The first thread is used to generate and display software icons on the electronic device;

[0096] The second thread is used to: create a database engine, and use the database engine to map out the ORM objects of each table in the database; monitor whether a diamond wire image has been generated, and if the diamond wire image is generated, process the diamond wire image to obtain the diamond wire image data; and create a database session, insert the diamond wire image data into the target ORM object in the database, and submit the target ORM object to the database through the database session.

[0097] In one feasible embodiment of this application, the data upload module 404 is specifically used to: obtain the target key corresponding to the diamond wire image data; obtain the target ORM object with the target key from all ORM objects mapped to the electronic device; and insert the diamond wire image data into the target ORM object.

[0098] In one feasible embodiment of this application, the image processing module 402 is specifically used to: extract diamond abrasive image data and busbar image data from the diamond wire image; and obtain the diamond wire image data based on the diamond abrasive image data and the busbar image data.

[0099] It should be understood that, for the sake of brevity, some of the content described in the method embodiments will not be repeated in this device embodiment section.

[0100] Based on the same inventive concept, this application provides an electronic device, see [link to relevant documentation]. Figure 5 As shown, it includes a processor 501, a memory 502, and a communication module 503. Wherein:

[0101] The electronic device communicates with a database located outside the electronic device via the communication module 503.

[0102] The processor 501 is used to execute one or more programs stored in the memory 502 to implement the above data storage method.

[0103] It is understandable that processor 501 can be a processor core or processor chip, or other circuitry capable of program configuration and execution. Memory 502 can be RAM (Random Access Memory), ROM (Read-Only Memory), flash memory, etc., but this is not a limitation.

[0104] It's understandable. Figure 5 The structure shown is for illustrative purposes only; the electronic device may also include components that are more advanced than those shown. Figure 5 The more or fewer components shown, or having the same Figure 5 Different configurations are shown. For example, it may also have an internal communication bus for communication between the processor 501 and the memory 502; or it may have an external communication interface, such as a USB (Universal Serial Bus) interface, a CAN (Controller Area Network) bus interface, etc.; or it may have an information display component such as a display screen, but this is not a limitation.

[0105] In the embodiments of this application, the electronic device may be, but is not limited to, a computer, a tablet, or other such device.

[0106] Based on the same inventive concept, this application also provides a data storage system, see [link to relevant documentation]. Figure 6 As shown, it includes a first electronic device and a second electronic device.

[0107] The first electronic device is located outside the diamond wire production line, and a database is installed in the first electronic device;

[0108] The second electronic device is installed in the diamond wire production line and communicates with the database in the first electronic device.

[0109] The second electronic device is used to execute the data storage method provided in the embodiments of this application.

[0110] In this embodiment of the application, the first electronic device may be a host, server, or other electronic device capable of deploying a database.

[0111] In this embodiment of the application, the second electronic device may be as described above. Figure 5 The electronic equipment provided.

[0112] In this embodiment of the application, the first electronic device is also used to notify the diamond wire production line of an anomaly when the database data stops updating.

[0113] It is understandable that when the production line is in operation, the second electronic device should theoretically continuously upload diamond wire image data to the database in the first electronic device for storage. Once the database data stops updating, it means that there is a high probability that an abnormality has occurred in the diamond wire production line. At this time, the first electronic device will actively send an abnormality notification, which will enable the staff to promptly check the abnormality of the diamond wire production line, thereby eliminating the abnormality in time and improving the safety of the diamond wire production line.

[0114] In this embodiment of the application, when the database data stops updating, possible anomalies include, but are not limited to, damage to the second resistor device, machine damage, or power outage.

[0115] Based on the same inventive concept, this embodiment also provides a computer-readable storage medium, such as a floppy disk, optical disk, hard disk, flash memory, USB flash drive, SD (Secure Digital Memory Card), MMC (Multimedia Card), etc., in which one or more programs implementing the above steps are stored. These one or more programs can be executed by one or more processors to implement the above data storage method. Further details will not be elaborated here.

[0116] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0117] Furthermore, the units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0118] Furthermore, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0119] In this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying any such actual relationship or order between these entities or operations.

[0120] In this article, "multiple" refers to two or more.

[0121] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A data storage method, characterized by, The method applied to an electronic device in a diamond wire production line comprises: Monitoring whether a diamond wire image is generated; In the case that it is monitored that the diamond wire image is generated, processing the diamond wire image to obtain diamond wire image data of the diamond wire image; Creating a database session; Inserting the diamond wire image data into a target ORM object and submitting the target ORM object to a database through the database session; wherein: the database is arranged outside the electronic device, and the target ORM object is an ORM object to which the diamond wire image data needs to be inserted among all ORM objects mapped to the electronic device in the database.

2. The data storage method of claim 1, wherein, Before monitoring whether a diamond wire image is generated, the method further comprises: Creating a database engine; Mapping ORM objects of each table in the database locally using the database engine.

3. The data storage method of claim 2, wherein, The method is implemented by software running on the electronic device; Before creating a database engine, the method further comprises: Generating and displaying a software icon on the electronic device; The software icon is used to reflect the current running state of the software.

4. The data storage method of claim 3, wherein, The software comprises a first thread and a second thread; The first thread is used to generate and display a software icon on the electronic device; The second thread is used to: create a database engine, map ORM objects of each table in the database using the database engine, monitor whether a diamond wire image is generated, and in the case that it is monitored that the diamond wire image is generated, process the diamond wire image to obtain diamond wire image data; And is used to create a database session, insert the diamond wire image data into a target ORM object of the database, and submit the target ORM object to the database through the database session. Inserting the diamond wire image data into a target ORM object of the database comprises:

5. The data storage method of any one of claims 1-4, wherein, Obtaining a target key corresponding to the diamond wire image data; From all ORM objects mapped to the electronic device, obtaining the target ORM object having the target key; Inserting the diamond wire image data into the target ORM object. Processing the diamond wire image to obtain diamond wire image data of the diamond wire image comprises:

6. The data storage method of any one of claims 1-4, wherein, Extracting diamond grit image data and bus image data in the diamond wire image; Obtaining the diamond wire image data according to the diamond grit image data and the bus image data. The data storage device applied to an electronic device in a diamond wire production line comprises:

7. A data storage device, characterized by A monitoring module for monitoring whether a diamond wire image is generated; An image processing module for processing the diamond wire image to obtain diamond wire image data of the diamond wire image in the case that it is monitored that the diamond wire image is generated; A creating module for creating a database session; A data uploading module for inserting the diamond wire image data into a target ORM object and submitting the target ORM object to a database through the database session; ​ The database is arranged outside the electronic device, and the target ORM object is an ORM object into which the diamond wire image data needs to be inserted among all ORM objects mapped to the electronic device.

8. An electronic device, comprising: The method comprises the following steps: The electronic device is connected to the database arranged outside the electronic device through the communication module; The processor is configured to execute one or more programs stored in the memory to implement the data storage method according to any one of claims 1-6.

9. A data storage system, characterized by The method comprises the following steps: The first electronic device is arranged outside the diamond wire production line, and the first electronic device is arranged with a database; The second electronic device is arranged in the diamond wire production line and is connected to the database in the first electronic device in communication; The second electronic device is configured to execute the data storage method according to any one of claims 1-6. The first electronic device is further configured to notify that the diamond wire production line is abnormal when the database data stops updating.

10. The data storage system of claim 9, wherein, The computer readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the data storage method according to any one of claims 1-6.

11. A computer readable storage medium, characterized in that, ​