Block chain-based data acquisition method and related equipment

By building a blockchain network and using sensors to determine the idle status of optical inspection computers, the problem of high network pressure caused by simultaneous uploads from optical inspection computers was solved, and stable defect file upload and data integrity were achieved.

CN120653390APending Publication Date: 2025-09-16BOE TECHNOLOGY GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510725317.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

The simultaneous uploading of defect files by optical inspection computers causes heavy network pressure, making the server prone to crashes, and task failures can easily lead to task loss.

Method used

By building a blockchain network, the optical inspection computer is used as a blockchain node, and voltage sensors, current sensors, and temperature sensors are used to determine the computer's idle state. Defect files are uploaded to the blockchain for task scheduling only when the computer is idle, avoiding simultaneous uploading.

Benefits of technology

It reduces the transmission pressure on the optical inspection computer, avoids server crashes, and ensures the stability of upload tasks and the integrity of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120653390A_ABST
    Figure CN120653390A_ABST
Patent Text Reader

Abstract

The invention provides a block chain-based data acquisition method and related equipment. The method is applied to a first optical detection computer, and the first optical detection computer is electrically coupled with first optical detection equipment and is used for building a block chain. The method comprises the following steps: receiving at least one production picture collected by first optical detection equipment; in response to defects detected from the at least one production picture, determining at least one defect picture from the at least one production picture; determining a defect file based on the at least one defect picture, and generating an uploading task based on the defect file; collecting equipment parameters of the first optical detection equipment; determining whether the first optical detection equipment is in an idle state according to the equipment parameters of the first optical detection equipment; and in response to determining that the first optical detection equipment is in the idle state, uploading the uploading task to the block chain, so that the block chain performs task scheduling based on the uploading task to control the first optical detection computer to upload the defect file to a server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to a blockchain-based data collection method and related equipment. Background Art

[0002] Optical inspection computers inspect production images for defects, assembling defect information and images before uploading them to the server in real time, without regard for the computer's resource usage or server storage pressure. When all optical inspection computers are simultaneously uploading data, network pressure is extreme, and the server is prone to crashing.

[0003] In view of this, how to avoid all optical inspection computers uploading at the same time, which would cause heavy network pressure, has become a technical problem that needs to be solved urgently. Summary of the Invention

[0004] In view of this, the purpose of the present disclosure is to propose a blockchain-based data collection method and related equipment to solve or partially solve the above-mentioned technical problems.

[0005] Based on the above objectives, a first aspect of the present disclosure provides a blockchain-based data collection method, which is applied to a first optical inspection computer, the first optical inspection computer being electrically coupled to a first optical inspection device and used to form a blockchain; the method comprises:

[0006] receiving at least one production picture collected by the first optical inspection device;

[0007] In response to detecting a defect from the at least one production image, determining at least one defective image from the at least one production image;

[0008] Determining a defect file based on the at least one defect image, and generating an upload task based on the defect file;

[0009] collecting equipment parameters of the first optical detection equipment;

[0010] determining whether the first optical inspection computer is in an idle state according to the device parameters of the first optical inspection device;

[0011] In response to determining that the first optical inspection computer is in an idle state, the upload task is uploaded to the blockchain, so that the blockchain performs task scheduling based on the upload task to control the first optical inspection computer to upload the defect file to the server.

[0012] Based on the same inventive concept, a second aspect of the present disclosure provides an optical detection computer, wherein the optical detection computer is electrically coupled to an optical detection device and is used to establish a blockchain;

[0013] Wherein, the optical detection computer executes the method described in the first aspect.

[0014] Based on the same inventive concept, the third aspect of the present disclosure proposes a blockchain-based data collection method, which is applied to an optical inspection device; the optical inspection device is electrically coupled to the optical inspection computer described in the second aspect; the method comprises:

[0015] At least one production picture is collected, and the at least one production picture is sent to the optical detection computer, so that the optical detection computer detects at least one defective picture from the at least one production picture.

[0016] Based on the same inventive concept, a fourth aspect of the present disclosure provides an optical detection device, comprising: the optical detection device electrically coupled to the optical detection computer described in the second aspect;

[0017] Wherein, the optical detection equipment performs the method described in the third aspect.

[0018] Based on the same inventive concept, the fifth aspect of the present disclosure proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method described above when executing the computer program.

[0019] Based on the same inventive concept, the sixth aspect of the present disclosure proposes a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute the method as described above.

[0020] Based on the same inventive concept, a seventh aspect of the present disclosure proposes a computer program product, comprising computer program instructions. When the computer program instructions are executed on a computer, the computer is caused to execute the method described above.

[0021] As can be seen from the above, the present disclosure provides a blockchain-based data collection method and related equipment. At least one production image collected by a first optical inspection device is received. When a defect is detected in the at least one production image, at least one defect image is determined from the at least one production image. A defect file is determined based on the at least one defect image, and an upload task is generated based on the defect file so that the upload task can be subsequently uploaded to the blockchain for task scheduling. Next, based on the device parameters of the first optical inspection device, it is determined whether the first optical inspection computer is in an idle state. When the first optical inspection computer is in an idle state, the upload task is uploaded to the blockchain, so that the blockchain performs task scheduling based on the upload task to control the first optical inspection computer to upload the defect file to the server. In this way, the upload task can be uploaded to the blockchain when the first optical inspection computer is in an idle state. Furthermore, the blockchain can perform task scheduling based on the upload task, thereby avoiding, to a certain extent, the situation where all optical inspection computers in the blockchain upload defect files simultaneously, thus avoiding, to a certain extent, increasing the transmission pressure on the optical inspection computers, and also reducing, to a certain extent, network transmission pressure. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0023] Figure 1 This is a flowchart of the blockchain-based data collection method according to an embodiment of the present disclosure;

[0024] Figure 2 Schematic diagram of a blockchain-based data acquisition system according to an embodiment of the present disclosure;

[0025] Figure 3 A flowchart for joining a target optical detection computer to a blockchain according to an embodiment of the present disclosure;

[0026] Figure 4 Schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.

[0028] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should have the usual meanings understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative position relationships. When the absolute position of the described object changes, the relative position relationship may also change accordingly.

[0029] Based on the description of the background technology, the optical inspection computer monitors local defect information and defect images, and when the defect information and defect images are generated, the assembly upload task is uploaded in real time without considering the local system resource usage, server pressure and transmission network pressure.

[0030] The factory's optical inspection computers had low configurations. When operating normally, they periodically generated a large number of defect images and files, placing significant pressure on disk input and output (IO). Upload tasks had no way of distinguishing between busy and idle times, so uploading tasks during the optical inspection computer's busy hours increased system pressure.

[0031] When optical inspection computers are working normally, they continuously generate upload tasks. When all optical inspection computers generate tasks at the same time, it will cause great pressure on the transmission network and the server, and the server is prone to crash.

[0032] If the optical inspection computer fails to upload the task, it will be directly retried or saved to the local memory or disk. Repeated retrying will easily increase the network pressure on the server. Saving to the local memory or disk will easily cause the task to be lost when the device restarts or fails. Saving to the disk will increase the local disk IO pressure.

[0033] As mentioned above, how to avoid all optical detection computers from uploading at the same time, which causes heavy network pressure, has become an important research issue.

[0034] Based on the above description, if Figure 1 As shown, the blockchain-based data collection method proposed in this embodiment is applied to a first optical detection computer, which is electrically coupled to a first optical detection device and is used to form a blockchain; the method includes:

[0035] Step 101: Receive at least one production picture collected by the first optical inspection device.

[0036] The optical inspection equipment may be an automatic optical inspection equipment (AOI), which is a device that detects common defects encountered in production based on optical principles.

[0037] The optical inspection computer can be an Automated Optical Inspection-Personal Computer (AOI-PC), which is a computer electrically coupled to the optical inspection equipment. A PC refers to a network system based on a personal computer, typically including desktop computers and laptop computers.

[0038] The first optical inspection device is configured to capture at least one production image during a factory production process and transmit the at least one production image to a first optical inspection computer. For example, the production process may be the production of a display panel, and the production image may be an image captured by the first optical inspection device of a display panel or a semi-finished display panel during a particular production step.

[0039] There can be at least one first optical inspection computer electrically coupled to the first optical inspection device. Specifically, when there is one first optical inspection computer, the first optical inspection device sends at least one collected production image to the first optical inspection computer. When there are multiple first optical inspection computers, the first optical inspection device randomly distributes the at least one collected production image to the multiple first optical inspection computers. For example, if the first optical inspection computers include optical inspection computer A and optical inspection computer B, and the first optical inspection device collects 10 production images, it randomly distributes the first 6 production images to optical inspection computer A and the remaining 4 production images to optical inspection computer B.

[0040] Step 102 : In response to detecting a defect from the at least one production picture, determining at least one defective picture from the at least one production picture.

[0041] In a specific implementation, when the first optical inspection computer detects a defect from at least one production picture, at least one defect picture is determined from at least one production picture so that a defect file can be generated based on the defect picture, and then defect analysis can be performed based on this to improve the production process.

