ZYNQ-based multipath relay parallel control method and system

By integrating ARM and FPGA terminals on the ZYNQ architecture, parallel control of multiple relays is achieved, which solves the problem of poor control of traditional CPU architecture, reduces the board area and development costs, and improves the real-time and reliability of relay operations.

CN119065299APending Publication Date: 2024-12-03TIANJIN JINHANG COMP TECH RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411196310.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

The traditional CPU architecture has poor parallel control over multiple switch volumes, resulting in the relay operation being out of synchronization, and the board area is large and the development cost is high.

Method used

Adopt a ZYNQ-based multi-relay parallel control system, integrates the ARM terminal master control and FPGA terminal, and data interaction is carried out through the AXI high-speed bus to realize parallel control of multiple switches, including Ethernet control module, switch data configuration module, The switch quantity input acquisition module and the switch quantity output control module ensure the accuracy and reliability of the switch quantity output.

Benefits of technology

Complete parallel control of multi-channel switching output is realized, the board area and development cost is reduced, the potential non-simultaneous safety hazards brought about by traditional sequential control methods, and the real-time and reliability of relay operations are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119065299A_ABST
    Figure CN119065299A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of computer bus communication, and discloses a ZYNQ-based multipath relay parallel control method and system. The system comprises an Ethernet control module, a switching value data configuration module, a switching value input acquisition module and a switching value output control module. The controller based on the ZYNQ architecture can realize complete parallel control of multi-path switching value output, and has switching value output information verification and output control functions so as to ensure the accuracy and reliability of switching value output. Compared with the prior art, a ZYNQ framework is adopted, an ARM end main control part and a switching value action part are integrated together, a traditional main processor and FPGA design mode is replaced by a single chip, the area of a board card is better saved, and development cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of computer bus communication, and in particular relates to a ZYNQ-based multi-channel relay parallel control method and system. Background Art

[0002] A relay is a commonly used electrical control device used to realize signal conversion, amplification and protection in a circuit. It consists of a mechanical switch driven by an electromagnet, which can control the on and off of the circuit according to the changes in external signals. Relays are widely used, covering fields such as communications, automatic control and power electronics. During use, the action information is fed back to the back-end equipment through the opening and closing of the relay. As a reliable and flexible electrical control device, the relay has become an indispensable part of modern society. The above process is for some simple control systems, while for some control systems with high real-time requirements, the traditional sequential control method may lead to poor real-time performance of the back-end switch quantity, that is, lack of parallelism of action.

[0003] Through the above analysis, the problems and defects of the existing technology are: the traditional CPU architecture has poor control over the parallelism of multiple switch quantities, resulting in asynchronous relay operation, and the existing technology has a large board area and high development cost. Summary of the invention

[0004] In order to overcome the problems existing in the related art, the disclosed embodiment of the present invention provides a multi-channel relay parallel control method and system based on ZYNQ. The purpose of the present invention is to solve the problem that the traditional CPU architecture has poor parallel control of multiple switch quantities, resulting in asynchronous relay operation. The present invention designs a multi-channel relay parallel control method based on ZYNQ. Based on this platform, a single controller can better realize the parallel control of multiple switch quantities, and at the same time has the switch quantity output information verification and output control functions to ensure the accuracy and reliability of the switch quantity output.

[0005] The technical solution is as follows: a multi-channel relay parallel control system based on ZYNQ, using the ZYNQ architecture, integrating the ARM-side main control part and the switch quantity action part, and performing parallel control of multi-channel switch quantity outputs through a single chip, specifically including:

[0006] The ZYNQ processor integrates the ARM side and the FPGA side, and exchanges data between the ARM side and the FPGA side through the AXI high-speed bus to complete the input and output control of multiple switch quantities;

[0007] The ARM end is equipped with an Ethernet control module, which is used to receive the Ethernet data to be sent written by the external device of the controller, and is used to process the data of the external relay action as the switch signal input, and send it to the external device of the controller byte by byte through Ethernet;

[0008] The switch data configuration module is used to obtain the switch configuration parameters sent by the ARM end;

[0009] Switch input acquisition module, used to obtain the action information of external relays;

[0010] The switch quantity output control module is used to cooperate with the switch quantity data configuration module to complete the configuration output of the switch quantity.

[0011] Further, the ARM end includes a dual-core ARM processor for overall process control, Ethernet communication, switch parameter configuration and data processing;

[0012] The FPGA end includes an FPGA processor, which cooperates with parameter configuration and control logic of multi-channel switch input and output;

