METHOD FOR CONTROLLING STATION-PASSING OF YARN SPINDLE, ELECTRONIC DEVICE AND STORAGE MEDIUM

Abstract

Provided are a method for controlling automatic station-passing of a yarn spindle, an electronic device and a storage medium, relating to the technical field of chemical fiber intelligent manufacturing. A system for controlling automatic station-passing of the yarn spindle includes an MES, a first PLC and second PLCs. The method for controlling automatic station-passing of the yarn spindle includes: synchronizing offline data to the MES if it is detected that an offline cache area stores the offline data, responsive to determining that the control button of the first PLC is switched from the offline mode to the online mode and the communication between the first PLC and the MES is restored, where the offline data is a station-passing record which is stored when the first PLC and the MES are disconnected and which needs to be synchronized to the MES.

Claims

1. A method for controlling automatic station-passing of a yarn spindle, applied to a system for controlling automatic station-passing of the yarn spindle, characterized in that the system for controlling automatic station-passing of the yarn spindle comprises: a Manufacturing Execution System (MES), a first Programmable Logic Controller (PLC), and a plurality of second PLCs, wherein one of the plurality of second PLCs is responsible for controlling at least one station; the plurality of second PLCs are connected to the first PLC, and the first PLC is connected to the MES; wherein the method for controlling automatic station-passing of the yarn spindle comprises: monitoring whether a control button of the first PLC is switched from an offline mode to an online mode and whether communication between the first PLC and the MES is restored; and synchronizing offline data to the MES if it is detected that an offline cache area stores the offline data, responsive to determining that the control button of the first PLC is switched from the offline mode to the online mode and the communication between the first PLC and the MES is restored, wherein the offline data is a station-passing record which is stored when the first PLC and the MES are disconnected and which needs to be synchronized to the MES.

2. The method of claim 1, wherein the synchronizing of the offline data to the MES comprises: after the system is started, continuously checking whether the first PLC is in an online mode and has started an offline station-passing record synchronization function; checking whether the offline cache area has queues to be processed if the conditions are met; ensuring that relevant data bits and control bits of an offline control area are in an initial status, or otherwise, carrying out a reset operation; transmitting the first queue data of the offline cache area to the offline control area, and setting the control bits to indicate the second PLC to start processing the station-passing; triggering, by the control bits, the first PLC to send a request to the MES and awaiting a response from the MES; verifying a format of data returned from the MES, parsing the data to a operational data area of the offline control area if correct, and checking whether a response result is valid and has no error; according to the response result, performing error handling or updating the control bits to indicate that the data processing is completed; and performing queue shift on the offline cache area, and resetting the relevant control bits of the offline control area and the operational data area to prepare for the next round of synchronization.

3. The method of claim 1, wherein before synchronizing the offline data to the MES, the method further comprises: obtaining, by the first PLC, second operational data of a target station from a second PLC corresponding to the target station, and obtaining first operational data of the target station according to the second operational data; and recording, by the first PLC, the first operational data responsive to determining that the first PLC and the MES are disconnected, and sending station-passing indication information to the second PLC so that the second PLC controls the target station to execute a yarn spindle station-passing task based on the station-passing indication information, wherein the station-passing indication information is permission for station-passing.

4. The method of claim 1, wherein the method for controlling automatic station-passing of the yarn spindle further comprises: determining that the first PLC is disconnected from the MES when the first PLC detects that the control button corresponding to the first PLC rotates to the offline mode.

5. The method of claim 1, wherein the method for controlling automatic station-passing of the yarn spindle further comprises: determining that the first PLC is disconnected from the MES when the first PLC detects that the communication between the first PLC and the MES is interrupted.

6. The method of claim 4, wherein the method for controlling automatic station-passing of the yarn spindle further comprises: not performing, by the MES, judgment processing for an online station-passing condition responsive to determining that the MES is disconnected from the first PLC.

7. The method of claim 6, wherein the judgment processing for the online station-passing condition comprises: judging whether the yarn spindle at the target station meets the station-passing condition based on target character string data corresponding to the target station; if the station-passing condition is met, determining that the station-passing indication information is permission for station-passing; or if the station-passing condition is not met, determining that the station-passing indication information is prohibition for station-passing, wherein the target character string data are obtained by parsing first operational data through the MES.

8. The method of claim 1, wherein the method for controlling automatic station-passing of the yarn spindle further comprises: allocating, by the first PLC, a plurality of offline cache areas and an offline control area for all target stations, wherein the plurality of offline cache areas are shared by all the target stations, and the offline control area includes relevant data bits and relevant control bits used for synchronizing the offline data to the MES.

9. An electronic device, applied to a system for controlling automatic station-passing of the yarn spindle, characterized in that the system for controlling automatic station-passing of the yarn spindle comprises: a Manufacturing Execution System (MES), a first Programmable Logic Controller (PLC), and a plurality of second PLCs, wherein one of the plurality of second PLCs is responsible for controlling at least one station; the plurality of second PLCs are connected to the first PLC, and the first PLC is connected to the MES; wherein the electronic device comprises: at least one processor; and a memory connected in communication with the at least one processor; wherein the memory stores an instruction executable by the at least one processor, and the instruction, when executed by the at least one processor, enables the at least one processor to execute: monitoring whether a control button of the first PLC is switched from an offline mode to an online mode and whether communication between the first PLC and the MES is restored; and synchronizing offline data to the MES if it is detected that an offline cache area stores the offline data, responsive to determining that the control button of the first PLC is switched from the offline mode to the online mode and the communication between the first PLC and the MES is restored, wherein the offline data is a station-passing record which is stored when the first PLC and the MES are disconnected and which needs to be synchronized to the MES.

10. The electronic device of claim 9, wherein the instruction, when executed by the at least one processor, enables the at least one processor to execute the synchronizing of the offline data to the MES by: after the system is started, continuously checking whether the first PLC is in an online mode and has started an offline station-passing record synchronization function; checking whether the offline cache area has queues to be processed if the conditions are met; ensuring that relevant data bits and control bits of an offline control area are in an initial status, or otherwise, carrying out a reset operation; transmitting the first queue data of the offline cache area to the offline control area, and setting the control bits to indicate the second PLC to start processing the station-passing; triggering, by the control bits, the first PLC to send a request to the MES and awaiting a response from the MES; verifying a format of data returned from the MES, parsing the data to a operational data area of the offline control area if correct, and checking whether a response result is valid and has no error; according to the response result, performing error handling or updating the control bits to indicate that the data processing is completed; and performing queue shift on the offline cache area, and resetting the relevant control bits of the offline control area and the operational data area to prepare for the next round of synchronization.

11. The electronic device of claim 9, wherein before synchronizing the offline data to the MES, the instruction, when executed by the at least one processor, enables the at least one processor to further execute: obtaining, by the first PLC, second operational data of a target station from a second PLC corresponding to the target station, and obtaining first operational data of the target station according to the second operational data; and recording, by the first PLC, the first operational data responsive to determining that the first PLC and the MES are disconnected, and sending station-passing indication information to the second PLC so that the second PLC controls the target station to execute a yarn spindle station-passing task based on the station-passing indication information, wherein the station-passing indication information is permission for station-passing.

12. The electronic device of claim 9, wherein the instruction, when executed by the at least one processor, enables the at least one processor to further execute: determining that the first PLC is disconnected from the MES when the first PLC detects that the control button corresponding to the first PLC rotates to the offline mode.

13. The electronic device of claim 9, wherein the instruction, when executed by the at least one processor, enables the at least one processor to further execute: determining that the first PLC is disconnected from the MES when the first PLC detects that the communication between the first PLC and the MES is interrupted.

14. The electronic device of claim 12, wherein the instruction, when executed by the at least one processor, enables the at least one processor to further execute: not performing, by the MES, judgment processing for an online station-passing condition responsive to determining that the MES is disconnected from the first PLC.

15. A non-transitory computer-readable storage medium storing a computer instruction thereon, applied to a system for controlling automatic station-passing of the yarn spindle, characterized in that the system for controlling automatic station-passing of the yarn spindle comprises: a Manufacturing Execution System (MES), a first Programmable Logic Controller (PLC), and a plurality of second PLCs, wherein one of the plurality of second PLCs is responsible for controlling at least one station; the plurality of second PLCs are connected to the first PLC, and the first PLC is connected to the MES; wherein the computer instruction is used to cause a computer to execute: monitoring whether a control button of the first PLC is switched from an offline mode to an online mode and whether communication between the first PLC and the MES is restored; and synchronizing offline data to the MES if it is detected that an offline cache area stores the offline data, responsive to determining that the control button of the first PLC is switched from the offline mode to the online mode and the communication between the first PLC and the MES is restored, wherein the offline data is a station-passing record which is stored when the first PLC and the MES are disconnected and which needs to be synchronized to the MES.