[0042] When the first optical inspection computer detects no defects in the at least one production image, the at least one production image is saved to the first optical inspection computer. Because the local storage of the first optical inspection computer is regularly cleared, when the storage time of the at least one production image without defects in the first optical inspection computer reaches a preset time, the at least one production image without defects is deleted, thereby avoiding excessive usage of the local memory of the first optical inspection computer.

[0043] Step 103: Determine a defect file based on the at least one defect image, and generate an upload task based on the defect file.

[0044] In specific implementations, each defect image is extracted and processed to obtain defect information and image information, which are then combined into a defect file. An upload task is generated based on the defect file, facilitating subsequent upload of the upload task to the blockchain. The blockchain then schedules the upload task based on the upload task to control the first optical inspection computer to upload the defect file to the server.

[0045] The defect information includes at least one of the following: defect location information, defect size information, and defect type information. The image information includes at least one of the following: image memory usage information, image storage path information, and image naming information.

[0046] The image storage path information includes information related to the first optical inspection computer that performed defect detection. For example, if optical inspection computer A detects defective image a, the image storage path information in the defect file can be used to determine that the first optical inspection computer that detected defective image a is optical inspection computer A. In this way, the image storage path information can be used to accurately determine the first optical inspection computer that detected the defective image.

[0047] Step 104: Acquire device parameters of the first optical detection device.

[0048] In a specific implementation, the device parameters of the first optical detection device are collected using sensors provided on the first optical detection device. In some embodiments, the sensors may include voltage sensors, current sensors, and temperature sensors. The device parameters include voltage parameters, current parameters, and temperature parameters.

[0049] Step 105: Determine whether the first optical inspection computer is in an idle state according to the equipment parameters of the first optical inspection equipment.

[0050] In a specific implementation, the device parameters of the first optical inspection device are compared with a parameter threshold to determine whether the first optical inspection computer is in an idle state. When the device parameters are greater than or equal to the parameter threshold, the first optical inspection computer is determined to be in an operating state (busy state). When the device parameters are less than the parameter threshold, the first optical inspection computer is determined to be in an idle state.

[0051] Step 106: In response to determining that the first optical inspection computer is in an idle state, uploading the upload task to the blockchain, so that the blockchain performs task scheduling based on the upload task to control the first optical inspection computer to upload the defect file to the server.

[0052] In a specific implementation, when the first optical inspection computer is in a working state (busy state), the upload task is set to a waiting state and the upload task is temporarily not processed. When the first optical inspection computer is in an idle state, the upload task is set to a ready-to-upload state and uploaded to each blockchain node in the blockchain network. The blockchain performs task scheduling based on the upload task to control the first optical inspection computer to upload the defect file to the server.

[0053] Through the above embodiment, at least one production image captured by a first optical inspection device is received. When a defect is detected in the at least one production image, at least one defect image is determined from the at least one production image. A defect file is determined based on the at least one defect image, and the determined defect file includes both defect information and image information, making the resulting defect file more comprehensive. An upload task is generated based on the defect file so that the upload task can be subsequently uploaded to the blockchain for task scheduling. Next, based on the device parameters of the first optical inspection device, it is determined whether the first optical inspection computer is in an idle state. When the first optical inspection computer is in an idle state, the upload task is uploaded to the blockchain, so that the blockchain performs task scheduling based on the upload task to control the first optical inspection computer to upload the defect file to the server. This ensures that the upload task is uploaded to the blockchain when the first optical inspection computer is in an idle state. Furthermore, the blockchain can perform task scheduling based on the upload task, thereby, to a certain extent, avoiding the situation where all optical inspection computers in the blockchain upload defect files simultaneously, thereby, to a certain extent, reducing transmission pressure on the optical inspection computers and, to a certain extent, reducing network transmission pressure.

[0054] Figure 2 Schematic diagram of a blockchain-based data collection system according to an embodiment of the present disclosure.

[0055] like Figure 2As shown, in some embodiments, a blockchain-based data acquisition system includes: an optical inspection device (AOI device) and at least one optical inspection computer (AOI-PC). The optical inspection device is provided with a current sensor, a voltage sensor, and a temperature sensor. The data acquisition software of the optical inspection computer includes: an acquisition component Dma.collector, an upload component Dma.upload, and a blockchain network component Dma.chainnet. Multiple optical inspection computers (AOI-PCs) in the same local area network constitute a blockchain. The blockchain performs task scheduling based on the upload tasks of each optical inspection computer to control each optical inspection computer to send defect files generated based on the detected defect images to the platform server, and the platform server sends the defect images to the business server. Among them, the IoT management and control platform services in the platform server include device management and data analysis, and the EMQX services in the platform server include message subscription.

[0056] The embodiment of the present disclosure proposes a method for collecting images of factory optical inspection equipment based on the Internet of Things platform. The computer configuration in the optical inspection equipment is low and the performance is poor. When the optical inspection equipment is running a task, it will occupy a large amount of system resources, especially disk IO resources and server network resources. If the acquisition software is working at the same time, it will affect the normal operation of the optical inspection equipment. The embodiment of the present disclosure installs a voltage sensor, a current sensor and a temperature sensor on the optical inspection equipment to achieve uploading when the optical inspection equipment is idle, without affecting the normal operation of the optical inspection equipment. Optionally, before uploading the defect file, the defect image can be compressed and cropped to reduce the size of the defect image and thus reduce the size of the defect file. Optionally, the data acquisition software uses a component form, and different process optical inspection equipment uses different components for easy expansion. In some embodiments, the upload protocol used for uploading defect files can support multiple protocols, for example, File Transfer Protocol (FTP), Hypertext Transfer Protocol (HTTP), Message Queuing Telemetry Transport (MQTT), etc., so that the upload process can be componentized. In the disclosed embodiments, a blockchain network is established, with the optical inspection computer acting as a blockchain node. Intelligent processing of upload tasks by the blockchain node allows for smooth upload times, reducing server and network pressure. In some embodiments, failed upload tasks can be saved via the blockchain network without having to be saved to a local disk, thus reducing local disk I / O pressure and ensuring data is preserved even if the optical inspection computer is shut down and restarted.

[0057] In some embodiments, a blockchain network is formed, and each optical detection computer serves as a blockchain node. The optical detection equipment is equipped with voltage sensors, current sensors, and temperature sensors. The optical detection computer periodically collects voltage parameters, current parameters, and temperature parameters, assembles them into data packets, and sends them to the blockchain network. Each blockchain node saves the parameters, performs parameter cleaning and screening, and performs training analysis to generate a corresponding relationship between a parameter threshold and whether the optical detection computer is idle or busy. The parameter threshold can be used to determine whether the optical detection computer is idle or busy. When the optical detection computer has an upload task, the upload task is sent to the blockchain network. Each blockchain node performs smart contract processing to ensure that the optical detection computer uploads when it is idle, and to ensure peak upload. All optical detection computers will not upload at the same time, thereby ensuring network stability and server stability.

[0058] In some embodiments, it further includes:

[0059] Step 10A: In response to receiving a broadcast message indicating that a target optical inspection computer has joined the blockchain, the broadcast message is parsed to obtain a network address and port number of the target optical inspection computer.

[0060] Step 10B: Record the network address and the port number into the node list of the blockchain, so that the target optical inspection computer is added to the blockchain as a blockchain node.

[0061] In practical implementation, optical inspection computers are widely used in product quality inspection in modern industrial production. To improve inspection efficiency and data management transparency, a lightweight blockchain network is constructed based on the first optical inspection computer. Each first optical inspection computer acts as a blockchain node, exchanging and synchronizing data over the network. This not only simplifies system complexity but also improves data consistency and security. The blockchain network component, Dma.chainnet, is used to build the blockchain network within the local area network.

[0062] The first optical inspection computer is used as a blockchain node to build a blockchain. The process of adding a target optical inspection computer to the blockchain as a new blockchain node includes: upon startup of the target optical inspection computer as a new blockchain node, the target optical inspection computer sends a broadcast message on the blockchain local area network, wherein the broadcast message includes the network address and port number of the target optical inspection computer. Upon receiving the broadcast message indicating that the target optical inspection computer has joined the blockchain, the first optical inspection computer adds the target optical inspection computer to the blockchain as a new blockchain node, thereby establishing a communication connection with the target optical inspection computer.

[0063] Figure 3This is a flowchart of adding a target optical detection computer to a blockchain according to an embodiment of the present disclosure. Figure 3 As shown in the figure, the process of the target optical detection computer joining the blockchain as a new blockchain node includes:

[0064] (1) New node starts

[0065] Step A: Initialize network configuration and data storage.

[0066] When the target optical inspection computer starts up as a new blockchain node, it initializes the network configuration, which includes the Internet Protocol (IP) address and port number. It also initializes the data storage to prepare for storing received data.

[0067] Step B: Construct a broadcast message (including IP and port).

[0068] The target optical detection computer constructs a broadcast message based on the network address and port number.

[0069] Step C: Send a broadcast message to the broadcast address.

[0070] A broadcast message is sent to the broadcast address (255.255.255.255) of the first optical detection computer in the blockchain local area network via the User Datagram Protocol (UDP).

[0071] The broadcast message can be expressed in the following format:

[0072]

[0073] (2) Start the existing node

[0074] Step a: Set up a UDP listener (listen to the specified port).

