A method, device and electronic device for collecting and transmitting sensor signals

By using the combination of temporary queues and send queues in a microcontroller, the problem of data loss during multi-channel high-frequency signal acquisition is solved, and the data is two-wire operation is realized, ensuring the complete transmission of signals.

CN115933497BActive Publication Date: 2024-12-06JIANGSU RICH HAILI TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202211740009.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2024-12-06
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

When the microcontroller collects multi-channel high-frequency vibration sensor signals, data is easily lost during transmission, mainly because the microcontroller cannot perform data reading tasks at the same time when performing data sending tasks, resulting in new data being overwritten.

Method used

The combination of temporary queue and send queue is used to read the sensing signal and mark it as a send queue when the preset length is reached to ensure data integrity, and interrupt the sending process when new data is generated and transferred to a new queue. Until the send queue is completed, the data is two-line operation.

Benefits of technology

It effectively prevents data loss, ensures the complete transmission of the sensing signal, and avoids coverage problems caused by delay in the read signal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115933497B_ABST
    Figure CN115933497B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device and electronic device for collecting and transmitting sensor signals. The method comprises: reading the sensor signals output by the analog-to-digital converters connected to each sampling channel. During the reading process, the sensor signals are sequentially stored in a temporary storage queue in the order of reading. When the data length of the temporary storage queue reaches a preset length, the current temporary storage queue is marked as a sending queue. The sensor signals in the sending queue are sent to a communication device. During the sending process, if the analog-to-digital converter connected to any sampling channel generates a new sensor signal, the sending process of the sensor signal is interrupted. After the sensor signals read subsequently are sequentially stored in the next temporary storage queue in the order of reading, the sensor signals in the sending queue continue to be sent to the communication device until the sensor signals in the sending queue are sent. This scheme can prevent the sensor signals from being overwritten due to the delay in reading the signals during the transmission process, thereby avoiding data loss.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to signal acquisition technology, and in particular to a method, device and electronic device for acquiring and transmitting sensor signals. Background Art

[0002] At present, vibration sensor signal acquisition devices that support Ethernet data transmission mostly use a solution of a single-chip microcomputer combined with an external analog-to-digital conversion device and a communication device. The sensing signal collected by the vibration sensor is converted by the external analog-to-digital conversion device at a specified frequency, and after the conversion is completed, it is read by the single-chip microcomputer and sent through the communication device.

[0003] However, when a single-chip microcomputer implements multi-channel high-frequency data acquisition, there are many problems in sending data through a communication device, which can easily lead to data loss. Summary of the invention

[0004] The present invention provides a method, device and electronic equipment for collecting and transmitting a sensing signal, so as to prevent the sensing signal from being covered due to delay in reading the signal during the transmission process, thereby avoiding data loss.

[0005] In a first aspect, an embodiment of the present invention provides a method for collecting and transmitting a sensor signal, which is applied to a single-chip microcomputer. The method for collecting and transmitting a sensor signal includes:

[0006] Reading the sensing signal output by the analog-to-digital converter connected to each sampling channel;

[0007] During the reading process, the sensor signals are sequentially stored in a temporary storage queue according to the reading order;

[0008] When the data length of the temporary storage queue reaches a preset length, marking the current temporary storage queue as a sending queue;

[0009] sending the sensing signals in the sending queue to a communication device;

[0010] In the process of sending the sensor signal in the sending queue to the communication device, if the analog-to-digital converter connected to any sampling channel generates a new sensor signal, the sending process of the sensor signal is interrupted;

[0011] After the sensor signals subsequently read are sequentially stored in the next temporary storage queue according to the reading order, the sensor signals in the sending queue continue to be sent to the communication device until the sensor signals in the sending queue are completely sent.

[0012] Optionally, after reading the sensing signal output by the analog-to-digital converter connected to each sampling channel, the method further includes:

[0013] A sampling channel mark is set for each of the sensing signals.

[0014] Optionally, after the sensing signal in the sending queue is sent, the method further includes:

[0015] All sensor signals in the sending queue are deleted.

[0016] Optionally, while reading the sensing signal output by the analog-to-digital converter connected to each sampling channel, the method further includes:

[0017] The preset length is set according to the conversion frequency of the analog-to-digital converter.

[0018] Optionally, the communication device includes a wireless communication device and / or an Ethernet communication device.

