CN117222050A - Communication method, communication device, electronic equipment and storage medium - Google Patents

Communication method, communication device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117222050A
CN117222050A CN202311110404.1A CN202311110404A CN117222050A CN 117222050 A CN117222050 A CN 117222050A CN 202311110404 A CN202311110404 A CN 202311110404A CN 117222050 A CN117222050 A CN 117222050A
Authority
CN
China
Prior art keywords
communication
slave devices
slave
master device
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311110404.1A
Other languages
Chinese (zh)
Inventor
郭兴勇
戴若黎
刘午达
刘昊扬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BEIJING NOITOM TECHNOLOGY Ltd
Original Assignee
BEIJING NOITOM TECHNOLOGY Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BEIJING NOITOM TECHNOLOGY Ltd filed Critical BEIJING NOITOM TECHNOLOGY Ltd
Priority to CN202311110404.1A priority Critical patent/CN117222050A/en
Publication of CN117222050A publication Critical patent/CN117222050A/en
Pending legal-status Critical Current

Links

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The present disclosure relates to a communication method, apparatus, electronic device, and storage medium, the method including: the method comprises the steps that a master device establishes connection with a plurality of slave devices, allocates the same data access address for the plurality of slave devices, and allocates a device serial number identifier for each slave device in the plurality of slave devices; the master device communicates with the plurality of slave devices based on a preset communication protocol and the data access address. Compared with the prior art, the method and the device have the advantages that the same data access address is allocated to the plurality of slave devices, different slave devices are not distinguished by using the data access address, but the plurality of slave devices of different sets are distinguished by using the data access address, and further communication with the plurality of slave devices can be achieved simultaneously by the preset communication protocol based on the preset communication protocol and the communication between the data access address and the plurality of slave devices, so that the synchronization performance is improved, power consumption generated in the communication process can be reduced, and the communication efficiency is improved.

Description