[0075] When the first optical inspection computer is started as an existing blockchain node, a UDP listener is set to listen to a specified port. For example, if the port number of the target optical inspection computer is 8080, the designated port to be listened is 8080.

[0076] Step b: monitor broadcast messages (continuous monitoring).

[0077] The listener continuously monitors broadcast messages from other nodes in the blockchain LAN.

[0078] Step c: parse the broadcast message and extract node information.

[0079] When the listener of the first optical inspection computer receives the broadcast message that the target optical inspection computer has joined the blockchain, the broadcast message is parsed to obtain the network address and port number of the target optical inspection computer.

[0080] Step d: record the new node information (de-duplication).

[0081] The first optical inspection computer determines whether the target optical inspection computer's network address and port number are stored in its node list. If the target optical inspection computer's network address and port number are not stored in the first optical inspection computer's node list, the first optical inspection computer records the target optical inspection computer's network address and port number in the blockchain's node list for subsequent data synchronization and communication. This also prevents duplicate records by checking whether the same network information is already stored in the node list. Each blockchain node maintains a node list that records the network information of all blockchain nodes. The node list can be stored in memory or persisted to a file for recovery after a reboot.

[0082] Step e: Periodically request data from other nodes.

[0083] Each blockchain node periodically (e.g., every 10 seconds) requests the latest data from other blockchain nodes in the power-saving list.

[0084] Step f: Receive data and verify data integrity.

[0085] Each data block is accompanied by a hash value, which is used to verify the integrity of the data. When each blockchain node receives the latest data from other nodes, it calculates the hash value of the latest data and compares it with the accompanying hash value to ensure data consistency.

[0086] Step g: store data.

[0087] After receiving the latest data from other nodes, the latest data is stored.

[0088] In addition, blockchain nodes are authenticated using digital certificates, ensuring that only legitimate nodes can join the network. Broadcast messages can include digital signatures to ensure integrity and non-repudiation. Data transmission is encrypted using Secure Sockets Layer (SSL) or Transport Layer Security (TLS) to prevent data theft or tampering during transmission.

[0089] With this solution, when a broadcast message is received announcing the target optical inspection computer's addition to the blockchain, the broadcast message is parsed to obtain the target optical inspection computer's network address and port number. By recording the network address and port number in the blockchain's node list, the target optical inspection computer is added to the blockchain as a blockchain node, thereby establishing a communication connection with the target optical inspection computer.

[0090] In some embodiments, it further includes:

[0091] Step 10C: Determine the data synchronization method of the blockchain.

[0092] Step 10D: In response to determining that the data synchronization mode is the periodic synchronization mode, requesting the latest data from other optical inspection computers in the node list after a preset time interval.

[0093] Step 10E: in response to determining that the data synchronization mode is the update synchronization mode, sending an update notification to other optical inspection computers after updating the data, so that the other optical inspection computers request the first optical inspection computer to update the data after receiving the update notification.

[0094] In specific implementations, when the data synchronization mode is set to periodic, each blockchain node (i.e., each optical inspection computer) periodically requests the latest data from other blockchain nodes (i.e., other optical inspection computers) in the node list. For example, if the preset duration is 10 seconds, when the data synchronization mode is set to periodic, the first optical inspection computer will request the latest data from other optical inspection computers in the node list every 10 seconds. After receiving the request for the latest data, the other optical inspection computers will send the latest data to the first optical inspection computer.

[0095] Among them, other optical detection computers transmit the latest data to the first optical detection computer via HTTP / HTTPS or WebSocket to ensure data consistency.

[0096] When the data synchronization mode is update synchronization (i.e., on-demand synchronization), when any blockchain node (i.e., any optical inspection computer) generates the latest data, it proactively notifies other blockchain nodes, and other blockchain nodes (i.e., other optical inspection computers) request the latest data from the blockchain node that generated the latest data. Specifically, when the data synchronization mode is update synchronization, after updating data, the first optical inspection computer sends an update notification to the other optical inspection computers. After receiving the update notification, the other optical inspection computers request updated data from the first optical inspection computer. After receiving the update request, the first optical inspection computer sends the updated data to the other optical inspection computers.

[0097] After the first optical inspection computer receives the latest data from other optical inspection computers, it performs data verification on the latest data to ensure data consistency and guarantee that the received data is the latest data. The data verification includes: hash verification and version verification.

[0098] Each data item is accompanied by a hash value, which is used to verify the data's integrity. Specifically, the data hash verification process includes: calculating a first hash value for the latest data upon receipt, parsing the received data to obtain a second hash value, and comparing the first and second hash values. If the first and second hash values ​​match, the hash verification of the latest data is considered successful. This ensures that the latest data sent by other optical inspection computers is consistent with the latest data received by the first optical inspection computer.

[0099] Each data item is accompanied by a version number that identifies the data version. Specifically, the data version verification process includes parsing the latest data received to obtain the accompanying version number, determining whether the version number is the latest version, and determining that the version number verification of the latest data is successful if the version number is the latest version. This ensures that the first optical inspection computer receives the latest data.

[0100] When building a blockchain based on optical inspection computers, resource consumption should be minimized to make it suitable for resource-constrained optical inspection computers. Furthermore, communication between blockchain nodes should primarily rely on basic network functions (e.g., HTTP / HTTPS or WebSocket). Data consistency across all blockchain nodes should be ensured, with support for both scheduled and on-demand data synchronization. This avoids complex consensus mechanisms and reduces the difficulty of system design and implementation.

[0101] With the above solution, when the data synchronization mode is periodic, the latest data is requested from other optical inspection computers in the node list after a preset time interval, thus achieving regular data synchronization between the optical inspection computers. When the data synchronization mode is update, an update notification is sent to the other optical inspection computers after data is updated. After receiving the update notification, the other optical inspection computers request updated data from the first optical inspection computer. In this way, the updated data can be promptly synchronized to the other optical inspection computers after the data is updated.

[0102] In some embodiments, step 103 includes:

[0103] Step 1031: Count the at least one defective image detected.

[0104] Step 1032 : In response to determining that the number of defective images remains unchanged within a preset time period, determine whether the size of the latest defective image continues to increase.

[0105] Step 1033 : In response to the size of the latest defective image remaining unchanged within a preset time period, the defective file is determined based on all detected defective images.

[0106] In specific implementation, the collection component Dma.collector is the core functional component in the data collection software of the optical inspection computer. It is used to collect defect images and defect information and clean and organize them, and is also used to organize and analyze equipment parameters.

[0107] The data acquisition software of the first optical inspection computer is activated to monitor the local production image directory and defect file directory. The system counts at least one detected defective image. If the number of defective images remains constant for a preset period of time, the system determines whether the size of the latest defective image continues to increase. If the size of the latest defective image remains constant for a preset period of time, the system determines the defective file based on all detected defective images.

[0108] For example, the preset duration is 5 seconds. Eight defective images are detected. If the number of defective images remains at 8 within 10 seconds, the size of the latest defective image is determined to be 50 MB. If the size of the latest defective image remains at 50 MB within 10 seconds, defective images have been generated, and a defective file is determined based on all detected defective images.

[0109] Additionally, upon receiving at least one production image from the first optical inspection device, the first optical inspection computer determines whether the at least one production image has been received. Specifically, the computer counts the at least one production image received. In response to determining that the number of production images remains unchanged for a preset period of time, the computer determines the latest production image based on the modification time of the production image, and determines whether the size of the latest production image continues to increase. In response to the size of the latest production image remaining unchanged for a preset period of time, the computer determines that the at least one production image has been received.

[0110] Through the above scheme, when the number of defective images remains unchanged within the preset time length and the size of the latest defective image remains unchanged within the preset time length, it can be determined that all defective images have been detected. In this way, the defective file can be accurately determined based on all the detected defective images, avoiding the situation where the defective file is generated when the defective images are not fully detected, resulting in an incomplete defective file.

[0111] In some embodiments, step 105 includes:

[0112] Step 1051: Compare the device parameters with parameter thresholds.

[0113] Step 1052: In response to determining that the device parameter is less than the parameter threshold, determine that the first optical inspection computer is in an idle state.

[0114] During specific implementation, the device parameters are compared with the parameter threshold; when the device parameters are greater than or equal to the parameter threshold, it is determined that the first optical detection computer is in a working state (busy state); when the device parameters are less than the parameter threshold, it is determined that the first optical detection computer is in an idle state.

[0115] Through the above solution, by comparing the device parameters with the parameter threshold, it is possible to accurately determine whether the first optical inspection computer is in an idle state. When the device parameters are less than the parameter threshold, it indicates that the first optical inspection computer has not reached the working state, thereby accurately determining that the first optical inspection computer is in an idle state.

[0116] In some embodiments, the first optical detection device includes a voltage sensor, a current sensor, and a temperature sensor; the device parameters include: a voltage parameter collected by the voltage sensor, a current parameter collected by the current sensor, and a temperature parameter collected by the temperature sensor; the parameter thresholds include a voltage threshold, a current threshold, and a temperature threshold; step 1052 includes:

[0117] Step 1052A, in response to determining that the voltage parameter is less than a voltage threshold, the current parameter is less than a current threshold, and the temperature parameter is less than a temperature threshold, determining that the first optical inspection computer is in an idle state.

