Method, device, electronic equipment and storage medium for automatically selecting communication frequency band

文档序号:383365 发布日期:2021-12-10 浏览:12次 中文

阅读说明:本技术 自动选择通信频段的方法、装置、电子设备及存储介质 (Method, device, electronic equipment and storage medium for automatically selecting communication frequency band ) 是由 李红霞 于 2021-09-02 设计创作,主要内容包括:本公开涉及一种自动选择通信频段的方法、装置、电子设备及存储介质,上述方法包括:确定用于通信的固定约定频段和动态约定频段;在使用所述动态约定频段的加密通信发生故障的情况下,通过双无线通信模组实现通信自动跳频操作,以将通信频段从所述动态约定频段跳到所述固定约定频段;使用所述固定约定频段实现广播通信,其中,所述广播通信包括更新所述动态约定频段;使用更新后的所述动态约定频段实现所述加密通信。采用上述技术手段,解决现有技术中,在当前通信频段出现干扰的情况下,无法保持通信稳定和准确率的问题。(The present disclosure relates to a method, an apparatus, an electronic device and a storage medium for automatically selecting a communication frequency band, wherein the method comprises: determining a fixed appointed frequency band and a dynamic appointed frequency band for communication; under the condition that encrypted communication using the dynamically appointed frequency band fails, realizing communication automatic frequency hopping operation through a double-wireless communication module so as to hop the communication frequency band from the dynamically appointed frequency band to the fixedly appointed frequency band; implementing broadcast communication using the fixedly agreed frequency band, wherein the broadcast communication includes updating the dynamically agreed frequency band; and realizing the encrypted communication by using the updated dynamically agreed frequency band. By adopting the technical means, the problem that the communication stability and accuracy cannot be maintained under the condition that the current communication frequency band is interfered in the prior art is solved.)

1. A method for automatically selecting a communication band, comprising:

determining a fixed appointed frequency band and a dynamic appointed frequency band for communication;

under the condition that encrypted communication using the dynamically appointed frequency band fails, realizing communication automatic frequency hopping operation through a double-wireless communication module so as to hop the communication frequency band from the dynamically appointed frequency band to the fixedly appointed frequency band;

implementing broadcast communication using the fixedly agreed frequency band, wherein the broadcast communication includes updating the dynamically agreed frequency band;

and realizing the encrypted communication by using the updated dynamically agreed frequency band.

2. The method of claim 1, wherein determining the fixedly agreed frequency band and the dynamically agreed frequency band for communication comprises:

obtaining information of at least one of: communication range information, terrain information, obstacle information, and communication antenna information;

and calling a communication frequency band determination service to determine the fixed appointed frequency band and the dynamic appointed frequency band according to the electromagnetic wave propagation characteristics and the information.

3. The method of claim 1, wherein in case of failure of encrypted communication using the dynamically agreed frequency band, an automatic frequency hopping operation of communication is implemented through a dual radio communication module to hop a communication frequency band from the dynamically agreed frequency band to the fixedly agreed frequency band, and the method further comprises:

calculating the packet loss rate and the error rate of the encrypted communication, and calculating the accuracy of the encrypted communication according to the packet loss rate and the error rate;

and determining that the encrypted communication fails under the condition that the accuracy is smaller than a preset threshold.

4. The method of claim 1, wherein said updating the dynamically agreed frequency band comprises:

acquiring fault information of the encrypted communication using the dynamically appointed frequency band, wherein the fault information is a fault of the encrypted communication and communication frequency band information of a communication network where the encrypted communication is located;

determining a frequency protection band according to the fault information and the communication frequency band information;

and updating the dynamically appointed frequency band according to the frequency guard band and the communication frequency band information.

5. The method of claim 1, wherein the communicating comprises:

generating a unified address table for the communication according to a serial communication protocol, wherein the unified address table comprises: the address of the wired device, the address of the wireless device, the address of the wired device and the address of the wireless device are in a corresponding relationship, the communication is bidirectional communication, and both a receiver and a sender of the communication comprise: wired device and wireless device

And realizing the communication according to the unified address table.

6. The method of claim 1, wherein the communicating comprises:

and under the condition that the communication distance is greater than a first preset distance, realizing the communication in a multi-stage cascade mode, wherein the multi-stage cascade mode comprises the following steps:

determining a plurality of communication nodes between a receiver and a sender of the communication according to the communication distance, a second preset distance and communication node information of a communication network in which the communication is located, wherein the first preset distance is greater than the second preset distance;

and the communication is realized in a mode that the sender sends communication information, the receiver receives the communication information, and the plurality of communication nodes forward the communication information between the sender and the receiver.

7. The method of claim 1, wherein said using the updated dynamically agreed frequency band to implement the encrypted communication comprises:

performing frequency extension operation on the updated dynamic appointed frequency band through a spread spectrum function;

and realizing the encrypted communication by using the dynamically appointed frequency band after the frequency expansion operation.

8. An apparatus for automatically selecting a communication band, comprising:

the determining module is used for determining a fixed appointed frequency band and a dynamic appointed frequency band for communication;

the frequency hopping module is used for realizing automatic frequency hopping operation of communication through the double wireless communication modules under the condition that encrypted communication using the dynamically appointed frequency band fails so as to hop the communication frequency band from the dynamically appointed frequency band to the fixedly appointed frequency band;

a first communication module, configured to implement broadcast communication using the fixed agreed frequency band, where the broadcast communication includes updating the dynamically agreed frequency band;