Communication method, communication device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of wireless communication, and in particular relates to a communication method, a device, electronic equipment and a storage medium.
Background
In the field of short-range wireless communication, there have been many excellent communication protocols such as classical Bluetooth (Bluetooth), bluetooth Low Energy (BLE), wifi, lora, thread, zigbee, and various mesh protocols.
Classical Bluetooth can achieve transmission of one master and multiple slaves, but is limited by a protocol, and one host cannot be connected with more than 7 slaves; although the Bluetooth low power consumption supports the linking of hundreds of devices and a host on a slave protocol, when the BLE works in a state of one master and multiple slaves, each master and each slave are independently linked, the slaves are not synchronous, the synchronous performance is poor, the slaves cannot share link control data and cannot communicate at the same time, and a large part of bandwidth is not used for transmitting useful data when the BLE works in the state of one master and multiple slaves, so that the communication efficiency is low; wiFi can transmit data in one master and multiple slaves, but the WiFi protocol itself consumes much more power than classical bluetooth and bluetooth low energy; while Lora, thread, zigbee supports one master-to-many slave communication, the manner in which it supports one master-to-many slave is essentially polling all slaves, so communication efficiency is not high. Although the existing protocol is excellent in power consumption, speed and usability, the existing communication protocol has the problems of high power consumption and low communication efficiency of synchronous transmission when a master device communicates with multiple slave devices.
When the prior communication protocol is adopted to carry out multi-device communication of one master and multiple slaves, because different slaves are distributed with different addresses, when the master needs to communicate with a certain number of slaves, data needs to be sent to the addresses corresponding to the slaves respectively, the slaves reply to the master respectively after receiving the data, the slaves need to communicate respectively, and the power consumption generated in the communication process is larger, the synchronization performance is poorer, the communication cannot be carried out simultaneously, and the communication efficiency is lower.
Disclosure of Invention
In order to solve the technical problems described above, or at least partially solve the technical problems described above, the present disclosure provides a communication method, apparatus, electronic device, and storage medium.
In a first aspect, embodiments of the present disclosure provide a communication method, the method including:
the method comprises the steps that a master device establishes connection with a plurality of slave devices, allocates the same data access address for the plurality of slave devices, and allocates a device serial number identifier for each slave device in the plurality of slave devices;
the master device communicates with the plurality of slave devices based on a preset communication protocol and the data access address.
In some embodiments, the preset communication protocol includes at least one of:
physical layer, link layer, data channel access protocol, controller control protocol, attribute data service, network service.
In some embodiments, the physical layer uses 2.4G SIM frequency band communication, modulation mode modulation using gaussian frequency shift keying, frequency offset using a preset frequency offset value, and modulation rate using a preset modulation rate value;
the link layer is used for defining a communication mode and a message structure between the master device and the plurality of slave devices, wherein the message structure comprises a preamble, a data access address, a length, header data and effective communication data.
In some embodiments, the header data includes a sequence number, a sequence number used by a next frame, and a mask;
the mask is used for representing target slave devices to be communicated in a plurality of slave devices, the bit number of the mask is the same as the number of the slave devices, and each bit in the mask corresponds to one device serial number identifier; the sequence number and the sequence number used by the next frame are used to characterize whether the current communication data is received by the target device.
In some embodiments, the master device establishes a connection with a plurality of slave devices, including:
the master device sends a connection request to a plurality of slave devices; each slave device of the plurality of slave devices is configured to receive the connection request sent by the master device, and connect with the master device based on the connection request.
In some embodiments, the master device communicates with the plurality of slave devices based on a preset communication protocol and the data access address, comprising:
the master device determines the data access address of the current communication data and determines a plurality of slave devices according to the data access address;
the master device generates a communication message of current communication data;
the master device determines target slave devices to be communicated from the plurality of slave devices based on masks in header data in the communication message and the preset communication protocol;
the master device sends a communication message to the target slave device in a connection time slot, wherein the type of the communication message comprises a data request message, a state request message and a control message; the target slave device is used for processing the communication message sent by the master device in the connection waiting time slot and sending a response message to the master device in the response time slot.
In some embodiments, after the master device determines a plurality of slave devices from the data access address, the method further comprises:
the master device sends a synchronization message to each slave device in the plurality of slave devices in a synchronization time slot; and each slave device is used for carrying out clock synchronization in a synchronization waiting time slot based on the synchronization message sent by the master device.
In a second aspect, embodiments of the present disclosure provide a communication apparatus, including:
the connection module is used for establishing connection between the master equipment and the plurality of slave equipment, distributing the same data access address for the plurality of slave equipment and distributing an equipment serial number identifier for each slave equipment in the plurality of slave equipment;
and the communication module is used for the master equipment to communicate with the plurality of slave equipment based on a preset communication protocol and the data access address.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method according to the first aspect.
In a fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium having stored thereon a computer program for execution by a processor to implement the method of the first aspect.
In a fifth aspect, embodiments of the present disclosure also provide a computer program product comprising a computer program or instructions which, when executed by a processor, implement a method as described in the first aspect.
According to the communication method, the device, the electronic equipment and the storage medium, connection is established between the master equipment and the plurality of slave equipment, the same data access address is allocated to the plurality of slave equipment, an equipment serial number identifier is allocated to each slave equipment in the plurality of slave equipment, and the master equipment communicates with the plurality of slave equipment based on a preset communication protocol and the data access address. Compared with the prior art, the method and the device have the advantages that the same data access address is allocated to the plurality of slave devices, different slave devices are not distinguished by using the data access address, but the plurality of slave devices of different sets are distinguished by using the data access address, and further communication with the plurality of slave devices can be achieved simultaneously by the preset communication protocol based on the preset communication protocol and the communication between the data access address and the plurality of slave devices, so that the synchronization performance is improved, power consumption generated in the communication process can be reduced, and the communication efficiency is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the 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 solutions in the prior art, the drawings that are required for the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flow chart of a communication method provided by an embodiment of the present disclosure;
FIG. 2 is a flow chart of a communication method provided by another embodiment of the present disclosure;
fig. 3 is a schematic diagram of a message structure provided in an embodiment of the disclosure;
fig. 4 is a schematic diagram of the structure of header data provided in an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a time slice provided in an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a communication device according to an embodiment of the disclosure;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, a further description of aspects of the present disclosure will be provided below. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced otherwise than as described herein; it will be apparent that the embodiments in the specification are only some, but not all, embodiments of the disclosure.
In the field of short-range wireless communication, there have been many excellent communication protocols such as classical Bluetooth (Bluetooth), bluetooth Low Energy (BLE), wifi, lora, thread, zigbee, and various mesh protocols.
Classical Bluetooth can achieve transmission of one master and multiple slaves, but is limited by a protocol, and one host cannot be connected with more than 7 slaves; although the Bluetooth low power consumption supports the linking of hundreds of devices and a host on a slave protocol, when the BLE works in a state of one master and multiple slaves, each master and each slave are independently linked, the slaves are not synchronous, the synchronous performance is poor, the slaves cannot share link control data and cannot communicate at the same time, and a large part of bandwidth is not used for transmitting useful data when the BLE works in the state of one master and multiple slaves, so that the communication efficiency is low; wiFi can transmit data in one master and multiple slaves, but the WiFi protocol itself consumes much more power than classical bluetooth and bluetooth low energy; while Lora, thread, zigbee supports one master-to-many slave communication, the manner in which it supports one master-to-many slave is essentially polling all slaves, so communication efficiency is not high. Although the existing protocol is excellent in power consumption, speed and usability, the existing communication protocol has the problems of high power consumption and low communication efficiency of synchronous transmission when a master device communicates with multiple slave devices.
When the prior communication protocol is adopted to carry out multi-device communication of one master and multiple slaves, because different slaves are distributed with different addresses, when the master needs to communicate with a certain number of slaves, data needs to be sent to the addresses corresponding to the slaves respectively, the slaves reply to the master respectively after receiving the data, the slaves need to communicate respectively, and the power consumption generated in the communication process is larger, the synchronization performance is poorer, the communication cannot be carried out simultaneously, and the communication efficiency is lower. In view of this problem, embodiments of the present disclosure provide a communication method, which is described below in connection with specific embodiments.
Fig. 1 is a flowchart of a communication method provided by an embodiment of the present disclosure, where an execution body of the method is a master device. The main equipment can be portable mobile equipment such as smart phones, tablet computers, notebook computers, vehicle navigation equipment, intelligent sports equipment and the like; the system can also be a fixed device such as a personal computer, an intelligent household appliance, a server and the like, wherein the server can be a single server, can be a server cluster, and can be a distributed cluster or a centralized cluster. The method can be applied to a scene that the master device communicates with a plurality of slave devices at the same time, and can also be applied to a scene that the master device communicates with a target slave device in the plurality of slave devices. It can be appreciated that the communication method provided by the embodiment of the present disclosure may also be applied in other scenarios. As shown in fig. 1, the method comprises the following steps:
S101, the master device establishes connection with a plurality of slave devices, allocates the same data access address for the plurality of slave devices, and allocates a device serial number identifier for each slave device in the plurality of slave devices.
In this step, the master device establishes connection with the plurality of slave devices, and the master device allocates the same data access address to the plurality of slave devices, so that the master device and the plurality of slave devices can communicate simultaneously based on the data access address. The master device distributes a device serial number identifier for each slave device in the plurality of slave devices, and the device serial number identifier is used for distinguishing different slave devices, so that the subsequent master device can conveniently communicate with some slave devices in the plurality of slave devices at the same time, and the flexibility of communication between the master device and the slave devices is improved. For example, 32 slaves, i.e., the device serial number identification assigned to each slave is 1, 2, 3, 32, respectively.
In some embodiments, the master device establishes a connection with a plurality of slave devices, including: the master device sends a connection request to a plurality of slave devices; each slave device of the plurality of slave devices is configured to receive the connection request sent by the master device, and connect with the master device based on the connection request.
Specifically, the master device may send connection requests to the plurality of slave devices, the slave devices receive the connection requests sent by the master device, and based on the connection requests, the master device and the plurality of slave devices can communicate after connection.
S102, the master device communicates with the plurality of slave devices based on a preset communication protocol and the data access address.
In this step, the master device determines a plurality of slave devices according to the data access addresses in the current communication data, and further communicates with the plurality of slave devices according to a preset communication protocol. The communication may include: the master device and the slave device perform clock synchronization; the method comprises the steps that a master device sends data to a slave device, and the slave device receives the data; the master device sends a control request to the slave device, and the slave device feeds back a control result to the master device; the master device sends a data request to the slave device, the slave device returns data to the master device, etc.
Optionally, the preset communication protocol at least includes one of the following: physical layer, link layer, data channel access protocol, controller control protocol, attribute data service, network service.
For example, the preset communication protocol includes a physical layer, a link layer, a data channel access protocol, a controller control protocol, an attribute data service, a network service, and may further include other contents, which are not limited herein.
Optionally, rules such as radio frequency transceiving, frequency setting, RSSI reading, CRC initialization, address setting, data whitening and the like are defined in the physical layer. Rules for transmitting broadcast, scanning broadcast, initiating connection, responding to connection, frequency hopping, etc. are defined in the link layer. Rules such as channel creation, data transmission and reception, receipt encryption and the like are defined in the data channel access protocol. Rules for network creation, device management, device switching, etc. are defined in the controller control protocol. Rules such as read, write, notify, etc. are defined in the attribute data service. Networking, as well as other network rules, are defined in the network service.
In some embodiments, the physical layer uses 2.4G SIM frequency band communication, modulation mode modulation using gaussian frequency shift keying, frequency offset using a preset frequency offset value, and modulation rate using a preset modulation rate value; the frequency range used is 2402-2480MHz, one wireless channel (data channel) is 2MHz, 40 wireless channels are all used, and the center frequency of the kth channel is Fc k =2402+2(k-1)MHz,k=1,2,3,...,40。
It should be noted that the preset frequency offset value may be 180KHz, may be set by itself, or may be other frequency offset values set by the user, which is not limited herein. The preset modulation rate value may be 1Mbps or 2Mbps, may select different rates based on the data amount and the distance, may be set by itself, and may be other modulation rate values set by the user, which is not limited herein.
The link layer is used for defining a communication mode and a message structure between the master device and the plurality of slave devices, wherein the message structure comprises a preamble, a data access address, a length, header data and effective communication data.
The link layer in the preset communication protocol is used for defining the communication mode and the message structure between the master device and the plurality of slave devices, and as shown in fig. 3, the message structure is composed of a preamble, a data access address, a length, header data, effective data of communication and a CRC 32.
Preamble code: two byte 0/1 alternating bit stream for the receiver to calibrate the clock and amplification of the receiver.
Data access address: the address of 4 bytes is general, and addresses of other byte lengths such as 2 bytes and 3 bytes can be used, and the byte length can be determined based on the device amount and the data length, which is not limited herein. The same set of equipment uses a set of data access addresses, different sets of equipment uses different access addresses, and a receiving end judges whether to receive subsequent data according to the data access addresses.
Length: one byte of length data representing the total number of bytes of subsequent header data and valid data for communication.
Header data: the byte length of the header data can be adjusted for describing the type of the message, network state synchronization and the like, for example, the header data can be 40 bits, can be other lengths, and is not limited.
Effective data of communication: the byte length of the valid data transmitted is determined by the length of the actual data.
CRC32: the CRC32 is used to check the validity of the entire packet.
While CRC32 is illustrated as an example, it is to be understood that CRC24 or other types may be used to check the validity of the entire packet, without limitation.
Optionally, the header data includes a sequence number, a sequence number used by a next frame, and a mask; the mask is used for representing target slave devices to be communicated in a plurality of slave devices, the bit number of the mask is the same as the number of the slave devices, and each bit in the mask corresponds to one device serial number identifier; the sequence number and the sequence number used by the next frame are used to characterize whether the current communication data is received by the target device.
As shown in fig. 4, the header data includes a link layer identifier, more data (MoreData, MD), a sequence number used for the next frame, a mask, and a neighbor advertisement message (NeighborAdivertisment, NA). The mask is used for representing target slave devices to be communicated in a plurality of slave devices, the bit number of the mask is the same as the number of the slave devices, and each bit in the mask corresponds to one device serial number identifier; the MD bit is used to indicate whether all slaves can end up with the return data, the sequence number and the sequence number used by the next frame are used to characterize whether the current communication data is received by the target device.
Since each slave device is assigned a continuous, fixed device serial number identifier starting from 1, the master device sends data to different addresses according to the type of the current data during communication, if it is required to specify which slave device the current data is sent to, the mask field in the header is used, the device that needs to receive and respond to is used, and the mask corresponding to the device serial number identifier is set to 1, otherwise, 0.
For example, there are eight slaves, the eight slaves assigned device number identifiers being 1, 2, 3, 4, 5, 6, 7, 8, respectively, the number of bits of the mask being 8, the first bit value corresponding to the communication state of the slave device of device number 1, the second bit value corresponding to the communication state of the slave device of device number 2, the third bit value corresponding to the communication state of the slave device of device number 3, the fourth bit value corresponding to the communication state of the slave device of device number 4, the fifth bit value corresponding to the communication state of the slave device of device number 5, the sixth bit value corresponding to the communication state of the slave device of device number 6, the seventh bit value corresponding to the communication state of the slave device of device number 7, and the eighth bit value corresponding to the communication state of the slave device of device number 8. Optionally, the bit has a value of 1, which indicates that the corresponding slave device needs to communicate; the value of the bit is 0, indicating that the corresponding slave device does not need to communicate.
In some embodiments, the preset communication protocol adopts a connection event driven frequency hopping mode, so that the clock precision requirement on equipment is greatly reduced, and the influence of burst interference in the 2.4G frequency band on communication can be avoided by adopting adaptive frequency hopping.
According to the embodiment of the disclosure, connection is established between the master device and the plurality of slave devices, the same data access address is allocated to the plurality of slave devices, a device serial number identifier is allocated to each slave device in the plurality of slave devices, and the master device communicates with the plurality of slave devices based on a preset communication protocol and the data access address. Compared with the prior art, the method and the device have the advantages that the same data access address is allocated to the plurality of slave devices, different slave devices are not distinguished by using the data access address, but the plurality of slave devices of different sets are distinguished by using the data access address, and further communication with the plurality of slave devices can be achieved simultaneously by the preset communication protocol based on the preset communication protocol and the communication between the data access address and the plurality of slave devices, so that the synchronization performance is improved, power consumption generated in the communication process can be reduced, and the communication efficiency is improved.
Fig. 2 is a flowchart of a communication method according to another embodiment of the disclosure, as shown in fig. 2, the method includes the following steps:
S201, the master device establishes connection with a plurality of slave devices, allocates the same data access address for the plurality of slave devices, and allocates a device serial number identifier for each slave device in the plurality of slave devices.
Specifically, the implementation process and principle of S201 and S101 are consistent, and will not be described herein.
S202, the master device determines the data access address of the current communication data, and determines a plurality of slave devices according to the data access address.
Specifically, the master device determines a data access address from the current communication data, and further determines a plurality of slave devices according to the data access address.
Each time the master device and the slave device communicate with each other in one time slot, fig. 5 is a schematic diagram of the time slots according to the embodiment of the disclosure, and as shown in fig. 5, one time slot includes a synchronization time slot, a synchronization waiting time slot, a connection waiting time slot,
S203, the master device sends a synchronous message to each slave device in the plurality of slave devices in a synchronous time slot; and each slave device is used for carrying out clock synchronization in a synchronization waiting time slot based on the synchronization message sent by the master device.
As shown in fig. 5, the master device transmits a synchronization message to each of the plurality of slave devices in a synchronization time slot, and each slave device performs clock synchronization based on the synchronization message transmitted by the master device in a synchronization waiting time slot.
Optionally, the master device may send a global signal synchronization message to each slave device in the plurality of slave devices in a synchronization timeslot, and each slave device performs global signal synchronization based on the synchronization message sent by the master device in a synchronization waiting timeslot.
S204, the master device generates a communication message of the current communication data.
In this step, the master device generates a communication packet according to the current communication data, where the generated communication packet includes the current communication data, a preamble, a data access address, a length, header data, and the like, and the header data includes an MD, a sequence number used in the next frame, a mask, and the like. The header data carries three flag bits of MD, sequence Number (SN) and sequence number (NESN) used by the next frame and a mask, so that the reliability and flexibility of communication are ensured, the current data can be flexibly controlled to be sent to any slave device through the mask, the communication process can be optionally expanded by setting the flag bit of MD and the mask, the next connection time slot is not required to be waited, the high-efficiency transmission of the data can be ensured, and the reliability of the data can be ensured by the SN and NESN.
S205, the master device determines a target slave device to be communicated from the plurality of slave devices based on a mask in header data in the communication message and the preset communication protocol.
Since each slave device is assigned a continuous, fixed device serial number identifier starting from 1, the master device sends data to different addresses according to the type of the current data during communication, if it is required to specify which slave device the current data is sent to, the mask field in the header is used, the device that needs to receive and respond to is used, and the mask corresponding to the device serial number identifier is set to 1, otherwise, 0. And the master device determines the target slave device to be communicated from the plurality of slave devices according to the mask in the header data in the communication message and the preset communication protocol.
S206, the master device sends a communication message to the target slave device in a connection time slot, wherein the type of the communication message comprises a data request message, a state request message and a control message; the target slave device is used for processing the communication message sent by the master device in the connection waiting time slot and sending a response message to the master device in the response time slot.
As shown in fig. 5, the master device sends a communication message to the target slave device in a connection time slot, wherein the type of the communication message includes a data request message, a status request message and a control message, and the target slave device processes the communication message sent by the master device in a connection waiting time slot and sends a response message to the master device in a response time slot. It should be noted that the length of the response time slots is not fixed, and if the master device does not request all the slave devices in the connection time slots, the number of response time slots is the number of slave devices actually requested, i.e., the target slave devices.
In order to avoid collision of communication between devices, TDMA (time division multiple access) scheme is used. For example, the slave devices need to reply to the instruction of the master device for a certain time, the slave devices can judge the order of the device serial number identification of the slave devices in the communication according to the mask transmitted by the master device, and occupy the corresponding response time slot to report data to the master device. For example, if the order is the first, the first response time slot is occupied to report data to the master device; and if the order is fifth, occupying a fifth response time slot to report data to the master device.
According to the embodiment of the disclosure, connection is established between the master device and the plurality of slave devices, the same data access address is allocated to the plurality of slave devices, a device serial number identifier is allocated to each slave device in the plurality of slave devices, the master device determines the data access address of current communication data, and the plurality of slave devices are determined according to the data access address. Further, the master device sends a synchronization message to each slave device in the plurality of slave devices in a synchronization time slot; each slave device is used for carrying out clock synchronization in a synchronization waiting time slot based on a synchronization message sent by the master device, the master device generates a communication message of current communication data, and the master device determines a target slave device to be communicated from the plurality of slave devices based on a mask in header data in the communication message and the preset communication protocol. The master device sends a communication message to the target slave device in a connection time slot, wherein the type of the communication message comprises a data request message, a state request message and a control message; the target slave device is used for processing the communication message sent by the master device in the connection waiting time slot and sending a response message to the master device in the response time slot. Because the same data access address is allocated to the plurality of slave devices, a device serial number identifier is allocated to each slave device in the plurality of slave devices, different devices are not distinguished by using the data access address, but a plurality of slave devices in different sets are distinguished by using the data access address, the master device and the slave devices can flexibly communicate, the master device uses a mask in header data in a communication message to represent a target slave device which needs to be processed by current communication data, the slave device can flexibly judge whether the communication data sent by the master device needs to be received according to the mask, the problem that the data under one master and more slave devices are sent to a certain slave device is solved, and the packet transmission can be flexible.
Fig. 6 is a schematic structural diagram of a communication device according to an embodiment of the disclosure. The communication means may be a master device as described in the above embodiments, or the communication means may be a part or assembly in the master device. The communication apparatus provided in the embodiment of the present disclosure may execute the processing flow provided in the embodiment of the communication method, as shown in fig. 6, the communication apparatus 60 includes: a connection module 61, a communication module 62; the connection module 61 is configured to establish connection between a master device and a plurality of slave devices, allocate the same data access address to the plurality of slave devices, and allocate a device serial number identifier to each slave device in the plurality of slave devices; the communication module 62 is configured to communicate with the plurality of slave devices by using the master device based on a preset communication protocol and the data access address.
Optionally, the preset communication protocol at least includes one of the following: physical layer, link layer, data channel access protocol, controller control protocol, attribute data service, network service.
Optionally, the physical layer uses 2.4G SIM frequency band communication, modulation mode modulation adopting Gaussian frequency shift keying, frequency offset adopting preset frequency offset value, and modulation rate adopting preset modulation rate value; the link layer is used for defining a communication mode and a message structure between the master device and the plurality of slave devices, wherein the message structure comprises a preamble, a data access address, a length, header data and effective communication data.
Optionally, the header data includes a sequence number, a sequence number used by a next frame, and a mask; the mask is used for representing target slave devices to be communicated in a plurality of slave devices, the bit number of the mask is the same as the number of the slave devices, and each bit in the mask corresponds to one device serial number identifier; the sequence number and the sequence number used by the next frame are used to characterize whether the current communication data is received by the target device.
Optionally, the connection module 61 is configured to, when the master device establishes a connection with a plurality of slave devices, specifically: the master device sends a connection request to a plurality of slave devices; each slave device of the plurality of slave devices is configured to receive the connection request sent by the master device, and connect with the master device based on the connection request.
Optionally, the communication module 62 is configured to, when the master device communicates with the plurality of slave devices based on a preset communication protocol and the data access address, specifically: the master device determines the data access address of the current communication data and determines a plurality of slave devices according to the data access address; the master device generates a communication message of current communication data; the master device determines target slave devices to be communicated from the plurality of slave devices based on masks in header data in the communication message and the preset communication protocol; the master device sends a communication message to the target slave device in a connection time slot, wherein the type of the communication message comprises a data request message, a state request message and a control message; the target slave device is used for processing the communication message sent by the master device in the connection waiting time slot and sending a response message to the master device in the response time slot.
Optionally, after the communication module 62 is used by the master device to determine a plurality of slave devices according to the data access address, the communication module 62 is further configured to: the master device sends a synchronization message to each slave device in the plurality of slave devices in a synchronization time slot; and each slave device is used for carrying out clock synchronization in a synchronization waiting time slot based on the synchronization message sent by the master device.
The communication device of the embodiment shown in fig. 6 may be used to implement the technical solution of the above-mentioned method embodiment, and its implementation principle and technical effects are similar, and are not repeated here.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure. The electronic device may be a terminal as described in the above embodiments. The electronic device provided in the embodiment of the present disclosure may execute the processing flow provided in the embodiment of the communication method, as shown in fig. 7, the electronic device 70 includes: memory 71, processor 72, computer programs and communication interface 73; wherein the computer program is stored in the memory 71 and configured to be executed by the processor 72 for performing the communication method as described above.
In addition, the embodiment of the present disclosure also provides a storage medium having stored thereon a computer program that is executed by a processor to implement the communication method described in the above embodiment.
Furthermore, the disclosed embodiments also provide a computer program product comprising a computer program or instructions which, when executed by a processor, implement a communication method as described above.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, 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), an optical fiber, 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 context of this 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. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some embodiments, the client, server, etc. may communicate using any currently known or future developed network protocol, such as HTTP (hypertext transfer protocol), etc., and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to:
the method comprises the steps that a master device establishes connection with a plurality of slave devices, allocates the same data access address for the plurality of slave devices, and allocates a device serial number identifier for each slave device in the plurality of slave devices;
the master device communicates with the plurality of slave devices based on a preset communication protocol and the data access address.
Alternatively, the electronic device may perform other steps described in the above embodiments when the above one or more programs are executed by the electronic device.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, 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), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (10)