[0118] In a specific implementation, when the voltage parameter is greater than or equal to the voltage threshold, or the current parameter is greater than or equal to the current threshold, or the temperature parameter is greater than or equal to the temperature threshold, it is determined that the first optical detection computer is in a working state (busy state).

[0119] When the voltage parameter is less than a voltage threshold, the current parameter is less than a current threshold, and the temperature parameter is less than a temperature threshold, it is determined that the first optical detection computer is in an idle state.

[0120] When the first optical inspection computer is idle, it uses the upload component Dma.upload to upload the task to the blockchain. This allows the decision to proceed based on the voltage, current, and temperature parameters of the optical inspection equipment. Simultaneously, the decision to proceed is made based on the current upload tasks of other optical inspection computers in the blockchain network.

[0121] The above solution uses the voltage, current, and temperature parameters together to determine whether the first optical inspection computer is in an idle state, making it possible to more accurately determine whether the first optical inspection computer is in an idle state, thereby avoiding the inaccurate determination that can occur when a single device parameter is used. When the voltage parameter is less than a voltage threshold, the current parameter is less than a current threshold, and the temperature parameter is less than a temperature threshold, the first optical inspection computer can be accurately determined to be in an idle state.

[0122] In some embodiments, it further includes:

[0123] Step 1053: Determine the timestamp of the data collection moment and the device identification of the first optical detection device from the device parameters.

[0124] Step 1054: pre-process the device parameters to obtain target parameters.

[0125] Step 1055: Pack the timestamp, the device identifier, and the target parameter to obtain a data packet.

[0126] Step 1056: Add a digital signature to the data packet and upload it to the blockchain.

[0127] During implementation, data acquisition software on the first optical inspection computer is activated, and a data acquisition frequency is set, for example, once per second, to ensure real-time and accurate data. Voltage parameters of the optical inspection device are acquired using a voltage sensor, current parameters of the optical inspection device are acquired using a current sensor, and temperature parameters of the optical inspection device are acquired using a temperature sensor. These voltage, current, and temperature parameters are used as device parameters of the optical inspection device.

[0128] Preprocess the device parameters to obtain target parameters, where preprocessing refers to cleaning and includes at least one of the following: missing value processing, outlier processing, duplicate data processing, and format conversion. The target parameters are packaged into a structured data packet, where the data packet includes a timestamp, device identification (i.e., device ID), voltage parameters, current parameters, and temperature parameters.

[0129] Data packets are digitally signed to ensure data integrity and source authenticity. Data packets are uploaded to various blockchain nodes via the blockchain network. Uploaded data packets are packaged into blocks, each containing multiple data records. Newly generated blocks are linked to the blockchain, forming an immutable data chain. Through a peer-to-peer (P2P) network, data consistency is ensured across all blockchain nodes, enabling distributed data storage and backup.

[0130] Compared with sending device parameters to the cloud server, the above solution can process the device parameters and then upload them to the blockchain, which has higher data security and privacy protection, lower latency and higher performance, higher cost-effectiveness in the long run, higher data availability and reliability, higher flexibility and customization capabilities, and easier to meet legal and compliance requirements.

[0131] (1) Data security and privacy protection

[0132] Advantages of uploading processed device parameters to the blockchain:

[0133] 1. Data sovereignty: Device parameters are retained locally on the optical inspection computer, which has complete control over them, reducing the risk of device parameter leakage.

[0134] 2. Encrypted storage: Blockchain uses encryption technology to store device parameters, ensuring the security of device parameters during transmission and storage.

[0135] 3. Anti-tampering: The immutability of blockchain ensures the authenticity of device parameters, and any unauthorized modifications will be detected.

[0136] Disadvantages of sending device parameters to a cloud server:

[0137] 1. Data transmission risk: Device parameters may be intercepted or tampered with during transmission to the cloud server.

[0138] 2. Third-party trust: Relying on the security measures of the cloud server provider, there is a certain trust risk.

[0139] 3. Compliance: You may need to comply with more data privacy and security regulations, increasing compliance costs.

[0140] (2) Performance and latency

[0141] Advantages of uploading processed device parameters to the blockchain:

[0142] 1. Low latency: Local processing on optical detection computers reduces the time it takes to transmit device parameters, resulting in faster response and suitable for real-time analysis and control.

[0143] 2. High throughput: Optical inspection computers typically have higher local network bandwidth and can handle a large number of device parameters, especially in the case of high-frequency data acquisition.

[0144] Disadvantages of sending device parameters to a cloud server:

[0145] 1. Network delay: The transmission of device parameters to the cloud server needs to go through the Internet, which may encounter network congestion and delays.

[0146] 2. Network dependence: Network instability may lead to interruption of device parameter transmission, affecting the continuity and real-time nature of analysis.

[0147] (3) Cost-effectiveness

[0148] Advantages of uploading processed device parameters to the blockchain:

[0149] 1. Reduce bandwidth costs: There is no need to upload a large number of device parameters to the cloud server, saving bandwidth costs.

[0150] 2. Hardware investment: Although hardware and maintenance costs are required initially, in the long run, local processing of optical inspection computers can save cloud server costs.

[0151] 3. Autonomous control: Local hardware can be flexibly expanded and upgraded according to actual needs, without being restricted by cloud server providers.

[0152] Disadvantages of sending device parameters to a cloud server:

[0153] 1. Pay-as-you-go: Cloud servers are typically charged based on usage, which requires a lower initial investment but can result in higher long-term costs.

[0154] 2. Operation and maintenance costs: Cloud server providers are responsible for most of the operation and maintenance work, which reduces the operation and maintenance burden of enterprises, but also increases operating costs.

[0155] (4) Data availability and reliability

[0156] Advantages of uploading processed device parameters to the blockchain:

[0157] 1. Data redundancy: Blockchain nodes in the blockchain network can store copies of device parameters, improving the availability and fault tolerance of device parameters.

[0158] 2. Decentralization: Even if a blockchain node fails, other blockchain nodes can still continue to work, ensuring the continuity of the system.

[0159] 3. Local backup: Data can be backed up locally to further improve the security and reliability of device parameters.

[0160] Disadvantages of sending device parameters to a cloud server:

[0161] 1. Single point of failure: If there is a problem with the cloud server provider's infrastructure, it may affect access for all users.

[0162] 2. Supplier dependence: The availability and reliability of device parameters depend on the technical capabilities and operation and maintenance level of the cloud server provider.

[0163] (5) Flexibility and customization

[0164] Advantages of uploading processed device parameters to the blockchain:

[0165] 1. Customization: It can be highly customized according to the needs of the enterprise, including data processing logic, security policies, etc.

[0166] 2. Easy integration: Easier to integrate with current local systems and devices, reducing compatibility issues.

[0167] 3. Flexible expansion: The local network can be gradually expanded according to actual needs, adding more blockchain nodes and computing resources.

[0168] Disadvantages of sending device parameters to a cloud server:

[0169] 1. Standardized services: The services provided by cloud server providers are often standardized and may not meet certain specific customization requirements.

[0170] 2. API dependency: Integration with current systems often relies on the Application Programming Interface (API) provided by cloud server providers, which may lead to compatibility and stability issues.

[0171] (6) Law and Compliance

[0172] Advantages of uploading processed device parameters to the blockchain:

[0173] 1. Data sovereignty: Equipment parameters are retained locally on the optical inspection computer, making it easier to meet requirements for data localization.

[0174] 2. Compliance: It is easier to comply with relevant laws and regulations on data privacy and security, reducing compliance risks.

[0175] Disadvantages of sending device parameters to a cloud server:

[0176] 1. Cross-border data flow: Data transmission to cloud servers may involve cross-border data flow and must comply with the laws and regulations of multiple countries and regions.

[0177] 2. Regulatory requirements: Cloud server providers may need to comply with more complex regulatory requirements, increasing compliance costs and complexity.

[0178] After step 1054, the method further includes:

[0179] Step 1054A, compare the target parameter with the parameter threshold.

[0180] Step 1054B, in response to determining that the target parameter is less than the parameter threshold, determining that the first optical inspection computer is in an idle state.

[0181] In a specific implementation, the voltage parameters, current parameters and temperature parameters of the first optical detection computer are collected and used as device parameters, and the device parameters are pre-processed to obtain target parameters, making the target parameters more accurate.

[0182] Determine whether the first optical inspection computer is in an idle state based on the target parameter. When the target parameter is greater than or equal to a parameter threshold, determine that the first optical inspection computer is in a working state (busy state); when the target parameter is less than the parameter threshold, determine that the first optical inspection computer is in an idle state.

[0183] Based on the time series characteristics of the target parameters, the operating mode and trend of the first optical inspection device can be identified. For example, if the first optical inspection computer is idle at a first timestamp and active at all subsequent timestamps, the operating mode and trend of the first optical inspection device can be identified as being idle at an initial time and busy at subsequent times.

[0184] In addition, a normal parameter range is pre-set. Step 1054A includes: determining whether the target parameter is within the preset normal parameter range; in response to determining that the target parameter is not within the preset normal parameter range, deleting the target parameter; in response to determining that the target parameter is within the preset normal parameter range, comparing the target parameter with a parameter threshold.

