CN115314080A - Data transmission method, device, system, computer equipment and storage medium - Google Patents

Data transmission method, device, system, computer equipment and storage medium Download PDF

Info

Publication number
CN115314080A
CN115314080A CN202211195327.XA CN202211195327A CN115314080A CN 115314080 A CN115314080 A CN 115314080A CN 202211195327 A CN202211195327 A CN 202211195327A CN 115314080 A CN115314080 A CN 115314080A
Authority
CN
China
Prior art keywords
data
frame
sampling
target
type
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
CN202211195327.XA
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 Brain Up Technology Co ltd
Original Assignee
Beijing Brain Up Technology 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 Beijing Brain Up Technology Co ltd filed Critical Beijing Brain Up Technology Co ltd
Priority to CN202211195327.XA priority Critical patent/CN115314080A/en
Publication of CN115314080A publication Critical patent/CN115314080A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • H04B5/72
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0006Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format

Abstract

The invention discloses a data transmission method, a device, a system, computer equipment and a storage medium, wherein the method comprises the following steps: determining at least one data type to be acquired by acquisition equipment and a sampling frequency corresponding to each data type; collecting sampling data according to each data type and the sampling frequency corresponding to each data type; packaging the sampled data by adopting a preset frame format to obtain a target data frame; and sending the target data frame to a data center connected with the acquisition equipment through Bluetooth. By adopting the method, more effective data can be transmitted by the Bluetooth protocol as much as possible.

Description

