Control method and device of communication master station, communication master station and communication system

By introducing optical network and double cache mechanisms into industrial bus systems to process data in parallel, the problem of low data transmission stability is solved and communication performance and stability is improved.

CN119814153APending Publication Date: 2025-04-11SUZHOU INOVANCE CONTROL TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411995136.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

In the process where the controller sends control information to the communication slave through the communication master station, the existing industrial bus system has the problem of low data transmission stability.

Method used

By setting up an optical network between the communication master station, the host computer and the communication slave station, optical communication is realized, and the dual cache mechanism and parallel data processing mechanism are adopted to optimize the data transmission and processing flow.

Benefits of technology

The communication performance between the communication master station and the host computer and the communication slave station is improved, the response performance is optimized, the communication stability is enhanced, and the communication slave controls the actuator more accurately and stably.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814153A_ABST
    Figure CN119814153A_ABST
Patent Text Reader

Abstract

The invention relates to a control method and device of a communication master station and the communication master station, and relates to the technical field of computers, the communication master station is connected with an upper computer and is connected with a communication slave station through an optical network, and the method comprises the following steps: receiving monitoring data which are acquired in a second clock period and uploaded by the communication slave station through optical communication in a first clock period, a control instruction is generated based on the monitoring data and configuration data received from the upper computer, and the second clock period is a previous clock period adjacent to the first clock period; the control instruction is sent to the communication slave station through optical communication in a third clock period, the third clock period is the next clock period adjacent to the first clock period, and the control instruction is used for instructing the communication slave station to control the execution structure connected with the communication slave station to execute the corresponding action. By adopting the scheme of the embodiment, the communication stability can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of industrial communication technology, and in particular to a control method and device for a communication master station, a communication master station, a communication system, a storage medium, and a computer program product. Background Art

[0002] With the development of industrial technology, in industrial sites, various communication needs between different systems and multi-axis devices are usually achieved through industrial bus systems. The industrial bus system includes a controller (also called a host computer), a communication master station, a communication slave station, and an actuator. Among them, the controller is connected to the communication master station, the communication master station is connected to the communication slave station, and the communication slave station is connected to the actuator on site. During operation, the controller sends control information to the actuator through the communication master station and the communication slave station. The actuator works after receiving the control information, and finally realizes the control of the actuator.

[0003] However, in the current bus system, when the control information of the controller is sent to the communication slave station through the communication master station, there is a problem of low data transmission stability. Summary of the invention

[0004] Based on this, it is necessary to provide a control method, device, communication master station, communication system, computer-readable storage medium and computer program product for a communication master station that can improve the stability of data transmission in response to the above technical problems.

[0005] In a first aspect, the present application provides a control method for a communication master station.

[0006] The communication master station is connected to the host computer and connected to the communication slave station via an optical network. The method includes:

[0007] Receiving, in a first clock cycle, monitoring data collected in a second clock cycle and uploaded by a communication slave station through optical communication, and generating a control instruction based on the monitoring data and configuration data received from a host computer, wherein the second clock cycle is a previous clock cycle adjacent to the first clock cycle;

[0008] The control instruction is sent to the communication slave station via optical communication in a third clock cycle, the third clock cycle being the next clock cycle adjacent to the first clock cycle, and the control instruction is used to instruct the communication slave station to control the connected execution structure to perform a corresponding action.

[0009] Based on the control method of the communication master station of this embodiment, the communication master station is connected to the host computer and the communication slave station through an optical network, so that optical communication can be used to communicate with the communication slave station. Optical communication has fast transmission speed, large communication capacity and strong anti-interference ability, which can improve the communication performance between the communication master station and the host computer and the communication slave station. What the communication master station receives from the communication slave station is the monitoring data collected in the previous clock cycle, and after processing the current clock cycle, the control instruction is sent to the communication slave station for execution in the next clock cycle. Therefore, the communication master station and the communication slave station can realize a parallel data processing mechanism. For high-speed motion, high-dynamic scenes with large complex fluctuations in industrial technology, the parallel processing mechanism can further optimize the response performance, improve the stability of communication, and make the control of the actuator by the communication slave station more accurate and stable.

[0010] In some embodiments, the communication master station is provided with a first buffer area and a second buffer area, and the method further comprises:

[0011] Writing data obtained from the host computer into the first buffer area, and reading data from the second buffer area;

[0012] Acquire a first usage status of the first cache area and a second usage status of the second cache area;

[0013] Based on the first usage state and the second usage state, attribute states of the first cache area and the second cache area are switched.

[0014] Based on this embodiment, the communication master station is provided with two cache areas, a first cache area and a second cache area, and writes data obtained from the host computer into the first cache area, and reads data from the second cache area, that is, independent write separation is realized through a double cache mechanism, and the attribute states of the first cache area and the second cache area are switched through the first usage state of the first cache area and the second usage state of the second cache area, so that the attribute states of the first cache area and the second cache area can be switched, so that data can be alternately stored and processed through double cache, which can improve the real-time and stability of data transmission.

[0015] In some embodiments, the communication master station is further provided with a spare buffer area; the first use state includes: a write rate of writing data obtained from the host computer into the first buffer area, and a first use rate of the first buffer area; the second use state includes: a read rate of reading data from the second buffer area, and a second use rate of the second buffer area;

[0016] The switching of the attribute states of the first cache area and the second cache area based on the first use state and the second use state includes:

[0017] Based on the write rate and the read rate, determining whether to enable a standby cache area, and if it is determined that the standby cache area is enabled, writing the data obtained from the host computer into the standby cache area;

[0018] Based on the first usage rate and the second usage rate, the read / write properties of the first cache area and the second cache area are switched, and the data obtained from the host computer is written into the second cache area after the read / write properties are switched, and data is read from the first cache area.

[0019] Based on the method of this embodiment, it can switch the read and write properties of the first cache area and the second cache area based on the first usage rate and the second usage rate, so that the writing and reading of data can be realized through the dual cache mechanism, which can reduce the processing delay problem caused by the lack of synchronization between writing data and reading data, and can improve security. Its communication master station is also provided with a spare cache area as a spare cache area. By monitoring the write rate of writing data to the first buffer area and the read rate of reading data from the second buffer area, it is dynamically determined whether to enable the spare spare cache area, so that the spare cache can be dynamically enabled as a temporary write space based on the write rate and the read rate, and the cache can be dynamically expanded during the peak period of data writing, which can avoid the risk of cache overflow, further improve security and reduce jitter risk, and improve stability.

[0020] In some embodiments, if the ratio of the write rate to the read rate is greater than or equal to a first ratio threshold, it is determined that the spare cache area is enabled.

