Log storage method, control device and readable storage medium
By integrating log storage functions into control devices, the complexity and cost of distributed control systems are reduced, enhancing flexibility and reliability through decentralized log management.
Patent Information
- Application Number
- CN202310738925.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-20
- Publication Date
- 2024-12-20
AI Technical Summary
Distributed control systems require additional log servers for storing log information, complicating the hardware architecture and increasing costs and maintenance difficulties.
Integrate log storage functions into control devices within the distributed control system, allowing them to send and store log information without the need for a separate log server, thereby simplifying the hardware architecture and reducing hardware costs and maintenance complexity.
This approach reduces hardware requirements, enhances flexibility in device selection, and improves log storage reliability and security by distributing log information across multiple control devices.
Smart Images

Figure CN119172402A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of log storage, and in particular to a log storage method, a control device and a readable storage medium. Background Art
[0002] Distributed control systems are usually composed of multiple control devices, and different control devices are used to control the operation of different equipment. Taking the control and protection system of the energy storage valve as an example, the control and protection system includes a control device for controlling the operation of the battery cabinet, a control device for controlling the operation of the voltage source converter (VSC), and a control device for controlling the operation of the cooling system.
[0003] Among them, a distributed control system needs to set up an additional log server to store the log information of each control device, which makes the hardware architecture of the distributed control system more complicated. Therefore, providing a log storage method that can reduce the complexity of the hardware architecture of the distributed control system has become an urgent problem to be solved. Summary of the invention
[0004] The embodiments of the present application provide a log storage method, a control device, and a readable storage medium, which can reduce the complexity of the hardware architecture of a distributed control system.
[0005] In a first aspect, a log storage method is provided, the method comprising:
[0006] A first control device generates first log information, the first control device belongs to a distributed control system, and the first control device is used to control the operation of a first device;
[0007] The first control device sends the first log information to a second control device with a log storage function in the distributed control system, so that the second control device stores the first log information, and the second control device is used to control the operation of the second device.
[0008] In the embodiment of the present application, the log storage function is integrated into one or more control devices in the distributed control system. After the control device generates log information, it sends the log information to the control device with the log storage function in the distributed control system, and the control device with the log storage function stores the log information. In this way, it is possible to avoid setting up a log server in the distributed control system, thereby simplifying the hardware architecture of the distributed control system and reducing the complexity of the hardware architecture.
[0009] At the same time, when the distributed control system does not have a log server, the amount of hardware in the distributed control system can be reduced, thereby reducing the hardware cost of the distributed control system. In addition, when the distributed control system does not have a log server, the selection of the control device in the development stage of the distributed control system is not restricted by the communication protocol of the log server, which can improve the flexibility of the control device selection, thereby reducing the difficulty and cost of development. In addition, when the hardware architecture of the distributed control system is relatively simple, the maintenance difficulty of the distributed control system can be reduced.
[0010] In some embodiments, before sending the first log information to the second control device, the method further includes: the first control device determining that the second control device is configured as a log storage end of the first control device.
[0011] In an embodiment of the present application, when the first control device sends log information to the second control device, it first determines whether the second control device is pre-configured as the log storage end of the first control device, so as to avoid sending log information to other control devices that are not log storage ends, thereby reducing the amount of data in the communication bus, and further reducing the probability of congestion in the communication bus.
[0012] In some embodiments, the method also includes: the first control device sends the first log information to a third control device with a log storage function in the distributed control system, so that the third control device stores the first log information, and the third control device is used to control the operation of a third device.
[0013] In an embodiment of the present application, after generating log information, the first control device can not only send the log information to a second control device with a log storage function for storage, but also send the log information to a third control device with a log storage function for storage, so that the log information can be distributed and stored in multiple control devices, thereby reducing the probability of log information loss and improving the security and reliability of log information storage.
[0014] In some embodiments, the method further includes: the first control device storing the first log information.
[0015] In an embodiment of the present application, after generating log information, the first control device can not only send the log information to the second control device for storage, but also directly store the log information, so that the log information can be distributed and stored in multiple control devices, thereby reducing the probability of log information loss and improving the security and reliability of log information storage.
[0016] In some embodiments, before sending the first log information to the second control device, the method further includes:
[0017] When the communication connection between the first control device and the second control device is disconnected, the first control device caches the first log information in the first control device.
[0018] When the communication connection between the first control device and the second control device is restored, the first control device sends the cached first log information to the second control device.
[0019] In the embodiment of the present application, the first control device can cache log information when the communication connection between the first control device and the second control device is disconnected, and resend the cached log information when the communication connection between the first control device and the second control device is restored. In this way, the log information generated by the first control device during the disconnection of the communication connection can still be stored in the second control device, which can reduce the probability of log information loss.
[0020] In some embodiments, the first control device sends the first log information to a second control device having a log storage function in the distributed control system, including: the first control device unicasts the first log information to the second control device.
[0021] In the embodiment of the present application, the first control device unicasts the log information to the second control device, which can reduce the amount of data in the communication bus between the control devices, thereby reducing the probability of congestion in the communication bus.
[0022] In some embodiments, the first control device sends the first log information to a second control device with a log storage function in the distributed control system, including: the first control device broadcasts the first log information to other control devices in the distributed control system except the first control device.
[0023] In an embodiment of the present application, when the first control device sends log information to the second control device, it can use broadcasting to send log information to the control devices in the distributed control system, which can simplify the log information sending process and improve the sending efficiency.
[0024] In some embodiments, before sending the first log information to the second control device, the method further includes:
[0025] The first control device acquires first configuration information of the first control device;
[0026] When the first configuration information instructs the first control device to store log information in the second control device, the first control device configures the first control device as a log sending end of the second control device.
[0027] In an embodiment of the present application, before the first control device sends log information to the second control device, the first control device is pre-configured as the log sending end of the second control device according to the configuration information. This can reduce the probability of sending log information to other control devices other than the log sending end, thereby reducing the amount of data in the communication bus and reducing the probability of congestion on the communication bus.
[0028] In a second aspect, a log storage method is provided, the method comprising:
[0029] The second control device receives the first log information sent by the first control device, the first control device and the second control device belong to a distributed control system, the first control device is used to control the operation of the first device, and the second control device has a log storage function and is used to control the operation of the second device;
[0030] The second control device stores the first log information.
[0031] In some embodiments, the second control device stores the first log information, including:
[0032] The second control device determines whether the second control device is configured as a log storage end of the first control device;
[0033] If so, the first log information is stored in the second control device.
[0034] In an embodiment of the present application, when storing log information, the second control device first determines whether the first control device is pre-configured as the log sending end of the second control device, which can avoid storing log information sent by other control devices that are not log sending ends, thereby reducing the log storage capacity of the second control device, and further reducing the storage pressure of the second control device.
[0035] In some embodiments, the second control device stores the first log information, including: when there are multiple first control devices, the second control device separately stores the log information of each of the first control devices.
[0036] In an embodiment of the present application, the second control device separately stores the log information of each first control device, which can facilitate the user to quickly determine all log information of the first control device from more log information during the log analysis process, so as to quickly analyze the faults and / or abnormalities of the equipment controlled by the first control device based on all log information of the first control device, thereby improving the log analysis efficiency.
[0037] In some embodiments, before storing the first log information, the method further includes:
[0038] The second control device obtains second configuration information of the second control device;
[0039] When the second configuration information indicates that the second control device stores the log information of the first control device, the second control device configures the second control device as a log storage terminal of the first control device.
[0040] In an embodiment of the present application, before storing log information, the second control device is pre-configured as a log storage end of the first control device according to configuration information, which can avoid storing log information sent by a non-log sending end, thereby reducing the log storage capacity of the second control device.
[0041] In a third aspect, a first control device is provided, comprising:
[0042] A generating module, used for generating first log information, wherein the first control device belongs to a distributed control system, and the first control device is used for controlling the operation of a first device;
[0043] The sending module is used to send the first log information to a second control device with a log storage function in the distributed control system so that the second control device stores the first log information, and the second control device is used to control the operation of the second device.
[0044] In some embodiments, the first control device further includes: a determination module, configured to determine that the second control device is configured as a log storage end of the first control device.
[0045] In some embodiments, the sending module is also used to send the first log information to a third control device with a log storage function in the distributed control system so that the third control device stores the first log information, and the third control device is used to control the operation of a third device.
[0046] In some embodiments, the first control device further includes a storage module for storing the first log information.
[0047] In some embodiments, the sending module is further configured to cache the first log information in the first control device when the communication connection with the second control device is disconnected, and to send the cached first log information to the second control device when the communication connection with the second control device is restored.
[0048] In some embodiments, the sending module is specifically configured to unicast the first log information to the second control device.
[0049] In some embodiments, the sending module is specifically used to broadcast and send the first log information to other control devices in the distributed control system except the first control device.
[0050] In some embodiments, the first control device further includes: a configuration module, configured to obtain first configuration information of the first control device; and configure the first control device as a log sending end of the second control device when the first configuration information indicates that the first control device stores log information in the second control device.
[0051] In a fourth aspect, a second control device is provided, comprising:
[0052] A receiving module, used for receiving first log information sent by a first control device, wherein the first control device and the second control device belong to a distributed control system, the first control device is used for controlling the operation of the first device, and the second control device has a log storage function for controlling the operation of the second device;
[0053] A storage module is used to store the first log information.
[0054] In some embodiments, the storage module is specifically used to determine whether the second control device is configured as a log storage end of the first control device; if so, store the first log information in the second control device.
[0055] In some embodiments, the storage module is specifically configured to separately store log information of each first control device when there are multiple first control devices.
[0056] In some embodiments, the second control device further includes a configuration module for obtaining second configuration information of the second control device; and configuring the second control device as a log storage end of the first control device when the second configuration information indicates that the second control device stores log information of the first control device.
[0057] In a fifth aspect, a readable storage medium is provided, on which a computer program is stored. When the computer program runs on a control device, the control device executes the log storage method provided in the first aspect or the second aspect.
[0058] In a sixth aspect, a control device is provided, comprising: a processor; a memory; and a computer program, wherein the computer program is stored in the memory, and when the computer program is executed by the processor, the screening device executes the log storage method provided in the first aspect or the second aspect.
[0059] In a seventh aspect, a computer program product is provided, comprising: a computer program code, which, when executed on a control device, enables the control device to execute the log storage method provided in the first aspect or the second aspect.
[0060] In an eighth aspect, a chip is provided, comprising: a processor for calling and running a computer program from a memory, so that a control device equipped with the chip executes the log storage method provided in the first aspect or the second aspect.
[0061] It can be understood that the control device provided in the third, fourth and sixth aspects, the readable storage medium provided in the fifth aspect, the computer program product provided in the seventh aspect and the chip provided in the eighth aspect are all used to execute the log storage method provided in the first or second aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 A schematic diagram of the architecture of a distributed control system provided in an embodiment of the present application is shown.
[0063] Figure 2 A schematic diagram of the architecture of another distributed control system provided in an embodiment of the present application is shown.
[0064] Figure 3 A flow chart of the steps of a log storage method provided in an embodiment of the present application is shown.
[0065] Figure 4 A schematic diagram of a configuration flow of a control device provided in an embodiment of the present application is shown.
[0066] Figure 5 A schematic diagram of the composition of a distributed control system provided in an embodiment of the present application is shown.
[0067] Figure 6 An interactive schematic diagram of a log storage method provided in an embodiment of the present application is shown.
[0068] Figure 7 A schematic structural diagram of a control device provided in an embodiment of the present application is shown.
[0069] Figure 8 A schematic structural diagram of another control device provided in an embodiment of the present application is shown.
[0070] Fig. 9 A structural block diagram of a control device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0071] The technical solution in the present application will be described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments.
[0072] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0073] The term "comprising" herein indicates the presence of the described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections. The terms "comprising", "including", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized. Below, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise stated, the meaning of "multiple" is two or more.
[0074] The term "and / or" in this article is only a description of the association relationship of the 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. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0075] In the field of electric energy storage, the energy storage valve includes at least one battery cabinet for storing electric energy, a voltage source converter VSC for commutation, a cooling system for cooling the battery cabinet, etc., but not limited thereto. The control and protection system of the energy storage valve includes a control device for controlling the operation of the battery cabinet, a control device for controlling the operation of the VSC, and a control device for controlling the operation of the circulating pump, three-way valve, air supply valve and other equipment in the cooling system, etc., but not limited thereto.
[0076] The control device may also be referred to as an embedded system, board or plug-in, including a processor for performing computing and control tasks, a memory for storing program code, operating data and configuration information, a bus interface for communicating between different components, and various input / output devices, such as keyboards, sensors, actuators, etc., but not limited thereto. It should be understood that the specific type of the control device can be set according to requirements, and may include but is not limited to the above examples.
[0077] Figure 1 FIG. 1 shows a schematic diagram of the architecture of a distributed control system provided by an embodiment of the present application. Figure 1 As shown, the distributed control system 1 includes a control device 11, a control device 12, a control device 13, and a log server 14. The control device 11, the control device 12, and the control device 13 are connected to the log server 14 through a communication bus 15 respectively.
[0078] After generating log information, the control device 11, the control device 12 and the control device 13 can respectively send the log information to the log server 14, and the log server 14 can receive and store the log information sent by each control device. The log information includes error information, warning information, general information and debugging information, but is not limited thereto.
[0079] During the maintenance process, the staff can connect to the log server 14 via a computer, obtain the log information generated by each control device from the log server 14, and analyze the abnormalities or failures of the equipment controlled by each control device based on the log information.
[0080] The log server is mainly used to store log information of each control device, and the log server can be implemented by an embedded system or other types of hardware modules.
[0081] like Figure 1 As shown, when a log server 14 is set in a distributed control system, not only multiple control devices need to be set in the distributed control system, but also the log server 14 needs to be set, and communication connections between multiple control devices and the log server 14 need to be established, making the hardware architecture of the distributed control system more complicated.
[0082] In order to solve the above technical problems, a log storage method is provided in an embodiment of the present application, wherein the log storage function is integrated into one or more control devices in a distributed control system, and after the control device generates log information, the control device sends the log information to a control device with a log storage function in the distributed control system, and the control device with a log storage function stores the log information. In this way, it is possible to avoid setting up a log server in the distributed control system, thereby simplifying the hardware architecture of the distributed control system and reducing the complexity of the hardware architecture.
[0083] At the same time, when the distributed control system does not have a log server, the amount of hardware in the distributed control system can be reduced, thereby reducing the hardware cost of the distributed control system. In addition, when the distributed control system does not have a log server, the selection of the control device in the development stage of the distributed control system is not restricted by the communication protocol of the log server, which can improve the flexibility of the control device selection, thereby reducing the difficulty and cost of development. In addition, when the hardware architecture of the distributed control system is relatively simple, the maintenance difficulty of the distributed control system can be reduced.
[0084] Figure 2 FIG. 2 shows a schematic diagram of the architecture of another distributed control system provided by an embodiment of the present application. Figure 2 As shown, the distributed control system 2 includes a control device 21, a control device 22, a control device 23 and a control device 24, and the control device 21, the control device 22, the control device 23 and the control device 24 are connected via a communication bus 25. The control device 21, the control device 22, the control device 23 and the control device 24 are respectively used to control the operation of different devices.
[0085] Among them, some or all of the control device 21, control device 22, control device 23 and control device 24 have a log storage function. When a control device generates log information, it can send the log information to another control device with a log storage function, and the other control device will store the log information.
[0086] For example, if the control device 24 has a log storage function, after generating log information, the control device 21, the control device 22 and the control device 23 can send the log information to the control device 24 through the communication bus 25, and the control device 24 stores the log information of the control device 21, the control device 22 and the control device 23.
[0087] The above are merely illustrative examples, and the number of control devices included in the distributed control system and the number of control devices with log storage function in the distributed control system can be specifically set according to needs.
[0088] Figure 3 A flow chart of the steps of a log storage method provided by an embodiment of the present application is shown. Figure 3 As shown, the method may include steps 31 and 32.
[0089] Step 31: The first control device generates first log information.
[0090] Step 32: The first control device sends first log information to a second control device having a log storage function in the distributed control system.
[0091] The first control device is any one of the multiple control devices included in the distributed control system, and the second control device is a control device with a log storage function in the distributed control system. The first control device is used to control the operation of the first device, and the second control device is used to control the operation of the second device. The first device and the second device can be different devices.
[0092] For example, the first control device is used to control the operation of the battery cabinet in the energy storage valve, and the second control device is used to control the operation of the circulating pump, three-way valve and air supply valve included in the cooling system of the energy storage valve. The battery cabinet is the first equipment, and the circulating pump, three-way valve and air supply valve are the second equipment.
[0093] In this embodiment, the distributed control system may include one or more control devices with a log storage function. For example, the control device 22 and the control device 24 in the distributed control system 2 are second control devices with a log storage function. After generating log information (the log information is the first log information), the control device 21 may send the first log information to the control device 22 and the control device 24 as the first control device, or may send the first log information to one of the control device 22 and the control device 24.
[0094] Similarly, after generating the log information, the control device 23 may also serve as the first control device to send the log information to the control device 22 and the control device 24 serving as the second control device, respectively, or send the log information to one of the control device 22 and the control device 24 .
[0095] Similarly, after generating the log information, the control device 22 can also function as a first control device to send the log information of the control device 22 to the control device 24 functioning as a second control device. After generating the log information, the control device 24 can also function as a first control device to send the log information of the control device 24 to the control device 22 functioning as a second control device.
[0096] Step 33: The second control device receives the first log information sent by the first control device.
[0097] Step 34: The second control device stores the first log information.
[0098] Exemplarily, after receiving the first log information sent by the control device 21, the control device 22 may store the received first log information in a memory included in the control device 22. Similarly, after receiving the log information sent by the control device 21, the control device 24 may store the log information sent by the control device 21 in a memory included in the control device 24.
[0099] In some embodiments, the first control device may store the generated first log information. For example, the control device 22 has a log storage function, and after the control device 22 generates the log information, the generated log information may be stored in the control device 22.
[0100] It should be understood that the first control device can also store the first log information generated by itself when it does not have the log storage function. For example, the control device 21 does not have the log storage function, and after the control device 21 generates the log information, it can store the generated log information in the control device 21. In other words, the control device with the log storage function can store the log information generated by itself and the log information sent by other control devices, and the control device without the log storage function can store the log information generated by itself.
[0101] In an embodiment of the present application, after generating log information, the first control device can not only send the log information to the second control device for storage, but also directly store the log information, so that the log information can be distributed and stored in multiple control devices, thereby reducing the probability of log information loss and improving the security and reliability of log information storage.
[0102] In some embodiments, the first control device may send the first log information to a third control device having a log storage function in the distributed control system, so that the third control device stores the first log information, and the third control device is used to control the operation of the third device.
[0103] The third control device is a control device other than the second control device in the distributed control system that has a log storage function. The third control device is used to control the operation of a third device, which may be a device different from the first device and the second device.
[0104] Exemplarily, the control device 21 is a first control device, the control device 22 is a second control device with a log storage function, and the control device 24 is a third control device with a log storage function. After generating log information, the control device 21 can not only send the log information to the control device 22 as the second control device so that the control device 22 stores the log information, but also send the log information to the control device 24 as the third control device so that the control device 24 stores the log information.
[0105] In an embodiment of the present application, after generating log information, the first control device can not only send the log information to a second control device with a log storage function for storage, but also send the log information to a third control device with a log storage function for storage, so that the log information can be distributed and stored in multiple control devices, thereby reducing the probability of log information loss and improving the security and reliability of log information storage.
[0106] Among them, a different device identifier can be set for each control device in the distributed control system. The device identifier can be an identifier in the form of a string, which can be called the device name of the control device. Alternatively, the device identifier can also be an identifier in the form of integer data, which can be called the serial number or identity document (ID) of the control device. Alternatively, a unique device name and serial number can be set for each control device. The device name has high readability, which can facilitate users to distinguish different control devices according to the device name. The serial number occupies a low amount of data, which can identify different control devices when communicating between different control devices.
[0107] In some embodiments, when there are multiple first control devices, the second control device may store log information of each first control device separately.
[0108] Exemplarily, when control device 21 and control device 23 simultaneously act as the first control device to send log information to control device 22, control device 22 can establish a log file for control device 21, as well as a log file for control device 23, and uniquely identify the log file of control device 21 by the device name and serial number of control device 21, as well as uniquely identify the log file of control device 23 by the device name and serial number of control device 23.
[0109] After each receipt of log information sent by control device 21, control device 22 can add the log information to the log file of control device 21 according to the device name and / or serial number of control device 21; after each receipt of log information sent by control device 23, control device 23 can add the log information to the log file of control device 23 according to the device name and / or serial number of control device 23.
[0110] Likewise, when the control device 22 needs to store the log information generated by itself, a log file of the control device 22 may be created, and the log information may be stored in the log file of the control device 22 after each log information is generated.
[0111] The second control device may also store the log information of each first control device separately in other ways. For example, the second control device may divide an independent storage area for each first control device in the memory of the second control device, and store the log information sent by each first control device in the corresponding storage area. The above are only illustrative examples, and the method of storing the log information of each first control device separately may include but is not limited to the above examples.
[0112] Optionally, when sending log information to a second control device, different first control devices may use the same log format to send the log information to the second control device.
[0113] For example, when the control device 21 and the control device 23 send log information to the control device 22, they can use the same log format to send log information to the control device 22. In this way, the control device 22 can quickly store log information sent by different control devices, reducing the steps of data cleaning of the control device 22.
[0114] In an embodiment of the present application, the second control device separately stores the log information of each first control device, which can facilitate the user to quickly determine all log information of the first control device from more log information during the log analysis process, so as to quickly analyze the faults and / or abnormalities of the equipment controlled by the first control device based on all log information of the first control device, thereby improving the log analysis efficiency.
[0115] In some embodiments, a control device with a log storage function in a distributed control system can be pre-configured as a log storage end of other control devices. During the log storage process, the log storage end of the control device can store the log information generated by the control device.
[0116] Figure 4 The configuration flow diagram of a control device provided in an embodiment of the present application is shown. The method can be implemented by the control device and can include steps 41 to 49.
[0117] Step 41: Determine whether a configuration file is stored locally.
[0118] The configuration file may include configuration information of each control device in the distributed control system, and the configuration file may be uploaded in advance by the user to one or more control devices in the distributed control system.
[0119] Exemplarily, each control device has four items of configuration information, namely the device name, serial number, log sending end and log storage end of the control device. The log sending end of the control device is other control devices in the distributed control system that send log information to the control device, and the log storage end of the control device is other control devices in the distributed control system that are used to store the log information of the control device. The configuration information is shown in the following table:
[0120] Table 1
[0121] Device Name Control device 1 Serial Number 01 Log sender Log storage end 02、04
[0122] As shown in Table 1, the device name "control device 1" in the first configuration information and the serial number "01" in the second configuration information indicate that the configuration information is the configuration information of the control device 21. The third configuration information is the log sending end, which is empty, indicating that the control device 21 does not store the log information of other control devices. The fourth configuration information is the serial number "02" of the control device 22 and the serial number "04" of the control device 24, indicating that the log storage end of the control device 21 includes the control device 22 and the control device 24.
[0123] Exemplarily, if the control device 22 is required to store the log information of the control device 21, the control device 23, and the control device 24, the third configuration information of the control device 22 may include the serial numbers of the control device 21, the control device 23, and the control device 24 to indicate that the log sending end of the control device 22 includes the control device 21, the control device 23, and the control device 24, so that the control device 22 can receive and store the log information of the control device 21, the control device 23, and the control device 24.
[0124] Meanwhile, when the fourth item of configuration information of the control device 22 is empty, it indicates that the control device 22 stores its own log information, and other control devices do not store the log information of the control device 22. Alternatively, if the control device 24 is required to store the log information of the control device 22, the fourth item of configuration information of the control device 22 may include the serial number of the control device 24 to instruct the control device 22 to send the log information to the control device 24, so that the control device 24 stores the log information of the control device 22.
[0125] Taking the control device 21 as an example, after the control device 21 starts running, step 41 is executed to first detect whether a pre-uploaded configuration file is stored in the local memory of the control device 21. If the configuration file is stored, step 42 is executed; if the configuration file is not stored, step 45 is executed.
[0126] Step 42: Obtain configuration information of each control device from the configuration file.
[0127] In some embodiments, after detecting the configuration file, the control device may parse the configuration file and obtain configuration information of each control device in the distributed control system from the configuration file. For example, after detecting that a configuration file is stored locally, the control device 21 may parse the configuration file and obtain configuration information of the control devices 21, 22, 23, and 24 from the configuration file.
[0128] Step 43: Send configuration information to other control devices.
[0129] Step 44: Get its own configuration information.
[0130] Exemplarily, after obtaining the configuration information of control device 22, control device 23 and control device 24 from the configuration file, control device 21 may send the configuration information of control device 22 to control device 22, send the configuration information of control device 23 to control device 23, and send the configuration information of control device 24 to control device 24.
[0131] Meanwhile, after obtaining the configuration information of each control device from the configuration file, the control device 21 may obtain the configuration information of the control device 21 from the plurality of configuration information according to the device identification and / or device name of the control device 21 .
[0132] When the control device 21 sends configuration information to other control devices, it can broadcast the configuration information to all control devices in the distributed control system, or it can unicast the configuration information to other control devices in the control system according to the device name and / or serial number in the configuration information. The configuration information sending method may include but is not limited to the above examples.
[0133] Step 45: Receive configuration information sent by other control devices.
[0134] Exemplarily, after detecting that no configuration file is stored locally, the control device 22 , the control device 23 , and the control device 24 may receive the configuration information sent by the control device 21 .
[0135] Step 46: Determine whether to start the sending module according to the configuration information.
[0136] Step 47: Start the sending module.
[0137] Among them, a software module for sending log information is installed in the control device, and the software module can be called a sending module. After the sending module is started, the control device can act as a first control device after generating log information and send log information to a second control device with a log storage function.
[0138] Figure 5 A schematic diagram of the composition of a distributed control system provided by an embodiment of the present application is shown. For example, the fourth configuration information of the control device 21 includes the serial numbers of the control device 22 and the control device 24, indicating that the log storage end of the control device 21 includes the control device 22 and the control device 24, and also indicating that the control device 21 serves as the log sending end of the control device 22 and the control device 24. After the control device 21 generates log information, it needs to send the log information to the control device 22 and the control device 24 for storage.
[0139] Wherein, when the fourth configuration information is not empty, the control device 21 determines that the sending module needs to be started, and can execute step 47 to start the sending module. After generating the log information, the sending module can send the log information to the control device 22 and the control device 24 as the log storage end, so that the control device 22 and the control device 24 store the log information.
[0140] Step 48: Determine whether to start the receiving module and the storage module according to the configuration information.
[0141] Step 49: Start the receiving module and the storage module.
[0142] like Figure 5 As shown, a software module for receiving log information (the software module may be referred to as a receiving module) and a software module for storing log information (the software module may be referred to as a storage module) are installed in the control device. After the receiving module and the storage module are started and run, the control device has a log storage function and can be used as a second control device to receive and store log information sent by the first control device.
[0143] Exemplarily, the third item of configuration information of control device 22 includes the serial numbers of control device 21, control device 23 and control device 24, indicating that the log sending end of control device 22 includes control device 21, control device 23 and control device 24, and also indicates that control device 22 needs to serve as the log storage end of control device 21, control device 23 and control device 24, and needs to receive and store the log information sent by control device 21, control device 23 and control device 24.
[0144] Among them, when the third configuration information is not empty, the control device 22 determines that it is necessary to start the receiving module and the storage module, and can execute step 49 to start the receiving module and the storage module, so that the control module 22 has the log receiving and storage functions, so as to receive the log information sent by the control device 21, the control device 23 and the control device 24 through the receiving module, and store the received log information through the storage module.
[0145] It is understandable that the user may also upload the configuration file 26 to each control device in advance, or upload corresponding configuration information to each control device. During the configuration process, the control device may only obtain its own configuration information and complete its own configuration.
[0146] In the embodiment of the present application, the control device can be configured as a log storage terminal of one or more other control devices according to the storage capacity of the control device, so as to reduce the probability of log information loss due to insufficient storage capacity of the control device. At the same time, the probability of the control device sending log information to all other control devices after generating log information can be reduced, thereby reducing the amount of data in the communication bus and reducing the probability of congestion in the communication bus.
[0147] In some embodiments, before sending the first log information to the second control device, the first control device may also obtain first configuration information of the first control device, and when the first configuration information instructs the first control device to store the log information in the second control device, configure the first control device as a log sending end for the second control device.
[0148] Taking the control device 21 as an example, the fourth configuration information of the control device 21 includes the serial numbers of the control device 22 and the control device 24, indicating that the control device 21 needs to send the log information to the control device 22 and the control device 24 for storage. After starting the sending module, the control device 21 can store the configuration information of the control device 21 locally to configure the control device 21 as the log sending end of the control device 22 and the control device 24.
[0149] After each log information is generated, the control device 21 first obtains the locally stored configuration information, and through the serial numbers of the control device 22 and the control device 24 included in the fourth configuration information, it can be determined that the control device 21 is the log sending end of the control device 22 and the control device 24. Then, the control device 21 can serve as a log sending end to send the generated log information to the control device 22 and the control device 24.
[0150] In an embodiment of the present application, before the first control device sends log information to the second control device, the first control device is pre-configured as the log sending end of the second control device according to the configuration information. This can reduce the probability of sending log information to other control devices other than the log sending end, thereby reducing the amount of data in the communication bus and reducing the probability of congestion on the communication bus.
[0151] In some embodiments, before storing the first log information, the second control device may also obtain second configuration information of the second control device, and configure the second control device as the log storage end of the first control device when the second configuration information indicates that the second control device stores the log information of the first control device.
[0152] Taking the control device 22 as an example, the third item of configuration information of the control device 22 includes the serial numbers of the control device 21, the control device 23, and the control device 24, indicating that the control device 22 needs to receive and store the log information sent by the control device 21, the control device 23, and the control device 24. After starting the receiving module and the storage module, the control device 22 can store the configuration information of the control device 22 locally to configure the control device 22 as the log storage end of the serial numbers of the control device 21, the control device 23, and the control device 24.
[0153] After receiving log information each time, the control device 22 first obtains the locally stored configuration information, and can determine that the control device 22 is the log storage end of the control device 21, the control device 23, and the control device 24 according to the serial numbers of the control device 21, the control device 23, and the control device 24 included in the third configuration information. Then, the control device 22 can serve as a log storage end, and after receiving the log information sent by the control device 21, the control device 23, and the control device 24, store the log information sent by the control device 21, the control device 23, and the control device 24.
[0154] In an embodiment of the present application, before storing log information, the second control device is pre-configured as a log storage end of the first control device according to configuration information, which can avoid storing log information sent by a non-log sending end, thereby reducing the log storage capacity of the second control device.
[0155] In some embodiments, before storing the first log information, the second control device first determines whether the first control device sending the log information is pre-configured as a log sending end of the second control device, and if so, stores the first log information; otherwise, does not store the first log information.
[0156] Exemplarily, the control device 22 is a second control device with a log storage function, and the third configuration information of the control device 22 includes the serial number of the control device 21, and the control device 21 is pre-configured as the log sending end of the control device 22. The third configuration information of the control device 22 does not include the serial number of the control device 23, and the control device 23 is not configured as the log sending end of the control device 22.
[0157] After each time the control device 22 receives the log information sent by the control device 21, the control device 22 can obtain the pre-stored configuration information of the control device 22, and the serial number of the control device 21 can be obtained from the third configuration information. The control device 22 can then determine that the control device 21 is the log sending end of the control device 22, and the control device 22 can store the log information sent by the control device 21.
[0158] On the contrary, the serial number of control device 23 is not included in the third configuration information of control device 22. After receiving the log information sent by control device 23, since the serial number of control device 23 is not included in the third configuration information, control device 22 can determine that control device 23 is not the log sending end of control device 22, and control device 22 may not store the log information sent by control device 23.
[0159] In an embodiment of the present application, when storing log information, the second control device first determines whether the first control device is pre-configured as the log sending end of the second control device, which can avoid storing log information sent by other control devices that are not log sending ends, thereby reducing the log storage capacity of the second control device, and further reducing the storage pressure of the second control device.
[0160] In some embodiments, before sending the first log information to the second control device, the first control device first determines whether the second control device with a log storage function is configured as the log storage end of the first control device. If so, the log information is sent to the second control device; otherwise, the log information is not sent to the second control device.
[0161] Exemplarily, control device 22 and control device 24 are second control devices with a log storage function, and the fourth item of configuration information of control device 21 includes the serial number of control device 22, then control device 22 is pre-configured as the log storage end of control device 21; if the fourth item of configuration information of control device 21 does not include the serial number of control device 24, then control device 24 is not configured as the log storage end of control device 21.
[0162] After generating log information each time, the control device 21 can obtain the pre-stored configuration information of the control device 21, and the serial number of the control device 22 can be obtained from the fourth configuration information. The control device 21 can then determine that the control device 22 with the log storage function is the log storage end of the control device 21, and the control device 21 can send log information to the control device 22, so that the control device 22 stores the log information of the control device 21.
[0163] On the contrary, the serial number of the control device 24 is not included in the fourth configuration information of the control device 22. The control device 21 can determine that the control device 24 with the log storage function is not the log storage end of the control device 21, and the control device 21 does not send log information to the control device 22.
[0164] In an embodiment of the present application, when the first control device sends log information to the second control device, it first determines whether the second control device is pre-configured as the log storage end of the first control device, so as to avoid sending log information to other control devices that are not log storage ends, thereby reducing the amount of data in the communication bus, and further reducing the probability of congestion in the communication bus.
[0165] Optionally, the step of the first control device sending the first log information to the second control device having a log storage function in the distributed control system may include:
[0166] The first control device unicasts the first log information to the second control device.
[0167] In some embodiments, when sending the first log information to the second control device, the first control device may first establish a communication connection with the second control device, and then unicast the first log information to the second control device based on the communication connection between the first control device and the second control device.
[0168] Exemplarily, when the control device 21 determines that the control device 22 is the log storage end, it can first determine the address of the control device 22 in the distributed control system, the address is, for example, an Internet Protocol (IP) address, and then establish a communication connection with the control device 22 based on the IP address of the control device 22, and after establishing the communication connection with the control device 22, send the first log information to the control device 22 to realize unicast sending of the log information.
[0169] The above are only illustrative examples, and the manner of unicasting log information may include but is not limited to the above examples.
[0170] In the embodiment of the present application, the first control device unicasts the log information to the second control device, which can reduce the amount of data in the communication bus between the control devices, thereby reducing the probability of congestion in the communication bus.
[0171] Optionally, the step of the first control device sending the first log information to the second control device may include: broadcasting the first log information to other control devices in the distributed control system except the first control device.
[0172] Exemplarily, when the control device 21 sends log information to the control device 22, the control device 21 may broadcast the log information to the control devices in the distributed control system. Correspondingly, after receiving the log information, other control devices in the distributed control system may determine whether the control device 21 sending the log information is a pre-configured log sending end according to the configuration information, and if so, store the log information, otherwise, do not store the log information.
[0173] For example, when sending log information, the control device 21 may broadcast a data packet including the log information and the serial number of the control device 21 to other control devices in the distributed control system. After receiving the data packet, the control device 22 first obtains the serial number from the data packet, and then may determine whether the serial number is included from the third item in the pre-stored configuration information. If the serial number is included, the control device 21 is determined to be the log sending end of the control device 22, and the control device 22 may store the log information.
[0174] On the contrary, after receiving the data packet, if the pre-stored third configuration information does not include the sequence number in the data packet, the control device 24 determines that the control device 21 is not the log sending end of the control device 24, and the control device 24 does not store the log information in the data packet.
[0175] The above are only illustrative examples, and the manner of broadcasting log information may include but is not limited to the above examples.
[0176] In an embodiment of the present application, when the first control device sends log information to the second control device, it can use broadcasting to send log information to the control devices in the distributed control system, which can simplify the log information sending process and improve the sending efficiency.
[0177] Optionally, before sending the log information to the second control device, the method may further include:
[0178] When the communication connection between the first control device and the second control device is disconnected, the first control device buffers the first log information in the first control device.
[0179] When the communication connection between the first control device and the second control device is restored, the first control device sends the cached first log information to the second control device.
[0180] In some embodiments, when the first control device is sending log information to the second control device, if it is detected that the communication connection with the second control device is disconnected, the first control device can cache the log information to be sent. For example, when the control device 21 is sending log information to the control device 22 by unicast, if it is detected that the communication connection with the control device 22 is disconnected, the control device 21 can cache the log information to be sent. After restoring the communication connection with the control device 22, the control device 21 can resend the cached log information to the control device 22.
[0181] In the embodiment of the present application, the first control device can cache log information when the communication connection between the first control device and the second control device is disconnected, and resend the cached log information when the communication connection between the first control device and the second control device is restored. In this way, the log information generated by the first control device during the disconnection of the communication connection can still be stored in the second control device, which can reduce the probability of log information loss.
[0182] Figure 6 FIG. 1 shows an interactive schematic diagram of a log storage method provided by an embodiment of the present application. Figure 6 As shown, the method may include:
[0183] Step 61: The first control device performs communication initialization.
[0184] Step 62: The first control device sends a connection request to the second control device.
[0185] In this embodiment, after the first control device generates log information, the first sending module in the first control device first initializes communication with the first control device. After the communication initialization is completed, the first sending module can send a connection request to the second control device to request to establish a communication connection with the second control device.
[0186] Step 63: The second control device sends a confirmation message to the first control device.
[0187] After the second control device receives the connection request, the second receiving module in the second control device may send confirmation information to the first control device if it determines that the log information can be received, so as to establish a communication connection with the first control device.
[0188] Step 64: The first control device confirms the establishment of the communication connection.
[0189] Step 65: The first control device sends log information to the second control device.
[0190] In this embodiment, after receiving the confirmation information sent by the second control device, the first sending module confirms that the communication connection between the first control device and the second control device is established. At this time, the first sending module can send log information to the second control device.
[0191] Step 66: The second control device stores log information.
[0192] In this embodiment, after receiving the log information, the second receiving module may forward the log information to the second storage module in the second control device, and the second storage module stores the log information.
[0193] Step 67: The second control device sends a response message to the first control device.
[0194] Step 68: The first control device sends log information to the second control device.
[0195] Step 69: The second control device stores log information.
[0196] Step 70: The second control device sends a response message to the first control device.
[0197] Step 71: The first control device determines that the communication connection is disconnected.
[0198] Wherein, after receiving the log information each time, the second receiving module can send a response message to the first sending module. If the first sending module receives the response message within a preset time after sending the log information, it is determined that the response message has not timed out, and it can be determined that the communication connection between the first control device and the second control device is normal, and the next log information can continue to be sent to the second control device.
[0199] On the contrary, if the first sending module does not receive the response information within the preset time after sending the log information, it is determined that the response information has timed out, and it can be determined that the communication connection between the first control device and the second control device is disconnected. At this time, the first sending module can return to execute step 61, initialize the communication with the first control device again, and then establish the communication connection with the second control device.
[0200] The above are merely illustrative examples, and the process of establishing a communication connection between the first control device and the second control device, and the process of sending log information and response information can be specifically configured according to requirements.
[0201] Figure 7 FIG. 1 is a schematic diagram showing the structure of a control device provided in an embodiment of the present application. Figure 7 As shown, the control device 7 includes a generating module 71 , a sending module 72 , a determining module 73 , a storing module 74 , and a configuring module 75 .
[0202] A generating module 71, configured to generate first log information, wherein the first control device belongs to a distributed control system, and the first control device is configured to control the operation of a first device;
[0203] The sending module 72 is used to send the first log information to a second control device with a log storage function in the distributed control system, so that the second control device stores the first log information, and the second control device is used to control the operation of the second device.
[0204] In some embodiments, the first control device further includes: a determination module 73, configured to determine that the second control device is configured as a log storage end of the first control device.
[0205] In some embodiments, the sending module 72 is also used to send the first log information to a third control device with a log storage function in the distributed control system so that the third control device stores the first log information, and the third control device is used to control the operation of a third device.
[0206] In some embodiments, the first control device further includes a storage module 74 for storing the first log information.
[0207] In some embodiments, the first control device further includes: a configuration module 75, configured to obtain first configuration information of the first control device; and configure the first control device as a log sending end of the second control device when the first configuration information indicates that the first control device stores log information in the second control device.
[0208] In some embodiments, the sending module 72 is specifically configured to unicast the first log information to the second control device.
[0209] In some embodiments, the sending module 72 is specifically configured to broadcast the first log information to other control devices in the distributed control system except the first control device.
[0210] In some embodiments, the sending module 72 is further configured to cache the first log information in the first control device when the communication connection with the second control device is disconnected, and to send the cached first log information to the second control device when the communication connection with the second control device is restored.
[0211] Figure 8 FIG. 2 shows a schematic diagram of the structure of another control device provided in an embodiment of the present application. Figure 8 As shown, the control device 8 includes a receiving module 81 , a storage module 82 and a configuration module 83 .
[0212] A receiving module 81, configured to receive first log information sent by a first control device, wherein the first control device and the second control device belong to a distributed control system, the first control device is configured to control the operation of a first device, and the second control device has a log storage function and is configured to control the operation of a second device;
[0213] The storage module 82 is used to store the first log information.
[0214] In some embodiments, the storage module 82 is specifically used to determine whether the second control device is configured as a log storage end of the first control device; if so, store the first log information in the second control device.
[0215] In some embodiments, the storage module 82 is specifically configured to separately store log information of each first control device when there are multiple first control devices.
[0216] In some embodiments, the second control device further includes a configuration module 83 for acquiring second configuration information of the second control device; and configuring the second control device as a log storage end of the first control device when the second configuration information indicates that the second control device stores log information of the first control device.
[0217] Fig. 9 FIG. 1 shows a structural block diagram of a control device provided in an embodiment of the present application. Fig. 9 As shown, the control device 9 includes a processor 91 and a memory 92 , and the above-mentioned components can be connected via one or more buses 94 .
[0218] The control device 9 further includes a computer program 93, which is stored in the memory 92. When the computer program 93 is executed by the processor 91, the control device 9 performs the above-mentioned Figure 3 , Figure 4 and Figure 6 All relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding physical device, and will not be repeated here.
[0219] An embodiment of the present application also provides a readable storage medium, which includes a computer program. When the computer program is executed on a computer, the computer executes the method provided by the above method embodiment.
[0220] An embodiment of the present application also provides a computer program product comprising instructions, and when the computer program product is run on a computer, the computer is enabled to execute the method provided by the above method embodiment.
[0221] An embodiment of the present application also provides a chip system, including a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that a control device equipped with the chip system executes the method provided in the above method embodiment.
[0222] Among them, the chip system may include an input circuit or interface for sending information or data, and an output circuit or interface for receiving information or data.
[0223] It should be understood that in the embodiments of the present application, the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0224] It should also be understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0225] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0226] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0227] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0228] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0229] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0230] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0231] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A log storage method, characterized in that: The method comprises: A first control device generates first log information, the first control device belongs to a distributed control system, and the first control device is used to control the operation of a first device; The first control device sends the first log information to a second control device with a log storage function in the distributed control system, so that the second control device stores the first log information, and the second control device is used to control the operation of the second device.
2. The method according to claim 1, characterized in that Before sending the first log information to the second control device, the method further includes: The first control device determines that the second control device is configured as a log storage end of the first control device.
3. The method according to claim 1, characterized in that The method further comprises: The first control device sends the first log information to a third control device having a log storage function in the distributed control system, so that the third control device stores the first log information. The third control device is used to control the operation of a third device.
4. The method according to claim 1, characterized in that The method further comprises: The first control device stores the first log information.
5. The method according to claim 1, characterized in that Before sending the first log information to the second control device, the method further includes: When the communication connection between the first control device and the second control device is disconnected, the first control device caches the first log information in the first control device; When the communication connection between the first control device and the second control device is restored, the first control device sends the cached first log information to the second control device.
6. The method according to claim 1, characterized in that The first control device sends the first log information to a second control device having a log storage function in the distributed control system, including: The first control device unicasts the first log information to the second control device.
7. The method according to claim 1, characterized in that The first control device sends the first log information to a second control device having a log storage function in the distributed control system, including: The first control device broadcasts the first log information to other control devices in the distributed control system except the first control device.
8. The method according to any one of claims 1 to 7, characterized in that Before sending the first log information to the second control device, the method further includes: The first control device acquires first configuration information of the first control device; When the first configuration information instructs the first control device to store log information in the second control device, the first control device configures the first control device as a log sending end of the second control device.
9. A log storage method, characterized in that: The method comprises: The second control device receives the first log information sent by the first control device, the first control device and the second control device belong to a distributed control system, the first control device is used to control the operation of the first device, and the second control device has a log storage function and is used to control the operation of the second device; The second control device stores the first log information.
10. The method according to claim 9, characterized in that The second control device stores the first log information, including: The second control device determines whether the second control device is configured as a log storage end of the first control device; If so, the first log information is stored in the second control device.
11. The method according to claim 9, characterized in that The second control device stores the first log information, including: When there are multiple first control devices, the second control device stores log information of each first control device separately.
12. The method according to any one of claims 9 to 11, characterized in that Before storing the first log information, the method further includes: The second control device obtains second configuration information of the second control device; When the second configuration information indicates that the second control device stores the log information of the first control device, the second control device configures the second control device as a log storage terminal of the first control device.
13. A first control device, characterized in that: include: A generating module, used to generate first log information, the first control device belongs to a distributed control system, and the first control device is used to control the operation of a first device; The sending module is used to send the first log information to a second control device with a log storage function in the distributed control system so that the second control device stores the first log information, and the second control device is used to control the operation of the second device.
14. The device according to claim 13, characterized in that Also includes: The determination module is used to determine whether the second control device is configured as a log storage end of the first control device.
15. The device according to claim 13, characterized in that The sending module is also used to send the first log information to a third control device with a log storage function in the distributed control system, so that the third control device stores the first log information. The third control device is used to control the operation of a third device.
16. The device according to claim 13, characterized in that It also includes a storage module, which is used to store the first log information.
17. The device according to claim 13, characterized in that The sending module is further configured to cache the first log information in the first control device when the communication connection with the second control device is disconnected; and to send the cached first log information to the second control device when the communication connection with the second control device is restored.
18. The device according to claim 13, characterized in that The sending module is specifically configured to unicast the first log information to the second control device.
19. The device according to claim 13, characterized in that The sending module is specifically used to broadcast and send the first log information to other control devices in the distributed control system except the first control device.
20. The device according to any one of claims 13 to 19, characterized in that Also includes: The configuration module is used to obtain first configuration information of the first control device; when the first configuration information indicates that the first control device stores log information in the second control device, configure the first control device as a log sending end of the second control device.
21. A second control device, characterized in that: include: A receiving module, used for receiving first log information sent by a first control device, wherein the first control device and the second control device belong to a distributed control system, the first control device is used for controlling the operation of the first device, and the second control device has a log storage function for controlling the operation of the second device; A storage module is used to store the first log information.
22. The device according to claim 21, characterized in that The storage module is specifically used to determine whether the second control device is configured as the log storage end of the first control device; if so, store the first log information in the second control device.
23. The device according to claim 21, characterized in that The storage module is specifically configured to separately store log information of each first control device when there are multiple first control devices.
24. The device according to any one of claims 21 to 23, characterized in that It also includes a configuration module, which is used to obtain second configuration information of the second control device; when the second configuration information indicates that the second control device stores the log information of the first control device, configure the second control device as a log storage end of the first control device.
25. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program runs on a control device, the control device executes the method according to any one of claims 1 to 12.