Data transmission method, device, system, computer equipment and storage medium
Technical Field
The invention relates to the field of bioelectrical data transmission, in particular to a data transmission method, a device, a system, computer equipment and a storage medium.
Background
Most of data collected by the bioelectricity collection device is transmitted through a bluetooth protocol, and the transmission speed of bluetooth is limited, for example, the maximum transmission speed supported by the bluetooth 4.2 standard is 1Mbps. Meanwhile, in order to improve the accuracy of the bioelectrical data, the bioelectrical data collecting apparatus needs to collect the bioelectrical data at a higher frequency, which results in an increase in the amount of data that the bioelectrical data collecting apparatus needs to transmit. For example, when a 32-channel device samples at a frequency of 1000Hz, assuming that each channel uses 4 bytes of encoding per sampling result, transmitting only the data itself requires a bandwidth of 1000 × 32 × 4 × 8/(1024 × 1024), i.e., approximately equal to 0.98 Mbps.
Thus, the transmission capabilities of the bluetooth protocol effectively limit the sampling frequency of the acquisition device. Taking a four-channel device as an example, the four-channel device needs to transmit at least 4 × 3 = 12 bytes (after compression) for each acquisition result, and since the size of the data packet in the bluetooth protocol is fixed to 20 bytes, each data packet at most supports transmission of two acquisition results, that is, the four-channel device must transmit one data packet at least after acquiring two times of bioelectricity data. If the maximum bluetooth transmission speed is 2Mbps, in practice, the four-channel device transmits at most 100 data packets per second, that is, the four-channel device can only sample at a frequency of 200Hz at most.
Therefore, under the condition that the transmission capability of the bluetooth protocol cannot completely support the data volume required to be transmitted by the bioelectricity collecting device, a data transmission method is urgently needed to balance the transmission capability of the bluetooth protocol and the data volume required to be transmitted by the bioelectricity collecting device, so that the bluetooth protocol can transmit more data as much as possible, and the limitation of the transmission capability of the bluetooth protocol on the sampling rate of the collecting device is reduced.
Disclosure of Invention
The technical problem to be solved by the embodiment of the invention is how to balance the transmission capability of the Bluetooth protocol and the data volume required to be transmitted by the bioelectricity acquisition equipment, so that the Bluetooth protocol can transmit more data as much as possible.
In a first aspect, the present application provides a data transmission method. The method comprises the following steps:
determining at least one data type required to be acquired by acquisition equipment and a sampling frequency corresponding to each data type;
acquiring sampling data according to each data type and the sampling frequency corresponding to each data type;
packaging the sampled data by adopting a preset frame format to obtain a target data frame;
and sending the target data frame to a data center connected with the acquisition equipment through Bluetooth.
In a second aspect, the present application further provides a data transmission method, where the method includes:
receiving a target data frame sent by acquisition equipment connected with a data center through Bluetooth, wherein the target data frame is obtained by packaging sampling data by the acquisition equipment by adopting a preset frame format, and the sampling data is obtained by acquiring the acquisition equipment according to at least one data type corresponding to the data to be acquired and sampling frequency corresponding to each data type;
and de-encapsulating the target data frame according to the preset frame format to obtain the sampling data.
In a third aspect, the present application further provides a data transmission system, where the system includes a data center and at least one acquisition device, where:
the acquisition equipment is used for determining at least one data type required to be acquired by the acquisition equipment and the sampling frequency corresponding to each data type, and acquiring sampling data according to each data type and the sampling frequency corresponding to each data type;
the acquisition equipment is also used for packaging the sampling data by adopting a preset frame format to obtain a target data frame and sending the target data frame to a data center connected with the acquisition equipment through Bluetooth;
the data center is used for receiving the target data frame sent by the acquisition equipment connected with the data center through Bluetooth and de-encapsulating the target data frame according to the preset frame format to obtain the sampling data.
In a fourth aspect, the present application further provides a data transmission apparatus, including:
the device comprises a determining module, a sampling module and a processing module, wherein the determining module is used for determining at least one data type required to be acquired by acquisition equipment and a sampling frequency corresponding to each data type;
the acquisition module is used for acquiring sampling data according to each data type and the sampling frequency corresponding to each data type;
the encapsulation module is used for encapsulating the sampling data by adopting a preset frame format to obtain a target data frame;
and the sending module is used for sending the target data frame to a data center connected with the acquisition equipment through Bluetooth.
In a fifth aspect, the present application further provides a data transmission apparatus, including:
the receiving module is used for receiving a target data frame sent by acquisition equipment connected with a data center through Bluetooth, wherein the target data frame is a data frame obtained by packaging sampling data by the acquisition equipment by adopting a preset frame format, and the sampling data is obtained by the acquisition equipment according to at least one data type required to be acquired by the acquisition equipment and a sampling frequency corresponding to each data type;
and the decapsulation module is used for decapsulating the target data frame according to the preset frame format to obtain the sampling data.
In a sixth aspect, the application further provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing any of the above methods when the processor executes the computer program.
In a seventh aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements any of the above methods.
In an eighth aspect, the present application further provides a computer program product. The computer program product comprising a computer program that when executed by a processor implements any of the above methods.
According to the data transmission method, the data transmission device, the data transmission system, the computer equipment and the storage medium, sampling data can be acquired according to at least one data type required to be acquired by the acquisition equipment and the sampling frequency corresponding to each data type, the sampling data is packaged into a target data frame according to a preset frame format, and the target data frame is sent to a data center connected with the acquisition equipment through Bluetooth. According to the embodiment of the application, the acquisition equipment can acquire data of different data types at different frequencies, so that the acquisition frequency corresponding to the data type which needs to be acquired frequently is set to be higher, and the acquisition frequency corresponding to the data type which does not need to be acquired frequently is set to be lower, so that the data volume of the data type which does not need to be acquired frequently can be reduced, and the data volume sent to a data center through a Bluetooth protocol is further reduced; meanwhile, the sampling data is packaged in a preset data frame format, and more sampling data can be put into one data frame to be sent, so that the frequency of sending the data frame by the acquisition equipment can be reduced. Under the condition that the data volume sent by the acquisition equipment is reduced and the frequency of sending data frames is also reduced, the limitation of the transmission capability of the Bluetooth protocol on the sampling rate of the acquisition equipment can be reduced, so that the Bluetooth protocol can transmit more effective data as far as possible.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention.
The invention will be more clearly understood from the following detailed description, taken with reference to the accompanying drawings, in which:
FIG. 1 is a diagram of an exemplary data transmission method;
FIG. 2 is a flow diagram illustrating a method for data transmission according to one embodiment;
FIG. 3 is a flow chart illustrating step 206 in one embodiment;
FIG. 4 is a flow diagram illustrating a method for data transmission according to one embodiment;
FIG. 5 is a flowchart of step 204 in one embodiment;
FIG. 6 is a flow diagram illustrating a method for data transmission according to one embodiment;
FIG. 7 is a flowchart of step 604 in one embodiment;
FIG. 8 is a flowchart illustrating step 704 in one embodiment;
FIG. 9 is a flow diagram illustrating a method for data transmission according to one embodiment;
FIG. 10 is a flow diagram illustrating a method for data transmission according to one embodiment;
FIG. 11 is a flow chart illustrating a method of data transmission according to one embodiment;
FIG. 12 is a flow chart illustrating a method of data transmission according to one embodiment;
FIG. 13 is a flow diagram illustrating a method for data transmission according to one embodiment;
FIG. 14 is a schematic illustration of a configuration panel in one embodiment;
FIG. 15 is a block diagram showing the construction of a data transmission device according to an embodiment;
FIG. 16 is a block diagram showing the construction of a data transmission device according to an embodiment;
FIG. 17 is a diagram of an internal structure of a computer device in one embodiment.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless it is specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
Embodiments of the invention are operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known computing systems, environments, and/or configurations that may be suitable for use with the computer system/server include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, networked personal computers, minicomputer systems, mainframe computer systems, distributed cloud computing environments that include any of the above, and the like.
The computer system/server may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system/server may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
The data transmission method provided by the embodiment of the application can be applied to the application environment shown in fig. 1. The data center 102 performs bluetooth wireless communication with at least one acquisition device 104 (in fig. 1, one acquisition device 104 is taken as an example, and actually, the number of the acquisition devices 104 is not specifically limited in this embodiment of the present application). The acquisition device 104 acquires sampling data according to at least one data type to be acquired by the acquisition device and a sampling frequency corresponding to each data type, encapsulates the sampling data by adopting a preset frame format to obtain a target data frame, and then sends the target data frame to the acquisition device 104, and after receiving the target data frame, the data center 102 can decapsulate the target data frame by adopting the preset frame format to obtain the sampling data. The data center 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices, and portable wearable devices, and the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart car-mounted devices, and the like. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, and the like. The capture device 104 may be, but is not limited to, a bioelectrical capture device, or the like.
In one embodiment, as shown in fig. 2, a data transmission method is provided, which is described by taking the example that the method is applied to the acquisition device 104 in fig. 1, and includes the following steps:
step 202, determining at least one data type to be acquired by the acquisition device and a sampling frequency corresponding to each data type.
In the embodiment of the application, the acquisition equipment can determine the data types to be acquired by the acquisition equipment and the sampling frequency corresponding to each data type according to the instruction of the data center. Illustratively, the data types may include battery data, bioelectric impedance data, device acceleration data, and the like. For example, the sampling frequency may be different for different data types, for example, the sampling frequency for the bioelectrical data may be 250Hz (i.e., collected 250 times per second), the sampling frequency for the device acceleration data may be 10Hz (i.e., collected 10 times per second), and so on. The embodiment of the present application is not particularly limited to this.
And 204, acquiring sampling data according to each data type and the sampling frequency corresponding to each data type.
In the embodiment of the application, the acquisition equipment can acquire the sampling data according to the data types required to be acquired by the acquisition equipment and the sampling frequency corresponding to each data type. For example, if the acquisition device needs to acquire bioelectricity data and device acceleration data, and the sampling frequency corresponding to the bioelectricity data is 250Hz and the sampling frequency corresponding to the device acceleration data is 10Hz, the acquisition device may acquire the bioelectricity data 250 times per second and the device acceleration data 10 times per second.
And step 206, packaging the sampling data by adopting a preset frame format to obtain a target data frame.
In the embodiment of the application, the preset frame format is a preset bluetooth data frame format. Illustratively, the preset frame format may be as shown in table 1 below:
TABLE 1
Figure 557766DEST_PATH_IMAGE001
The timestamp field carries timestamp information, and the timestamp information can be obtained locally by the acquisition equipment when the target data frame is sent.
The data number field is used to indicate the number of the sample data of the bioelectricity type (including bioelectricity data and bioelectrical impedance data) carried in the target data frame, and for example, the values of the bits in the data number field may be represented as shown in table 2 below:
TABLE 2
Figure 881431DEST_PATH_IMAGE002
Illustratively, if the value of the data number field is 0100, it indicates that the target data frame carries sampled data of 4 bioelectricity types in total.
The data type field is used for representing the data type of the sampling data carried by the target data frame. For example, each value of the data type field may represent a data type of the sample data carried by the target data frame, and thus, after the value of the data type field is read, a specific data type of the sample data in the target data frame may be determined.
The data field is used to carry the sampled data.
And step 208, sending the target data frame to a data center connected with the acquisition equipment through Bluetooth.
In the embodiment of the application, the acquisition device can establish Bluetooth connection with the data center and send the target data frame to the data center connected with the acquisition device through Bluetooth, so that the data center can analyze the target data frame according to a preset frame format to obtain the sampling data.
According to the data transmission method provided by the embodiment of the application, sampling data can be acquired according to at least one data type required to be acquired by the acquisition equipment and the sampling frequency corresponding to each data type, the sampling data is packaged into a target data frame according to a preset frame format, and the target data frame is sent to a data center connected with the acquisition equipment through Bluetooth. According to the embodiment of the application, the acquisition equipment can acquire data of different data types at different frequencies, so that the acquisition frequency corresponding to the data type which needs to be acquired frequently is set to be higher, and the acquisition frequency corresponding to the data type which does not need to be acquired frequently is set to be lower, so that the data volume of the data type which does not need to be acquired frequently can be reduced, and the data volume sent to a data center through a Bluetooth protocol is further reduced; meanwhile, the sampling data is packaged through a preset data frame format, and more sampling data can be put into one data frame to be sent, so that the frequency of sending the data frame by the acquisition equipment can be reduced. Under the condition that the data volume sent by the acquisition equipment is reduced and the frequency of sending data frames is also reduced, the limitation of the transmission capability of the Bluetooth protocol on the sampling rate of the acquisition equipment can be reduced, so that the Bluetooth protocol can transmit more effective data as far as possible.
In one embodiment, the sample data includes first sample data corresponding to a first data type and second sample data corresponding to a second data type, the first data type being a bioelectric type, the second data type being a data type other than the first data type.
In an embodiment of the application, the sample data may include first sample data of a first data type (bio-electricity type) and second sample data of a second data type (other type). For example, the bioelectric type may include electroencephalogram data, electroencephalogram impedance data, electrocardiograph impedance data, electromyogram impedance data, and the like, and the other types may include data types not belonging to the bioelectric type, such as battery-related data, blood oxygen saturation data, triaxial acceleration data, and posture data. After the acquisition device acquires the first sampling data of the bioelectricity type and the second sampling data of other types, the acquisition device may encapsulate the sampling data according to a preset frame format to obtain a target data frame, and transmit the target data frame to the data center.
The data transmission method provided by the embodiment of the application can acquire the first sampling data of the first data type and the second sampling data of the second data type, and the acquisition equipment can acquire data of different data types at different frequencies, so that the acquisition frequency corresponding to the data type needing frequent acquisition is set to be higher, the acquisition frequency corresponding to the data type needing frequent acquisition is set to be lower, the data volume of the data type needing no frequent acquisition can be reduced, and the data volume sent to a data center through a Bluetooth protocol is further reduced.
In an embodiment, as shown in fig. 3, in step 206, performing encapsulation processing on the sample data by using a preset frame format to obtain a target data frame includes:
step 302, when the first sampling data reaches a preset number, setting a data number field in the target data frame according to the preset number, and setting a data type field in the target data frame according to the data type of each sampling data.
Step 304, setting a data field of the target data frame according to the preset number of first sample data and the target second sample data corresponding to each second data type, wherein for any second data type, the target second sample data corresponding to the second data type is the second sample data of the second data type acquired last time in the acquisition period of the preset number of first sample data.
In this embodiment of the application, the time required for acquiring a preset number of first sample data may be taken as a period, the first sample data and the second sample data are periodically acquired, and the first sample data and the target second sample data acquired in this period are encapsulated into one target data frame. The preset number is a preset value, and the value can be determined by those skilled in the art according to actual needs. For example, when the target data frame needs to carry more sampling data, the preset number may be set to be larger, and when the target data frame does not need to carry more sampling data, the preset number may be set to be smaller.
When the first sampling data reaches the preset number, the data number field in the target data frame may be set according to the preset number, and the data type field in the target data frame may be set according to the data type of the sampling data acquired in the present period. For example, if the preset number is 10, the data types of the sampling data acquired in this period are electrocardiographic data, battery-related data, and blood oxygen saturation data, respectively, the value of the first 4 bits of the data number field in the target data frame may be set to 1010, and the value of the data type field in the target data frame is correspondingly set to a value that can represent that the target data frame carries electrocardiographic data, battery-related data, and blood oxygen saturation data.
The acquisition device may acquire a plurality of second sample data during a period. In this case, the acquiring device may use the second sample data acquired last time in the period as the target second sample data, that is, the target data frame will only carry the second sample data acquired last time in the period by the acquiring device. The value of the second sampling data is not changed greatly in one period, so that the data center does not need to update the value of the second sampling data frequently, the acquisition equipment does not need to send all the acquired second sampling data to the data center, and the target data frame only needs to carry the second sampling data acquired last time in one period. If the value of the second sampling data is required to be updated at a high frequency, the method can be implemented by reducing the preset number, that is, by reducing the length of one period.
For example, taking the first data type including electrocardiographic data, the second data type including battery-related data and blood oxygen saturation data as an example, if the sampling frequency corresponding to the electrocardiographic data is 250Hz, the preset number is 10, the sampling frequency corresponding to the battery-related data is 25Hz, and the sampling frequency corresponding to the blood oxygen saturation data is 50Hz, during the period of acquiring 10 electrocardiographic data, the acquisition device will acquire 1 battery-related data and 2 blood oxygen saturation data. At this time, the target second sampling data corresponding to the battery-related data is the battery-related data acquired in the period, and the target second sampling data corresponding to the blood oxygen saturation data is the blood oxygen saturation data acquired for the second time in the period. Furthermore, the battery related data, the blood oxygen saturation data collected for the second time and 10 pieces of electrocardio data can be packaged into a target data frame to be transmitted.
According to the data transmission method provided by the embodiment of the application, the data field of the target data frame can be set according to the preset number of first sampling data and the target second sampling data corresponding to each second data type acquired during the period of acquiring the preset number of first sampling data. In the embodiment of the application, only the target second sampling data is added into the target data frame, that is, for any second data type, each target data frame carries at most one second sampling data of the second data type, so that the data volume sent to the data center can be further reduced.
In one embodiment, in step 302, setting a data type field in the target data frame according to a data type of each sample data includes:
and aiming at the sampling data of any data type, adjusting the bit mark of the data type in the data type field in the target data frame from a first identifier to a second identifier, wherein the first identifier is used for representing the sampling data which does not carry the data type in the target data frame, and the second identifier is used for representing the sampling data which carries the data type in the target data frame.
In the embodiment of the application, whether the target data frame carries the sampling data of a certain data type or not can be represented by the bit flag. For example, the bit flag may be a value of a bit corresponding to each data type in the data type field. For any data type, the data type can be made to correspond to a specific bit in the data type field, so that whether the sampling data of the data type is carried in the target data frame or not can be known according to the value of the bit.
For example, in the data type field, the bits corresponding to each data type may be as shown in table 3 below:
TABLE 3
Figure 192327DEST_PATH_IMAGE003
For any bit, the first identifier may be that the bit takes a value of 0, and the second identifier may be that the bit takes a value of 1. For example, when the target data frame carries electrocardiographic data, battery related data, and blood oxygen saturation data, the values of the 0 th bit, the 3 rd bit, and the 7 th bit may be adjusted from 0 to 1, that is, the value of the first 10 bits of the data type field is 1001000100.
It should be noted that, for any bit, the first identifier may also be that the bit takes a value of 1, and the second identifier may also be that the bit takes a value of 0. The embodiment of the present application is not particularly limited to this.
According to the data transmission method provided by the embodiment of the application, the bit identifier of each data type in the data type field of the target data frame can be adjusted according to the data type carried in the target data frame so as to indicate which data types of the sampled data are carried in the target data frame, so that the data center can quickly identify which data types of the sampled data are carried in the target data frame, and the data center can conveniently acquire the sampled data from the target data frame.
In one embodiment, in step 304, setting a data field of the target data frame according to a preset number of first sample data and target second sample data corresponding to each second data type includes:
and adding a preset number of first sample data and target second sample data corresponding to each second data type to the data field of the target data frame according to the sequence of the bit marks of the first data type and the bit marks of the second data types in the data type field.
In the embodiment of the application, a preset number of first sampling data and target second sampling data can be sequentially added to the data field of the target data frame, so that the data in the data field can be sequentially analyzed after the data center receives the target data frame, and the sampling data of each data type can be obtained.
For example, taking the order of the bit flag of each first data type and the bit flag of each second data type in the data type field, which is the order in table 3 above as an example, when the target data frame carries 10 pieces of electrocardiographic data, 1 piece of battery-related data, and 1 piece of blood oxygen saturation data, each piece of sampling data may be added to the data field of the target data frame in the following order: (1) Adding battery-related data to a data field (2) of a target data frame, and then sequentially adding 10 pieces of electrocardiogram data to the data field of the target data frame according to a sampling sequence after the battery-related data; (3) The oximetry data is added to the data field of the target data frame immediately after the last electrocardiographic data.
It should be noted that, since the first sample data is more important, the first sample data may be added to the data field of the target data frame first, and then the target second sample data corresponding to each second data type may be added to the data field of the target data frame according to the sequence of the bit flag of each second data type in the data type field. That is, if the target data frame carries 10 pieces of electrocardiographic data, 1 piece of battery-related data, and 1 piece of blood oxygen saturation data, the sampling data may be added to the data field of the target data frame in the following order: (1) Adding the 10 pieces of electrocardiogram data to a data field of a target data frame in sequence according to a sampling sequence; (2) Adding the battery-related data to the data field of the target data frame immediately after the last electrocardiogram data; (3) The blood oxygen saturation data is added to the data field of the target data frame immediately after the battery related data. This is not particularly limited in the embodiments of the present application.
Since the data length of each data type is fixed, the sample data of each data type can be closely arranged in the data field. For example, assuming that the length of the battery-related data is fixed to 4 bytes, the length of the electrocardiographic data is fixed to 24 bytes, and the length of the blood oxygen saturation data is fixed to 1 byte, in the data field, the data of 0 th byte to 239 th byte represents 10 electrocardiographic data, the data of 240 th byte to 243 th byte represents the battery-related data, and the data of 244 th byte represents the blood oxygen saturation data.
According to the data transmission method provided by the embodiment of the application, whether the target data frame carries the sampling data of a certain data type or not can be represented by the bit marks, so that when the target data frame carries the sampling data of a plurality of data types, the data center can also quickly identify the sampling data of each data type according to the sequence of the bit marks in the data type field, the sampling data of the plurality of data types can be collected and sent in one target data frame, and the frequency of sending the target data frame is reduced.
In one embodiment, in step 304, after the data field of the target data frame is set according to the preset number of first sample data and the target second sample data corresponding to each second data type, the method further includes:
and setting a frame start identifier at the start position of the target data frame, and setting a frame length field in the target data frame according to the current length of the target data frame.
And/or acquiring the timestamp information of the current moment, and setting the timestamp field of the target data frame according to the timestamp information.
And/or setting a data positioning identification field in the target data frame according to the position of the target first sampling data in the first sampling data, wherein the target first sampling data is data subjected to marking operation in the first sampling data.
In the embodiment of the present application, after the sample data is added to the data field of the target data frame, information such as a frame start identifier, a frame length field, a timestamp field, and a data positioning identifier field of the target data frame may be continuously set.
The frame start identifier may be a fixed character, and is used to represent that data from the frame start identifier to the next frame start identifier is a data frame. Illustratively, the frame start identification may be ">".
The frame length field carries the total length information of the data frame, and after the sampling data is added to the data field of the target data frame, the total length of the target data frame can be determined.
The timestamp field carries timestamp information, the timestamp information is a Greenwich mean time zone absolute time millisecond level timestamp, and the timestamp information can be obtained locally from acquisition equipment when a target data frame is sent.
The data location identification field carries position information of the specially marked first sample data (i.e. the target first sample data) in the first sample data. For example, the target first sample data may be first sample data generated when a person under test wearing the acquisition device performs a specific action. When the tested person performs a specific action (such as blinking, squatting, etc.), the acquisition device can be instructed to use the sampling data as the target first sampling data by performing corresponding setting operation on the acquisition device. The acquiring device may further record a ranking position of the target first sample data in the first sample data (for example, if 2 pieces of first sample data to be sent are still stored in the acquiring device at this time, the target first sample data is the 3 rd first sample data), so as to determine a position of the target first sample data in the first sample data.
For example, when the first sample data needs to be specially marked, the format of the target data frame may be as shown in table 4 below:
TABLE 4
Figure 991131DEST_PATH_IMAGE004
The specific format of the data location identification field may be as shown in table 5 below:
TABLE 5
Figure 336662DEST_PATH_IMAGE005
For example, if the target first sample data is the 3 rd data in the first sample data, the value of the data location identification field may be set to 0011.
It should be noted that the value of the data location identification field should be less than or equal to the value of the data number field. Illustratively, if the value of the data number field is 0100, it indicates that the target data frame carries 4 pieces of first sample data in total, and the value of the data location identification field should be limited to 0100, 0011, 0010, 0001, and 0000. If the 3 rd first sample data in the target data frame is the target first sample data, the value of the data location identification field may be set to 0011. If the target data frame does not contain the target first sample data, the value of the data location identification field may be set to 0000.
The data transmission method provided by the embodiment of the application can be used for setting the frame start identifier, the frame length field, the timestamp field and the data positioning identifier field of the target data frame. The data center can rapidly divide the target data frame through the total length information of the target data frame carried by the frame starting identifier and the frame length field, the data center can judge the sending sequence of the target data frame through the timestamp information carried by the timestamp field, the data center can also judge whether the target data frame loses packets (for example, the packet loss occurs if the target data frame with certain specific timestamp information is lacked), the position information of the target first sampling data carried by the data locating identifier field in the first sampling data can meet the requirement for marking certain specific first sampling data.
In one embodiment, in step 202, determining at least one data type that needs to be acquired by the acquisition device and a sampling frequency corresponding to each data type includes:
if the acquisition equipment receives an instruction frame sent by the data center within a preset time length after the Bluetooth connection with the data center is established, at least one data type required to be acquired by the acquisition equipment and the sampling frequency corresponding to each data type are acquired from the instruction frame.
Or, if the acquisition equipment does not receive the instruction frame sent by the data center within the preset time length, the default data type and the default sampling frequency corresponding to the default data type are used as at least one data type to be acquired by the acquisition equipment and the sampling frequency corresponding to each data type.
In the embodiment of the present application, the preset duration is used to control the waiting time of the acquisition device after establishing the bluetooth connection with the data center, and the specific duration may be set by a person skilled in the art according to actual needs, such as 5 seconds, 10 seconds, and the like. Within a preset time length, if the acquisition equipment receives an instruction frame sent by a data center, at least one data type required to be acquired by the acquisition equipment and a sampling frequency corresponding to each data type can be acquired from the instruction frame; if the acquisition equipment does not receive the instruction frame sent by the data center, the acquisition equipment can start to acquire the sampling data according to the default data type and the default sampling frequency corresponding to the default data type, and send the data frame to the data center according to the sampling data, so that the acquisition equipment can normally sample the data and send the sampling data to the data center even if the data center does not send the instruction frame to the acquisition equipment.
The instruction frame comprises at least one data type required to be acquired by the acquisition equipment and a sampling frequency corresponding to each data type. Illustratively, the format may be as shown in table 6 below:
TABLE 6
Figure 565649DEST_PATH_IMAGE006
The frame token is the equipment identification of the acquisition equipment for receiving the instruction frame; the information carried in the device control field can be used for indicating the acquisition device to perform specific operation; the information carried in the channel control field may be used to indicate whether the acquisition device has acquired data via each acquisition channel of the acquisition device.
The information carried in the data requirement field is used for indicating the type of data required to be acquired by the acquisition equipment. For example, when constructing the instruction frame, whether the acquisition device needs to acquire the sampling data of the corresponding data type may be characterized by a bit flag. For example, the bit flag may be a value of a bit corresponding to each data type in the data requirement field. For any data type, the data type can be made to correspond to a specific bit in the data requirement field, so that the acquisition device can know whether the sampling data of the data type needs to be acquired or not according to the value of the bit.
For example, in the data requirement field, the bits corresponding to each data type may be as shown in table 3 above. It should be noted that table 3 above is only an example, and actually, in the data requirement field of the instruction frame, the bit corresponding to each data type may be different from the bit corresponding to each data type in the data type field of the data frame, which is not specifically limited in this embodiment of the present application.
The information carried in the default parameter field may be used to indicate a default sampling rate of each data type, that is, if a sampling frequency corresponding to a certain data type is not configured for the data type, the acquisition device acquires the sampling data of the data type according to the default sampling rate, and may further include an identifier indicating whether the acquisition device needs to specially mark the first sampling data, and the like. For example, the values of the bits of the default parameter field may be represented as the following table 7:
TABLE 7
Figure 363841DEST_PATH_IMAGE007
Illustratively, when the first 15 bits of the default parameter field take the value 000000011111010, the default sampling rate is 250Hz.
The information carried in the optional parameter field may be used to configure the sampling rate of each data type, and may also be used to indicate the data type that the acquisition device needs to additionally acquire in addition to the data types listed in table 3 above, and the format requirement that the data frame sent by the acquisition device should comply with, and so on. Illustratively, the format of the optional parameter field may be as shown in table 8 below:
TABLE 8
Figure 703686DEST_PATH_IMAGE008
In table 8, the data in parentheses are collectively referred to as a group (that is, the parameter corresponds to a group of data type, parameter length, parameter parsing method, and parameter value), and the number of repetitions is a number of times. The value of the data type field corresponding to the parameter needs to correspond to the data type corresponding to each bit in the data requirement field, for example, the bit corresponding to the battery related data in the data requirement field is 0, and when the data type corresponding to the parameter is the battery related data, the value of the data type field corresponding to the parameter needs to be 0000; the corresponding bit of the electromyographic data in the data requirement field is 5, and when the data type corresponding to the parameter is the electromyographic data, the value of the data type field corresponding to the parameter should be 0101.
The parameter type field is used to indicate the meaning of the parameter. The values of the same parameter type field may refer to different meanings for different data types. For example, for the first data type, a value of 0x01 in the parameter type field may be used to indicate a preset number of corresponding first sample data in the data frame. When the value of the parameter value field is 10, the value indicates that each data frame should carry 2 corresponding first sampling data; for battery related data, a value of 0x01 for the parameter type field may be used to indicate a sampling frequency of the battery related data. At this time, when the value of the parameter field is 10, the value indicates that the sampling frequency of the battery related data should be 2Hz.
It should be noted that, during the period when the acquisition device sends the data frame to the data center, if the acquisition device receives a new instruction frame sent by the data center, the acquisition device may obtain, from the new instruction frame, at least one data type that the acquisition device needs to acquire and a sampling frequency corresponding to each data type, that is, send the data frame to the data center according to an instruction of the new instruction frame.
Illustratively, if the acquisition device first receives an instruction frame a sent by the data center, and the instruction of the instruction frame a is to acquire electrocardiographic data at a frequency of 250Hz. During the period that the acquisition equipment continuously transmits the electrocardiogram data acquired at the frequency of 250Hz to the data center according to the instruction of the instruction frame A, if the acquisition equipment receives a new instruction frame B and the instruction of the new instruction frame B is to acquire the electrocardiogram data at the frequency of 300Hz, the acquisition equipment will change to acquire the electrocardiogram data at the frequency of 300Hz according to the new instruction frame B and transmit the acquired electrocardiogram data to the data center.
Within the preset time length, when an instruction frame sent by the data center is not received, the default data type and the default sampling frequency corresponding to the default data type can be used as at least one data type to be acquired by the acquisition equipment and the sampling frequency corresponding to each data type. The default data type and the default sampling frequency corresponding to the default data type may be pre-stored in a database of the acquisition device, and when the acquisition device does not receive an instruction frame sent by the data center within a preset time period, the information may be acquired from the database, so as to acquire the sampling data according to the information.
According to the data transmission method provided by the embodiment of the application, the data type required to be acquired by the acquisition equipment and the sampling frequency corresponding to each data type can be acquired according to the information in the instruction frame, or the default data type and the default sampling frequency corresponding to the default data type can be used as the data type required to be acquired by the acquisition equipment and the sampling frequency corresponding to each data type under the condition that the instruction frame is not received within the preset time length. According to the embodiment of the application, even if the acquisition equipment does not receive the instruction frame sent by the data center, the acquisition equipment can normally acquire and send the sampling data according to the default data type and the default sampling frequency corresponding to the default data type, so that the influence of the non-received instruction frame on the acquisition equipment can be reduced.
In one embodiment, the method further comprises:
the method comprises the steps that a broadcast frame is sent to a data center within a preset time length after Bluetooth connection between acquisition equipment and the data center is established, the broadcast frame comprises an equipment token field and a data information field, the equipment token field comprises equipment identification of the acquisition equipment, and the data information field comprises data types which can be acquired by the acquisition equipment, so that after the data center receives the broadcast frame, a corresponding instruction frame is constructed according to the data types which can be acquired by the acquisition equipment, and the instruction frame is sent to the acquisition equipment according to the equipment identification of the acquisition equipment.
In the embodiment of the application, after the acquisition device establishes the bluetooth connection with the data center, the acquisition device may send the broadcast frame to the data center within a preset duration, for example, the preset duration may be 10 seconds, and in the preset duration, the broadcast frame may be sent 1 time per second, that is, the broadcast frame is sent 10 times within the preset duration. The preset time period can be determined by those skilled in the art according to actual needs. The broadcast frame includes a device identifier of the acquisition device and a data type that the acquisition device can acquire, and for example, the format of the broadcast frame may be as shown in table 9 below:
TABLE 9
Figure 903723DEST_PATH_IMAGE009
The device token field comprises a device identifier of the acquisition device, and the data information field comprises a data type which can be acquired by the acquisition device. For example, when constructing a broadcast frame, it may be characterized by a bit flag whether the acquisition device is capable of acquiring the sample data of the corresponding data type. For example, the bit flag may be a value of a bit corresponding to each data type in the data information field. For any data type, the data type can be made to correspond to a specific bit in the data information field, so that the data center can know whether the acquisition equipment can acquire the sampling data of the data type according to the value of the bit.
For example, in the data information field, the bits corresponding to each data type may be as shown in table 3 above. It should be noted that table 3 above is only an example, and actually, in the data information field of the broadcast frame, bits corresponding to each data type may be different from bits corresponding to each data type in the data type field of the data frame, which is not specifically limited in this embodiment of the present application.
After receiving the broadcast frame, the data center may match the corresponding instruction frame according to the data type that the acquisition device can acquire, for example, the data center may preset the data type required by this sampling and the sampling frequency corresponding to each data type. For example, the data center may preset the battery related data, the electrocardiographic data, the blood oxygen saturation data, and the triaxial acceleration data required for the current sampling, where the sampling frequency corresponding to the electrocardiographic data is 250Hz, the sampling frequency corresponding to the triaxial acceleration data is 10Hz, and the sampling frequency corresponding to the blood oxygen saturation data is 200Hz (that is, the sampling frequency corresponding to the battery related data is not set). When the data center receives the broadcast frame, and the broadcast frame indicates that the acquisition device can acquire battery related data, electrocardiographic data and triaxial acceleration data, because the acquisition device cannot acquire oxyhemoglobin saturation data, at this time, the instruction frame does not need to include an identifier of oxyhemoglobin saturation data to be acquired and a sampling frequency corresponding to oxyhemoglobin saturation, but only includes an identifier of a data type which can be acquired by the acquisition device, that is, an identifier of battery related data, electrocardiographic data and triaxial acceleration data to be acquired, and according to a sampling frequency corresponding to each preset data type, a sampling frequency corresponding to the battery related data is determined (not preset, so that no special indication is made in the instruction frame, the acquisition device only needs to sample according to a default sampling rate), a sampling frequency corresponding to the electrocardiographic data (preset to 250 Hz) and a sampling frequency corresponding to the triaxial acceleration (preset to 10 Hz).
After the corresponding instruction frame is obtained through matching, the data center can send the instruction frame to the acquisition equipment according to the equipment identification of the acquisition equipment.
The data transmission method provided by the embodiment of the application can send the broadcast frame to the data center, wherein the broadcast frame comprises the equipment identifier of the acquisition equipment and the data type which can be acquired by the acquisition equipment, so that the data center can match and send the corresponding instruction frame according to the broadcast frame. According to the embodiment of the application, the instruction frame only comprises the data type which can be acquired by the acquisition equipment and the sampling frequency corresponding to the data type, so that the structure of the instruction frame can be simplified, the size of the instruction frame is reduced, and the transmission speed of the instruction frame is increased.
In one embodiment, as shown in fig. 4, the method further includes:
and 402, acquiring channel identifiers corresponding to the acquisition channels from the channel control field of the instruction frame.
Step 404, for any acquisition channel, acquiring sampling data through the acquisition channel under the condition that the channel identifier corresponding to the acquisition channel is the channel opening identifier.
Step 406, or, under the condition that the channel identifier corresponding to the acquisition channel is the channel closing identifier, the sampling data is not acquired through the acquisition channel.
In the embodiment of the present application, whether sampling data needs to be acquired through the acquisition channel of the acquisition device may be determined according to the channel identifier corresponding to each acquisition channel included in the channel control field of the instruction frame. For example, for an 8-channel acquisition device, the length of the channel control field may be set to 8 bits, and the 0 th bit to the 7 th bit may correspond to the 1 st channel to the 8 th channel, respectively. For any bit, a bit value of 1 may be a channel open flag, and a bit value of 0 may be a channel close flag, for example, when a channel control field value is 00000001, it indicates that sampling data is collected only through the 8 th channel.
It should be noted that the value of the bit is 1, which may also be a channel closing identifier, and the value of the bit is 0, which may also be a channel opening identifier, and this is not specifically limited in this embodiment of the present application.
According to the data transmission method provided by the embodiment of the application, whether sampling data needs to be acquired through a certain channel of the acquisition equipment can be determined through the channel control field in the instruction frame, so that the requirement that the sampling data only needs to be acquired through part of channels in the acquisition equipment in certain scenes can be met.
In one embodiment, as shown in fig. 5, in step 204, collecting sampling data according to each data type and the sampling frequency corresponding to each data type includes:
step 502, a device control instruction is obtained from a device control field of an instruction frame.
And step 504, under the condition that the equipment control instruction is an equipment starting instruction, acquiring sampling data according to each data type and the sampling frequency corresponding to each data type.
Step 506, or stopping collecting the sampling data under the condition that the device control instruction is a device closing instruction.
Step 508, or, in case that the device control instruction is a device restart instruction, restarting the acquisition device.
In the embodiment of the application, the device control instruction can be obtained from the device control field of the instruction frame to determine the operation required to be performed by the acquisition device. For example: a device control instruction value of 0x00 may indicate no operation (0 x00 is a default value), a device control instruction value of 0x01 may be a device start instruction, a device control instruction value of 0x02 may be a device stop instruction, a device control instruction value of 0x03 may be a device restart instruction, and the like.
According to the data transmission method provided by the embodiment of the application, the operation required to be performed by the acquisition equipment can be determined through the equipment control field in the instruction frame, so that the requirement that the acquisition equipment needs to be controlled through the data center in some scenes can be met.
In one embodiment, as shown in fig. 6, a data transmission method is provided, which is exemplified by the method applied to the data center 102 in fig. 1, and includes the following steps:
step 602, receiving a target data frame sent by an acquisition device connected to a data center by bluetooth, where the target data frame is a data frame obtained by the acquisition device by encapsulating sampling data in a preset frame format, and the sampling data is data obtained by the acquisition device according to at least one data type corresponding to data to be acquired and a sampling frequency corresponding to each data type.
In the embodiment of the application, the data center can receive the target data frame sent by the acquisition equipment connected with the data center through Bluetooth. Wherein the number of the acquisition devices can be one or more. The specific format of the target data frame may refer to the related description in the foregoing embodiments, and the description of the embodiments of the present application is omitted here.
And step 604, de-encapsulating the target data frame according to a preset frame format to obtain sampling data.
In the embodiment of the application, the target data frame may be decapsulated according to a preset frame format used when the target data frame is encapsulated, so as to obtain the sample data. The specific format of the preset frame format may refer to the related description in the foregoing embodiments, and details are not repeated herein in this embodiment of the application. For example, each data type carried in the target data frame may be obtained from a data type field in the target data frame, and the number of the first sample data carried in the target data frame may also be obtained from a data number field in the target data frame, so that the first sample data and the target second sample data of each second data type are read from the data field in the target data frame.
The data transmission method provided by the embodiment of the application can receive the target data frame sent by the acquisition equipment connected with the data center through the Bluetooth, and then de-encapsulation processing is carried out on the target data frame according to the preset frame format to obtain the sampling data. The target data frame is data acquired according to at least one data type which is acquired by the acquisition equipment according to the acquisition equipment and the sampling frequency corresponding to each data type, so that the data volume of the data types which do not need to be acquired frequently can be reduced, and the data volume sent to the data center through the Bluetooth protocol is further reduced; meanwhile, the sampling data is packaged through a preset data frame format, and more sampling data can be put into one data frame to be sent, so that the frequency of sending the data frame by the acquisition equipment can be reduced. Under the condition that the data volume sent by the acquisition equipment is reduced and the frequency of sending data frames is also reduced, the limitation of the transmission capability of the Bluetooth protocol on the sampling rate of the acquisition equipment can be reduced, so that the Bluetooth protocol can transmit more effective data as far as possible.
In an embodiment, as shown in fig. 7, the sampling data includes first sampling data corresponding to a first data type and second sampling data corresponding to a second data type, where the first data type is a bio-electric type, and the second data type is a data type other than the first data type, in step 604, the decapsulating the target data frame according to the preset frame format to obtain the sampling data, including:
step 702, analyzing the data number field and the data type field of the target data frame to obtain the number of the first sampling data, the data type of the first sampling data carried in the target data frame, and the data type of the second sampling data carried in the target data frame.
Step 704, analyzing the data field of the target data frame according to the number of the first sample data, the data type of the first sample data carried in the target data frame, and the data type of the second sample data carried in the target data frame, so as to obtain the first sample data and the second sample data.
In the embodiment of the application, the number of the first sampling data, the data type corresponding to the first sampling data and the data type corresponding to the second sampling data can be obtained from the data number field and the data type field of the target data frame, and then the data field of the target data frame can be analyzed according to the number of the first sampling data, the data type corresponding to the first sampling data and the data type corresponding to the second sampling data to obtain the first sampling data and the second sampling data. For example, since the order of arrangement of the sample data of each data type is fixed and the length of the sample data of each data type is also fixed, the fixed length data of a fixed position in the data field can be used as the sample data of a specific data type.
According to the data transmission method provided by the embodiment of the application, the number of the first sampling data, the data type corresponding to the first sampling data and the data type corresponding to the second sampling data can be obtained from the data number field and the data type field of the target data frame, and the data field of the target data frame can be analyzed according to the number of the first sampling data, the data type corresponding to the first sampling data and the data type corresponding to the second sampling data. Because the target data frame is data acquired according to at least one data type required to be acquired by the acquisition equipment and the sampling frequency corresponding to each data type, the acquisition frequency corresponding to the data type required to be acquired frequently can be set to be higher, and the acquisition frequency corresponding to the data type not required to be acquired frequently can be set to be lower, so that the data volume of the data type not required to be acquired frequently can be reduced, and the data volume sent to the data center through a Bluetooth protocol is further reduced.
In an embodiment, as shown in fig. 8, in step 704, parsing the data field of the target data frame according to the number of the first sample data, the data type of the first sample data carried in the target data frame, and the data type of the second sample data carried in the target data frame to obtain the first sample data and the second sample data includes:
step 802, determining the length of the first sample data according to the data type of the first sample data.
And 804, according to the length of the first sampling data, sequentially determining data with the length of bytes of the first sampling data as the first sampling data from the initial position of the data field in the target data frame until the number of the acquired first sampling data reaches the number of the first sampling data.
Step 806, sequentially obtaining the second sample data from the data field according to the sequence of the bit flag of each second data type in the data type field and the length corresponding to the data type of each second sample data.
In the embodiment of the present application, for any second data type, the second sample data is the second sample data (target second sample data) of the second data type that is acquired last time during the period of acquiring the number of first sample data of the first sample data. For a method for constructing a target data frame according to first sample data and target second sample data, reference may be made to the relevant description of the foregoing embodiments, and details of the embodiments of the present application are not repeated herein. The data field in the target data frame may be parsed according to the length of the first sample data, the number of the first sample data, the order of the bit flags of each second data type in the data type field, and the length corresponding to the data type of the second sample data, so as to obtain the first sample data and each target second sample data.
For example, if the target data frame carries electrocardiographic data, battery-related data, and blood oxygen saturation data, and the number of the first sampling data is 10, the sequence of the battery-related data and the blood oxygen saturation data in the data type field is as shown in table 3 above, while the length of the electrocardiographic data is fixed to 24 bytes, the length of the battery-related data is fixed to 4 bytes, and the length of the blood oxygen saturation data is fixed to 1 byte, the data from the 0 th byte to the 23 th byte in the data field may be determined as the 1 st electrocardiographic data, and then the data from the 24 th byte to the 47 th byte may be determined as the 2 nd electrocardiographic data \8230, and so on until the data from the 216 th byte to the 239 th byte is determined as the 10 th electrocardiographic data, and the number of the electrocardiographic data reaches the number of the first sampling data. After that, since the battery-related data is arranged before the blood oxygen saturation data, the data of the 240 th byte to the 243 th byte may be determined as the battery-related data, and the data of the 244 th byte may be determined as the blood oxygen saturation data.
According to the data transmission method provided by the embodiment of the application, the first sample data and each target second sample data can be obtained by analyzing the data field in the target data frame according to the length of the first sample data, the number of the first sample data, the sequence of the bit marks of each second data type in the data type field and the length corresponding to the data type of the second sample data. The target data frames are data constructed by the acquisition equipment according to the preset number of first sampling data and the target second sampling data, namely, for any second data type, each target data frame carries at most one second sampling data of the second data type, so that the data volume sent to the data center can be further reduced.
In an embodiment, as shown in fig. 9, before performing a decapsulation process on the target data frame according to a preset frame format to obtain sample data in step 604, the method further includes:
step 902, obtaining the length of the target data frame from the frame length field of the target data frame.
Step 904, determining the theoretical starting position of the next data frame according to the frame starting identifier of the target data frame and the length of the target data frame.
Step 906, when the theoretical starting position of the next data frame is the frame start identifier, the target data frame is retained.
Step 908, or, when the theoretical starting position of the next data frame is not the frame start identifier, discarding the target data frame.
In the embodiment of the present application, whether the target data frame should be reserved may be determined according to the length of the target data frame and the frame start identifier of the target data frame. Since the data between the two frame start identifiers should be a data frame, after a frame start identifier, the data passing through the length of the target data frame should be the next frame start identifier, i.e. the theoretical start position of the next data frame. If the theoretical starting position of the next target data frame is the frame identifier, it indicates that no error occurs in the target data frame during transmission, and the target data frame can be reserved. If the theoretical starting position of the next target data frame is not the frame identifier, it indicates that the target data frame may have an error in transmission, and at this time, the target data frame may be discarded.
According to the data transmission method provided by the embodiment of the application, whether the target data frame should be reserved or not can be judged according to the length of the target data frame and the frame start identification of the target data frame, so that the illegal data frame can be quickly segmented and rejected, and the speed of reading the data frame by a data center is increased.
In one embodiment, as shown in fig. 10, the method further includes:
step 1002, obtaining timestamp information of the target data frame from the timestamp field of the target data frame.
And step 1004, determining the sequence of sending the data frames by the acquisition equipment according to the timestamp information of the data frames, wherein the data frames comprise target data frames and historical target data frames.
Step 1006, taking the sequence of sending each data frame by the acquisition device as the sampling sequence of the sampling data contained in each data frame.
In this embodiment of the present application, the sending sequence of each data frame may be determined according to timestamp information carried in a timestamp field of each data frame, so as to determine a sampling sequence of sampling data carried by each data frame. Since the time stamp information is generated when the data frames are transmitted, the order in which the data frames are transmitted by the acquisition device can be judged according to the time stamp information. And because the acquisition equipment can send a data frame after acquiring a certain amount of sampling data, the sampling sequence among the sampling data contained in each data frame can be judged according to the sequence of sending the data frame by the acquisition equipment.
The data transmission method provided by the embodiment of the application can determine the sending sequence of each data frame according to the timestamp information carried in the timestamp field of each data frame so as to judge the sampling sequence among the sampling data carried by each data frame, and therefore, the data transmission method can be applied to scenes in which the sampling data needs to be analyzed according to the sampling sequence.
In an embodiment, as shown in fig. 11, the first sample data includes target first sample data, and the target first sample data is data of the first sample data, where the marking operation is performed, and the method further includes:
step 1102, obtaining the position of the target first sample data in the first sample data from the data positioning identification field of the target data frame.
And 1104, acquiring target first sample data from the first sample data according to the position of the target first sample data in the first sample data.
In the embodiment of the application, the target first sample data can be obtained from the first sample data according to the value of the data positioning identification field of the target data frame. For example, if the value of the data location identification field of the target data frame is 0011, it indicates that the target first sample data is the 3 rd first sample data, and therefore the read 3 rd first sample data may be used as the target first sample data.
According to the data transmission method provided by the embodiment of the application, the target first sampling data can be obtained from the first sampling data according to the position of the target first sampling data in the first sampling data, so that the requirement for marking certain specific first sampling data can be met.
In one embodiment, as shown in fig. 12, before receiving a target data frame sent by a collection device connected to a data center via bluetooth in step 602, the method further includes:
and sending an instruction frame to the acquisition equipment, wherein the instruction frame comprises a data requirement field and a sampling frequency field, the data requirement field comprises at least one data type required to be acquired by the acquisition equipment, and the sampling frequency field comprises sampling frequency corresponding to each data type. Alternatively, the first and second liquid crystal display panels may be,
step 1202, receiving a broadcast frame sent by an acquisition device, where the broadcast frame includes a device token field and a data information field.
And 1204, acquiring the data types which can be acquired by the acquisition equipment from the data information field, and matching at least one data type which needs to be acquired by the acquisition equipment from the data types of the data to be sampled according to the data types which can be acquired by the acquisition equipment.
Step 1206, setting a data requirement field in the instruction frame according to at least one data type to be acquired by the acquisition device, and setting a sampling frequency field in the instruction frame according to a sampling frequency corresponding to each data type.
And step 1208, acquiring the device identifier of the acquisition device from the device token field, and sending an instruction frame to the acquisition device according to the device identifier of the acquisition device.
In the embodiment of the application, the data to be sampled is all sampled data which needs to be acquired by one or more acquisition devices in the data center. The data center can directly send the instruction frame to each acquisition device, and can also receive the broadcast frame sent by each acquisition device so as to send the instruction frame to each acquisition device according to the broadcast frame. For the specific structure of the broadcast frame, reference may be made to the related description in the foregoing embodiments, and details of the embodiments of the present application are not repeated herein.
For example, if the data types that can be acquired by a certain acquisition device are battery-related data, electrocardiographic data, and attitude data, and the data types of the data to be sampled are battery-related data, electroencephalogram data, electrocardiographic data, and triaxial acceleration data, the data types that the acquisition device needs to acquire may be battery-related data and electrocardiographic data, and the data center may further construct an instruction frame according to the sampling frequency corresponding to the battery-related data and the sampling frequency corresponding to the electrocardiographic data, and send the instruction frame to the acquisition device according to the device identifier of the acquisition device. The specific structure of the instruction data and the method for constructing the instruction frame may refer to the related description of the foregoing embodiments, and are not described herein again in this embodiment of the application.
The data transmission method provided by the embodiment of the application can directly send the instruction frame and also can receive the broadcast frame sent by the acquisition equipment so as to match and send the corresponding instruction frame according to the broadcast frame. According to the embodiment of the application, the instruction frame only comprises the data type which can be acquired by the acquisition equipment and the sampling frequency corresponding to the data type, so that the structure of the instruction frame can be simplified, the size of the instruction frame is reduced, and the transmission speed of the instruction frame is increased.
In an embodiment, as shown in fig. 13, before receiving the broadcast frame sent by the acquisition device in step 1204, the method further includes:
step 1302, determining a data type of data to be sampled in response to a configuration operation for the data type.
In the embodiment of the application, the data center can determine the data type of the data to be sampled in response to the configuration operation for the data type. Referring to fig. 14, the operator may configure the data type by operating the corresponding configuration panel. For example, the configuration panel may include check boxes or pull-down menus for each data type, and for example, the configuration panel includes check boxes for each data type, and an operator may configure the data type by checking the data type in the check boxes. For example, if the operator checks the battery-related data, the electroencephalogram data, the electrocardiograph data, and the triaxial acceleration data in the check frame, the data type of the data to be sampled is the battery-related data, the electroencephalogram data, the electrocardiograph data, and the triaxial acceleration data.
In step 1304, for any data type of the data to be sampled, in response to the configuration operation for the sampling frequency corresponding to the data type, the sampling frequency corresponding to the data type is determined.
In this embodiment of the application, the data center may determine the sampling frequency corresponding to each data type in response to the configuration operation for the sampling frequency corresponding to each data type. Referring to fig. 14, an operator may configure the sampling frequency corresponding to each data type by operating the corresponding configuration panel. For example, the configuration panel may include an input box for a sampling frequency corresponding to each data type, and an operator may configure the sampling frequency corresponding to the data type by inputting the sampling frequency corresponding to the data type in the input box. For example, if the operator does not input the sampling frequency corresponding to the battery related data, the sampling frequency corresponding to the electroencephalogram data is input to 250Hz, the sampling frequency corresponding to the electrocardiograph data is input to 250Hz, and the sampling frequency corresponding to the triaxial acceleration data is input to 10Hz, the battery related data does not have a corresponding sampling frequency (the acquisition device will acquire the battery related data at a default sampling rate), the sampling frequency corresponding to the electroencephalogram data is 250Hz, the sampling frequency corresponding to the electrocardiograph data is 250Hz, and the sampling frequency corresponding to the triaxial acceleration data is 10Hz.
The data transmission method provided by the embodiment of the application can determine the data type and the sampling frequency corresponding to each data type according to the configuration operation aiming at the data type and the sampling frequency corresponding to each data type. This application embodiment can be through the instruction frame, instruct collection equipment to gather different data types's data with different frequencies, so can be with the collection frequency setting that the data type that needs frequent collection corresponds higher, the collection frequency setting that the data type that does not need frequent collection corresponds is lower, consequently, can reduce the data size of the data type that does not need frequent collection, and then reduce the data size that sends to data center through the bluetooth agreement, the transmission ability of balanced bluetooth agreement and the data size that collection equipment needs the transmission.
It should be understood that, although the steps in the flowcharts related to the embodiments as described above are sequentially displayed as indicated by arrows, the steps are not necessarily performed sequentially as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be rotated or alternated with other steps or at least a part of the steps or stages in other steps.
In one embodiment, a data transmission system is provided, the system comprising a data center and at least one acquisition device, wherein:
the acquisition equipment is used for determining at least one data type required to be acquired by the acquisition equipment and the sampling frequency corresponding to each data type, and acquiring sampling data according to each data type and the sampling frequency corresponding to each data type;
the acquisition equipment is also used for packaging the sampling data by adopting a preset frame format to obtain a target data frame and sending the target data frame to a data center connected with the acquisition equipment through Bluetooth;
the data center is used for receiving the target data frame sent by the acquisition equipment connected with the data center through Bluetooth and de-encapsulating the target data frame according to the preset frame format to obtain the sampling data.
In the embodiment of the present application, the data interaction process between the data center and the acquisition device, and the specific operations performed by the data center and the acquisition device in the data transmission process refer to the relevant description parts of the foregoing embodiments, and the embodiments of the present application are not described herein again.
The data transmission system provided by the embodiment of the application can enable the acquisition equipment to determine at least one data type to be acquired by the acquisition equipment and the sampling frequency corresponding to each data type, acquire the sampled data according to each data type and the sampling frequency corresponding to each data type, further perform encapsulation processing on the sampled data to obtain a target data frame, and send the target data frame to the data center connected with the acquisition equipment through the Bluetooth. The data center can further receive a target data frame sent by the acquisition equipment connected with the data center through Bluetooth, and decapsulate the target data frame according to a preset frame format to obtain sampling data. According to the embodiment of the application, the acquisition frequency corresponding to the data type which needs to be acquired frequently is set to be higher, and the acquisition frequency corresponding to the data type which does not need to be acquired frequently is set to be lower, so that the data volume of the data type which does not need to be acquired frequently can be reduced, and the data volume sent to a data center through a Bluetooth protocol is further reduced; meanwhile, the sampling data is packaged through a preset data frame format, and more sampling data can be put into one data frame to be sent, so that the frequency of sending the data frame by the acquisition equipment can be reduced. Under the condition that the data volume sent by the acquisition equipment is reduced and the frequency of sending data frames is also reduced, the limitation of the sampling rate of the acquisition equipment by the transmission capability of the Bluetooth protocol can be reduced, so that the Bluetooth protocol can transmit more effective data as much as possible.
Based on the same inventive concept, the embodiment of the present application further provides a data transmission apparatus for implementing the above-mentioned data transmission method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so specific limitations in one or more embodiments of the data transmission device provided below can be referred to the limitations of the data transmission method in the foregoing, and details are not described herein again.
In one embodiment, as shown in fig. 15, there is provided a data transmission apparatus 1500, including: a determination module 1502, an acquisition module 1504, an encapsulation module 1506, a sending module 1508, wherein:
a determining module 1502, configured to determine at least one data type that needs to be acquired by an acquisition device and a sampling frequency corresponding to each data type;
an acquisition module 1504, configured to acquire sampling data according to each data type and a sampling frequency corresponding to each data type;
the encapsulating module 1506 is configured to encapsulate the sampled data by using a preset frame format to obtain a target data frame;
a sending module 1508, configured to send the target data frame to a data center connected to the acquisition device by bluetooth.
The data transmission device provided by the embodiment of the application can acquire the sampling data according to at least one data type required to be acquired by the acquisition equipment and the sampling frequency corresponding to each data type, packages the sampling data into a target data frame according to a preset frame format, and sends the target data frame to the data center connected with the acquisition equipment through Bluetooth. According to the embodiment of the application, the acquisition equipment can acquire data of different data types at different frequencies, so that the acquisition frequency corresponding to the data type which needs to be acquired frequently is set to be higher, and the acquisition frequency corresponding to the data type which does not need to be acquired frequently is set to be lower, so that the data volume of the data type which does not need to be acquired frequently can be reduced, and the data volume sent to a data center through a Bluetooth protocol is further reduced; meanwhile, the sampling data is packaged through a preset data frame format, and more sampling data can be put into one data frame to be sent, so that the frequency of sending the data frame by the acquisition equipment can be reduced. Under the condition that the data volume sent by the acquisition equipment is reduced and the frequency of sending data frames is also reduced, the limitation of the transmission capability of the Bluetooth protocol on the sampling rate of the acquisition equipment can be reduced, so that the Bluetooth protocol can transmit more effective data as far as possible.
In one embodiment, the sampling data includes first sampling data corresponding to a first data type and second sampling data corresponding to a second data type, the first data type is a bioelectricity type, and the second data type is a data type other than the first data type.
In one embodiment, the encapsulation module 1506 is further configured to:
when the first sampling data reaches a preset number, setting a data number field in the target data frame according to the preset number, and setting a data type field in the target data frame according to the data type of each sampling data;
and setting a data field of the target data frame according to the preset number of first sample data and target second sample data corresponding to each second data type, wherein for any second data type, the target second sample data corresponding to the second data type is the second sample data of the second data type acquired last time in the acquisition period of the preset number of first sample data.
In one embodiment, the encapsulation module 1506 is further configured to:
and aiming at the sampling data of any data type, adjusting the bit mark of the data type in the data type field in the target data frame from a first identifier to a second identifier, wherein the first identifier is used for representing the sampling data which does not carry the data type in the target data frame, and the second identifier is used for representing the sampling data which carries the data type in the target data frame.
In one embodiment, the encapsulation module 1506 is further configured to:
and adding the preset number of first sample data and target second sample data corresponding to each second data type to a data field of the target data frame according to the sequence of the bit flag of the first data type and the bit flag of each second data type in the data type field.
In one embodiment, the apparatus further comprises:
a first setting module, configured to set a frame start identifier at a start position of the target data frame, and set a frame length field in the target data frame according to a current length of the target data frame; and/or the presence of a gas in the atmosphere,
the second setting module is used for acquiring the timestamp information of the current moment and setting the timestamp field of the target data frame according to the timestamp information; and/or the presence of a gas in the atmosphere,
and the third setting module is used for setting a data positioning identification field in the target data frame according to the position of target first sampling data in the first sampling data, wherein the target first sampling data is data subjected to marking operation in the first sampling data.
In one embodiment, the determining module 1502 is further configured to:
if the acquisition equipment receives an instruction frame sent by the data center within a preset time length after the Bluetooth connection with the data center is established, acquiring at least one data type required to be acquired by the acquisition equipment and a sampling frequency corresponding to each data type from the instruction frame; alternatively, the first and second liquid crystal display panels may be,
if the acquisition equipment does not receive the instruction frame sent by the data center within the preset time length, the default data type and the default sampling frequency corresponding to the default data type are used as at least one data type to be acquired by the acquisition equipment and the sampling frequency corresponding to each data type.
In one embodiment, the apparatus further comprises:
the broadcast module is used for sending a broadcast frame to the data center within a preset time length after the acquisition equipment and the data center establish Bluetooth connection, the broadcast frame comprises an equipment token field and a data information field, the equipment token field comprises the equipment identification of the acquisition equipment, and the data information field comprises the data type which can be acquired by the acquisition equipment, so that the data center establishes a corresponding instruction frame according to the data type which can be acquired by the acquisition equipment after receiving the broadcast frame, and sends the instruction frame to the acquisition equipment according to the equipment identification of the acquisition equipment.
In one embodiment, the apparatus further comprises:
the acquisition module is used for acquiring channel identifications corresponding to the acquisition channels from the channel control field of the instruction frame;
the channel opening module is used for acquiring the sampling data through the acquisition channel under the condition that a channel identifier corresponding to the acquisition channel is a channel opening identifier aiming at any acquisition channel; alternatively, the first and second liquid crystal display panels may be,
and the channel closing module is used for not collecting the sampling data through the acquisition channel under the condition that the channel identifier corresponding to the acquisition channel is the channel closing identifier.
In one embodiment, the acquisition module 1504 is further configured to:
acquiring a device control instruction from a device control field of the instruction frame;
under the condition that the equipment control instruction is an equipment starting instruction, acquiring the sampling data according to each data type and the sampling frequency corresponding to each data type; alternatively, the first and second liquid crystal display panels may be,
under the condition that the equipment control instruction is an equipment closing instruction, stopping collecting the sampling data; alternatively, the first and second electrodes may be,
and restarting the acquisition equipment under the condition that the equipment control instruction is an equipment restart instruction.
In one embodiment, as shown in fig. 16, there is provided a data transmission apparatus 1600 comprising: a receiving module 1602, a decapsulating module 1604, wherein:
a receiving module 1602, configured to receive a target data frame sent by an acquisition device connected to a data center via bluetooth, where the target data frame is a data frame obtained by the acquisition device by encapsulating sampling data in a preset frame format, and the sampling data is data obtained by the acquisition device according to at least one data type that needs to be acquired by the acquisition device and a sampling frequency corresponding to each data type;
a decapsulation module 1604, configured to decapsulate the target data frame according to the preset frame format to obtain the sample data.
The data transmission device provided by the embodiment of the application can receive the target data frame sent by the acquisition equipment connected with the data center through the Bluetooth, and then unpack the target data frame according to the preset frame format to obtain the sampling data. The target data frame is data acquired according to the at least one data type required to be acquired by the acquisition equipment and the sampling frequency corresponding to each data type by the acquisition equipment, so that the data volume of the data types which do not need to be acquired frequently can be reduced, and the data volume sent to the data center through a Bluetooth protocol is further reduced; meanwhile, the sampling data is packaged through a preset data frame format, and more sampling data can be put into one data frame to be sent, so that the frequency of sending the data frame by the acquisition equipment can be reduced. Under the condition that the data volume sent by the acquisition equipment is reduced and the frequency of sending data frames is also reduced, the limitation of the transmission capability of the Bluetooth protocol on the sampling rate of the acquisition equipment can be reduced, so that the Bluetooth protocol can transmit more effective data as far as possible.
In one embodiment, the sampling data includes first sampling data corresponding to a first data type and second sampling data corresponding to a second data type, where the first data type is a bioelectricity type, and the second data type is a data type other than the first data type, and the decapsulation module 1604 is further configured to:
analyzing a data number field and a data type field of the target data frame to obtain the number of the first sampling data, the data type of the first sampling data carried in the target data frame and the data type of the second sampling data carried in the target data frame;
and analyzing a data field of the target data frame according to the number of the first sampling data, the data type of the first sampling data carried in the target data frame and the data type of the second sampling data carried in the target data frame to obtain the first sampling data and the second sampling data.
In one embodiment, the decapsulating module 1604 is further configured to:
determining the length of the first sampling data according to the data type of the first sampling data;
according to the length of the first sampling data, sequentially determining data with the length of bytes of the first sampling data as the first sampling data from the initial position of a data field in the target data frame until the number of the acquired first sampling data reaches the number of the first sampling data;
and acquiring the second sampling data from the data field in sequence according to the sequence of the bit marks of the second data types in the data type field and the length corresponding to the data types of the second sampling data.
In one embodiment, the apparatus further comprises:
a first obtaining module, configured to obtain a length of the target data frame from a frame length field of the target data frame;
the first determining module is used for determining the theoretical starting position of the next data frame according to the frame starting identifier of the target data frame and the length of the target data frame;
the reservation module is used for reserving the target data frame when the theoretical starting position of the next data frame is the frame starting identifier; alternatively, the first and second electrodes may be,
and the discarding module is used for discarding the target data frame when the theoretical starting position of the next data frame is not the frame starting identifier.
In one embodiment, the apparatus further comprises:
the second acquisition module is used for acquiring the timestamp information of the target data frame from the timestamp field of the target data frame;
a second determining module, configured to determine, according to the timestamp information of each data frame, an order in which the acquisition device sends each data frame, where the data frames include the target data frame and a historical target data frame;
and a third determining module, configured to use an order in which the acquiring device sends each data frame as a sampling order of the sample data included in each data frame.
In one embodiment, the first sample data includes target first sample data, and the target first sample data is data of the first sample data, where the marking operation is performed, and the apparatus further includes:
a third obtaining module, configured to obtain, from a data location identification field of the target data frame, a location of the target first sample data in the first sample data;
and the fourth acquisition module is used for acquiring the target first sampling data from the first sampling data according to the position of the target first sampling data in the first sampling data.
In one embodiment, the apparatus further comprises:
a sending module, configured to send an instruction frame to the acquisition device, where the instruction frame includes a data requirement field and a sampling frequency field, the data requirement field includes at least one data type that the acquisition device needs to acquire, and the sampling frequency field includes a sampling frequency corresponding to each data type; alternatively, the first and second liquid crystal display panels may be,
the broadcast receiving module is used for receiving a broadcast frame sent by the acquisition equipment, and the broadcast frame comprises an equipment token field and a data information field;
a fifth obtaining module, configured to obtain, from the data information field, a data type that can be collected by the collection device, and match, according to the data type that can be collected by the collection device, at least one data type that needs to be collected by the collection device from the data types of the data to be sampled;
the setting module is used for setting a data demand field in the instruction frame according to at least one data type required to be acquired by the acquisition equipment, and setting a sampling frequency field in the instruction frame according to the sampling frequency corresponding to each data type;
and the sixth acquisition module is used for acquiring the equipment identifier of the acquisition equipment from the equipment token field and sending the instruction frame to the acquisition equipment according to the equipment identifier of the acquisition equipment.
In one embodiment, the apparatus further comprises:
a fourth determining module, configured to determine a data type of the data to be sampled in response to a configuration operation for the data type;
and a fifth determining module, configured to, for any one of the data types of the data to be sampled, determine a sampling frequency corresponding to the data type in response to a configuration operation for the sampling frequency corresponding to the data type.
The modules in the data transmission device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent of a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 17. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program to run on the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a data transmission method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the configuration shown in fig. 17 is a block diagram of only a portion of the configuration associated with the present application, and is not intended to limit the computing device to which the present application may be applied, and that a particular computing device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory in which a computer program is stored and a processor, which when executing the computer program implements the steps of the above-described data transmission method.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the above-mentioned data transmission method.
In an embodiment, a computer program product is provided, comprising a computer program which, when being executed by a processor, carries out the steps of the above-mentioned data transmission method.
It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive Random Access Memory (ReRAM), magnetic Random Access Memory (MRAM), ferroelectric Random Access Memory (FRAM), phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), for example. The databases involved in the embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
In the present specification, the embodiments are described in a progressive manner, and each embodiment focuses on differences from other embodiments, and the same or similar parts in each embodiment are referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The method and system of the present invention may be implemented in a number of ways. For example, the methods and systems of the present invention may be implemented in software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of the method is for illustrative purposes only, and the steps of the method of the present invention are not limited to the order specifically described above unless specifically indicated otherwise. Furthermore, in some embodiments, the present invention may also be embodied as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the method according to the present invention. Thus, the present invention also covers a recording medium storing a program for executing the method according to the present invention.
The description of the present invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to practitioners skilled in this art. The embodiment was chosen and described in order to best explain the principles of the invention and the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.