[0185] When the target parameter is not within the preset normal parameter range, it indicates that the first optical inspection computer may have a fault or abnormality. In this scenario, it is not possible to accurately determine whether the first optical inspection computer is in an idle state based on the target parameter, and the target parameter is deleted. When the target parameter is within the preset normal parameter range, it indicates that the first optical inspection computer has no fault or abnormality. In this scenario, it is possible to accurately determine whether the first optical inspection computer is in an idle state based on the target parameter, and the target parameter is compared with the parameter threshold to determine whether the first optical inspection computer is in an idle state.

[0186] Through the above solution, the device parameters are preprocessed to make the target parameters more accurate. The target parameters are compared with the parameter threshold. When the target parameters are less than the parameter threshold, the first optical inspection computer is determined to be in an idle state. In this way, based on the preprocessed target parameters, it is possible to accurately determine whether the first optical inspection computer is in an idle state, avoiding the problem of being unable to accurately determine whether the first optical inspection computer is in an idle state due to inaccurate device parameters.

[0187] After step 1054, the method further includes:

[0188] Step 1054a: Store the target parameters within the preset period so that the target parameters can be exported and displayed in chronological order.

[0189] Step 1054b: determining a parameter threshold based on the target parameter within the preset period, and updating the parameter threshold based on the target parameter within the new preset period.

[0190] During implementation, the first optical inspection computer collects voltage, current, and temperature parameters and stores them for training. The computer displays these parameters in chronological order. Staff members annotate these parameters based on the derived voltage, current, and temperature parameters, using the boundary parameters between the first optical inspection computer's idle and active states as parameter thresholds.

[0191] For example, the preset period is one week, and the voltage parameters, current parameters, and temperature parameters collected by the first optical detection computer within the week are obtained. After the voltage parameters, current parameters, and temperature parameters within the week are marked, the corresponding parameter thresholds (voltage threshold, current threshold, and temperature threshold) are determined through comprehensive analysis and processing. In this way, when the voltage parameters, current parameters, and temperature parameters are less than the corresponding parameter thresholds, the first optical detection computer is determined to be in an idle state; when the voltage parameters, current parameters, and temperature parameters are greater than or equal to the corresponding parameter thresholds, the first optical detection computer is determined to be in an active state.

[0192] The determined parameter thresholds are broadcast to the Dma.collector component in the data acquisition software on each optical inspection computer for storage. The Dma.collector component makes judgments based on the parameter thresholds and only uploads the upload task when the optical inspection computer is idle.

[0193] The parameter thresholds are updated based on the target parameters within a new preset period. For example, if the new preset period is one month, the voltage parameters, current parameters, and temperature parameters collected by the first optical inspection computer within one month are obtained, the voltage parameters, current parameters, and temperature parameters within one month are annotated, and the log information within one month is retrieved. The state judgment error records of the optical inspection computer are determined from the log information. The parameter thresholds are adjusted based on the state judgment error records to obtain the updated parameter thresholds. In this way, the blockchain network based on the optical inspection computer can analyze the parameter thresholds, and the optical inspection computer can update the parameter thresholds. Through continuous cycles, the parameter thresholds are continuously optimized.

[0194] Through the above solution, the target parameters obtained are made more accurate by preprocessing the device parameters. The target parameters within a preset period are stored. In this way, the target parameters exported and displayed in chronological order are accurate. Staff can use the accurate target parameter standard parameter thresholds to avoid the problem of inaccurate standard parameter thresholds due to inaccurate device parameters. The parameter thresholds are determined based on the target parameters within the preset period, and the parameter thresholds are updated based on the target parameters within the new preset period. In this way, by updating the parameter thresholds, the parameter thresholds can be continuously optimized, making the parameter thresholds more accurate, and thus accurately determining whether the optical inspection computer is in an idle state based on the parameter thresholds.

[0195] In some embodiments, step 1054 includes:

[0196] Step 10541: In response to determining the missing value from the device parameter, the device parameter is corrected to obtain a first corrected parameter.

[0197] Step 10542: determine abnormal values ​​from the first correction parameters, and perform abnormality elimination processing on the abnormal values ​​in the first correction parameters to obtain second correction parameters.

[0198] Step 10543: Determine duplicate data from the second correction parameter according to the timestamp and the device identifier, and delete the duplicate data from the second correction parameter to obtain a third correction parameter.

[0199] Step 10544: Perform format conversion processing on the third correction parameter to obtain target format parameters, and determine whether the target format data meets the preset format conditions.

[0200] Step 10545: In response to determining that the target format data meets the preset format condition, the target format data is used as the target parameter.

[0201] In specific implementation, preprocessing includes: missing value processing, outlier processing, duplicate data processing and format conversion processing.

[0202] Before preprocessing the device parameters, the process also includes determining the basic structure and content of the device parameters and calculating statistical indicators of the device parameters. The statistical indicators include at least one of the following: mean, median, and standard deviation. In this way, the distribution of the device parameters can be quickly and accurately understood based on the statistical indicators of the device parameters.

[0203] Check whether there are missing values ​​in the device parameters. If there are missing values ​​in the device parameters, record the row position, column position and missing ratio of the missing values ​​in the device parameters. When the missing ratio is less than the preset ratio threshold, delete the data corresponding to the row position and column position of the missing value in the device parameters to obtain the first corrected parameters.

[0204] Outliers are detected from the first correction parameters using a minimum-maximum normalization algorithm. Each parameter in the first correction parameters is normalized using the normalization algorithm to obtain a standard parameter. When a standard parameter is not within a preset range, the parameter corresponding to the standard parameter is treated as an outlier. Outliers in the first correction parameters are deleted or corrected to obtain the second correction parameters.

[0205] Duplicate data is determined from the second correction parameters using a unique identifier (e.g., a device ID and a timestamp), and the duplicate data in the second correction parameters is deleted to obtain a third correction parameter. For example, if there are two device parameters corresponding to the first device identifier and the first timestamp, then one of the device parameters corresponding to the first device identifier and the first timestamp is determined to be duplicate data. For example, if there are three device parameters corresponding to the second device identifier and the first timestamp, then two of the device parameters corresponding to the second device identifier and the first timestamp are determined to be duplicate data. In this way, by deleting the duplicate data to obtain the third correction data, only one device parameter corresponding to the first device identifier and the first timestamp can be retained, thereby avoiding the waste of storage resources caused by duplicate data in the device parameters.

[0206] Check whether the data type of each column of data in the third correction parameter is correct. Convert the data type of the third correction parameter to a target format suitable for analysis (for example, convert a string to a numeric type).

[0207] Determine whether the target format data meets the preset format conditions. If the target format data meets the preset format conditions, use the target format data as the target parameter. The preset format conditions include: consistency conditions, verification conditions, and standardization conditions. Consistency conditions include unit consistency conditions and format consistency conditions. Verification conditions include logic verification conditions and range verification conditions. Standardization conditions include data standardization and application standardization.

[0208] When the target format data satisfies the preset unit consistency condition, it indicates that the parameter units in the target format data are consistent. For example, to determine whether the unit of the temperature parameter in the target format data is the preset unit, if the unit of the temperature parameter in the target format data is both Celsius or Fahrenheit, then the target format data is determined to meet the preset unit consistency condition.

[0209] When the target format data satisfies the preset format consistency condition, it indicates that the parameter formats in the target format data are consistent. For example, determining whether the timestamp format in the target format data is the preset format, if the timestamp format in the target format data is all in YYYY-MM-DD format, then it is determined that the target format data satisfies the preset format consistency condition.

[0210] When the target format data meets the preset logical verification conditions, it indicates that the target format data complies with the business logic. For example, determining whether the temperature parameter in the target format data is greater than or equal to absolute zero degrees. If the temperature parameter in the target format data is greater than or equal to absolute zero degrees, it is determined that the target format data meets the preset logical verification conditions.

[0211] When the target format data meets the preset range verification conditions, it indicates that the target format data is within a reasonable range. For example, it is determined whether the current parameter in the target format data is less than the maximum rated current of the device. If the current parameter in the target format data is less than the maximum rated current of the device, it is determined that the target format data meets the preset range verification conditions.

[0212] When the target format data meets the preset data standardization, the target format data is scaled to within the preset parameter range. For example, the target format data is scaled to within the parameter range of [0, 1] using a minimum-maximum normalization algorithm. When the target format data meets the preset application standardization, all target format data is ensured to be on the same scale. After performing data and application standardization on the target format data, the statistical indicators of the standardized target format data are recalculated to ensure that the target format data has been successfully standardized. A distribution diagram of the target format data before and after standardization is plotted to visually verify the effectiveness of standardization. The device parameters collected by different optical inspection computers are standardized to ensure that the device parameters collected by different optical inspection computers are comparable.

[0213] Through the above scheme, when missing values ​​are determined from the device parameters, the device parameters are corrected to obtain a first corrected parameter. Abnormal values ​​are determined from the first corrected parameter, and abnormal values ​​in the first corrected parameter are eliminated to obtain a second corrected parameter. Duplicate data can be accurately determined from the second corrected parameter based on the timestamp and device identifier, and the duplicate data in the second corrected parameter is deleted to obtain a third corrected parameter. The third corrected parameter is format-converted to obtain a target format parameter, and when the target format data meets the preset format conditions, the target format data is used as the target parameter. In this way, by performing missing value processing, abnormal value processing, duplicate data processing, and format conversion processing on the device parameters, the device parameters can be cleaned, making the obtained target data more accurate.

