Communication control method and system based on Modbus protocol

By using quantum algorithms to measure the security of the Modbus protocol, the problems of easy information theft and inability to resist attacks in Modbus protocol communication are solved, and secure communication in both traditional and quantum channels is realized.

CN120915434APending Publication Date: 2025-11-07BEIJING URBAN CONSTR INTELLIGENT CONTROL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510960186.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-11
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

The Modbus protocol lacks security, authentication, and encryption during communication, making information vulnerable to theft and unable to withstand external attacks.

Method used

A quantum algorithm is used to measure the security of the Modbus protocol. The security of the Modbus target photon sequence is detected by randomly generating a measurement basis photon sequence, and communication control is performed based on the measurement results.

Benefits of technology

It can achieve secure transmission in both traditional and quantum channels, resist malicious attacks by attackers, detect channel eavesdropping in a timely manner, and prevent message leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120915434A_ABST
    Figure CN120915434A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of communication security, and provides a communication control method and system based on a Modbus protocol, and the method comprises the steps: receiving a Modbus target photon sequence sent by a main control equipment end, and enabling the Modbus target photon sequence to be generated through the modulation of a binary sequence and a random sequence corresponding to target information to be sent; randomly generating a measurement base photon sequence for selecting a measurement base; performing safety measurement on the Modbus target photon sequence based on the measurement-based photon sequence; and performing communication control with the main control equipment end through a Modbus protocol based on the safety measurement result. Therefore, security protection is carried out on Modbus protocol communication based on the quantum algorithm, so that the Modbus protocol communication can be safely transmitted in a traditional channel and a quantum channel, malicious attacks of attackers can be resisted, whether monitoring exists in the channel or not is found, communication is terminated in time, and message leakage is prevented.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of communication security, and in particular to a communication control method and system based on a Modbus protocol. BACKGROUND

[0002] Modbus protocol is a reliable industrial electronic communication protocol, which can be used for remote control and monitoring between different types of devices, involving digital signal input, output, analog signal input, and output. In the rail transit industry, Modbus protocol has a wide range of application scenarios, and is used to provide effective communication between devices and monitoring systems. The protocol is based on message data transmission, and the device encapsulates device status information as a message to transmit to the monitoring end, and the monitoring end can obtain data information by analyzing the message.

[0003] Although Modbus protocol provides easy-to-use and powerful features, it also has security risks that can seriously damage system performance and security, including: 1. Lack of security, Modbus protocol is an open protocol, and it does not have built-in security, so it is vulnerable to attack. Hackers can use malicious software to tamper with data, or use denial-of-service attacks to disrupt the system. 2. Lack of authentication, Modbus protocol does not have built-in authentication, so there is no way to ensure that only authorized users can access the system, which means that unauthorized users can also access the system, which can lead to security vulnerabilities. 3. Lack of encryption, Modbus protocol does not have built-in encryption, so data is vulnerable to theft during transmission. This means that malicious users can steal sensitive data, which can lead to security vulnerabilities.

[0004] Cyclic redundancy check (CRC) is a commonly used check code with error detection and correction capabilities, which is widely used in early communication. In the Modbus protocol, two bytes are selected as CRC check codes to detect the content of the entire frame, so that the protocol has a certain error correction capability during information transmission. When the network is unstable and causes packet loss and bit changes, the CRC check code can provide a certain error correction effect. Using CRC check code can correct errors to a certain extent, but this method is only limited to the problem of packet loss and bit errors caused by network failure during network transmission, ensuring reliability and integrity, but it cannot resist third-party attacks. Therefore, the security of data transmission using Modbus protocol based on CRC check cannot be guaranteed.