[0019] In a second aspect, an embodiment of the present invention further provides a sensor signal collection and transmission device, the device comprising: a reading module, a storage module, a queue marking module, a sending module and an interrupt module, the reading module being used to read the sensor signal output by the analog-to-digital converter connected to each sampling channel; the storage module being used to store the sensor signal in a temporary queue in sequence according to the reading order during the reading process; the queue marking module being used to mark the current temporary queue as a sending queue when the data length of the temporary queue reaches a preset length; the sending module being used to send the sensor signal in the sending queue to a communication device; and the interrupt module being used to During the process of sending the sensor signal in the sending queue to the communication device, if the analog-to-digital converter connected to any sampling channel generates a new sensor signal, the sending process of the sensor signal is interrupted; the storage module is also used to store the subsequently read sensor signals in the next temporary storage queue in the reading order after interrupting the sending process of the sensor signal; the sending module is also used to continue sending the sensor signals in the sending queue to the communication device after storing the subsequently read sensor signals in the next temporary storage queue in the reading order, until the sensor signals in the sending queue are completely sent.

[0020] Optionally, the sensor signal collection and transmission device further includes a channel marking module, which is used to set a sampling channel marking bit for each sensor signal before reading the sensor signal output by the analog-to-digital converter connected to each sampling channel.

[0021] Optionally, the sensor signal collection and transmission device further includes a deletion module, and the deletion module is used to delete all sensor signals in the sending queue after the sensor signals in the sending queue are sent completely.

[0022] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0023] at least one processor; and

[0024] A memory communicatively connected to the at least one processor; wherein,

[0025] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the method for collecting and transmitting sensing signals described in any item of the first aspect.

[0026] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for collecting and transmitting the sensor signals described in any item of the first aspect when executed.

[0027] The sensor signal acquisition and transmission method, device and electronic device provided in this embodiment read the sensor signal output by the analog-to-digital converter connected to each sampling channel, and store the sensor signal in a temporary storage queue in sequence according to the reading order. When the data length of the temporary storage queue reaches the preset length, the current temporary storage queue is marked as a sending queue and sent to the communication device. During the sending process, if the analog-to-digital converter outputs a new sensor signal, the sending process is interrupted, and the sensor signal is read and stored in a new temporary storage queue in sequence according to the reading order. After each reading, the sending task can be returned until the sensor signal in the sending queue is sent. At this time, the sending task and the reading task can no longer be switched back and forth, but the sensor signal output by the analog-to-digital converter connected to each sampling channel can be returned to continue reading, so that the single-chip microcomputer can collect and transmit the sensor information of multiple sampling channels. By setting the temporary storage queue and the sending queue, and switching the task, the dual-line operation of data transmission and reading is realized, and the sensor signal caused by delaying the reading signal during the transmission process is prevented from being covered, thereby avoiding data loss. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 A schematic diagram of a flow chart of a method for collecting and transmitting a sensor signal provided by an embodiment of the present invention;

[0029] Figure 2 A schematic diagram of a flow chart of another method for collecting and transmitting sensor signals provided in an embodiment of the present invention;

[0030] Figure 3 A schematic diagram of a flow chart of another method for collecting and transmitting sensor signals provided in an embodiment of the present invention;

[0031] Figure 4A schematic diagram of the composition of a sensor signal collection and transmission device provided by an embodiment of the present invention;

[0032] Figure 5 A schematic diagram of another sensor signal collection and transmission device provided by an embodiment of the present invention;

[0033] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0034] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0035] As described in the background technology, when the single-chip microcomputer implements multi-channel high-frequency acquisition, the data needs to be sent to the communication device and sent out through the communication device, which needs to face many problems and easily cause data loss. The inventor has found through research that the single-chip microcomputer can only perform one task at a time, and it cannot perform the data reading task while performing the data sending task. Therefore, when performing the data sending task, it is easy to miss the new data converted by the external analog-to-digital conversion device, and these data will be overwritten by the next data, resulting in data loss. Therefore, in order to prevent data loss, when the single-chip microcomputer sends data, it is necessary to ensure that the data on the external analog-to-digital conversion device connected to all channels has been read and new data has not been generated. If new data is generated during transmission, it needs to be read back before it is overwritten by the next data.

[0036] In order to solve the aforementioned problems, the present invention proposes a method for collecting and transmitting sensor signals, which is applied to a single chip microcomputer. Figure 1 A flow chart of a method for collecting and transmitting a sensor signal provided by an embodiment of the present invention is shown in FIG. Figure 1 , the sensor signal collection and transmission method includes:

[0037] S101 , reading the sensor signal output by the analog-to-digital converter connected to each sampling channel.