[0214] In some embodiments, step 10541 includes:

[0215] Step 10541A, in response to determining a missing value from the device parameters, determining the row position and column position of the missing value in the device parameters.

[0216] Step 10541B: determine the missing ratio of the missing values ​​in the device parameters, and compare the missing ratio with a preset ratio threshold.

[0217] Step 10541C: In response to determining that the missing ratio is greater than or equal to a preset ratio threshold, re-collect the device parameters of the first optical detection device.

[0218] Step 10541D: In response to determining that the missing ratio is less than a preset ratio threshold, the data corresponding to the row position and column position of the missing value in the device parameters are deleted to obtain the first correction parameter.

[0219] In a specific implementation, when missing values ​​are determined from the device parameters, the missing ratio of the missing values ​​in the device parameters is determined, and then it is judged whether there are too many missing values ​​in the device parameters according to the missing ratio.

[0220] When the missing value ratio is greater than or equal to a preset threshold, it indicates that there are too many missing values ​​in the device parameters. In this scenario, the excessive number of missing values ​​in the device parameters can lead to an inability to accurately determine whether the first optical inspection computer is in an idle state. Therefore, when the missing value ratio is greater than or equal to the preset threshold, the device parameters of the first optical inspection device are re-collected to avoid inaccurate determination of whether the first optical inspection computer is in an idle state.

[0221] When the missing value ratio is less than a preset threshold, it indicates that there are relatively few missing values ​​in the device parameters. In this scenario, the relatively few missing values ​​in the device parameters will not affect the determination of whether the first optical inspection computer is in an idle state. Therefore, when the missing value ratio is less than the preset threshold, to avoid the problem of being unable to quickly determine whether the first optical inspection computer is in an idle state due to re-collecting the device parameters, the data corresponding to the row and column positions of the missing values ​​in the device parameters are deleted to obtain the first corrected parameters.

[0222] The device parameters may be composed of device parameters collected at multiple timestamps. For example, the device parameters include: a first device parameter corresponding to a first timestamp, a second device parameter corresponding to a second timestamp, and a third device parameter corresponding to a third timestamp. The row position may indicate the data type of the missing value. For example, if the missing value is the first voltage in the first device parameter, the first voltage in the first device parameter, the second voltage in the second device parameter, and the third voltage in the third device parameter are deleted. The column position may indicate the timestamp (i.e., the data collection time). For example, if the missing value is the first voltage in the first device parameter, the first voltage, first current, and first temperature in the first device parameter are deleted.

[0223] For example, when the first voltage in the first device parameter is missing, the second current in the second device parameter is missing, and the third temperature in the third device parameter is missing, due to the excessive proportion of missing device parameters, it is impossible to accurately determine whether the first optical detection computer is in an idle state, and the device parameters of the first optical detection device are re-collected.

[0224] For another example, when only the second current in the second device parameter is missing, and since the missing proportion of the device parameters is relatively small and does not affect the determination of whether the first optical detection computer is in an idle state, the first current in the first device parameter, the second current in the second device parameter, and the third current in the third device parameter are deleted, thereby deleting the data at the row position of the missing value in the device parameters, and then determining whether the first optical detection computer is in an idle state using the voltage parameter and the temperature parameter. Alternatively, when only the second current in the second device parameter is missing, and since the missing proportion of the device parameters is relatively small and does not affect the determination of whether the first optical detection computer is in an idle state, the second device parameter corresponding to the second timestamp is deleted, thereby deleting the data at the column position of the missing value in the device parameters, and then determining whether the first optical detection computer is in an idle state using the first and second device parameters.

[0225] With the above solution, when the missing value ratio in the device parameters is greater than or equal to a preset ratio threshold, the device parameters of the first optical inspection device are re-collected, thereby avoiding the inability to accurately determine whether the first optical inspection computer is in an idle state due to excessive missing values ​​in the device parameters. When the missing value ratio is less than the preset ratio threshold, the data corresponding to the row and column positions of the missing values ​​in the device parameters are deleted to obtain first corrected parameters, eliminating the need to re-collect the device parameters. This avoids the time wasted in re-collecting the device parameters while still maintaining the ability to determine whether the first optical inspection computer is in an idle state, thereby enabling accurate and rapid determination of whether the first optical inspection computer is in an idle state.

[0226] In some embodiments, step 10542 includes:

[0227] Step 10542A, determining the maximum parameter and the minimum parameter from the first correction parameters.

[0228] Step 10542B: Using a standardization algorithm, standardize each parameter in the first correction parameter according to the maximum parameter and the minimum parameter to obtain a standard parameter.

[0229] Step 10542C: In response to determining that the standard parameter is not within the preset range, the parameter corresponding to the standard parameter is regarded as an abnormal value.

[0230] Step 10542D: Delete or correct the abnormal value in the first correction parameter to obtain the second correction parameter.

[0231] In specific implementation, the maximum parameter X of each column of data is determined from the first corrected data. max and the minimum parameter X min The Min-Max Scaling algorithm in the statistical algorithm is used to detect outliers from the first correction parameter.

[0232] Specifically, each parameter in the first correction parameter is normalized by the minimum-maximum normalization algorithm to obtain a standard parameter.

[0233]

[0234] Among them, X new is the standard parameter, X is the first correction parameter, X max is the maximum parameter, X min is the minimum parameter.

[0235] The preset range may be [0, 1]. It is determined whether the standard parameter is within the preset range [0, 1]. If the standard parameter is within the preset range [0, 1], the parameter corresponding to the standard parameter is determined to be a normal value. If the standard parameter is not within the preset range [0, 1], the parameter corresponding to the standard parameter is considered an abnormal value.

[0236] Determine whether the outlier is a data entry error. If the outlier is a data entry error, indicating that the outlier is not the parameter itself, then delete the outlier from the first correction parameter and modify the corresponding parameter to the correct data to obtain the second correction parameter. If the outlier is not a data entry error, indicating that the outlier is the parameter itself, then modify the first correction parameter to obtain the second correction parameter and mark the outlier in the first correction parameter.

[0237] Through the above scheme, each parameter in the first correction parameter is standardized by a standardization algorithm to obtain a standard parameter. When the standard parameter is not within the preset range, the parameter corresponding to the standard parameter can be accurately determined to be an abnormal value. When the abnormal value is a data entry error, the abnormal value in the first correction parameter is deleted, and the parameter at the corresponding position is modified to the correct data to obtain the second correction parameter. In this way, there is no abnormal value in the second correction parameter, making the second correction parameter more accurate. When the abnormal value is an abnormality in the parameter itself, the first correction parameter is corrected to obtain the second correction parameter, and the abnormal value in the first correction parameter is marked. In this way, when the second correction parameter still has an abnormality, the marked abnormal value can be quickly and promptly determined and corrected.

[0238] In some embodiments, it further includes:

[0239] Step 107: In response to satisfying the upload condition, uploading the defect file to the server.

[0240] Step 108: In response to determining that the defect file upload fails, generating a failed task and uploading the failed task to the blockchain, so that the blockchain reschedules the failed task;

[0241] In which, the blockchain uses an exponential backoff algorithm based on the smart contract to determine the retransmission interval of the failed task.

[0242] In specific implementation, when the upload conditions are met, the defective file is uploaded to the server. If the defective file fails to upload, a failure task is generated and uploaded to each blockchain node in the blockchain. The blockchain node records the failed task in the blockchain network.

[0243] Blockchain nodes regularly check the failed task queue in the blockchain network, attempt to reschedule, and upload failed tasks to the server. Blockchain smart contracts use an exponential backoff algorithm to determine the retransmission interval to avoid network congestion caused by frequent retransmissions.

[0244] For example, when the blockchain reschedules a failed task, the first retransmission interval is 1 minute, the second retransmission interval is 2 minutes, the third retransmission interval is 4 minutes, the fourth retransmission interval is 8 minutes, and so on.

[0245] With this solution, when a defective file fails to be uploaded to the server, the failed task is stored directly on the blockchain network rather than on local disk, saving disk space and reducing disk I / O pressure. This ensures that the uploaded task is not lost even if the optical inspection computer is restarted. Leveraging the distributed nature of blockchain, uploaded tasks are backed up across multiple blockchain nodes, improving data reliability and resilience. The blockchain's smart contract automatically triggers a retransmission mechanism, periodically checking for failed tasks and attempting to re-upload them. All uploaded task status changes are recorded on the blockchain, enhancing system transparency and traceability.

[0246] In some embodiments, the blockchain performs task scheduling based on the upload task, including:

[0247] Step 106A: assign a priority to the upload task.

[0248] Step 106B: adopting a polling algorithm and a priority scheduling algorithm to determine the upload order and the upload time required for the upload task.

[0249] Step 106C: In response to determining that the number of optical inspection computers in the blockchain that are currently uploading defect files is less than a preset ratio of the total number of optical inspection computers in the blockchain, determine a time window for the first optical inspection computer based on the time required for the upload.

[0250] Step 106D: Send an upload instruction to the first optical inspection computer according to the upload sequence within the time window, so as to control the first optical inspection computer to upload the defect file to the server within the time window.