[0005] Zeek is an open-source network security monitoring system and network traffic analysis framework designed to help network administrators and security experts monitor and analyze network traffic in real-time to discover security threats, unusual behavior, and network performance issues. Zeek uses a more flexible approach based on network traffic analysis, performing deep analysis of network traffic, extracting and aggregating various metadata, and then matching these metadata with user-defined policies to detect potential threats or unusual activities. Moreover, Zeek's rule writing is more flexible, supporting more plugins, which can be used to detect Modbus attacks. Using Zeek to monitor Modbus communication, if the number of requests per unit time exceeds the set threshold during monitoring, it is determined that there is a scanning attack in the current communication process. The Zeek detection scheme for the Modbus protocol is already mature and can well detect Modbus threats. However, in the actual case of a large number of requests, there may be false judgments. In addition, the Zeek technology is only limited to detecting whether there are possible attackers in the current network environment, and cannot prevent attackers from stealing information, and has no ability to resist external attacks. SUMMARY

[0006] The present application provides a communication control method and system based on Modbus protocol, which solves the defects that the communication using Modbus protocol in the prior art cannot prevent information from being stolen and cannot resist external attacks, and realizes the detection of the attacker's monitoring and the prevention of message leakage in the communication process.

[0007] The present application provides a communication control method based on Modbus protocol, applied to the slave device end, comprising: receiving the Modbus target photon sequence sent by the master device end, wherein the Modbus target photon sequence is generated by modulating the binary sequence corresponding to the target information to be sent and a random sequence; randomly generating a measurement base photon sequence for selecting a measurement base; performing security measurement on the Modbus target photon sequence based on the measurement base photon sequence; based on the security measurement result, performing communication control with the master device end through the Modbus protocol.

[0008] In one possible implementation, the method further comprises: determining the measurement base sequence selected by the current round of security measurement based on the measurement base photon sequence; performing security measurement on the Modbus target photon sequence based on the measurement base sequence.

[0009] In one possible implementation, the method further comprises: measure the Modbus target photon sequence based on the measurement basis sequence, to generate a measurement photon sequence; send the measurement photon sequence to the master device end; receive error bit positions confirmed and re-sent by the master device end after comparing the measurement photon sequence with the Modbus target photon sequence; re-select measurement bases for the error bit positions for next round of security measurement.

[0010] In one possible implementation, the method further includes: when each bit position is measured with a correct measurement basis, obtain a target measurement basis sequence based on the correct measurement basis corresponding to each bit position; obtain target information corresponding to the Modbus target photon sequence based on the target measurement basis sequence; when each bit position is not measured with a correct measurement basis after exceeding a preset number of rounds of security measurement, terminate the Modbus protocol to disconnect communication with the master device end.

[0011] In one possible implementation, the method further includes: when each bit position is measured with a correct measurement basis, if target information corresponding to the Modbus target photon sequence is not obtained based on the target measurement basis sequence, determine that there is a communication anomaly; when it is determined that there is a communication anomaly, terminate the Modbus protocol to disconnect communication with the master device end.

[0012] The application also provides a communication control method based on a Modbus protocol, applied to a master device end, including: send a Modbus target photon sequence to a slave device end, wherein the Modbus target photon sequence is generated by modulation of a binary sequence corresponding to target information to be sent and a random sequence; receive a measurement photon sequence sent by the slave device end; confirm error bit positions after comparing the measurement photon sequence with the Modbus target photon sequence, and send the error bit positions to the slave device end.

[0013] The application also provides a communication control system based on a Modbus protocol, including a master device end and a slave device end; The slave device end is used for receiving the Modbus target photon sequence sent by the master device end, wherein the Modbus target photon sequence is generated by the binary sequence corresponding to the target information to be sent and the random sequence modulation; the measurement basis photon sequence for selecting the measurement basis is randomly generated; the safety measurement is carried out on the Modbus target photon sequence based on the measurement basis photon sequence; and the communication control with the master device end is carried out through the Modbus protocol based on the safety measurement result. The master device end is used for sending the Modbus target photon sequence to the slave device end, wherein the Modbus target photon sequence is generated by the binary sequence corresponding to the target information to be sent and the random sequence modulation; the measurement photon sequence sent by the slave device end is received; and the error bit is confirmed and sent to the slave device end after comparing the measurement photon sequence with the Modbus target photon sequence.

