Input / output service system and crown block system in industrial control

By introducing configuration file and hash table storage mechanisms in industrial control systems, combined with the XOR processing technology of the EtherCAT docking layer, the problems of low portability and insignificant functions in the existing technology are solved, and fast and accurate data is achieved Transmission and efficient state management.

CN118981174AActive Publication Date: 2024-11-19SUZHOU XINSHINUO SEMICON EQUIP CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411024073.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-11-19
Estimated Expiration
2044-07-29

AI Technical Summary

Technical Problem

The existing input/output service system in industrial control lacks configuration files, resulting in low portability, high maintenance difficulty, and insignificant input/output port function, which increases the cost of joint debugging.

Method used

A kind of input/output service system in industrial control is designed, including the application docking layer, the data processing layer and the EtherCAT docking layer. It uses a hash table to store data, determines the unique key value through the MD5 value, and stores the interface function name of the configuration file. The EtherCAT docking layer uses message queues to communicate with EtherCAT and improves data transmission efficiency through XOR processing.

Benefits of technology

Improves the portability and debugging convenience of the system, reduces the time-consuming of input/output port setting and state acquisition, realizes fast and accurate data transmission, and improves computing efficiency through the MD5 algorithm, reducing the incrackability of the program sex.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118981174A_ABST
    Figure CN118981174A_ABST
Patent Text Reader

Abstract

The invention discloses an input / output service system and a crown block system in industrial control. The input / output service system comprises an application docking layer, a data processing layer and an EtherCAT docking layer which are arranged in sequence and form a full duplex channel. The application docking layer is used for providing an interface for a visual application program; the data processing layer adopts a hash table to store data, a key value of the hash table is determined according to an MD5 value corresponding to an interface function name of each input / output port, the interface function name is defined in a configuration file, and the configuration file comprises data needing to be modified when all visual application programs are used and debugged; the EtherCAT butt joint layer is used for being in butt joint with the EtherCAT module. According to the invention, the portability can be effectively improved, debugging and device adjustment are facilitated, the time consumption of data transmission is greatly reduced, meanwhile, the outside can simply and clearly know the function of the input / output port through the interface function name of each input / output port, and the inside can conveniently acquire data in a short time through the interface function name of the functional interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of industrial control, in particular to an input / output service system and an overhead crane system in industrial control. Background Art

[0002] In the field of industrial control, especially in the OHT (Overhead Hoist Transport) system, an input / output service system is needed to support various devices and connect EtherCAT modules to ensure the stability and timeliness of industrial control. Therefore, a fast, efficient and stable input / output service system is indispensable.

[0003] Usually, configuration files are not used in the input / output service system of industrial control, which greatly reduces the subsequent portability and makes it difficult to maintain. If the device position needs to be modified later, the code must be modified, which increases the difficulty of adjustment.

[0004] At the same time, there is no clear and eye-catching description of the functions of the input / output ports, which makes it impossible to intuitively understand the functions of the controlled input / output ports when each device is used, greatly increasing the cost of joint debugging. Summary of the invention

[0005] The purpose of the present invention is to solve the above problems existing in the prior art and to provide an input / output service system and an overhead crane system in industrial control.

[0006] The purpose of the present invention is achieved through the following technical solutions:

[0007] The input / output service system in industrial control includes an application docking layer, a data processing layer and an EtherCAT docking layer which are arranged in sequence and form a full-duplex channel;

[0008] The application docking layer is used to provide an interface for the visualization application program;

[0009] The data processing layer uses a hash table to store data. The key value of the hash table is determined according to the MD5 value corresponding to the interface function name of each input / output port. The interface function name is defined in a configuration file. The configuration file includes all data that need to be modified when the visualization application is used for debugging.

[0010] The EtherCAT docking layer is used to dock the EtherCAT module.

[0011] Preferably, in the input / output service system in the industrial control, the configuration file is stored as a JSON file.

