CN111556535B - 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
CN111556535B
CN111556535B CN202010348923.1A CN202010348923A CN111556535B CN 111556535 B CN111556535 B CN 111556535B CN 202010348923 A CN202010348923 A CN 202010348923A CN 111556535 B CN111556535 B CN 111556535B
Authority
CN
China
Prior art keywords
data transmission
transmission rate
low level
data
determining
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.)
Active
Application number
CN202010348923.1A
Other languages
Chinese (zh)
Other versions
CN111556535A (en
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.)
Chipsea Technologies Shenzhen Co Ltd
Original Assignee
Chipsea Technologies Shenzhen Co 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 Chipsea Technologies Shenzhen Co Ltd filed Critical Chipsea Technologies Shenzhen Co Ltd
Priority to CN202010348923.1A priority Critical patent/CN111556535B/en
Publication of CN111556535A publication Critical patent/CN111556535A/en
Application granted granted Critical
Publication of CN111556535B publication Critical patent/CN111556535B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/16Central resource management; Negotiation of resources or communication parameters, e.g. negotiating bandwidth or QoS [Quality of Service]
    • H04W28/18Negotiating wireless communication parameters
    • H04W28/22Negotiating communication rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)

Abstract

The invention relates to the technical field of communication, and particularly discloses a communication method, a communication device, electronic equipment and a storage medium. The method comprises the following steps: receiving a data frame sent by a second device, wherein the frame head of the data frame comprises a synchronous interval field; determining a data transmission rate of the second device according to the synchronization interval field; and adjusting the data transmission rate of the first device according to the data transmission rate of the second device. The data transmission rate of the second device can be determined only according to the synchronous interval field in the frame header of the data frame sent by the second device without adding a protocol conversion device or changing the protocol format of the second device, and then the data transmission rate of the first device is adjusted, so that the data transmission rates of the first device and the second device are matched, and resource sharing among different devices is realized under the condition of not increasing extra cost.

Description

Communication method, communication device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a communications method, a communications device, an electronic apparatus, and a storage medium.
Background
In general, resource sharing is realized between different devices, and an accessed party needs to be informed in advance that the accessed party must access according to the communication protocol format, otherwise, the accessed party cannot normally share the data. To achieve normal resource sharing, it is common practice to add a set of protocol conversion means that complies with the protocol format and rate of the access device, while also complying with the format and rate requirements of the accessed device. However, at the same time, the addition of the device of the set obviously increases the cost of software and hardware, and correspondingly increases manpower and material resources, so that the device of the set is not suitable for industries with strict cost control. In addition, many vendors have self-contained a suite of protocol frameworks that are not willing to modify their own protocol formats and rates, and that are expected to be able to automatically identify their protocols without adding additional cost.
Disclosure of Invention
Based on this, it is necessary to provide a communication method, a communication device, an electronic apparatus and a storage medium for solving the problem that the communication protocol cannot be automatically adapted without increasing additional cost.
A communication method applied to a first device, wherein the first device and a second device communicate based on a preset data frame format, the method comprising:
receiving a data frame sent by a second device, wherein the frame head of the data frame comprises a synchronous interval field;
Determining a data transmission rate of the second device according to the synchronization interval field;
And adjusting the data transmission rate of the first device according to the data transmission rate of the second device.
In one embodiment, the sync interval field is used to characterize a low level width;
The step of determining the data transmission rate of the second device from the synchronization interval field comprises:
Determining the low level width according to the synchronous interval field;
And determining the data transmission rate of the second equipment according to the low level width and the preset low level length.
In one embodiment, the step of determining the low level width from the sync spacer field comprises:
capturing a first falling edge in the data frame;
Capturing a first rising edge in the data frame;
The low level width is determined from a time difference between the first falling edge and the first rising edge.
In one embodiment, the step of determining the low level width from the sync spacer field comprises:
Detecting a low level in the data frame, starting timing when a first low level in the data frame appears, and stopping timing when the first low level ends;
And determining the low level width according to the time length of the timing.
In one embodiment, the step of determining the data transmission rate of the second device according to the low level width and the preset low level length includes:
determining the data transmission rate of the second equipment according to a preset relation between the data transmission rate, the low level width and the preset low level length;
Wherein, the preset relation is:
Wherein BAUD is a data transmission rate, n is a preset low level length, and T is a low level width.
In one embodiment, the step of adjusting the data transmission rate of the first device according to the data transmission rate of the second device comprises:
And when the data transmission rate of the first device is inconsistent with the data transmission rate of the second device, adjusting the data transmission rate of the first device so as to enable the data transmission rate of the first device to be consistent with the data transmission rate of the second device.
In one embodiment, after the step of adjusting the data transmission rate of the first device according to the data transmission rate of the second device, the method further comprises:
And carrying out data transmission with the second equipment according to the adjusted data transmission rate.
In one embodiment, the step of transmitting data with the second device according to the adjusted data transmission rate includes:
According to the adjusted data transmission rate, receiving a first measurement parameter based on a target object, which is sent by the second equipment;
The method may further comprise the steps of,
Acquiring a second measurement parameter based on the target object;
Determining at least one physiological parameter of the target subject from the first and second measured parameters;
Wherein at least one of the first and second measured parameters comprises a bioimpedance value of the target subject, and the physiological parameter comprises at least one of a body composition parameter and a heart rate parameter of the target subject.
A communication device, comprising:
a receiving unit, configured to receive a data frame sent by a second device, where a frame header of the data frame includes a synchronization interval field;
A determining unit, configured to determine a data transmission rate of the second device according to the synchronization interval field;
and the adjusting unit is used for adjusting the data transmission rate of the first device according to the data transmission rate of the second device.
An electronic device, comprising:
The device comprises a data receiving end, a capturing end, a memory and a processor, wherein the data receiving end is connected with the capturing end, the processor and the memory are mutually in communication connection, computer instructions are stored in the memory, and the processor executes the computer instructions, so that the communication method is executed.
A computer readable storage medium having stored therein computer instructions which when executed by a processor implement a communication method as described above.
The communication method is applied to the first equipment, the first equipment and the second equipment communicate based on a preset data frame format, and after the first equipment receives a data frame sent by the second equipment, the data transmission rate of the second equipment is firstly determined according to a synchronous interval field contained in a data frame header, and then the data transmission rate of the first equipment is adjusted according to the data transmission rate of the second equipment. Therefore, the data transmission rate of the second device can be determined only according to the synchronous interval field in the frame header of the data frame sent by the second device without adding a protocol conversion device or changing the protocol format of the second device, and the data transmission rate of the first device is further adjusted, so that the data transmission rates of the first device and the second device are matched, and resource sharing among different devices is realized under the condition of not increasing extra cost.
Drawings
FIG. 1 is a flow chart of a communication method according to an embodiment of the application;
FIG. 2 is a flow chart of a communication method according to another embodiment of the present application;
FIG. 3 is a flow chart of a communication method according to another embodiment of the present application;
FIG. 4 is a flow chart of a communication method according to another embodiment of the present application;
FIG. 5 is a flow chart of a communication method according to another embodiment of the present application;
FIG. 6 is a flow chart of a communication method according to another embodiment of the present application;
FIG. 7 is a diagram illustrating an application scenario of a specific example of a communication method according to the present application;
fig. 8 is a schematic structural diagram of a communication device according to an embodiment of the application;
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the application.
Detailed Description
In order that the invention may be readily understood, a more complete description of the invention will be rendered by reference to the appended drawings. The drawings illustrate preferred embodiments of the invention. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
It will be understood that when an element is referred to as being "fixed to" another element, it can be directly on the other element or intervening elements may also be present. When an element is referred to as being "connected" to another element, it can be directly connected to the other element or intervening elements may also be present. The terms "vertical," "horizontal," "left," "right," "upper," "lower," "front," "rear," "circumferential," and the like as used herein are based on the orientation or positional relationship shown in the drawings and are merely for convenience of description and to simplify the description, rather than to indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus are not to be construed as limiting the invention.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and/or" as used herein includes any and all combinations of one or more of the associated listed items.
As described in the background art, in the existing communication manner, in order to realize resource sharing between different devices, a unified communication protocol format is first required between the devices, and it is common practice to add a protocol conversion device, where the protocol conversion device needs to follow the protocol format and rate of the access device, and the format and rate of the accessed device. Although resource sharing can be achieved by this protocol conversion apparatus, the same protocol conversion apparatus can be adapted to only one device, and when a new device is introduced, a new protocol conversion apparatus needs to be replaced, which would require a large investment in cost.
In order to solve the above problem of resource sharing without adding additional cost, the embodiment of the application provides a communication method applied to a first device, wherein the first device and a second device communicate based on a preset data frame format. The first device and the second device may be a PC or various mobile intelligent terminals, and the preset data frame format is a format requirement of the first device and the second device for the transmitted data frame according to a communication protocol, where the preset data frame format is generally a format of frame header+data information.
In one embodiment, the present application provides a communication method applied to a first device. As shown in fig. 1, the communication method includes the following steps:
step S10: and receiving a data frame sent by the second device, wherein the frame head of the data frame comprises a synchronous interval field.
The second device sends data to the first device according to a preset data frame format, and the first device receives a data frame sent by the second device, wherein a frame header of the data frame comprises a synchronous interval field, and the synchronous interval field is matched with the data transmission rate of the second device. The synchronization interval field may be matched with the data transmission rate of the second device in various manners, for example, the synchronization interval field may represent width information of a preset level (i.e., duration of the preset level), the width information of the preset level and length information corresponding to the preset level (i.e., number of bits corresponding to the preset level) are matched with the data transmission rate of the second device, or the synchronization interval field may be matched with the data transmission rate of the second device in other manners, which are not listed herein.
In addition, the frame header of the data frame further comprises a synchronous field, the synchronous field is composed of commands, the commands can be divided into an operation state, an operation control and the like, the data information part in the data frame specifically comprises a data field and a check field, the data field can comprise equipment time, historical data, control data, state data, upgrading data and the like, and the check field can comprise accumulation and check, exclusive or check, CRC8 check, CRC16 check and other check modes.
Step S30: the data transmission rate of the second device is determined based on the synchronization interval field.
After the first device receives the data frame sent by the second device, the data transmission rate of the second device can be determined according to the synchronous interval field in the frame head of the data frame. Since the sync interval field is matched with the data transmission rate of the second device, when the first device acquires the data frame of the second device, it can acquire the data transmission rate of the second device matched with the sync interval field through the sync interval field in the data frame.
Step S50: and adjusting the data transmission rate of the first device according to the data transmission rate of the second device.
When the first device determines the data transmission rate of the second device, the first device adjusts the data transmission rate of the first device according to the data transmission rate of the second device so that the data transmission rate of the first device is matched with the data transmission rate of the second device, and further data information transmitted by the second device is successfully received, so that resource sharing is realized.
The communication method is applied to the first equipment, the first equipment and the second equipment communicate based on a preset data frame format, and after the first equipment receives a data frame sent by the second equipment, the data transmission rate of the second equipment is firstly determined according to a synchronous interval field contained in a data frame header, and then the data transmission rate of the first equipment is adjusted according to the data transmission rate of the second equipment. Therefore, the data transmission rate of the second device can be determined only according to the synchronous interval field in the frame header of the data frame sent by the second device without adding a protocol conversion device or changing the protocol format of the second device, and the data transmission rate of the first device is further adjusted, so that the data transmission rates of the first device and the second device are matched, and resource sharing among different devices is realized under the condition of not increasing extra cost.
In one embodiment, the sync interval field is used to characterize the low level width, which refers to the duration of the low level. As shown in fig. 2, step S30, i.e. the step of determining the data transmission rate of the second device from the synchronization interval field, comprises the steps of:
step S301: the low level width is determined from the sync interval field.
Since the synchronization interval field characterizes the low level width, after the first device acquires the data frame transmitted by the second device, the low level width, i.e. the duration of the low level, may be determined first by the synchronization interval field. The determination of the low level width may be implemented in combination with an interrupt function, a timer function, or the like.
Step S302: and determining the data transmission rate of the second device according to the low level width and the preset low level length.
The preset low level length refers to a bit number corresponding to the preset low level. Before the first device and the second device communicate, both devices should have a predetermined low-level length and the predetermined low-level length is stored in both the first device and the second device, or both devices have the same low-level length according to the protocol to which they are compliant. When the first device obtains the low level width according to the synchronization interval field, the data transmission rate of the second device can be determined according to the low level width and the preset low level length stored in the first device. It should be noted that, the preset low level length and low level width are set in combination with the data transmission rate of the second device and the data processing rate of the first device, so that the data transmission rate error of the finally determined second device is smaller, and meanwhile, excessive system resources are avoided being consumed.
In one embodiment, as shown in fig. 3, step S301, i.e., the step of determining the low level width according to the synchronization interval field, includes the steps of:
S3011: the first falling edge in the data frame is captured. Specifically, when the first device does not communicate data with the second device, the data receiving port of the first device may be set to a high level, and when a data frame sent by the second device is received, since the synchronization interval field is located at the frame head of the data frame and is at a low level, the first device captures the first falling edge in the data frame, that is, captures the initial time of the synchronization interval field.
S3012: the first rising edge in the data frame is captured. The first rising edge in the data frame, the end of the sync interval field, is captured.
Specifically, the data frame may be in a format of a synchronization interval field+a synchronization field+a data field+a check field, where the synchronization interval field is located at an initial position of the data frame and is a continuous low level signal, the synchronization field is located after the synchronization interval field and is a high level signal of an interval, and an initial level of the synchronization field is a high level. The first rising edge in the data frame, the end time of the captured sync interval field, is captured, as well as the initial time of capturing the sync field.
S3013: the low level width is determined from the time difference between the first falling edge and the first rising edge.
When the first falling edge and the first rising edge in the data frame are captured, the time difference between the first falling edge and the first rising edge, namely the low level width, can be obtained.
The above-mentioned manner of capturing the first falling edge and the first rising edge in the data frame may be implemented by a capturing function port, where the capturing function port may be a port having both a GPIO (General-purpose input/output) function and a PWM (pulse width modulation) wave acquisition function, and may perform edge detection, and the capturing port is connected to the data receiving port.
The above edge detection may also be achieved by an interrupt port, which is typically provided with an edge detector to trigger the generation of an interrupt event upon detection of a rising or falling edge. Therefore, the interrupt port can be connected to the data receiving port so that the arrival of a falling edge or a rising edge is confirmed according to the interrupt signal generated by the interrupt port when a data frame is received.
The mode of determining the low level width by capturing the edges is higher in accuracy, and is beneficial to improving the internal calculation speed and improving the overall data transmission efficiency.
As a modification, as shown in fig. 4, step S301, i.e., the step of determining the low level width from the synchronization interval field, includes the steps of:
s3014: the low level in the data frame is detected and the timing is started when the first low level in the data frame occurs and stopped when the first low level ends.
In practical application, high and low level detection can be realized through a common I/O port. The timer is started to count when the first low level in the data frame starts, and the timer is controlled to stop counting when the first high level in the data frame appears, i.e. when the first low level ends.
S3015: the low level width is determined based on the duration of the timer. The above-mentioned time duration of the timer can be used as the low level width.
Of course, the above steps may be replaced by: once when the first low level appears, the first high level appears, i.e. the first low level ends, and the time is counted again, and the time difference of the two times of counting is taken as the low level width.
The low-level width determining mode does not need to depend on a port with a capturing function, and can be determined only by a timer, so that the cost is low, and the implementation is simple and convenient.
The above methods for determining the low level width are applicable to the present application, and can be selected according to practical requirements in practical application.
In one embodiment, step S302, that is, the step of determining the data transmission rate of the second device according to the low level width and the preset low level length, is:
Determining the data transmission rate of the second equipment according to a preset relation between the data transmission rate, the low level width and the preset low level length;
Wherein, the preset relation is:
Wherein BAUD is a data transmission rate, n is a preset low level length, and T is a low level width.
Specifically, the preset low level length is a preset number of bits, for example, 13bits, and the low level width is a duration of the low level, for example, 1.5ms. When the first device obtains the low level width, the data transmission rate of the second device is 8666bps by combining the low level length stored in the first device and the preset relation. Since there are several kinds of common data transmission rates fixed, including 9600bps, 19200bps, 115200bps, and the like. When the data transmission rate is calculated to be 8666bps, it can be considered to fall within an error range of 9600bps, that is, the first device side can determine that the data transmission rate of the second device is 9600bps.
In one embodiment, step S50, i.e. the step of adjusting the data transmission rate of the first device according to the data transmission rate of the second device, comprises the steps of:
s501: when the data transmission rate of the first device is inconsistent with the data transmission rate of the second device, the data transmission rate of the first device is adjusted so that the data transmission rate of the first device is consistent with the data transmission rate of the second device.
After the first equipment acquires the data transmission rate of the second equipment, the data transmission rate of the first equipment is compared with the data transmission rate of the second equipment, if the data transmission rate of the first equipment is inconsistent with the data transmission rate of the second equipment, the data transmission rate of the first equipment is consistent with the data transmission rate of the second equipment, and if the data transmission rate of the first equipment is consistent with the data transmission rate of the second equipment, the data transmission rate of the first equipment is not required to be adjusted. The adjusting the data transmission rate of the first device is specifically adjusting the register configuration of the first device, and the data transmission rate of the first device is adjusted to be consistent with the data transmission rate of the second device.
In one embodiment, as shown in fig. 5, step S50, that is, after the step of adjusting the data transmission rate of the first device according to the data transmission rate of the second device, the communication method provided by the embodiment of the present application further includes the following steps:
S70: and carrying out data transmission with the second equipment according to the adjusted data transmission rate.
When the data transmission rate of the first device is adjusted, the first device can perform data transmission with the second device according to the adjusted data transmission rate. Since the data transmission rates of the first device and the second device are already adjusted to be consistent, resource sharing can be smoothly realized.
In one embodiment, as shown in fig. 6, step S70, that is, the step of transmitting data with the second device according to the adjusted data transmission rate, includes the following steps:
S701: and receiving a first measurement parameter based on the target object, which is sent by the second equipment, according to the adjusted data transmission rate.
After the first device adjusts its own data transmission rate according to the data transmission rate of the second device, the first device can receive and analyze the data frame sent by the second device. In one embodiment, the second device sends to the first device a first measurement parameter based on a target object, which may be a person or animal, or the like, and the first measurement parameter may be an impedance measurement or heart rate measurement, or the like, based on the target object.
The communication method provided in this embodiment further includes the following steps:
s702: a second measurement parameter based on the target object is acquired. The second measurement parameter may be an impedance measurement value or a heart rate measurement value based on the target object, and the second measurement parameter is obtained by measuring by a different device from the first measurement parameter.
S703: at least one physiological parameter of the target object is determined from the first measurement parameter and the second measurement parameter.
Wherein at least one of the first measured parameter and the second measured parameter comprises a bioimpedance value of the target subject, and the physiological parameter comprises at least one of a body composition parameter and a heart rate parameter of the target subject. For example, the first measurement parameter is a measurement value of impedance of two feet of a human body, the second measurement parameter is a measurement value of heart rate of the human body, and the physiological parameters determined according to the first measurement parameter and the second measurement parameter are a human body component, heart rate row and the like. For another example, the first measurement parameter is a measured value of impedance of both hands of the human body, the second measurement parameter is a measured value of impedance of both feet of the human body, and the physiological parameter determined according to the first measurement parameter and the second measurement parameter is a component of the human body. The human body composition calculated by combining the two-foot impedance measurement value and the two-hand impedance measurement value is more accurate and comprehensive than the human body composition calculated by singly using the two-hand or two-foot impedance measurement value.
The communication method provided by the application is described below with reference to a specific application scenario and example:
Fig. 7 shows an application scenario comprising a master device (i.e. a first device), a slave device 1 (i.e. a second device) and a slave device 2 (i.e. a second device), the master device communicating with the slave device 1, the slave device 2, respectively. The data receiving ends of the master device are respectively connected with the data sending ends of the slave device 1 and the slave device 2, the data sending ends of the master device are respectively connected with the data receiving ends of the slave device 1 and the slave device 2, and meanwhile, the data receiving ends of all the devices are connected with the interrupt ports. The data receiving end is an RXD pin, the data transmitting end is an TXD pin, and the interrupt port is an INT0 pin.
First, system initialization and hardware layer initialization are performed. The system initialization mainly comprises the steps of initializing configuration information, power consumption management, interruption and the like; the hardware layer initialization mainly comprises the initialization of a hardware layer such as a system clock, a GPIO input/output port and a UART baud rate.
After the initialization is completed, the system enters a normal working state, and the communication between the slave device 1 and the master device is taken as an example for explanation.
The slave device 1 sends a data frame to a data receiving end of the master device through a data sending end, wherein a frame head of the data frame comprises a synchronous interval field; the method comprises the steps that an interrupt port connected with a data receiving end in a main device detects the first falling edge and the first rising edge of a data frame, an internal processor of the main device obtains the low level width of a synchronous interval field in the frame head of the data frame according to the time difference between the first falling edge and the first rising edge, and the data transmission rate of a slave device 1 is calculated by combining the low level length of the main device stored in the main device in advance; the master device adjusts the configuration of the internal register to enable the data transmission rate of the master device to be consistent with the data transmission rate of the slave device 1, and analyzes the data frame according to the adjusted data transmission rate to obtain data information; the master device replies the data frame to the slave device 1 at the adjusted data transmission rate, and information interaction and data sharing are completed.
The embodiment of the application also provides a communication device, as shown in fig. 8, which includes a receiving unit 10, a first determining unit 30, and an adjusting unit 50. The receiving unit 10 is configured to receive a data frame sent by the second device, where a frame header of the data frame includes a synchronization interval field; the first determining unit 30 is configured to determine a data transmission rate of the second device according to the synchronization interval field; the adjusting unit 50 is configured to adjust the data transmission rate of the first device according to the data transmission rate of the second device.
Therefore, a protocol conversion device is not required to be added or the protocol format of the device is not required to be changed, the data transmission rate of the second device is only required to be determined through the first determination unit according to the synchronous interval field in the frame header of the data frame sent by the second device, and then the data transmission rate of the first device is adjusted through the adjustment unit, so that the data transmission rates of the first device and the second device are matched, and resource sharing among different devices is realized under the condition of not increasing extra cost.
In one embodiment, a sync interval field is used to characterize the low level width. The first determining unit comprises a first determining subunit and a second determining subunit, wherein the first determining subunit is used for determining a low-level width according to the synchronous interval field; the second determining subunit is configured to determine a data transmission rate of the second device according to the low level width and a preset low level length.
In one embodiment, the first determination subunit includes a first capture unit, a second capture unit, and a third determination subunit. The first capturing unit is used for capturing the first falling edge in the data frame; the second capturing unit is used for capturing the first rising edge in the data frame; the third determining subunit is configured to determine the low level width according to a time difference between the first falling edge and the first rising edge.
As a variant embodiment, the first determining subunit includes a detection timing unit and a fourth determining subunit, where the detection timing unit is configured to detect a low level in the data frame, start timing when a first low level in the data frame occurs, and stop timing when the first low level ends; the fourth determining subunit is configured to determine the low level width according to the duration of the timing.
In one embodiment, the second determining subunit is configured to determine the data transmission rate of the second device according to a preset relationship between the data transmission rate and a low level width and a preset low level length; wherein, the preset relation is:
Wherein BAUD is a data transmission rate, n is a preset low level length, and T is a low level width.
In one embodiment, the communication device provided in the embodiment of the present application further includes a data transmission unit, where the data transmission unit is configured to perform data transmission with the second device according to the adjusted data transmission rate.
In one embodiment, the data transmission unit includes a receiving unit, an acquiring unit, and a second determining unit. The receiving unit is used for receiving a first measurement parameter based on a target object sent by the second equipment according to the adjusted data transmission rate; the acquisition unit is used for acquiring a second measurement parameter based on the target object; the second determination unit is configured to determine at least one physiological parameter of the target object based on the first measurement parameter and the second measurement parameter. Wherein at least one of the first and second measured parameters comprises a bioimpedance value of the target subject, and the physiological parameter comprises at least one of a body composition parameter and a heart rate parameter of the target subject.
The details of the above units may be referred to the description of the relevant parts in the communication method, and will not be repeated here.
An embodiment of the present application provides an electronic device, as shown in fig. 9, which includes a data receiving end 20, a capturing end 40, a memory 60, and a processor 80. The data receiving terminal 20 is connected to the capturing terminal 40, and the capturing terminal 40, the memory 60 and the processor 80 are communicatively connected to each other by a bus or other means, which is illustrated in fig. 9 as a bus connection.
The processor 80 may be a central processing unit (Central Processing Unit, CPU). The Processor 80 may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL processors, DSPs), application SPECIFIC INTEGRATED Circuits (ASICs), field-Programmable gate arrays (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations thereof.
The memory 60 is used as a non-transitory computer readable storage medium for storing non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions corresponding to the communication method in the embodiment of the present invention. The processor 80 performs various functional applications and data processing of the processor 80, i.e., implements a communication method, by running non-transitory software programs, instructions, and modules stored in the memory 60.
The memory 60 may include a storage program area that may store an operating system, at least one application program required for functions, and a storage data area; the storage data area may store data created by the processor 80, etc. In addition, memory 60 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 60 may optionally include memory located remotely from processor 80, which may be connected to the processor via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
It will be appreciated by those skilled in the art that implementing all or part of the above-described embodiment method may be implemented by a computer program to instruct related hardware, where the program may be stored in a computer readable storage medium, and the program may include the above-described embodiment method when executed. Wherein the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (Random Access Memory, RAM), a flash memory (flash memory), a hard disk (HARD DISK DRIVE, abbreviated as HDD), a solid state disk (solid-state-STATE DRIVE, SSD), or the like; the storage medium may also comprise a combination of memories of the kind described above.
The technical features of the above-described embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above-described embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the invention, which are described in detail and are not to be construed as limiting the scope of the invention. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the invention, which are all within the scope of the invention. Accordingly, the scope of protection of the present invention is to be determined by the appended claims.

Claims (10)

1. A communication method, applied to a first device, where the first device and a second device communicate based on a preset data frame format, the method comprising:
Receiving a data frame sent by a second device, wherein the frame head of the data frame comprises a synchronous interval field, and the synchronous interval field is used for representing low-level width;
Determining the low level width according to the synchronous interval field;
Determining the data transmission rate of the second device according to the low level width and the preset low level length, wherein the low level length is a bit number corresponding to the low level preset by combining the data transmission rate of the second device and the data processing rate of the first device before communication;
adjusting the data transmission rate of the first device according to the data transmission rate of the second device;
Carrying out data transmission with the second equipment according to the adjusted data transmission rate;
And performing data transmission with the second device according to the adjusted data transmission rate, including:
According to the adjusted data transmission rate, receiving a first measurement parameter based on a target object, which is sent by the second equipment;
Acquiring a second measurement parameter based on the target object;
Determining at least one physiological parameter of the target subject from the first and second measured parameters, wherein at least one of the first and second measured parameters comprises a bioimpedance value of the target subject, the physiological parameter comprising at least one of a body composition parameter and a heart rate parameter of the target subject;
And replying the data frame to the second equipment according to the adjusted data transmission rate.
2. The communication method of claim 1, wherein the step of determining the low level width based on the synchronization interval field comprises:
capturing a first falling edge in the data frame;
Capturing a first rising edge in the data frame;
The low level width is determined from a time difference between the first falling edge and the first rising edge.
3. The communication method of claim 1, wherein the step of determining the low level width based on the synchronization interval field comprises:
Detecting a low level in the data frame, starting timing when a first low level in the data frame appears, and stopping timing when the first low level ends;
And determining the low level width according to the time length of the timing.
4. The communication method according to claim 1, wherein the step of determining the data transmission rate of the second device according to the low level width and the preset low level length comprises:
determining the data transmission rate of the second equipment according to a preset relation between the data transmission rate, the low level width and the preset low level length;
Wherein, the preset relation is:
Wherein BAUD is a data transmission rate, n is a preset low level length, and T is a low level width.
5. The communication method of claim 1, wherein the step of adjusting the data transmission rate of the first device based on the data transmission rate of the second device comprises:
And when the data transmission rate of the first device is inconsistent with the data transmission rate of the second device, adjusting the data transmission rate of the first device so as to enable the data transmission rate of the first device to be consistent with the data transmission rate of the second device.
6. A communication apparatus for use with a first device, the first device and a second device communicating based on a predetermined data frame format, the apparatus comprising:
a receiving unit, configured to receive a data frame sent by a second device, where a frame header of the data frame includes a synchronization interval field;
A determining unit, configured to determine a low level width according to the synchronization interval field, and determine a data transmission rate of the second device according to the low level width and a preset low level length, where the low level length is a bit number corresponding to a low level preset by combining the data transmission rate of the second device and the data processing rate of the first device before communication;
An adjusting unit, configured to adjust a data transmission rate of a first device according to a data transmission rate of the second device;
The data transmission unit is used for carrying out data transmission with the second equipment according to the adjusted data transmission rate;
The data transmission unit is configured to, when performing data transmission with the second device according to the adjusted data transmission rate:
According to the adjusted data transmission rate, receiving a first measurement parameter based on a target object, which is sent by the second equipment;
Acquiring a second measurement parameter based on the target object;
Determining at least one physiological parameter of the target subject from the first and second measured parameters, wherein at least one of the first and second measured parameters comprises a bioimpedance value of the target subject, the physiological parameter comprising at least one of a body composition parameter and a heart rate parameter of the target subject;
And replying the data frame to the second equipment according to the adjusted data transmission rate.
7. The apparatus of claim 6, wherein the determining unit, when performing the determining the low level width from the synchronization interval field, is configured to:
capturing a first falling edge in the data frame;
Capturing a first rising edge in the data frame;
The low level width is determined from a time difference between the first falling edge and the first rising edge.
8. The apparatus of claim 6, wherein the determining unit, when performing the determining the low level width from the synchronization interval field, is configured to:
Detecting a low level in the data frame, starting timing when a first low level in the data frame appears, and stopping timing when the first low level ends;
And determining the low level width according to the time length of the timing.
9. An electronic device, comprising:
The communication method comprises the steps of a data receiving end, a capturing end, a memory and a processor, wherein the data receiving end is connected with the capturing end, the processor and the memory are in communication connection, computer instructions are stored in the memory, and the processor executes the computer instructions, so that the communication method of any one of claims 1-5 is executed.
10. A computer readable storage medium, wherein computer instructions are stored in the computer readable storage medium, which when executed by a processor, implement the communication method according to any of claims 1-5.
CN202010348923.1A 2020-04-28 2020-04-28 Communication method, communication device, electronic equipment and storage medium Active CN111556535B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010348923.1A CN111556535B (en) 2020-04-28 2020-04-28 Communication method, communication device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010348923.1A CN111556535B (en) 2020-04-28 2020-04-28 Communication method, communication device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111556535A CN111556535A (en) 2020-08-18
CN111556535B true CN111556535B (en) 2024-04-19

Family

ID=72004186

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010348923.1A Active CN111556535B (en) 2020-04-28 2020-04-28 Communication method, communication device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111556535B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112134809B (en) * 2020-09-16 2024-04-23 山东云海国创云计算装备产业创新中心有限公司 Flow control method, device, equipment and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103036823A (en) * 2012-12-14 2013-04-10 中船重工(武汉)凌久电子有限责任公司 Baud rate fast self-adaptive method based on field programmable gate array (FPGA), processor and receiving end
CN107566088A (en) * 2017-09-07 2018-01-09 维沃移动通信有限公司 The method of adjustment and charging adapter of a kind of baud rate
CN110908940A (en) * 2019-10-14 2020-03-24 百富计算机技术(深圳)有限公司 Method for adjusting serial port communication parameters and terminal equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100748086B1 (en) * 2005-11-10 2007-08-09 한국전자통신연구원 Method for balancing quality of wireless communication channel and wireless communication apparatus using the same

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103036823A (en) * 2012-12-14 2013-04-10 中船重工(武汉)凌久电子有限责任公司 Baud rate fast self-adaptive method based on field programmable gate array (FPGA), processor and receiving end
CN107566088A (en) * 2017-09-07 2018-01-09 维沃移动通信有限公司 The method of adjustment and charging adapter of a kind of baud rate
CN110908940A (en) * 2019-10-14 2020-03-24 百富计算机技术(深圳)有限公司 Method for adjusting serial port communication parameters and terminal equipment

Also Published As

Publication number Publication date
CN111556535A (en) 2020-08-18

Similar Documents

Publication Publication Date Title
US7934039B2 (en) Variable oscillator for generating different frequencies in a controller area network
EP2849384B1 (en) Approximate matching method and related device, and communication system
CN110908940B (en) Method for adjusting serial port communication parameters and terminal equipment
CN102306136B (en) Baud rate self-adaption method based on input capture function of singlechip
CN105634840B (en) Method and device for measuring packet loss
CN107147553B (en) Method, device and equipment for adjusting Baud rate and frame format of slave station
EP3133878A1 (en) Power adjustment apparatus and method
WO2013100188A1 (en) Communication terminal device, communication system, communication state display method, and computer-readable recording medium
CN111556535B (en) Communication method, communication device, electronic equipment and storage medium
CN104917645A (en) Online detection message transmission timeout method and device
KR20150128658A (en) Dithering circuit for serial data transmission
CN114328003B (en) Method for realizing data reverse order processing through CRC hardware module
CN110363980B (en) LoRa acquisition device based on TDMA and Contiki and acquisition method thereof
US20140153623A1 (en) Device for auto baud rate detection
CN113312284A (en) Data transmission method, device, system, storage medium and electronic device
CN110535621B (en) Serial port communication baud rate correction device and correction method thereof
US10838795B2 (en) Monitoring circuit with a signature watchdog
CN105553781B (en) method and device for measuring bottleneck bandwidth
CN112241615A (en) Method and system for detecting data balance time sequence and electronic equipment
CN114443537A (en) Method, device, equipment and medium for configuring parameters of PCIE signal sending terminal
CN111726459A (en) Position determination method, position determination device, electronic device and storage medium
Sieczkowski et al. A method for real-time data acquisition using Matlab software
CN116361095B (en) Power consumption verification method, system, equipment and storage medium
US11973677B2 (en) Method and device for calculating bandwidth utilization ratio
CN114124334B (en) Processing method, client, equipment and medium of air interface data packet

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
GR01 Patent grant
GR01 Patent grant