[0021] Based on this embodiment, when the ratio of the write rate to the read-write rate is greater than or equal to the first ratio threshold, it means that the write rate and the read-write rate have reached a certain degree of mismatch, and the write rate is greater than the read-write rate. Therefore, it can be determined to enable the backup cache area to avoid the risk of cache overflow, so as to improve security and jitter risk.

[0022] In some embodiments, the determining whether to enable the backup cache area based on the write rate and the read rate includes:

[0023] Based on the write rate, the read rate, and the first usage rate, it is determined whether to enable the backup cache area.

[0024] Based on this embodiment, by further combining the first usage rate of the first cache area to comprehensively determine whether to enable the backup cache area, the frequent occupancy of cache space caused by frequent activation of the backup cache area due to mismatch between write rate and read data can be reduced, which can help improve the storage performance of the communication master station.

[0025] In some embodiments, determining whether to enable the backup cache area based on the write rate, the read rate, and the first usage rate includes:

[0026] If the ratio of the write rate to the read rate is greater than or equal to a second ratio threshold, and the first usage rate is greater than or equal to a first load threshold, it is determined to enable the backup cache area, and the second ratio threshold is greater than 1.

[0027] Based on this embodiment, when the ratio of the write rate to the read-write rate is greater than or equal to the second ratio threshold, it means that the write rate and the read-write rate have reached a certain degree of mismatch, and the write rate is greater than the read-write rate, and the first usage rate of the first cache area is greater than or equal to the first load threshold, which means that the usage rate of the first cache area has reached a certain level. Writing and reading data at the current write rate and read-write rate is prone to the risk of data overflow. Therefore, it can be determined to enable the backup cache area to avoid the risk of cache overflow, so as to improve security and jitter risk.

[0028] In some embodiments, the method further comprises:

[0029] If it is determined based on the write rate and the read rate that there is a need to increase the write rate, a first request is sent to the host computer, wherein the first request is used to instruct the host computer to increase the data transmission rate of sending data to the communication master station.

[0030] Based on this embodiment, it can be determined whether the write rate needs to be increased based on the write rate and the read rate. If the write rate needs to be increased, a first request can be sent to the host computer to instruct the host computer to increase the data sending rate, so that the data sending rate can be increased by the host computer, so that the write rate and the read rate can achieve a certain degree of matching, which can improve the stability of data writing and data reading.

[0031] In some embodiments, the method further comprises:

[0032] If the ratio of the write rate to the read rate is less than or equal to a third ratio threshold, and the first usage rate is less than or equal to a second load threshold, it is determined that there is a need to increase the write rate, and the third ratio threshold is less than 1.

[0033] Based on this embodiment, when the ratio of the write rate to the read rate is less than or equal to the third ratio threshold, it means that the write rate is already lower than the speed rate, and the first usage rate of the first cache area is less than or equal to the second load threshold, that is, the usage rate of the first cache area is low. If data is written and read according to the current write rate and read-write rate, there is a risk of data interruption. Therefore, it can be determined that there is a need to increase the write rate, which helps to improve stability.

[0034] In some embodiments, the method further comprises:

[0035] If it is determined based on the first usage rate and the second usage rate that the read-write attribute switching requirement is not met, and the first usage rate is greater than or equal to the third load threshold, the backup cache area is enabled and a second request is sent to the host computer, wherein the second request is used to instruct the host computer to reduce the data sending rate to the communication master station.

[0036] Based on this embodiment, when it is determined based on the first usage rate and the second usage rate that the read-write attribute switching requirement is not met, and the first usage rate is greater than or equal to the third load threshold, it means that the usage rate of the first cache area is relatively high, and there is a risk of data overflow, so the backup cache area is enabled to avoid data overflow, and a second request is sent to the host computer to enable the host computer to reduce the data sending rate to the communication master station, so that the write rate and the read rate can achieve a certain degree of matching, which can improve the stability of data writing and data reading.

[0037] In some embodiments, the method further comprises:

[0038] If the second usage rate is 0 and the first usage rate is less than a fourth load threshold, interpolation compensation is performed on the data in the first cache area.

[0039] Based on this embodiment, when the second usage rate is 0 and the first usage rate is less than the fourth load threshold, it means that the data in the second cache area has been read and written, and the amount of data stored in the first cache area is small, resulting in a cache interruption. Therefore, interpolation compensation can be performed on the data in the first cache area to maintain the continuity of communication, which can further help improve stability.

[0040] In some embodiments, the method further comprises:

[0041] If the second usage rate is 0, and the first usage rate is greater than or equal to a fifth load threshold, the read and write properties of the first cache area and the second cache area are switched.

[0042] Based on this embodiment, when the second usage rate is 0 and the first usage rate is greater than or equal to the fifth load threshold, it means that the data in the second cache area has been read and written, and the amount of data stored in the first cache area can meet the demand for continuous data flow. Therefore, the read and write properties of the first cache area and the second cache area can be switched, that is, switching to write data to the second cache area and read data from the first cache area, which can avoid interruption of reading data to maintain the continuity of communication, and can further help to improve stability.

[0043] In a second aspect, the present application also provides a control device for a communication master station, wherein:

[0044] The communication master station is connected to the host computer and is connected to the communication slave station through an optical network. The device includes:

[0045] A first data processing module is used to receive monitoring data collected in a second clock cycle and uploaded by a communication slave station through optical communication in a first clock cycle, and generate a control instruction based on the monitoring data and configuration data received from a host computer, wherein the second clock cycle is a previous clock cycle adjacent to the first clock cycle;

[0046] The second data processing module is used to send the control instruction to the communication slave station through optical communication in a third clock cycle, and the third clock cycle is the next clock cycle adjacent to the first clock cycle. The control instruction is used to instruct the communication slave station to control the connected execution structure to perform a corresponding action.

[0047] In a third aspect, the present application further provides a communication master station. The communication master station includes a memory and a processor, the memory stores a computer program, and the processor implements the steps in any of the above embodiments when executing the computer program.

[0048] In a fourth aspect, the present application also provides a communication system, which includes a host computer, multiple communication slaves and a communication master station as in the above embodiment, wherein the host computer is connected to the communication master station, and the communication master station is connected to the multiple communication slaves via optical communication.

[0049] In a fifth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in any of the above embodiments are implemented.

[0050] In a sixth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps in any of the above embodiments are implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 is a schematic diagram of the architecture of a communication system in one embodiment;

[0052] Figure 2 is a schematic diagram of the structure of a communication master station in an example;

[0053] Figure 3 It is a functional module diagram of a communication master station in an example;

[0054] Figure 4is a flow chart of a control method of a communication master station in one embodiment;

[0055] Figure 5 is a flow chart of a control method of a communication master station in another embodiment;

[0056] Figure 6 A schematic diagram of a flow chart of switching the attribute states of a first cache area and a second cache area based on a first use state and a second use state in an embodiment;