[0012] Preferably, in the input / output service system in the industrial control, when determining the key value corresponding to an interface function name, the non-repetitive key value corresponding to the MD5 value is determined as the key value corresponding to the interface function name according to the MD5 value local byte extraction algorithm, and after determining the non-repetitive key value corresponding to the MD5 value, the non-repetitive key value and its corresponding input / output port data are saved in a hash table.

[0013] Preferably, in the input / output service system in the industrial control, when the MD5 value local byte extraction algorithm is calculated for the first time, four bytes whose byte numbers are integer multiples of 4 are selected from the MD5 value to form a 32-bit string as the key value to be verified;

[0014] During the second to nth calculations, four bytes are randomly selected from the MD5 value to form a 32-bit string as the key value to be verified;

[0015] When the key value to be verified calculated for the nth time still has duplicate values ​​in the hash table, the decimal value corresponding to the 32-bit string determined by the nth calculation is -1 and converted to obtain a new 32-bit string as the key value to be verified.

[0016] Preferably, in the input / output service system in the industrial control, the data processing layer uses a state machine to control the data transmission process.

[0017] Preferably, in the input / output service system in the industrial control, the EtherCAT docking layer communicates with EtherCAT via a message queue.

[0018] Preferably, in the input / output service system in the industrial control, the EtherCAT docking layer has an interface for detecting whether the current state and the next state are the same, and the interface compares the current state and the next state using a memcmp function, and when it is determined that the current state and the next state are different, determines the position of the input / output port whose state has changed.

[0019] Preferably, in the input / output service system in the industrial control, when determining that the current state is different from the next state, an XOR process is used, and the position of the input / output port whose state is changed is determined according to the result of the XOR process.

[0020] Preferably, in the input / output service system in the industrial control, the EtherCAT docking layer obtains the data of the input / output port whose state has changed from the data packet sent thereto by the EtherCAT module by shifting according to the position of the input / output port whose state has changed, and the data packet contains the data of all input / output ports of the input / output control board where the input / output port whose state has changed is located.

[0021] An overhead crane system includes any one of the above-mentioned input / output service systems in industrial control.

[0022] The advantages of the technical solution of the present invention are mainly reflected in:

[0023] The input / output system of the present invention can effectively improve portability by setting configuration files, facilitate operations such as debugging and device adjustment, and greatly reduce the time spent on setting the status of the input / output port and the time spent on obtaining the status. At the same time, by adding an interface function name for each input / output port and using a hash table to store data based on the interface function name, data can be transmitted quickly and accurately. The outside world can simply and clearly know the function of the input / output port through the interface function name of each input / output port, which is unique internally and facilitates data acquisition in a short time.

[0024] The present invention adopts a special key value determination method based on the MD5 algorithm, which improves the calculation efficiency and avoids excessive consumption while ensuring the unbreakability of the program.

[0025] The time complexity of the method adopted by the EtherCAT docking layer of the present invention when receiving data from the EtherCAT module is O(1). Compared with the time complexity of the traditional polling traversal, which is O(n2), the method greatly improves the processing speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 is a schematic diagram of an input / output service system of the present invention;

[0027] Figure 2 It is a code schematic diagram of the configuration file of the present invention;

[0028] Figure 3 Schematic diagram of the overhead traveling vehicle system of the present invention. DETAILED DESCRIPTION

[0029] The purpose, advantages and features of the present invention will be illustrated and explained by the non-limiting description of the following preferred embodiments. These embodiments are only typical examples of the application of the technical solution of the present invention, and any technical solution formed by equivalent replacement or equivalent transformation falls within the scope of protection claimed by the present invention.

[0030] In the description of the scheme, it should be noted that the terms "center", "upper", "lower", "left", "right", "front", "back", "vertical", "horizontal", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, and are only for the convenience and simplification of description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0031] Example 1

[0032] The input / output service system in industrial control disclosed by the present invention is explained below in conjunction with the accompanying drawings. It is responsible for receiving instructions from the visualization application, converting them into data recognizable by the EtherCAT module and transmitting them to the EtherCAT module. It is also responsible for receiving data sent to it by the EtherCAT module and forwarding the data to the visualization application.