and the second communication module is used for realizing the encrypted communication by using the updated dynamically agreed frequency band.

9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;

a memory for storing a computer program;

a processor for implementing the method of any one of claims 1 to 7 when executing a program stored on a memory.

10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of any one of claims 1 to 7.

Technical Field

The present disclosure relates to the field of internet technologies, and in particular, to a method and an apparatus for automatically selecting a communication frequency band, an electronic device, and a storage medium.

Background

The problem of multi-device interference inevitably exists in the communication process, and even after an anti-collision monitoring mode is used, the problems of frame loss and the like still possibly occur. For low-power consumption devices, the time for communication is very limited, and if the problems of frame loss and the like occur, the low-power consumption devices will increase power consumption to ensure the communication times and stability. Low power devices may cause problems with repeated occupation of the radio channel if retransmitted, and thus the communication system may enter a vicious circle. Since repeated communication causes a very large consumption of power, which reduces the lifetime of the device and the standby time of the device.

In the course of implementing the disclosed concept, the inventors found that there are at least the following technical problems in the related art: the problem that the communication stability and the accuracy can not be maintained under the condition that the interference occurs in the current communication frequency band.

Disclosure of Invention

In order to solve the above technical problem or at least partially solve the above technical problem, embodiments of the present disclosure provide a method, an apparatus, an electronic device, and a storage medium for automatically selecting a communication frequency band, so as to solve at least the problem in the prior art that stable and accurate communication cannot be maintained when interference occurs in a current communication frequency band.

The purpose of the present disclosure is realized by the following technical scheme:

in a first aspect, an embodiment of the present disclosure provides a method for automatically selecting a communication frequency band, including: determining a fixed appointed frequency band and a dynamic appointed frequency band for communication; under the condition that encrypted communication using the dynamically appointed frequency band fails, realizing communication automatic frequency hopping operation through a double-wireless communication module so as to hop the communication frequency band from the dynamically appointed frequency band to the fixedly appointed frequency band; implementing broadcast communication using the fixedly agreed frequency band, wherein the broadcast communication includes updating the dynamically agreed frequency band; and realizing the encrypted communication by using the updated dynamically agreed frequency band.

In an exemplary embodiment, the determining the fixed agreed frequency band and the dynamically agreed frequency band for communication includes: obtaining information of at least one of: communication range information, terrain information, obstacle information, and communication antenna information; and calling a communication frequency band determination service to determine the fixed appointed frequency band and the dynamic appointed frequency band according to the electromagnetic wave propagation characteristics and the information.

In an exemplary embodiment, before the communication automatic frequency hopping operation is implemented through a dual wireless communication module to hop the communication frequency band from the dynamically agreed frequency band to the fixedly agreed frequency band in case of a failure of the encrypted communication using the dynamically agreed frequency band, the method further includes: calculating the packet loss rate and the error rate of the encrypted communication, and calculating the accuracy of the encrypted communication according to the packet loss rate and the error rate; and determining that the encrypted communication fails under the condition that the accuracy is smaller than a preset threshold.

In an exemplary embodiment, the updating the dynamically agreed frequency band includes: acquiring fault information of the encrypted communication using the dynamically appointed frequency band, wherein the fault information is a fault of the encrypted communication and communication frequency band information of a communication network where the encrypted communication is located; determining a frequency protection band according to the fault information and the communication frequency band information; and updating the dynamically appointed frequency band according to the frequency guard band and the communication frequency band information.

In one exemplary embodiment, the communicating comprises: generating a unified address table for the communication according to a serial communication protocol, wherein the unified address table comprises: the address of the wired device, the address of the wireless device, the address of the wired device and the address of the wireless device are in a corresponding relationship, the communication is bidirectional communication, and both a receiver and a sender of the communication comprise: and the wired equipment and the wireless equipment realize the communication according to the unified address list.

In one exemplary embodiment, the communicating comprises: and under the condition that the communication distance is greater than a first preset distance, realizing the communication in a multi-stage cascade mode, wherein the multi-stage cascade mode comprises the following steps: determining a plurality of communication nodes between a receiver and a sender of the communication according to the communication distance, a second preset distance and communication node information of a communication network in which the communication is located, wherein the first preset distance is greater than the second preset distance; and the communication is realized in a mode that the sender sends communication information, the receiver receives the communication information, and the plurality of communication nodes forward the communication information between the sender and the receiver.

In an exemplary embodiment, the using the updated dynamically agreed frequency band to implement the encrypted communication includes: performing frequency extension operation on the updated dynamic appointed frequency band through a spread spectrum function; and realizing the encrypted communication by using the dynamically appointed frequency band after the frequency expansion operation.

In a second aspect, an embodiment of the present disclosure provides an apparatus for automatically selecting a communication frequency band, including: the determining module is used for determining a fixed appointed frequency band and a dynamic appointed frequency band for communication; the frequency hopping module is used for realizing automatic frequency hopping operation of communication through the double wireless communication modules under the condition that encrypted communication using the dynamically appointed frequency band fails so as to hop the communication frequency band from the dynamically appointed frequency band to the fixedly appointed frequency band; a first communication module, configured to implement broadcast communication using the fixed agreed frequency band, where the broadcast communication includes updating the dynamically agreed frequency band; and the second communication module is used for realizing the encrypted communication by using the updated dynamically agreed frequency band.