1. A method of communication, the method comprising:
the method comprises the steps that a master device establishes connection with a plurality of slave devices, allocates the same data access address for the plurality of slave devices, and allocates a device serial number identifier for each slave device in the plurality of slave devices;
the master device communicates with the plurality of slave devices based on a preset communication protocol and the data access address.
2. The method of claim 1, wherein the predetermined communication protocol comprises at least one of:
physical layer, link layer, data channel access protocol, controller control protocol, attribute data service, network service.
3. The method of claim 2, wherein the step of determining the position of the substrate comprises,
the physical layer uses 2.4G SIM frequency band communication, adopts Gaussian frequency shift keying modulation mode modulation, adopts preset frequency offset value for frequency offset, and adopts preset modulation rate value for modulation rate;
The link layer is used for defining a communication mode and a message structure between the master device and the plurality of slave devices, wherein the message structure comprises a preamble, a data access address, a length, header data and effective communication data.
4. A method according to claim 3, wherein the header data comprises a sequence number, a sequence number used for a next frame, and a mask;
the mask is used for representing target slave devices to be communicated in a plurality of slave devices, the bit number of the mask is the same as the number of the slave devices, and each bit in the mask corresponds to one device serial number identifier; the sequence number and the sequence number used by the next frame are used to characterize whether the current communication data is received by the target device.
5. The method of claim 1, wherein the master device establishes a connection with a plurality of slave devices, comprising:
the master device sends a connection request to a plurality of slave devices; each slave device of the plurality of slave devices is configured to receive the connection request sent by the master device, and connect with the master device based on the connection request.
6. The method of claim 1, wherein the master device communicates with the plurality of slave devices based on a preset communication protocol and the data access address, comprising:
The master device determines the data access address of the current communication data and determines a plurality of slave devices according to the data access address;
the master device generates a communication message of current communication data;
the master device determines target slave devices to be communicated from the plurality of slave devices based on masks in header data in the communication message and the preset communication protocol;
the master device sends a communication message to the target slave device in a connection time slot, wherein the type of the communication message comprises a data request message, a state request message and a control message; the target slave device is used for processing the communication message sent by the master device in the connection waiting time slot and sending a response message to the master device in the response time slot.
7. The method of claim 6, wherein after the master device determines a plurality of slave devices from the data access address, the method further comprises:
the master device sends a synchronization message to each slave device in the plurality of slave devices in a synchronization time slot; and each slave device is used for carrying out clock synchronization in a synchronization waiting time slot based on the synchronization message sent by the master device.
8. A communication device, the device comprising:
the connection module is used for establishing connection between the master equipment and the plurality of slave equipment, distributing the same data access address for the plurality of slave equipment and distributing an equipment serial number identifier for each slave equipment in the plurality of slave equipment;
and the communication module is used for the master equipment to communicate with the plurality of slave equipment based on a preset communication protocol and the data access address.
9. An electronic device, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-7.
10. A computer readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, implements the method according to any of claims 1-7.
CN202311110404.1A 2023-08-30 2023-08-30 Communication method, communication device, electronic equipment and storage medium Pending CN117222050A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311110404.1A CN117222050A (en) 2023-08-30 2023-08-30 Communication method, communication device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311110404.1A CN117222050A (en) 2023-08-30 2023-08-30 Communication method, communication device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117222050A true CN117222050A (en) 2023-12-12