[0013] The Ethernet control module enables Ethernet 0 by configuring and opening the MIO16 to MIO27 interfaces in Block Design; and enables the network transmission API interface function provided by the network protocol stack LWIP in the board support package BSP;

[0014] Before receiving and sending data, the Ethernet control module creates a new protocol control block UDP PCB for communication, binds the PCB to the local address, and listens to the local IP address.

[0015] Furthermore, when external network data is input, the Ethernet control module (1) caches the received valid data into a receiving buffer recv_buf, performs big-endian and small-endian adjustment and byte splicing on the data, converts the data into 32-bit wide data, and sends the data to the FPGA end via the AXI bus;

[0016] When data needs to be sent to the external network, the FPGA side sends the data to the ARM side through the AXI bus. The Ethernet control module caches the valid data into the send buffer send_buf, splits the 32-bit wide data into bytes, converts the data into big-endian and small-endian data, and sends it byte by byte to the external device of the controller through Ethernet.

[0017] Furthermore, the ARM end writes the configuration parameters of the switch quantity to the FPGA end through the AXI bus. The switch quantity data configuration module parses the Ethernet message and extracts the data therein and assigns it to the output register kgl_reg_out. The data bit width of the output register is strongly related to the number of switches. After the configuration parameters are completed, the ARM end notifies the switch quantity output control module. The configuration parameters in the output register control the corresponding path switch quantity according to the value of the corresponding bit, and then controls the relay to complete the switching action.

[0018] Furthermore, when the action information of the external relay is converted into switch quantity information from each switch quantity input, the switch quantity input acquisition module caches the data information into the input register kgl_reg_in, and each bit information of the input register represents the input information of each switch quantity; when the reception is completed, the content in the input register will be mapped to a certain address, and the ARM side will read the data under the address through the AXI bus to obtain the input of the switch quantity.

[0019] Another object of the present invention is to provide a ZYNQ-based multi-channel relay parallel control method, which runs on the ZYNQ-based multi-channel relay parallel control system, and the method includes:

[0020] For controlling multi-channel switch outputs, the controller external device writes the data to be sent to the Ethernet control module on the ARM side through Ethernet, and the ARM side sends the obtained data to the switch data configuration module on the FPGA side through the AXI bus. The switch data configuration module extracts valid information and notifies the switch output control module to complete the corresponding relay switching action according to the data content;

[0021] For controlling multiple switch inputs, the external relay action is input to the FPGA end as a switch signal. The switch input acquisition module extracts the valid information and sends it to the ARM end through the AXI bus. The Ethernet control module processes the data and then sends it byte by byte to the controller external device through Ethernet.

[0022] Furthermore, the switch input acquisition module extracts effective information therein, including:

[0023] Step 1: obtaining the original data to be sent and preprocessing the original data to be sent; filtering the preprocessed data to be sent by using a regular matching method to remove special switch characters that have no practical meaning;

[0024] Step 2: Enhance the filtered data to be sent, and randomly divide the enhanced data to be sent into a training set, a verification set, and a test set;

[0025] Step 3: construct a switch quantity configuration parameter detection model, and train the constructed switch quantity configuration parameter detection model to obtain a trained switch quantity configuration parameter detection model; use the trained switch quantity configuration parameter detection model to generate switch quantity configuration parameters for the test set to obtain a switch quantity pseudo configuration parameter sample;

[0026] Step 4: Fusion training set and switch quantity pseudo configuration parameter samples as a new training set, using open source model T5 and setting learning rate, input length, output length and batch size to retrain the training set and obtain the optimal switch quantity configuration parameter detection model; using the obtained optimal switch quantity configuration parameter detection model to predict the test set to generate binary switch quantity configuration parameters and using ROUGE to calculate the switch quantity configuration parameter detection model score;

[0027] Step 5, using the optimal switch value configuration parameter detection model to automatically extract binary switch value configuration parameters from the data to be sent;

[0028] Step six, the extracted binary switch configuration parameters are subjected to an improved binary switch character recognition method, and according to the switch action frequency characteristics, the overall complete binary switch character is obtained and accurately recognized.

[0029] In step 1, the original data to be sent is obtained, and the original data to be sent is preprocessed, including: determining whether the binary length of the data to be sent is greater than a preset threshold; if greater, truncating the binary of the data to be sent; if not greater, padding the binary of the data to be sent with 0s, so that the binary length of the data to be sent is consistent with the preset threshold;