[0033] As attached Figure 1 As shown, the input / output service system in the industrial control includes an application docking layer, a data processing layer and an EtherCAT docking layer arranged in sequence from top to bottom. The application docking layer interacts with the data processing layer, and the data processing layer interacts with the EtherCAT docking layer. The three form a full-duplex channel from top to bottom and from bottom to top, thereby providing stable, efficient and convenient input / output service support in the overhead crane system.

[0034] The application docking layer is used to provide an interface for the visualization application; it can realize the registration of input / output port callback function, input / output port status query, input / output port status synchronization / asynchronous setting and other functions, which are specifically designed according to actual needs and are not limited here. When the device status changes, the data processing layer will call the registered input / output port callback function to notify the visualization application that registered the callback function.

[0035] The data processing layer is the core content of the present invention. It has at least the following functions: parsing JSON files, providing data storage for the entire system so that visualization applications can query at high speed, managing all input / output port data, and providing the required data space for the EtherCAT docking layer.

[0036] The data processing layer uses JSON files as configuration files, and defines the data that needs to be modified when debugging all visualization applications in the JSON files. As a result, both the portability of the code and the convenience of debugging are greatly improved.

[0037] The configuration file is divided into three layers based on the structure of the entire industrial control system, input / output port control board, and input / output port. The specific content of the configuration file is set as needed. Figure 2 As shown, the industrial control system has two input / output control boards, each of which uses two input / output ports, and the structure of each input / output port is the same. Then the configuration file is as follows: First, the outermost layer defines how many input / output control boards exist in this system, and then the second outermost layer defines the index value of the input / output control board, how many input / output ports need to be used, and finally the innermost layer defines the interface function name of each input / output port, which pin it is on the input / output control board (hardware attribute), and whether it is an input port or an output port on the input / output control board (hardware attribute).

[0038] All data in the configuration file is provided to the data processing layer. For example, if there are several input / output control boards, several spaces are applied in the data processing layer to store the data of each input / output control board. If there are several input / output ports in the input / output control board, several spaces are applied in the data processing layer to store the data of each input / output port. The index value of the input / output control board is the index of its corresponding data in the memory, which can be used to quickly get data from the memory through the index. For example, the first pointer of a space is point, and the index value of an input / output control board is 2, then point[2] can be used directly to obtain the data corresponding to this input / output control board.

[0039] The pin value of the input / output port is used to sort the data packet to the EtherCAT docking layer. For example, if the pin value of an input / output port is 10, when setting the status to sort the data packet, you only need to change the 10th bit to the value you want to set by shifting.

[0040] The input / output port type is used to avoid errors. For example, a visualization application inputs an output port, which is not executed on the hardware, so it is intercepted directly at the software level to improve the system's resource utilization and avoid invalid operations.

[0041] The data processing layer uses a hash table to store data and combines the MD5 algorithm to determine the key value of the hash table. Each key value can be calculated based on the interface function name of each input / output port. Therefore, the data of each input / output port can be obtained through the interface function name of the input / output port defined in the JSON file. The interface function name is customized by the user and serves as the unique mark of each input / output port. This is efficient, fast and clear at a glance. The visualization application calls each input / output port through the interface function name.

[0042] Specifically, the key value is determined according to the MD5 value corresponding to the interface function name of each input / output port. The MD5 value is a unique 16-byte hash value generated by processing each interface function name through the MD5 algorithm. The technology for generating MD5 values ​​through the MD5 algorithm is a known technology and will not be elaborated here.

[0043] When determining the key value corresponding to an interface function name, it is necessary to ensure that there is no duplicate key value in the hash table. Therefore, in the present invention, the non-duplicate key value corresponding to each MD5 value is determined according to the MD5 value local byte extraction algorithm as the key value corresponding to each interface function name, and after determining the non-duplicate key value corresponding to the MD5 value, the non-duplicate key value and the data of the corresponding input / output port are saved in the hash table.

[0044] When the MD5 value local byte extraction algorithm is calculated for the first time, four bytes whose byte numbers are integer multiples of 4 (i.e., the 4th byte, the 8th byte, the 12th byte, and the 16th byte) are selected from the MD5 value to form a 32-bit string as the key value to be verified; it is determined whether the key value to be verified has a duplicate value in the hash table, and if so, the next calculation is performed; if not, the key value to be verified is determined to be the non-duplicate key value corresponding to the MD5 value.

[0045] During the second to nth calculations, four bytes are randomly selected from the MD5 value to form a 32-bit string as the key value to be verified; the next calculation is performed each time the key value to be verified has a repeated value in the hash table; and n is, for example, an integer between 2 and 4.

[0046] In order to avoid the repeated calculations and consumption caused by random selection, it is better to randomly select four bytes from the MD5 value to form a 32-bit string as the key value to be verified. It is better to select one from several determined string combinations as the key value to be verified, and each time there is a repeated value in the verification, select one from the remaining unverified string combinations for the next verification. Specifically, the sequence number tolerance of the four strings in each string combination is 4, that is, there are three determined string combinations, the first combination is a string composed of the 1st, 5th, 9th, and 13th bytes, the second combination is a string composed of the 2nd, 6th, 10th, and 14th bytes, and the third combination is a string composed of the 3rd, 7th, 11th, and 15th bytes. For example, when the first combination is randomly selected for the second calculation, and when there is a repeated value in the verification, then the next verification is performed randomly from the second and third combinations.

[0047] When the key value to be verified calculated for the nth time still has duplicate values ​​in the hash table, that is, when the above three string combinations all have duplicate values ​​after verification, the decimal value corresponding to the 32-bit string determined by the nth calculation (i.e., the fourth calculation) is converted to a new 32-bit string as the key value to be verified. Due to the probability of MD5 value generating data, each time the key value to be verified fails to be verified, the probability of passing the next verification will increase. Therefore, at this time, the non-duplicate key value corresponding to the MD5 value can be effectively obtained.

[0048] This method can improve the uncrackability of the program and increase the processing speed.

[0049] When the data processing layer manages all input / output port data, all data to be sent to the EtherCAT docking layer and all data that need to be modified in the data processing layer are managed using a state machine, which makes the code architecture clear and ensures the stability and robustness of the program and the clearness of subsequent troubleshooting and maintenance. The specific technology of the state machine is a known technology and will not be described here.

[0050] All data that need to be modified in the data processing layer include data that need to be modified by the data processing layer when the visualization application sends instructions, and data that need to be modified by the data processing layer when the device reports data.

[0051] For example, combining Figure 2 According to the configuration file, when the visualization application sends a door opening command, the input / output port of OPEN_DOOR is set to 1, and the data of the data processing layer is modified. If the door is already opened, the sensor that detects whether the door is open will report 1, and the data is transmitted from the EtherCAT module to the Ethercat docking layer and then to the data processing layer, and the data of the data processing layer is also modified. The state machine is used uniformly for management here.

[0052] The data processing layer provides the required data space for the EtherCAT docking layer. All data are maintained in the data processing layer. Other layers do not perform any form of memory processing, and the layers are clear.

[0053] The EtherCAT docking layer is used to dock the EtherCAT module, which realizes the functions of data packet sending, identification of whether there is a change in the current state of data, data packet receiving and parsing, etc.

[0054] The EtherCAT docking layer and the EtherCAT module define data packets according to a custom data protocol and then communicate using a message queue.

[0055] The custom data protocol has two data paths, one is sent from the EtherCAT docking layer to the EtherCAT module, and the other is sent from the EtherCAT module to the EtherCAT docking layer.

[0056] First, let's introduce the messages sent from the EtherCAT docking layer to the EtherCAT module.

[0057] The data processing layer provides a space, and the EtherCAT docking layer organizes the data corresponding to the input / output ports to be sent to the EtherCAT module and needs to be set into a data packet and stores it in this space. Therefore, the EtherCAT module can directly get the data from this space.

[0058] For example, if the visualization application wants to turn on the light and open the door at the same time, then OPEN_DOOR and OPEN_LAMP need to be set to 1 at the same time. At this time, a data packet is integrated, including how many pins need to be set, which pin of which input / output control board each pin is, and whether the state to be set is 0 or 1, that is, {set the number of input / output ports, {which board, which pin, what is the state}, {which board, which pin, what is the state}}}, and the data is {2, {0, 0, 1}, {1, 0, 1}}. In this way, the subsequent EtherCAT module can directly go to this space to get the data packet and get the data accurately and quickly according to the content in the data packet, and send it to the device to complete the setting.

[0059] Next, we will introduce the information sent from the EtherCAT module to the EtherCAT docking layer:

[0060] The EtherCAT docking layer provides an interface for detecting whether the current state and the next state are the same. The current state and the next state are two copies of data stored in the EtherCAT module, one for the previous data and the other for this data. The two copies of data respectively store the status of all input / output ports. Each bit in the data represents the status of an input / output port. If there are two input / output control boards, two uint32_t data are stored.

[0061] The interface for detecting whether the current state and the next state are the same compares the current state and the next state using the memcmp function, and when it is determined that the current state and the next state are different, determines the position of the input / output port whose state has changed and marks it. Specifically, when it is determined that the current state and the next state are different, performs XOR processing on the two copies of data of the current state and the next state, and determines the position of the input / output port whose state has changed based on the result of the XOR processing. Taking the input / output control board as a unit, if the state of an input / output port on a certain input / output control board changes, then it is necessary to send out the data of all the input / output ports of this input / output control board.

[0062] The EtherCAT module calls the interface for detecting whether the current state is the same as the next state, and then organizes the index of the input / output control board where the input / output port with the changed state is located, the data of all the input / output ports on the input / output control board, and the position information of the input / output port with the changed state into a data packet and sends it to the EtherCAT docking layer. In this way, the EtherCAT docking layer can directly obtain the data of the corresponding input / output port from the data packet according to the position information of the input / output port with the changed state. Compared with the traditional polling traversal (time complexity is O(n2)), this method has a time complexity of O(1), and the speed is greatly improved.

[0063] For example: there are two copies of data, the current state and the next state. The data A corresponding to the current state is 10101010, and the data B corresponding to the next state is 10010010. After comparison through the memcmp function, it is determined that A and B are different. A and B are XORed, and the result of A XOR B is 00111000.

[0064] It can be found that in the result obtained by XOR processing, the number of bits where "1" is located is the number of different bits of the two data, that is, the position of the input / output port where the state changes.

[0065] After receiving the data packet, the Ethercat interface layer directly determines the number of input / output ports whose status has changed based on the bit where the 1 in the XOR result 00111000 is located, and then uses the shift method to obtain the data of the input / output port of this bit from the data packet. This can save a lot of traversal time.

[0066] After the Ethercat docking layer obtains and parses the data, it can hand over the parsed data to the state machine of the data processing layer for state switching. The state machine then updates the data of the corresponding input / output port in the hash table according to the data, and calls the callback function bound in advance by the visualization application. If it is not bound, it will not be called, and only the data will be updated.

[0067] The input / output service system is tested and the following results are obtained:

[0068]

[0069] From the above, it can be seen that the system greatly reduces the time-consuming input / output port setting status and the time-consuming status acquisition, and has extremely fast data transmission efficiency.

[0070] Example 2

[0071] This embodiment discloses a crane system, as shown in the attached Figure 3 As shown, including:

[0072] An input / output service system in industrial control as described above;

[0073] A visualization application program communicates with the application docking layer of the input / output service system, which may be an APP program installed on a mobile phone or tablet computer or industrial control software on an industrial control computer, etc., which is not limited here;

[0074] An EtherCAT module is connected and communicated with the EtherCAT docking layer of the input / output service system;

[0075] An input / output control board connected and communicating with the EtherCAT module;

[0076] Devices are connected and communicated with the input / output control board. The devices are, for example, various sensors or actuators, such as motors, cylinders, etc., which are not limited here.

[0077] If the user wants to control a device through a visualization application, he first needs to use the visualization application to select a device, and then the visualization application sends instructions to the input / output service system, which parses and converts the instructions into data recognizable by the EtherCAT module. The EtherCAT module then organizes the instructions into network data packets that comply with the EtherCAT protocol, and then transmits them to the docking input / output port of the input / output control board. Finally, the corresponding input / output port of the input / output control board outputs corresponding high and low levels, causing the device to perform corresponding actions.

[0078] There are many implementation methods of the present invention, and all technical solutions formed by equivalent transformation or equivalent transformation fall within the protection scope of the present invention.

Claims

1. Input / output service system in industrial control, characterized by: It includes an application docking layer, a data processing layer and an EtherCAT docking layer which are sequentially arranged to form a full-duplex channel; The application docking layer is used to provide an interface for the visualization application program; The data processing layer uses a hash table to store data. The key value of the hash table is determined according to the MD5 value corresponding to the interface function name of each input / output port. The interface function name is defined in a configuration file. The configuration file includes all data that need to be modified when the visualization application is used for debugging. The EtherCAT docking layer is used to dock the EtherCAT module.

2. The input / output service system in industrial control according to claim 1, characterized in that: The configuration file is stored as a JSON file.

3. The input / output service system in industrial control according to claim 1, characterized in that: When determining a key value corresponding to an interface function name, determine a non-repeated key value corresponding to the MD5 value as the key value corresponding to the interface function name according to the MD5 value local byte extraction algorithm, and after determining a non-repeated key value corresponding to the MD5 value, save the non-repeated key value and its corresponding input / output port data in a hash table.

4. The input / output service system in industrial control according to claim 3, characterized in that: When the MD5 value local byte extraction algorithm is calculated for the first time, four bytes whose byte numbers are integer multiples of 4 are selected from the MD5 value to form a 32-bit string as the key value to be verified; During the second to nth calculations, four bytes are randomly selected from the MD5 value to form a 32-bit string as the key value to be verified; When the key value to be verified calculated for the nth time still has duplicate values ​​in the hash table, the decimal value corresponding to the 32-bit string determined by the nth calculation is -1 and converted to obtain a new 32-bit string as the key value to be verified.

5. The input / output service system in industrial control according to claim 1, characterized in that: The data processing layer uses a state machine to control the data transmission process.

6. The input / output service system in industrial control according to claim 1, characterized in that: The EtherCAT docking layer communicates with EtherCAT via a message queue.

7. The input / output service system in industrial control according to claim 1, characterized in that: The EtherCAT docking layer has an interface for detecting whether the current state and the next state are the same. The interface compares the current state and the next state using a memcmp function, and when it is determined that the current state and the next state are different, determines the position of the input / output port of the state change.

8. The input / output service system in industrial control according to claim 7, characterized in that: When determining that the current state is different from the next state, an exclusive OR process is used, and the position of the input / output port whose state is changed is determined based on the result of the exclusive OR process.

9. The input / output service system in industrial control according to claim 7, characterized in that: The EtherCAT docking layer obtains data of the input / output port whose state has changed from a data packet sent to it by the EtherCAT module by shifting according to the position of the input / output port whose state has changed, and the data packet contains data of all input / output ports of the input / output control board where the input / output port whose state has changed is located.

10. Overhead crane system, characterized by: It comprises the input / output service system in industrial control as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Open type configuration method and system for IO parameters of field device

    CN101634833A

  • High performance hash-based lookup for packet processing in a communication network

    CN104904167A

  • Method for supporting customization of panel operation of instrument

    CN105511303A

  • Method, device and equipment for adjusting setting of basic input / output system

    CN110347624A

  • Data packet caching method and device, electronic equipment and storage medium

    CN117082142A