[0038] Specifically, the single-chip microcomputer used in the method for collecting and transmitting the sensor signal is provided with a plurality of sampling channels, each sampling channel is connected to an analog-to-digital converter, and the analog-to-digital converter can convert the collected sensor signal from the analog signal form to the digital signal form. The single-chip microcomputer can read the sensor signal converted and output by each analog-to-digital converter through each sampling channel.

[0039] S102 . During the reading process, the sensing signals are stored in a temporary storage queue in sequence according to the reading order.

[0040] Specifically, the single chip microcomputer stores the sensor signals read from each sampling channel in a temporary storage queue in the order of reading, and the reading order can be consistent with the signal output order of each analog-to-digital converter. During the storage process, the sensor signals read from multiple sampling channels are mixed and stored in the same temporary storage queue in sequence.

[0041] S103: When the data length of the temporary storage queue reaches a preset length, the current temporary storage queue is marked as a sending queue.

[0042] Specifically, the preset length refers to the judgment threshold for determining whether the temporary storage queue is full of data, which can be expressed in data units of bit. When the data storage length of the temporary storage team reaches the preset length, it means that the data volume of the temporary storage team is full, and the sending task can be implemented for the temporary storage team with full data volume. The temporary storage team with full data volume is marked as a sending queue, and from then on, the queue is no longer a temporary storage queue and no longer receives newly read sensor data. All sensor data read thereafter are stored in the new temporary storage team.

[0043] S104: Send the sensor signals in the sending queue to the communication device.

[0044] Specifically, after marking the current temporary queue as a sending queue, the sensor signal in the sending queue is immediately sent via the communication channel to the communication device connected to the communication channel. The communication device can use communication technology to send the sensor signal. For example, the communication device can send it to a host computer, a database or any device required by the user.

[0045] S105 . During the process of sending the sensor signals in the sending queue to the communication device, if the analog-to-digital converter connected to any sampling channel generates a new sensor signal, the process of sending the sensor signal is interrupted.

[0046] Specifically, since the single-chip microcomputer can only implement one task at a time, during the process of the sending task in step S104, if the analog-to-digital converter connected to any sampling channel generates a new sensor signal, the single-chip microcomputer needs to interrupt the sending task immediately. The single-chip microcomputer can determine the timing of interrupting the sending task according to the conversion frequency of the connected analog-to-digital converter. Exemplarily, if it takes a total of 0.5s to send the sensor signal in the sending queue to the communication device, and the conversion frequency of the two analog-to-digital converters A and B being read is 0.4s / time, and the conversion timing of the two analog-to-digital converters differs by 0.1s, if the sending task starts 0.3s before the conversion timing of the analog-to-digital converter A, then the sending task is interrupted after the sending task is implemented for 0.3 seconds, and the sensor signals of the analog-to-digital converters A and B are read in sequence.

[0047] S106 , after storing the subsequently read sensor signals in the next temporary storage queue in sequence according to the reading order, continue to send the sensor signals in the sending queue to the communication device until the sensor signals in the sending queue are completely sent.

[0048] Specifically, a temporary storage queue is re-created, and the sensor signals read after marking the sending queue are stored in the new temporary storage queue in the order of reading. After each new sensor signal is read, return to step S104 to continue sending the remaining sensor signals in the sending queue to the communication device. Repeat steps S104, S105 and S106 until the sensor signals in the sending queue are sent, and then return to step S101 to continue reading the sensor signals. When the end signal is received, the microcontroller can end the reading and transmission process.

[0049] The sensor signal acquisition and transmission method provided in this embodiment reads the sensor signal output by the analog-to-digital converter connected to each sampling channel, and stores the sensor signal in a temporary storage queue in sequence according to the reading order. When the data length of the temporary storage queue reaches the preset length, the current temporary storage queue is marked as a sending queue and sent to the communication device. During the sending process, if the analog-to-digital converter outputs a new sensor signal, the sending process is interrupted, and the sensor signal is read and stored in a new temporary storage queue in sequence according to the reading order. After each reading, the sending task can be returned until the sensor signal in the sending queue is sent. At this time, the sending task and the reading task can no longer be switched back and forth, but the sensor signal output by the analog-to-digital converter connected to each sampling channel can be returned to continue reading, thereby realizing the acquisition and transmission of the sensor information of multiple sampling channels by the single-chip microcomputer. By setting the temporary storage queue and the sending queue, and switching the task, the dual-line operation of data transmission and reading is realized, and the sensor signal caused by delaying the reading signal during the transmission process is prevented from being covered, thereby avoiding data loss.