[0251] In practice, upload tasks are sent to various blockchain nodes in the blockchain network. Optical computers are used to detect whether the computer is idle and continuously update the upload tasks to each blockchain node. The blockchain nodes assign a priority to each upload task based on its urgency and importance.

[0252] A polling algorithm and priority scheduling method are used to determine the upload order and required upload time for upload tasks. The blockchain's smart contract checks the number of optical inspection computers currently uploading defect files. If the number of optical inspection computers currently uploading defect files in the blockchain does not reach a preset ratio of the total number of optical inspection computers in the blockchain, upload permission is granted, allowing idle optical inspection computers to upload the upload task to the server. Based on the required upload time, a time window is determined for the first optical inspection computer. Within this time window, an upload instruction is sent to the first optical inspection computer according to the upload order.

[0253] A priority scheduling algorithm is used to determine the priority of each upload task, and a round-robin algorithm is used to prioritize all upload tasks, determining the upload order and required upload time for each task. For example, the upload tasks include the first, second, and third tasks. Based on the pre-set defect priority, the defect severity of each upload task is determined. If the first task has a moderate defect severity, the second task has a severe defect severity, and the third task has a mild defect severity, the upload order is determined to be the second task, the first task, and the third task, in that order. The upload time for each upload task is determined to be 5 seconds.

[0254] For example, the preset ratio value can be one-tenth. If the number of optical inspection computers currently uploading defect files in the blockchain is less than one-tenth of the total number of optical inspection computers in the blockchain, it takes 3 seconds for the first optical inspection computer to upload the upload task to the blockchain, and it takes 5 seconds for the first optical inspection computer to upload the upload task to the server, then the time window for the first optical inspection computer is determined to be 8 seconds. Within the 8-second time window, an upload instruction is sent to the first optical inspection computer according to the upload order. In this way, the first optical inspection computer can upload the defect file to the server within the time window. By setting the time window, it is possible to prevent the first optical inspection computer from performing other operations after uploading the upload task to the blockchain, thereby avoiding the situation where the first optical inspection computer is unable to upload the upload task to the server due to performing other operations.

[0255] When uploading defect files to the server, the first optical inspection computer may upload the defect files to the server in batches according to the upload order. For example, if the upload tasks include the first task, the second task, the third task, and the fourth task, and the upload order is the fourth task, the second task, the first task, and the third task, then the fourth task and the second task will be uploaded to the server in the first batch, and the first task and the third task will be uploaded to the server in the second batch.

[0256] This solution manages upload permissions through smart contracts, preventing all optical inspection computers from uploading tasks simultaneously and reducing pressure on the transmission network and servers. The immutability of blockchain ensures the authenticity and consistency of uploaded tasks. The submission, scheduling, and upload process of all upload tasks is recorded on the blockchain, enhancing system transparency and traceability. Blockchain's encryption technology and distributed storage enhance data security and privacy.

[0257] Through the above embodiment, at least one production picture collected by the first optical inspection device is received. When a defect is detected from at least one production picture, at least one defect picture is determined from the at least one production picture. A defect file is determined based on the at least one defect picture, and the determined defect file contains defect information and picture information, so that the obtained defect file is more comprehensive. An upload task is generated based on the defect file so that the upload task can be subsequently uploaded to the blockchain. It is determined whether the first optical inspection computer is in an idle state based on the device parameters of the first optical inspection device. When the first optical inspection computer is in an idle state, the upload task is uploaded to the blockchain so that the blockchain performs task scheduling based on the upload task to control the first optical inspection computer to upload the defect file to the server. In this way, it can be ensured that the upload task is uploaded to the blockchain when the first optical inspection computer is in an idle state, and the situation where all optical inspection computers upload at the same time will not occur, thereby avoiding increasing the transmission pressure of the optical inspection computer and the situation where the transmission network is under high pressure.

[0258] The embodiments of the present disclosure have the following technical effects:

[0259] 1. Voltage sensors, current sensors, and temperature sensors are installed on the optical inspection equipment to collect equipment parameters. Based on the voltage, current, and temperature values ​​when the optical inspection equipment is working and idle, it can be comprehensively analyzed whether the optical inspection equipment is in an idle state or a busy state. The upload task is performed when the optical inspection equipment is in an idle state to avoid increasing the system pressure on the optical inspection computer.

[0260] 2. Build a blockchain network based on optical inspection computers. All optical inspection computers serve as blockchain nodes and publish the collected voltage parameters, current parameters, and temperature parameters to the blockchain for cleaning and analysis, which improves data security and privacy protection. Since there is no need to send device parameters to the cloud server, it has lower latency and higher performance, while reducing the pressure on the cloud server and the network pressure during transmission with the cloud server.

[0261] 3. The optical inspection computer publishes the upload task to the blockchain network. The blockchain node performs intelligent analysis and performs peak upload processing to ensure that all optical inspection computers do not upload at the same time, reducing the pressure on the server and the server network.

[0262] 4. The optical inspection computer publishes the failed upload tasks to the blockchain network. The blockchain node performs retry logic processing. The failed tasks do not need to be saved locally, reducing the pressure on local disk IO. The failed tasks will not be lost, which is safer and more reliable.

[0263] It should be noted that the method of the embodiments of the present disclosure can be performed by a single device, such as a computer or server. The method of the embodiments of the present disclosure can also be applied in a distributed scenario, where multiple devices cooperate to perform the method. In such a distributed scenario, one of the multiple devices may only perform one or more steps of the method of the embodiments of the present disclosure, and the multiple devices will interact with each other to complete the method.

[0264] It should be noted that the above description is limited to some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in an order different from that described in the above embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0265] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure further provides an optical detection computer, wherein the optical detection computer is electrically coupled to the optical detection device and is used to establish a blockchain;

[0266] In which, the optical detection computer executes the corresponding blockchain-based data collection method in any of the aforementioned embodiments.

[0267] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure further provides a blockchain-based data collection method, which is applied to an optical inspection device; the optical inspection device is electrically coupled to the optical inspection computer described in the above-mentioned embodiments; the method comprises:

[0268] Step 201: Collect at least one production picture, and send the at least one production picture to the optical detection computer, so that the optical detection computer detects at least one defect picture from the at least one production picture.

[0269] In specific implementation, the first optical inspection device is used to collect at least one production picture during the factory production process, and send the at least one production picture to the first optical inspection computer, so that the optical inspection computer detects at least one defect picture from the at least one production picture.

[0270] There can be at least one first optical inspection computer electrically coupled to the first optical inspection device. Specifically, when there is one first optical inspection computer, the first optical inspection device sends at least one collected production image to the first optical inspection computer. When there are multiple first optical inspection computers, the first optical inspection device randomly distributes the at least one collected production image to the multiple first optical inspection computers. For example, if the first optical inspection computers include optical inspection computer A and optical inspection computer B, and the first optical inspection device collects 10 production images, it randomly distributes the first 6 production images to optical inspection computer A and the remaining 4 production images to optical inspection computer B.

[0271] Through the above embodiment, at least one production picture collected by the first optical inspection device is received. When a defect is detected from at least one production picture, at least one defect picture is determined from the at least one production picture. A defect file is determined based on the at least one defect picture, and the determined defect file contains defect information and picture information, so that the obtained defect file is more comprehensive. An upload task is generated based on the defect file so that the upload task can be subsequently uploaded to the blockchain. It is determined whether the first optical inspection computer is in an idle state based on the device parameters of the first optical inspection device. When the first optical inspection computer is in an idle state, the upload task is uploaded to the blockchain so that the blockchain performs task scheduling based on the upload task to control the first optical inspection computer to upload the defect file to the server. In this way, it can be ensured that the upload task is uploaded to the blockchain when the first optical inspection computer is in an idle state, and the situation where all optical inspection computers upload at the same time will not occur, thereby avoiding increasing the transmission pressure of the optical inspection computer and the situation where the transmission network is under high pressure.

[0272] It should be noted that the method of the embodiments of the present disclosure can be performed by a single device, such as a computer or server. The method of the embodiments of the present disclosure can also be applied in a distributed scenario, where multiple devices cooperate to perform the method. In such a distributed scenario, one of the multiple devices may only perform one or more steps of the method of the embodiments of the present disclosure, and the multiple devices will interact with each other to complete the method.

[0273] It should be noted that the above description is limited to some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in an order different from that described in the above embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0274] Based on the same inventive concept, corresponding to any of the above embodiments and methods, the present disclosure further provides an optical detection device, comprising: the optical detection device is electrically coupled to the optical detection computer described in the above embodiments;

[0275] In which, the optical detection equipment executes the blockchain-based data collection method described in the aforementioned embodiment.

[0276] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the blockchain-based data collection method described in any of the above embodiments is implemented.

[0277] Figure 4 10 is a schematic diagram showing a more specific hardware structure of an electronic device provided in this embodiment. The device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are communicatively connected to each other within the device via the bus 1050.

[0278] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0279] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage devices, dynamic storage devices, etc. The memory 1020 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.

[0280] The input / output interface 1030 is used to connect input / output modules to implement information input and output. The input / output modules can be configured as components within the device (not shown in the figure) or can be externally connected to the device to provide corresponding functions. Input devices may include a keyboard, mouse, touch screen, microphone, various sensors, etc., and output devices may include a display, speaker, vibrator, indicator light, etc.