Claims (23)

1. A method of data transmission, the method comprising:
determining at least one data type required to be acquired by acquisition equipment and a sampling frequency corresponding to each data type;
acquiring sampling data according to each data type and the sampling frequency corresponding to each data type;
packaging the sampled data by adopting a preset frame format to obtain a target data frame;
and sending the target data frame to a data center connected with the acquisition equipment through Bluetooth.
2. The method of claim 1, wherein the sampled data comprises first sampled data corresponding to a first data type and second sampled data corresponding to a second data type, the first data type being a bioelectrical type, and the second data type being a data type other than the first data type.
3. The method of claim 2, wherein the encapsulating the sample data using the preset frame format to obtain the target data frame comprises:
when the first sampling data reaches a preset number, setting a data number field in the target data frame according to the preset number, and setting a data type field in the target data frame according to the data type of each sampling data;
and setting a data field of the target data frame according to the preset number of first sample data and target second sample data corresponding to each second data type, wherein for any second data type, the target second sample data corresponding to the second data type is the second sample data of the second data type acquired last time in the acquisition period of the preset number of first sample data.
4. The method of claim 3, wherein setting the data type field in the target data frame according to the data type of each of the sample data comprises:
and aiming at the sampling data of any data type, adjusting the bit mark of the data type in the data type field in the target data frame from a first identifier to a second identifier, wherein the first identifier is used for representing the sampling data which does not carry the data type in the target data frame, and the second identifier is used for representing the sampling data which carries the data type in the target data frame.
5. The method according to claim 4, wherein the setting a data field of the target data frame according to the preset number of the first sample data and target second sample data corresponding to each of the second data types comprises:
and adding the preset number of first sample data and target second sample data corresponding to each second data type to a data field of the target data frame according to the sequence of the bit flag of the first data type and the bit flag of each second data type in the data type field.
6. The method according to claim 5, wherein after the setting of the data field of the target data frame according to the preset number of the first sample data and the target second sample data corresponding to each of the second data types, the method further comprises:
setting a frame starting identifier at the starting position of the target data frame, and setting a frame length field in the target data frame according to the current length of the target data frame; and/or the presence of a gas in the gas,
acquiring timestamp information of the current moment, and setting a timestamp field of the target data frame according to the timestamp information; and/or the presence of a gas in the gas,
and setting a data positioning identification field in the target data frame according to the position of target first sampling data in the first sampling data, wherein the target first sampling data is data subjected to marking operation in the first sampling data.
7. The method according to any one of claims 1 to 6, wherein the determining at least one data type required to be acquired by an acquisition device and a sampling frequency corresponding to each data type comprises:
if the acquisition equipment receives an instruction frame sent by the data center within a preset time length after the Bluetooth connection with the data center is established, acquiring at least one data type required to be acquired by the acquisition equipment and a sampling frequency corresponding to each data type from the instruction frame; alternatively, the first and second electrodes may be,
and if the acquisition equipment does not receive the instruction frame sent by the data center within the preset time length, taking the default data type and the default sampling frequency corresponding to the default data type as at least one data type to be acquired by the acquisition equipment and the sampling frequency corresponding to each data type.
8. The method of claim 7, further comprising:
the method comprises the steps that a broadcast frame is sent to a data center within a preset time length after Bluetooth connection between acquisition equipment and the data center is established, the broadcast frame comprises an equipment token field and a data information field, the equipment token field comprises equipment identification of the acquisition equipment, and the data information field comprises data types which can be acquired by the acquisition equipment, so that the data center constructs a corresponding instruction frame according to the data types which can be acquired by the acquisition equipment after receiving the broadcast frame, and sends the instruction frame to the acquisition equipment according to the equipment identification of the acquisition equipment.
9. The method of claim 7, further comprising:
acquiring channel identification corresponding to each acquisition channel from a channel control field of the instruction frame;
for any acquisition channel, acquiring the sampling data through the acquisition channel under the condition that the channel identifier corresponding to the acquisition channel is a channel opening identifier; alternatively, the first and second electrodes may be,
and under the condition that the channel identifier corresponding to the acquisition channel is the channel closing identifier, the sampling data is not acquired through the acquisition channel.
10. The method of claim 7, wherein collecting sample data according to each of the data types and a sampling frequency corresponding to each of the data types comprises:
acquiring a device control instruction from a device control field of the instruction frame;
under the condition that the equipment control instruction is an equipment starting instruction, acquiring the sampling data according to each data type and the sampling frequency corresponding to each data type; alternatively, the first and second liquid crystal display panels may be,
under the condition that the equipment control instruction is an equipment closing instruction, stopping collecting the sampling data; alternatively, the first and second electrodes may be,
and restarting the acquisition equipment under the condition that the equipment control instruction is an equipment restart instruction.
11. A method of data transmission, the method comprising:
receiving a target data frame sent by acquisition equipment connected with a data center Bluetooth, wherein the target data frame is obtained by the acquisition equipment by packaging sampling data in a preset frame format, and the sampling data is obtained by the acquisition equipment according to at least one data type to be acquired by the acquisition equipment and a sampling frequency corresponding to each data type;
and de-encapsulating the target data frame according to the preset frame format to obtain the sampling data.
12. The method of claim 11, wherein the sampling data comprises a first sampling data corresponding to a first data type and a second sampling data corresponding to a second data type, the first data type is a bioelectricity type, the second data type is a data type other than the first data type, and the decapsulating the target data frame according to the preset frame format to obtain the sampling data comprises:
analyzing a data number field and a data type field of the target data frame to obtain the number of the first sampling data, the data type of the first sampling data carried in the target data frame and the data type of the second sampling data carried in the target data frame;
and analyzing a data field of the target data frame according to the number of the first sampling data, the data type of the first sampling data carried in the target data frame and the data type of the second sampling data carried in the target data frame to obtain the first sampling data and the second sampling data.
13. The method of claim 12, wherein the parsing the data field of the target data frame according to the number of the first sample data, the data type of the first sample data carried in the target data frame, and the data type of the second sample data carried in the target data frame to obtain the first sample data and the second sample data comprises:
determining the length of the first sampling data according to the data type of the first sampling data;
according to the length of the first sampling data, sequentially determining data with the length of bytes of the first sampling data as the first sampling data from the initial position of a data field in the target data frame until the number of the acquired first sampling data reaches the number of the first sampling data;
and according to the sequence of the bit marks of the second data types in the data type field and the length corresponding to the data types of the second sample data, sequentially acquiring the second sample data from the data field.
14. The method of claim 11, wherein before the decapsulating the target data frame according to a preset frame format to obtain the sample data, the method further comprises:
acquiring the length of the target data frame from the frame length field of the target data frame;
determining a theoretical starting position of a next data frame according to the frame starting identifier of the target data frame and the length of the target data frame;
when the theoretical starting position of the next data frame is the frame starting identifier, reserving the target data frame; alternatively, the first and second electrodes may be,
and when the theoretical starting position of the next data frame is not the frame starting identifier, discarding the target data frame.
15. The method of claim 11, further comprising:
acquiring timestamp information of the target data frame from a timestamp field of the target data frame;
determining the sequence of sending each data frame by the acquisition equipment according to the timestamp information of each data frame, wherein the data frames comprise the target data frame and the historical target data frame;
and taking the sequence of sending each data frame by the acquisition equipment as the sampling sequence of the sampling data contained in each data frame.
16. The method of claim 12, wherein the first sample data comprises target first sample data, and the target first sample data is data of the first sample data subjected to a marking operation, and the method further comprises:
acquiring the position of the target first sampling data in the first sampling data from a data positioning identification field of the target data frame;
and acquiring the target first sampling data from the first sampling data according to the position of the target first sampling data in the first sampling data.
17. The method of claim 11, wherein prior to receiving the target data frame sent by the acquisition device bluetooth connected to the data center, the method further comprises:
sending an instruction frame to the acquisition equipment, wherein the instruction frame comprises a data requirement field and a sampling frequency field, the data requirement field comprises at least one data type which needs to be acquired by the acquisition equipment, and the sampling frequency field comprises sampling frequency corresponding to each data type; alternatively, the first and second electrodes may be,
receiving a broadcast frame sent by the acquisition equipment, wherein the broadcast frame comprises an equipment token field and a data information field;
acquiring data types which can be acquired by the acquisition equipment from the data information fields, and matching at least one data type which needs to be acquired by the acquisition equipment from the data types of the data to be sampled according to the data types which can be acquired by the acquisition equipment;
setting a data demand field in the instruction frame according to at least one data type to be acquired by the acquisition equipment, and setting a sampling frequency field in the instruction frame according to the sampling frequency corresponding to each data type;
and acquiring the equipment identifier of the acquisition equipment from the equipment token field, and sending the instruction frame to the acquisition equipment according to the equipment identifier of the acquisition equipment.
18. The method of claim 17, wherein prior to receiving the broadcast frame transmitted by the acquisition device, the method further comprises:
determining a data type of the data to be sampled in response to a configuration operation for the data type;
and for any data type of the data to be sampled, responding to configuration operation of a sampling frequency corresponding to the data type, and determining the sampling frequency corresponding to the data type.
19. A data transmission system, comprising a data center and at least one acquisition device, wherein:
the acquisition equipment is used for determining at least one data type required to be acquired by the acquisition equipment and the sampling frequency corresponding to each data type, and acquiring sampling data according to each data type and the sampling frequency corresponding to each data type;
the acquisition equipment is also used for packaging the sampling data by adopting a preset frame format to obtain a target data frame and sending the target data frame to a data center connected with the acquisition equipment through Bluetooth;
the data center is used for receiving the target data frame sent by the acquisition equipment connected with the data center through Bluetooth and de-encapsulating the target data frame according to the preset frame format to obtain the sampling data.
20. A data transmission apparatus, characterized in that the apparatus comprises:
the device comprises a determining module, a sampling module and a processing module, wherein the determining module is used for determining at least one data type required to be acquired by acquisition equipment and a sampling frequency corresponding to each data type;
the acquisition module is used for acquiring sampling data according to each data type and the sampling frequency corresponding to each data type;
the encapsulation module is used for encapsulating the sampling data by adopting a preset frame format to obtain a target data frame;
and the sending module is used for sending the target data frame to a data center connected with the acquisition equipment through Bluetooth.
21. A data transmission apparatus, characterized in that the apparatus comprises:
the receiving module is used for receiving a target data frame sent by acquisition equipment connected with a data center through Bluetooth, wherein the target data frame is a data frame obtained by packaging sampling data by the acquisition equipment by adopting a preset frame format, and the sampling data is obtained by the acquisition equipment according to at least one data type required to be acquired by the acquisition equipment and a sampling frequency corresponding to each data type;
and the decapsulation module is used for decapsulating the target data frame according to the preset frame format to obtain the sampling data.
22. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 18.
23. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 18.
CN202211195327.XA 2022-09-29 2022-09-29 Data transmission method, device, system, computer equipment and storage medium Pending CN115314080A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211195327.XA CN115314080A (en) 2022-09-29 2022-09-29 Data transmission method, device, system, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211195327.XA CN115314080A (en) 2022-09-29 2022-09-29 Data transmission method, device, system, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115314080A true CN115314080A (en) 2022-11-08