16. The non-transitory computer-readable storage medium of claim 15, wherein the computer instruction is used to cause the computer to execute the synchronizing of the offline data to the MES by: after the system is started, continuously checking whether the first PLC is in an online mode and has started an offline station-passing record synchronization function; checking whether the offline cache area has queues to be processed if the conditions are met; ensuring that relevant data bits and control bits of an offline control area are in an initial status, or otherwise, carrying out a reset operation; transmitting the first queue data of the offline cache area to the offline control area, and setting the control bits to indicate the second PLC to start processing the station-passing; triggering, by the control bits, the first PLC to send a request to the MES and awaiting a response from the MES; verifying a format of data returned from the MES, parsing the data to a operational data area of the offline control area if correct, and checking whether a response result is valid and has no error; according to the response result, performing error handling or updating the control bits to indicate that the data processing is completed; and performing queue shift on the offline cache area, and resetting the relevant control bits of the offline control area and the operational data area to prepare for the next round of synchronization.

17. The non-transitory computer-readable storage medium of claim 15, wherein before synchronizing the offline data to the MES, the computer instruction is used to cause the computer to execute: obtaining, by the first PLC, second operational data of a target station from a second PLC corresponding to the target station, and obtaining first operational data of the target station according to the second operational data; and recording, by the first PLC, the first operational data responsive to determining that the first PLC and the MES are disconnected, and sending station-passing indication information to the second PLC so that the second PLC controls the target station to execute a yarn spindle station-passing task based on the station-passing indication information, wherein the station-passing indication information is permission for station-passing.

18. The non-transitory computer-readable storage medium of claim 15, wherein the computer instruction is used to cause the computer to further execute: determining that the first PLC is disconnected from the MES when the first PLC detects that the control button corresponding to the first PLC rotates to the offline mode.

19. The non-transitory computer-readable storage medium of claim 15, wherein the computer instruction is used to cause the computer to further execute: determining that the first PLC is disconnected from the MES when the first PLC detects that the communication between the first PLC and the MES is interrupted.

20. The non-transitory computer-readable storage medium of claim 19, wherein the computer instruction is used to cause the computer to further execute: not performing, by the MES, judgment processing for an online station-passing condition responsive to determining that the MES is disconnected from the first PLC.

Description

BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The above and other features, advantages and aspects of embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the drawings, like or similar reference characters designate like or similar elements, in which:

[0019] FIG. 1 is a structural diagram schematically illustrating a system for controlling automatic station-passing of a yarn spindle according to an embodiment of the present disclosure;

[0020] FIG. 2 is a flowchart schematically illustrating a method for controlling automatic station-passing of a yarn spindle according to an embodiment of the present disclosure;

[0021] FIG. 3 is another flowchart schematically illustrating a method for controlling automatic station-passing of a yarn spindle according to an embodiment of the present disclosure;

[0022] FIG. 4 is a flowchart schematically illustrating a process of a first PLC uploading an offline station-passing record to an MES according to an embodiment of the disclosure;

[0023] FIG. 5 is a structural block diagram schematically illustrating an apparatus for controlling automatic station-passing of a yarn spindle according to an embodiment of the present disclosure; and

[0024] FIG. 6 is a block diagram schematically illustrating an electronic device for implementing the method for controlling automatic station-passing of the yarn spindle according to the embodiment of the present disclosure.

DETAILED DESCRIPTION

[0025] Exemplary embodiments of the present disclosure will be described below with reference to the accompanying drawings, in which various details of the embodiments of the present disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, an ordinary person skilled in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the disclosure. Also, descriptions of well-known functions and structures are omitted in the following description for clarity and conciseness.

[0026] The terms first, second and third in the embodiments and claims of the description of the present disclosure and the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. Furthermore, the terms comprise and have as well as any variations thereof are intended to cover a non-exclusive inclusion, such that a list of steps or elements is included. The method, system, product or apparatus need not be limited to the explicitly listed steps or elements, but may include other steps or elements not expressly listed or inherent to the process, method, product or apparatus.

[0027] Before the technical solutions of the embodiments of the present disclosure are introduced, technical terms that may be used in the present disclosure will be further described: [0028] MES: a software system for monitoring and managing a manufacturing process that enables real-time collection, processing and analysis of production data and optimization of production planning and resource allocation. [0029] PLC: an industrial digital computer used for controlling automatic equipment, such as mechanical devices and robots on a production line, which can carry out logic operation and processing on an input signal according to a preset program and output a control signal to control the operation of equipment.

[0030] Operational data: operation-related data generated during the manufacturing process, such as device status, product quantity, production schedule, which are basis for decision making and control by the MES and PLC.

[0031] Station-passing indication information (also called station-passing instruction): instruction and parameter information generated by the MES with the analysis of the operational data for guiding equipment to execute a station-passing task.

[0032] FIG. 1 is a diagram schematically illustrating a system for controlling automatic station-passing of a yarn spindle. As shown in FIG. 1, the system for controlling automatic station-passing of the yarn spindle includes an MES, a first PLC and a plurality of second PLCs, where the plurality of second PLCs are connected to the first PLC, the first PLC is connected to the MES, and one of the plurality of second PLCs is responsible for controlling at least one station. The second PLC is mainly responsible for collecting and processing real-time operational data of a target station and providing the real-time operational data to the first PLC for use. The first PLC is responsible for interacting with the second PLC and acquiring second operational data from the second PLC; the first PLC is also responsible for interacting with the MES, sending first operational data to the MES, receiving the station-passing indication information issued from the MES based on the first operational data, and further informing the second PLC of executing the station-passing indication information for the target station.

[0033] In some implementations, the MES is configured to determine the station-passing indication information for the target station based on the first operational data sent from the first PLC and return the station-passing indication information to the first PLC.

[0034] In some implementations, the first PLC is configured to obtain the first operational data for the target station according to second operational data for the target station obtained from the second PLC.

[0035] In some implementations, the second PLC is configured to obtain and store the second operational data of the target station managed and controlled by the second PLC.

[0036] Here, the first operational data is a data set, collected and processed by the first PLC, including information on the real-time status of the target station, the processing progress of the yarn spindle, the quality check result of the yarn spindle, the request type, for example, which is. The data is of significant importance for monitoring the operational status of the production line and making a decision as to whether to allow the yarn spindle to pass through the station.

[0037] Here, the second operational data is a data set, collected and processed by the second PLC, including information on the real-time status of the target station, the processing progress of the yarn spindle, the quality check result of the yarn spindle, the bar code of the yarn spindle. The data is of significant importance for monitoring the operational status of the production line.

[0038] According to the system for controlling automatic station-passing of the yarn spindle, the MES, the first PLC and the second PLC are communicated in real time and process data, so that the MES can monitor the status of stations in real time to make adjustment and optimization as required. Through the automatic control, manual intervention is reduced and the efficiency and the accuracy of the station-passing of the yarn spindle are improved; the material waste and the downtime caused by human errors are reduced, and the cost of the production is reduced. Through the automatic control, the stability and the consistency of the e yarn spindle in the process of passing the station are ensured, and the pace and the efficiency of the whole production are favorably improved. By using first PLC as an intermediate layer of the MES and the second PLCs, the system for controlling automatic station-passing of the yarn spindle has remarkable advantages in aspects of centralized management, data integration, MES burden lightening, system expandability enhancement, safety and stability improvement, network structure simplification and the like.

[0039] If the MES communicates directly with the plurality of second PLCs, the MES will need to process a large amount of real-time data and requests, which can burden the MES and affect its performance. By using the first PLC as an intermediate layer, the MES only needs to communicate with the first PLC, thereby reducing the processing load of the MES. Without the first PLC as an intermediate layer, the MES needs to establish a direct communication connection with each second PLC, which may result in complex and unmanageable network architecture. The network structure can be greatly simplified by transferring through the first PLC, so that the whole communication process becomes clearer and more orderly. The first PLC can act as a security barrier to verify and filter data from the second PLC to prevent malicious or erroneous data from entering the MES system. Meanwhile, the redundancy and fault-tolerant mechanism of the first PLC can improve the stability and reliability of the system, ensuring that the normal operation of the production line can be maintained when partial equipment fails.

[0040] As the production line expands and upgrades, more second PLCs may need to be added. If the MES communicates directly with each second PLC, corresponding configuration and modification of the MES will be required for each extension. By using the first PLC as the intermediate layer, only support for a new second PLC needs to be added in the first PLC, without modifying the MES configuration. The first PLC can receive the operational data from the second PLCs in a centralized manner and perform unified processing and analysis, thereby making the control of the entire production line more centralized and organized and reducing the complexity and the disorder of direct communication between the MES and the second PLCs. The first PLC can integrate data from the different second PLCs to form a more comprehensive production view, which enables the MES to make a decision based on the more comprehensive data to optimize production planning and resource allocation. Meanwhile, the first PLC can also preprocess and filter the data, thereby reducing the amount of data transmitted to the MES and improving the communication efficiency.