Family

ID=89036221

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311110404.1A Pending CN117222050A (en) 2023-08-30 2023-08-30 Communication method, communication device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117222050A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102714620A (en) * 2009-10-20 2012-10-03 韩国电子通信研究院 Method for allocating group address in wireless lan, method for transmitting response request frame and response frame to terminals, and data transmission method using same group address
US9747227B1 (en) * 2013-05-24 2017-08-29 Qlogic, Corporation Method and system for transmitting information from a network device
CN114189474A (en) * 2020-09-14 2022-03-15 华为技术有限公司 Data transmission method and device
CN115989666A (en) * 2020-05-26 2023-04-18 卡乐工业股份公司 Method for allocating operation address

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102714620A (en) * 2009-10-20 2012-10-03 韩国电子通信研究院 Method for allocating group address in wireless lan, method for transmitting response request frame and response frame to terminals, and data transmission method using same group address
US9747227B1 (en) * 2013-05-24 2017-08-29 Qlogic, Corporation Method and system for transmitting information from a network device
CN115989666A (en) * 2020-05-26 2023-04-18 卡乐工业股份公司 Method for allocating operation address
CN114189474A (en) * 2020-09-14 2022-03-15 华为技术有限公司 Data transmission method and device

Similar Documents

Publication Publication Date Title
EP2484173B1 (en) Wlan peer-to-peer group owner negotiation
JP2009027725A (en) Wireless communication method for transmitting voice in wireless personal area network
CN109804691B (en) Data transmission method and device and computer storage medium
US8503473B2 (en) Wireless network system and method of transmitting and receiving data over the wireless network system
KR102024352B1 (en) Method for data transmission and management of channel in wireless sensor networks
WO2018176324A1 (en) Data exchange method, terminal device, and network device
CN104640172A (en) D2D (device to device) discovery signal transmitting method and D2D discovery signal transmitting device
KR20230081039A (en) Method and apparatus for uwb (ultra wide band) communication
TWI778962B (en) Device-to-device (d2d) communication method and d2d device
CN116158187A (en) AID distribution method and related device for multi-link equipment
JP2023550243A (en) Communication method and communication device
CN114514772A (en) Method and apparatus for prioritization of logical channels including MAC CEs with priority values
WO2020060682A1 (en) Bluetooth connectionless slave broadcast burst mode
CN117222050A (en) Communication method, communication device, electronic equipment and storage medium
US8792463B2 (en) Method for managing a distribution of bandwidth in a communications network, corresponding storage means and slave node
KR102467945B1 (en) Method and apparatus for TDMA(time division multiple access) resource scheduling in wireless network
CN105122927B (en) A kind of method, apparatus and system of resource bid
CN114765901B (en) Method, device, equipment and storage medium for managing multi-link equipment connection
WO2022056856A1 (en) Method and apparatus for transmitting physical downlink control channel
TWI779160B (en) Method for selecting a synchronous carrier and devices and computer storage medium
WO2023050332A1 (en) Ranging rate switching control method and communication apparatus
WO2024098912A1 (en) Communication method, terminal device, and communication system
WO2023279343A1 (en) Resource determination method, apparatus and device, and medium, chip, product and program
US20220397658A1 (en) Method and device for performing uwb ranging
WO2023272444A1 (en) Communication method and communication apparatus therefor

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination