Disclosure of Invention
In view of the foregoing, it is necessary to provide a communication control method and apparatus, a communication control device, and a storage medium based on docker, for solving the technical problem of system failure caused by the single point link failure.
In order to achieve the above object, in one aspect, an embodiment of the present application provides a communication control method based on docker, where the method includes:
receiving an access connection request of acquisition equipment, wherein the access connection request comprises equipment information of a target master station and the acquisition equipment;
distributing a corresponding docker container for the acquisition equipment according to the equipment information of the acquisition equipment, and acquiring network configuration information of the docker container;
and establishing a communication connection relation between the docker container and the acquisition equipment according to the network configuration information of the docker container so that the acquisition equipment can communicate with the target master station through the corresponding docker container.
In one embodiment, the network configuration information of the docker container includes an IP address of the docker container; then, establishing a communication connection relationship between the docker container and the acquisition device according to the network configuration information of the docker container, including: and respectively establishing an information transmission channel and an encryption transmission channel according to the IP address of the docker container, wherein the information transmission channel is used for transmitting data and control instructions between the acquisition equipment and the target master station, and the encryption transmission channel is used for transmitting data between the acquisition equipment and the docker container in an encryption communication mode.
In one embodiment, the information transmission channel comprises a data transmission channel and a control instruction transmission channel, and the data transmission channel is used for the acquisition device to report data to the target master station; and the control instruction transmission channel is used for the target master station to send a control instruction to the acquisition equipment.
In one embodiment, the encrypted transmission channel comprises a first encrypted transmission channel and a second encrypted transmission channel, and the first encrypted transmission channel is used for the acquisition device to transmit data to the docker container in an encrypted communication mode; and the second encryption transmission channel is used for transmitting data to the acquisition equipment by the docker container in an encryption communication mode.
In one embodiment, after establishing the communication connection relationship between the docker container and the acquisition device according to the network configuration information of the docker container, the method further includes: monitoring the operating state of the docker container; when the fact that the docker container has a fault is monitored, generating a new docker container according to network configuration information of the docker container; and establishing a communication connection relation between the new docker container and the acquisition equipment so that the acquisition equipment can communicate with the target master station through the new docker container.
On the other hand, the embodiment of the present application further provides a communication control device based on docker, and the device includes:
the system comprises a request receiving module, a request receiving module and a processing module, wherein the request receiving module is used for receiving an access connection request of acquisition equipment, and the access connection request comprises equipment information of a target master station to be accessed and the acquisition equipment;
the docker container distribution module is used for distributing corresponding docker containers to the acquisition equipment according to the equipment information of the acquisition equipment to acquire network configuration information of the docker containers;
and the communication connection establishing module is used for establishing a communication connection relation between the docker container and the acquisition equipment according to the network configuration information of the docker container so as to enable the acquisition equipment to communicate with the target master station through the corresponding docker container.
In one embodiment, the network configuration information of the docker container includes an IP address of the docker container; the communication connection establishing module is specifically configured to establish an information transmission channel and an encryption transmission channel according to the IP address of the docker container, where the information transmission channel is used for transmitting data and control instructions between the acquisition device and the target master station, and the encryption transmission channel is used for transmitting data between the acquisition device and the docker container in an encryption communication manner.
In one embodiment, the apparatus further includes a monitoring module, configured to monitor an operating state of the docker container, and generate a new docker container according to network configuration information of the docker container when it is monitored that the docker container is in a fault; the communication connection establishing module is further configured to establish a communication connection relationship between the new docker container and the acquisition device, so that the acquisition device communicates with the target master station through the new docker container.
In yet another aspect, an embodiment of the present application further provides a communication control apparatus, including a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the method when executing the computer program.
In yet another aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the method described above.
According to the communication control method, the device, the communication control equipment and the storage medium based on the docker, the corresponding docker container is distributed for the acquisition equipment by receiving the access connection request of the acquisition equipment, the network configuration information of the docker container is acquired, and the communication connection relation between the docker container and the acquisition equipment is established according to the network configuration information of the docker container, so that the acquisition equipment is communicated with the target master station through the corresponding docker container.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The communication control method based on docker provided by the application can be applied to the application environment shown in fig. 1. Each acquisition device 102 communicates with the master station 106 through the communication control device 104, the acquisition device 102 and the communication control device 104 establish connection through a network, and the communication control device 104 may be disposed inside the master station 106 or may be independently disposed and establish communication connection with the master station 106. Specifically, in this embodiment, when the communication control device 104 receives an access connection request from a certain acquisition device 102 to the master station 106, a corresponding docker container is allocated to the acquisition device 102 according to the device information of the acquisition device 102, network configuration information of the docker container is acquired, and a communication connection relationship between the docker container and the acquisition device 102 is established according to the network configuration information of the docker container, so that the acquisition device 102 communicates with the target master station 106 through the corresponding docker container.
The collection device 102 may be, but not limited to, various terminal devices for data collection, such as a distribution transformer terminal and a low-voltage centralized meter reading collection terminal distributed in a power grid. The master site 106 may be implemented as a stand-alone server or as a server cluster comprised of multiple servers. The communication control device 104 may be a computer device with a docker (application container engine) deployed.
In one embodiment, as shown in fig. 2, a docker-based communication control method is provided, which is described by taking an example of the method applied to the communication control apparatus in fig. 1, and includes the following steps:
step 202, receiving an access connection request of the acquisition device.
Specifically, the front-end acquisition device communicates with the master station through the communication control device, so that before the front-end acquisition device communicates with the master station, connection needs to be established with the communication control device first, that is, an access connection request is sent to the communication control device, where the access connection request includes device information of the target master station and the acquisition device. Specifically, the device information of the acquisition device may be Address information of the acquisition device, such as an IP Address (Internet Protocol Address) and a Media Access Control (MAC) Address of the acquisition device.
And 204, distributing corresponding docker containers to the acquisition equipment according to the equipment information of the acquisition equipment, and acquiring network configuration information of the docker containers.
Since the communication control device is provided with the docker, i.e., the application container engine, after the communication control device receives the access connection request of the acquisition device, the communication control device allocates the corresponding docker container to the acquisition device according to the device information of the acquisition device in the access connection request. And obtaining network configuration information of the docker container, where the network configuration information may include, but is not limited to, an IP address of the docker container.
And step 206, establishing a communication connection relation between the docker container and the acquisition equipment according to the network configuration information of the docker container.
In this embodiment, the communication control device establishes a communication connection relationship between the docker container and the acquisition device according to network configuration information of the docker container, such as an IP address of the docker container, that is, the network configuration information of the docker container realizes one-to-one correspondence between the docker container and the acquisition device, so that the acquisition device communicates with the target master station through the corresponding docker container.
According to the communication control method based on the docker, the corresponding docker container is distributed for the acquisition equipment by receiving the access connection request of the acquisition equipment, the network configuration information of the docker container is obtained, and the communication connection relation between the docker container and the acquisition equipment is established according to the network configuration information of the docker container, so that the acquisition equipment is communicated with the target master station through the corresponding docker container.
In an embodiment, the network configuration information of the docker container includes an IP address of the docker container, and the establishing of the communication connection relationship between the docker container and the acquisition device according to the network configuration information of the docker container may specifically include: and generating a routing strategy according to the IP address of the docker container and the IP address or the MAC address of the acquisition equipment, thereby establishing a communication transmission channel. The communication transmission channel comprises an information transmission channel and an encryption transmission channel. Specifically, the information transmission channel is used for transmitting data and control instructions between the acquisition device and the target master station, and the encryption transmission channel is used for transmitting data between the acquisition device and the docker container in an encryption communication mode. According to the embodiment, on the basis that the docker containers correspond to the acquisition devices one to one, a plurality of communication transmission channels are established, so that data required by various service types can be transmitted, and the compatibility of the system is improved.
In an embodiment, the information transmission channel may further include a data transmission channel and a control instruction transmission channel, where the data transmission channel is used for the collection device to report data, such as data of logs or records, to the target master station. The control instruction transmission channel is used for the target master station to send control instructions to the acquisition equipment, such as control instructions for issuing configuration data, responding to data formats, monitoring running states and the like, so that the control function of the acquisition equipment is realized.
The encrypted transmission channel may include a first encrypted transmission channel and a second encrypted transmission channel, and specifically, when the network communication is not trusted, the acquisition device may transmit data to the docker container through the first encrypted transmission channel in an encrypted communication manner; the docker container can transmit data to the acquisition equipment through the second encryption transmission channel in an encryption communication mode, so that the safety of information transmission is guaranteed. In the embodiment, different communication transmission channels are established to transmit the required data, so that the concurrency of data transmission is realized, and the efficiency of data transmission is improved to a certain extent.
In an embodiment, as shown in fig. 3, after establishing a communication connection relationship between the docker container and the acquisition device according to the network configuration information of the docker container, the method may further include the following steps:
step 302, monitoring the operating state of the docker container.
The operating state of the docker container includes whether the docker container itself has a response or whether each corresponding communication transmission channel has a response. In this embodiment, after the communication control device establishes the communication connection relationship between the docker container and the acquisition device, the operating state of the docker container may be monitored.
And 304, when the fault of the docker container is monitored, generating a new docker container according to the network configuration information of the docker container.
In this embodiment, when the docker container itself does not respond, it indicates that the docker container has a fault, and therefore, a new docker container may be generated according to the network configuration information of the docker container having the fault, that is, the network configuration information of the faulty docker container is copied to reestablish a corresponding new docker container, so that the faulty docker container is replaced with the new docker container.
And step 306, establishing a communication connection relation between the new docker container and the acquisition equipment.
Specifically, a communication connection relation between the acquisition equipment and a new docker container is established for the acquisition equipment establishing the communication connection relation with the failed docker container, so that the acquisition equipment can communicate with the target master station through the new docker container. The above embodiments can be referred to in the process of establishing the communication connection relationship, and details are not described here.
It should be understood that although the various steps in the flow charts of fig. 1-3 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1-3 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 4, there is provided a docker-based communication control apparatus including: a request receiving module 401, a docker container allocating module 402, and a communication connection establishing module 403, wherein:
a request receiving module 401, configured to receive an access connection request of an acquisition device, where the access connection request includes device information of a target master station to be accessed and the acquisition device;
the docker container allocation module 402 is configured to allocate a corresponding docker container to the acquisition device according to the device information of the acquisition device, and obtain network configuration information of the docker container;
the communication connection establishing module 403 is configured to establish a communication connection relationship between the docker container and the acquisition device according to the network configuration information of the docker container, so that the acquisition device communicates with the target master station through the corresponding docker container.
In an embodiment, as shown in fig. 5, the apparatus further includes a monitoring module 404, configured to monitor an operating state of the docker container, and generate a new docker container according to network configuration information of the docker container when it is monitored that the docker container has a fault; the communication connection establishing module 403 is further configured to establish a communication connection relationship between the new docker container and the collection device, so that the collection device communicates with the target master station through the new docker container.
In one embodiment, the network configuration information of the docker container includes an IP address of the docker container; the communication connection establishing module 403 is specifically configured to respectively establish an information transmission channel and an encrypted transmission channel according to the IP address of the docker container, where the information transmission channel is used for transmitting data and control instructions between the acquisition device and the target master station, and the encrypted transmission channel is used for transmitting data between the acquisition device and the docker container in an encrypted communication manner.
In one embodiment, the information transmission channel comprises a data transmission channel and a control instruction transmission channel, wherein the data transmission channel is used for the acquisition device to report data to the target master station; and the control instruction transmission channel is used for the target master station to send a control instruction to the acquisition equipment. The encrypted transmission channel comprises a first encrypted transmission channel and a second encrypted transmission channel, wherein the first encrypted transmission channel is used for the acquisition equipment to transmit data to the docker container in an encrypted communication mode; and the second encryption transmission channel is used for transmitting data to the acquisition equipment by the docker container in an encryption communication mode.
For specific limitations of the docker-based communication control apparatus, reference may be made to the above limitations of the docker-based communication control method, which are not described herein again. The respective modules in the docker-based communication control apparatus may be wholly or partially implemented by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a communication control device is provided, and the communication control device may be a computer device deployed with a docker application container engine, and the internal structure diagram of the communication control device may be as shown in fig. 6. The communication control device comprises a processor, a memory, a network interface and a docker application container engine which are connected through a system bus. Wherein the processor of the communication device is configured to provide computing and control capabilities. The memory of the communication control device includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a docker application container engine. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the communication control device is used for connecting and communicating with external acquisition devices and a master station through a network. The computer program is executed by a processor to implement a docker-based communication control method.
Those skilled in the art will appreciate that the structure shown in fig. 6 is a block diagram of only a part of the structure related to the present application, and does not constitute a limitation of the communication control apparatus to which the present application is applied, and a specific communication control apparatus may include more or less components than those shown in the figure, or combine some components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
receiving an access connection request of acquisition equipment, wherein the access connection request comprises equipment information of a target master station and the acquisition equipment;
distributing a corresponding docker container for the acquisition equipment according to the equipment information of the acquisition equipment, and acquiring network configuration information of the docker container;
and establishing a communication connection relation between the docker container and the acquisition equipment according to the network configuration information of the docker container so that the acquisition equipment can communicate with the target master station through the corresponding docker container.
In one embodiment, the network configuration information of the docker container includes an IP address of the docker container; then, establishing a communication connection relationship between the docker container and the acquisition device according to the network configuration information of the docker container, including: and respectively establishing an information transmission channel and an encryption transmission channel according to the IP address of the docker container, wherein the information transmission channel is used for transmitting data and control instructions between the acquisition equipment and the target master station, and the encryption transmission channel is used for transmitting data between the acquisition equipment and the docker container in an encryption communication mode.
In one embodiment, the information transmission channel comprises a data transmission channel and a control instruction transmission channel, and the data transmission channel is used for the acquisition device to report data to the target master station; and the control instruction transmission channel is used for the target master station to send a control instruction to the acquisition equipment.
In one embodiment, the encrypted transmission channel comprises a first encrypted transmission channel and a second encrypted transmission channel, and the first encrypted transmission channel is used for the acquisition device to transmit data to the docker container in an encrypted communication mode; and the second encryption transmission channel is used for transmitting data to the acquisition equipment by the docker container in an encryption communication mode.
In one embodiment, after establishing the communication connection relationship between the docker container and the acquisition device according to the network configuration information of the docker container, the method further includes: monitoring the operating state of the docker container; when the fact that the docker container has a fault is monitored, generating a new docker container according to network configuration information of the docker container; and establishing a communication connection relation between the new docker container and the acquisition equipment so that the acquisition equipment can communicate with the target master station through the new docker container.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
receiving an access connection request of acquisition equipment, wherein the access connection request comprises equipment information of a target master station and the acquisition equipment;
distributing a corresponding docker container for the acquisition equipment according to the equipment information of the acquisition equipment, and acquiring network configuration information of the docker container;
and establishing a communication connection relation between the docker container and the acquisition equipment according to the network configuration information of the docker container so that the acquisition equipment can communicate with the target master station through the corresponding docker container.
In one embodiment, the network configuration information of the docker container includes an IP address of the docker container; then, establishing a communication connection relationship between the docker container and the acquisition device according to the network configuration information of the docker container, including: and respectively establishing an information transmission channel and an encryption transmission channel according to the IP address of the docker container, wherein the information transmission channel is used for transmitting data and control instructions between the acquisition equipment and the target master station, and the encryption transmission channel is used for transmitting data between the acquisition equipment and the docker container in an encryption communication mode.
In one embodiment, the information transmission channel comprises a data transmission channel and a control instruction transmission channel, and the data transmission channel is used for the acquisition device to report data to the target master station; and the control instruction transmission channel is used for the target master station to send a control instruction to the acquisition equipment.
In one embodiment, the encrypted transmission channel comprises a first encrypted transmission channel and a second encrypted transmission channel, and the first encrypted transmission channel is used for the acquisition device to transmit data to the docker container in an encrypted communication mode; and the second encryption transmission channel is used for transmitting data to the acquisition equipment by the docker container in an encryption communication mode.
In one embodiment, after establishing the communication connection relationship between the docker container and the acquisition device according to the network configuration information of the docker container, the method further includes: monitoring the operating state of the docker container; when the fact that the docker container has a fault is monitored, generating a new docker container according to network configuration information of the docker container; and establishing a communication connection relation between the new docker container and the acquisition equipment so that the acquisition equipment can communicate with the target master station through the new docker container.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.