[0281] The communication interface 1040 is used to connect to a communication module (not shown) to enable communication between the device and other devices. The communication module can communicate via a wired method (e.g., USB (Universal Serial Bus), network cable, etc.) or a wireless method (e.g., mobile network, WIFI (Wireless Fidelity), Bluetooth, etc.).

[0282] The bus 1050 comprises a path for transmitting information between the various components of the device (eg, the processor 1010 , the memory 1020 , the input / output interface 1030 , and the communication interface 1040 ).

[0283] It should be noted that although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in a specific implementation, the device may also include other components necessary for normal operation. In addition, it will be understood by those skilled in the art that the above device may only include the components necessary to implement the embodiments of this specification, and does not necessarily include all the components shown in the figure.

[0284] The electronic device of the above embodiment is used to implement the corresponding blockchain-based data collection method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0285] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the blockchain-based data collection method as described in any of the above embodiments.

[0286] The computer-readable media of this embodiment include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0287] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the blockchain-based data collection method as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0288] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a computer program product, including computer program instructions. When the computer program instructions are run on a computer, the computer executes the blockchain-based data collection method as described in any of the above embodiments, which has the beneficial effects of the corresponding method embodiments and will not be repeated here.

[0289] It is understandable that before using the technical solutions of each embodiment of the present disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved will be informed to the user in an appropriate manner, and the user's authorization will be obtained.

[0290] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operation of the disclosed technical solution based on the prompt message.

[0291] As an optional but non-limiting implementation, in response to a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.

[0292] It is understandable that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0293] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure is limited to these examples. Based on the concept of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of simplicity.

[0294] In addition, to simplify the description and discussion, and so as not to obscure the embodiments of the present disclosure, known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, devices may be shown in the form of block diagrams to avoid obscuring the embodiments of the present disclosure, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure are to be implemented (i.e., these details should be fully within the purview of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it will be apparent to those skilled in the art that the embodiments of the present disclosure may be implemented without these specific details or with variations in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0295] Although the present disclosure has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those skilled in the art based on the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0296] The embodiments of the present disclosure are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the present disclosure. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present disclosure should be included in the scope of protection of the present disclosure.

Claims

1. A data collection method based on blockchain, characterized in that: Applied to a first optical detection computer, the first optical detection computer is electrically coupled to a first optical detection device and is used to establish a blockchain; the method includes: receiving at least one production picture collected by the first optical inspection device; In response to detecting a defect from the at least one production image, determining at least one defective image from the at least one production image; Determining a defect file based on the at least one defect image, and generating an upload task based on the defect file; collecting equipment parameters of the first optical detection equipment; determining whether the first optical inspection computer is in an idle state according to the device parameters of the first optical inspection device; In response to determining that the first optical inspection computer is in an idle state, the upload task is uploaded to the blockchain, so that the blockchain performs task scheduling based on the upload task to control the first optical inspection computer to upload the defect file to the server.

2. The method according to claim 1, characterized in that Also includes: In response to receiving a broadcast message indicating that a target optical inspection computer has joined the blockchain, parsing the broadcast message to obtain a network address and port number of the target optical inspection computer; The network address and the port number are recorded in the node list of the blockchain, so that the target optical detection computer is added to the blockchain as a blockchain node.

3. The method according to claim 2, characterized in that Also includes: Determining a data synchronization method for the blockchain; In response to determining that the data synchronization mode is a periodic synchronization mode, requesting the latest data from other optical detection computers in the node list after a preset time interval; In response to determining that the data synchronization mode is the update synchronization mode, an update notification is sent to other optical inspection computers after updating the data, so that the other optical inspection computers request the first optical inspection computer to update the data after receiving the update notification.

4. The method according to claim 1, wherein The determining of the defective file based on the at least one defective image includes: Counting the at least one defective image detected; In response to determining that the number of defective images remains unchanged within a preset time period, determining whether the size of the latest defective image continues to increase; In response to the size of the latest defective image remaining unchanged within a preset time period, the defective file is determined based on all detected defective images.

5. The method according to claim 1, wherein The determining whether the first optical inspection computer is in an idle state according to the device parameters of the first optical inspection device includes: comparing the device parameters with parameter thresholds; In response to determining that the device parameter is less than the parameter threshold, the first optical inspection computer is determined to be in an idle state.

6. The method according to claim 5, characterized in that The first optical detection device includes a voltage sensor, a current sensor, and a temperature sensor, the device parameters include: a voltage parameter collected by the voltage sensor, a current parameter collected by the current sensor, and a temperature parameter collected by the temperature sensor, and the parameter thresholds include a voltage threshold, a current threshold, and a temperature threshold; In response to determining that the device parameter is less than the parameter threshold, determining that the first optical inspection computer is in an idle state includes: In response to determining that the voltage parameter is less than a voltage threshold, the current parameter is less than a current threshold, and the temperature parameter is less than a temperature threshold, it is determined that the first optical inspection computer is in an idle state.

7. The method according to claim 5, characterized in that Also includes: Determining a timestamp of a data acquisition moment and a device identification of the first optical detection device from the device parameters; Preprocessing the device parameters to obtain target parameters; Packing the timestamp, the device identifier, and the target parameter to obtain a data packet; A digital signature is added to the data packet and uploaded to the blockchain.

8. The method according to claim 7, characterized in that The preprocessing of the device parameters to obtain target parameters includes: In response to determining a missing value from the device parameter, performing correction processing on the device parameter to obtain a first correction parameter; Determining an abnormal value from the first correction parameter, and performing abnormality elimination processing on the abnormal value in the first correction parameter to obtain a second correction parameter; determining duplicate data from the second correction parameter according to the timestamp and the device identifier, and deleting the duplicate data from the second correction parameter to obtain a third correction parameter; Performing format conversion processing on the third correction parameter to obtain a target format parameter, and determining whether the target format data meets a preset format condition; In response to determining that the target format data meets the preset format condition, the target format data is used as the target parameter.

9. The method according to claim 8, characterized in that In response to determining the missing value from the device parameter, performing correction processing on the device parameter to obtain a first correction parameter includes: In response to determining a missing value from the device parameters, determining a row position and a column position of the missing value in the device parameters; Determining a missing ratio of the missing values ​​in the device parameters, and comparing the missing ratio with a preset ratio threshold; In response to determining that the missing ratio is greater than or equal to a preset ratio threshold, re-collecting device parameters of the first optical detection device; In response to determining that the missing ratio is less than a preset ratio threshold, data corresponding to the row position and the column position of the missing value in the device parameters are deleted to obtain the first correction parameter.

10. The method according to claim 8, characterized in that The determining of the abnormal value from the first correction parameter and performing abnormality elimination processing on the abnormal value in the first correction parameter to obtain the second correction parameter includes: determining a maximum parameter and a minimum parameter from the first correction parameters; By using a standardization algorithm, each parameter in the first correction parameter is standardized according to the maximum parameter and the minimum parameter to obtain a standard parameter; In response to determining that the standard parameter is not within a preset range, treating a parameter corresponding to the standard parameter as an abnormal value; Abnormal values ​​in the first correction parameters are deleted or corrected to obtain the second correction parameters.

11. The method according to claim 1, wherein Also includes: In response to satisfying an upload condition, uploading the defect file to the server; In response to determining that the defect file fails to be uploaded, generating a failed task and uploading the failed task to the blockchain, so that the blockchain reschedules the failed task; In which, the blockchain uses an exponential backoff algorithm based on the smart contract to determine the retransmission interval of the failed task.

12. The method according to claim 1, characterized in that The blockchain performs task scheduling based on the uploaded task, including: assigning a priority to the upload task; Using a polling algorithm and a priority scheduling algorithm to determine the upload order and upload time required for the upload task; In response to determining that the number of optical inspection computers currently uploading defect files in the blockchain is less than a preset ratio of the total number of optical inspection computers in the blockchain, determining a time window for the first optical inspection computer based on a time required for the upload; An upload instruction is sent to the first optical inspection computer according to the upload sequence within the time window, so as to control the first optical inspection computer to upload the defect file to the server within the time window.

13. An optical detection computer, characterized in that: The optical detection computer is electrically coupled to the optical detection device and is used to form a blockchain; Wherein, the optical detection computer executes the method according to any one of claims 1 to 12.

14. A data collection method based on blockchain, characterized in that: Used in optical inspection equipment; The optical inspection device is electrically coupled to the optical inspection computer according to claim 13; the method comprising: At least one production picture is collected, and the at least one production picture is sent to the optical detection computer, so that the optical detection computer detects at least one defective picture from the at least one production picture.

15. An optical detection device, characterized in that: include: The optical inspection device is electrically coupled to the optical inspection computer according to claim 13; Wherein, the optical detection device performs the method of claim 14.

16. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 12 or claim 14 is implemented.

17. A non-transitory computer-readable storage medium, characterized in that The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to cause a computer to execute the method of any one of claims 1 to 12 or claim 14.

18. A computer program product comprising computer program instructions, characterized in that When the computer program instructions are executed on a computer, the computer is caused to perform the method according to any one of claims 1 to 12 or claim 14.