In a third aspect, embodiments of the present disclosure provide an electronic device. The electronic equipment comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus; a memory for storing a computer program; and a processor for implementing the method for automatically selecting a communication band or the method for image processing as described above when executing the program stored in the memory.

In a fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium. The computer-readable storage medium stores thereon a computer program that, when executed by a processor, implements the method of automatically selecting a communication band or the method of image processing as described above.

Compared with the prior art, the technical scheme provided by the embodiment of the disclosure at least has part or all of the following advantages: determining a fixed appointed frequency band and a dynamic appointed frequency band for communication; under the condition that encrypted communication using the dynamically appointed frequency band fails, realizing communication automatic frequency hopping operation through a double-wireless communication module so as to hop the communication frequency band from the dynamically appointed frequency band to the fixedly appointed frequency band; implementing broadcast communication using the fixedly agreed frequency band, wherein the broadcast communication includes updating the dynamically agreed frequency band; and realizing the encrypted communication by using the updated dynamically agreed frequency band. By adopting the technical means, the problem that the communication stability and the accuracy cannot be maintained under the condition that the current communication frequency band is interfered in the prior art is solved, so that the method for automatically hopping between the fixed appointed frequency band and the dynamic appointed frequency band and maintaining the communication stability and the accuracy is provided.

Drawings

The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.

In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the related art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.

Fig. 1 is a block diagram schematically illustrating a hardware structure of a computer terminal according to a method for automatically selecting a communication band in an embodiment of the present disclosure;

fig. 2 schematically illustrates a flow chart of a method of automatically selecting a communication band according to an embodiment of the present disclosure;

fig. 3 schematically illustrates a schematic view of the interior of a communication device of an embodiment of the present disclosure;

FIG. 4 schematically illustrates a schematic diagram of communication in a cascaded manner according to an embodiment of the disclosure;

FIG. 5 is a schematic diagram illustrating a dual band automatic frequency hopping communication method according to an embodiment of the disclosure;

FIG. 6 schematically illustrates a schematic diagram of an address mapping method of an embodiment of the present disclosure;

fig. 7 is a block diagram schematically illustrating a structure of an apparatus for automatically selecting a communication band according to an embodiment of the present disclosure;

fig. 8 schematically shows a block diagram of an electronic device provided in an embodiment of the present disclosure.

Detailed Description

The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments. It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict.

It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.

The method embodiments provided by the embodiments of the present disclosure may be executed in a computer terminal or a similar computing device. Taking an example of the method running on a computer terminal as an example, fig. 1 schematically illustrates a hardware structure block diagram of a computer terminal of the method for automatically selecting a communication frequency band according to an embodiment of the present disclosure. As shown in fig. 1, a computer terminal may include one or more processors 102 (only one is shown in fig. 1), wherein the processors 102 may include but are not limited to a processing device such as a Microprocessor (MPU) or a Programmable Logic Device (PLD) and a memory 104 for storing data, and optionally, the computer terminal may further include a transmission device 106 for communication function and an input/output device 108, it is understood by those skilled in the art that the structure shown in fig. 1 is merely illustrative and not a limitation to the structure of the computer terminal, for example, the computer terminal may further include more or less components than those shown in fig. 1, or have equivalent functions or different configurations than those shown in fig. 1.

The memory 104 may be used to store a computer program, for example, a software program and a module of an application software, such as a computer program corresponding to the method for automatically selecting a communication frequency band in the embodiment of the present disclosure, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, so as to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to a computer terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.

The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.

In an embodiment of the present disclosure, a method for automatically selecting a communication frequency band is provided, and fig. 2 schematically illustrates a flowchart of the method for automatically selecting a communication frequency band in an embodiment of the present disclosure, and as shown in fig. 2, the flowchart includes the following steps:

step S202, determining a fixed appointed frequency band and a dynamic appointed frequency band for communication;

step S204, under the condition that the encryption communication using the dynamically appointed frequency band fails, the automatic frequency hopping operation of the communication is realized through a double-wireless communication module, so that the communication frequency band is hopped from the dynamically appointed frequency band to the fixedly appointed frequency band;

step S206, implementing broadcast communication by using the fixed appointed frequency band, wherein the broadcast communication comprises updating the dynamic appointed frequency band;

and step S208, the encrypted communication is realized by using the updated dynamic appointed frequency band.

The broadcast communication includes updating the dynamically agreed frequency band, which may be understood as using the fixedly agreed frequency band to implement broadcast communication, and updating the dynamically agreed frequency band in the process of implementing broadcast communication.

By the method, the fixed appointed frequency band and the dynamic appointed frequency band for communication are determined; under the condition that encrypted communication using the dynamically appointed frequency band fails, realizing communication automatic frequency hopping operation through a double-wireless communication module so as to hop the communication frequency band from the dynamically appointed frequency band to the fixedly appointed frequency band; implementing broadcast communication using the fixedly agreed frequency band, wherein the broadcast communication includes updating the dynamically agreed frequency band; and realizing the encrypted communication by using the updated dynamically agreed frequency band. By adopting the technical means, the problem that the communication stability and the accuracy cannot be maintained under the condition that the current communication frequency band is interfered in the prior art is solved, so that the method for automatically hopping between the fixed appointed frequency band and the dynamic appointed frequency band and maintaining the communication stability and the accuracy is provided.

