A method, system, device and storage medium for continuous data collection and transmission
By subcontracting data transmission in the high-speed rail 6C data acquisition device according to the maximum data total received by the sending unit, the problem of data blank area during data acquisition and transmission is solved, and continuous data acquisition and transmission is realized, real-time and data integrity are improved.
Patent Information
- Application Number
- CN202210587243.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-24
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2042-05-24
AI Technical Summary
The prior art has a blank area of data during data acquisition and transmission in the high-speed rail 6C data acquisition equipment, which makes it impossible to continuously respond to the real situation on the scene and there is a risk of losing abnormal data.
In each acquisition cycle, data sub-package transmission is performed according to the maximum data total received by the transmission unit, and data is transmitted in batches using the acquisition gap to ensure continuous data acquisition and transmission.
It realizes continuous collection and transmission of data, reflects the real situation at the site, avoids the risk of losing abnormal data, and improves real-time.
Smart Images

Figure CN115002832B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of data collection and transmission, and relates to a method, system, device and storage medium for continuous data collection and transmission. Background Art
[0002] High-speed rail 6C data acquisition equipment can collect data online and transmit it to the remote end wirelessly, thus realizing online real-time monitoring. In order to completely restore the state of on-site signal changes, it is necessary to continuously collect signals and transmit data to the remote end uninterruptedly. This requires that signals must be transmitted while collecting data.
[0003] The current practice is to first collect 1 second of data at 60Hz, and then package and send about 400 bytes to the Lora module for transmission. The air rate is configured to 9600. In the final test, a single collection and transmission takes about 1.5 seconds, but the data only takes 1 second, and the remaining 0.5 seconds is free.
[0004] If the acquisition frequency is increased, the idle data time will be extended. For example, when the acquisition is performed at 120Hz, the data per second is packaged into about 800 bytes, and the transmission time in the air is nearly 1 second, resulting in nearly 1 second of data blank area.
[0005] Therefore, the current data collection and transmission has data blank areas, is not consistent enough, cannot reflect the actual situation on site, and there is a risk of losing abnormal data. Summary of the invention
[0006] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and provide a method, system, device and storage medium for continuous data collection and transmission, so as to realize continuous data collection and transmission, reflect the real situation on site, avoid the risk of losing abnormal data, and thus improve real-time performance.
[0007] In order to achieve the above object, the present invention adopts the following technical solutions:
[0008] A method for continuous data collection and transmission includes the following steps:
[0009] S1, collect data according to the set period;
[0010] S2, according to the maximum total amount of data received by the sending unit in a single time, in each collection cycle, when the maximum total amount of data received by the sending unit in a single time is collected, the data is written into the sending unit;
[0011] S3, after receiving each piece of data, the sending unit immediately transmits the data over the air;
[0012] S4, after one cycle of data collection is completed, the sending unit completes the air transmission of all collected data and proceeds to the next cycle of data collection.
[0013] Preferably, a single chip microcomputer is used to collect data and send the data to a sending unit.
[0014] Preferably, the sending unit adopts a Lora module.
[0015] Preferably, in S2, the data is sent to the sending unit via DMA transmission.
[0016] Preferably, a Uart-Lora communication module is used for air transmission of data.
[0017] Preferably, the data collected and transmitted are cable dancing posture signals when the cable is shaking or vibrating.
[0018] A data continuous acquisition and transmission system, comprising:
[0019] The acquisition module is used to collect data according to a set period;
[0020] A data writing module is used to write the data into the sending unit when the maximum total amount of data received by the sending unit in a single time is collected in each collection cycle according to the maximum total amount of data received by the sending unit in a single time;
[0021] The air transmission module is used for transmitting the data in the air immediately after the sending unit receives each piece of data;
[0022] The cycle completion module is used to complete the air transmission of all collected data by the sending unit after the data collection of one cycle is completed, and then carry out the data collection of the next cycle.
[0023] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above-mentioned methods for continuous data collection and transmission when executing the computer program.
[0024] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for continuous data collection and transmission as described in any one of the above items are implemented.
[0025] Compared with the prior art, the present invention has the following beneficial effects:
[0026] The present invention utilizes the collection gap to perform data packet transmission based on the maximum total amount of data received at a single time by the sending unit, and transmits multiple groups of data in batches within one cycle, thereby realizing collection and continuous transmission, realizing continuous data collection and reflecting the actual situation on site, avoiding the risk of losing abnormal data, and improving real-time performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a statistical schematic diagram of data collection time of the present invention;
[0028] Figure 2 It is a transmission time decomposition statistical schematic diagram of the present invention;
[0029] Figure 3 It is a schematic diagram of the statistical decomposition of the transmission time using the DMA transmission mode of the present invention;
[0030] Figure 4 This is a schematic diagram of data transmission of 0-250ms of the present invention;
[0031] Figure 5 This is a schematic diagram of data transmission at 500ms of the present invention;
[0032] Figure 6 This is a schematic diagram of data transmission at 750ms of the present invention;
[0033] Figure 7 This is a schematic diagram of data transmission at 1000ms of the present invention;
[0034] Figure 8 This is a schematic diagram of data transmission at 1250ms according to the present invention. DETAILED DESCRIPTION
[0035] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0036] It should be noted that the words "front", "rear", "left", "right", "up" and "down" used in the following description refer to directions in the drawings, and the words "inside" and "outside" refer to directions toward or away from the geometric center of a specific component, respectively.
[0037] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0038] The method for continuous data collection and transmission of the present invention comprises the following steps:
[0039] S1, using a single-chip microcomputer to collect data according to a set period;
[0040] S2, according to the maximum total amount of data received at a single time by the sending unit, in each collection cycle, each time the maximum total amount of data received at a single time by the sending unit is collected, the single chip microcomputer sends the data to the sending unit through DMA transmission.
[0041] The sending unit uses the Lora module.
[0042] S3, after receiving each piece of data, the Lora module immediately transmits the data over the air;
[0043] S4, after one cycle of data collection is completed, the Lora module completes the air transmission of all collected data and proceeds to the next cycle of data collection.
[0044] The data collected and transmitted are the cable dancing posture signals of the high-speed rail's external cables during shaking or vibration.
[0045] The specific process ideas are:
[0046] In order to achieve the goal of continuous data collection and transmission, we need to first calculate the collection and transmission time.
[0047] 1 Collection time
[0048] The data is collected at 120Hz and each data collection occupies 6 bytes. For example, the air rate is 9600 and each data packet is 800 bytes.
[0049] 120 batches of data are collected per second, and the cycle of each batch of data is 8.3ms. After actual testing, the actual time for collecting each batch of data is 10us. Figure 1 As shown, there is about 8ms of idle time in each acquisition cycle.
[0050] 2Transmission time
[0051] The total transmission time is the time it takes the MCU to write to the LoRa module, plus the air transmission time.
[0052] The Lora module used in the product can receive a maximum of 200 bytes of data written by the microcontroller each time, so the entire 800 bytes needs to be written in 4 times.
[0053] The microcontroller writes to the Lora module, currently writing byte by byte, with a baud rate of 115200. It takes about 20ms to write 200 bytes each time.
[0054] The current air transmission rate is 9600, and the total air transmission time of 800 bytes is about 1 second. If the air transmission rate is increased to 19200, the total air transmission time of 800 bytes is about 0.5 seconds. Figure 2 As shown, if 800 bytes are divided into 4 times and written into the Lora module, 200 bytes are transmitted over the air each time, which is about 100ms based on 19200bps.
[0055] If the MCU uses DMA transmission to write Lora, writing 200 bytes only takes a few clock cycles, that is, a few microseconds, specifically about 0.01ms, which greatly reduces the writing time. Figure 3 As shown, there is a blank area of nearly 20ms between each writing of 200 bytes and the air transmission of the 200 bytes. Therefore, this period of time is sufficient for one acquisition and one write, and the two will not interfere with each other, so that the microcontroller can collect and write normally.
[0056] Therefore, in order to improve the transmission efficiency, it is necessary to make use of the blank time of collection and send data in the intervals of collection.
[0057] like Figure 4-8 As shown, the MCU first collects data at a cycle of 8.3ms. When enough 200 bytes of data are collected, it is about 250ms. Then, in the collection gap, the data is sent to the Lora module through DMA transmission. After receiving the data, the Lora module will immediately start air transmission. Air transmission takes 100ms, that is, by 350ms, the first 200 bytes of data have been transmitted; by 500ms, the second batch of 200 bytes of data is ready, and the MCU uses the collection gap to continue to transfer data to the Lora module through DMA for air transmission. Then comes the 750ms and 1000ms. After the 1 second data collection is completed, the entire 1 second of data is sent after a delay of about 100ms. The first 200 bytes of data in the next second will also be sent at 1250ms. In this way, real-time transmission is achieved while collecting.
[0058] The following are device embodiments of the present invention, which can be used to perform method embodiments of the present invention. For details not disclosed in the device embodiments, please refer to the method embodiments of the present invention.
[0059] In another embodiment of the present invention, a continuous data acquisition and transmission system is provided, which can be used to implement the above-mentioned continuous data acquisition and transmission method. Specifically, the continuous data acquisition and transmission system includes an acquisition module, a data writing module, an air transmission module and a cycle completion module.
[0060] Among them, the acquisition module is used to collect data according to the set period.
[0061] The data writing module is used to write the data into the sending unit when the maximum total amount of data received at a single time by the sending unit is collected in each collection cycle according to the maximum total amount of data received at a single time by the sending unit.
[0062] The air transmission module is used for transmitting the data in the air immediately after the sending unit receives each piece of data.
[0063] The cycle completion module is used to complete the data collection of one cycle, and the sending unit completes the air transmission of all the collected data and starts the data collection of the next cycle.
[0064] In yet another embodiment of the present invention, a terminal device is provided. The terminal device includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement corresponding method processes or corresponding functions; the processor described in the embodiment of the present invention can be used for the operation of the data continuous collection and transmission method, including: S1, collecting data according to a set cycle; S2, according to the maximum total amount of data received by the sending unit in a single time, in each collection cycle, when the maximum total amount of data received by the sending unit in a single time is collected, the data is written into the sending unit; S3, after each data is received by the sending unit, the data is immediately transmitted over the air; S4, after the data collection of one cycle is completed, the sending unit completes the air transmission of all the collected data and performs data collection for the next cycle.
[0065] In another embodiment, the present invention further provides a computer-readable storage medium (Memory), which is a memory device in a terminal device for storing programs and data. It is understandable that the computer-readable storage medium here can include both the built-in storage medium in the terminal device and the extended storage medium supported by the terminal device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory.
[0066] One or more instructions stored in a computer-readable storage medium can be loaded and executed by a processor to implement the corresponding steps of the method for continuous data collection and transmission in the above-mentioned embodiment; one or more instructions in the computer-readable storage medium are loaded by the processor and the following steps are executed: S1, collecting data according to a set period; S2, according to the maximum total amount of data received by the sending unit in a single time, in each collection cycle, each time the maximum total amount of data received by the sending unit in a single time is collected, the data is written into the sending unit; S3, after each piece of data is received by the sending unit, the sending unit immediately transmits the data over the air; S4, until the data collection of one cycle is completed, the sending unit completes the air transmission of all the collected data and performs data collection for the next cycle.
[0067] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0068] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0069] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0070] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0071] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0072] It should be understood that the above description is for illustration and not for limitation. Many embodiments and many applications beyond the examples provided will be apparent to those skilled in the art upon reading the above description. Therefore, the scope of the present teachings should not be determined with reference to the above description, but rather with reference to the foregoing claims and the full scope of equivalents to which such claims are entitled. For the purpose of comprehensiveness, all articles and references, including disclosures of patent applications and publications, are incorporated herein by reference. The omission of any aspect of the subject matter disclosed herein in the foregoing claims is not intended to be a waiver of such subject matter, nor should it be considered that the applicant has not considered such subject matter to be part of the disclosed inventive subject matter.
Claims
1. A method for continuous data collection and transmission, characterized in that: The process includes: S1, collect data according to the set cycle; use the single chip microcomputer to collect data and send it to the sending unit; S2, according to the maximum total amount of data received by the sending unit in a single time, in each collection cycle, when the maximum total amount of data received by the sending unit in a single time is collected, the data is sent to the sending unit through the DMA transmission mode, and the sending unit adopts the Lora module; S3, after receiving each piece of data, the sending unit immediately transmits the data over the air; S4, after one cycle of data collection is completed, the sending unit completes the air transmission of all collected data and proceeds to the next cycle of data collection; When the data is collected at 120Hz and each collected data occupies 6 bytes, and the air rate is 9600 and each data packet is 800 bytes: 120 batches of data are collected per second, and the cycle of each batch of data is 8.3ms. The actual time for collecting each batch of data is 10us. In each collection cycle, there is 8ms of idle time; The Lora module used in the product can receive a maximum of 200 bytes of data written by the microcontroller each time, and the entire 800 bytes needs to be written in 4 times; The MCU first collects data at a cycle of 8.3ms. When 200 bytes of data are collected, it is about 250ms. Then, in the collection gap, the data is sent to the Lora module through DMA transmission. After receiving the data, the Lora module will immediately start air transmission. The air transmission takes 100ms. When it takes 350ms, the first 200 bytes of data have been transmitted. When it takes 500ms, the second batch of 200 bytes of data is ready. The MCU uses the collection gap to continue to transfer data to the Lora module through DMA for air transmission. Then it is 750ms and 1000ms. After 1 second of data collection is completed, there is a delay of about 100ms, and the entire 1 second of data is sent. The first 200 bytes of data in the next second will also be sent at 1250ms.
2. The method for continuous data collection and transmission according to claim 1, characterized in that: Uart-Lora communication module is used for air transmission of data.
3. The method for continuous data collection and transmission according to claim 1, characterized in that: The data collected and transmitted are the cable dancing posture signals when the cable is shaking or vibrating.
4. A data continuous acquisition and transmission system, characterized in that: include: The acquisition module is used to collect data according to a set period; A single chip microcomputer is used to collect data and send it to the sending unit; A data writing module is used to write the data into the sending unit when the maximum total amount of data received by the sending unit in a single time is collected in each collection cycle according to the maximum total amount of data received by the sending unit in a single time; The air transmission module is used for transmitting the data in the air immediately after the sending unit receives each piece of data; The cycle completion module is used to complete the air transmission of all collected data by the sending unit after the data collection of one cycle is completed, and then proceed to the data collection of the next cycle; When the data is collected at 120Hz and each collected data occupies 6 bytes, and the air rate is 9600 and each data packet is 800 bytes: 120 batches of data are collected per second, and the cycle of each batch of data is 8.3ms. The actual time for collecting each batch of data is 10us. In each collection cycle, there is 8ms of idle time; The Lora module used in the product can receive a maximum of 200 bytes of data written by the microcontroller each time, and the entire 800 bytes needs to be written in 4 times; The MCU first collects data at a cycle of 8.3ms. When 200 bytes of data are collected, it is about 250ms. Then, in the collection gap, the data is sent to the Lora module through DMA transmission. After receiving the data, the Lora module will immediately start air transmission. The air transmission takes 100ms. When it takes 350ms, the first 200 bytes of data have been transmitted. When it takes 500ms, the second batch of 200 bytes of data is ready. The MCU uses the collection gap to continue to transfer data to the Lora module through DMA for air transmission. Then it is 750ms and 1000ms. After 1 second of data collection is completed, there is a delay of about 100ms, and the entire 1 second of data is sent. The first 200 bytes of data in the next second will also be sent at 1250ms.
5. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method for continuous data collection and transmission as claimed in any one of claims 1 to 3 are implemented.
6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for continuous data collection and transmission as claimed in any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Data acquisition device for safety monitoring
CN111245954A