[0057] Figure 7 is a flow chart of a control method of a communication master station in another embodiment;

[0058] Figure 8 is a flow chart of a control method of a communication master station in another embodiment;

[0059] Fig. 9 is a flow chart of a control method of a communication master station in a specific example;

[0060] Fig.10 is a flow chart of a control method of a communication master station in a specific example;

[0061] Fig.11 A timing diagram of communication performed by a communication system in a specific example;

[0062] Fig.12 FIG. 4 is a structural block diagram of a control device of a communication master station in one embodiment. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0064] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0065] The following embodiments of the technical solution of the present application will be described in detail in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.

[0066] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.

[0067] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.

[0068] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0069] In the description of the embodiments of the present application, the term "and / or" is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0070] In the description of the embodiments of the present application, the term "multiple" refers to more than two (including two). Similarly, "multiple groups" refers to more than two groups (including two groups), and "multiple pieces" refers to more than two pieces (including two pieces).

[0071] At present, in the field of industrial communication, the industrial field bus needs to be able to meet various communication requirements between different systems and multi-axis devices. Usually, its high-speed transmission bandwidth supports bandwidth access of 1.0Gbps to 10.0Gbps. The existing industrial bus system realizes communication control through the cooperation of controllers, master stations, slave stations and actuators to meet communication needs. However, in actual industrial communication scenarios, such as the field of machine tool processing, this overall control solution has the problems of low processing efficiency and low processing quality. The existing solutions cannot meet the performance and functional requirements of some scenarios. This is because there are a large number of small line segment processing requirements in the field of machine tool processing. Therefore, it is necessary to improve efficiency and accuracy while ensuring consistent processing accuracy. Moreover, the bus communication system is limited by the isolation and complexity of the architecture, the transmission efficiency is not high, and real-time control and data interaction at the system level cannot be achieved.

[0072] After research, it was found that the efficiency of control and data interaction of the communication system is closely related to the fluency and efficiency of writing and reading data by the communication master station. Therefore, the communication performance and stability can be improved by setting and adjusting the communication process between the communication master station and the host computer and the communication slave station. On this basis, the mechanism for writing and reading data by the communication master station can be further set to improve the efficiency of control and data interaction of the communication system.

[0073] To solve this problem, the present invention provides a control method for a communication master station. The control method for a communication master station provided in the present invention can be applied to Figure 1 In the application environment shown. Among them, the application environment involves a communication system, and the communication system can specifically be an optical bus communication system. Among them, the schematic diagram of the structure of the optical bus communication system includes: a host computer 10, a communication master station (also referred to as an optical communication board) 20, n communication slave stations (also referred to as servo drives in the embodiment of the present application) 30 and n actuators 40. Among them, the host computer 10 is connected to the communication master station 20, the communication master station 20 is connected to n communication slave stations 30, and each communication slave station 30 is connected to an actuator 40. N is a natural number greater than or equal to 1. In the embodiment of the present application, the communication master station 20 is connected to the host computer 10, and is connected to the communication slave station 30 through optical communication. Among them, the way in which the communication master station 20 is connected to the host computer 10 is not limited. In the relevant embodiment of the present application, the communication master station 20 can be connected to the host computer 10 through the high-speed serial computer expansion bus standard PCIe.

[0074] Among them, the host computer 10 is used to parse the workpiece model, identify and analyze the control trajectory and debug visualization parameters; the communication master station 20 is used for motion planning and control, optical bus data transmission and optical network dynamic scheduling; the communication slave station 30 is used to perform motion control and motor control on the corresponding actuator 40.

[0075] The host computer 10 and the communication master station 20 may be different devices. In some embodiments, the host computer 10 and the communication master station may also be integrated into one, for example, the communication master station 20 is disposed on the host computer 10 .

[0076] refer to Figure 1 In the communication system shown, during downlink communication, the host computer 10 parses the original data according to the machine tool processing file, and sends the parsed data to the communication master station 20 through a message. Specifically, the message can be sent to the communication master station through PCIe (Peripheral Component Interconnect express, a high-speed serial computer expansion bus standard). After receiving the message, the communication master station 20 determines the message to be sent to the communication slave station 30, and uses the broadcast form to send the message to each communication slave station 30 through the optical network. Each communication slave station parses the message to obtain information according to its own station number or location, and controls the actuator 40 based on the obtained information.

[0077] During uplink communication, the communication slave station 30 uploads the message to the communication master station 20 in a multi-point-in-one manner. The communication master station 20 then transmits the message to the host computer 10 based on the received message. In a specific example, the message can be transmitted uplink to the host computer 10 via PCIe. The host computer 10 receives the message and parses the status and position information, which is used to record the working status and current position of the actuator 40.

[0078] Among them, the structural diagram of the communication master station in a specific example is as follows Figure 2 shown.

[0079] refer to Figure 2 As shown, the communication main station 20 may include a first processing module and a second processing module, wherein the first processing module may be implemented by an FPGA (field programmable gate array) and the second processing module may be implemented by an ARM (advanced reduced instruction set machine). Therefore, when the first processing module is implemented by an FPGA and the second processing module is implemented by an ARM, in some embodiments, the communication main station 20 may also be referred to as including an FPGA module and an ARM module. The following example is taken as an example in which the communication main station 20 includes an FPGA module and an ARM module.

[0080] The FPGA module includes a PCIe interface module, a clock module, and an optical module, which are used to configure the running program and receive and send messages in real time. The clock module is used to provide the high-precision clock required by the system, the optical module is used to complete the conversion of electrical and optical signals and transmit data through optical fibers, and the PCIe interface module is used to realize information interaction between the host computer and the communication master station.

[0081] The ARM module includes a data cache module, an instruction planning module, and a framing and deframing module. The data cache module is used to manage data storage (such as DDR (Double Data Rate) data storage) and buffer data to ensure system stability. The instruction planning module is used to perform trajectory planning and motion control calculations based on the instructions of the host computer and the feedback information of the communication slave station. The framing and deframing module is used to assemble and parse data according to the communication protocol.

[0082] Specifically, in a specific example, Figure 3 As shown, the communication master station can be functionally divided into a communication module (the PCIe communication module is used as an example in the embodiment of the present application), a cache module, a data generation module and a fiber optic communication module. Among them, the PCIe communication module is used to implement PCIe protocol transmission, which is used to solve the communication problem between the communication master station and the host computer. The cache module is used to solve the data transmission problem between ARM and FPGA, and is compatible with different data interfaces and clock domains. The fiber optic communication module is used to realize high-speed data transmission and reception, for example, through FIFO (First Input First Output, first-in-first-out queue) and SerDes (Serializer / Deserializer, a mainstream time division multiplexing (TDM), point-to-point (P2P) serial communication technology) IP core to realize high-speed data transmission and reception.

[0083] In some embodiments, Figure 4 As shown, a control method for a communication master station is provided, and the method is applied to Figure 1 The communication master station 20 in the embodiment is used as an example for explanation. This method can be applied to the communication master station in the optical bus communication system in the machine tool processing scenario.

[0084] Step S401: receiving monitoring data collected in a second clock cycle uploaded by a communication slave station in a first clock cycle, and generating control instructions based on the monitoring data and configuration data received from a host computer, wherein the second clock cycle is a previous clock cycle adjacent to the first clock cycle.

[0085] The first clock cycle may refer to the current clock cycle. The clock cycle may be the same as the signal synchronization cycle or the clock cycle of the communication master. The second clock cycle is the previous clock cycle adjacent to the first clock cycle. That is, after the communication slave collects the monitoring data in the second clock cycle, it uploads it to the communication master in the next first clock cycle.

[0086] Step S402: Send the control instruction to the communication slave station in a third clock cycle, where the third clock cycle is a next clock cycle adjacent to the first clock cycle, and the control instruction is used to instruct the communication slave station to control the connected execution structure to perform a corresponding action.

[0087] The third clock cycle is the next clock cycle adjacent to the first clock cycle, that is, after the communication master station generates a control instruction in the first clock cycle, it will not send it to the communication slave station immediately, but will send it to the communication slave station in the next third clock cycle.

[0088] Based on this embodiment, the communication master station is connected to the host computer and to the communication slave station through an optical network, so that communication can be carried out with the communication slave station through optical communication. Optical communication has fast transmission speed, large communication capacity and strong anti-interference ability, which can improve the communication performance between the communication master station and the host computer and the communication slave station. What the communication master station receives from the communication slave station is the monitoring data collected in the previous clock cycle, and after processing the current clock cycle, the control instruction is sent to the communication slave station for execution in the next clock cycle. Therefore, the communication master station and the communication slave station can realize a parallel data processing mechanism. For high-speed motion, complex and high-dynamic scenes with large fluctuations in industrial technology, the parallel processing mechanism can further optimize the response performance, improve the stability of communication, and make the control of the actuator by the communication slave station more precise and stable.

[0089] In the embodiment of the present application, the communication master station is provided with a first buffer area and a second buffer area. Figure 5 As shown, the communication method of the communication master station may also include:

[0090] Step S501: writing data obtained from the host computer into the first buffer area, and reading data from the second buffer area.

[0091] The dual buffer structure of the communication master station is formed based on the first buffer area and the second buffer area. In the first buffer area and the second buffer area, one buffer area is used to write data, that is, write data into the buffer area, and the other buffer area is used to read data, that is, read the data in the buffer area for the next step of processing.

[0092] Step S502: Obtain a first usage status of the first cache area and a second usage status of the second cache area.

[0093] The first usage status is information used to characterize the usage status of the first cache area. The type of information contained in the first usage status is not limited. In some examples, it may include the usage rate of the first cache area (referred to as the first usage rate in the embodiment of the present application), and in some examples, it may also include the write rate of writing data to the first cache area.

[0094] The write rate is the rate at which data is written to the first buffer area. It can be the rate at which the communication master station writes data to the first buffer area. Among them, since the communication master station receives data sent by the host computer and determines the instructions sent to the communication slave station based on the data sent by the host computer, the rate at which the host computer sends data will affect the rate at which the communication master station writes data. Therefore, in the relevant embodiments of the present application, the rate at which the host computer sends data can also be used as the write rate at which the communication master station writes data to the first buffer area.

[0095] The first usage rate is the ratio of the first buffer area used, which represents the usage of the first usage rate. When no data is written to the first buffer area, the first usage rate is 0, and when the first buffer area is full of data, the first usage rate is 100%.

[0096] The second usage status is information used to characterize the usage status of the second cache area. The type of information contained in the second usage status is not limited. In some examples, it may include the usage rate of the second cache area (referred to as the second usage rate in the embodiment of the present application). In some examples, it may also include the reading rate of reading data from the second cache area.

[0097] The read rate is the rate at which data is read from the second buffer. The second usage rate is the ratio of the second buffer area used, which represents the usage of the second usage rate. When the second buffer area is full and data has not been read, the second usage rate is 100%, and when the data in the second buffer area has been read and written, the second usage rate is 0.

[0098] Step S503: based on the first use state and the second use state, switching the attribute states of the first cache area and the second cache area.

[0099] The usage of the first cache area and the second cache area can be known through the first usage state of the first cache area and the second usage state of the second cache area, so that the attribute states of the first cache area and the second cache area can be switched on this basis.

[0100] Based on this embodiment, the communication master station is provided with two cache areas, a first cache area and a second cache area, and writes data obtained from the host computer into the first cache area, and reads data from the second cache area, that is, independent write separation is realized through a double cache mechanism, and the attribute states of the first cache area and the second cache area are switched through the first usage state of the first cache area and the second usage state of the second cache area, so that the attribute states of the first cache area and the second cache area can be switched, so that data can be alternately stored and processed through double cache, which can improve the real-time and stability of data transmission.

[0101] In some embodiments, the communication master station is further provided with a spare buffer area, and the first use state includes: the write rate of writing data obtained from the host computer into the first buffer area, and the first use rate of the first buffer area; the second use state includes: the read rate of reading data from the second buffer area, and the second use rate of the second buffer area as an example, refer to Figure 6 As shown, the above step S503 of switching the attribute states of the first cache area and the second cache area based on the first use state and the second use state includes:

[0102] Step S5031: Based on the write rate and the read rate, determine whether to enable the backup cache area, and if it is determined that the backup cache area is enabled, write the data obtained from the host computer into the backup cache area.

[0103] Since the write rate and the read rate are not necessarily the same, and both the host computer and the communication master station are high-speed devices, if the difference between the write rate and the read rate reaches a certain level, the first buffer may overflow. Therefore, the communication master station is provided with a backup cache area, and determines whether to enable the backup cache area based on the write rate and the read rate. After the backup cache area is enabled, the data obtained from the host computer can be written into the backup cache area to avoid data overflow.

[0104] Step S5032: Based on the first usage rate and the second usage rate, the read / write properties of the first cache area and the second cache area are switched, and data obtained from the host computer is written into the second cache area after the read / write properties are switched, and data is read from the first cache area.

[0105] After the conditions are met, the read and write properties of the cache area can be switched, and the cache area originally used for writing data is switched to be used for reading data, and the cache area originally used for reading data is used for writing data. In the embodiment of the present application, the cache area with write properties is called the first cache area, and the cache area with read properties is called the second cache area.

[0106] Based on the first usage rate and the second usage rate, the read and write conditions of the first cache area and the second cache area can be known, so that the switching of the read and write properties of the first cache area and the second cache area can be determined based on the first usage rate and the second usage rate, that is, after the read and write properties are switched, the first cache area is switched from a write cache area to a read cache area, that is, data is read from the first cache area, and the second cache area is switched from a read cache area to a write cache area, that is, data received from the upper computer is written into the second cache area.

[0107] After the read-write attributes are switched, the original first cache area of ​​the write attribute is switched to the cache area of ​​the read attribute, and the original second cache area of ​​the read attribute is switched to the cache area of ​​the write attribute. Therefore, after the read-write attributes are switched, the second cache area after switching the read-write attributes can be regarded as the first cache area, and the first cache area after switching the read-write attributes can be regarded as the second cache area, and the above processing process continues.

[0108] Based on the control method of the communication master station of this embodiment, it can switch the read and write properties of the first cache area and the second cache area based on the first usage rate and the second usage rate, so that the writing and reading of data can be realized through the dual cache mechanism, which can reduce the processing delay problem caused by the lack of synchronization between writing data and reading data, and can improve security. The communication master station is also provided with a spare cache area as a spare cache area. By monitoring the write rate of writing data to the first buffer area and the read rate of reading data from the second buffer area, it is dynamically determined whether to enable the spare spare cache area, so that the spare cache can be dynamically enabled as a temporary write space based on the write rate and the read rate, and the cache can be dynamically expanded during the peak period of data writing, which can avoid the risk of cache overflow, further improve security and reduce the risk of jitter, and improve stability.

[0109] In the above step S5031, there is no limitation on the manner of determining whether to enable the standby cache area based on the write rate and the read rate. Some of the manners are described below with examples.

[0110] In some embodiments, the step S5031 of determining whether to enable the backup cache area based on the write rate, the read rate, and the first usage rate includes:

[0111] If the ratio of the write rate to the read rate is greater than or equal to a first ratio threshold, it is determined that the backup cache area is enabled, and the first ratio threshold is greater than 1.

[0112] The first ratio threshold is a threshold used to analyze and determine the difference between the write rate and the read rate, and can be determined by combining experience or experimental analysis.

[0113] Based on this embodiment, when the ratio of the write rate to the read-write rate is greater than or equal to the first ratio threshold, since the first ratio threshold is greater than 1, it means that the write rate and the read-write rate have reached a certain degree of mismatch, and the write rate is greater than the read-write rate. Therefore, it can be determined to enable the backup cache area to avoid the risk of cache overflow, so as to improve security and jitter risk.

[0114] In some embodiments, it is also possible to determine whether to enable the backup cache area in combination with the first usage rate of the first cache area. In this case, the above step S5031 determines whether to enable the backup cache area based on the write rate and the read rate, including:

[0115] Based on the write rate, the read rate, and the first usage rate, it is determined whether to enable the backup cache area.

[0116] Based on this embodiment, by further combining the first usage rate of the first cache area, it is comprehensively determined whether to enable the backup cache area, that is, while considering the write rate and the read rate, the occupancy of the first cache area is also considered at the same time, thereby reducing the frequent occupancy of cache space caused by frequent activation of the backup cache area due to mismatch between the write rate and the read data, which can help improve the storage performance of the communication master station.

[0117] In some specific examples, determining whether to enable the backup cache area based on the write rate, the read rate, and the first usage rate includes:

[0118] If the ratio of the write rate to the read rate is greater than or equal to a second ratio threshold, and the first usage rate is greater than or equal to a first load threshold, it is determined that the backup cache area is enabled, and the second ratio threshold is greater than 1.

[0119] The second ratio threshold is a threshold used to analyze and determine the difference between the write rate and the read rate, and can be determined by combining experience or experimental analysis. The second ratio threshold can be the same value as the first ratio threshold, or can be the same value.

[0120] The first load threshold is a threshold used to analyze and determine the load level of the first cache area, and the load level represents the usage of the first cache area.

[0121] Based on this embodiment, when the ratio of the write rate to the read-write rate is greater than or equal to the second ratio threshold, it means that the write rate and the read-write rate have reached a certain degree of mismatch, and the write rate is greater than the read-write rate, and the first usage rate of the first cache area is greater than or equal to the first load threshold, which means that the usage rate of the first cache area has reached a certain level. If data continues to be written and read at the current write rate and read-write rate, there is a risk of data overflow. Therefore, it can be determined to enable the backup cache area to avoid the risk of cache overflow, so as to improve security and jitter risk.

[0122] In some embodiments, reference Figure 7 As shown, the method also includes:

[0123] Step S700: If it is determined based on the write rate and the read rate that there is a need to increase the write rate, a first request is sent to the host computer, wherein the first request is used to instruct the host computer to increase the data transmission rate of sending data to the communication master station.

[0124] Since the write rate and the read rate are not necessarily the same, and both the host computer and the communication master station are high-speed devices, if the difference between the write rate and the read rate reaches a certain level, or the write rate is lower than the read rate to a certain extent, it may cause insufficient data written in the first buffer after the data in the second buffer of the read attribute is read, resulting in data interruption. Therefore, it is also possible to determine whether the write rate needs to be increased based on the write rate and the read rate to reduce the possibility of interruption.

[0125] Given that the communication master station writes the data sent by the host computer into the first buffer, when there is a need to increase the write rate, that is, when the write rate needs to be increased, a first request can be sent to the host computer to request the host computer to increase the rate of sending data, thereby increasing the rate of writing data to the first buffer area.

[0126] Based on this embodiment, it can be determined whether the write rate needs to be increased based on the write rate and the read rate. If the write rate needs to be increased, a first request can be sent to the host computer to instruct the host computer to increase the data sending rate, so that the data sending rate can be increased by the host computer, so that the write rate and the read rate can achieve a certain degree of matching, which can improve the stability of data writing and data reading.

[0127] Wherein, based on the write rate and the read rate, the manner of determining whether there is a need to increase the write rate is not limited. In some embodiments, the method further includes:

[0128] If the ratio of the write rate to the read rate is less than or equal to a third ratio threshold, and the first usage rate is less than or equal to a second load threshold, it is determined that there is a need to increase the write rate, and the third ratio threshold is less than 1.

[0129] The third ratio threshold is a threshold used to analyze and determine the degree of difference between the write rate and the read rate, and can be determined by combining experience or experimental analysis.

[0130] Based on this embodiment, when the ratio of the write rate to the read rate is less than or equal to the third ratio threshold, it means that the write rate is already lower than the speed rate, and the first usage rate of the first cache area is less than or equal to the second load threshold, that is, the usage rate of the first cache area is low. If data is written and read according to the current write rate and read-write rate, there is a risk of data interruption. Therefore, it can be determined that there is a need to increase the write rate, which helps to improve stability.

[0131] In some embodiments, reference Figure 8 As shown, the method also includes:

[0132] Step S800: If it is determined based on the first usage rate and the second usage rate that the read-write attribute switching requirement is not met, and the first usage rate is greater than or equal to the third load threshold, the backup cache area is enabled, and a second request is sent to the host computer, wherein the second request is used to instruct the host computer to reduce the data sending rate to the communication master station.

[0133] Based on the first usage rate and the second usage rate, it is determined that the read-write attribute switching requirement is not met, indicating that the conditions for switching the read-write attributes of the first cache area and the second cache area are not met at this time, and the read-write attributes of the first cache area and the second cache area cannot be switched. The first usage rate of the first cache area is greater than or equal to the third load threshold, indicating that the first cache area has a lot of space written to it, and the remaining space may not be enough. Continuing to write is prone to the risk of data overflow, so the backup cache area can be started at the same time and the write rate of writing data to the first cache area can be reduced.

[0134] Given that the communication master station writes the data sent by the host computer into the first buffer, when there is a need to reduce the write rate, that is, when the write rate needs to be reduced, a second request can be sent to the host computer to request the host computer to reduce the rate at which data is sent, thereby reducing the rate at which data is written to the first buffer area.

[0135] Based on this embodiment, when it is determined based on the first usage rate and the second usage rate that the read-write attribute switching requirement is not met, and the first usage rate is greater than or equal to the third load threshold, it means that the usage rate of the first cache area is relatively high, and there is a risk of data overflow, so the backup cache area is enabled to avoid data overflow, and a second request is sent to the host computer to enable the host computer to reduce the data sending rate to the communication master station, so that the write rate and the read rate can achieve a certain degree of matching, which can improve the stability of data writing and data reading.

[0136] In some embodiments, reference Fig. 9 As shown, the method also includes:

[0137] Step S900: If the second usage rate is 0 and the first usage rate is less than a fourth load threshold, interpolation compensation is performed on the data in the first buffer area.

[0138] The fourth load threshold is a threshold used to analyze and determine the load level of the first cache area, and can be used to analyze and determine whether data flow is interrupted, and can be specifically determined based on experiments or experience.

[0139] The specific method of performing interpolation compensation is not limited, as long as the data in the first cache can be compensated to reduce the possibility of data interruption.

[0140] Based on this embodiment, when the second usage rate is 0 and the first usage rate is less than the fourth load threshold, it means that the data in the second cache area has been read and written, and the amount of data stored in the first cache area is small, resulting in a cache interruption. Therefore, interpolation compensation can be performed on the data in the first cache area to maintain the continuity of communication, which can further help improve stability.

[0141] In some embodiments, the switching of the read / write properties of the first cache area and the second cache area based on the first usage rate and the second usage rate in step S5032 may specifically include:

[0142] If the second usage rate is 0, and the first usage rate is greater than or equal to a fifth load threshold, the read and write properties of the first cache area and the second cache area are switched.

[0143] The fifth load threshold can be determined based on the need for data continuity, that is, when the first usage rate of the first cache area reaches the fifth load threshold, data interruption will not be caused, and the continuity of communication and control can be maintained. In some specific examples, the fifth load threshold and the fourth load threshold can be set to be the same.

[0144] Based on this embodiment, when the second usage rate is 0 and the first usage rate is greater than or equal to the fifth load threshold, it means that the data in the second cache area has been read and written, and the amount of data stored in the first cache area can meet the demand for continuous data flow. Therefore, the read and write properties of the first cache area and the second cache area can be switched, that is, switching to write data to the second cache area and read data from the first cache area, which can avoid interruption of reading data to maintain the continuity of communication, and can further help to improve stability.

[0145] Based on the above-mentioned embodiments, the following is illustrated with reference to specific examples. In the following examples, the second ratio threshold is 1.2, the third ratio threshold is 0.8, the first load threshold and the third load threshold are both 80%, and the second load threshold, the fourth load threshold, and the fourth load threshold are all 20%. It can be understood that in other embodiments, the thresholds can also be set in other ways.

[0146] refer to Fig.10 As shown, in this specific example, the control method of the communication master station includes the following steps.

[0147] Step S1001: The communication master station first initializes the cache area and allocates the cache. Specifically, two independent cache areas can be initialized: cache area A and cache area B, which are used for reading or writing respectively. The capacity of each cache is N units, and dynamic expansion is supported. Among them, when cache area A is used for writing and cache area B is used for reading, the first cache area is cache area A, and the second cache area is cache area B. When cache area A is used for reading and cache area B is used for writing, the first cache area is cache area B, and the second cache area is cache area A. In the following embodiments, cache area A is used for writing and cache area B is used for reading as an example for explanation.

[0148] The ARM module of the communication master station can synchronize the time base with the host computer through communication methods such as the PCIe bus to ensure the accuracy of periodic data transmission. Among them, the FPGA module of the communication master station can generate a system clock, such as a 31.25μs system clock, to provide a time base for switching and scheduling the read and write properties of the cache area.

[0149] During the bus communication process, the communication master station receives the data sent by the host computer and writes the data into a buffer area with write attributes (e.g., buffer area A). When writing data, the data can be written into the buffer area in a fixed frame format, and each frame contains: a frame header, a data body, and a check bit, wherein the frame header may include a frame sequence number and a time error, the data body includes actual control instructions and status information, and the check bit is used to verify the integrity of the data. After writing the data into buffer area A, the communication master station can send a write completion signal to the host computer.

[0150] The FPGA module of the communication master station can read a unit of data from the read attribute buffer (such as buffer B) at a fixed cycle (such as a clock cycle of 31.25μs) and send it to the communication slave station through the optical bus. After the data in the read attribute buffer (such as buffer B) is read, the ARM module of the communication master station can send a read completion signal to the host computer or FPGA module.

[0151] Step S1002: In the above process, the communication master station can detect the usage rate of the write cache area (such as cache area A) and the read cache area (such as cache area B) in real time. At the same time, the communication master station also monitors the write rate in real time. and read rate , and actually calculate the write rate and read rate Ratio , and combined with the first utilization of the write cache area and the second usage of the read cache , and the ratio , dynamically adjust the cache switching strategy.

[0152] Among them, if the current read buffer is empty ( = 0%), and the usage of the write cache >= 20%, indicating that the current read buffer has been completely read, and then proceeds to step S1003:

[0153] Step S1004: trigger cache switching. When performing cache switching, a switching request may be issued through the FPGA module of the communication master station to notify the ARM module of the communication master station to switch the read and write cache areas, such as switching cache area A from a write attribute to a read attribute, and switching cache area B from a read attribute to a write attribute. After the ARM module of the communication master station responds to the switching request, it updates the cache pointer: such as switching from cache A -> write mode, cache B -> read mode to cache B -> write mode, cache A -> read mode.

[0154] Among them, the communication master station reserves a certain amount of spare cache area for dynamic expansion during peak periods: if it is during peak period, the spare cache area is enabled as temporary write space; if the cache load decreases, the spare cache area is automatically released and the initial allocation strategy is restored.

[0155] Specifically:

[0156] like >1.2, and write cache > 80%, it is considered that there may be a risk of cache overflow, and the process goes to step S1005:

[0157] Step S1005: Activate the backup cache area.

[0158] like <0.8, and write cache < 80%, the system may have idle cache, and then proceed to step S1006:

[0159] Step S1006: Increase the writing rate. Specifically, a first request may be sent to the host computer to request the host computer to increase the data sending rate.

[0160] like =100%, and the conditions for switching the read-write attribute are not met, it means that the write buffer is full before the switch ( = 100%), if a buffer overflow occurs, then go to step S1007:

[0161] Step S1007: Start the backup cache area to reduce the write rate Specifically, the FPGA module of the communication master station notifies the ARM module of the communication master station to enable the spare buffer area, and sends a second request to the host computer to instruct the host computer to reduce the data transmission rate, thereby achieving abnormal and fault-tolerant processing when the buffer overflows.

[0162] like = 0%, and write cache <20%, it means that the read cache area has been exhausted before the switch, and the cache is disconnected, so the process goes to step S1008:

[0163] Step S1008: The FPGA module of the communication master station compensates for the missing data through an interpolation algorithm to maintain communication continuity and implement abnormal and fault-tolerant processing when the cache is disconnected.

[0164] Among them, the above-mentioned communication master station (the embodiment of the present application may also be referred to as the master station board) and the communication slave station (the embodiment of the present application may also be referred to as the slave station servo) can be processed through a parallel data processing mechanism. That is, the calculation and transmission in the communication master station are carried out simultaneously with the calculation and transmission of the communication slave station. In summary, in the nth allocation cycle or clock cycle, the slave station servo transmits the status and position information of the n-1th allocation cycle to the master station board. After receiving the information, the master station board performs calculations and other operations to generate new control information, and then in the n+1th allocation cycle, the information is sent to the slave station servo to form a closed loop between the entire system. For high-speed motion, complex and high-dynamic scenes such as machine tool processing, the parallel processing mechanism can further optimize the response performance and make the servo motion control more accurate and stable. That is, when the control information flows from the host computer to the master station board, the master station board will read the relevant instructions cached by the host computer. The slave station servo uploads status feedback in each allocation cycle, and the ARM end of the master station board uses the feedback information to update the motion control algorithm in real time and generate adaptive control instructions. In the next cycle, the updated control instructions are sent to the slave servo to form a closed-loop control.

[0165] Specifically, refer to Fig.11 As shown, in the specific communication process:

[0166] The FPGA module of the communication master station reads the information uploaded by the communication slave station, generates an interrupt signal I to the ARM module of the communication master station, and sends the data of the host computer to the communication slave station.

[0167] After receiving the interrupt signal I from the FPGA module of the communication master station, the ARM module of the communication master station reads the instructions cached by the host computer, executes the instruction plan, then reads the status and location information uploaded by the communication slave station, and finally sends the processed control information to the communication slave station.

[0168] The communication slave station receives the command sent by the communication master station and sends it to the actuator to control the actuator's action. The communication slave station also reads the actuator's feedback and transmits it uplink to the communication master station.

[0169] In the above process, the host computer generates and sends control information to ensure that the cache data in the board is not empty.

[0170] Based on the examples described above, it can be seen that the embodiments of the present application can realize the parallel data processing mechanism between the communication master station and the communication slave station based on optical communication, and can apply the optical bus system, parallel data and double buffer processing strategy in the machine tool equipment to meet the characteristics of short-cycle high response, reduce the possibility of data interruption caused by high execution load, operating system jitter, and unstable write data rate of the host computer, improve the real-time performance of the system, and improve resource utilization through the dynamic adjustment mechanism. Therefore, it can be used in the field of precision machine tool processing to meet the requirements of low bit error rate, low delay, low jitter and high precision between different systems and multi-axis equipment. After testing, it is found that it can achieve a network synchronization period of less than 31.25us, an uplink bandwidth of 1.25Gbps, a downlink bandwidth of 2.5 Gbps, a maximum number of 8 nodes, and a synchronization signal jitter of less than 200ns, and finally meet the requirements of low bit error rate, low delay, low jitter and high precision precision machine tool processing.

[0171] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0172] Based on the same inventive concept, the embodiment of the present application also provides a control device of a communication master station for implementing the control method of the communication master station involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the control device of one or more communication masters provided below can refer to the limitations of the control method of the communication master station above, and will not be repeated here.

[0173] In one embodiment, Fig.12 As shown, a control device for a communication master station is provided, wherein the communication master station is connected to a host computer and connected to a communication slave station via an optical network, and the device comprises:

[0174] A first data processing module 1201 is configured to receive, in a first clock cycle, monitoring data collected in a second clock cycle and uploaded by a communication slave station through optical communication, and to generate a control instruction based on the monitoring data and configuration data received from a host computer, wherein the second clock cycle is a previous clock cycle adjacent to the first clock cycle;

[0175] The second data processing module 1202 is used to send the control instruction to the communication slave station through optical communication in a third clock cycle, and the third clock cycle is the next clock cycle adjacent to the first clock cycle. The control instruction is used to instruct the communication slave station to control the connected execution structure to perform a corresponding action.

[0176] In some embodiments, the communication master station is provided with a first buffer area and a second buffer area, and the device includes:

[0177] A read / write processing module, used to write data obtained from the host computer into the first buffer area, and read data from the second buffer area;

[0178] A monitoring module, used to obtain a first usage status of the first cache area and a second usage status of the second cache area;

[0179] A switching control module is used to switch the attribute states of the first cache area and the second cache area based on the first use state and the second use state.

[0180] In some embodiments, the communication master station is further provided with a spare buffer area; the first use state includes: a write rate of writing data obtained from the host computer into the first buffer area, and a first use rate of the first buffer area; the second use state includes: a read rate of reading data from the second buffer area, and a second use rate of the second buffer area; the switching control module includes:

[0181] an optimization processing module, configured to determine whether to enable the standby cache area based on the write rate and the read rate, and write the data obtained from the host computer into the standby cache area if it is determined that the standby cache area is enabled;

[0182] A switching module is used to switch the read and write properties of the first cache area and the second cache area based on the first usage rate and the second usage rate, and switch to writing data obtained from the host computer into the second cache area after the read and write properties are switched, and reading data from the first cache area.

[0183] In some embodiments, the optimization processing module is further used to determine whether to enable the backup cache area based on the write rate, the read rate and the first usage rate.

[0184] In some embodiments, the optimization processing module is also used to determine to enable the backup cache area if the ratio of the write rate to the read rate is greater than or equal to a second ratio threshold, and the first usage rate is greater than or equal to a first load threshold, and the second ratio threshold is greater than 1.

[0185] In some embodiments, the optimization processing module is also used to send a first request to the host computer if it is determined that there is a need to increase the write rate based on the write rate and the read rate. The first request is used to instruct the host computer to increase the data sending rate to the communication master station.

[0186] In some embodiments, the optimization processing module is also used to determine that there is a need to increase the write rate if the ratio of the write rate to the read rate is less than or equal to a third ratio threshold, and the first usage rate is less than or equal to a second load threshold, and the third ratio threshold is less than 1.

[0187] In some embodiments, the optimization processing module is also used to enable the backup cache area and send a second request to the host computer if it is determined based on the first usage rate and the second usage rate that the read-write attribute switching requirement is not met, and the first usage rate is greater than or equal to a third load threshold, and the second request is used to instruct the host computer to reduce the data sending rate to the communication master station.

[0188] In some embodiments, the switching module is further configured to perform interpolation compensation on the data in the first cache area if the second usage rate is 0 and the first usage rate is less than a fourth load threshold.

[0189] In some embodiments, the switching module is further configured to switch the read and write properties of the first cache area and the second cache area if the second usage rate is 0 and the first usage rate is greater than or equal to a fifth load threshold.

[0190] Each module in the control device of the above-mentioned communication master station can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.

[0191] In one embodiment, a communication master station is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the method in any of the above embodiments are implemented.

[0192] In one embodiment, a communication system is provided, including a host computer, multiple communication slaves, and a communication master station as described above in any of the embodiments, wherein the host computer is connected to the communication master station, and the communication master station is connected to the multiple communication slaves via a high-speed serial computer expansion bus standard PCIe, and the communication master station executes the steps of the control method of the communication master station as described above in any of the embodiments.

[0193] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method in any of the above embodiments are implemented.

[0194] In one embodiment, a computer program product is provided, comprising a computer program, which implements the steps of the method in any of the above embodiments when executed by a processor.

[0195] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0196] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0197] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A control method for a communication master station, characterized in that: The communication master station is connected to the host computer and connected to the communication slave station via an optical network. The method includes: Receiving, in a first clock cycle, monitoring data collected in a second clock cycle and uploaded by a communication slave station through optical communication, and generating a control instruction based on the monitoring data and configuration data received from a host computer, wherein the second clock cycle is a previous clock cycle adjacent to the first clock cycle; The control instruction is sent to the communication slave station via optical communication in a third clock cycle, the third clock cycle being the next clock cycle adjacent to the first clock cycle, and the control instruction is used to instruct the communication slave station to control the connected execution structure to perform a corresponding action.

2. The method according to claim 1, characterized in that The communication master station is provided with a first buffer area and a second buffer area, and the method further comprises: Writing data obtained from the host computer into the first buffer area, and reading data from the second buffer area; Acquire a first usage status of the first cache area and a second usage status of the second cache area; Based on the first usage state and the second usage state, attribute states of the first cache area and the second cache area are switched.

3. The method according to claim 2, characterized in that The communication master station is also provided with a spare buffer area; the first use state includes: a write rate of writing data obtained from the host computer into the first buffer area, and a first use rate of the first buffer area; the second use state includes: a read rate of reading data from the second buffer area, and a second use rate of the second buffer area; The switching of the attribute states of the first cache area and the second cache area based on the first use state and the second use state includes: Based on the write rate and the read rate, determining whether to enable a standby cache area, and if it is determined that the standby cache area is enabled, writing the data obtained from the host computer into the standby cache area; Based on the first usage rate and the second usage rate, the read / write properties of the first cache area and the second cache area are switched, and the data obtained from the host computer is written into the second cache area after the read / write properties are switched, and data is read from the first cache area.

4. The method according to claim 3, characterized in that The determining whether to enable the backup cache area based on the write rate and the read rate includes: Based on the write rate, the read rate, and the first usage rate, it is determined whether to enable the backup cache area.

5. The method according to claim 4, characterized in that The determining whether to enable the backup cache area based on the write rate, the read rate, and the first usage rate includes: If the ratio of the write rate to the read rate is greater than or equal to a second ratio threshold, and the first usage rate is greater than or equal to a first load threshold, it is determined to enable the backup cache area, and the second ratio threshold is greater than 1.

6. The method according to any one of claims 3 to 5, characterized in that: The method further comprises: If it is determined based on the write rate and the read rate that there is a need to increase the write rate, a first request is sent to the host computer, wherein the first request is used to instruct the host computer to increase the data transmission rate of sending data to the communication master station.

7. The method according to claim 6, characterized in that The method further comprises: If the ratio of the write rate to the read rate is less than or equal to a third ratio threshold, and the first usage rate is less than or equal to a second load threshold, it is determined that there is a need to increase the write rate, and the third ratio threshold is less than 1.

8. The method according to any one of claims 3 to 5, characterized in that: The method further comprises: If it is determined based on the first usage rate and the second usage rate that the read-write attribute switching requirement is not met, and the first usage rate is greater than or equal to the third load threshold, the backup cache area is enabled and a second request is sent to the host computer, wherein the second request is used to instruct the host computer to reduce the data sending rate to the communication master station.

9. The method according to any one of claims 3 to 5, characterized in that: The method further comprises at least one of the following: If the second usage rate is 0, and the first usage rate is less than a fourth load threshold, performing interpolation compensation on the data in the first buffer area; If the second usage rate is 0, and the first usage rate is greater than or equal to a fifth load threshold, the read and write properties of the first cache area and the second cache area are switched.

10. A control device for a communication master station, characterized in that: The communication master station is connected to the host computer and connected to the communication slave station through an optical network. The device includes: A first data processing module is used to receive, in a first clock cycle, monitoring data collected in a second clock cycle and uploaded by a communication slave station through optical communication, and to generate a control instruction based on the monitoring data and configuration data received from a host computer, wherein the second clock cycle is a previous clock cycle adjacent to the first clock cycle; The second data processing module is used to send the control instruction to the communication slave station through optical communication in a third clock cycle, and the third clock cycle is the next clock cycle adjacent to the first clock cycle. The control instruction is used to instruct the communication slave station to control the connected execution structure to perform a corresponding action.

11. A communication master station, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the method according to any one of claims 1 to 9 when executing the computer program.

12. A communication system, characterized in that: It comprises a host computer, a plurality of communication slaves and a communication master station as claimed in claim 11, wherein the host computer is connected to the communication master station, and the communication master station is connected to the plurality of communication slaves via optical communication.

Citation Information

Cited By

  • EtherCAT real-time performance improving method and system, storage medium and program product

    CN120848442A