In an optional embodiment, after the encrypted communication is implemented using the updated dynamically agreed frequency band, the method further includes: when the encryption communication failure is realized by using the updated dynamically appointed frequency band and the number of communication failure times is more than the preset number, an anti-interference frequency band is newly added through a newly added frequency band communication module; realizing automatic frequency hopping operation of communication through a double-wireless communication module so as to hop a communication frequency band from the updated dynamically appointed frequency band to the anti-interference frequency band; and realizing the encrypted communication through the anti-interference frequency band.

Through the operation, the embodiment of the disclosure can realize the anti-interference function in communication.

In step S202, determining a fixed agreed frequency band and a dynamically agreed frequency band for communication includes: obtaining information of at least one of: communication range information, terrain information, obstacle information, and communication antenna information; and calling a communication frequency band determination service to determine the fixed appointed frequency band and the dynamic appointed frequency band according to the electromagnetic wave propagation characteristics and the information.

The communication frequency band determination service is additionally provided, and can provide a communication frequency band which is calculated appropriately according to communication range information, terrain information, obstacle information, communication antenna information and electromagnetic wave propagation characteristics, and determine the fixed appointed frequency band and the dynamic appointed frequency band according to different requirements from the calculated communication frequency band. Wherein the communication range information is a size of the communication range; the terrain information is information of terrain between two or more communication parties; the obstacle information is information of an object which may block communication between two or more communication parties, and includes a building, the penetration capacity of the building required in communication, and the like; the communication antenna information is information of an antenna installed in communication; the information may also include information about the communication device.

It should be noted that the fixed appointed frequency band is a relatively fixed wireless channel, and this frequency band is used as a broadcast frequency band. Both master and slave devices can initiate communication, and the other devices are receivers. The broadcast frequency band is mainly used for informing whether the dynamically appointed frequency band is adjusted or not, so that the communication of the dynamically appointed frequency band can be kept good. If one device's dynamically agreed frequency band cannot receive data between devices, it should immediately call in the broadcast frequency band to report that its dynamically agreed frequency band is interfered. Therefore, the host can judge whether the dynamically appointed frequency band needs to be switched or not, and if the dynamically appointed frequency band needs to be switched, the host can directly broadcast the notice in the broadcast frequency band. And all the devices switch the dynamically appointed frequency band and then communicate until all the devices can communicate in the dynamically appointed frequency band.

The fixed agreed frequency band is used to play the radio broadcast and can help the system to control the tempo as a whole. By doing so, basic communication can be effectively performed in a fixed appointed frequency band. Such as heartbeat data, broadcast data, underlying data, etc. And important encrypted data can be communicated in a dynamically appointed frequency band. The advantage of this is obvious, at the same time, because the dynamic appointed frequency band is selected by the host computer, the interference is greatly reduced. The slave machine serving as the battery equipment can monitor only in the communication windowing period, so that the power consumption of the system can be effectively reduced.

In step S204, when the encrypted communication using the dynamically agreed frequency band fails, an automatic frequency hopping operation of communication is implemented by using a dual wireless communication module, so as to jump the communication frequency band from the dynamically agreed frequency band to the fixedly agreed frequency band, and the method further includes: calculating the packet loss rate and the error rate of the encrypted communication, and calculating the accuracy of the encrypted communication according to the packet loss rate and the error rate; and determining that the encrypted communication fails under the condition that the accuracy is smaller than a preset threshold.

The methods for calculating the packet loss rate and the error rate of the encrypted communication are methods in the prior art. The Loss rate (Loss Tolerance or packet Loss rate) refers to the ratio of the number of lost packets to the number of transmitted packets in a test, and is usually tested in a throughput range. The packet loss rate is related to the packet length and the packet transmission frequency. Generally, when the flow rate of the gigabit network card is greater than 200Mbps, the packet loss rate is less than five ten-thousandths; when the flow rate of the hundred million network cards is more than 60Mbps, the packet loss rate is less than one ten thousandth. The embodiment of the disclosure can provide for testing the encrypted communication, and further obtain the packet loss rate. The error rates include: bit error rate and signal error rate, embodiments of the present disclosure may provide for cyclic redundancy check calculation error rate. Cyclic Redundancy Check (CRC) is a channel coding technique that generates a short fixed bit Check code based on data such as network data packets or computer files, and is mainly used to detect or Check errors that may occur after data transmission or storage. It uses the principle of division and remainder to detect the error.

Calculating an accuracy of said encrypted communication based on said packet loss ratio and said error ratio, wherein calculating said accuracy of said encrypted communication may be a weighted calculation based on said packet loss ratio and said error ratio; and determining that the encrypted communication fails under the condition that the accuracy is smaller than a preset threshold.

In step S206, updating the dynamically agreed frequency band includes: acquiring fault information of the encrypted communication using the dynamically appointed frequency band, wherein the fault information is a fault of the encrypted communication and communication frequency band information of a communication network where the encrypted communication is located; determining a frequency protection band according to the fault information and the communication frequency band information; and updating the dynamically appointed frequency band according to the frequency guard band and the communication frequency band information.

In order to ensure that the updated dynamically agreed frequency band does not have interference as the former dynamically agreed frequency band, the embodiment of the present disclosure considers a frequency guard band when updating the dynamically agreed frequency band. According to the embodiment of the disclosure, a frequency guard band is determined according to fault information and communication frequency band information, and the dynamically appointed frequency band is updated according to the frequency guard band and the communication frequency band information. The communication frequency band information is information of a frequency band used by a communication network in which the encrypted communication is located. That is, the updated dynamically agreed frequency band is ensured to be separated from the frequency band used by the communication network in which the encrypted communication is located by a frequency guard band. By the technical means, the problem of adjacent channel interference can be effectively avoided.