[0041] The embodiment of the disclosure provides a method for controlling automatic station-passing of a yarn spindle, and FIG. 2 is a flowchart schematically illustrating the method for controlling automatic station-passing of the yarn spindle according to an embodiment of the present disclosure. The method for controlling automatic station-passing of the yarn spindle can be applied to an apparatus for controlling automatic station-passing of the yarn spindle which is disposed on an electronic device applied to a system for controlling automatic station-passing of the yarn spindle. The electronic device includes, but is not limited to, a stationary device and/or a mobile device. For example, the stationary device includes, but is not limited to, a server, which may be a cloud server or a general server. For example, the mobile device includes, but is not limited to, a mobile phone, a tablet computer, a notebook a computer. In some possible implementations, the method for controlling automatic station-passing of the yarn spindle can also be realized by invoking a computer readable instruction stored in a memory through a processor. As shown in FIG. 2, the method for controlling automatic station-passing of the yarn spindle includes steps of: [0042] S201: monitoring whether a control button of the first PLC is switched from an offline mode to an online mode and whether communication between the first PLC and the MES is restored; and [0043] S202: synchronizing offline data to the MES if it is detected that an offline cache area stores the offline data, responsive to determining that the control button of the first PLC is switched from the offline mode to the online mode and the communication between the first PLC and the MES is restored, where the offline data is a station-passing record which is stored when the first PLC and the MES are disconnected and which needs to be synchronized to the MES.

[0044] In some implementations, monitoring the status of the control button of the first PLC includes: reading a status signal of the control button by an input module of the first PLC to judge whether the offline mode (usually represented by a specific input value, for example, =0) is switched to the online mode (another specific input value, for example, =1).

[0045] In some implementations, monitoring the communication status between the first PLC and the MES includes: using heartbeat detection or a specific instruction in a communication protocol to periodically detect whether a communication link between the first PLC and the MES is normal. The heartbeat detection typically involves the first PLC regularly sending a short signal to the MES, and the MES replying with an acknowledgement to confirm that the communication between the two parties is normal.

[0046] In some implementations, a storage medium internally or externally connected to the first PLC includes a plurality of offline cache areas for storing offline data such as a station-passing record generated during a communication interruption. The first PLC judges whether the offline data need to be synchronized or not by reading status or content of the area.

[0047] In some implementations, synchronizing the offline data to the MES includes: responsive to determining that the first PLC has been switched to the online mode and communication is restored, initiating, by the first PLC, a data synchronization program. The program reads all the offline data in the offline cache area and sends the data to the MES according to the Data Interface Standard of the MES (e.g., Application Programming Interface (API), Database Interface, etc.). Tasks such as data format conversion, data encryption and error check may need to be handled in the synchronization process.

[0048] It is assumed that the automatic control is carried out on the packaging of the yarn spindles by adopting the first PLC and the second PLC, and the first PLC and the MES interact the production data in real time. The communication between the first PLC and the MES is interrupted due to network failure on a certain day, but critical data such as the station-passing record generated in the process is stored in the offline cache area of the first PLC. When the network failure is resolved, the first PLC detects that the control button has been switched from the offline mode to the online mode and communication with the MES is restored. At the moment, the first PLC automatically starts a data synchronization program and synchronizes the data such as the station-passing record in the offline cache area to the MES, thereby ensuring the integrity and the real-time performance of production data.

[0049] According to the technical scheme of the embodiment of the disclosure, when the control button of the first PLC is switched from the offline mode to the online mode and the communication between the first PLC and the MES is restored, the offline data are synchronized to the MES if the offline data is stored in the offline cache area, thereby ensuring that the critical data in the production process can be timely synchronized to the MES, and helping the management layer grasp the production condition in real time to make a quick response. Through the offline cache mechanism, the integrity and traceability of the critical data can be ensured even under the condition of disconnection, thereby avoiding the influence of data loss on production. Through the automatic synchronization mechanism, the communication fault can be timely found and resolved, thereby improving the stability and reliability of the system.

[0050] In some implementations, before synchronizing the offline data to the MES, as shown in FIG. 3, the method further includes: [0051] S301: obtaining, by the first PLC, second operational data of a target station from a second PLC corresponding to the target station, and obtaining first operational data of the target station according to the second operational data; [0052] S302: recording, by the first PLC, the first operational data responsive to determining that the first PLC and the MES are disconnected, and sending station-passing indication information to the second PLC so that the second PLC controls the target station to execute a yarn spindle station-passing task based on the station-passing indication information, where the station-passing indication information is permission for station-passing; and [0053] S303: storing, by the first PLC, the offline data to the offline cache area, where the offline data is a station-passing record which is stored when the first PLC and the MES are disconnected and which needs to be synchronized to the MES.

[0054] Here, the first operational data is converted from second operational data acquired by the first PLC from a second PLC corresponding to the target station. The second operational data typically includes real-time production status, parameter, result of the target station. In the event that the first PLC is disconnected from the MES, the first PLC will record the first operational data converted from the second PLC. The first operational data is mainly used to support production control of the target station, such as the control of a yarn spindle station-passing task in the embodiment, which reflects the working status of the target station in real time or near real time.

[0055] Here, different from the first operational data, the offline data does not originate directly from real-time data conversion at the production site, but refers to data that needs to be recorded for subsequent synchronization to the MES during the time the first PLC is disconnected from the MES. These data may include various production record, event, status change, for example. In the case where the first PLC is disconnected from the MES, the data needs to be stored in the offline cache area in order to maintain the continuity and integrity of the data. The offline data is mainly used to be synchronized to the MES after the network is restored or the connection with the MES is reestablished, to ensure that the data in the MES is up-to-date and can reflect the reality of the production site. This is crucial for production management, data analysis, and report generation, for example.

[0056] In some implementations, the second PLCs collect and process relevant second operational data (e.g., the position, status and quantity of the yarn spindle) based on the status of respective controlled stations, and the data is stored in a data storage area, such as a Data Block (DB), allocated by the second PLC for its responsible station.

[0057] In some implementations, the first PLC obtains the second operational data for the respective station from the second PLC and generates first operational data for the station. The first operational data contain information about the status and required operations of all the relevant stations. The MES analyzes the first operational data and determines the station-passing indication information of the target station (namely, the station which needs to execute the yarn spindle station-passing task currently). The station-passing indication information includes permission of station-passing or prohibition of station-passing. When the station-passing indication information is the permission of station-passing, the station-passing indication information can also include parameters such as specific time, target position and speed of station-passing. The MES transmits the station-passing indication information as generated to the first PLC via the network or other communication manners such as a Management Interface (MI).

[0058] In some implementations, after receiving the station-passing indication information from the MES, the first PLC performs parsing processing to extract a specific control instruction and parameter. After finishing the parsing, the first PLC sends a parsing result (namely, the specific control instruction and parameter) to the second PLC corresponding to the target station through a communication interface or a communication protocol. After receiving the parsing result, the second PLC controls station-passing equipment such as a mechanical device or a robot of the target station to execute the yarn spindle station-passing task according to the control instruction and parameter in the parsing result.

[0059] In some implementations, at the time of system start-up, the communication protocol and parameter between the first PLC and the second PLC are configured to ensure stable communication therebetween. The connection between the first PLC and the MES is configured to ensure that the first PLC can send the first operational data to the MES and receive the station-passing indication information returned by the MES. The first PLC actively acquires the second operational data (such as the current working status, the number of the yarn spindles to be processed, and the processing time) of the target station from a second PLC corresponding to the target station. After acquiring the second operational data, the first PLC converts the second operational data into the first operational data (e.g., whether a station-passing condition is met, and a predicted station-passing time) according to a preset algorithm or logic. If the connection between the first PLC and the MES is disconnected for any reasons (e.g., network failure and MES maintenance), the first PLC will automatically switch to an offline operating mode. In this mode, the first PLC records the first operational data and sends the station-passing indication information (e.g., a permission for station-passing signal) to the second PLC. After receiving the station-passing indication information, the second PLC controls the target station to execute a yarn spindle station-passing task, including moving the yarn spindle to the next station, and updating the status information, for example. Once the connection between the first PLC and the MES is restored, the system can automatically synchronize the data and adjust subsequent operations according to the up-to-date instructions of the MES.

[0060] For example, it is assumed that the production line has a plurality of stations, each of which is responsible for a different processing task. The first PLC regularly obtains the second operational data of the current station from the second PLC. After the processing of the yarn spindle at a certain station (such as a weighing station) is finished, the yarn spindle will enter into the next procedure. At this point, if the MES is temporarily unavailable, the first PLC will send station-passing indication information of permission for station-passing to the second PLC in place of the MES. Subsequently, the second PLC sends an instruction to station-passing equipment (such as a conveyor belt or a robot) to convey the processed yarn spindle to the next station (such as a coil diameter measuring station) for subsequent processing.

[0061] The main type of the yarn spindle involved in the scheme of the embodiments of the disclosure can include one or more of Partially Oriented Yarns (POY), Fully Drawn Yarns (FDY), or Draw Textured Yarns (DTY) (or called low stretch yarns). For example, the type of the yarn can specifically include Polyester Partially Oriented Yarns, Polyester Fully Drawn Yarns, Polyester Drawn Yarns, Polyester Draw Textured Yarns and Polyester Staple Fiber (PSF).

[0062] According to the technical scheme of the embodiment of the disclosure, the MES can monitor the status of the stations in real time through real-time communication and data processing among the MES, the first PLC and the plurality of second PLCs, and adjust and optimize the station-passing strategy on demand. Even under the condition that the first PLC is disconnected from the MES, the system can independently run and complete the station-passing task, thereby enhancing the stability and the reliability of the system. Through automatic offline compulsory station-passing control, manual intervention is reduced, the speed and accuracy of the yarn spindle station-passing are increased, and the production cost and the time cost caused by manual errors or delay are lowered.