[0030] In step 2, the filtered data to be sent is enhanced, including: using back translation, EDA and binary error correction to enhance the filtered data to be sent; using binary error correction to enhance the filtered data to be sent, and using edit distance to calculate the erroneous switch value characters in the to-be-sent data, the expression is:

[0031]

[0032] In the formula, S (r,p) (d, e) is the Levenshtein distance between the first d switch characters of r and the first e switch characters of p, d is the inserted switch character, e is the replaced switch character, is the indicator function, S (r,p) () is to delete switch characters from the switch character string r to reach p, max(d,e) is the maximum switch character, and min(d,e) is the minimum switch character.

[0033] In step three, the constructed switch configuration parameter detection model is trained, including: using the open source model T5 to set the model's learning rate, input length, output length, and batch size and train to obtain the trained switch configuration parameter detection model, wherein the switch configuration parameter detection model score calculation formula is as follows:

[0034]

[0035] score=0.2×f score (R1)+0.4×f score (R2)+0.4×f score (R3)

[0036] Where H is the switch configuration parameter marker for machine translation, E is the reference switch configuration parameter marker, and R LCS is the recall rate, P LCS is the accuracy rate, ROUGE is the switch quantity configuration parameter detection score, N is the multi-channel binary switch quantity character length, LCS(H,E) is the longest common switch quantum sequence, len(E) is the binary switch quantity character length of the returned switch quantity, L is the binary switch quantity character length of a single channel, and β is the switch quantity configuration coefficient.

[0037] In step six, the extracted binary switch configuration parameters are subjected to an improved binary switch character recognition method, and according to the switch action frequency characteristics, the overall complete binary switch character is obtained and accurately recognized, including:

[0038] The first step is to set the time interval Δt = 0.01 μs, and divide the single-channel 1ms binary switch character acquisition signal into 100 segments, and the length of each segment is I. Therefore, I = L / 100, L is the length of a single-channel binary switch character, and No = 1;

[0039] The second step is to take the No. segment data, perform short-time Fourier transform, obtain the switching action frequency of the No. segment data, and store it in the array X; find the maximum value XMAX of the switching action frequency amplitude in the high-frequency range, and calculate the amplitude average value XAV; λ1 is a constant coefficient greater than 3; if XMAX>λ1XAV, then the main frequency q=qXMAX;

[0040] The third step is to calculate the number of sampling points G corresponding to the full cycle at the frequency qXMAX; where G <I;

[0041] Step 4: Calculate cos(m×2π / G), sin(m×2π / G), m=1, 2…G-2, G-1;

[0042] Step 5: Take the No segment data and perform discrete Fourier transform calculation to obtain I-G+1 amplitudes, which are stored in array Y;

[0043] Step 6: Calculate the average value YAV of array Y and find the maximum value YMAX;

[0044] Step 7, λ2 is a constant coefficient less than 1; if YMAX<λ2YAN, then there is no binary switch character; otherwise, u=0;

[0045] Step 8: If Y[u]≥YMAX, then the starting point I1=u, otherwise u=u+1;

[0046] Step 9: Let I2 = I-G+1, starting from Y[I-G+1], proceed in reverse direction; λ3 is a constant coefficient less than 1; if Y[u]>λ3×YMAX, then I2 = u;

[0047] Step 10: If I2-I1>G, the binary switch character is obtained and the original data to be sent between I1-I2 is saved;

[0048] Step 11: No=No+1. If No>100, start recognizing binary switch characters.

[0049] In combination with all the above-mentioned technical solutions, the beneficial effects possessed by the present invention are as follows: the relay parallel control system of the present invention includes an Ethernet control module, a switch quantity data configuration module, a switch quantity input acquisition module and a switch quantity output control module. This controller based on the ZYNQ architecture can realize the complete parallel control of multi-channel switch quantity outputs, and at the same time has the switch quantity output information verification and output control functions to ensure the accuracy and reliability of the switch quantity output. Compared with the prior art, the present invention solves the problem that the traditional CPU architecture has poor control over the parallelism of multi-channel relays, thereby avoiding the potential non-simultaneous safety hazards brought by the traditional sequential control method. The present invention adopts the ZYNQ architecture, integrates the ARM-side main control part and the switch quantity action part together, and replaces the traditional "main processor + FPGA" design method with a single chip, which better saves the board area and reduces the development cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The accompanying drawings herein are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the principles of the present disclosure;

[0051] Figure 1 Schematic diagram of a multi-channel relay parallel control system based on ZYNQ provided by an embodiment of the present invention;

