Data storage method, data acquisition recorder and electronic equipment
By using comma-separated value files in the data acquisition recorder to store and read temperature and humidity data in real time, the problem of low data reading efficiency in cold chain logistics is solved, and the efficiency and simplicity of data reading is achieved.
Patent Information
- Application Number
- CN202010947446.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-10
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2040-09-10
AI Technical Summary
In cold chain logistics, as the transportation time is extended, the storage amount of temperature and humidity data increases, and the method of reading data one by one greatly reduces the data reading efficiency.
Using a data acquisition recorder, the collected temperature and humidity data is written to the memory in real time in the form of comma-separated value files, providing a unique data identifier, and directly reading the comma-separated value files when needed to obtain all data, improving data reading Efficiency.
Through this method, data reading efficiency can be significantly improved, data acquisition process can be simplified, storage capacity requirements can be reduced, and data from all data acquisition sensors can be read directly when needed.
Smart Images

Figure CN112084147B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a data storage method, a data acquisition recorder and electronic equipment. Background Art
[0002] Cold chain logistics usually has high requirements on the environmental conditions of the transported goods during transportation. Temperature and humidity recorders that can collect temperature and humidity data play a vital role in cold chain logistics.
[0003] In the related technology, the temperature and humidity recorder will store the collected temperature and humidity data in a memory. When logistics personnel need to understand the temperature and humidity data during transportation, they need to read the temperature and humidity data stored in the temperature and humidity recorder from the memory one by one. As the transportation time increases, the number of temperature and humidity data stored in the memory increases. Reading the temperature and humidity data one by one greatly reduces the data reading efficiency. Summary of the invention
[0004] The embodiments of the present invention provide a data storage method, a data acquisition recorder and an electronic device to achieve the technical effect of improving data reading efficiency.
[0005] In one aspect of the present invention, a data storage method is provided, which is applied to a data acquisition recorder, wherein the data acquisition recorder comprises a data acquisition sensor and a memory, and the method comprises:
[0006] Acquire target data representing surrounding storage environment conditions collected by the data collection sensor;
[0007] Assigning a data unique identifier to the target data;
[0008] Writing the data unique identifier and target data into a data collection area, wherein the data collection area is a data area in a pre-created comma-separated value file for storing data collected by the data collection sensor;
[0009] The comma separated values file is stored in the memory.
[0010] Optionally, the method further includes:
[0011] When a reading condition for reading the comma-separated value file is met, performing data statistics on the target data contained in the comma-separated value file to obtain a statistical result;
[0012] The statistical results are written into a statistical data area, wherein the statistical data area is a data area in the comma separated value file for storing statistical results.
[0013] Optionally, the step of assigning an identifier to the target data includes:
[0014] Determining whether the target data is within a preset data range;
[0015] If yes, determine the time when the target data is collected, and determine the time as the data unique identifier of the target data.
[0016] Optionally, the step of performing data statistics on the target data contained in the comma separated value file to obtain statistical results includes:
[0017] Calculate the average of the target data contained in the comma-separated value file;
[0018] Count the maximum and minimum values of the target data contained in the comma-separated value file.
[0019] In another aspect of the present invention, a data acquisition recorder is provided, the data acquisition recorder comprises: a data acquisition sensor and a memory, the data acquisition recorder further comprises:
[0020] An acquisition module, connected to the data acquisition sensor, for acquiring target data representing surrounding storage environment conditions collected by the data acquisition sensor;
[0021] An allocation module, connected to the acquisition module, for allocating a data unique identifier to the target data;
[0022] A writing module connected to the allocation module is used to write the data unique identifier and the target data into a data collection area, wherein the data collection area is a data area in a pre-created comma-separated value file for storing data collected by the data collection sensor;
[0023] A storage module is connected to the writing module and the memory and is used for storing the comma separated value file in the memory.
[0024] Optionally, the data acquisition recorder also includes:
[0025] A statistical module connected to the writing module is used to perform data statistics on the target data contained in the comma-separated value file to obtain statistical results when the reading condition of the comma-separated value file is met;
[0026] The writing module is further used to write the statistical results into a statistical data area, wherein the statistical data area is a data area in the comma separated value file for storing statistical results.
[0027] Optionally, the writing module includes:
[0028] A first determining unit, used to determine whether the target data is within a preset data range;
[0029] The second determining unit is connected to the first determining unit and is used to determine the time of collecting the target data within a preset data range, and determine the time as the data unique identifier of the target data.
[0030] Optionally, the statistics module includes:
[0031] a calculation unit, used for calculating the average value of the target data contained in the comma-separated value file;
[0032] A statistical unit is connected to the statistical unit and is used to count the maximum value and the minimum value of the target data contained in the comma-separated value file.
[0033] Another aspect of the present invention provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0034] A memory for storing processor executable instructions;
[0035] The processor is used to implement the above data storage method when executing instructions stored in the memory.
[0036] A data storage method, a data acquisition recorder, and an electronic device provided by an embodiment of the present invention include: obtaining target data collected by the data acquisition sensor that characterizes the surrounding storage environment conditions; assigning a unique data identifier to the target data, and writing the identifier and the target data into a collection data area in a pre-created comma-separated value file for storing the data collected by the data acquisition sensor; and storing the comma-separated value file in the memory. By applying the solution provided by the embodiment of the present invention, the data collected by the data acquisition sensor can be written into the comma-separated value file in real time, that is, the data is stored in the memory in the form of a comma-separated value file. When data needs to be read, the comma-separated value file can be directly read to obtain the data collected by all data acquisition sensors, thereby improving the data reading efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings:
[0038] Figure 1 A schematic diagram of a flow chart of a first data storage method provided by an embodiment of the present invention;
[0039] Figure 2A schematic diagram of a flow chart of a second data storage method provided by an embodiment of the present invention;
[0040] Figure 3 A schematic diagram of a flow chart of a third data storage method provided by an embodiment of the present invention;
[0041] Figure 4 A structural schematic diagram of a data acquisition recorder provided by an embodiment of the present invention;
[0042] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0044] See also Figure 1 , is a flow chart of a data storage method provided by an embodiment of the present invention, which is applied to a data acquisition recorder, the data acquisition recorder includes: a data acquisition sensor and a memory, and the method includes:
[0045] S100, obtaining target data representing surrounding storage environment conditions collected by data collection sensors.
[0046] In implementation, the data acquisition recorder can be a temperature and humidity data acquisition recorder, and accordingly, the data acquisition sensor also includes: a data acquisition sensor for collecting temperature data and a data acquisition sensor for collecting humidity data; the data acquisition recorder can also be an air pressure data acquisition recorder, and accordingly, the data acquisition sensor includes: a data acquisition sensor for collecting air pressure data.
[0047] In implementation, after the data acquisition recorder is turned on, a time interval for collecting data can be set in the data acquisition recorder. After the data acquisition recorder starts working, the data acquisition sensor can be driven to collect target data according to the set time interval.
[0048] The warehousing environment refers to the warehouses, containers and other environments used to store items in logistics.
[0049] The target data is the data that represents the environmental conditions in the storage environment, such as temperature, humidity, air pressure and other data.
[0050] S110, allocating a data unique identifier to the target data.
[0051] In implementation, the data unique identifier is a mark used to mark the uniqueness of the data. In one implementation, the data unique identifier can be numbers, letters, or a combination of numbers and letters.
[0052] In order to intuitively understand the collection time of the target data when viewing the target data, in implementation, the collection time can be used as the unique data identifier of the target data.
[0053] For details, see Figure 2 A schematic flow chart of a second data storage method provided in an embodiment of the present invention, wherein S100, S120, S130 and Figure 1 S100, S120, and S130 are the same and will not be described in detail here. S110 includes:
[0054] S111 determines whether the target data is within a preset data range; if so, execute S112 to determine the time when the target data was collected, and determine the time as the data unique identifier of the target data; if not, discard the data and return to execute S100.
[0055] The preset data range is a numerical range used to determine the validity of the target data. For example, the data range of the temperature data may be 24-26 degrees, that is, if the target data is within the range of 24-26 degrees, it is determined as valid data, otherwise it is determined as invalid data.
[0056] S120, writing the data unique identifier and the target data into the collected data area.
[0057] The collected data area is a data area in a pre-created comma-separated value file used to store data collected by the data collection sensor.
[0058] Comma-Separated Values (CSV) files are simple to store and can reduce the capacity of data storage. For example, the first target data is collected at 2020 / 01 / 01 00:01, and the collected target data includes: temperature 25.0, humidity 50; the second target data is collected at 2020 / 01 / 01 00:02, and the collected target data includes: temperature 25.0, humidity 50; then the data format written to the CSV file can be:
[0059] Time, Temperature, Humidity
[0060] 2020 / 01 / 01 00:01,25.0,50
[0061] 2020 / 01 / 01 00:02,25.0,50
[0062] S130, storing the comma separated value file in a memory.
[0063] The target data is stored in the memory in the form of a comma-separated value file. Accordingly, when it is necessary to read the data recorded by the data acquisition recorder, all the data can be obtained by directly reading the comma-separated value file, thereby improving the data reading efficiency.
[0064] See also Figure 3 , is a flow chart of a third data storage method provided by an embodiment of the present invention, in which S100-S130 and Figure 2 The steps S100-S130 are the same and will not be repeated here, and also include:
[0065] S140, when a reading condition for reading a comma-separated value file is met, performing data statistics on target data included in the comma-separated value file to obtain a statistical result.
[0066] In implementation, the data acquisition recorder may also include a USB interface. When the USB interface is connected to a device with storage function such as a mobile phone or a mobile hard disk, it is determined that the reading condition of the comma-separated value file is met. The data acquisition recorder may also include a wireless communication module, such as an infrared, Bluetooth or other wireless communication module. When other devices with the same wireless communication module are connected to the data acquisition recorder, it is determined that the reading condition of the comma-separated value file is met. Of course, the data acquisition recorder can also perform data statistics after the number of target data reaches a predetermined number.
[0067] Specifically, the average value of the target data contained in the comma-separated value file may be calculated; and the maximum value and the minimum value of the target data contained in the comma-separated value file may be counted to obtain the statistical result.
[0068] S150, writing the statistical results into the statistical data area.
[0069] The statistical data area is the data area in the comma-separated value file used to store statistical results.
[0070] By writing the statistical results into a comma-separated value file, you can intuitively understand the overall situation of all target data through the statistical results recorded in the comma-separated value file. Continuing with the above two target data as an example, the data format for writing the statistical results of the above two data into a CSV file can be:
[0071] Device ID, AACC8888
[0072] Average Temperature, 25.0
[0073] Average Humidity, 50
[0074] Device ID represents the device identifier, that is, the device identifier is used to uniquely mark the statistical results.
[0075] See also Figure 4 , is a structural diagram of a data acquisition recorder provided by an embodiment of the present invention, the data acquisition recorder includes: a data acquisition sensor and a memory, the data acquisition recorder also includes:
[0076] An acquisition module 400, connected to the data acquisition sensor, is used to acquire target data representing surrounding storage environment conditions collected by the data acquisition sensor;
[0077] An allocation module 410, connected to the acquisition module, for allocating a data unique identifier to the target data;
[0078] A writing module 420, connected to the allocation module, is used to write the data unique identifier and the target data into a data collection area, wherein the data collection area is a data area in a pre-created comma-separated value file for storing data collected by the data collection sensor;
[0079] The storage module 430 is connected to the writing module and the memory and is used to store the comma separated value file in the memory.
[0080] In one implementation, the data acquisition recorder further includes:
[0081] A statistical module connected to the writing module is used to perform data statistics on the target data contained in the comma-separated value file to obtain statistical results when the reading condition of the comma-separated value file is met;
[0082] The writing module 420 is further used to write the statistical results into a statistical data area, wherein the statistical data area is a data area in the comma separated value file for storing statistical results.
[0083] In one implementation, the writing module 420 includes:
[0084] A first determining unit, used to determine whether the target data is within a preset data range;
[0085] The second determining unit is connected to the first determining unit and is used to determine the time of collecting the target data within a preset data range, and determine the time as the data unique identifier of the target data.
[0086] In one implementation, the statistics module includes:
[0087] a calculation unit, used for calculating the average value of the target data contained in the comma-separated value file;
[0088] A statistical unit is connected to the statistical unit and is used to count the maximum value and the minimum value of the target data contained in the comma-separated value file.
[0089] By applying the solution provided in the embodiment of the present invention, the data collected by the data acquisition sensor can be written into a comma separated value file in real time, that is, the data can be stored in the memory in the form of a comma separated value file. When the data needs to be read, the comma separated value file can be directly read to obtain the data collected by all data acquisition sensors, thereby improving the data reading efficiency.
[0090] The embodiment of the present invention further provides an electronic device, such as Figure 5 As shown, it includes a processor 001, a communication interface 002, a memory 003 and a communication bus 004, wherein the processor 001, the communication interface 002, and the memory 003 communicate with each other through the communication bus 004.
[0091] Memory 003, used for storing computer programs;
[0092] The processor 001 is used to implement a data storage method applied to a data acquisition recorder when executing a program stored in the memory 003. The method includes:
[0093] Acquire target data representing surrounding storage environment conditions collected by the data collection sensor;
[0094] Assigning a data unique identifier to the target data;
[0095] Writing the data unique identifier and target data into a data collection area, wherein the data collection area is a data area in a pre-created comma-separated value file for storing data collected by the data collection sensor;
[0096] The comma separated values file is stored in the memory.
[0097] By applying the solution provided in the embodiment of the present invention, the data collected by the data acquisition sensor can be written into a comma separated value file in real time, that is, the data can be stored in the memory in the form of a comma separated value file. When the data needs to be read, the comma separated value file can be directly read to obtain the data collected by all data acquisition sensors, thereby improving the data reading efficiency.
[0098] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0099] The communication interface is used for communication between the above electronic device and other devices.
[0100] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0101] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0102] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0103] 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. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0104] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the data acquisition recorder and electronic device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0105] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A data storage method, characterized in that: Applied to a data acquisition recorder, the data acquisition recorder comprises: a data acquisition sensor and a memory, the method comprises: Obtaining target data representing the surrounding storage environment conditions collected by the data collection sensor, setting a time interval for collecting data in the data collection recorder, and after the data collection recorder starts working, driving the data collection sensor to collect target data according to the set time interval; Assigning a data unique identifier to the target data; Writing the data unique identifier and target data into a data collection area, wherein the data collection area is a data area in a pre-created comma-separated value file for storing data collected by the data collection sensor; storing the comma separated value file in the memory; The step of assigning a unique data identifier to the target data includes: determining whether the target data is within a preset data range; if so, determining the time when the target data was collected, and determining the time as the unique data identifier of the target data; The method further comprises: when a reading condition of the comma-separated value file is met, performing data statistics on the target data contained in the comma-separated value file to obtain a statistical result; writing the statistical result into a statistical data area, wherein the statistical data area is a data area in the comma-separated value file for storing the statistical result; The data acquisition recorder also includes a USB interface. When the USB interface is connected to a device with a storage function such as a mobile phone or a mobile hard disk, it is determined that the reading condition of the comma-separated value file is met; and / or, the data acquisition recorder also includes a wireless communication module. When other devices that also have the wireless communication module are connected to the data acquisition recorder for communication, it is determined that the reading condition of the comma-separated value file is met; The step of performing data statistics on the target data contained in the comma separated value file to obtain statistical results includes: Calculate the average of the target data contained in the comma-separated value file; Count the maximum and minimum values of the target data contained in the comma-separated value file.
2. A data acquisition recorder, characterized in that: The data acquisition recorder includes: a data acquisition sensor and a memory, and the data acquisition recorder also includes: An acquisition module, connected to the data acquisition sensor, for acquiring target data representing surrounding storage environment conditions collected by the data acquisition sensor; An allocation module, connected to the acquisition module, for allocating a unique data identifier to the target data, setting a time interval for collecting data in a data acquisition recorder, and after the data acquisition recorder starts working, driving a data acquisition sensor to collect target data according to the set time interval; A writing module connected to the allocation module is used to write the data unique identifier and the target data into a data collection area, wherein the data collection area is a data area in a pre-created comma-separated value file for storing data collected by the data collection sensor; the writing module includes: a first determination unit, used to determine whether the target data is within a preset data range; a second determination unit, connected to the first determination unit, used to determine the time of collecting the target data if it is within the preset data range, and determine the time as the data unique identifier of the target data; A storage module connected to the writing module and the memory for storing the comma separated value file in the memory; The data acquisition recorder also includes: A statistical module connected to the writing module is used to perform data statistics on the target data contained in the comma-separated value file to obtain statistical results when the reading condition of the comma-separated value file is met; The writing module is further used to write the statistical results into a statistical data area, wherein the statistical data area is a data area in the comma separated value file for storing statistical results; The statistical module comprises: a calculation unit, used for calculating the average value of the target data contained in the comma-separated value file; A statistical unit is connected to the statistical unit and is used to count the maximum value and the minimum value of the target data contained in the comma-separated value file.
3. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; A memory for storing processor executable instructions; The processor is used to implement the method steps described in claim 1 when executing instructions stored in the memory.
Citation Information
Patent Citations
Wireless transmission method for sensor data
CN105516235A
Data import method and device and electronic equipment
CN109828964A
Data acquisition method and device
CN110324211A
Time series data storage method and device, server and storage medium
CN111125089A