[0063] In the embodiment of the disclosure, the second PLC controls the target station to execute the yarn spindle station-passing task based on the station-passing indication information, including: under the condition that the station-passing indication information is permission for station-passing, informing, through the second PLC, the station-passing equipment or directly controlling the station-passing equipment to convey the processed yarn spindle at the target station to the next station of the target station.

[0064] Here, the station-passing equipment refers to an automatic device, such as a conveying belt, a mechanical arm, and an automatic carrying trolley, used for realizing the transfer of materials (such as yarn spindles) between different stations on a production line. The above is merely an exemplary illustration and should not be construed as a limitation on all potential devices of the station-passing equipment, which are not exhaustively listed here.

[0065] In some implementations, the station-passing indication information may include an evaluation result of the first PLC on whether the yarn spindle at the target station meets the station-passing condition, for guiding a subsequent control operation.

[0066] In some implementations, when the station-passing indication information is permission for station-passing, the second PLC sends an instruction or signal to the station-passing equipment to inform the station-passing equipment to prepare to convey the processed yarn spindle at the target station. After receiving the instruction from the second PLC, the station-passing equipment can convey the yarn spindle from the target station to the next station based on a preset program or path. In the process of conveying, a series of actions on the yarn spindle such as gripping, handling and placing may be involved, all of which need to be precisely controlled to ensure safe and accurate conveying of the yarn spindle.

[0067] In some implementations, the second PLC continuously monitors the operational status of the station-passing equipment and the conveying of the yarn spindle. Once the conveying is finished, the station-passing equipment will send a feedback signal to the second PLC confirming that the current yarn spindle has successfully arrived at the next station. The second PLC updates the internal status based on the feedback signal to prepare for the subsequent control operation.

[0068] For example, it is assumed that the production line has a plurality of stations, each of which is responsible for a different processing task. After the processing of the yarn spindle at a certain station (such as a weighing station) is finished, the second PLC receives the parsing result of the station, and the permission for station-passing station is determined as long as a compulsory station-passing variable =1 regardless of whether parameters such as weight, specification and batch number meet requirements or not. Subsequently, the second PLC sends an instruction to the station-passing equipment (such as the conveying belt or the robot) to convey the processed yarn spindle to the next station (such as a coil diameter measuring station) for subsequent processing.

[0069] As such, the process of passing the yarn spindle through the station can be accurately controlled through the first PLC and the plurality of second PLCs, thereby reducing the waiting time and the manual intervention and improving the overall efficiency of the production line; reducing errors caused by human factors, and improving the stability and the reliability of the production process. The PLC is flexible in programming, can quickly adjust control logic according to production requirements, and is suitable for processing different types and specifications of yarn spindles. The first PLC supports the compulsory station-passing, such that dwell time of the yarn spindle at the station can be significantly shorten to promote the whole smoothness of production line while effectively reducing energy consumption and human cost.

[0070] In the embodiment of the disclosure, the method for controlling the automatic station-passing of the yarn spindle further includes: determining that the first PLC is disconnected from the MES when the first PLC detects that the control button corresponding to the first PLC rotates to the offline mode.

[0071] In some implementations, the offline mode generally refers to a status in which the system is operating independently without communication with a superior management system (e.g., MES). In this mode, the system can rely on its own logic and preset parameters to execute the control task.

[0072] In some implementations, the control button is a physical switch or knob for controlling an operating mode of the first PLC, which is used to switch the operating mode (e.g., online mode or offline mode) of the first PLC. The offline mode is a specific location or marker on the control button which, when the button is rotated to that position, indicates selection of the offline mode to actively interrupt the communications with the MES. The online mode is a specific location or marker on the control button which, when the button is rotated to that position, indicates selection of the online mode to desirably maintain the communication with the MES.

[0073] In some implementations, the first PLC continuously monitors status of a control button directly connected thereto, and the button is typically mounted on a control panel, allowing an operator to manually switch the operating mode of the first PLC. When detecting that the control button has been rotated to the offline mode position, the first PLC immediately records this event and assumes that the connection to the MES has been disconnected or is about to be disconnected. It should be noted that this detection mode is mainly dependent on hardware signals (e.g., ON/OFF status of the button), and is therefore instantaneous and reliable. After the offline mode is determined, the first PLC obtains the second operational data of the target station from the second PLC according to an established flow and converts the second operational data into first operational data. Based on the processed first operational data, the first PLC judges whether to send the station-passing indication information to the second PLC so as to control the station-passing task of the yarn spindle. Generally, the first PLC will send station-passing indication information of permission for station-passing to the second PLC. The system should have the capability to handle various exception conditions and automatically synchronize data or restore the connection with the MES when the condition is restored.

[0074] Taking an automatic packaging line in the chemical fiber industry as an example, the MES may not communicate with the first PLC temporarily due to a network failure. At this point, an operator may walk up to a control panel of the first PLC, and rotate the control button to offline mode. When the change is detected, the first PLC may automatically determine that the connection with the MES is disconnected, and immediately starts the station-passing control flow in the offline mode. Subsequently, the first PLC sends the station-passing indication information of permission for station-passing to the second PLC, ensuring that the yarn spindle can smoothly move from the current station to the next station.

[0075] As such, by introducing the control button, the operator is allowed to directly intervene in the production flow under a specific condition, improving the flexibility of the system and the capability of coping with emergencies. By allowing the operator to manually switch the working mode of the first PLC, the system can quickly adjust the operating status according to an actual requirement, enhancing the flexibility and the adaptability of the system. The status detection of the control button provides visual indication for the connection status between the first PLC and the MES and is beneficial to timely finding and processing connection problems, thereby improving the reliability of the system. In the event that the MES is unavailable, the operator can switch the first PLC to the offline mode by simply rotating the control button to allow the system to continuously execute the station-passing task, thereby simplifying the operational flow and reducing down time.

[0076] In the embodiment of the disclosure, the method for controlling the automatic station-passing of the yarn spindle further includes: determining that the first PLC is disconnected from the MES when the first PLC detects that the communication between the first PLC and the MES is interrupted.

[0077] In some implementations, the communication interruption refers to a status in which a communication link cannot normally transmit data for any reasons (such as network failure, equipment failure, and signal interference) during communication.

[0078] In some implementations, the first PLC internally integrates a communication status monitoring module which continuously monitors the communication link with the MES. The monitored contents include, but are not limited to, key indexes such as success rate of sending and receiving data packet, communication delay, and timeout times. When it is monitored that the communication link is abnormal (such as failure of sending continuous data packets, communication delay exceeding a preset threshold, and timeout times reaching an upper limit), the communication is determined to be interruption. Once the communication is determined to be interruption, the first PLC immediately records this event and assumes that the connection with the MES has been disconnected. Subsequently, the first PLC will switch to an offline working mode. In the offline working mode, the first PLC continuously obtains the second operational data of the target station from the second PLC and converts the second operational data into the first operational data. Based on the processed first operational data, the first PLC judges whether to send the station-passing indication information to the second PLC so as to control the station-passing task of the yarn spindle. When it is detected that the communication link with the MES is restored to be normal, the first PLC automatically switches to an online working mode; in the online working mode, the first PLC and the MES synchronously operate to ensure the consistency and accuracy of data.

[0079] It is assumed that the first PLC on the automatic production line is responsible for monitoring and managing the operating status of a plurality of yarn spindle processing stations. Someday, the communication link between the first PLC and the MES is disconnected due to the network failure. The communication status monitoring module of the first PLC immediately detects the abnormality and determines that the communication is interrupted. Subsequently, the first PLC automatically switches to the offline working mode, continuously obtains the operational data from the second PLC and controls the station-passing task of the yarn spindle. When the network failure is resolved and the communication link is restored to be normal, the first PLC and the MES synchronously operate once more to ensure the consistency and accuracy of data.

[0080] As such, by automatically detecting communication interruption and switching to the offline working mode, the system can continuously execute the control task when the MES is unavailable without the manual intervention, thereby improving the automation degree of the system. The automatic detection and processing mechanism of the communication interruption enables the system to cope with various communication faults, and improves the stability and reliability of the system. After the communication is restored, the system can automatically synchronize data and restore to a normal working status, thereby reducing downtime caused by the communication problem.

[0081] In the embodiment of the disclosure, the method for controlling the automatic station-passing of the yarn spindle further includes: not performing, by the MES, judgment processing for an online station-passing condition responsive to determining that the MES is disconnected from the first PLC.

[0082] In some implementations, when the communication between the MES and the underlying control system is interrupted, the MES adopts a series of alternative processing measures to maintain normal system operation, and these measures may not rely on real-time data.

[0083] In some implementations, the judgment processing for the online station-passing condition includes: a process where the MES evaluates and analyzes the received operational data according to a preset rule and algorithm to determine whether the target station is allowed to perform the station-passing operation. The conditions may include a variety of factors such as production schedule, equipment status, and material supply condition.