[0014] The application further provides an electronic device, including a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the communication control method based on the Modbus protocol according to any one of the above when executing the computer program.

[0015] The application further provides a non-transitory computer readable storage medium, which stores a computer program, and the computer program is executable on a processor to implement the communication control method based on the Modbus protocol according to any one of the above.

[0016] The application further provides a computer program product, which includes a computer program, and the computer program is executable on a processor to implement the communication control method based on the Modbus protocol according to any one of the above.

[0017] The application provides the communication control method and system based on the Modbus protocol, which receives the Modbus target photon sequence sent by the master device end, wherein the Modbus target photon sequence is generated by the binary sequence corresponding to the target information to be sent and the random sequence modulation; the measurement basis photon sequence for selecting the measurement basis is randomly generated; the safety measurement is carried out on the Modbus target photon sequence based on the measurement basis photon sequence; and the communication control with the master device end is carried out through the Modbus protocol based on the safety measurement result. Compared with the defects that the communication using the Modbus protocol in the prior art cannot prevent information from being stolen and cannot resist external attacks, the Modbus protocol communication is safely protected based on the quantum algorithm in the present application, so that it can be safely transmitted in the traditional channel and the quantum channel, resist malicious attacks of attackers, discover whether there is eavesdropping in the channel, terminate the communication in time, and prevent message leakage. BRIEF DESCRIPTION OF DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the present application or the prior art, the drawings required to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0019] Figure 1 is one of the flowcharts of the communication control method based on the Modbus protocol provided by the present application.

[0020] Figure 2 is another flowchart of the communication control method based on the Modbus protocol provided by the present application.

[0021] Figure 3 is a third flowchart of the communication control method based on the Modbus protocol provided by the present application.

[0022] Figure 4 is a schematic diagram of the heuristic Modbus secure communication method provided by the present application.

[0023] Figure 5 is a schematic diagram of four polarization states of photons provided by the present application.

[0024] Figure 6 is a measurement base schematic diagram provided by the present application.

[0025] Figure 7 is a structural schematic diagram of the communication control system based on the Modbus protocol provided by the present application.

[0026] Figure 8 is a structural schematic diagram of the electronic device provided by the present application. DETAILED DESCRIPTION

[0027] In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described clearly and completely in the following with reference to the drawings in the present application. Obviously, the described embodiments are some embodiments of the present application, but not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0028] In order to facilitate the understanding of the embodiments of the present application, the following will be further explained and described with specific embodiments in combination with the drawings, and the embodiments do not constitute a limitation on the embodiments of the present application.

[0029] Figure 1 is one of the flowcharts of the communication control method based on the Modbus protocol provided by the present application, asFigure 1 As shown, the method includes the following: S11. Receive the Modbus target photon sequence sent by the master control device.

[0030] In this embodiment of the invention, when communicating via the Modbus protocol, the message content is in bytes. Therefore, the secure transmission process in this embodiment is described using 8 bits as an example. The communicating parties are a master device and a slave device, as follows: Figure 4 The Modbus communication interaction method is shown.

[0031] The Modbus protocol leverages quantum computing principles in communication. In quantum transmission, a superposition of states is transmitted, and the receiver needs to measure the received information. Only by selecting the correct measurement basis can the accurate transmitted content be measured. The BB84 quantum key distribution protocol encodes data using the four polarization states of photons, such as... Figure 5 As shown. Depending on the encoding method, the receiver uses two measurement bases, such as... Figure 6 As shown.

[0032] First, the device receives the Modbus target photon sequence sent by the master control device. The Modbus target photon sequence is generated by modulating the binary sequence and random sequence corresponding to the target information to be sent.

[0033] For example, the information that the main control device needs to send is Another set of sequences was randomly selected. : 01100101, based on these two sequences and the preset modulation rules, 8 photons are generated by modulation, and the state of each photon is determined according to the relationship in Table 1.