[0050] Optionally, Figure 2 A flow chart of another method for collecting and transmitting sensor signals provided by an embodiment of the present invention is shown in FIG. Figure 2 , a method for collecting and transmitting a sensing signal, comprising:

[0051] S201, reading the sensor signal output by the analog-to-digital converter connected to each sampling channel.

[0052] Specifically, the single-chip microcomputer used in the method for collecting and transmitting the sensor signal is provided with a plurality of sampling channels, each sampling channel is connected to an analog-to-digital converter, and the analog-to-digital converter can convert the collected sensor signal from the analog signal form to the digital signal form. The single-chip microcomputer can read the sensor signal converted and output by each analog-to-digital converter through each sampling channel. Exemplarily, the analog-to-digital converter can be an analog-to-digital conversion chip, also called an AD chip.

[0053] S202: Set a sampling channel flag for each sensor signal.

[0054] Specifically, when the single-chip microcomputer stores the sensor signal, the sensor signals of each channel are stored in the same temporary storage queue. After sending it to the communication device, the communication device cannot respectively sense the source of the sensor information, which causes trouble for the subsequent signal application. Therefore, according to the different sampling channels through which the sensor signal passes, a sampling channel mark bit can be set for each sensor signal when reading the sensor signal. For example, the last 3 bits of the sensor signal can be used as the data bits for setting the channel mark. When the single-chip microcomputer reads the sensor signal, the sampling channel mark corresponding to the sensor signal is set to the last 3 bits of the sensor signal, which can minimize the signal loss and ensure the accuracy of the sensor signal.

[0055] S203 , after setting the sampling channel flag bit, storing the sensor signals in a temporary storage queue in sequence according to the reading order.

[0056] Specifically, the single chip microcomputer stores the sensor signals read from each sampling channel in a temporary storage queue in the order of reading, and the reading order can be consistent with the signal output order of each analog-to-digital converter. During the storage process, the sensor signals read from multiple sampling channels are mixed and stored in the same temporary storage queue in sequence.

[0057] S204: When the data length of the temporary storage queue reaches a preset length, the current temporary storage queue is marked as a sending queue.

[0058] Specifically, the preset length refers to the judgment threshold for judging whether the temporary storage queue is full of data, which can be expressed in data unit bit. When the data storage length of the temporary storage team reaches the preset length, it indicates that the data volume of the temporary storage team is full, and the sending task can be implemented for the temporary storage team with full data volume. The temporary storage team with full data volume is marked as a sending queue, and from then on the queue is no longer a temporary storage queue and no longer receives newly read sensor data. The sensor data read thereafter are stored in the new temporary storage team. Exemplarily, the preset length is set according to the conversion frequency of the analog-to-digital converter. For example, the time length that can be used for sending is calculated according to the conversion frequency of each analog-to-digital converter. The time length refers to the interval time length between two reading tasks, and then the preset length value is determined according to the interval time length. The setting of the preset length value needs to minimize the number of interruptions during the sending task. Preferably, the number of interruptions for each sending task can not exceed two times.

[0059] S205: Send the sensor signals in the sending queue to the communication device.

[0060] Specifically, after marking the current temporary queue as a sending queue, the sensor signal in the sending queue is immediately sent to the communication device connected to the communication channel through the communication channel. The communication device can use communication technology to send the sensor signal. For example, the communication device can send it to a host computer, a database, or any device required by the user. The communication device can be an Ethernet chip or a wireless communication chip.

[0061] S206 . During the process of sending the sensor signals in the sending queue to the communication device, if the analog-to-digital converter connected to any sampling channel generates a new sensor signal, the process of sending the sensor signal is interrupted.

[0062] Specifically, since the single-chip microcomputer can only implement one task at a time, during the process of the sending task in step S205, if the analog-to-digital converter connected to any sampling channel generates a new sensor signal, the single-chip microcomputer needs to interrupt the sending task immediately. The single-chip microcomputer can determine the timing of interrupting the sending task according to the conversion frequency of the connected analog-to-digital converter. Exemplarily, if it takes 0.5s to send the sensor signal in the sending queue to the communication device, and the conversion frequency of the two analog-to-digital converters A and B being read is 0.4s / time, and the conversion timing of the two analog-to-digital converters differs by 0.1s, if the sending task starts 0.3s before the conversion timing of the analog-to-digital converter A, then the sending task is interrupted after the sending task is implemented for 0.3 seconds, and the sensor signals of the analog-to-digital converters A and B are read in sequence.