[0084] In some implementations, when receiving the first operational data sent from the first PLC, the MES first performs the reception and preliminary verification of the data. If the data has a correct format and contains effective compulsory station-passing variables, the MES will completely record the data into an internal database or a log system so as to facilitate the follow-up data tracing. The recorded contents may include information about all or part of the key fields of the first operational data and the timestamp of the received data. Under normal circumstances, the MES may perform the judgment processing for the online station-passing condition on the received operational data according to the preset rule and algorithm, in order to determine whether passage through the target station is permitted.

[0085] In some implementations, a stable communication link is established between the MES and the first PLC and the status of the link is continuously monitored. When detecting that the communication with the MES is interrupted, the first PLC informs the MES through a preset communication protocol or a heartbeat mechanism. After receiving the notice of the communication interruption from the first PLC, the MES immediately recognizes that the current connection status with the first PLC is disconnected. The MES then stops performing any judgment processing for the online station-passing condition that relies on real-time communication with the first PLC. The MES may initiate an offline processing strategy that may include logging communication interruption events, sending an alert to system administrator, and performing predictive processing to some degree (if applicable) based on the preset rule or historical data. However, in any event, the MES does not perform any judgment processing for the online station-passing condition that requires real-time data collection from the first PLC. When detecting that communication with the MES is restored, the first PLC informs the MES again. After receiving the notification of the communication restoration, the MES reestablishes the communication connection with the first PLC and restores to execute the judgment processing for the online station-passing condition.

[0086] Taking an automatic packaging line in the chemical fiber industry as an example, the MES is responsible for monitoring the whole production process and judging whether the yarn spindle meets the station passing condition or not according to real-time data. However, due to the network failure, communication between the MES and the first PLC is abruptly interrupted. At this point, the MES immediately stops the determination process of the online stop-crossing condition and logs this event through the system log. Meanwhile, the system administrator receives an alarm of communication interruption and immediately starts troubleshooting. And after the fault is solved, the communication is recovered, the MES establishes connection with the first PLC again, and continues to execute the judgment processing for the online station-passing condition.

[0087] As such, during the communication interruption, the MES does not perform unnecessary judgment for the online station-passing condition, thereby reducing the consumption of computing resources. By avoiding processing that relies on real-time data when the communication is interrupted, potential problems with the system due to data inconsistencies or errors are reduced. The system administrator can timely receive the alarm of communication interruption and intervene according to the requirement, thereby improving the maintainability and the user experience of the system.

[0088] In the embodiment of the present disclosure, the judgment processing for the online station-passing condition may include: judging whether the yarn spindle at the target station meets the station-passing condition based on target character string data corresponding to the target station, where the target character string data are obtained by parsing first operational data through the MES; if the station-passing condition is met, determining that the station-passing indication information is permission for station-passing; or if the station-passing condition is not met, determining that the station-passing indication information is prohibition for station-passing.

[0089] In some implementations, the station-passing indication information is used to indicate whether the yarn spindle on the production line can be passed through to the next station for processing. The station-passing indication information may be permission for station-passing or prohibition for station-passing according to a judgment result of the station-passing condition.

[0090] In some implementations, the MES first receives the first operational data sent from the first PLC. These data typically include status information about the target station on the production line, the processing progress of the yarn spindle, the quality check result, and the number of times the station-passing is requested. A dedicated data parsing module is built inside the MES, which is configured to parse the received first operational data to extract target character string data corresponding to the target station. These target character string data may be encoded to represent a particular working status or attribute.

[0091] In some implementations, based on the parsed target character string data, the MES further performs a comparison analysis with a preset station-passing condition. The station-passing condition may include whether the processing quality of the yarn spindle satisfies standard, whether all processing tasks of the current station are completed, and whether the equipment fault or the production abnormality is present, for example. If the yarn spindle at the target station meets all preset station-passing conditions, the MES determines that the station-passing indication information is permission for station-passing, representing that the yarn spindle can be safely conveyed to the next station for further processing. If the yarn spindle at the target station does not meet any one of the station-passing conditions, the MES determines that the station-passing indication information is prohibition for station-passing and possibly triggers a corresponding alarm mechanism to inform field personnel to check and process.

[0092] In some implementations, the MES sends the judgement result (permission for station-passing or prohibition for station-passing) as the station-passing indication information to the second PLC or other associated control device via the communication interface. The station-passing equipment executes corresponding control logic, such as starting or stopping the conveying action of the yarn spindle, according to the received station-passing indication information.

[0093] Taking an automatic packaging line in the chemical fiber industry as an example, when detecting that the processing of yarn spindle at a certain station (such as a weighing station) is completed, the first PLC may send the first operational data containing status information of the station to the MES. After receiving the data, the MES parses out the target character string data (such as the two-dimension code and the weight information of the yarn spindle with the station-passing request) and compares the target character string data with the preset station-passing condition (such as whether the weight of the yarn spindle of the specification is within an allowable range, A grade: within the allowable range, B grade: light in weight, and C grade: heavy in weight). If the quality grade of the yarn spindle is A grade, the MES determines that the station-passing indication information is permission for station-passing and informs the second PLC to start the conveying action of the yarn spindle; if the quality grade of the yarn spindle is grade B or grade C, the MES determines that the station-passing indication information is prohibition for station-passing, and triggers an alarm mechanism.

[0094] As such, it can be ensured that only the yarn spindle meeting the requirement is continuously conveyed through the parsing of the first operational data and the accurate judgment of the station-passing condition by the MES, thereby improving the accuracy and the reliability of production. The conveying of the yarn spindle which does not meet the station-passing condition is found and prevented in time, so that abnormal conditions in the production process, such as equipment fault and quality problem can be reduced, thereby reducing the production risk. Through automatic judgment and the station-passing indication information, the manual intervention and waiting time can be reduced, thereby improving the overall operation efficiency of the production line.

[0095] In the embodiment of the disclosure, obtaining, by the first PLC, the second operational data of the target station from the second PLC corresponding to the target station, includes: regularly obtaining, by the first PLC, the second operational data of the target station from the second PLC.

[0096] In some implementations, a timer is provided in the first PLC for controlling a time interval for data collection. The time interval can be adjusted according to the actual requirement of the production line, so that the latest data can be obtained in time while the burden of the system cannot be increased due to over-frequent data exchange. When the timer reaches a set time point, the first PLC sends a data request signal to the second PLC. This signal contains information such as the type of data to be obtained and the identity of the target station, so that the second PLC can accurately return corresponding data.

[0097] In some implementations, after receiving the data request of the first PLC, the second PLC searches its own database or real-time data cache for the second operational data of the target station according to information in the request, and sends the second operational data to the first PLC via the communication interface. The data may include real-time status of the target station, process progress, quality check results, for example.

[0098] In some implementations, after obtaining the second operational data, the first PLC may parse and process the second operational data to extract required information for subsequent decision-making or control operations. At the same time, the data may also be used to update relevant data in the MES or generate a report.

[0099] As such, by regularly obtaining the second operational data of the target station from the second PLC, the real-time monitoring of the production line status can be realized, thereby ensuring the transparence and traceability of the production process. Based on the real-time data, the MES or the first PLC can discover the abnormal condition in the production process in time and take a corresponding adjustment measure, such as stopping the station-passing and adjusting a process parameter, to improve the production efficiency and the product quality. Through the analysis of historical data and real-time data, powerful support can be provided for optimization and decision-making of the production line, such as prediction of production trend and optimization of production plan.

[0100] In the embodiment of the disclosure, the obtaining, by the first PLC, the first operational data according to the second operational data of the target station obtained from the second PLC corresponding to the target station includes: converting, by the first PLC, the second operational data into the first operational data in a data storage format according to a preset data storage format, where the first operational data is stored in a data storage area allocated for the target station by the first PLC, and different types of variables in the first operational data correspond to different fixed addresses in the data storage area.

[0101] Here, the data storage format refers to a specific format or specification adopted by data in the storage or transmission process, and includes a data type, a data unit and a data encoding.

[0102] Here, the data storage area refers to a specific area for storing data inside the first PLC.

[0103] Here, the fixed address refers to a unique, unchanging storage location allocated for different variables in the data storage area. Quick access and modification of the variables can be achieved through the fixed address.

[0104] In some implementations, in the system for controlling the automatic station-passing of the yarn spindle, the first PLC is responsible for generating the first operational data of the target station according to the second operational data of the target station. The data may contain various types of information such as status code, numerical parameter and time stamp. The first PLC is internally configured with a preset data storage format to ensure that data can be efficiently exchanged and parsed between different PLCs or between the PLC and the MES. The first PLC converts the second operational data according to the preset format. The conversion process may include conversion of data types (e.g., integer to floating point), unification of data units (e.g., millimeter to inch), and decoding of data encodings (e.g., binary conversion). The converted data is the first operational data, which follows the preset data storage format, so as to facilitate the subsequent processing and transmission. The first PLC allocates a dedicated data storage area to the target station on the production line. The first operational data is stored in a data storage area corresponding to the target station. The different variables (such as the status code and the numerical parameter), when stored, are allocated to different fixed addresses in the storage area. When the value of a certain variable needs to be read or modified, the variable can be directly accessed through the corresponding address, thereby improving the data processing efficiency.

[0105] As such, the preset data storage format and the format conversion process can ensure the consistency and the accuracy of the data from different sources in the exchange and processing processes. The fixed storage address is allocated to the variable, thereby simplifying the data access and processing process and improving the overall performance of the system. The allocation and format definition of the data storage area have certain flexibility and can be expanded and adjusted according to the actual requirement of the production line.

[0106] In some implementations, the method for controlling the automatic station-passing of the yarn spindle further includes: allocating, by the first PLC, a plurality of offline cache areas and an offline control area for all target stations, where the plurality of offline cache areas are shared by all the target stations, and the offline control area includes relevant data bits and relevant control bits used for synchronizing the offline data to the MES.

[0107] Here, the offline cache area is a specific area assigned in the first PLC or other storage device for storing data to be synchronized when the communication between the first PLC and the MES is interrupted.

[0108] Here, the offline control area is a dedicated area provided in the second PLC, and includes relevant data bits and control bits for controlling the offline data synchronization process.

[0109] In some implementations, the first PLC allocates a plurality of shared offline cache areas for all of the target stations. The areas are used to store offline data generated by the stations during the communication interruption between the PLC and the MES, such as the station-passing record and the production parameter.

[0110] In some implementations, the first PLC is provided with a dedicated offline control area that contains relevant data bits and control bits for controlling the offline data synchronization process. The data bits and control bits are used to store key information, such as synchronization status, target MES address, and synchronization priority, to ensure accurate and orderly synchronization of the offline data to the MES.

[0111] In some implementations, when the communication between the first PLC and the MES is interrupted, the offline data generated by the target station is automatically stored in the shared offline cache area. At the same time, the relevant data bits and control bits in the offline control area are updated to reflect the current synchronization status and priority. Once the communication between the first PLC and the MES is restored, the first PLC will check the status information in the offline control area and decide which offline data needs to be synchronized to the MES based on priority and synchronization policies. The first PLC then sends the offline data from the cache area to the MES according to the preset format and protocol.

[0112] In some implementations, after receiving the offline data, the MES will validate and confirm it. Once the data is successfully received and processed, the MES will send a synchronization acknowledgement signal to the first PLC. After receiving the acknowledgement signal, the first PLC updates the status information in the offline control area and clears the synchronized offline data to release the cache space for subsequent use.

[0113] As such, by allocating the shared offline cache area for all the target stations, it can be ensured that the key data generated during the communication interruption are properly stored, thereby avoiding the influence of data loss on production. The arrangement of the offline control area enables the PLC to flexibly control the synchronization process of the offline data, including the synchronization of priority and target MES address, so as to meet requirements under different production scenes. Once the communication is restored, the PLC can synchronize the offline data to the MES rapidly, thereby ensuring that the management layer can master production status in real time and make quick response to promote production efficiency. By synchronizing the confirmation and clearing mechanism, it can be ensured that the synchronized offline data is deleted from the cache area in time, thereby avoiding excessive storage space resources from being occupied.

[0114] In some implementations, the synchronization of the offline data to the MES mainly include the following steps:

[0115] System startup and status check: after the system is started, continuously checking whether the first PLC is in an online mode and has started an offline station-passing record synchronization function.

[0116] Offline data check: checking whether the offline cache area has queues (data) to be processed if the condition is satisfied.

[0117] Control area status preparation: ensuring that relevant data bits and control bits of an offline control area are in an initial status, or otherwise, carrying out a reset operation.

[0118] Data transmission and station-passing control: transmitting the first queue data of the offline cache area to the offline control area, and setting the control bits to indicate the second PLC to start processing the station-passing.

[0119] Request and response processing: triggering, by the control bits, the first PLC to send a request (AVI_REQUEST) to the MES and awaiting a response from the MES.

[0120] Response verification and data processing: verifying a format of data returned from the MES, parsing the data to an operational data area (IT_RES_1) of the offline control area if correct, and checking whether a response result is valid and has no error.

[0121] Error handling and status updating: according to the response result, performing error handling or updating the control bits to indicate that the data processing is completed.

[0122] Queue and data area resetting: performing queue shift on the offline cache area, and resetting the relevant control bits of the offline control area and the operational data area to prepare for the next round of synchronization to ensure effective synchronization and processing of the offline data. In some implementations, the synchronization of the offline data to the MES may include the following steps: [0123] a. starting a system; [0124] b. checking whether the first PLC is in an online mode and has started a synchronous offline station-passing record, and if yes, proceeding to Step c, or if not, repeatedly executing Step b; [0125] c. judging whether the number of queues in the offline cache area is not less than 1; if so, proceeding to Step d, or if not, repeatedly executing Step c; [0126] d. judging whether the relevant data bits and the relevant control bits in the offline control area are both in an initial state; if so, proceeding to Step e, or if not, clearing and resetting the relevant data bits and resetting the relevant control bits; [0127] e. transmitting relevant data of the yarn spindle corresponding to a first queue in the offline cache area to a first position in the offline control area, where the first position is used for caching operational data read from the offline cache area; [0128] f. setting a control bit in the offline control area for indicating that the second PLC starts to pass the station; [0129] g. checking whether a value of the control bit in the offline control area for indicating that the second PLC starts to pass the station is 1; if so, proceeding to Step h, or if not, repeatedly executing Step g; [0130] h. setting a control bit in the offline control area for indicating that the first PLC writes AVI_REQUEST, where the AVI_REQUEST represents a request message sent from the first PLC to the MES; [0131] i. checking whether a control bit in the offline control area for indicating that the first PLC receives data returned from the MES is not null; if so, proceeding to Step j, or if not, repeatedly executing i; [0132] j. checking a control bit in the offline control area for indicating whether a format of the data returned from the MES is correct; if the format is incorrect, proceeding to Step k, or if the format is correct, going to Step l; [0133] k. writing an error code indicating that the format of AVI_RESPONSE1 is incorrect, and proceeding to Step q; [0134] l. setting the control bit in the offline control area for indicating that the first PLC receives the data returned from the MES; [0135] m. parsing the data returned from the MES into IT_RES_1, where IT_RES_1 represents the operational data output from the first PLC; [0136] n. checking whether RESPONSE_RESULT in IT_RES_1 is 1 and whether RESPONSE_ERROR is 0; if so, proceeding to Step p, or proceeding to Step o, where RESPONSE_RESULT=1 represents that there is a response result, and RESPONSE_ERROR=0 represents that there is no error in the response result; [0137] o. writing an error code indicating that a processing result does not meet the expectation, and proceeding to Step q; [0138] p. setting a control bit in the offline control area for indicating that the data processing of the first PLC is completed; and [0139] q. shifting the queues in the offline cache area, and resetting the relevant control bits corresponding to the offline control area and the relevant operational data area.

[0140] It should be understood that the steps as described above can be set or adjusted according to actual demand; for example, steps can be added or reduced, or contents in some steps can be changed.

[0141] As such, through detailed step control including checking the number of queues in the offline cache area, the status of the offline control area, and the format of MES return data, only the offline data meeting the requirement is ensured to be synchronized to the MES, thereby avoiding the problem of data error or omission. The system can automatically initiate the synchronization process after the communication between the first PLC and the MES is restored and ensure that each step is performed in the correct state through a loop check and wait mechanism. Meanwhile, for a potential error condition (such as incorrect data format and unexpected processing result), the system can provide a clear error code and take a corresponding reset measure, thereby improving the fault tolerance and stability of the system. Through the queue shift processing and reset mechanism, the system can timely clear synchronized offline data and release the cache space for subsequent use. This can not only prevent the problem of cache overflow, but also improve the response speed and performance of the system. The synchronization process adopts a modularized and configurable design concept, and parameters such as synchronization strategy and priority can be flexibly adjusted by modifying relevant data bits and control bits in the offline control area so as to adapt to the requirements under different production scenes. Meanwhile, the synchronization process is easy to integrate and expand with other systems or modules. By synchronizing the offline data to the MES in real time, the management layer can know the operational status and key data of the production line in real time, so that more accurate and timely decisions can be made. This can not only improve the production efficiency, but also enhance the transparency and traceability of data, thereby providing powerful support for continuous improvement and optimization of enterprises.

[0142] Hereinafter, the processing flow of the first PLC, which serves as an intermediate layer between the MES and the second PLC, will be described by taking an example in which the IT-PLC represents the first PLC and the ME-PLC represents the second PLC.

[0143] FIG. 4 is a flowchart schematically illustrating a process of a first PLC uploading an offline station-passing record to an MES. As shown in FIG. 4, the process flow includes: [0144] S401: a system is started; [0145] S402: IT-PLC ON LINE(I0.0)=1 and DB6200.STATION_CFG.TRO=1? If Yes, the Process proceeds to S403, or if not, repeatedly executes S402;

[0146] Here, IT-PLC ON LINE(I0.0)=1 represents that the control button of the IT-PLC is turned to the online mode, and STATION_CFG.TRO=1 represents that the synchronized offline passage record is enabled. DB6200 is a DB used by IT-PLC to store the relevant control bits of the synchronous offline station-passing record. [0147] S403: DB6241.QTY_UNLOAD1? If yes, the process proceeds to S404, or if not, repeatedly executes S403;