[0034] Table 1

[0035] Furthermore, the master control device sends the modulated Modbus target photon sequence to the slave device.

[0036] S12. Randomly generate a measurement basis photon sequence for selecting the measurement basis.

[0037] Since the receiver (from the device side) does not know which basis should be used for measurement, the device side generates a random sequence to select the measurement basis, which we will call the measurement basis photon sequence. :00101010, select the measurement basis according to the relationship in Table 2, and measure the particles from the device end.

[0038] Table 2

[0039] S13, performing security measurement on the Modbus target photon sequence based on the measurement base photon sequence.

[0040] The measurement base sequence selected by the slave device based on the measurement base photon sequence is determined, and then security measurement is performed on the Modbus target photon sequence based on the measurement base sequence.

[0041] Specifically, the slave device performs measurement on the Modbus target photon sequence based on the measurement base sequence to generate a measurement photon sequence, and sends the measurement photon sequence to the master device. After the master device compares the measurement photon sequence with the Modbus target photon sequence, it confirms that the error bit is retransmitted, wherein the correct measurement base is the measurement base applied to the bit position where the photons in the measurement photon sequence and the Modbus target photon sequence are the same. The correct measurement base and the corresponding bit position are recorded, and the measurement base of the error bit position where the photons in the measurement photon sequence and the Modbus target photon sequence are different is reselected for the next round of security measurement.

[0042] S14, based on the security measurement result, performing communication control with the master device through the Modbus protocol.

[0043] When each bit position is measured correctly, the target measurement base sequence is obtained based on the correct measurement base corresponding to each bit position, the target information corresponding to the Modbus target photon sequence is obtained based on the target measurement base sequence, and when the correct measurement base is not measured for each bit position after a predetermined number of security measurement rounds, the Modbus protocol is terminated to disconnect the communication with the master device.

[0044] Optionally, when each bit position is measured correctly, if the target information corresponding to the Modbus target photon sequence is not obtained based on the target measurement base sequence, it is judged that there is a communication anomaly, and when it is judged that there is a communication anomaly, the Modbus protocol is terminated to disconnect the communication with the master device.

[0045] In view of the fact that the communication using the Modbus protocol in the prior art cannot achieve security, the embodiments of the present application can detect the monitoring of the attacker in the communication process and prevent message leakage. In addition, the present method not only has good security in traditional channel communication, but also can achieve secure communication in the future scenario where quantum channels are widely used.

[0046] This invention provides a communication control method based on the Modbus protocol. The method receives a Modbus target photon sequence sent by a master control device. This Modbus target photon sequence is generated by modulating a binary sequence corresponding to the target information to be transmitted and a random sequence. A measurement basis photon sequence is randomly generated for selecting the measurement basis. A security measurement is performed on the Modbus target photon sequence based on the measurement basis photon sequence. Based on the security measurement result, communication control with the master control device is performed via the Modbus protocol. Compared to existing technologies that use the Modbus protocol for communication and cannot prevent information theft or resist external attacks, this method uses a quantum algorithm to provide security protection for Modbus protocol communication. This allows for secure transmission in both traditional and quantum channels, resists malicious attacks, detects eavesdropping in the channel, and terminates communication promptly to prevent message leakage.

[0047] Figure 2 This is the second flowchart illustrating the communication control method based on the Modbus protocol provided by this invention, as shown below. Figure 2 As shown, the method includes the following: S21. Determine the measurement base sequence selected for this round of security measurement based on the measurement base photon sequence.

[0048] S22. Measure the Modbus target photon sequence based on the measurement base sequence to generate a measurement photon sequence.

[0049] The embodiments of the present invention are combined with Figure 3 Provide a detailed explanation, such as Figure 3 As shown, the measurement base sequence selected for this round of security measurement is determined from the device side based on the measurement base photon sequence, as shown in step 3 of the figure. Then, the security measurement of the Modbus target photon sequence is performed based on the measurement base sequence, as shown in step 4 of the figure. Finally, the measurement photon sequence is generated, as shown in the Ss sequence of the figure.

