SYSTEM, METHOD, AND APPARATUS FOR DEVICE CONTROL BASED ON OPTICAL COMMUNICATION
20240048877 ยท 2024-02-08
Inventors
Cpc classification
H04Q2011/0064
ELECTRICITY
H04L67/12
ELECTRICITY
H04L69/18
ELECTRICITY
International classification
Abstract
This application provides a system for device control based on optical communication. A device supporting optical communication is introduced into a conventional system for device control. The system includes a first controller, a first optical head-end, a first optical terminal, and a first field device. The first controller communicates with the first field device through the first optical head-end. The first field device communicates with the first controller through the first optical terminal. The first optical head-end communicates with the first optical terminal through an optical signal.
Claims
1. A method for device control, comprising: obtaining, by a first optical head-end, a first primary station packet from a first controller, wherein the first primary station packet comprises a first primary station data unit, the first primary station data unit comprises a destination identifier and first service data, the destination identifier comprised in the first primary station data unit is an identifier of a first field device, the first field device is a field device controlled by the first controller, and the destination identifier comprised in the first primary station data unit identifies a destination recipient of the first service data; determining, by the first optical head-end based on the destination identifier comprised in the first primary station data unit, a first optical terminal connected to the first field device; and constructing, by the first optical head-end, a first downlink transmission frame, and sending the first downlink transmission frame to the first optical terminal through an optical signal, wherein the first downlink transmission frame comprises the first primary station data unit and a header field corresponding to the first primary station data unit, the header field corresponding to the first primary station data unit comprises an identifier of the first optical terminal or a broadcast optical terminal identifier, and the identifier of the first optical terminal or the broadcast optical terminal identifier indicates the first optical terminal to process the first primary station data unit.
2. The method according to claim 1, wherein the first primary station packet further comprises a second primary station data unit, the second primary station data unit comprises a destination identifier and second service data, the destination identifier comprised in the second primary station data unit is an identifier of a second field device, and the second field device is a field device controlled by the first controller; and the method further comprises: determining, by the first optical head-end based on the destination identifier comprised in the second primary station data unit, a second optical terminal connected to the second field device, wherein the first downlink transmission frame constructed and sent by the first optical head-end further comprises the second primary station data unit and a header field corresponding to the second primary station data unit, the header field corresponding to the second primary station data unit comprises an identifier of the second optical terminal or a broadcast optical terminal identifier, and the identifier of the second optical terminal or the broadcast optical terminal identifier indicates the second optical terminal to process the second primary station data unit.
3. The method according to claim 2, wherein when the second primary station data unit and the first primary station data unit correspond to a same header field, an identifier comprised in the header field is the broadcast optical terminal identifier; and when the second primary station data unit and the first primary station data unit correspond to different header fields, an identifier comprised in the header field corresponding to the first primary station data unit is the identifier of the first optical terminal, and an identifier comprised in the header field corresponding to the second primary station data unit is the identifier of the second optical terminal.
4. The method according to claim 2, wherein after the sending, by the first optical head-end, the first downlink transmission frame, the method further comprises: receiving, by the first optical head-end, a first uplink transmission frame, wherein the first uplink transmission frame comprises a first uplink transmission subframe, the first uplink transmission subframe comprises a header field and a first secondary station data unit, the header field in the first uplink transmission subframe comprises the identifier of the first optical terminal, the first secondary station data unit comprises service data of the first field device and a source identifier, and the source identifier in the first secondary station data unit is the identifier of the first field device.
5. The method according to claim 4, wherein the first uplink transmission frame received by the first optical head-end further comprises a second uplink transmission subframe, the second uplink transmission subframe comprises a header field and a second secondary station data unit, the header field in the second uplink transmission subframe comprises the identifier of the second optical terminal, the second secondary station data unit comprises service data of the second field device and a source identifier, and the source identifier in the second secondary station data unit is the identifier of the second field device.
6. The method according to claim 4, wherein the first secondary station data unit further comprises a destination identifier, and the method further comprises: determining, by the first optical head-end based on the destination identifier comprised in the first secondary station data unit, a path for forwarding the first secondary station data unit.
7. The method according to claim 6, wherein the determining, by the first optical head-end based on the destination identifier comprised in the first secondary station data unit, a forwarding path specifically comprises: when the destination identifier comprised in the first secondary station data unit is an identifier of the first controller, sending, by the first optical head-end, the first secondary station data unit to the first controller; or when the destination identifier comprised in the first secondary station data unit is the identifier of the second field device, constructing, by the first optical head-end, a second downlink transmission frame based on the first secondary station data unit, wherein the second downlink transmission frame comprises the first secondary station data unit.
8. The method according to claim 1, wherein the method further comprises: obtaining, by the first optical head-end, a second primary station packet sent by the first controller, wherein the second primary station packet comprises a third primary station data unit, the third primary station data unit comprises a destination identifier and third service data, and the destination identifier comprised in the third primary station data unit is an identifier of a second controller; determining, by the first optical head-end based on the identifier of the second controller, a MAC address of a second optical head-end corresponding to the second controller; and sending, by the first optical head-end, the third primary station data unit to the second optical head-end based on the MAC address of the second optical head-end.
9. The method according to claim 8, wherein the method further comprises: receiving, by the first optical head-end, a second uplink transmission frame, wherein the second uplink transmission frame comprises a third uplink transmission subframe, the third uplink transmission subframe comprises a header field and a third secondary station data unit, the header field in the third uplink transmission subframe comprises the identifier of the first optical terminal, the third secondary station data unit comprises service data of the first field device, a source identifier, and a destination identifier, the source identifier in the third secondary station data unit is the identifier of the first field device, the destination identifier comprised in the third secondary station data unit is an identifier of a third field device, and the third field device is a field device controlled by the second controller; and determining, by the first optical head-end based on the destination identifier comprised in the third secondary station data unit, the MAC address of the second optical head-end corresponding to the second controller; and sending the third secondary station data unit to the second optical head-end based on the MAC address of the second optical head-end.
10. A method for device control, comprising: receiving, by a first optical terminal, a downlink optical signal from a first optical head-end, wherein the downlink optical signal comprises a first downlink transmission frame, the first downlink transmission frame comprises a first primary station data unit and a header field corresponding to the first primary station data unit, the header field corresponding to the first primary station data unit comprises an identifier of the first optical terminal or a broadcast optical terminal identifier, the first primary station data unit comprises a destination identifier and first service data, the destination identifier comprised in the first primary station data unit is an identifier of a first field device, and the first optical terminal is connected to the first field device; determining, by the first optical terminal based on the identifier of the first optical terminal or the broadcast optical terminal identifier comprised in the header field corresponding to the first primary station data unit, that the first primary station data unit is a to-be-processed data unit; and sending, by the first optical terminal, the first service data to the first field device based on the identifier of the first field device comprised in the first primary station data unit, or operating or controlling the first field device based on the first service data.
11. The method according to claim 10, wherein when the header field corresponding to the first primary station data unit comprises the broadcast optical terminal identifier, the method further comprises: determining, by the first optical terminal based on the destination identifier comprised in the first primary station data unit, that the first primary station data unit is the to-be-processed data unit.
12. The method according to claim 10, wherein the method further comprises: obtaining, by the first optical terminal, service data of the first field device, and encapsulating the service data of the first field device into a first uplink transmission subframe, wherein the first uplink transmission subframe comprises a header field and a first secondary station data unit, the header field in the first uplink transmission subframe comprises the identifier of the first optical terminal, the first secondary station data unit comprises the service data of the first field device and a source identifier, and the source identifier in the first secondary station data unit is the identifier of the first field device; and sending the first uplink transmission subframe to the first optical head-end through an optical signal.
13. The method according to claim 10, wherein the method further comprises: encapsulating, by the first optical terminal, the service data of the first field device into a third uplink transmission subframe, wherein the third uplink transmission subframe comprises a header field and a third secondary station data unit, the header field in the third uplink transmission subframe comprises the identifier of the first optical terminal, the third secondary station data unit comprises the service data of the first field device, a source identifier, and a destination identifier, the source identifier in the third secondary station data unit is the identifier of the first field device, and the destination identifier comprised in the third secondary station data unit is an identifier of another field device; and sending, by the first optical terminal, the third uplink transmission subframe to the first optical head-end through an optical signal.
14. The method according to claim 10, wherein any optical head-end is an OLT, and any optical terminal is an ONU or an ONT; and an identifier of the first optical head-end and the identifier of the first optical terminal each are a passive optical network PON identifier, and a type of the PON identifier comprises but is not limited to a gigabit-capable passive optical network encapsulation mode GEM port identifier and an Ethernet passive optical network EPON logical link identifier LLID.
15. The method according to claim 10, wherein any downlink transmission frame and any uplink transmission frame are in a GEM frame format, and a header field comprised in any downlink transmission frame and a header field comprised in any uplink transmission frame each are a GEM frame header field.
16. The method according to claim 10, wherein any primary station data unit and any secondary station data unit each further comprise at least one of the following fields: a data type, an operation type, a secondary station operation address offset, a payload length, a packet sequence number, a priority, a last packet data unit indication, a secondary station event, a response error code, and the like.
17. The method according to claim 16, wherein the sending, by the first optical terminal, the first service data to the first field device, or operating or controlling the first field device based on the first service data specifically comprises: sending, by the first optical terminal to the first field device, the operation type and the secondary station operation address offset that are comprised in the first primary station data unit, or operating or controlling the first field device based on the operation type and the secondary station operation address offset.
18. The method according to claim 16, wherein a data type indicated by the data type field comprises any one of the following data types: periodic real-time data, random access data, management data, and security data; and when the data type indicated by the data type field is the periodic real-time data or the random access data, a command type indicated by the operation type field comprises any one of the following types: a read operation, a write operation, a read/write operation, a broadcast write operation, and a loopback test; or when the data type indicated by the data type field is the management data, a command type indicated by the operation type field comprises any one of the following types: a read operation, a read response operation, a set operation, and a set response operation.
19. An apparatus for device control, wherein the apparatus comprises a processor and a transceiver, wherein the transceiver is configured to send and receive optical signals; and the processor is configured to execute instructions, and when the instructions are executed, the apparatus serves as a first optical head-end to: obtain, a first primary station packet from a first controller, wherein the first primary station packet comprises a first primary station data unit, the first primary station data unit comprises a destination identifier and first service data, the destination identifier comprised in the first primary station data unit is an identifier of a first field device, the first field device is a field device controlled by the first controller, and the destination identifier comprised in the first primary station data unit identifies a destination recipient of the first service data; determine, based on the destination identifier comprised in the first primary station data unit, a first optical terminal connected to the first field device; and construct, a first downlink transmission frame, and send the first downlink transmission frame to the first optical terminal through an optical signal, wherein the first downlink transmission frame comprises the first primary station data unit and a header field corresponding to the first primary station data unit, the header field corresponding to the first primary station data unit comprises an identifier of the first optical terminal or a broadcast optical terminal identifier, and the identifier of the first optical terminal or the broadcast optical terminal identifier indicates the first optical terminal to process the first primary station data unit.
20. An apparatus for device control, wherein the apparatus comprises a processor and a transceiver, wherein the transceiver is configured to send and receive optical signals; and the processor is configured to execute instructions, and when the instructions are executed, the apparatus serves as a first optical terminal to: receive, a downlink optical signal from a first optical head-end, wherein the downlink optical signal comprises a first downlink transmission frame, the first downlink transmission frame comprises a first primary station data unit and a header field corresponding to the first primary station data unit, the header field corresponding to the first primary station data unit comprises an identifier of the first optical terminal or a broadcast optical terminal identifier, the first primary station data unit comprises a destination identifier and first service data, the destination identifier comprised in the first primary station data unit is an identifier of a first field device, and the first optical terminal is connected to the first field device; determine, based on the identifier of the first optical terminal or the broadcast optical terminal identifier comprised in the header field corresponding to the first primary station data unit, that the first primary station data unit is a to-be-processed data unit; and send, the first service data to the first field device based on the identifier of the first field device comprised in the first primary station data unit, or operate or control the first field device based on the first service data.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0029]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
[0040]
[0041]
DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS
[0042] To make the objectives, technical solutions, and advantages of this application clearer, the following further describes implementations of this application in detail with reference to the accompanying drawings.
[0043] As shown in
[0044] As shown in
[0045] In a possible implementation, the point-to-multipoint optical communication network may be a passive optical network (PON), and includes a next-generation PON (NG-PON), NG-PON1, NG-PON2, gigabit-capable PON (GPON), 10-gigabit-per-second PON (10-gigabit-per-second PON, XG-PON), 10-gigabit-capable symmetric passive optical network (XGS-PON), Ethernet PON (Ethernet PON, EPON), 10-gigabit-per-second EPON (10G-EPON), next-generation EPON (NG-EPON), wavelength-division multiplexing (WDM) PON, time- and wavelength-division multiplexing (TWDM) PON, point-to-point (P2P) WDM PON (P2P-WDM PON), asynchronous transfer mode PON (APON), broadband PON (BPON), 25-gigabit-per-second PON (25G-PON), so-gigabit-per-second PON (soG-PON), mo-gigabit-per-second PON (100G-PON), 25-gigabit-per-second EPON (25G-EPON), so-gigabit-per-second EPON (soG-EPON), mo-gigabit-per-second EPON (100G-EPON), GPONs and EPONs having other rates, and the like. When the point-to-multipoint optical communication network is a PON network, a function of the optical head-end in
[0046] The controller 1 and the optical head-end 1 may be deployed separately, or may be deployed in an integrated manner. When the controller 1 and the optical head-end 1 are deployed separately, an interface between the controller 1 and the optical head-end 1 may be one of an Ethernet interface (FE, GE, or 10GE), a PCIE interface, or another interface. When the optical head-end 1 and the controller 1 are deployed in an integrated manner, the interface between the optical head-end 1 and the controller 1 is a software transceiver interface in a same device. The optical terminal and the field device may be deployed separately, or may be deployed in an integrated manner. Using the optical terminal 11 and the field device 11 as an example, when the optical terminal 11 and the field device 11 are deployed separately, an interface between the optical terminal 11 and the field device 11 may be one of an Ethernet interface (FE, GE, or 10GE), an SPI interface, or a servo motor monitoring and driving interface (AD, GPIO, RS422, PWM control, or the like). When the optical terminal 11 and the field device 11 are deployed in an integrated manner, the interface between the optical terminal 11 and the field device 11 is a software transceiver interface in a same device.
[0047] The system for device control shown in
[0048] The following separately describes the devices or apparatuses shown in
[0049] An optical head-end mainly sends and receives service data in a point-to-multipoint optical communication network. For example,
[0050] Controller module 401: As described above, the controller and the optical head-end may be deployed in an integrated manner. In the case of integrated deployment, the optical head-end includes a controller module to implement logic control programming of a field device, and a computing capability of the field device may further be implemented in this module, to reduce performance requirements on hardware or software of the field device. It should be noted that the controller described in this application may be the controller module 401 deployed in an integrated manner with the optical head-end, or may be a controller deployed separately from the optical head-end.
[0051] The head-end service module 402 is configured to identify a service data flow direction based on a destination identifier included in a data unit, and forward the data unit to the controller module 401 (or an external controller), the head-end Ethernet module 403, or the head-end point-to-multipoint module 404. Specifically, the head-end service module 402 is further configured to receive a packet sent by a controller, where the packet is also referred to as a primary station packet. As shown in
[0052] The head-end Ethernet module 403 is configured to provide an Ethernet interface, such as FE, GE, or 10GE, to receive and send Ethernet packets.
[0053] The head-end point-to-multipoint module 404 is configured to receive the data unit from the head-end service module, encapsulate the data unit into a downlink transmission frame suitable for transmission in a point-to-multipoint optical communication network, and send the downlink transmission frame through the head-end optical module 405. The head-end point-to-multipoint module 404 is further configured to receive an uplink transmission frame from a field device, and sends a data unit in the uplink transmission frame to the head-end service module 402 for processing. In a possible implementation, a downlink transmission frame includes at least one downlink transmission subframe, as shown in
[0054] The head-end optical module 405 is configured to provide an optical communication interface to send and receive optical signals. The optical signal may be of a single wavelength or a multiwavelength.
[0055] It should be noted that the foregoing division of the function modules of the optical head-end is only a possible implementation, and functions of the foregoing modules may alternatively be integrated or divided in other manners. For example, the head-end service module 402 and the head-end point-to-multipoint module 404 may be integrated into one function module.
[0056] An optical terminal sends and receives service data in a point-to-multipoint optical communication network. The optical terminal extracts a to-be-processed downlink transmission subframe from a received downlink optical signal, and sends service data carried in the downlink transmission subframe to a field device. The optical terminal receives service data sent by a field device, encapsulates the service data into an uplink transmission subframe, converts the uplink transmission subframe into an optical signal, and sends the optical signal to an optical head-end through the point-to-multipoint optical communication network. For example,
[0057] The terminal optical module 501 is configured to provide an optical communication interface to send and receive optical signals. The optical signal may be of a single wavelength or a multiwavelength.
[0058] The terminal point-to-multipoint module 502 is configured to receive a downlink transmission frame in a downlink direction, parse the downlink transmission frame to obtain a data unit, and send the data unit to the terminal service module 503. If the downlink transmission frame is in the encapsulation format shown in
[0059] The terminal service module 503 is configured to parse the data unit in the downlink direction, and send service data in the data unit to the device control module 504 or a field device. The terminal service module 503 may further determine, based on a destination identifier carried in the data unit, whether the destination identifier is an identifier of a field device connected to the optical terminal, to determine whether the data unit needs to be processed. The terminal service module 503 is further configured to receive service data from the device control module 504 or the field device in the uplink direction, encapsulate the service data into a data unit, and send the data unit to the terminal point-to-multipoint module 502. It should be noted that when the downlink transmission frame is in the encapsulation format shown in
[0060] Device control module 504: As described above, the optical terminal and the field device may be deployed in an integrated manner, or may be deployed separately. In the case of integrated deployment, the device control module 504 may be understood as a module for controlling the field device. It should be noted that the field device described in this application may be a field device that is deployed in an integrated manner with the optical terminal, or may be a field device that is deployed separately from the optical terminal.
[0061] It should be noted that the foregoing division of the function modules of the optical terminal is only a possible implementation, and functions of the foregoing modules may alternatively be integrated or divided in other manners. For example, the terminal service module 503 and the terminal point-to-multipoint module 502 may be integrated into one function module.
[0062] From the foregoing description of the system for device control shown in
[0063] The following describes a process of controlling a field device by a controller according to this application with reference to a method flowchart shown in
[0064] 1001: The controller sends a control instruction for controlling the field device. The control instruction is encapsulated in the primary station packet shown in
TABLE-US-00001 TABLE 1 Field name Field description Destination Address (DA)/Destination Destination address of a packet address Source Address (SA)/Source address Source address from which the packet is sent EtherType/Ethernet type Ethernet type PDUn/Data unit Carrying service data
[0065] The DA field identifies an address of a destination node of the packet. In the message in low, a value of this field may be a MAC address of the optical head-end. The SA field identifies an address of a source node of the packet. In the message in 1001, a value of this field may be a MAC address of the controller. The EtherType field identifies a type of an upper-layer protocol. The primary station packet includes at least one PDU. PDUn represents any one of the at least one PDU and is used for carrying service data. The PDU includes at least a source identifier, a destination identifier, and the service data. A possible PDU structure is shown in Table 2.
TABLE-US-00002 TABLE 2 Bit offset 7 6 5 4 3 2 1 0 Type/Data type cmd/Operation type Destination ID/Destination identifier SourceID/Source identifier offset1/Offset address 1 offset0/Offset address 0 len1/Payload length 1 len0/Payload length 0 payload/Payload
[0066] The destination identifier identifies a destination node identifier of the data unit. The source identifier identifies a source station identifier of the data unit. In the message in 1001, the destination node identifier in the PDU is an identifier of a field device (where the identifier of the field device may also be referred to as a secondary station identifier), and the source station identifier is an identifier of the controller (where the identifier of the controller may also be referred to as a primary station identifier). Content and a format of the service data are not limited in this application. The service data may be encapsulated in the payload field shown in Table 2. In addition to the payload field, one or more fields such as a data type field, an operation type field, and an offset address field may further be included. A data type that may be indicated by the data type field includes periodic real-time data, random access data, management data, security data, and the like. When the data type indicated by the data type field is the periodic real-time data or the random access data, a command type indicated by the operation type field may include a read operation, a write operation, a read/write operation, a broadcast write operation, a loopback test, and the like. When the data type indicated by the data type field is the management data, a command type indicated by the operation type field may include a read operation, a read response operation, a set operation, a set response operation, and the like. In Table 2, the offset address field occupies 12 bits, and the offset address field indicates a logical start offset address on which a secondary station needs to perform an operation. If all addresses need to be operated, the offset address may be set to 0. In addition to the fields shown in Table 2, the data unit may further include other fields, as shown in Table 3.
TABLE-US-00003 TABLE 3 Bit bit offset 7 6 5 4 3 2 1 0 Type/Data type cmd/Operation type Destination ID/Destination identifier SourceID/Source identifier offset1/Offset address 1 offseto/Offset address 0 len1/Payload length 1 leno/Payload length 0 sn/Packet sequence number pri/Packet r/Reserved eop_ind/ r/Reserved r/Reserved r/Reserved priority Last PDU indication event/Event err_code/Error code payload/Payload
[0067] The packet sequence number field is used for indicating a sequence number of a primary station packet sent by a primary station controller, and the secondary station carries a same sequence number value in a response message. In this way, after receiving service data of the secondary station, the primary station may learn, based on the packet sequence number, a primary station packet corresponding to the service data reported by the secondary station. The packet priority field is used for indicating a priority of the packet. The eop_ind field is used for indicating whether the PDU is a last PDU in the packet. The event field and the error code field are generally used by the secondary station to report a secondary station event and an error type to the primary station. In the primary station packet in 1001, the event field and the error code field in the PDU may be set to null.
[0068] 1003: After receiving the primary station control instruction, the optical head-end determines, based on the secondary station identifier included in the PDU in the primary station packet, that the destination node of the PDU is the secondary station or the field device, then encapsulates one or more PDUs in the primary station packet into a downlink transmission frame suitable for transmission in a point-to-multipoint optical communication network, and sends the downlink transmission frame through an optical signal. In addition to the one or more PDUs, the downlink transmission frame further includes a header field part. The header field part includes an identifier of the optical terminal, to indicate an optical terminal that needs to receive and process each PDU. It should be noted that when the point-to-multipoint optical transmission network is a GPON network, the identifier of the optical terminal may be a GEM port identifier of the optical terminal. When the point-to-multipoint optical transmission network is an EPON network, the identifier of the optical terminal may be a logical link identifier LLID of the optical terminal. In a possible implementation, the optical head-end generates one header field part for each PDU, and each PDU and the header field part corresponding to the PDU form one downlink transmission subframe, as shown in
[0069] 1005: The optical terminal receives the downlink transmission frame sent by the optical head-end, parses the downlink transmission frame, and sends the primary station control instruction to the corresponding field device. When a format of the downlink transmission frame is the format shown in
[0070] 1007: After performing an operation based on the primary station control instruction, the field device returns secondary station service data to the optical terminal. The secondary station service data may be content of the payload part in Table 2 or Table 3, or may further include content of other fields in Table 2 and Table 3, such as the secondary station event field and the error code field.
[0071] 1009: The optical terminal receives the secondary station service data, encapsulates the secondary station service data into the PDU format shown in Table 2 or Table 3, further encapsulates the secondary station service data in the PDU format into an uplink transmission frame suitable for transmission in the point-to-multipoint optical transmission network, and then sends the uplink transmission frame through an optical signal. A frame format of the uplink transmission frame may be a GPON encapsulation mode (GPON encapsulation mode/method, GEM) frame format of any GPON protocol. In a possible implementation, the uplink transmission frame is encapsulated into the format of the uplink transmission frame shown in
[0072] 111: The optical head-end receives the uplink transmission frame, parses the one or more uplink transmission subframes included in the uplink transmission frame, and obtains secondary station data units PDUs. The optical head-end sends the PDUs to the controller based on the destination identifiers included in the PDUs. A packet format of the secondary station data unit sent by the optical head-end to the controller may be the packet format shown in Table 1. If the optical head-end records, in step 1003, the sequence of the primary station data units sent by the controller, the optical head-end may further sort the secondary station data units based on source identifiers included in the secondary station data units, so that a sequence of the secondary station data units reported to the controller is consistent with the sequence of the primary station data units delivered by the controller. After receiving the secondary station service data, the controller parses the secondary station service data, and performs subsequent processing.
[0073] The foregoing describes a method procedure of controlling a secondary station by a controller through a point-to-multipoint optical communication network. It should be noted that the data formats and field names shown in Table 1 to Table 3 are merely examples, and the field names, lengths of the fields, a relationship between relative positions of the fields, and the like may be changed depending on an actual requirement. For example, in Table 2 and Table 3, fields such as the data type field, the operation type field, and the offset address field may alternatively be encapsulated in the payload field.
[0074] In the system for device control based on optical communication provided in this application, a controller may communicate, through a point-to-multipoint optical communication network, with a secondary station controlled or managed by the controller, and a plurality of secondary stations managed by a same controller may also communicate with each other. As shown in
[0075] 1101: The field device 11 sends service data to the optical terminal 11.
[0076] 1103: The optical terminal 11 encapsulates the service data of the secondary station 11 into the PDU format shown in
[0077] 1105: The optical head-end receives the uplink transmission frame, determines, based on the destination identifier in the PDU, that a destination recipient of the PDU is the field device 12, and encapsulates the PDU into a downlink transmission frame shown in
[0078] 1107: After receiving the downlink transmission frame, the optical terminal 12 parses the downlink transmission frame, and sends service data included in the downlink transmission frame to the field device 12. For details of the method performed by the optical terminal 12, refer to step 1005. Details are not described herein again.
[0079] When there are a plurality of controllers, as shown in
[0080] Because an optical head-end has an Ethernet communication interface, not only a plurality of field devices managed by a same controller can communicate with each other, but also field devices managed by different controllers can communicate with each other. As shown in
[0081] 1201: The field device 11 sends secondary station service data to the optical terminal 11.
[0082] 1203: The optical terminal 11 encapsulates the secondary station service data of the field device 11 into an uplink data frame. The uplink data frame includes a PDU, and a destination identifier carried in the PDU is an identifier of the field device 21.
[0083] 1205: The optical head-end 1 receives the uplink data frame sent by the optical terminal 11, determines, by parsing the PDU included in the uplink data frame, that the destination identifier carried in the PDU is neither an identifier of the controller 1 nor an identifier of any field device managed by the controller 1, and therefore sends the PDU to another optical head-end through the head-end Ethernet module. Optionally, identifiers of field devices are defined according to a specific rule. The optical head-end 1 may identify, based on the identifier of the field device 21, that the field device 21 is a field device managed by the controller 2. Therefore, the optical head-end 1 may send the PDU to the optical head-end 2. In a possible implementation, some bits of an identifier of a field device include an identifier of a controller. The optical head-end may determine, by parsing the identifier of the field device, the identifier of the controller that controls or manages the field device.
[0084] 1207: The optical head-end 2 receives the Ethernet packet sent by the optical head-end 1, and determines, by parsing the destination identifier in the PDU in the Ethernet packet, that a destination recipient of the PDU is the field device 21. The optical head-end 2 encapsulates the PDU into a downlink transmission frame, and sends the downlink transmission frame to the optical terminal 21.
[0085] 1209: The optical terminal 21 parses the downlink transmission frame, and sends service data included in the PDU to the field device 21.
[0086] It can be learned that because the point-to-multipoint optical communication network naturally has features such as low latency, high bandwidth, and low jitter, communication between a controller and a field device and communication between field devices in the industrial control system based on optical communication provided in this application also have features such as low latency, high bandwidth, and low jitter.
[0087] This application further provides a device 1300. The device 1300 may be specifically configured to implement a function of an optical head-end or an optical terminal in embodiments of this application. As shown in
[0088] The processor 1301 may be a general-purpose central processing unit (Central Processing Unit, CPU), a microprocessor, an application-specific integrated circuit ASIC, or at least one integrated circuit, and is configured to execute a related program, to implement technical solutions provided in embodiments of the present invention. The processor may independently have a PON-related protocol media access control (MAC) function, or may implement a PON protocol MAC function through an external chip, to implement communication between an optical head-end and an optical terminal. The device 1300 may include a plurality of processors, and each processor may include one or more CPUs. The processor 1301 is specifically responsible for performing the method related to the optical head-end or the optical terminal in this application, and communicating with the optical head-end or the optical terminal through the transceiver 1303. When the device 1300 is configured to implement the function of the optical head-end, the processor 1301 may correspond to the head-end service module 402 and the head-end point-to-multipoint module 404 in
[0089] The transceiver 1303 is configured to perform functions of sending and receiving uplink and downlink data frames in the foregoing embodiments. The transceiver 1303 includes an optical transmitter and/or an optical receiver. The optical transmitter may be configured to send an optical signal, and the optical receiver may be configured to receive the optical signal. The optical transmitter may be implemented through a light-emitting device, for example, a gas laser, a solid-state laser, a liquid laser, a semiconductor laser, or a directly modulated laser. The optical receiver may be implemented through an optical detector, for example, a photodetector or a photodiode (such as an avalanche photodiode). The transceiver 1303 may further include a digital-to-analog converter and an analog-to-digital converter. The transceiver 1303 may further include a wavelength-division multiplexer, configured to implement multiplexing and demultiplexing of optical signals of different wavelengths. When the device 1300 is configured to implement the function of the optical head-end, the transceiver 1303 may correspond to the head-end optical module 405 in
[0090] Optionally, the device 1300 may further include a memory 1302. The memory 1302 is configured to store program instructions and data. The memory may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). When the technical solutions provided in embodiments of the present invention are implemented through software or firmware, program code used for implementing the technical solutions provided in embodiments of the present invention is stored in the memory 1302, and is executed by the processor 1301.
[0091] In a possible implementation, the processor 1301 may include the memory 1302. In another possible implementation, the processor 1301 and the memory 1302 are two independent structures.
[0092] When the device 1300 is configured to implement the function of the optical head-end, the device 1300 may further include one or more other communication interfaces 1304, for example, a communication interface communicating with a controller and an Ethernet communication interface communicating with another optical head-end. When the device 1300 is configured to implement the function of the optical terminal, the device 1300 may also include one or more other communication interfaces 1304. For example, when the optical terminal and a field device are separately deployed, the optical terminal communicates with the field device through the communication interface 1304.
[0093] It should also be noted that the system, method, and apparatus provided in this application not only may be applied to the field of industrial control, but also may be applied to any device control scenario. Any controller or server may operate and control a device through the system and method provided in this application, and beneficial effects of low latency and high bandwidth brought by optical communication can also be obtained.
[0094] All or some of the foregoing embodiments may be implemented by software, hardware, firmware, or any combination thereof. When software is used to implement the embodiments, all or some of the embodiments may be implemented in a form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or some of procedures or functions in embodiments of the present invention are executed. The computer may be a general-purpose computer, a dedicated computer, a computer network, or any other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium, or may be transmitted from a computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, a computer, a server, or a data center to another website, computer, server, or data center in a wired (for example, a coaxial cable, an optical fiber, or a digital subscriber line (DSL)) or wireless (for example, infrared, radio, or microwave) manner. The computer-readable storage medium may be any usable medium accessible by the computer, or a data storage device, such as a server or a data center, integrating one or more usable media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, a DVD), a semiconductor medium (for example, a solid-state drive (SSD)), or the like.