PLC adjusting method, device and system, storage medium and electronic equipment
By receiving and parsing PLC adjustment instructions and transmitting adjustment strategies between virtual and physical PLCs, and using the server to build a digital base, the problems of difficulty in PLC management and low adjustment efficiency are solved, and efficient adjustment and unified management of PLC are achieved.
Patent Information
- Application Number
- CN202411871414.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-03-28
AI Technical Summary
The existing PLC equipment is difficult to manage and has low adjustment efficiency, especially in large-scale data processing and complex logic control.
By receiving and parsing adjustment instructions for the target PLC, distinguishing PLC types, and transmitting and executing corresponding adjustment policies between the virtual PLC and the physical PLC, the server is used to build a digital base to uniformly manage and control the PLC.
It realizes efficient adjustment and unified management of PLC, improves the scalability and flexibility of PLC, and reduces troubleshooting and maintenance costs.
Smart Images

Figure CN119717672A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent device control, and in particular to a PLC adjustment method, device, system, storage medium and electronic device. Background Art
[0002] The development of intelligent buildings and building automation systems has evolved from simple electromechanical control to highly integrated automation systems. Early building control systems mainly relied on programmable logic controllers (PLCs) for local control and simple logic control. However, due to the limited computing and storage capabilities of PLC devices, it is difficult to process large-scale data and complex logic, and the scalability is poor.
[0003] In actual engineering development, modifying control logic requires on-site connection to PLC devices for programming and downloading. These PLC devices are usually directly connected via physical cables, which are less flexible, difficult to troubleshoot and maintain, and have high repair costs. In addition, for a large number of PLC devices, it is impossible to achieve unified monitoring and management, and it is impossible to run related control logic across devices. Summary of the invention
[0004] The present application provides a PLC adjustment method to solve the technical problems of difficult PLC management and low adjustment efficiency.
[0005] In a first aspect, the present application provides a PLC adjustment method, comprising: receiving an adjustment instruction for adjusting a target PLC, wherein the target PLC is used to control intelligent devices in a target area; parsing the adjustment instruction to obtain the type and adjustment strategy of the target PLC; when the target PLC is a virtual PLC, adjusting the target PLC on a server according to the adjustment strategy; when the target PLC is a physical PLC, transmitting the adjustment strategy to the target PLC via the server, so as to adjust the target PLC according to the adjustment strategy.
[0006] In the second aspect, the present application provides a PLC adjustment device, comprising: a receiving module, used to receive adjustment instructions for adjusting a target PLC, wherein the target PLC is used to control intelligent devices in a target area; a parsing module, used to parse the adjustment instructions to obtain the type and adjustment strategy of the target PLC; an adjustment module, used to adjust the target PLC on a server according to the adjustment strategy when the target PLC is a virtual PLC; when the target PLC is a physical PLC, transmit the adjustment strategy to the target PLC via the server, so as to adjust the target PLC according to the adjustment strategy.
[0007] In the third aspect, the present application provides a digital base, including a virtual PLC and a physical PLC; the digital base is used to receive adjustment instructions for adjusting a target PLC, wherein the target PLC is used to control smart devices in a target area; the adjustment instructions are parsed to obtain the type and adjustment strategy of the target PLC; when the target PLC is a virtual PLC, the target PLC on the server is adjusted according to the adjustment strategy; when the target PLC is a physical PLC, the adjustment strategy is transmitted to the target PLC through the server so as to adjust the target PLC according to the adjustment strategy.
[0008] In a fourth aspect, the present application provides a PLC adjustment system, comprising: a client, used to initiate adjustment instructions; a server, used to receive adjustment instructions for adjusting a target PLC, wherein the target PLC is used to control intelligent devices in a target area; parsing the adjustment instructions to obtain the type and adjustment strategy of the target PLC; when the target PLC is a virtual PLC, adjusting the target PLC on the server according to the adjustment strategy; when the target PLC is a physical PLC, transmitting the adjustment strategy to the target PLC through the server, so as to adjust the target PLC according to the adjustment strategy; and an intelligent device, used to be controlled by the target PLC to realize the function of the device.
[0009] In a fifth aspect, the present application provides a PLC adjustment device, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the processor is configured to execute the above-mentioned PLC adjustment method by executing executable instructions in the memory.
[0010] In a sixth aspect, the present application further provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute any of the above-mentioned PLC adjustment methods of the present application.
[0011] The above-mentioned technical scheme provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application, by receiving an adjustment instruction for adjusting the target PLC, wherein the target PLC is used to control the intelligent devices in the target area; parsing the above-mentioned adjustment instruction to obtain the type and adjustment strategy of the above-mentioned target PLC; when the above-mentioned target PLC is a virtual PLC, adjusting the above-mentioned target PLC on the server according to the above-mentioned adjustment strategy; when the above-mentioned target PLC is a physical PLC, transmitting the above-mentioned adjustment strategy to the above-mentioned target PLC through the above-mentioned server, so as to adjust the above-mentioned target PLC according to the above-mentioned adjustment strategy, so that the server can be used to provide microservices of the virtual PLC, and the physical PLC can be connected through the server, so as to build a digital base on the server to carry the PLC, and the PLC can be easily adjusted. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0013] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0014] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0015] Figure 1 A flow chart of a PLC adjustment method provided in an embodiment of the present application;
[0016] Figure 2 A data interaction diagram provided for an embodiment of the present application;
[0017] Figure 3 A parsing adjustment instruction diagram of a PLC adjustment method provided in an embodiment of the present application;
[0018] Figure 4 A flow chart for adjusting a target PLC provided in an embodiment of the present application;
[0019] Figure 5 Another flow chart for adjusting the target PLC provided in an embodiment of the present application;
[0020] Figure 6 A system schematic diagram provided for an embodiment of the present application;
[0021] Figure 7 A schematic diagram of adjusting the target PLC of a digital base provided in an embodiment of the present application;
[0022] Figure 8 A schematic diagram of a PLC adjustment device provided in an embodiment of the present application;
[0023] Fig. 9 A schematic diagram of a PLC adjustment system provided in an embodiment of the present application;
[0024] Fig.10 A schematic diagram of a PLC adjustment device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0026] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0027] In order to solve the technical problems of difficult PLC management and low adjustment efficiency in the prior art, the present application provides a PLC adjustment method that can achieve the effect of improving the adjustment efficiency of the PLC.
[0028] Figure 1 A flow chart of a PLC adjustment method provided in an embodiment of the present application, such as Figure 1 As shown, including:
[0029] S102, receiving an adjustment instruction for adjusting a target PLC, wherein the target PLC is used to control intelligent devices in a target area;
[0030] S102, parsing the adjustment instruction to obtain the type and adjustment strategy of the target PLC;
[0031] S106, when the target PLC is a virtual PLC, the target PLC on the server is adjusted according to the adjustment strategy; when the target PLC is a physical PLC, the adjustment strategy is transmitted to the target PLC through the server, so that the target PLC is adjusted according to the adjustment strategy.
[0032] The present application can configure a digital base, which includes a programmable logic controller (PLC), and the PLC can control intelligent devices. For example, for a building, the building includes a variety of intelligent devices, such as central air conditioning, corridor lights, elevators, alarms, etc. And a variety of intelligent devices must be controlled by PLC. For example, the PLC used to control the light can control the light and dark time period of the light. Most of the existing PLCs are physical PLCs, and if the control logic of the PLC is to be adjusted, it is necessary to go to the location of the PLC and insert a physical line to import the control logic of the PLC into the PLC device, such as allowing the PLC device to control the light and dark time period of the light according to the imported control logic. However, this method is laborious and cumbersome to adjust the PLC. In this embodiment, by configuring the digital base, the digital base can be located on the server, so that both the physical PLC and the virtual PLC can be connected to the digital base, so that all PLCs can be managed and controlled through a unified platform. For example, if the PLCs of all smart devices in a community are integrated into the digital base, the property management can be given permissions to adjust any PLC on the digital base. The PLCs will control the smart devices in the community according to the adjusted strategy.
[0033] In this embodiment, the digital base can be located on the server, but because the virtual PLC is configured on the server, the physical PLC is a physical device and will not be located on the server. Therefore, the physical PLC can be communicated through the server, so that the physical PLC and the virtual PLC are integrated into a platform through the server as a digital base. If the user wants to adjust any PLC on the digital base, whether it is a physical PLC or a virtual PLC, he can access the server through the client and initiate adjustment instructions through the client to adjust the physical PLC or virtual PLC. The client can be a mobile terminal, a physical host, a cloud host, a virtual machine, a mini-program, an application on the terminal, etc. In other words, the user does not limit the way to access the server.
[0034] When the user is controlling the PLC, the front-end page can be displayed on the client. The user can use the front-end page to select the PLC to be controlled and what adjustments to make. After the user has configured the PLC to be controlled and what adjustments to make through the front-end page, an adjustment command can be issued. The adjustment command is used to adjust the target PLC. The target PLC can be one or more.
[0035] After obtaining the adjustment instruction, the server can parse the adjustment instruction. The purpose of the analysis is to check which target PLCs the user wants to control and the adjustment strategy for each target PLC. The adjustment strategy is what adjustments to make. After parsing the adjustment instruction, the type of the target PLC to be adjusted is obtained. Since the server includes virtual PLCs and physical PLCs, the strategy is different depending on the type of the target PLC to be adjusted.
[0036] For virtual PLC, virtual PLC is a microservice set on the server, and the functions of virtual PLC are realized through microservice. For example, a microservice for controlling an elevator is set on the server as the virtual PLC of the elevator. For physical PLC, the physical PLC can be configured near the elevator or in the community to control the elevator. A connection is established between the server and the physical PLC.
[0037] When the adjustment instruction is parsed and the target PLC that the user wants to adjust is determined, if the target PLC is a virtual PLC, the virtual PLC on the server can be adjusted directly. When adjusting the virtual PLC, the control logic in the microservice of the virtual PLC can be adjusted and updated to the new control logic. If the adjustment is made to the physical PLC, the server can send the adjustment strategy to the physical PLC to update the control logic in the physical PLC.
[0038] For example, Figure 2 The figure shows a data interaction diagram. The server contains a record table of the physical PLC and is also configured with a virtual PLC. The record table of the physical PLC corresponds to the physical PLC. The physical PLC and the virtual PLC constitute the digital base. The client interacts with the server to adjust the physical PLC or virtual PLC of the digital base.
[0039] The method provided by the embodiment of the present application receives an adjustment instruction for adjusting a target PLC, wherein the target PLC is used to control intelligent devices in a target area; parses the adjustment instruction to obtain the type and adjustment strategy of the target PLC; when the target PLC is a virtual PLC, adjusts the target PLC on the server according to the adjustment strategy; when the target PLC is a physical PLC, transmits the adjustment strategy to the target PLC through the server to adjust the target PLC according to the adjustment strategy, so that the server can be used to provide microservices of the virtual PLC, and the physical PLC can be connected through the server, so that a digital base can be built on the server to carry the PLC, and the PLC can be easily adjusted.
[0040] In this embodiment, when parsing the adjustment instruction, an optional method is as follows: Figure 3 As shown, the parsing process can be:
[0041] S302, parsing the adjustment instruction and obtaining adjustment information;
[0042] S304, when the adjustment information includes the device unique identifier, device model, performance indicators and adjustment strategy, determine that the target PLC is a virtual PLC and obtain the adjustment strategy; when the adjustment information only includes the unique identifier and adjustment strategy, determine that the target PLC is a physical PLC and obtain the adjustment strategy.
[0043] The core purpose of parsing the adjustment instruction is to obtain the adjustment information in the adjustment instruction. The adjustment information may include the device unique identifier, device model, performance indicators and adjustment strategy, or may not include performance indicators and device model. Because the corresponding device can be found through the device unique identifier. The adjustment strategy is the strategy for adjusting the only target PLC found. The device model and performance indicators are the model and performance indicators of the virtual PLC to be created on the server when the target PLC corresponding to the device unique identifier cannot be found.
[0044] In this embodiment, the amount of content included in the adjustment information in the adjustment instruction can determine whether the user wants to adjust the virtual PLC or the physical PLC. In another embodiment, the user can provide the device unique identifier, device model, performance index and adjustment strategy when creating a virtual PLC, and can also only provide the device unique identifier and adjustment strategy when adjusting the virtual PLC. In this case, the device unique identifier can be used to check whether the PLC to be adjusted is a virtual PLC or a physical PLC.
[0045] When the user decides to adjust a target PLC, an adjustment command can be initiated. Regardless of whether the PLC to be adjusted is a physical PLC or a virtual PLC, a virtual PLC can be created on the server according to the default device model and performance indicators when the target PLC to be adjusted cannot be found.
[0046] In this embodiment, the adjustment strategies for the virtual PLC and the physical PLC are different. As an implementation method, when the target PLC is a virtual PLC, Figure 4 As shown, adjusting the target PLC on the server according to the adjustment strategy includes:
[0047] S402, searching for a target PLC on the server;
[0048] S404, when the target PLC is found, the target PLC is adjusted; when the target PLC is not found, a microservice of the target PLC is created to simulate the target PLC.
[0049] In this embodiment, if the target PLC is a virtual PLC, the target PLC can be searched on the server. If the target PLC can be found, it can be adjusted directly. Since the target PLC is a virtual PLC, on the server, the control logic can be directly modified to obtain the adjusted target PLC. If the target PLC corresponding to the device unique identifier cannot be found on the server, it means that the target PLC corresponding to the device unique identifier is not stored on the server at all. At this time, either the user's device unique identifier is entered incorrectly, or the server does not have the target PLC that the user thinks should be there. Therefore, the corresponding target PLC can be generated on the server according to the adjustment instructions provided by the user, and the generated target PLC is a virtual PLC.
[0050] When generating a target PLC, if the user provides a device model and performance indicators, the target PLC can be generated according to the device model and performance indicators provided by the user. If the user does not provide a device model and performance indicators, the default device model and performance indicators can be used to create the target PLC.
[0051] In this embodiment, when searching for the target PLC on the server, the target PLC can be searched according to the device unique identifier in the adjustment instruction; a unique target PLC can be found according to the device unique identifier in the adjustment instruction. If the corresponding target PLC cannot be found on the server, it means that there is no corresponding PLC on the server, and the target PLC can be created according to the above-mentioned process. If a PLC matching the device unique identifier can be found, the model of the PLC found can be compared with the device model in the adjustment instruction to see if it is consistent; the purpose of comparing the model of the PLC found with the device model in the adjustment instruction is that although a unique device can be found through the device unique identifier, it is also necessary to see whether the unique device is consistent with the device model input by the user. If the device model is inconsistent, it means that although there is a virtual PLC corresponding to the device unique identifier on the server, the virtual PLC may not be the PLC of the model the user wants. Therefore, when the model of the PLC found is consistent with the device model, it is determined that the target PLC is found; when the model of the PLC found is inconsistent with the device model or the PLC matching the device unique identifier is not found, it is determined that the target PLC is not found. Therefore, a virtual PLC of the corresponding model can be created according to the user's device model.
[0052] In this case, the same device unique identifier may correspond to multiple virtual PLCs, and different virtual PLCs have different device models. However, in order to make the device unique identifier uniquely correspond to a device, the target PLC can be found according to the user's device unique identifier, but when the device model of the target PLC is different from the device model entered by the user, after creating the device model entered by the user, a device unique identifier is assigned to the device model, and the newly assigned device unique identifier is returned to the user. In this way, each PLC on the server can be marked with a unique identifier.
[0053] In this embodiment, when creating a virtual PLC on a server, in addition to the device model, a performance indicator can also be configured. The performance indicator is the performance of the virtual PLC, such as the size of the processor's L3 cache, the number of cores, the bandwidth size, the memory size, etc. When creating a virtual PLC, the virtual PLC can be created by creating a microservice.
[0054] In this embodiment, the adjustment strategies for the virtual PLC and the physical PLC are different. As an implementation method, when the target PLC is a physical PLC, Figure 5 As shown, transmitting the adjustment strategy to the target PLC through the server includes:
[0055] S502, determining a target PLC in the physical PLC according to the device unique identifier in the adjustment instruction;
[0056] S504, sending the adjustment strategy to the target PLC by calling the communication microservice on the server.
[0057] In this embodiment, since the target PLC is a physical PLC, it cannot be deployed on the server, but is deployed in a physical location, such as an elevator shaft, or a place in a community dedicated to arranging physical controllers. In this case, the correspondence between the physical PLC and the unique device identifier can be configured on the server, and a connection relationship is established with the server for each physical PLC. The connection relationship can be provided by a communication microservice. Then, for the adjustment instruction, after determining the physical PLC according to the unique device identifier, the server can send the adjustment strategy in the adjustment instruction to the physical PLC through the microservice to update the control logic of the physical PLC.
[0058] In this embodiment, whether the target PLC is a virtual PLC or a physical PLC, when adjusting the target PLC, the control logic in the adjustment strategy can be downloaded to the target PLC so that the target PLC runs the downloaded control logic. After the target PLC downloads the control logic and updates its own control logic, the smart device can be controlled according to the updated control logic. If the target PLC is a physical PLC, there are many ways to communicate with the smart device. For example, it can be connected through a physical line or through a network. If connected through a network, network communication can be provided through a communication microservice.
[0059] Figure 6 This is a system diagram of this embodiment. It includes a user interaction terminal, a digital base system (i.e., a system including a physical PLC and a virtual PLC), and a collection of smart devices. The user interaction terminal is an interactive terminal for users to operate and view, including but not limited to computer web pages, clients, mobile applications, applets or web pages, used to view device configuration details, device data display, control, etc. The digital base system provides user services and a collection of functions. It includes the following modules:
[0060] PLC logic control microservice: provides users with services to control the logical operation of virtual PLC devices and manage device logic in a unified manner.
[0061] Message channel: Provides internal and external communication services for the digital base system, through which equipment and logical data are transmitted and received.
[0062] Virtual PLC device: A microservice that is independent of the PLC device entity and is used to run related control logic. It has the same functions as the actual PLC device and can be connected to related control devices for logical control.
[0063] Real PLC device: refers to a physical PLC device that runs related control logic internally and can be independently connected to related devices for logical control.
[0064] The device set refers to different types of terminal devices connected to the system, such as lights, air conditioners, fans, temperature sensors, etc. They are controlled through virtual PLC and physical PLC. A, B, and C represent different types of smart devices.
[0065] Figure 7 The following is a schematic diagram for adjusting the target PLC of the digital base. The user can configure the PLC device remotely in the host computer software and can choose whether to configure a real PLC device or a virtual PLC device. PLC logic control microservice: used for configuration, logic download, and unified management and control of PLC devices. If it is a virtual PLC device, configure the relevant device information, including the device model, performance indicators, and device unique identifier, and then generate an independent microservice in the digital base to simulate a virtual PLC device. If it is a real device, you need to enter the corresponding device information, device unique identifier, and remotely connect to the real PLC device through the message channel (communication microservice). Message channel (communication microservice): used for data communication between PLC devices, access devices, and microservices. Then the user downloads the control logic to be run directly to the corresponding virtual PLC device or real device in the host computer software. For processing large-scale data and complex logic, you can choose a virtual PLC device and adjust the corresponding performance indicators of the virtual PLC to dynamically meet the operation requirements. For devices that need to be connected to the PLC, they are remotely connected to the corresponding devices through the message channel (communication microservice), data is exchanged, and related equipment is monitored through message communication.
[0066] This embodiment also provides a PLC adjustment device, such as Figure 8 As shown, including:
[0067] A receiving module 802 is used to receive an adjustment instruction for adjusting a target PLC, wherein the target PLC is used to control smart devices in a target area;
[0068] The parsing module 804 is used to parse the adjustment instruction and obtain the type and adjustment strategy of the target PLC;
[0069] The adjustment module 806 is used to adjust the target PLC on the server according to the adjustment strategy when the target PLC is a virtual PLC; when the target PLC is a physical PLC, the adjustment strategy is transmitted to the target PLC through the server so as to adjust the target PLC according to the adjustment strategy.
[0070] The present application can configure a digital base, which includes a programmable logic controller (PLC), and the PLC can control intelligent devices. For example, for a building, the building includes a variety of intelligent devices, such as central air conditioning, corridor lights, elevators, alarms, etc. And a variety of intelligent devices must be controlled by PLC. For example, the PLC used to control the light can control the light and dark time period of the light. Most of the existing PLCs are physical PLCs, and if the control logic of the PLC is to be adjusted, it is necessary to go to the location of the PLC and insert a physical line to import the control logic of the PLC into the PLC device, such as allowing the PLC device to control the light and dark time period of the light according to the imported control logic. However, this method is laborious and cumbersome to adjust the PLC. In this embodiment, by configuring the digital base, the digital base can be located on the server, so that both the physical PLC and the virtual PLC can be connected to the digital base, so that all PLCs can be managed and controlled through a unified platform. For example, if the PLCs of all smart devices in a community are integrated into the digital base, the property management can be given permissions to adjust any PLC on the digital base. The PLCs will control the smart devices in the community according to the adjusted strategy.
[0071] In this embodiment, the digital base can be located on the server, but because the virtual PLC is configured on the server, the physical PLC is a physical device and will not be located on the server. Therefore, the physical PLC can be communicated through the server, so that the physical PLC and the virtual PLC are integrated into a platform through the server as a digital base. If the user wants to adjust any PLC on the digital base, whether it is a physical PLC or a virtual PLC, he can access the server through the client and initiate adjustment instructions through the client to adjust the physical PLC or virtual PLC. The client can be a mobile terminal, a physical host, a cloud host, a virtual machine, a mini-program, an application on the terminal, etc. In other words, the user does not limit the way to access the server.
[0072] When the user is controlling the PLC, the front-end page can be displayed on the client. The user can use the front-end page to select the PLC to be controlled and what adjustments to make. After the user has configured the PLC to be controlled and what adjustments to make through the front-end page, an adjustment command can be issued. The adjustment command is used to adjust the target PLC. The target PLC can be one or more.
[0073] After obtaining the adjustment instruction, the server can parse the adjustment instruction. The purpose of the analysis is to check which target PLCs the user wants to control and the adjustment strategy for each target PLC. The adjustment strategy is what adjustments to make. After parsing the adjustment instruction, the type of the target PLC to be adjusted is obtained. Since the server includes virtual PLCs and physical PLCs, the strategy is different depending on the type of the target PLC to be adjusted.
[0074] For virtual PLC, virtual PLC is a microservice set on the server, and the functions of virtual PLC are realized through microservice. For example, a microservice for controlling an elevator is set on the server as the virtual PLC of the elevator. For physical PLC, the physical PLC can be configured near the elevator or in the community to control the elevator. A connection is established between the server and the physical PLC.
[0075] When the adjustment instruction is parsed and the target PLC that the user wants to adjust is determined, if the target PLC is a virtual PLC, the virtual PLC on the server can be adjusted directly. When adjusting the virtual PLC, the control logic in the microservice of the virtual PLC can be adjusted and updated to the new control logic. If the adjustment is made to the physical PLC, the server can send the adjustment strategy to the physical PLC to update the control logic in the physical PLC.
[0076] For example, Figure 2 The figure shows a data interaction diagram. The server contains a record table of the physical PLC and is also configured with a virtual PLC. The record table of the physical PLC corresponds to the physical PLC. The physical PLC and the virtual PLC constitute the digital base. The client interacts with the server to adjust the physical PLC or virtual PLC of the digital base.
[0077] The method provided by the embodiment of the present application receives an adjustment instruction for adjusting a target PLC, wherein the target PLC is used to control intelligent devices in a target area; parses the adjustment instruction to obtain the type and adjustment strategy of the target PLC; when the target PLC is a virtual PLC, adjusts the target PLC on the server according to the adjustment strategy; when the target PLC is a physical PLC, transmits the adjustment strategy to the target PLC through the server to adjust the target PLC according to the adjustment strategy, so that the server can be used to provide microservices of the virtual PLC, and the physical PLC can be connected through the server, so that a digital base can be built on the server to carry the PLC, and the PLC can be easily adjusted.
[0078] The present embodiment also provides a digital base, including: a virtual PLC and a physical PLC; the digital base is used to receive adjustment instructions for adjusting a target PLC, wherein the target PLC is used to control intelligent devices in a target area; the adjustment instructions are parsed to obtain the type and adjustment strategy of the target PLC; when the target PLC is a virtual PLC, the target PLC on the server is adjusted according to the adjustment strategy; when the target PLC is a physical PLC, the adjustment strategy is transmitted to the target PLC through the server so that the target PLC is adjusted according to the adjustment strategy.
[0079] The present application can configure a digital base, which includes a programmable logic controller (PLC), and the PLC can control intelligent devices. For example, for a building, the building includes a variety of intelligent devices, such as central air conditioning, corridor lights, elevators, alarms, etc. And a variety of intelligent devices must be controlled by PLC. For example, the PLC used to control the light can control the light and dark time period of the light. Most of the existing PLCs are physical PLCs, and if the control logic of the PLC is to be adjusted, it is necessary to go to the location of the PLC and insert a physical line to import the control logic of the PLC into the PLC device, such as allowing the PLC device to control the light and dark time period of the light according to the imported control logic. However, this method is laborious and cumbersome to adjust the PLC. In this embodiment, by configuring the digital base, the digital base can be located on the server, so that both the physical PLC and the virtual PLC can be connected to the digital base, so that all PLCs can be managed and controlled through a unified platform. For example, if the PLCs of all smart devices in a community are integrated into the digital base, the property management can be given permissions to adjust any PLC on the digital base. The PLCs will control the smart devices in the community according to the adjusted strategy.
[0080] In this embodiment, the digital base can be located on the server, but because the virtual PLC is configured on the server, the physical PLC is a physical device and will not be located on the server. Therefore, the physical PLC can be communicated through the server, so that the physical PLC and the virtual PLC are integrated into a platform through the server as a digital base. If the user wants to adjust any PLC on the digital base, whether it is a physical PLC or a virtual PLC, he can access the server through the client and initiate adjustment instructions through the client to adjust the physical PLC or virtual PLC. The client can be a mobile terminal, a physical host, a cloud host, a virtual machine, a mini-program, an application on the terminal, etc. In other words, the user does not limit the way to access the server.
[0081] When the user is controlling the PLC, the front-end page can be displayed on the client. The user can use the front-end page to select the PLC to be controlled and what adjustments to make. After the user has configured the PLC to be controlled and what adjustments to make through the front-end page, an adjustment command can be issued. The adjustment command is used to adjust the target PLC. The target PLC can be one or more.
[0082] After obtaining the adjustment instruction, the server can parse the adjustment instruction. The purpose of the analysis is to check which target PLCs the user wants to control and the adjustment strategy for each target PLC. The adjustment strategy is what adjustments to make. After parsing the adjustment instruction, the type of the target PLC to be adjusted is obtained. Since the server includes virtual PLCs and physical PLCs, the strategy is different depending on the type of the target PLC to be adjusted.
[0083] For virtual PLC, virtual PLC is a microservice set on the server, and the functions of virtual PLC are realized through microservice. For example, a microservice for controlling an elevator is set on the server as the virtual PLC of the elevator. For physical PLC, the physical PLC can be configured near the elevator or in the community to control the elevator. A connection is established between the server and the physical PLC.
[0084] When the adjustment instruction is parsed and the target PLC that the user wants to adjust is determined, if the target PLC is a virtual PLC, the virtual PLC on the server can be adjusted directly. When adjusting the virtual PLC, the control logic in the microservice of the virtual PLC can be adjusted and updated to the new control logic. If the adjustment is made to the physical PLC, the server can send the adjustment strategy to the physical PLC to update the control logic in the physical PLC.
[0085] For example, Figure 2 The figure shows a data interaction diagram. The server contains a record table of the physical PLC and is also configured with a virtual PLC. The record table of the physical PLC corresponds to the physical PLC. The physical PLC and the virtual PLC constitute the digital base. The client interacts with the server to adjust the physical PLC or virtual PLC of the digital base.
[0086] The method provided by the embodiment of the present application receives an adjustment instruction for adjusting a target PLC, wherein the target PLC is used to control intelligent devices in a target area; parses the adjustment instruction to obtain the type and adjustment strategy of the target PLC; when the target PLC is a virtual PLC, adjusts the target PLC on the server according to the adjustment strategy; when the target PLC is a physical PLC, transmits the adjustment strategy to the target PLC through the server to adjust the target PLC according to the adjustment strategy, so that the server can be used to provide microservices of the virtual PLC, and the physical PLC can be connected through the server, so that a digital base can be built on the server to carry the PLC, and the PLC can be easily adjusted.
[0087] This embodiment also provides a PLC adjustment system, such as Fig. 9 As shown, including:
[0088] Client 902, used to initiate adjustment instructions;
[0089] The server 904 is used to receive an adjustment instruction for adjusting a target PLC, wherein the target PLC is used to control the intelligent devices in the target area; parse the adjustment instruction to obtain the type and adjustment strategy of the target PLC; when the target PLC is a virtual PLC, adjust the target PLC on the server according to the adjustment strategy; when the target PLC is a physical PLC, transmit the adjustment strategy to the target PLC through the server, so as to adjust the target PLC according to the adjustment strategy;
[0090] The intelligent device 906 is used to be controlled by the target PLC to realize the function of the device.
[0091] The present application can configure a digital base, which includes a programmable logic controller (PLC), and the PLC can control intelligent devices. For example, for a building, the building includes a variety of intelligent devices, such as central air conditioning, corridor lights, elevators, alarms, etc. And a variety of intelligent devices must be controlled by PLC. For example, the PLC used to control the light can control the light and dark time period of the light. Most of the existing PLCs are physical PLCs, and if the control logic of the PLC is to be adjusted, it is necessary to go to the location of the PLC and insert a physical line to import the control logic of the PLC into the PLC device, such as allowing the PLC device to control the light and dark time period of the light according to the imported control logic. However, this method is laborious and cumbersome to adjust the PLC. In this embodiment, by configuring the digital base, the digital base can be located on the server, so that both the physical PLC and the virtual PLC can be connected to the digital base, so that all PLCs can be managed and controlled through a unified platform. For example, if the PLCs of all smart devices in a community are integrated into the digital base, the property management can be given permissions to adjust any PLC on the digital base. The PLCs will control the smart devices in the community according to the adjusted strategy.
[0092] In this embodiment, the digital base can be located on the server, but because the virtual PLC is configured on the server, the physical PLC is a physical device and will not be located on the server. Therefore, the physical PLC can be communicated through the server, so that the physical PLC and the virtual PLC are integrated into a platform through the server as a digital base. If the user wants to adjust any PLC on the digital base, whether it is a physical PLC or a virtual PLC, he can access the server through the client and initiate adjustment instructions through the client to adjust the physical PLC or virtual PLC. The client can be a mobile terminal, a physical host, a cloud host, a virtual machine, a mini-program, an application on the terminal, etc. In other words, the user does not limit the way to access the server.
[0093] When the user is controlling the PLC, the front-end page can be displayed on the client. The user can use the front-end page to select the PLC to be controlled and what adjustments to make. After the user has configured the PLC to be controlled and what adjustments to make through the front-end page, an adjustment command can be issued. The adjustment command is used to adjust the target PLC. The target PLC can be one or more.
[0094] After obtaining the adjustment instruction, the server can parse the adjustment instruction. The purpose of the analysis is to check which target PLCs the user wants to control and the adjustment strategy for each target PLC. The adjustment strategy is what adjustments to make. After parsing the adjustment instruction, the type of the target PLC to be adjusted is obtained. Since the server includes virtual PLCs and physical PLCs, the strategy is different depending on the type of the target PLC to be adjusted.
[0095] For virtual PLC, virtual PLC is a microservice set on the server, and the functions of virtual PLC are realized through microservice. For example, a microservice for controlling an elevator is set on the server as the virtual PLC of the elevator. For physical PLC, the physical PLC can be configured near the elevator or in the community to control the elevator. A connection is established between the server and the physical PLC.
[0096] When the adjustment instruction is parsed and the target PLC that the user wants to adjust is determined, if the target PLC is a virtual PLC, the virtual PLC on the server can be adjusted directly. When adjusting the virtual PLC, the control logic in the microservice of the virtual PLC can be adjusted and updated to the new control logic. If the adjustment is made to the physical PLC, the server can send the adjustment strategy to the physical PLC to update the control logic in the physical PLC.
[0097] For example, Figure 2 The figure shows a data interaction diagram. The server contains a record table of the physical PLC and is also configured with a virtual PLC. The record table of the physical PLC corresponds to the physical PLC. The physical PLC and the virtual PLC constitute the digital base. The client interacts with the server to adjust the physical PLC or virtual PLC of the digital base.
[0098] The method provided by the embodiment of the present application receives an adjustment instruction for adjusting a target PLC, wherein the target PLC is used to control intelligent devices in a target area; parses the adjustment instruction to obtain the type and adjustment strategy of the target PLC; when the target PLC is a virtual PLC, adjusts the target PLC on the server according to the adjustment strategy; when the target PLC is a physical PLC, transmits the adjustment strategy to the target PLC through the server to adjust the target PLC according to the adjustment strategy, so that the server can be used to provide microservices of the virtual PLC, and the physical PLC can be connected through the server, so that a digital base can be built on the server to carry the PLC, and the PLC can be easily adjusted.
[0099] like Fig.10As shown, the embodiment of the present application provides a PLC adjustment device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0100] Memory 113, used for storing computer programs;
[0101] In one embodiment of the present application, the processor 111 is used to implement the PLC adjustment method provided by any one of the aforementioned method embodiments when executing the computer program stored in the memory 113 .
[0102] An embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the PLC adjustment method provided in any of the aforementioned method embodiments are implemented.
[0103] The device embodiments described above are merely illustrative, wherein 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 modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0104] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0105] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0106] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A PLC adjustment method, characterized in that: include: Receiving an adjustment instruction for adjusting a target PLC, wherein the target PLC is used to control intelligent devices in a target area; Parsing the adjustment instruction to obtain the type and adjustment strategy of the target PLC; When the target PLC is a virtual PLC, adjusting the target PLC on the server according to the adjustment strategy; When the target PLC is a physical PLC, the adjustment strategy is transmitted to the target PLC through the server, so that the target PLC is adjusted according to the adjustment strategy.
2. The method according to claim 1, characterized in that The analyzing the adjustment instruction to obtain the type and adjustment strategy of the target PLC includes: Parsing the adjustment instruction to obtain adjustment information; When the adjustment information includes a unique device identifier, a device model, a performance indicator, and an adjustment strategy, determining that the target PLC is a virtual PLC, and obtaining the adjustment strategy; When the adjustment information only includes a unique identifier and an adjustment strategy, it is determined that the target PLC is a physical PLC, and the adjustment strategy is obtained.
3. The method according to claim 1, characterized in that When the target PLC is a virtual PLC, adjusting the target PLC on the server according to the adjustment strategy includes: Searching for the target PLC on the server; When the target PLC is found, adjusting the target PLC; When the target PLC is not found, a microservice of the target PLC is created to simulate the target PLC.
4. The method according to claim 3, characterized in that Describing searching for the target PLC on the server includes: Searching for the target PLC according to the unique device identifier in the adjustment instruction; When a PLC matching the unique identifier of the device is found, comparing the model of the found PLC with the device model in the adjustment instruction to see whether they are consistent; When the model of the found PLC is consistent with the device model, it is determined that the target PLC is found; When the model of the found PLC is inconsistent with the device model or a PLC matching the unique identifier of the device is not found, it is determined that the target PLC is not found.
5. The method according to claim 3, characterized in that: When the target PLC is not found, creating a microservice of the target PLC to simulate the target PLC includes: The microservice of the target PLC is created according to the device unique identifier, device model and performance indicators in the adjustment instruction.
6. The method according to claim 1, characterized in that When the target PLC is a physical PLC, transmitting the adjustment strategy to the target PLC through the server includes: Determine the target PLC in the physical PLC according to the unique device identifier in the adjustment instruction; The adjustment strategy is sent to the target PLC by calling the communication microservice on the server.
7. The method according to claim 1, characterized in that Adjusting the target PLC includes: The control logic in the adjustment strategy is downloaded to the target PLC, so that the target PLC runs the downloaded control logic.
8. The method according to claim 1, characterized in that After adjusting the target PLC, the method further comprises: The target PLC controls the smart device through the communication microservice.
9. A PLC adjustment device, characterized in that: include: A receiving module, used to receive an adjustment instruction for adjusting a target PLC, wherein the target PLC is used to control intelligent devices in a target area; A parsing module, used for parsing the adjustment instruction to obtain the type and adjustment strategy of the target PLC; An adjustment module is used to adjust the target PLC on the server according to the adjustment strategy when the target PLC is a virtual PLC; when the target PLC is a physical PLC, transmit the adjustment strategy to the target PLC through the server to adjust the target PLC according to the adjustment strategy.
10. A digital base, characterized in that: include: Virtual PLC and physical PLC; The digital base is used to receive adjustment instructions for adjusting a target PLC, wherein the target PLC is used to control intelligent devices in a target area; parse the adjustment instructions to obtain the type and adjustment strategy of the target PLC; when the target PLC is a virtual PLC, adjust the target PLC on the server according to the adjustment strategy; when the target PLC is a physical PLC, transmit the adjustment strategy to the target PLC via the server so as to adjust the target PLC according to the adjustment strategy.
11. A PLC adjustment system, characterized in that: include: Client, used to initiate adjustment instructions; A server is configured to receive an adjustment instruction for adjusting a target PLC, wherein the target PLC is used to control intelligent devices in a target area; parse the adjustment instruction to obtain a type and an adjustment strategy of the target PLC; when the target PLC is a virtual PLC, adjust the target PLC on the server according to the adjustment strategy; when the target PLC is a physical PLC, transmit the adjustment strategy to the target PLC through the server, so as to adjust the target PLC according to the adjustment strategy; The intelligent device is used to be controlled by the target PLC to realize the function of the device.
12. An electronic device, characterized in that: include: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; The memory is used to store a computer program; and the processor is used to implement the method according to any one of claims 1 to 8 when executing the computer program.
13. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.