[0050] S23. Send the measurement photon sequence to the main control device.

[0051] S24. After receiving the measurement photon sequence and the Modbus target photon sequence from the main control device, confirm and send the error bit.

[0052] The device notifies the master control device of its selected measurement base sequence via a classical channel. Then, the master control device compares the measurement base sequence with that of the slave device. and the Modbus target photon sequence that I have retained and informs the slave end which bit positions in the measurement bases used by the slave end are the same and which bit positions are different, and then confirms and re-sends the error bit positions of the Modbus target photon sequence to the slave end.

[0053] S25, reselecting the measurement bases for the next round of security measurement for the error bit positions.

[0054] The master end and the slave end each save the correct measurement bases, and discard the measurement results in which the measurement bases are inconsistent. Then, the slave end reselects the measurement bases and communicates with the master end to compare the photons of the error bit positions.

[0055] Further, whether there is an attack is determined according to the error rate of the selected measurement base sequence, and if there is an abnormality, the protocol is aborted. For the error bit positions, the number of error bit positions is recorded, and the above process is repeated to continue transmission, that is, the measurement bases are reselected for the next round of security measurement for the bit positions in which the photons of the measurement photon sequence and the Modbus target photon sequence are not the same.

[0056] The above is the secure communication process between the master end and the slave end using the Modbus protocol in the absence of an attacker, and the flow is as shown in Figure 3 .

[0057] S26, when each bit position has a correct measurement base, a target measurement base sequence is obtained based on the correct measurement base corresponding to each bit position.

[0058] S27, target information corresponding to the Modbus target photon sequence is obtained based on the target measurement base sequence.

[0059] When each bit position has a correct measurement base, a target measurement base sequence can be obtained based on the correct measurement base corresponding to each bit position, and then target information corresponding to the Modbus target photon sequence can be obtained according to the target measurement base sequence.

[0060] Specifically, when each bit position has a correct measurement base, that is, the measurement bases used by both sides are the same, therefore, the slave end can obtain the target information sent by the master end, that is, the correct target information. After the communication is ended, the master end and the slave end communicate again to compare the measurement bases, and in the measurement process, each bit position is compared. If the correct measurement base has been obtained, but the reception result is incorrect, it means that the target information has been changed.

[0061] For example, if there is a malicious attacker Eve, that is, Eve intercepts the transmitted photons, measures them, and then modulates the photons and sends them to the slave end. Similarly, Eve does not know which set of bases should be used for measurement, so she uses her own sequence As the measurement base selection, the result is obtained , for example 01010010. Then, Eve reconstructs the photons according to and transmits to the slave end. In this process, errors will be introduced because , and , are not completely the same in probability. Thus, by comparing the master end and the slave end in the 5th step of Figure 3 , when the correct measurement base is selected but the correct result is not obtained, the presence of the attacker Eve can be found. At the same time, since the attacker Eve does not know the correct measurement base, it cannot determine which bits of the measurement result are correct, and cannot steal effective information.

[0062] Optionally, when the correct measurement base is not measured for each bit within a preset number of security measurement rounds, it is indicated that there is a communication anomaly, and the Modbus protocol is terminated to disconnect the communication with the master device end.

[0063] Optionally, when the correct measurement base is measured for each bit, if the target information corresponding to the Modbus target photon sequence is not obtained based on the target measurement base sequence, it is judged that there is a communication anomaly; when it is judged that there is a communication anomaly, the Modbus protocol is terminated to disconnect the communication with the master device end.