[0063] S207 , after storing the subsequently read sensor signals in the next temporary storage queue in sequence according to the reading order, continue to send the sensor signals in the sending queue to the communication device until the sensor signals in the sending queue are completely sent.

[0064] Specifically, a temporary storage queue is newly created, and the sensor signals read after marking the sending queue are sequentially stored in the new temporary storage queue in the order of reading. After each new sensor signal is read, return to step S205 to continue sending the remaining sensor signals in the sending queue to the communication device. Steps S205, S206 and S207 and related processes are repeated until the sensor signals in the sending queue are completely sent.

[0065] S208. After the sensor signals in the sending queue are sent completely, all the sensor signals in the sending queue are deleted.

[0066] Specifically, after the transmission is completed, the sensor signal in the transmission queue is cleared to release the storage space of the single-chip microcomputer, which is convenient for the storage of the subsequent temporary storage queue. Then, depending on whether a stop signal is received, the single-chip microcomputer can return to step S201 or end the process. When the end signal is received, the single-chip microcomputer can end the reading and transmission process.

[0067] The sensor signal collection and transmission method provided in this embodiment, after reading the sensor signals output by the analog-to-digital converters connected to each sampling channel, also sets a sampling channel mark bit for each sensor signal to facilitate subsequent identification and utilization of the sensor signals. After the sensor signals in the sending queue are sent, all sensor signals in the sending queue are deleted, which can release the storage space of the microcontroller and facilitate the storage of the subsequent temporary queue.

[0068] Optionally, Figure 3 A flow chart of another method for collecting and transmitting sensor signals provided in an embodiment of the present invention is shown in FIG. Figure 3 , step S101, while reading the sensor signal output by the analog-to-digital converter connected to each sampling channel, also includes:

[0069] S301 , a preset length is set according to a conversion frequency of an analog-to-digital converter.

[0070] Specifically, the preset length can be set in real time according to the conversion frequency of the analog-to-digital converter. If the conversion frequency of the analog-to-digital converter changes, the preset length will also change accordingly. Exemplarily, the duration that can be used for sending is calculated according to the conversion frequency of each analog-to-digital converter. The duration refers to the interval between two reading tasks, and then the preset length value is determined according to the interval. The setting of the preset length value needs to minimize the number of interruptions during the sending task. Preferably, the number of interruptions for each sending task may not exceed two times. The real-time modification of the preset length can make the preset length compatible with the conversion frequency of the analog-to-digital converter, minimize the number of interruptions during the sending task, and improve the collection and sending efficiency of the single-chip microcomputer.

[0071] The present invention also provides a sensor signal collection and transmission device, which can be set as a single chip microcomputer. Figure 4 A schematic diagram of a sensor signal collection and transmission device provided in an embodiment of the present invention, referring to Figure 4The sensor signal collection and transmission device 400 includes: a reading module 401, a storage module 402, a queue marking module 403, a sending module 404 and an interruption module 405. The reading module 401 is used to read the sensor signals output by the analog-to-digital converters connected to each sampling channel. The storage module 402 is used to store the sensor signals in the temporary storage queue in the reading order in sequence during the reading process. The queue marking module 403 is used to mark the current temporary storage queue as a sending queue when the data length of the temporary storage queue reaches a preset length. The sending module 404 is used to send the sensor signals in the sending queue to the communication device. The interruption module 405 is used to interrupt the sending process of the sensor signal if the analog-to-digital converter connected to any sampling channel generates a new sensor signal during the process of sending the sensor signal in the sending queue to the communication device. The storage module 402 is also used to store the sensor signals read subsequently in the next temporary storage queue in the reading order after interrupting the sending process of the sensor signal. The sending module 404 is further configured to, after storing the subsequently read sensor signals in the next temporary storage queue in sequence according to the reading order, continue to send the sensor signals in the sending queue to the communication device until the sensor signals in the sending queue are completely sent.

[0072] Optionally, Figure 5 A schematic diagram of another sensor signal collection and transmission device provided in an embodiment of the present invention, referring to Figure 5 On the basis of the above-mentioned embodiment, the sensor signal collection and transmission device further includes a channel marking module 501 and a deletion module 502. The channel marking module 501 is used to set a sampling channel marking bit for each sensor signal before reading the sensor signal output by the analog-to-digital converter connected to each sampling channel. The deletion module 502 is used to delete all sensor signals in the sending queue after the sensor signals in the sending queue are sent.