[0148] Here, QTY_UNLOAD represents the number of queues in the offline cache in the DB6241.

[0149] Here, DB6241-DB6248 are the eight DBs allocated for all the stations for caching offline records. The DB6241 is the first DB in the eight DBs, and when the DB6241 is full, the data storage to the DB6242 is started; after the DB6242 is full, the data storage to the DB6243 is started. For the eight DBs, each DB can store a certain number of queues. When synchronously uploaded, the offline records are uploaded to the eight DBs in an order of the DB6241-DB6248. For example, offline data of the first target yarn spindle in DB6241 (the first yarn spindle in DB6241) is uploaded first; after the offline data of the first target yarn spindle is uploaded, the offline data of the first target yarn spindle is emptied; the offline data in the eight DBs from DB6241 to DB6248 are all moved forward by one bit, so that the offline data of the second yarn spindle in DB6241 is moved forward by one bit; and the second yarn spindle in DB6241 will be used as a new target yarn spindle. [0150] S404: FC64007 is invoked to perform the following judgment: [0151] whether data in DB6200.ME_MSG.ME_AVI_MSG is null, and [0152] DB6200.ME_MSG.ME_CTRL_WRD.ASSY_COMPLETE=0, and [0153] DB6200.IT_MSG.IT_CTRL_WRD.TR_SENT=0, and [0154] DB6200.IT_MSG.IT_CTRL_WRD.TS_RECEIVED=0, and [0155] DB6200.IT_MSG.IT_CTRL_WRD.MES_COMPLETE=0? If yes, the process proceeds to S405, or if not, proceeds to S418;

[0156] FC64007 is a preset functional module for invoking FC16 to judge whether the area of DB6200.ME_MSG.ME_AVI_MSG is null when the offline data is synchronized. ME_MSG.ME_AVI_MSG represents the operational data read from the cache, such as QR information and specification of a yarn spindle. FC16 is a functional module for judging whether the area of DB6200.ME_MSG.ME_AVI_MSG is null.

[0157] IT_CTRL_WRD.TR_SENT represents a variable as to whether IT-PLC is set after written into AVI_REQUEST; IT_CTRL_WRD.TR_SENT=1 represents that IT-PLC is set after written into AVI_REQUEST; IT_CTRL_WRD.TR_SENT=0 represents that the variable is currently in an initial state.

[0158] IT_CTRL_WRD.TS_RECEIVED represents a variable as to whether IT-PLC is set after receiving MES data; IT_CTRL_WRD.TS_RECEIVED=1 represents that IT-PLC is set after receiving MES data; IT_CTRL_WRD.TS_RECEIVED=0 represents that the variable is currently in an initial state.

[0159] IT_CTRL_WRD.MES_COMPLETE represents a variable as to whether IT-PLC completes current data processing; IT_CTRL_WRD.MES_COMPLETE=1 represents that IT-PLC completes the current data processing; IT_CTRL_WRD.MES_COMPLETE=0 represents that the variable is in an initial state. [0160] S405: FC64005 is invoked to transmit data contents of the target yarn spindle in DB6241-DB6248 to a corresponding position in DB6200.ME_MSG.ME_AVI_MSG;

[0161] Here, the target yarn spindle is the one stored at the foremost position within the eight DBs DB6421-DB6428.

[0162] FC64005 is a preset functional module for transmitting the contents in the DB6241-DB6248 to a corresponding position in DB6200.ME_MSG.ME_AVI_MSG.

[0163] Here, ME_MSG.ME_AVI_MSG represents that the operational data that IT-PLC reads from the cache. [0164] S406: DB6200.ME_MSG.ME_CTRL_WRD.ASSY_COMPLETE is set by IT-PLC;

[0165] Here, ME_MSG.ME_CTRL_WRD.ASSY_COMPLETE represents that IT-PLC starts to upload offline station-passing cache data. [0166] S407: DB6200.ME_MSG.ME_CTRL_WRD.ASSY_COMPLETE=1? If yes, the process proceeds to S408, or if not, repeatedly executes S407;

[0167] Here, ME_CTRL_WRD.ASSY_COMPLETE=1 represents that IT-PLC is set to start synchronization. [0168] S408: DB6200.IT_MSG.IT_CTRL_WRD.TR_SENT is set by IT-PLC, and then the process proceeds to S409;

[0169] Here, IT_MSG.IT_CTRL_WRD.TR_SENT=1 represents that IT-PLC is set after written into AVI_REQUEST.

[0170] After completing S408, IT-PLC waits for a message returned from MES. [0171] S409: DB6200.MI_RESPONSE. AVI_RESPONSE1null string? If yes, the process proceeds to S410, or if not, repeatedly executes S409;

[0172] Here, MI_RESPONSE. AVI_RESPONSE1null string represents that MES has written response information of the current station-passing into AVI_RESPONSE1. [0173] S410: whether a format of DB6200.MI_RESPONSE. AVI_RESPONSE1 is correct is judged. If yes, the process proceeds to S412, or if not, proceeds to S411;

[0174] Here, the format of AVI_RESPONSE1 can be set or adjusted according to an actual requirement. [0175] S411: an error code 3548 is written, then the process proceeds to S418;

[0176] Here, the error code 3548 is used to represent that the format of MI_RESPONSE. AVI_RESPONSE1 is incorrect. [0177] S412: Db6200.it_msg. It_ctrl_wrd. Ts_received Is Set by It-plc;

[0178] IT_CTRL_WRD. TS_RECEIVED=1 represents that IT-PLC is set after receiving MES data. [0179] S413: FC64004 is invoked to parse AVI_RESPONSE1 into a corresponding IT_RES_1;

[0180] Here, IT_RES_1(IT_MSG.IT_RES_1) represents a result of parsing the response information of MES by IT-PLC.

[0181] Here, FC64004 is a module integrated with a function of parsing AVI_RESPONSE1 to the corresponding IT_RES_1. [0182] S414: DB6200.IT_MSG.IT_RES_1.RESPONSE_RESULT=1 and DB6200.IT_MSG.IT_RES_1.RESPONSE_ERROR=0? If yes, the process proceeds to S416, or if not, proceeds to S415;

[0183] IT_RES_1.RESPONSE_RESULT=1 represents that a result in response string information sent from MES to IT-PLC is normal;

[0184] IT_RES_1.RESPONSE_ERROR=0 represents that there is no error code in the response string information sent from MES to IT-PLC. [0185] S415: an error code 3549 is written, then the process proceeds to S418;

[0186] Here, the error code 3549 is used to represent at least one of: [0187] IT_RES_1.RESPONSE_RESULT1; or [0188] IT_RES_1.RESPONSE_ERROR0. [0189] S416: IT-PLC clears and resets MI_RESPONSE.AVI_RESPONSE1;

[0190] Here, MI_RESPONSE.AVI_RESPONSE1 represents a response string sent from MES to IT-PLC. [0191] S417: DB6200.IT_MSG.IT_CTRL_WRD.MES_COMPLETE=1;

[0192] Here, IT_MSG.IT_CTRL_WRD.MES_COMPLETE=1 represents that IT-PLC has completed data processing. [0193] S418: FC64021 is invoked to perform shift processing on queues in DB6241; IT-PLC clears and resets a control bit corresponding to DB6200, a corresponding operational data area is reset, and then the process returns to S402.

[0194] The clearing and resetting, by IT-PLC, the corresponding control bit may include: [0195] DB6200.ME_MSG.ME_CTRL_WRD.ASSY_COMPLETE=0; [0196] DB6200.IT_MSG.IT_CTRL_WRD.TR_SENT=0; [0197] DB6200.IT_MSG.IT_CTRL_WRD.TS_RECEIVED=0; [0198] DB6200.IT_MSG.IT_CTRL_WRD.MES_COMPLETE=0.

[0199] Here, ASSY_COMPLETE represents that IT-PLC is ready to synchronize offline station-passing cache information to MES.

[0200] Here, TR_SENT represents that IT-PLC has sent a piece of offline station-passing cache information to MES.

[0201] Here, TS_RECEIVED represents that IT-PLC has received correct response information returned from MES.

[0202] Here, MES_COMPLETE represents that IT-PLC has completed the current offline station-passing cache information successfully.

[0203] The resetting the corresponding operational data area may include: [0204] invoking FC11 to reset DB6200.ME_AVI_MSG; [0205] invoking FC14 to clear and reset data in DB6241 for storing a target yarn spindle; [0206] invoking FC8 to shift the offline queues to ensures that data is always read from the position of the first yarn spindle in DB6241.

[0207] Here, resetting DB6101.ME_AVI_MSG is to continue the previous data processing process when a condition false trigger is considered.

[0208] It should be noted that the above-mentioned station number, error code number, DB number, variable name, storage address name, FC function module name, and FB function module name are merely exemplary and not restrictive, and can be set or adjusted according to actual requirements.

[0209] It should be understood that the schematic diagrams shown in FIGS. 1 and 4 are merely exemplary and not restrictive, and are extensible. Those skilled in the art may make various obvious modifications and/or substitutions based on the examples illustrated in FIGS. 1 and 4, and the resulting technical solutions still fall within the scope of the disclosure of the embodiments of the present disclosure.