[0064] In the embodiment of the application, the measurement of any attacker will certainly change the original photon state, and the legitimate communication parties can detect the disturbance to detect whether there is eavesdropping, and the attacker cannot accurately measure each quantum state intercepted, and cannot make the same photons to pretend. The embodiment of the application aims to improve the security when communicating based on the Modbus protocol, and combines with the quantum protocol, when the quantum technology is widely used in the future, this method is not only safe on the traditional channel, but also can maintain the original safety in the quantum channel, and can better resist risks. If the quantum channel safety is not considered, the communication message is encrypted by using the traditional encryption method such as the Advanced Encryption Standard (AES), the asymmetric encryption algorithm (RSA) and the like, the communication content can also be encrypted, but the listener of the eavesdropper cannot be found in time. The method based on the quantum algorithm protects the Modbus communication, so that it can be safely transmitted in the traditional channel and the quantum channel, resist the malicious attack of the attacker, and find whether there is a listener in the channel, so as to select and replace the channel or terminate the communication in time.

[0065] The following describes the communication control system based on the Modbus protocol provided by the present invention. The communication control system based on the Modbus protocol described below can be referred to in correspondence with the communication control method based on the Modbus protocol described above.

[0066] Figure 7 This is a schematic diagram of the communication control system based on the Modbus protocol provided by the present invention, specifically including: master control device 701 and slave device 702; The slave device 702 is used to receive a Modbus target photon sequence sent by the master device. The Modbus target photon sequence is generated by modulating a binary sequence corresponding to the target information to be transmitted and a random sequence. A measurement basis photon sequence is randomly generated for selecting the measurement basis. Security measurements are performed on the Modbus target photon sequence based on the measurement basis photon sequence. Based on the security measurement results, communication control with the master device is performed via the Modbus protocol. For detailed explanations, please refer to the relevant descriptions in the above method embodiments; they will not be repeated here.

[0067] The master control device 701 is used to send a Modbus target photon sequence to the slave device, wherein the Modbus target photon sequence is generated by modulating a binary sequence corresponding to the target information to be sent and a random sequence; receive a measurement photon sequence sent by the slave device; compare the measurement photon sequence and the Modbus target photon sequence to confirm and send error bits to the slave device. For detailed explanation, please refer to the relevant descriptions in the above method embodiments, which will not be repeated here.

[0068] Figure 8 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 8 As shown, the electronic device may include a processor 810, a communications interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communications interface 820, and the memory 830 communicate with each other via the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute a communication control method based on the Modbus protocol. This method includes: receiving a Modbus target photon sequence sent by a master control device, wherein the Modbus target photon sequence is generated by modulating a binary sequence corresponding to the target information to be transmitted and a random sequence; randomly generating a measurement base photon sequence for selecting a measurement base; performing a security measurement on the Modbus target photon sequence based on the measurement base photon sequence; and performing communication control with the master control device via the Modbus protocol based on the security measurement result.

[0069] Moreover, the logic instructions in the memory 830 described above can be implemented in the form of software functional units and sold or used as independent products, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for making a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0070] In another aspect, the present application also provides a computer program product, which comprises a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and the computer program is executed by a processor, so that the computer can execute the communication control method based on the Modbus protocol provided by the above-mentioned methods. The method comprises: receiving a Modbus target photon sequence sent by a master device end, wherein the Modbus target photon sequence is generated by a binary sequence corresponding to target information to be sent and a random sequence modulation; randomly generating a measurement base photon sequence for selecting a measurement base; performing security measurement on the Modbus target photon sequence based on the measurement base photon sequence; and performing communication control with the master device end through the Modbus protocol based on the security measurement result.

[0071] In another aspect, the present application also provides a non-transitory computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the communication control method based on the Modbus protocol provided by the above-mentioned methods. The method comprises: receiving a Modbus target photon sequence sent by a master device end, wherein the Modbus target photon sequence is generated by a binary sequence corresponding to target information to be sent and a random sequence modulation; randomly generating a measurement base photon sequence for selecting a measurement base; performing security measurement on the Modbus target photon sequence based on the measurement base photon sequence; and performing communication control with the master device end through the Modbus protocol based on the security measurement result.