[0073] An embodiment of the present invention further provides an electronic device. Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, referring to Figure 6 The electronic device 600 includes: at least one processor 601; and a memory 602 in communication with the at least one processor 601; wherein the memory 602 stores a computer program executable by the at least one processor 601, and the computer program is executed by the at least one processor 601, so that the at least one processor 601 can perform the sensor signal collection and transmission method of any embodiment of the present invention. The processor 601 can be a single-chip microcomputer or any processing device that cannot perform multiple tasks in parallel.

[0074] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for collecting and transmitting the sensing signal described in any embodiment of the present invention when executed.

[0075] The above-mentioned product can execute the method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0076] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0077] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0078] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0079] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0080] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0081] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0082] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0083] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for collecting and transmitting sensor signals, It is characterized in that Applied to a single chip microcomputer, the method for collecting and transmitting the sensor signal includes: Reading the sensing signal output by the analog-to-digital converter connected to each sampling channel; During the reading process, the sensor signals are sequentially stored in a temporary storage queue according to the reading order; When the data length of the temporary storage queue reaches a preset length, the current temporary storage queue is marked as a sending queue; sending the sensing signals in the sending queue to a communication device; In the process of sending the sensor signal in the sending queue to the communication device, if the analog-to-digital converter connected to any sampling channel generates a new sensor signal, the sending process of the sensor signal is interrupted; After the sensor signals subsequently read are sequentially stored in the next temporary storage queue according to the reading order, the sensor signals in the sending queue continue to be sent to the communication device until the sensor signals in the sending queue are completely sent; After reading the sensing signal output by the analog-to-digital converter connected to each sampling channel, the method further includes: A sampling channel mark is set for each of the sensing signals.

2. The method for collecting and transmitting sensor signals according to claim 1, It is characterized in that After the sensing signal in the sending queue is sent, the method further includes: All sensor signals in the sending queue are deleted.

3. The method for collecting and transmitting sensor signals according to claim 1, It is characterized in that While reading the sensing signal output by the analog-to-digital converter connected to each sampling channel, it also includes: The preset length is set according to the conversion frequency of the analog-to-digital converter.

4. The method for collecting and transmitting sensor signals according to claim 1, It is characterized in that The communication device includes a wireless communication device and / or an Ethernet communication device.

5. A device for collecting and transmitting sensor signals, It is characterized in that Used to perform the method for collecting and transmitting the sensor signal as described in any one of claims 1 to 4, the sensor signal collection and transmission device comprising: A reading module, used for reading the sensing signal output by the analog-to-digital converter connected to each sampling channel; A storage module, used for storing the sensing signals in a temporary storage queue in sequence according to the reading order during the reading process; A queue marking module, used for marking the current temporary queue as a sending queue when the data length of the temporary queue reaches a preset length; A sending module, used for sending the sensing signal in the sending queue to a communication device; An interrupt module, used for interrupting the sending process of the sensor signal if the analog-to-digital converter connected to any sampling channel generates a new sensor signal during the process of sending the sensor signal in the sending queue to the communication device; The storage module is also used to store the subsequently read sensor signals in the next temporary storage queue in the order of reading after interrupting the sending process of the sensor signals; The sending module is further used to continue sending the sensor signals in the sending queue to the communication device after storing the sensor signals subsequently read in the next temporary storage queue in sequence according to the reading order until the sensor signals in the sending queue are completely sent.

6. The sensor signal collection and transmission device according to claim 5, It is characterized in that Also includes: The channel marking module is used to set a sampling channel marking bit for each of the sensing signals before reading the sensing signals output by the analog-to-digital converters connected to the respective sampling channels.

7. The sensor signal collection and transmission device according to claim 5, It is characterized in that Also includes: The deleting module is used to delete all the sensor signals in the sending queue after the sensor signals in the sending queue are sent.

8. An electronic device, It is characterized in that The electronic device comprises: at least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the method for collecting and transmitting sensing signals according to any one of claims 1 to 4.

9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for collecting and transmitting sensing signals according to any one of claims 1 to 4 when executed.

Citation Information

Patent Citations

  • Data transmission method, long-term evolving system and device in switching

    CN101237681A

  • Data communication method and system

    CN107018087A

  • Data acquisition method, data transmission method, gateway, equipment and storage medium

    CN111918230A

  • Server and interrupt-based task scheduling method

    CN115048201A

  • Sensor data processing method and device, computing equipment and storage medium

    CN115310501A