Family

ID=83866212

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211195327.XA Pending CN115314080A (en) 2022-09-29 2022-09-29 Data transmission method, device, system, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115314080A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101583305A (en) * 2006-03-03 2009-11-18 理疗波公司 Physiologic monitoring systems and methods
US20190209022A1 (en) * 2018-01-05 2019-07-11 CareBand Inc. Wearable electronic device and system for tracking location and identifying changes in salient indicators of patient health
CN110072278A (en) * 2019-04-30 2019-07-30 南京大学 A kind of wireless multinode physiological signal monitor system based on low-power consumption bluetooth
CN110221684A (en) * 2019-03-01 2019-09-10 Oppo广东移动通信有限公司 Apparatus control method, system, electronic device and computer readable storage medium
CN113077860A (en) * 2021-02-10 2021-07-06 海信视像科技股份有限公司 Display device, control device and data acquisition method
CN114246609A (en) * 2022-01-06 2022-03-29 郑州大学 5G internet medical data acquisition terminal
CN114553351A (en) * 2020-11-24 2022-05-27 华为技术有限公司 Time synchronization method, control device, equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101583305A (en) * 2006-03-03 2009-11-18 理疗波公司 Physiologic monitoring systems and methods
US20190209022A1 (en) * 2018-01-05 2019-07-11 CareBand Inc. Wearable electronic device and system for tracking location and identifying changes in salient indicators of patient health
CN110221684A (en) * 2019-03-01 2019-09-10 Oppo广东移动通信有限公司 Apparatus control method, system, electronic device and computer readable storage medium
CN110072278A (en) * 2019-04-30 2019-07-30 南京大学 A kind of wireless multinode physiological signal monitor system based on low-power consumption bluetooth
CN114553351A (en) * 2020-11-24 2022-05-27 华为技术有限公司 Time synchronization method, control device, equipment and storage medium
CN113077860A (en) * 2021-02-10 2021-07-06 海信视像科技股份有限公司 Display device, control device and data acquisition method
CN114246609A (en) * 2022-01-06 2022-03-29 郑州大学 5G internet medical data acquisition terminal