[0072] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected to achieve the purposes of the embodiments according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0073] Through the description of the above embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software and the necessary general hardware platform, and of course can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.

[0074] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to part of the technical features; and these modifications or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A communication control method based on a Modbus protocol, applied to a slave device end, characterized in that, The method comprises the following steps: receiving a Modbus target photon sequence sent by a master device, wherein the Modbus target photon sequence is generated by modulating a binary sequence corresponding to target information to be sent and a random sequence; randomly generating a measurement basis photon sequence for selecting a measurement basis; performing security measurement on the Modbus target photon sequence based on the measurement basis photon sequence; controlling communication with the master device through a Modbus protocol based on the security measurement result.

2. The method of claim 1, wherein, The security measurement on the Modbus target photon sequence based on the measurement basis photon sequence comprises the following steps: determining a measurement basis sequence selected by the current round of security measurement based on the measurement basis photon sequence; performing security measurement on the Modbus target photon sequence based on the measurement basis sequence.

3. The method of claim 2, wherein, The security measurement on the Modbus target photon sequence based on the measurement basis sequence comprises the following steps: performing measurement on the Modbus target photon sequence based on the measurement basis sequence to generate a measurement photon sequence; sending the measurement photon sequence to the master device; receiving error bits confirmed and re-sent by the master device after comparing the measurement photon sequence with the Modbus target photon sequence; reselecting a measurement basis for the next round of security measurement based on the error bits.

4. The method of claim 3, wherein, The communication control with the master device through the Modbus protocol based on the measurement result comprises the following steps: when each bit is measured by a correct measurement basis, obtaining a target measurement basis sequence based on the correct measurement basis corresponding to each bit; obtaining target information corresponding to the Modbus target photon sequence based on the target measurement basis sequence; when more than a preset number of rounds of security measurement are performed without measuring a correct measurement basis for each bit, terminating the Modbus protocol to disconnect the communication with the master device.

5. The method of claim 4, wherein, The method further comprises the following steps: when each bit is measured by a correct measurement basis, if the target information corresponding to the Modbus target photon sequence is not obtained based on the target measurement basis sequence, it is determined that there is a communication abnormality; when it is determined that there is a communication abnormality, the Modbus protocol is terminated to disconnect the communication with the master device.

6. A communication control method based on a Modbus protocol, applied to a master device end, characterized in that, The method comprises the following steps: sending a Modbus target photon sequence to a slave device, wherein the Modbus target photon sequence is generated by modulating a binary sequence corresponding to target information to be sent and a random sequence; receiving a measurement photon sequence sent by the slave device; confirming error bits after comparing the measurement photon sequence with the Modbus target photon sequence and sending the error bits to the slave device.

7. A communication control system based on Modbus protocol, characterized by, The method comprises the following steps: a master device and a slave device; The slave device end is configured to receive a Modbus target photon sequence sent by the master device end, wherein the Modbus target photon sequence is generated by modulation of a binary sequence corresponding to target information to be sent and a random sequence; a measurement basis photon sequence for selecting a measurement basis is randomly generated; security measurement is performed on the Modbus target photon sequence based on the measurement basis photon sequence; and communication control with the master device end is performed through a Modbus protocol based on a security measurement result. The master device end is configured to send a Modbus target photon sequence to the slave device end, wherein the Modbus target photon sequence is generated by modulation of a binary sequence corresponding to target information to be sent and a random sequence; receive a measurement photon sequence sent by the slave device end; and confirm and send an error bit to the slave device end after comparing the measurement photon sequence and the Modbus target photon sequence.

8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and running on the processor, characterized in that, The processor executes the computer program to implement the communication control method based on the Modbus protocol as claimed in any one of claims 1 to 6. 9.A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the communication control method based on the Modbus protocol as claimed in any one of claims 1 to 6.

10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the communication control method based on the Modbus protocol as claimed in any one of claims 1 to 6.