In an optional embodiment, the communicating comprises: generating a unified address table for the communication according to a serial communication protocol, wherein the unified address table comprises: the address of the wired device, the address of the wireless device, the address of the wired device and the address of the wireless device are in a corresponding relationship, the communication is bidirectional communication, and both a receiver and a sender of the communication comprise: and the wired equipment and the wireless equipment realize the communication according to the unified address list.

The communication includes: encrypted communication, which is important communication requiring extra attention to security, and broadcast communication, which is communication that is not necessarily confidential or has a low security level.

It is difficult to define whose number is in front of the next for a wireless device to communicate with a host. And the data area at the sending end can not stably point to a wireless device but can be ordered in a certain sequence if the address is not fixedly arranged. This problem occurs mainly when wireless communication is transferred to wired communication. The embodiment of the disclosure can specify the physical position of the wireless device which is finally sent to the host before sending by using the address setting on the slave. So that data does not conflict with data at any time on the host. Therefore, the problem of data confusion after wireless data is converted into wired data is solved. The address of the equipment is distributed in the wireless sending and receiving links. The wired device receives the wireless device and assigns a wireless address to an independent address space in the wired device. This allows for a good reading of the fixture. The embodiment of the disclosure is suitable for a Modbus serial communication protocol. Through the technical means, the data storage and transmission method for converting wireless into wired data can be achieved. Each wireless device can set an address when leaving a factory, and can modify the address when being used subsequently. The modified address is used as a corresponding address for converting the wireless into the MODBUS wire. The wireless data may eventually be stored on the host. The address of the wireless device may not be duplicated. Otherwise, the problem of the collision of the vehicle occurs.

Modbus is a serial communication protocol published by Modicon corporation (now Schneider Electric) in 1979 for communication using a Programmable Logic Controller (PLC). Modbus has become an industry standard (De factor) for industrial field communication protocols and is now a common connection between industrial electronic devices.

In an optional embodiment, the communicating comprises: and under the condition that the communication distance is greater than a first preset distance, realizing the communication in a multi-stage cascade mode, wherein the multi-stage cascade mode comprises the following steps: determining a plurality of communication nodes between a receiver and a sender of the communication according to the communication distance, a second preset distance and communication node information of a communication network in which the communication is located, wherein the first preset distance is greater than the second preset distance; and the communication is realized in a mode that the sender sends communication information, the receiver receives the communication information, and the plurality of communication nodes forward the communication information between the sender and the receiver.

In communication, a problem may arise in that two communication devices are too far apart. The embodiment of the disclosure uses a mode of multiple cascade transmission to forward data sent by the device through other devices. Forwarding is typically designed as a limited number of hops within three. And adding a forwarding time life in the transmitted data, and not forwarding when the life is reached. This approach mainly protects the convergence of the network. If the equipment is infinitely forwarded, the equipment may oscillate, so that the data forwarding between the two equipment is ceaselessly formed, and the communication of the broadcast frequency band is blocked. Any device cannot continue to communicate. In the embodiment of the present disclosure, through wireless concatenation, after the wireless device sends out data, other devices may also perform limited-time forwarding, except that the final host may receive the data. The purpose of forwarding is to help wireless data transmission to be farther away, so that the problems of close wireless data transmission and the like can be solved.

In step S208, the implementing the encrypted communication by using the updated dynamically agreed frequency band includes: performing frequency extension operation on the updated dynamic appointed frequency band through a spread spectrum function; and realizing the encrypted communication by using the dynamically appointed frequency band after the frequency expansion operation.

The embodiment of the present disclosure may further perform a frequency spreading operation on the updated dynamically agreed frequency band through a spreading function, where the frequency spreading operation is to enable a bandwidth of a signal used for transmitting information to be much larger than a bandwidth of the information itself. The bandwidth is widened by modulating the transmitted information by a function (spread function) independent of the transmitted information; and performing related demodulation on the spread spectrum signal by using the same spread spectrum function at a receiving end to restore transmitted information.

It should be noted that, according to the shannon formula, in order to increase the transmission rate of information, the method can be implemented in two ways, i.e., increasing the bandwidth or increasing the signal-to-noise ratio. In other words, when the transmission rate of the signal is constant, the signal bandwidth and the signal-to-noise ratio are interchangeable, i.e., increasing the signal bandwidth can reduce the requirement for the signal-to-noise ratio, and when the bandwidth is increased to a certain extent, the signal-to-noise ratio is allowed to be further reduced. By the technical means, the bandwidth of the signal used for transmitting the information is expanded, and the requirement on the signal to noise ratio is further reduced.

In order to better understand the technical solutions, the embodiments of the present disclosure also provide an alternative embodiment for explaining the technical solutions.

Fig. 3 schematically illustrates a schematic diagram of the inside of a communication device according to an embodiment of the present disclosure, as shown in fig. 3:

the communication apparatus includes: the system comprises a Micro Control Unit (MCU), a power management module, a 485 communication module, a sensor module, a human-computer interaction module, a real-time clock module, a display module, a USB communication module, a wireless networking host and a slave general block diagram. And the control of other modules is realized through the micro control unit. The sensor module is not limited to a single type of sensor. A human-computer interaction module: mainly refers to a touch screen, keys and a human body triggering device.

Fig. 4 schematically illustrates a schematic diagram of communication in a cascade manner according to an embodiment of the disclosure, as shown in fig. 4:

the wireless networking slave A comprises: LORA1 and LORA 2; the wireless networking slave B comprises: LORA1 and LORA 2; the wireless networking slave C comprises: LORA1 and LORA 2; the wireless networking host comprises: LORA1 and LORA 2. The LORA1 and LORA2 are two wireless communication modules, and RS485 and MODBUS are serial communication protocols. The communication between the wireless networking slave A and the wireless networking master machine is realized by receiving or sending communication information by the wireless networking slave A and the wireless networking master machine and realizing the forwarding between the wireless networking slave A and the wireless networking master machine through the wireless networking slave B and the wireless networking slave machine C.

Fig. 5 is a schematic diagram schematically illustrating a communication method of dual-band automatic frequency hopping according to an embodiment of the disclosure, as shown in fig. 5:

the LORA1 is a fixed frequency, that is, a fixed agreed frequency band, and implements broadcast communication, and the LORA2 is an unfixed frequency, that is, a dynamically agreed frequency band, and implements encrypted communication. All wireless communication frequency ranges include: a non-fixed frequency adjustment range and a fixed frequency.

Fig. 6 schematically illustrates a schematic diagram of an address mapping method according to an embodiment of the present disclosure, as shown in fig. 6:

MODBUS address field 1 corresponds to wireless device address 1, MODBUS address field 2 corresponds to wireless device address 2, MODBUS address field 3 corresponds to wireless device address 3, MODBUS address field 4 corresponds to wireless device address 4, and MODBUS address field n corresponds to wireless device address n.

And generating a unified address table for communication according to a serial communication protocol, wherein the unified address table comprises a corresponding relation between an MODBUS address domain and a wireless equipment address.

By the method, the fixed appointed frequency band and the dynamic appointed frequency band for communication are determined; under the condition that encrypted communication using the dynamically appointed frequency band fails, realizing communication automatic frequency hopping operation through a double-wireless communication module so as to hop the communication frequency band from the dynamically appointed frequency band to the fixedly appointed frequency band; implementing broadcast communication using the fixedly agreed frequency band, wherein the broadcast communication includes updating the dynamically agreed frequency band; and realizing the encrypted communication by using the updated dynamically agreed frequency band. By adopting the technical means, the problem that the communication stability and the accuracy cannot be maintained under the condition that the current communication frequency band is interfered in the prior art is solved, so that the method for automatically hopping between the fixed appointed frequency band and the dynamic appointed frequency band and maintaining the communication stability and the accuracy is provided.

Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present disclosure may be embodied in the form of a software product, where the computer software product is stored in a storage medium (such as a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, and an optical disk), and includes several instructions for enabling a terminal device (which may be a mobile phone, a computer, a server, or a network device) to execute the methods of the embodiments of the present disclosure.

In this embodiment, an apparatus for automatically selecting a communication frequency band is further provided, and the apparatus for automatically selecting a communication frequency band is used to implement the foregoing embodiments and preferred embodiments, which have already been described and are not described again. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.

Fig. 7 is a block diagram schematically illustrating a structure of an apparatus for automatically selecting a communication band according to an alternative embodiment of the disclosure, and as shown in fig. 7, the apparatus includes:

a determining module 702, configured to determine a fixed agreed frequency band and a dynamic agreed frequency band for communication;

a frequency hopping module 704, configured to implement automatic frequency hopping operation for communication through a dual wireless communication module when encrypted communication using the dynamically agreed frequency band fails, so as to hop the communication frequency band from the dynamically agreed frequency band to the fixedly agreed frequency band;

a first communication module 706, configured to implement broadcast communication using the fixedly agreed frequency band, where the broadcast communication includes updating the dynamically agreed frequency band;

a second communication module 708, configured to implement the encrypted communication using the updated dynamically agreed frequency band.

By the method, the fixed appointed frequency band and the dynamic appointed frequency band for communication are determined; under the condition that encrypted communication using the dynamically appointed frequency band fails, realizing communication automatic frequency hopping operation through a double-wireless communication module so as to hop the communication frequency band from the dynamically appointed frequency band to the fixedly appointed frequency band; implementing broadcast communication using the fixedly agreed frequency band, wherein the broadcast communication includes updating the dynamically agreed frequency band; and realizing the encrypted communication by using the updated dynamically agreed frequency band. By adopting the technical means, the problem that the communication stability and the accuracy cannot be maintained under the condition that the current communication frequency band is interfered in the prior art is solved, so that the method for automatically hopping between the fixed appointed frequency band and the dynamic appointed frequency band and maintaining the communication stability and the accuracy is provided.

Optionally, the determining module 702 is further configured to obtain information of at least one of: communication range information, terrain information, obstacle information, and communication antenna information; and calling a communication frequency band determination service to determine the fixed appointed frequency band and the dynamic appointed frequency band according to the electromagnetic wave propagation characteristics and the information.

The communication frequency band determination service is additionally provided, and can provide a communication frequency band which is calculated appropriately according to communication range information, terrain information, obstacle information, communication antenna information and electromagnetic wave propagation characteristics, and determine the fixed appointed frequency band and the dynamic appointed frequency band according to different requirements from the calculated communication frequency band. Wherein the communication range information is a size of the communication range; the terrain information is information of terrain between two or more communication parties; the obstacle information is information of an object which may block communication between two or more communication parties, and includes a building, the penetration capacity of the building required in communication, and the like; the communication antenna information is information of an antenna installed in communication; the information may also include information about the communication device.

It should be noted that the fixed appointed frequency band is a relatively fixed wireless channel, and this frequency band is used as a broadcast frequency band. Both master and slave devices can initiate communication, and the other devices are receivers. The broadcast frequency band is mainly used for informing whether the dynamically appointed frequency band is adjusted or not, so that the communication of the dynamically appointed frequency band can be kept good. If one device's dynamically agreed frequency band cannot receive data between devices, it should immediately call in the broadcast frequency band to report that its dynamically agreed frequency band is interfered. Therefore, the host can judge whether the dynamically appointed frequency band needs to be switched or not, and if the dynamically appointed frequency band needs to be switched, the host can directly broadcast the notice in the broadcast frequency band. And all the devices switch the dynamically appointed frequency band and then communicate until all the devices can communicate in the dynamically appointed frequency band.

The fixed agreed frequency band is used to play the radio broadcast and can help the system to control the tempo as a whole. By doing so, basic communication can be effectively performed in a fixed appointed frequency band. Such as heartbeat data, broadcast data, underlying data, etc. And important encrypted data can be communicated in a dynamically appointed frequency band. The advantage of this is obvious, at the same time, because the dynamic appointed frequency band is selected by the host computer, the interference is greatly reduced. The slave machine serving as the battery equipment can monitor only in the communication windowing period, so that the power consumption of the system can be effectively reduced.

Optionally, the frequency hopping module 704 is further configured to calculate a packet loss rate and an error rate of the encrypted communication, and calculate an accuracy of the encrypted communication according to the packet loss rate and the error rate; and determining that the encrypted communication fails under the condition that the accuracy is smaller than a preset threshold.

The methods for calculating the packet loss rate and the error rate of the encrypted communication are methods in the prior art. The Loss rate (Loss Tolerance or packet Loss rate) refers to the ratio of the number of lost packets to the number of transmitted packets in a test, and is usually tested in a throughput range. The packet loss rate is related to the packet length and the packet transmission frequency. Generally, when the flow rate of the gigabit network card is greater than 200Mbps, the packet loss rate is less than five ten-thousandths; when the flow rate of the hundred million network cards is more than 60Mbps, the packet loss rate is less than one ten thousandth. The embodiment of the disclosure can provide for testing the encrypted communication, and further obtain the packet loss rate. The error rates include: bit error rate and signal error rate, embodiments of the present disclosure may provide for cyclic redundancy check calculation error rate. Cyclic Redundancy Check (CRC) is a channel coding technique that generates a short fixed bit Check code based on data such as network data packets or computer files, and is mainly used to detect or Check errors that may occur after data transmission or storage. It uses the principle of division and remainder to detect the error.

Calculating an accuracy of said encrypted communication based on said packet loss ratio and said error ratio, wherein calculating said accuracy of said encrypted communication may be a weighted calculation based on said packet loss ratio and said error ratio; and determining that the encrypted communication fails under the condition that the accuracy is smaller than a preset threshold.

Optionally, the first communication module 706 is further configured to obtain fault information that the encrypted communication using the dynamically agreed frequency band fails and communication frequency band information of a communication network in which the encrypted communication is located; determining a frequency protection band according to the fault information and the communication frequency band information; and updating the dynamically appointed frequency band according to the frequency guard band and the communication frequency band information.

In order to ensure that the updated dynamically agreed frequency band does not have interference as the former dynamically agreed frequency band, the embodiment of the present disclosure considers a frequency guard band when updating the dynamically agreed frequency band. According to the embodiment of the disclosure, a frequency guard band is determined according to fault information and communication frequency band information, and the dynamically appointed frequency band is updated according to the frequency guard band and the communication frequency band information. The communication frequency band information is information of a frequency band used by a communication network in which the encrypted communication is located. That is, the updated dynamically agreed frequency band is ensured to be separated from the frequency band used by the communication network in which the encrypted communication is located by a frequency guard band. By the technical means, the problem of adjacent channel interference can be effectively avoided.

Optionally, the first communication module 706 and/or the second communication module 708 are further configured to generate a unified address table for the communication according to a serial communication protocol, where the unified address table includes: the address of the wired device, the address of the wireless device, the address of the wired device and the address of the wireless device are in a corresponding relationship, the communication is bidirectional communication, and both a receiver and a sender of the communication comprise: and the wired equipment and the wireless equipment realize the communication according to the unified address list.

The communication includes: encrypted communication, which is important communication requiring extra attention to security, and broadcast communication, which is communication that is not necessarily confidential or has a low security level.

It is difficult to define whose number is in front of the next for a wireless device to communicate with a host. And the data area at the sending end can not stably point to a wireless device but can be ordered in a certain sequence if the address is not fixedly arranged. This problem occurs mainly when wireless communication is transferred to wired communication. The embodiment of the disclosure can specify the physical position of the wireless device which is finally sent to the host before sending by using the address setting on the slave. So that data does not conflict with data at any time on the host. Therefore, the problem of data confusion after wireless data is converted into wired data is solved. The address of the equipment is distributed in the wireless sending and receiving links. The wired device receives the wireless device and assigns a wireless address to an independent address space in the wired device. This allows for a good reading of the fixture. The embodiment of the disclosure is suitable for a Modbus serial communication protocol. Through the technical means, the data storage and transmission method for converting wireless into wired data can be achieved. Each wireless device can set an address when leaving a factory, and can modify the address when being used subsequently. The modified address is used as a corresponding address for converting the wireless into the MODBUS wire. The wireless data may eventually be stored on the host. The address of the wireless device may not be duplicated. Otherwise, the problem of the collision of the vehicle occurs.

Modbus is a serial communication protocol published by Modicon corporation (now Schneider Electric) in 1979 for communication using a Programmable Logic Controller (PLC). Modbus has become an industry standard (De factor) for industrial field communication protocols and is now a common connection between industrial electronic devices.

Optionally, the first communication module 706 and/or the second communication module 708 are further configured to, when the communication distance is greater than a first preset distance, implement the communication in a multi-stage cascade manner, where the multi-stage cascade manner includes: determining a plurality of communication nodes between a receiver and a sender of the communication according to the communication distance, a second preset distance and communication node information of a communication network in which the communication is located, wherein the first preset distance is greater than the second preset distance; and the communication is realized in a mode that the sender sends communication information, the receiver receives the communication information, and the plurality of communication nodes forward the communication information between the sender and the receiver.

In communication, a problem may arise in that two communication devices are too far apart. The embodiment of the disclosure uses a mode of multiple cascade transmission to forward data sent by the device through other devices. Forwarding is typically designed as a limited number of hops within three. And adding a forwarding time life in the transmitted data, and not forwarding when the life is reached. This approach mainly protects the convergence of the network. If the equipment is infinitely forwarded, the equipment may oscillate, so that the data forwarding between the two equipment is ceaselessly formed, and the communication of the broadcast frequency band is blocked. Any device cannot continue to communicate. In the embodiment of the present disclosure, through wireless concatenation, after the wireless device sends out data, other devices may also perform limited-time forwarding, except that the final host may receive the data. The purpose of forwarding is to help wireless data transmission to be farther away, so that the problems of close wireless data transmission and the like can be solved.

Optionally, the second communication module 708 is further configured to perform a frequency spreading operation on the updated dynamically agreed frequency band through a spreading function; and realizing the encrypted communication by using the dynamically appointed frequency band after the frequency expansion operation.

The embodiment of the present disclosure may further perform a frequency spreading operation on the updated dynamically agreed frequency band through a spreading function, where the frequency spreading operation is to enable a bandwidth of a signal used for transmitting information to be much larger than a bandwidth of the information itself. The bandwidth is widened by modulating the transmitted information by a function (spread function) independent of the transmitted information; and performing related demodulation on the spread spectrum signal by using the same spread spectrum function at a receiving end to restore transmitted information.

It should be noted that, according to the shannon formula, in order to increase the transmission rate of information, the method can be implemented in two ways, i.e., increasing the bandwidth or increasing the signal-to-noise ratio. In other words, when the transmission rate of the signal is constant, the signal bandwidth and the signal-to-noise ratio are interchangeable, i.e., increasing the signal bandwidth can reduce the requirement for the signal-to-noise ratio, and when the bandwidth is increased to a certain extent, the signal-to-noise ratio is allowed to be further reduced. By the technical means, the bandwidth of the signal used for transmitting the information is expanded, and the requirement on the signal to noise ratio is further reduced.

It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.

Embodiments of the present disclosure provide an electronic device.

Fig. 8 schematically shows a block diagram of an electronic device provided in an embodiment of the present disclosure.

Referring to fig. 8, an electronic device 800 provided in the embodiment of the present disclosure includes a processor 801, a communication interface 802, a memory 803, and a communication bus 804, where the processor 801, the communication interface 802, and the memory 803 complete communication with each other through the communication bus 804; a memory 803 for storing a computer program; the processor 801 is configured to implement the steps of any of the above method embodiments when executing the program stored in the memory.

Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the input/output device is connected to the processor.

Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:

s1, determining a fixed appointed frequency band and a dynamic appointed frequency band for communication;

s2, under the condition that the encrypted communication using the dynamically appointed frequency band fails, the automatic frequency hopping operation of communication is realized through a double-wireless communication module, so that the communication frequency band is hopped from the dynamically appointed frequency band to the fixedly appointed frequency band;

s3, implementing broadcast communication by using the fixed appointed frequency band, wherein the broadcast communication comprises updating the dynamic appointed frequency band;

and S4, the encrypted communication is realized by using the updated dynamic agreed frequency band.

Embodiments of the present disclosure also provide a computer-readable storage medium. The computer-readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps of any of the method embodiments described above.

Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:

s1, determining a fixed appointed frequency band and a dynamic appointed frequency band for communication;

s2, under the condition that the encrypted communication using the dynamically appointed frequency band fails, the automatic frequency hopping operation of communication is realized through a double-wireless communication module, so that the communication frequency band is hopped from the dynamically appointed frequency band to the fixedly appointed frequency band;

s3, implementing broadcast communication by using the fixed appointed frequency band, wherein the broadcast communication comprises updating the dynamic appointed frequency band;

and S4, the encrypted communication is realized by using the updated dynamic agreed frequency band.

The computer-readable storage medium may be contained in the apparatus/device described in the above embodiments; or may be present alone without being assembled into the device/apparatus. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.

According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.

Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.

It will be apparent to those skilled in the art that the modules or steps of the present disclosure described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. As such, the present disclosure is not limited to any specific combination of hardware and software.

The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure, and various modifications and changes may be made to the present disclosure by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the principle of the present disclosure should be included in the protection scope of the present disclosure.

20页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于二阶广义积分器的数据采集噪声自适应方法及设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!