Similar Documents

Publication Publication Date Title
CN105122771B (en) For providing the method and apparatus of service in bluetooth equipment
CN104144216B (en) Data processing method and device for wearable terminal
Pereira et al. Enabling cloud connectivity for mobile internet of things applications
CN102916854B (en) Flow statistical method, device and proxy server
CN102647369B (en) Gateway equipment used for telemedicine and realization method for telemedicine
CN108647051A (en) Optimisation strategy acquisition methods, providing method, device and equipment
CN108156056A (en) Network quality measuring method and its device
Giovanelli et al. Bluetooth Low Energy for data streaming: Application-level analysis and recommendation
CN105592784A (en) Medical data acquisition systems and methods for monitoring and diagnosis
US20220232298A1 (en) Activity monitoring
CN111818041B (en) Real-time message processing system and method based on network layer message analysis
CN107205692A (en) Stridulate detection means
CN113438628B (en) Method and device for data interaction
CN112333044A (en) Shunting equipment performance test method, device and system, electronic equipment and medium
Al Rasyid et al. CO and CO 2 pollution monitoring based on wireless sensor network
CN107888550A (en) Performance indications collecting method and device, tactful sending method and device
CN115314080A (en) Data transmission method, device, system, computer equipment and storage medium
CN109921960A (en) A kind of IDC network of computer room abnormality test method and device
CN104468190B (en) A kind of wifi data packet snapping method, device and intelligent terminal
US20170367634A1 (en) Method and system for emotion mapping
Zhang et al. A secure and scalable telemonitoring system using ultra-low-energy wireless sensor interface for long-term monitoring in life science applications
CN111367686A (en) Service interface calling method and device, computer equipment and storage medium
JP6157189B2 (en) Identification device, identification method, and identification program
US20190192011A1 (en) Wearable health monitoring data service
KR102113784B1 (en) Date management system for preventing from data loss in BLE

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20221108

RJ01 Rejection of invention patent application after publication