[0052] Figure 2It is a schematic diagram of a multi-channel relay parallel control system based on ZYNQ provided by an embodiment of the present invention;

[0053] In the figure: 1. Ethernet control module; 2. Switch data configuration module; 3. Switch input acquisition module; 4. Switch output control module; 5. ZYNQ processor. DETAILED DESCRIPTION

[0054] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention, so the present invention is not limited by the specific implementation disclosed below.

[0055] Embodiment 1, as Figure 1 As shown, the ZYNQ-based multi-channel relay parallel control system provided in an embodiment of the present invention includes an Ethernet control module 1, a switch data configuration module 2, a switch input acquisition module 3 and a switch output control module 4.

[0056] The control core of the multi-way relay parallel control system based on ZYNQ is the ZYNQ processor 5, which includes an ARM end and an FPGA end, and data is exchanged between the two ends through an AXI high-speed bus. The Ethernet control module 1 is located at the ARM end, and the switch data configuration module 2, the switch input acquisition module 3 and the switch output control module 4 are located at the FPGA end.

[0057] The Ethernet control module 1 is located at the ARM end of the ZYNQ processor 5, and Ethernet 0 is enabled by configuring and opening the MIO16 to MIO27 interfaces in Block Design. The network protocol stack LWIP is enabled in the BSP (Board Support Package) to provide a network transmission API interface function that can be called. The Ethernet transmission protocol between the Ethernet control module and the outside uses the UDP method without establishing a connection, and the Ethernet transmission rate is 1000M.

[0058] The network IP address of the Ethernet control module 1 is set to 192.168.1.110, the network mask is set to 255.255.255.0, and the external network setting should be in the same network segment as the Ethernet control module. Before receiving and sending data, the Ethernet control module first creates a new UDP PCB (Protocol Control Block) for communication through the API interface, and then binds the PCB to the local address, that is, calls the corresponding listening function under the library function to listen to the local IP address.

[0059] When there is external network data input, the Ethernet control module will cache the received valid data in the receiving buffer recv_buf, adjust the big and small end of the data and splice the bytes, convert it into 32-bit wide data, and send it to the FPGA end through the AXI bus. When data needs to be sent to the external network, the FPGA end will first send the data to the ARM end through the AXI bus, and the Ethernet control module will cache the valid data in the sending buffer send_buf, call the corresponding big and small end conversion function under the library function, split the 32-bit wide data into bytes, convert it into big and small end, and then send it to the outside byte by byte through Ethernet.

[0060] The main function of the switch quantity data configuration module 2 is to obtain the switch quantity configuration parameters sent by the ARM end. The ARM end writes the configuration parameters of the switch quantity to the FPGA end through the AXI bus. The switch quantity data configuration module 2 will parse the Ethernet message (parse according to the format of the message, such as valid data starts from the third byte, then start to take the number from the third byte) and extract the data therein and assign it to the output register kgl_reg_out. The data bit width of the output register is strongly related to the number of switch quantities. After the configuration parameters are completed, the ARM end will notify the switch quantity output control module 4, and the configuration parameters in the output register will control the corresponding path switch quantity according to the value of the corresponding bit, and then control the relay to complete the switch action. For example, the external switch quantity will be bound to the specified pin, and the output of 0 or 1 through the register will be output from the specified pin, and then output to the register through IO.

[0061] The main function of the switch quantity input acquisition module 3 is to obtain the action information of the external relay. The action information of the external relay will be converted into switch quantity information and input from each switch quantity. The switch quantity input acquisition module will cache the data information in the input register kgl_reg_in. The information of each bit of the input register represents the input information of each switch quantity. After the reception is completed, the content in the input register will be mapped to a certain address, and the ARM end will read the data at the address through the AXI bus to obtain the input of the switch quantity. The mapping is to put the data in the register under the specified address.

[0062] The main function of the switch quantity output control module 4 is to cooperate with the switch quantity data configuration module to complete the configuration output of the switch quantity. When the user configures multiple switch quantity outputs, the configuration information must first be written through the switch quantity data configuration module. The configuration information includes the high and low level output information of each switch quantity. After the configuration information is written, the ARM side will control the AXI bus to write the control information to the specified control address. After receiving the control information, the switch quantity output control module 4 will turn on the output master switch, and the configuration information will be sent out from each switch quantity at the same time, thereby controlling the back-end relay action. For example: the external switch quantity will be bound to a specified pin, and outputting 0 or 1 through the register will be output from the specified pin, and then output to the register through IO.

[0063] It can be seen from the above embodiments that the present invention provides a ZYNQ-based multi-relay parallel control method for providing a single controller with the capability of parallel control of multiple relays, which can achieve complete parallel control of multiple switch outputs and has switch output information verification and output control functions to ensure the accuracy and reliability of switch output.

[0064] Compared with the prior art, the present invention solves the problem of poor parallel control of multi-channel relays in the traditional CPU architecture, thereby avoiding the potential non-simultaneous safety hazards brought by the traditional sequential control method. The present invention adopts the ZYNQ architecture, integrates the ARM-side main control part and the switch action part together, and replaces the traditional "main processor + FPGA" design method with a single chip, which better saves the board area and reduces the development cost.

[0065] Example 2, illustrative, in the ZYNQ-based multi-channel relay parallel control method, the ZYNQ processor 5 uses the ZYNQ-7000 processor, including an FPGA processor part and a dual-core ARM cortex-A9 processor part, wherein the FPGA processor (PL end) and the ARM processor (PS end) are interconnected through the AXI internal bus to meet the ultra-high performance and complex system-on-chip (SoC) design requirements. The dual-core ARM processor is responsible for the overall system process control, Ethernet communication, switch parameter configuration and data processing; the FPGA processor is responsible for coordinating parameter configuration, multi-channel switch input and output control logic, and the connection between each module is as follows Figure 2 shown.

[0066] The ZYNQ-based multi-channel relay parallel control method includes the control logic for the input and output of the multi-channel switch quantity, and the process is as follows:

[0067] (1) The process of controlling multiple switch outputs is as follows: the controller external device (or host computer) writes the data to be sent to the Ethernet control module 1 on the ARM side through Ethernet, and the ARM side sends the obtained data to the switch data configuration module 2 on the FPGA side through the AXI bus. The switch data configuration module 2 extracts the valid information and notifies the switch output control module 4 to complete the corresponding relay switching action according to the data content. Among them, the valid information is the switch configuration parameters. For example, if 1 and 3 are turned on, bits 0 and 2 of the valid information are set to 1;

[0068] (2) The process of controlling multiple switch quantity inputs is as follows: the external relay action is input to the FPGA end as a switch quantity signal, the switch quantity input acquisition module 3 extracts the valid information therein and sends it to the ARM end through the AXI bus, and the Ethernet control module 1 processes the data and then sends it byte by byte to the controller external device through Ethernet.

[0069] Exemplarily, in the process of controlling the input and output of multiple switch quantities, the effective information is the switch quantity configuration parameter, and the extraction method includes:

[0070] Step 1: obtaining the original data to be sent and preprocessing the original data to be sent; filtering the preprocessed data to be sent by using a regular matching method to remove special switch characters that have no practical meaning;

[0071] Step 2: Enhance the filtered data to be sent; randomly divide the enhanced data to be sent into a training set, a validation set, and a test set;

[0072] Step 3: construct a switch quantity configuration parameter detection model, and train the constructed switch quantity configuration parameter detection model to obtain a trained switch quantity configuration parameter detection model; use the trained switch quantity configuration parameter detection model to generate switch quantity configuration parameters for the test set to obtain a switch quantity pseudo configuration parameter sample;

[0073] Step 4: Fusion training set and switch value pseudo configuration parameter samples as new training set, continue to use open source model T5 and set learning rate, input length, output length and batch size to retrain the training set and obtain the optimal switch value configuration parameter detection model;

[0074] Step 5, using the optimal switch value configuration parameter detection model to automatically extract binary switch value configuration parameters from the data to be sent;

[0075] Step six, the extracted binary switch configuration parameters are subjected to an improved binary switch character recognition method, and according to the switch action frequency characteristics, the overall complete binary switch character is obtained and accurately recognized.

[0076] In the step 1, preprocessing the original data to be sent includes:

[0077] Determine whether the binary length of the data to be sent is greater than a preset threshold; if so, truncate the binary length of the data to be sent; if not, pad the binary length of the data to be sent with 0s to make the binary length of the data to be sent consistent with the preset threshold;

[0078] In the step 2, the enhanced processing of the filtered data to be sent includes: enhancing the filtered data to be sent by back translation, EDA and binary error correction processing;

[0079] The method of using binary error correction processing to enhance the filtered data to be sent includes:

[0080] Use the edit distance to calculate the error switch character to be sent:

[0081]

[0082] In the formula, S (r,p) (d, e) is the Levenshtein distance between the first d switch characters of r and the first e switch characters of p, d is the inserted switch character, e is the replaced switch character, is the indicator function, S (r,p) () is to delete switch characters from the switch character string r to reach p, max(d,e) is the maximum switch character, and min(d,e) is the minimum switch character.

[0083] In step three, training the constructed switch configuration parameter detection model includes: using the open source model T5 to set the learning rate, input length, output length and batch size of the model and training to obtain the trained switch configuration parameter detection model;

[0084] Before step 5, the method further includes: using the obtained optimal switch quantity configuration parameter detection model to predict the test set to generate binary switch quantity configuration parameters and using ROUGE to calculate the switch quantity configuration parameter detection model score;

[0085] The switch configuration parameter detection model score calculation formula is as follows:

[0086]

[0087] score=0.2×f score (R1)+0.4×f score (R2)+0.4×f score (R3)

[0088] Where H is the switch configuration parameter marker for machine translation, E is the reference switch configuration parameter marker, and R LCS is the recall rate, P LCS is the accuracy rate, ROUGE is the switch quantity configuration parameter detection score, N is the multi-channel binary switch quantity character length, LCS(H,E) is the longest common switch quantum sequence, len(E) is the binary switch quantity character length of the returned switch quantity, L is the binary switch quantity character length of a single channel, and β is the switch quantity configuration coefficient.

[0089] In step six, the extracted binary switch configuration parameters are subjected to an improved binary switch character recognition method, and according to the switch action frequency characteristics, the overall complete binary switch character is obtained and accurately recognized, including:

[0090] The first step is to set the time interval Δt = 0.01 μs, and divide the single-channel 1ms binary switch character acquisition signal into 100 segments, and the length of each segment is I. Therefore, I = L / 100, L is the length of a single-channel binary switch character, and No = 1;

[0091] The second step is to take the No. segment data, perform short-time Fourier transform, obtain the switching action frequency of the No. segment data, and store it in the array X; find the maximum value XMAX of the switching action frequency amplitude in the high-frequency range, and calculate the amplitude average value XAV; λ1 is a constant coefficient greater than 3; if XMAX>λ1XAV, then the main frequency q=qXMAX;

[0092] The third step is to calculate the number of sampling points G corresponding to the full cycle at the frequency qXMAX; where G <I;

[0093] Step 4: Calculate cos(m×2π / G), sin(m×2π / G), m=1, 2…G-2, G-1;

[0094] Step 5: Take the No segment data and perform discrete Fourier transform calculation to obtain I-G+1 amplitudes, which are stored in array Y;

[0095] Step 6: Calculate the average value YAV of array Y and find the maximum value YMAX;

[0096] Step 7, λ2 is a constant coefficient less than 1; if YMAX<λ2YAV, then there is no binary switch character; otherwise, u=0;

[0097] Step 8: If Y[u]≥YMAX, then the starting point I1=u, otherwise u=u+1;

[0098] Step 9: Let I2 = I-G+1, starting from Y[I-G+1], proceed in reverse direction; λ3 is a constant coefficient less than 1; if Y[u]>λ3×YMAX, then I2 = u;

[0099] Step 10: If I2-I1>G, the binary switch character is obtained and the original data to be sent between I1-I2 is saved;

[0100] Step 11: No=No+1. If No>100, start recognizing binary switch characters.

[0101] The present invention processes irregular and noisy data sets and can better process the data sets.

[0102] The binary switch quantity configuration parameter extraction method of the present invention is relatively accurate, with small errors and error rates; and the present invention has low extraction efficiency and can accurately extract accurate switch quantity information.

[0103] The present invention can better handle the extraction of more frequent binary switch configuration parameters, and the extraction effect is relatively ideal. At the same time, more methods are used for data enhancement so that the data set itself can have diversity.

[0104] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0105] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principles of the present invention should be covered within the protection scope of the present invention.

Claims

1. A multi-channel relay parallel control system based on ZYNQ, It is characterized in that The system adopts ZYNQ architecture, integrating the ARM-side main control part and the switch action part, and parallelizing the multi-channel switch output through a single chip, including: The ZYNQ processor (5) integrates an ARM end and an FPGA end, and performs data exchange between the ARM end and the FPGA end through an AXI high-speed bus to complete input and output control of multiple switch quantities; The ARM end is configured with an Ethernet control module (1), which is used to receive the Ethernet data to be sent written by the controller external device, and is used to process the data as the switch signal input of the external relay action, and send it to the controller external device byte by byte through the Ethernet; The switch data configuration module (2) is used to obtain the switch configuration parameters sent by the ARM end; A switch quantity input acquisition module (3) is used to obtain the action information of the external relay; The switch quantity output control module (4) is used to cooperate with the switch quantity data configuration module (2) to complete the configuration output of the switch quantity.

2. According to the ZYNQ-based multi-channel relay parallel control system of claim 1, It is characterized in that The ARM end includes a dual-core ARM processor for overall process control, Ethernet communication, switch parameter configuration and data processing; The FPGA end includes an FPGA processor, which cooperates with parameter configuration and control logic of multi-channel switch input and output; The Ethernet control module (1) enables Ethernet 0 by configuring and opening the MIO16 to MIO27 interfaces in the Block Design; and enables the network transmission API interface function provided by the network protocol stack LWIP in the board support package BSP; Before receiving and sending data, the Ethernet control module (1) creates a new protocol control block UDP PCB for communication, binds the PCB to the local address, and listens to the local IP address.

3. The ZYNQ-based multi-channel relay parallel control system according to claim 1, It is characterized in that When external network data is input, the Ethernet control module (1) caches the received valid data into a receiving buffer recv_buf, performs big-endian and small-endian adjustment and byte splicing on the data, converts the data into 32-bit wide data, and sends the data to the FPGA end via the AXI bus; When data needs to be sent to the external network, the FPGA end sends the data to the ARM end via the AXI bus, and the Ethernet control module (1) caches the valid data into a sending buffer send_buf, splits the 32-bit wide data into bytes, performs big-endian and small-endian conversion, and sends the data byte by byte to the controller external device via Ethernet.

4. The ZYNQ-based multi-channel relay parallel control system according to claim 1, It is characterized in that The ARM end writes the configuration parameters of the switch quantity to the FPGA end through the AXI bus, and the switch quantity data configuration module (2) parses the Ethernet message and extracts the data therein and assigns it to the output register kgl_reg_out. The data bit width of the output register is strongly related to the number of the switch quantity. After the configuration parameters are completed, the ARM end notifies the switch quantity output control module (4), and the configuration parameters in the output register control the corresponding channel switch quantity according to the value of the corresponding bit, thereby controlling the relay to complete the switching action.

5. The ZYNQ-based multi-channel relay parallel control system according to claim 1, It is characterized in that When the action information of the external relay is converted into switch quantity information from each switch quantity input, the switch quantity input acquisition module (3) caches the data information into the input register kgl_reg_in, and each bit information of the input register represents the input information of each switch quantity; after the reception is completed, the content in the input register is mapped to a certain address, and the ARM end reads the data at the address through the AXI bus to obtain the input of the switch quantity.

6. A multi-channel relay parallel control method based on ZYNQ, It is characterized in that The method is run on a ZYNQ-based multi-channel relay parallel control system as described in any one of claims 1 to 5, and the method comprises: For controlling multiple switch outputs, the controller external device writes the data to be sent into the Ethernet control module (1) at the ARM end via Ethernet, and the ARM end sends the obtained data to the switch data configuration module (2) at the FPGA end via the AXI bus. The switch data configuration module (2) extracts valid information and notifies the switch output control module (4), and completes the corresponding relay switching action according to the data content. For controlling multiple switch quantity inputs, the external relay action is input to the FPGA end as a switch quantity signal, the switch quantity input acquisition module (3) extracts the effective information therein and sends it to the ARM end via the AXI bus, and the Ethernet control module (1) processes the data and then sends it byte by byte to the controller external device via Ethernet.

7. The ZYNQ-based multi-channel relay parallel control method according to claim 6, It is characterized in that The switch input acquisition module (3) extracts effective information therein, including: Step 1: obtain the original data to be sent and preprocess the original data to be sent; filter the preprocessed data to be sent by using regular matching to remove special switch characters that have no practical meaning; Step 2: Enhance the filtered data to be sent, and randomly divide the enhanced data to be sent into a training set, a verification set, and a test set; Step 3: construct a switch quantity configuration parameter detection model, and train the constructed switch quantity configuration parameter detection model to obtain a trained switch quantity configuration parameter detection model; use the trained switch quantity configuration parameter detection model to generate switch quantity configuration parameters for the test set to obtain a switch quantity pseudo configuration parameter sample; Step 4: Fusion training set and switch quantity pseudo configuration parameter samples as new training set, use open source model T5 and set learning rate, input length, output length and batch size to retrain the training set and obtain the optimal switch quantity configuration parameter detection model; use the obtained optimal switch quantity configuration parameter detection model to predict the test set to generate binary switch quantity configuration parameters and use ROUGE to calculate the switch quantity configuration parameter detection model score; Step 5, using the switch value configuration parameter detection model to automatically extract the binary switch value configuration parameters of the data to be extracted and sent; Step six, the extracted binary switch configuration parameters are subjected to an improved binary switch character recognition method, and according to the switch action frequency characteristics, the overall complete binary switch character is obtained and accurately recognized.

8. The ZYNQ-based multi-channel relay parallel control method according to claim 7, It is characterized in that In step 1, the original data to be sent is obtained, and the original data to be sent is preprocessed, including: determining whether the binary length of the data to be sent is greater than a preset threshold; if greater, truncating the binary of the data to be sent; if not greater, padding the binary of the data to be sent with 0s to make the binary length of the data to be sent consistent with the preset threshold; In step 2, the filtered data to be sent is enhanced, including: using back translation, EDA and binary error correction to enhance the filtered data to be sent; using binary error correction to enhance the filtered data to be sent, and using edit distance to calculate the erroneous switch value characters in the to-be-sent data, the expression is: In the formula, S (r,p) )d,e) is the Levenshtein distance between the first d switch characters of r and the first e switch characters of p, d is the inserted switch character, e is the replaced switch character, is the indicator function, S (r,p) () is to delete switch characters from the switch character string r to reach p, max(d,e) is the maximum switch character, and min(d,e) is the minimum switch character.

9. The ZYNQ-based multi-channel relay parallel control method according to claim 6, It is characterized in that In step three, the constructed switch configuration parameter detection model is trained, including: using the open source model T5 to set the model's learning rate, input length, output length, and batch size and train to obtain the trained switch configuration parameter detection model, wherein the switch configuration parameter detection model score calculation formula is as follows: score=0.2×f score (R 1 )+0.4×s score (R 2 )+0.4×f score (R 3 ) Where H is the switch configuration parameter marker for machine translation, E is the reference switch configuration parameter marker, and R LCS is the recall rate, P LCS is the accuracy rate, ROUGE is the switch quantity configuration parameter detection score, N is the multi-channel binary switch quantity character length, LCS(H,E) is the longest common switch quantum sequence, len(E) is the binary switch quantity character length of the returned switch quantity, L is the binary switch quantity character length of a single channel, and β is the switch quantity configuration coefficient.

10. The ZYNQ-based multi-channel relay parallel control method according to claim 6, It is characterized in that In step six, the extracted binary switch configuration parameters are subjected to an improved binary switch character recognition method, and according to the switch action frequency characteristics, the overall complete binary switch character is obtained and accurately recognized, including: The first step is to set the time interval Δt = 0.01 μs, and divide the single-channel 1ms binary switch character acquisition signal into 100 segments, and the length of each segment is I. Therefore, I = L / 100, L is the length of a single-channel binary switch character, and No = 1; The second step is to take the No. segment data, perform short-time Fourier transform, obtain the switching action frequency of the No. segment data, and store it in the array X; find the maximum value XMAX of the switching action frequency amplitude in the high-frequency range, and calculate the amplitude average value XAV; λ1 is a constant coefficient greater than 3; if XMAX>λ1XAV, then the main frequency q=qXMAX; The third step is to calculate the number of sampling points G corresponding to the full cycle at the frequency qXMAX; where G <I; Step 4: Calculate cos(m×2π / G), sin(m×2π / G), m=1, 2…G-2, G-1; Step 5: Take the No segment data and perform discrete Fourier transform calculation to obtain I-G+1 amplitudes, which are stored in array Y; Step 6: Calculate the average value YAN of array Y and find the maximum value YMAX; Step 7, λ2 is a constant coefficient less than 1; if YMAX<λ2YAV, then there is no binary switch character; otherwise, u=0; Step 8: If Y[u]≥YMAX, then the starting point I1=u, otherwise u=u+1; Step 9: Let I2 = I-G+1, starting from Y[I-G+1], proceed in reverse direction; λ3 is a constant coefficient less than 1; if Y[u]>λ3×YMAX, then I2 = u; Step 10: If I2-I1>G, the binary switch character is obtained and the original data to be sent between I1-I2 is saved; Step 11: No=No+1. If No>100, start recognizing binary switch characters.