Method, device, electronic device and storage medium for communication of security control system
By introducing the target communication mode in the communication module of the security control system, the communication mode is determined according to the type of the data request instruction, and the problem of low data transmission efficiency between the upper machine and the controller is solved, and more efficient data transmission is achieved.
Patent Information
- Application Number
- CN202111428684.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-28
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2041-11-28
AI Technical Summary
In the security control system, when the data transmission volume between the upper computer and the controller is large, the load on the controller is too large, resulting in data transmission blockage and affecting efficiency.
By introducing the target communication mode (first, second, and third communication mode) in the communication module, determine the communication mode according to the type of the data request instruction, and the data transmission between the controller and the upper machine to relieve the data of the controller Treatment of pressure.
Effectively improve the data transmission efficiency between the upper machine and the controller, avoid data blockage, and reduce the load of the controller.
Smart Images

Figure CN114124306B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a method, device, electronic device and storage medium for security control system communication. Background Art
[0002] A safety control system is a highly reliable safety protection system that can avoid unsafe conditions of related equipment to the greatest extent possible, prevent the occurrence of serious accidents, or minimize losses after an accident, thereby protecting production equipment and, most importantly, personal safety.
[0003] The safety control system includes a host computer and a controller. The controller mainly controls the equipment connected to it under the monitoring of the host computer. Therefore, when the host computer communicates with the controller, the host computer usually obtains data directly from the controller.
[0004] However, when the amount of data transmission between the host computer and the controller is large, the controller performs too many data processing operations, which can easily cause the controller to be overloaded, resulting in data transmission congestion and affecting the efficiency of data transmission.
[0005] Therefore, how to improve the data transmission efficiency when the host computer communicates with the controller is a problem that needs to be solved. Summary of the invention
[0006] In this embodiment, a method, device, electronic device and storage medium for communication in a safety control system are provided, which are used to improve the data transmission efficiency when a host computer communicates with a controller.
[0007] In a first aspect, a method for communication of a security control system is provided in this embodiment. The security control system includes a host computer, a communication module, and a controller. The method is applied to the communication module. The method includes:
[0008] Receive the data request instruction sent by the host computer.
[0009] According to the data type requested by the data request instruction, the corresponding target communication mode is determined, wherein the target communication mode includes a first communication mode, a second communication mode and a third communication mode, the first communication mode is used to obtain the target data before receiving the data request instruction, the second communication mode is used to obtain the target data when the data request instruction is received, and the third communication mode is used to obtain the data address corresponding to the target data when the data request instruction is received.
[0010] According to the target communication mode, the target data in response to the data request instruction is fed back to the host computer, and the target data is obtained from the controller.
[0011] In some embodiments, the method further comprises:
[0012] The target data sent by the controller is periodically received.
[0013] The target data stored in the communication module is updated according to the received target data to obtain updated target data.
[0014] When the target communication mode is the first communication mode, feeding back the target data in response to the data request instruction to the host computer includes:
[0015] According to the updated target data, the target data in response to the data request instruction is sent to the host computer.
[0016] In some of these embodiments, the controller includes a plurality of communication channels.
[0017] The periodically receiving the target data sent by the controller includes:
[0018] Periodically receive the target data sent by each communication channel.
[0019] Feeding back the target data in response to the data request instruction to the host computer includes:
[0020] According to a first preset rule, the target data sent by the first target communication channel in response to the data request instruction is sent to the host computer.
[0021] In some embodiments, when the target communication mode is the second communication mode, feeding back the target data in response to the data request instruction to the host computer includes:
[0022] The data request instruction is sent to the controller.
[0023] The target data sent by the controller in response to the data request instruction is received.
[0024] The received target data is sent to the host computer.
[0025] In some of these embodiments, the controller includes a plurality of communication channels.
[0026] The sending the data request instruction to the controller includes: sending the data request instruction to each communication channel of the controller respectively.
[0027] The receiving the target data sent by the controller in response to the data request instruction includes: receiving the target data sent by each communication channel in response to the data request instruction.
[0028] The sending the received target data to the host computer includes: sending the target data sent by the second target communication channel to the host computer according to a second preset rule.
[0029] In some embodiments, when the target communication mode is the third communication mode, feeding back the target data in response to the data request instruction to the host computer includes:
[0030] A data address of target data in response to the data request instruction is acquired.
[0031] The data address is sent to the host computer, so that the host computer obtains the target data in response to the data request instruction from the controller according to the data address.
[0032] In some embodiments, the method further comprises:
[0033] Whitelist protocol filtering, current limiting, intrusion detection and packet filtering are performed on at least one of the data request instruction, target data and data address to obtain secure communication data.
[0034] Data transmission is performed based on the secure communication data.
[0035] In a second aspect, a device for controlling communication of a security system is provided in this embodiment, and the device includes:
[0036] The receiving module is used to receive the data request instruction sent by the host computer.
[0037] A determination module is used to determine a corresponding target communication mode according to the data type requested by the data request instruction, wherein the target communication mode includes a first communication mode, a second communication mode and a third communication mode, the first communication mode is used to obtain target data before receiving the data request instruction, the second communication mode is used to obtain target data when receiving the data request instruction, and the third communication mode is used to obtain a data address corresponding to the target data when receiving the data request instruction.
[0038] A feedback module is used to feed back target data in response to the data request instruction to the host computer according to the target communication mode, and the target data is obtained from the controller.
[0039] In some embodiments, the receiving module is further configured to:
[0040] The target data sent by the controller is periodically received.
[0041] The target data stored in the communication module is updated according to the received target data to obtain updated target data.
[0042] When the target communication mode is the first communication mode, the feedback module is specifically configured to:
[0043] According to the updated target data, the target data in response to the data request instruction is sent to the host computer.
[0044] In some of these embodiments, the controller includes a plurality of communication channels.
[0045] The receiving module is specifically used for periodically receiving target data sent by each communication channel.
[0046] The feedback module is specifically configured to: according to a first preset rule, send the target data sent by the first target communication channel in response to the data request instruction to the host computer.
[0047] In some embodiments, when the target communication mode is the second communication mode, the feedback module is specifically configured to:
[0048] The data request instruction is sent to the controller.
[0049] The target data sent by the controller in response to the data request instruction is received.
[0050] The received target data is sent to the host computer.
[0051] In some of these embodiments, the controller includes a plurality of communication channels.
[0052] The feedback module is specifically used to send the data request instruction to each communication channel of the controller respectively.
[0053] Receive target data sent by each communication channel in response to the data request instruction.
[0054] According to the second preset rule, the target data sent by the second target communication channel is sent to the host computer.
[0055] In some embodiments, when the target communication mode is the third communication mode, the feedback module is specifically configured to:
[0056] A data address of target data in response to the data request instruction is acquired.
[0057] The data address is sent to the host computer, so that the host computer obtains the target data in response to the data request instruction from the controller according to the data address.
[0058] In some of the embodiments, the apparatus further comprises:
[0059] The security detection module is used to perform whitelist protocol filtering, current limiting, intrusion detection and packet filtering on at least one of the data request instructions, target data and data addresses to obtain secure communication data.
[0060] Data transmission is performed based on the secure communication data.
[0061] In a third aspect, an electronic device is provided in this embodiment, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for security control system communication described in the first aspect is implemented.
[0062] In a fourth aspect, in this embodiment, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method for communication of a security control system described in the first aspect is implemented.
[0063] Compared with the related art, a method, device, electronic device and storage medium for security control system communication are provided in this embodiment. The method transmits the data transmitted between the host computer and the controller through the corresponding target communication mode according to the data type requested by the data request instruction. When the amount of data transmitted between the host computer and the controller is large, it can alleviate the controller's data processing operations, effectively improving the data transmission efficiency between the host computer and the controller.
[0064] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0066] Figure 1 It is a hardware structure block diagram of a terminal of a method for communication of a security control system provided in an embodiment of the present application.
[0067] Figure 2 It is a flow chart of a method for communication of a security control system provided in an embodiment of the present application.
[0068] Figure 3 A schematic diagram of a data transmission method under a first communication mode provided in an embodiment of the present application.
[0069] Figure 4 A schematic diagram of a data transmission method under a second communication mode provided in an embodiment of the present application.
[0070] Figure 5 A schematic diagram of another data transmission method under a second communication mode provided in an embodiment of the present application.
[0071] Figure 6 A schematic diagram of the communication module structure provided in an embodiment of the present application.
[0072] Figure 7 It is a structural block diagram of a device for security control system communication provided in an embodiment of the present application. DETAILED DESCRIPTION
[0073] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0074] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the", "these" and the like in this application do not represent quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. Usually, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0075] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 1 is a hardware structure block diagram of a terminal of a method for communication of a security control system provided in an embodiment of the present application. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 and memory 104 for storing data, wherein processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0076] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method of communication of the security control system in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0077] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by the communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0078] In the related art, when the host computer and the controller in the safety control system transmit data, the usual transmission method is that the controller sends its own data to the host computer according to the data request instructions of the host computer. Under this communication method, if the host computer sends a large number of data request instructions and the amount of data transmitted is large, the controller has to perform more data processing operations, which can easily cause the controller to be overloaded and form data congestion, thereby affecting the data transmission efficiency between the host computer and the controller.
[0079] Therefore, the present application provides a method, device, electronic device and storage medium for communication in a safety control system, which are used to improve the data transmission efficiency when a host computer communicates with a controller.
[0080] The security control system in the embodiment of the present application includes a host computer, a communication module and a controller. The communication method of the security control system of the present application can be applied to the communication module, and the communication module can be an electronic device. Optionally, the electronic device can be a server or a terminal device, but the present application is not limited to this.
[0081] In this embodiment, a method for communication of a security control system is provided. Figure 2 It is a flow chart of a method for communication of a security control system provided in an embodiment of the present application.
[0082] like Figure 2 As shown, the process includes the following steps:
[0083] Step S201, receiving a data request instruction sent by a host computer.
[0084] Specifically, in the safety control system, when the host computer needs to access data in the controller, the host computer sends a data request instruction to the communication module, and the communication module receives the data request instruction sent by the host computer.
[0085] Step S202: determining a corresponding target communication mode according to the data type requested by the data request instruction.
[0086] Among them, the target communication mode may include a first communication mode, a second communication mode and a third communication mode. The first communication mode is used to obtain target data before receiving a data request instruction, the second communication mode is used to obtain target data when a data request instruction is received, and the third communication mode is used to obtain the data address corresponding to the target data when a data request instruction is received.
[0087] Specifically, the communication module determines the data type requested by the data request instruction according to the received data request instruction, and determines the corresponding target communication mode according to the data type.
[0088] Exemplarily, the communication module determines the data type requested by the data request instruction and the corresponding target communication mode according to the corresponding relationship between the preset data type and the target communication mode.
[0089] The data types requested by the data request instruction may include first-category data, second-category data, and third-category data. The first-category data may be real-time data in the controller, such as time synchronization data of each device controlled by the controller. The second-category data may be commonly used variable data in the controller, such as variable parameters of each device. The third-category data may be device configuration data in the controller, such as adjustment data of a faulty device.
[0090] The data type requested by the data request instruction and the target communication mode may include the following corresponding relationships:
[0091] If the data request instruction requests access to the first type of data, the determined target communication mode is the first communication mode.
[0092] If the data request instruction requests access to the second type of data, the determined target communication mode is the second communication mode.
[0093] If the data request instruction requests access to the third type of data, the determined target communication mode is the third communication mode.
[0094] In the above implementation process, the communication module transmits the data transmitted between the host computer and the controller in the corresponding target communication mode according to the data type requested by the data request instruction, so as to realize classified transmission of the data between the host computer and the controller.
[0095] Step S203: Feedback target data in response to the data request instruction to the host computer according to the target communication mode.
[0096] The target data is obtained from the controller.
[0097] Specifically, the communication module feeds back the target data obtained from the controller to the host computer under the determined target communication mode.
[0098] Exemplarily, the target data may include first data, second data and third data, and the target data corresponds to the data type requested by the data request instruction, that is, the first data belongs to the first category of data, the second data belongs to the second category of data, and the third data belongs to the third category of data.
[0099] Furthermore, when executing step S203, any of the following methods may be used:
[0100] Mode 1: When the target communication mode is the first communication mode, the communication module obtains the first data before receiving the data request instruction, and sends the first data in response to the data request instruction to the host computer when receiving the data request instruction.
[0101] Mode 2: When the target communication mode is the second communication mode, upon receiving the data request instruction, the communication module obtains the second data in response to the data request instruction from the controller, and sends the second data to the host computer.
[0102] Method three: When the target communication mode is the third communication mode, the communication module obtains the data address corresponding to the third data when receiving the data request instruction. The communication module can feed back the third data in response to the data request instruction to the host computer according to the data address.
[0103] In the above implementation process, according to the data type requested by the data request instruction, the data transmitted between the host computer and the controller is transmitted through the corresponding target communication mode. When the amount of data transmitted between the host computer and the controller is large, the controller's data processing operations can be alleviated, effectively improving the data transmission efficiency between the host computer and the controller.
[0104] As an embodiment, when the first approach is adopted, the method may further include:
[0105] Step 1: Periodically receive the target data sent by the controller.
[0106] Step 2: Update the target data stored in the communication module according to the received target data to obtain updated target data.
[0107] Further, when the target communication mode is the first communication mode, feeding back the target data in response to the data request instruction to the host computer includes:
[0108] According to the updated target data, the target data in response to the data request instruction is sent to the host computer.
[0109] Exemplarily, the communication module periodically receives the first data sent by the controller, and updates the first data stored in the communication module according to the received first data to obtain updated first data.
[0110] Further, when the target communication mode is determined to be the first communication mode, the communication module may send the first data in response to the data request instruction to the host computer according to the updated first data.
[0111] It should be noted that in the first target communication mode, the communication process between the communication module and the controller is asynchronous with the communication process between the communication module and the host computer. Therefore, the communication module can obtain the first data sent by the controller before receiving the data request instruction, and save the obtained first data. When receiving the data request instruction, the first data in response to the data request instruction is sent to the host computer.
[0112] In one specific embodiment, the controller may include multiple communication channels.
[0113] Periodically receiving target data sent by the controller includes: periodically receiving target data sent by each communication channel.
[0114] Feeding back target data in response to the data request instruction to the host computer includes: according to a first preset rule, sending the target data in response to the data request instruction sent by the first target communication channel to the host computer.
[0115] Exemplarily, the communication module periodically receives the first data sent by each communication channel, and upon receiving the data request instruction, sends the first data sent by the first target communication channel in response to the data request instruction to the host computer according to the first preset rule.
[0116] It should be noted that the first preset rule can be to set the channel with the fastest data transmission speed among multiple communication channels as the first target communication channel, or to set a certain channel among the multiple communication channels as the first target communication channel, or to set any channel among the multiple communication channels as the first target communication channel, and there is no limitation here.
[0117] In the above implementation process, the controller periodically sends the target data to the communication module so that the communication module can obtain the target data, which is convenient for the communication module to feedback the target data to the host computer according to the data request instruction, and the communication process between the controller and the communication module is asynchronous with the communication process between the communication module and the host computer, so that the data transmission process between the communication module and the host computer is not affected by the controller, thereby improving the data transmission efficiency between the communication module and the host computer.
[0118] For example, Figure 3 As shown, Figure 3 A schematic diagram of a data transmission method under a first communication mode provided in an embodiment of the present application, the safety control system provided in the embodiment of the present application includes a host computer 1, a communication module 2 and a controller 3, and the controller 3 includes six channels: channel a, channel b, channel c, channel d, channel e and channel f.
[0119] In the first communication mode, the six channels of the controller 3 send the first data 4 to the communication module 2 every 1 second, and the communication module 2 updates the stored first data to the currently received first data 4 and saves them respectively.
[0120] If the first preset rule is to set channel a as the first target communication channel, when the communication module 2 receives the data request instruction 5 sent by the host computer 1, the communication module 2 will feedback the first data 4 corresponding to channel a to the host computer 1 so that the host computer 1 can obtain the first data 4.
[0121] It should be noted that in the embodiments of the present application, only the periodic interval time of 1 second is used as an example for illustration. In actual application, the periodic interval time can be every 0.5 seconds, every 2 seconds, every 3 seconds, or other time periods, and there is no limitation here.
[0122] It should be noted that the 6-channel controller in the embodiment of the present application can be a controller composed of two three-channel storage control units (Storage Control Unit, SCU), or a controller composed of one six-channel SCU, or a controller composed of three two-channel SCUs, without limitation here. In addition, the embodiment of the present application only takes the 6-channel controller as an example for illustration. In actual applications, the controller can be two-channel, three-channel, or four-channel, without limitation here.
[0123] In the above implementation process, the controller periodically sends the target data to the communication module, and the communication module saves the received target data. When the communication module receives the data request instruction sent by the host computer, it sends the target data stored in itself to the host computer, so that during the data transmission between the host computer and the controller, the host computer can obtain data from the communication module without the need for the host computer to directly obtain data from the controller. This communication method effectively reduces the controller's processing operations on data request instructions when the amount of data transmitted between the host computer and the controller is large, or the data request instructions sent by the host computer are frequent, and can avoid congestion in data transmission between the host computer and the controller, further improving data transmission efficiency.
[0124] As another embodiment, when the second method is used to perform step S203, the following steps may be used:
[0125] Step 1: Send a data request instruction to the controller.
[0126] Step 2: Receive target data sent by the controller in response to the data request instruction.
[0127] Step 3: Send the received target data to the host computer.
[0128] Exemplarily, the communication module sends a data request instruction to the controller, and the controller sends third data in response to the data request instruction to the communication module based on the received data request instruction. The communication module receives the third data and sends the received third data to the communication module.
[0129] In one specific embodiment, the controller may include multiple communication channels, and sending the data request instruction to the controller includes: sending the data request instruction to each communication channel of the controller respectively.
[0130] Receiving target data sent by the controller in response to the data request instruction includes: receiving target data sent by each communication channel in response to the data request instruction.
[0131] The received target data is sent to the host computer, including: according to a second preset rule, the target data sent by the second target communication channel is sent to the host computer.
[0132] It should be noted that the second preset rule can be to set the channel with the fastest data transmission speed among multiple communication channels as the second target communication channel, or to set a certain channel among the multiple communication channels as the second target communication channel, or to set any one of the multiple communication channels as the second target communication channel, and there is no limitation here.
[0133] Exemplarily, in the second communication mode, if any one of the multiple communication channels in the controller is used as the second target communication channel, if the data request instruction sent by the host computer to the communication module is a read data instruction, the communication module will send the read data instruction to each channel of the controller respectively, and after each channel of the controller receives the read data instruction, it will send the third data in response to the read data instruction to the communication module. If within a preset time period, the communication module receives the third data in response to the read data instruction sent by any one of the communication channels, the communication module will send the received third data in response to the read data instruction to the host computer.
[0134] For example, Figure 4 As shown, Figure 4 A schematic diagram of a data transmission method under a second communication mode provided in an embodiment of the present application, the safety control system provided in the embodiment of the present application includes a host computer 1, a communication module 2 and a controller 3, and the controller 3 includes six channels: channel a, channel b, channel c, channel d, channel e and channel f.
[0135] In the second communication mode, if channel a among multiple communication channels in the controller 3 is used as the second target communication channel, if the data request instruction sent by the host computer 1 to the communication module 2 is a read data instruction 401, the communication module will send the read data instruction 401 to each channel of the controller 3 respectively. After each channel of the controller 3 receives the read data instruction 401, it will send the third data 402 in response to the read data instruction to the communication module 2. If the communication module 2 does not receive the third data 402 in response to the read data instruction sent by channel a within the preset time period, even if the communication module 2 receives the third data 402 in response to the read data instruction sent by other communication channels except channel a within the preset time period, the communication module 2 will send the read data instruction 401 to each channel of the controller 3 again until the communication module 2 receives the third data 402 in response to the read data instruction sent by channel a within the preset time period, and sends the third data 402 in response to the read data instruction sent by channel a to the host computer.
[0136] In the above implementation process, when the communication module does not receive the target data in response to the read data instruction sent on the second target communication channel within a preset time period, the communication module will again send the read data request instruction to each channel of the controller, thereby ensuring that the communication module can receive valid target data in response to the read data instruction, thereby improving the security of the target data obtained by the host computer.
[0137] For example, Figure 5 As shown, Figure 5 A schematic diagram of another data transmission method under a second communication mode provided in an embodiment of the present application.
[0138] In the second communication mode, if any one of the multiple communication channels in the controller is used as the second target communication channel, if the data request instruction sent by the host computer 1 to the communication module 2 is a write data instruction 501, the communication module will send the write data instruction 501 to each channel of the controller 3 respectively. After each channel of the controller 3 receives the write data instruction 501, it will send the third data 502 in response to the write data instruction to the communication module 2. If the communication module 2 does not receive the third data 502 in response to the write data instruction sent by any communication channel within the preset time period, the communication module 2 will again send the write data instruction 501 to each channel of the controller 3 respectively, until the communication module 2 receives the third data 502 in response to the write data instruction sent by all channels within the preset time period, and then send the third data 502 in response to the write data instruction sent by any channel to the host computer.
[0139] It should be noted that the preset time period can be 1 second, 2 seconds, or 3 seconds, and there is no limitation here.
[0140] In the above implementation process, if the communication module does not receive the target data in response to the write data instruction sent by any communication channel within the preset time period, the communication module will send the write data instruction to each communication channel of the controller again until the communication module receives the target data in response to the write data instruction sent by each communication channel within the preset time period, thereby ensuring that the data write operation is implemented on each communication channel in the controller.
[0141] As an embodiment, when the third method is adopted to perform step S203, the following steps may be adopted:
[0142] Step 1: Obtain the data address of the target data in response to the data request instruction.
[0143] Specifically, the communication module sends the data request instruction to the controller, and the controller sends the data address in response to the data request instruction to the communication module, so that the communication module obtains the data address in response to the data request instruction.
[0144] It should be noted that, when receiving the data request instruction, the communication module may also obtain the data address in response to the data request instruction from other locations other than the controller, for example, a preset database.
[0145] Step 2: Send the data address to the host computer so that the host computer obtains the target data in response to the data request instruction from the controller according to the data address.
[0146] Specifically, the communication module sends the acquired data address to the host computer, and further, the host computer acquires the target data in response to the data request instruction from the controller according to the data address.
[0147] Exemplarily, the communication module sends a data request instruction to the controller, the controller sends a data address in response to the data request instruction to the communication module, and sends the data address to the host computer, so that the host computer obtains third data in response to the data request instruction from the controller according to the data address.
[0148] As another embodiment, when the third method is adopted to perform step S203, the following steps may also be adopted:
[0149] Step 1: Obtain the data address of the target data in response to the data request instruction.
[0150] Step 2: The communication module obtains the target data from the controller according to the data address, and sends the obtained target data to the host computer.
[0151] Exemplarily, the communication module sends a data request instruction to the controller, and the controller sends a data address in response to the data request instruction to the communication module. Further, the communication module obtains third data from the controller according to the data address and sends the obtained third data to the host computer.
[0152] In the above implementation process, the controller sends the data address in response to the data request instruction to the communication module. Further, the communication module sends the data address to the host computer so that the host computer obtains the target data from the controller according to the data address, thereby reducing the controller's operation of extracting the target data, alleviating the load pressure of the controller, and further improving the controller's processing efficiency of other data, thereby also improving the data transmission efficiency between the host computer and the controller.
[0153] In the above implementation process, according to the data type requested by the data request instruction, the data transmitted between the host computer and the controller is transmitted through the corresponding target communication mode, so that the data between the host computer and the controller can be classified and transmitted. In the first communication mode, the communication module obtains the first data before receiving the data request instruction. When the communication module receives the data request instruction, the communication module can directly feed back the first data obtained by itself to the host computer without waiting for the controller to process the data request instruction and then obtain the first data from the controller. Further, the processing operation of the controller on the data request instruction is reduced, and the transmission efficiency of the data between the host computer and the controller is improved; the communication module receives the data requested by the data request instruction sent by the host computer according to the data requested by the data request instruction The types are classified and processed, so that the controller only processes the corresponding data request instructions in the second communication mode, thereby effectively alleviating the operating pressure of the controller and improving the data transmission efficiency between the host computer and the controller; in the third communication mode, the host computer can obtain data from the controller according to the data address, and the controller does not need to feedback the data requested by the data request instruction, which further reduces the data processing operation of the controller and improves the data transmission efficiency between the host computer and the controller. Therefore, the communication module transmits the data transmitted between the host computer and the controller through the corresponding target communication mode according to the data type requested by the data request instruction, which alleviates the data processing operation of the controller and effectively improves the data transmission efficiency between the host computer and the controller.
[0154] As an embodiment, the method for communication of a security control system provided in the present application may further include the following steps:
[0155] Step 1: Perform whitelist protocol filtering, current limiting, intrusion detection, and packet filtering on at least one of the data request instruction, target data, and data address to obtain secure communication data.
[0156] Specifically, the communication module may include a firewall, through which whitelist protocol filtering, current limiting, intrusion detection and packet filtering are performed on at least one of data request instructions, target data and data addresses to obtain secure communication data.
[0157] Step 2: Data transmission based on secure communication data.
[0158] Specifically, the communication module sends the security data that passes through the firewall to the host computer, or sends the security data that passes through the firewall to the controller.
[0159] As an example, Figure 6 As shown, Figure 6 A schematic diagram of a communication module structure provided in an embodiment of the present application, the communication module 2 may include a protocol processor 21 and a data processor 22, and the firewall may include a first firewall 211 and a second firewall 221.
[0160] The first firewall 211 is arranged in the protocol processor 21, and is used to perform whitelist protocol filtering, current limiting, and intrusion detection on the communication data in the communication module to obtain initial security data.
[0161] The second firewall 221 is disposed in the data processor 22 and is used to perform packet filtering on the initial security data to obtain secure communication data.
[0162] Furthermore, the protocol processor and the data processor may also respectively set a secure communication protocol and a secure communication interface, through which the communication data can be detected.
[0163] Optionally, the protocol processor 21 and the data processor 22 in the communication module 2 can adopt an asymmetric multi-processing (AMP) architecture, the data processor 22 uses the foreground and background systems for task scheduling, and the protocol processor 21 uses the UC / OS II operating system for multi-task scheduling to improve data processing efficiency.
[0164] In the above implementation process, the communication data in the communication module is filtered by the firewall, and the communication data is limited, intrusion detection and packet filtering are performed, which can effectively improve the security of data transmission between the host computer and the controller.
[0165] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0166] In this embodiment, a device for communication of a safety control system is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. The terms "module", "unit", "subunit" and the like used below can implement a combination of software and / or hardware of predetermined functions. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0167] like Figure 7 As shown, Figure 7 A structural block diagram of a device for communication of a security control system provided in an embodiment of the present application, the device comprising:
[0168] The receiving module 701 is used to receive a data request instruction sent by a host computer.
[0169] Determination module 702 is used to determine the corresponding target communication mode according to the data type requested by the data request instruction, wherein the target communication mode includes a first communication mode, a second communication mode and a third communication mode, the first communication mode is used to obtain the target data before receiving the data request instruction, the second communication mode is used to obtain the target data when the data request instruction is received, and the third communication mode is used to obtain the data address corresponding to the target data when the data request instruction is received.
[0170] The feedback module 703 is used to feed back the target data in response to the data request instruction to the host computer according to the target communication mode, and the target data is obtained from the controller.
[0171] In some embodiments, the receiving module 701 is further configured to:
[0172] Periodically receive target data sent by the controller.
[0173] The target data stored in the communication module is updated according to the received target data to obtain updated target data.
[0174] When the target communication mode is the first communication mode, the feedback module 703 is specifically configured to:
[0175] According to the updated target data, the target data in response to the data request instruction is sent to the host computer.
[0176] In some of these embodiments, the controller includes a plurality of communication channels.
[0177] The receiving module 701 is specifically used to periodically receive target data sent by each communication channel.
[0178] The feedback module 703 is specifically configured to: send the target data sent by the first target communication channel in response to the data request instruction to the host computer according to the first preset rule.
[0179] In some embodiments, when the target communication mode is the second communication mode, the feedback module 703 is specifically configured to:
[0180] Send a data request command to the controller.
[0181] The target data sent by the receiving controller in response to the data request instruction.
[0182] Send the received target data to the host computer.
[0183] In some of these embodiments, the controller includes a plurality of communication channels.
[0184] The feedback module 703 is specifically used to send the data request instruction to each communication channel of the controller respectively.
[0185] Receive target data sent by each communication channel in response to the data request command.
[0186] According to the second preset rule, the target data sent by the second target communication channel is sent to the host computer.
[0187] In some embodiments, when the target communication mode is the third communication mode, the feedback module 703 is specifically configured to:
[0188] A data address of target data in response to a data request instruction is acquired.
[0189] The data address is sent to the host computer so that the host computer obtains the target data in response to the data request instruction from the controller according to the data address.
[0190] In some of the embodiments, the apparatus may further include:
[0191] The security detection module is used to perform whitelist protocol filtering, current limiting, intrusion detection and packet filtering on at least one of the data request instructions, target data and data addresses to obtain secure communication data.
[0192] Data transmission is based on secure communication data.
[0193] It should be noted that the above modules (or units) can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules (or units) can be located in different processors in any combination.
[0194] In this embodiment, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0195] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0196] Optionally, in this embodiment, the processor may be configured to execute the above-mentioned Figure 2 The method process shown.
[0197] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.
[0198] In addition, in combination with the communication method of the security control system provided in the above embodiments, a storage medium can also be provided in this embodiment to implement the communication method of the security control system provided in the above embodiments. The storage medium stores a computer program, and when the computer program is executed by a processor, any communication method of the security control system provided in the above embodiments can be implemented.
[0199] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.
[0200] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.
[0201] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.
[0202] The above-mentioned 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 patent protection. 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 scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.
Claims
1. A method for communication of a safety control system, characterized in that: The safety control system includes a host computer, a communication module and a controller. The method is applied to the communication module. The method includes: Receiving a data request instruction sent by the host computer; Determining the data type requested by the data request instruction according to the correspondence between the preset data type and the target communication mode; Determine a corresponding target communication mode according to the data type requested by the data request instruction, wherein the target communication mode includes a first communication mode, a second communication mode and a third communication mode, the first communication mode is used to obtain target data before receiving the data request instruction, the second communication mode is used to obtain target data when receiving the data request instruction, and the third communication mode is used to obtain a data address corresponding to the target data when receiving the data request instruction; the data type requested by the data request instruction includes a first type of data, a second type of data and a third type of data; the first type of data includes real-time data; the second type of data includes commonly used variable data; the third type of data includes device configuration data; According to the target communication mode, feeding back the target data in response to the data request instruction to the host computer, the target data being acquired from the controller; The correspondence between the preset data type and the target communication mode includes: If the data request instruction requests access to the first type of data, the determined target communication mode is the first communication mode; If the data request instruction requests access to the second type of data, the determined target communication mode is the second communication mode; If the data request instruction requests access to the third type of data, the determined target communication mode is the third communication mode; The step of feeding back the target data in response to the data request instruction to the host computer according to the target communication mode includes: When the target communication mode is the first communication mode, feeding back the target data in response to the data request instruction to the host computer; the target data has been stored in the communication module before receiving the data request instruction; When the target communication mode is the second communication mode, sending the data request instruction to the controller; receiving target data sent by the controller in response to the data request instruction; Sending the received target data to the host computer; When the target communication mode is the third communication mode, acquiring a data address of the target data in response to the data request instruction; The data address is sent to the host computer, so that the host computer obtains the target data in response to the data request instruction from the controller according to the data address.
2. The method according to claim 1, characterized in that The method further comprises: Periodically receiving target data sent by the controller; updating the target data stored in the communication module according to the received target data to obtain updated target data; When the target communication mode is the first communication mode, feeding back the target data in response to the data request instruction to the host computer includes: According to the updated target data, the target data in response to the data request instruction is sent to the host computer.
3. The method according to claim 2, characterized in that The controller includes a plurality of communication channels; The periodically receiving the target data sent by the controller includes: Periodically receiving target data sent by each communication channel; Feeding back the target data in response to the data request instruction to the host computer includes: According to a first preset rule, the target data sent by the first target communication channel in response to the data request instruction is sent to the host computer.
4. The method according to claim 1, characterized in that: The controller includes a plurality of communication channels; The sending the data request instruction to the controller includes: sending the data request instruction to each communication channel of the controller respectively; The receiving the target data sent by the controller in response to the data request instruction includes: receiving the target data sent by each communication channel in response to the data request instruction; The sending the received target data to the host computer includes: sending the target data sent by the second target communication channel to the host computer according to a second preset rule.
5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: Performing whitelist protocol filtering, current limiting, intrusion detection, and packet filtering on at least one of the data request instruction, target data, and data address to obtain secure communication data; Data transmission is performed based on the secure communication data.
6. A device for communication of a safety control system, characterized in that: The device comprises: A receiving module, used for receiving a data request instruction sent by a host computer; A determination module, used to determine the data type requested by the data request instruction according to the corresponding relationship between the preset data type and the target communication mode; Determine a corresponding target communication mode according to the data type requested by the data request instruction, wherein the target communication mode includes a first communication mode, a second communication mode and a third communication mode, the first communication mode is used to obtain target data before receiving the data request instruction, the second communication mode is used to obtain target data when receiving the data request instruction, and the third communication mode is used to obtain a data address corresponding to the target data when receiving the data request instruction; the data type requested by the data request instruction includes a first type of data, a second type of data and a third type of data; the first type of data includes real-time data; the second type of data includes commonly used variable data; the third type of data includes device configuration data; A feedback module, used for feeding back target data in response to the data request instruction to the host computer according to the target communication mode, wherein the target data is obtained from the controller; The correspondence between the preset data type and the target communication mode includes: If the data request instruction requests access to the first type of data, the determined target communication mode is the first communication mode; If the data request instruction requests access to the second type of data, the determined target communication mode is the second communication mode; If the data request instruction requests access to the third type of data, the determined target communication mode is the third communication mode; The feedback module is further used for feeding back the target data in response to the data request instruction to the host computer when the target communication mode is the first communication mode; the target data has been stored in the communication module before receiving the data request instruction; When the target communication mode is the second communication mode, sending the data request instruction to the controller; receiving target data sent by the controller in response to the data request instruction; Sending the received target data to the host computer; When the target communication mode is the third communication mode, acquiring a data address of the target data in response to the data request instruction; The data address is sent to the host computer, so that the host computer obtains the target data in response to the data request instruction from the controller according to the data address.
7. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Vehicle-mounted controller testing device, system and method
CN112764410A
Data transmission method and related equipment
CN113542273A
Data transmission method and system, electronic equipment and storage medium
CN113630466A