[0210] An embodiment of the disclosure provides an apparatus for controlling automatic station-passing of a yarn spindle, which is applied to the system for controlling automatic station-passing of the yarn spindle, where the system for controlling automatic station-passing of the yarn spindle includes an MES, a first PLC and a plurality of second PLCs, the second PLCs are connected to the first PLC, and the first PLC is connected to the MES, where one of the plurality of second PLCs is used for controlling at least one station; as shown in FIG. 5, the apparatus for controlling automatic station-passing of the yarn spindle may include: [0211] a monitoring module 501, configured to monitor whether a control button of the first PLC is switched from an offline mode to an online mode and whether communication between the first PLC and the MES is restored; and [0212] a first control module 502, configured to synchronize offline data to the MES if it is detected that an offline cache area stores the offline data, responsive to determining that the control button of the first PLC is switched from the offline mode to the online mode and the communication between the first PLC and the MES is restored, where the offline data is a station-passing record which is stored when the first PLC and the MES are disconnected and which needs to be synchronized to the MES.

[0213] In some embodiments, the first control module 502 is configured to synchronize the offline data to the MES by: [0214] after the system is started, continuously checking whether the first PLC is in the online mode and has started an offline station-passing record synchronization function; [0215] checking whether the offline cache area has queues to be processed if the condition is satisfied; [0216] ensuring that relevant data bits and control bits of an offline control area are in an initial status, or otherwise, carrying out a reset operation; [0217] transmitting the first queue data of the offline cache area to the offline control area, and setting the control bits to indicate the second PLC to start processing the station-passing; [0218] triggering, by the control bits, the first PLC to send a request to the MES and awaiting a response from the MES; [0219] verifying a format of data returned from the MES, parsing the data to a operational data area of the offline control area if correct, and checking whether a response result is valid and has no error; [0220] according to the response result, performing error handling or updating the control bits to indicate that the data processing is completed; and [0221] performing queue shift on the offline cache area, and resetting the relevant control bits of the offline control area and the operational data area to prepare for the next round of synchronization.

[0222] In some embodiments, the apparatus for controlling automatic station-passing of the yarn spindle further includes: a second control module (not shown in FIG. 5), configured to obtain, by the first PLC, second operational data of a target station from a second PLC corresponding to the target station, and obtain the first operational data of the target station according to the second operational data; [0223] a third control module (not shown in FIG. 5) configured to record, by the first PLC, the first operational data responsive to determining that the first PLC and the MES are disconnected and send station-passing indication information to the second PLC so that the second PLC controls the target station to execute a yarn spindle station-passing task based on the station-passing indication information, where the station-passing indication information is permission for station-passing; and [0224] a recording module (not shown in FIG. 5), configured to: store the offline data to the offline cache area, where the offline data is a station-passing record which is stored when the first PLC and the MES are disconnected and which needs to be synchronized to the MES.

[0225] In some embodiments, the apparatus for controlling automatic station-passing of the yarn spindle further includes: a first judging module (not shown in FIG. 5), where the first judging module is configured to: determine that the first PLC is disconnected from the MES when the first PLC detects that the control button corresponding to the first PLC rotates to the offline mode.

[0226] In some embodiments, the apparatus for controlling automatic station-passing of the yarn spindle further includes: a second judging module (not shown in FIG. 5), where the second judging module is configured to determine that the first PLC is disconnected from the MES when the first PLC detects that the communication between the first PLC and the MES is interrupted.

[0227] In some embodiments, the apparatus for controlling automatic station-passing of the yarn spindle further includes: a fourth control module (not shown in FIG. 5), where the fourth control module is configured not to perform judgment processing for an online station-passing condition responsive to determining that the MES is disconnected from the first PLC.

[0228] In some embodiments, the apparatus for controlling automatic station-passing of the yarn spindle further includes: a fifth control module (not shown in FIG. 5), where the fifth control module is configured to judge whether the yarn spindle at the target station meets the station-passing condition based on target character string data corresponding to the target station; if the station-passing condition is met, determine that the station-passing indication information is permission for station-passing; or if the station-passing condition is not met, determine that the station-passing indication information is prohibition for station-passing, where the target character string data are obtained by parsing first operational data through MES.

[0229] In some embodiments, the apparatus for controlling automatic station-passing of the yarn spindle further includes: a sixth control module (not shown in FIG. 5), where the sixth control module is configured to allocate, by the first PLC, a plurality of offline cache areas and an offline control area for all target stations, where the plurality of offline cache areas are shared by all the target stations, and the offline control area includes relevant data bits and relevant control bits used for synchronizing the offline data to the MES.

[0230] It should be understood by those skilled in the art that functions of processing modules in the apparatus for controlling automatic station-passing of the yarn spindle according to the embodiments of the present disclosure may be understood by referring to the foregoing description of the method for controlling automatic station-passing of the yarn spindle. The processing modules in the apparatus for controlling automatic station-passing of the yarn spindle according to the embodiments of the present disclosure may be implemented by an analog circuit that performs the functions of the embodiments of the present disclosure, or may be implemented by running software that performs the functions of the embodiments of the present disclosure on an electronic device.

[0231] The apparatus for controlling automatic station-passing of the yarn spindle according to the embodiments of the present disclosure can realize automatic synchronous offline recording management of the yarn spindles to improve the efficiency of the station-passing of the yarn spindles.

[0232] According to an embodiment of the present disclosure, the disclosure also provides an electronic device and a readable storage medium.

[0233] FIG. 6 is a block diagram of an electronic device according to an embodiment of the present disclosure. As shown in FIG. 6, the electronic device includes: a memory 610 and a processor 620, the memory 610 storing therein a computer program operable on the processor 620. The number of the memory 610 and the processor 620 may be one or more. The memory 610 may store one or more computer programs that, when executed by the electronic device, cause the electronic device to perform the methods according to the above-described method embodiments. The electronic device may further include: the communication interface 630 is used for communicating with an external device to perform data interactive transmission.

[0234] If the memory 610, the processor 620, and the communication interface 630 are implemented independently, the memory 610, the processor 620, and the communication interface 630 may connect to and communicate with each other through a bus. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, for example. For sake of illustration, the bus is represented by only one thick line in FIG. 6, but it does not mean only one bus or one type of bus is provided.

[0235] Optionally, in an implementation, if the memory 610, the processor 620, and the communication interface 630 are integrated on a chip, the memory 610, the processor 620, and the communication interface 630 may communicate with each other through an internal interface.

[0236] It should be understood that the processor may be a Central Processing Unit (CPU) or other general-purpose processor, a Digital Signal Processing (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device or discrete hardware components, for example. The general-purpose processor may be a microprocessor or any conventional processor. It is noted that the processor may be a processor supporting Advanced RISC Machine (ARM) architecture.

[0237] Further, optionally, the memory may include a read-only memory and a random-access memory, and may further include a nonvolatile random-access memory. The memory may be a volatile memory or a nonvolatile memory, or may include both the volatile and the nonvolatile memory. The non-volatile memory may include a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM), or a flash Memory. The volatile memory may include a Random-Access Memory (RAM), which acts as an external cache memory. By way of example and not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic Random-Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct RAMBUS RAM (DR RAM).

[0238] The above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, they may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instruction. The computer instruction, when loaded and executed on a computer, can all or partially generate the flows or functions described in accordance with the embodiments of the disclosure. The computer may be a general-purpose computer, a special purpose computer, a network of computers, or other programmable devices. The computer instruction can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instruction can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic or Digital Subscriber Line (DSL)) or wireless (e.g., infrared, Bluetooth of microwave). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server and a data center, that includes one or more available medium integration. The available medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., Digital Versatile Disk (DVD)), or a semiconductor medium (e.g., Solid State Disk (SSD)), for example. It should be noted that the computer-readable storage medium referred to in the disclosure can be non-volatile storage medium, i.e., non-transitory storage medium.

[0239] It will be understood by those skilled in the art that all or part of the steps for performing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk.

[0240] In the description of the embodiments of the present disclosure, the description with reference to the terms such as one embodiment, some embodiments, an example, a specific example or some examples means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present disclosure. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Moreover, various embodiments or examples and features in various embodiments or examples described in this specification can be combined and grouped by one skilled in the art if there is no mutual conflict.

[0241] In the description of the embodiments of the present disclosure, the sign / indicates a meaning of or, for example, A/B indicates a meaning of A or B, unless otherwise specified. The term and/or herein is merely an association relationship describing associated objects, and means that there may be three relationships, for example, A and/or B may mean: A alone, both A and B, and B alone.

[0242] In the description of the embodiments of the present disclosure, the terms first and second are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly indicating the number of technical features as indicated. Thus, a feature defined as first or second may explicitly or implicitly include one or more features. In the description of the embodiments of the present disclosure, a plurality means two or more unless otherwise specified.

[0243] The above description is intended only to illustrate embodiments of the present disclosure, and should not be taken as limiting thereof, and any modifications, equivalents and improvements made within the spirit and principle of the present disclosure will fall within the scope of the present disclosure.