[go: up one dir, main page]

CN116320041A - Data compression and analysis method, vehicle, electronic device and storage medium - Google Patents

Data compression and analysis method, vehicle, electronic device and storage medium Download PDF

Info

Publication number
CN116320041A
CN116320041A CN202310341060.9A CN202310341060A CN116320041A CN 116320041 A CN116320041 A CN 116320041A CN 202310341060 A CN202310341060 A CN 202310341060A CN 116320041 A CN116320041 A CN 116320041A
Authority
CN
China
Prior art keywords
bit
signal
data
flag
signal value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310341060.9A
Other languages
Chinese (zh)
Inventor
余健
姬亚伟
汤志明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zero Beam Technology Co ltd
Original Assignee
Zero Beam Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zero Beam Technology Co ltd filed Critical Zero Beam Technology Co ltd
Priority to CN202310341060.9A priority Critical patent/CN116320041A/en
Publication of CN116320041A publication Critical patent/CN116320041A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请实施例提供了一种数据压缩、解析方法、车辆、电子设备和存储介质,数据压缩方法,包括:按照预设的采集周期采集到n个信号值;生成n个信号值对应的数据包,数据包中包括存储位以及标志位,标志位的位数为n,标志位的第i位用于标识第i个与第i‑1个信号值不同,i大于等于2,存储位用于存储第1个信号值以及被标志位标识为不同的第j个信号值,j大于等于2;发送数据包。本申请通过将不重复的信号值存储于数据包内,过滤掉重复的信号值,并利用标志位对存储的信号值进行标识,通过优化数据组织形式过滤掉了采集的信号的重复值,从而减少数据体积,实现数据的压缩。

Figure 202310341060

An embodiment of the present application provides a data compression and analysis method, a vehicle, an electronic device, and a storage medium, and a data compression method, including: collecting n signal values according to a preset collection cycle; generating data packets corresponding to the n signal values , the data packet includes storage bits and flag bits, the number of flag bits is n, the i-th bit of the flag bit is used to identify the i-th signal value is different from the i-1-th signal value, i is greater than or equal to 2, and the storage bit is used for Store the first signal value and the jth signal value identified as different by the flag bit, j is greater than or equal to 2; send the data packet. This application stores non-repetitive signal values in data packets, filters out repeated signal values, uses flag bits to identify stored signal values, and filters out repeated values of collected signals by optimizing the data organization form, thereby Reduce data volume and realize data compression.

Figure 202310341060

Description

数据压缩、解析方法、车辆、电子设备和存储介质Data compression, analysis method, vehicle, electronic device and storage medium

技术领域technical field

本申请属于数据处理领域,尤其涉及一种数据压缩、解析方法、车辆、电子设备和存储介质。The application belongs to the field of data processing, and in particular relates to a data compression and analysis method, a vehicle, an electronic device and a storage medium.

背景技术Background technique

随着网联与智能化特别是自动驾驶技术的发展,汽车上的传感器和电控单元越来越多,车内软件系统也越来越复杂,对算力的需求也大幅提升,汽车已经演变成了一台移动的“超级电脑”。这台“超级电脑”在运行时会产生大量数据,极端情况下一台车一天甚至可产生3TB以上的数据。而云端基于远程控制、新能源监控、远程故障诊断和自动驾驶学习等需求,需要采集车内的相关数据并上传至云端,传统车云数据传输方式是预先定义好所有信号数据的排列顺序,然后以固定的频率采集这些信号的数据,为了方便传输,一般会将多次采集的数据文件合并成一个文件再上传,这样会使总体数据体积较大,不仅占用存储空间还会导致数据上传时的时间较长。With the development of networking and intelligence, especially autonomous driving technology, there are more and more sensors and electronic control units on the car, the software system in the car is becoming more and more complex, and the demand for computing power has also increased significantly. The car has evolved It has become a mobile "supercomputer". This "supercomputer" will generate a large amount of data when it is running. In extreme cases, a car can even generate more than 3TB of data a day. Based on the requirements of remote control, new energy monitoring, remote fault diagnosis and automatic driving learning, the cloud needs to collect relevant data in the car and upload it to the cloud. The traditional car cloud data transmission method is to pre-define the arrangement order of all signal data, and then The data of these signals is collected at a fixed frequency. In order to facilitate transmission, the data files collected multiple times are generally combined into one file and then uploaded. This will make the overall data volume larger, not only occupying storage space but also causing data uploading. A long time.

因此面对数以万计的车辆产生的海量数据,如何高效、低成本的将数据传输到云端系统,这是急需解决的问题。Therefore, in the face of the massive data generated by tens of thousands of vehicles, how to transmit data to the cloud system efficiently and at low cost is an urgent problem to be solved.

发明内容Contents of the invention

有鉴于此,本申请实施例所解决的技术问题之一在于提供一种数据压缩、解析方法、车辆、电子设备和存储介质,用以克服或避免上述问题。In view of this, one of the technical problems solved by the embodiments of the present application is to provide a data compression and analysis method, a vehicle, an electronic device and a storage medium, so as to overcome or avoid the above problems.

基于上述目的,本申请提供一种数据压缩方法,包括:按照预设的采集周期采集到n个信号值;生成所述n个信号值对应的数据包,所述数据包中包括存储位以及标志位,所述标志位的位数为n,所述标志位的第i位用于标识第i个与第i-1个信号值不同,i大于等于2,所述存储位用于存储第1个信号值以及被所述标志位标识为不同的第j个信号值,j大于等于2;发送所述数据包。Based on the above purpose, the present application provides a data compression method, including: collecting n signal values according to a preset collection period; generating data packets corresponding to the n signal values, and the data packets include storage bits and flags bit, the number of bits of the flag bit is n, the i-th bit of the flag bit is used to identify that the i-th signal value is different from the i-1-th signal value, i is greater than or equal to 2, and the storage bit is used to store the first signal values and the jth signal value identified as different by the flag bit, j is greater than or equal to 2; sending the data packet.

可选地,所述标志位的第1位用于标识所述n个信号值全不相同。Optionally, the first bit of the flag bit is used to identify that the n signal values are all different.

可选地,所述n个信号值为按照预设的采集周期采集到的同一个信号的信号值。Optionally, the n signal values are signal values of the same signal collected according to a preset collection period.

可选地,所述数据包的数量包括若干个,所述数据包对应的信号名被存储于信号表中,在所述发送所述数据包之前,还包括:按照若干个所述数据包对应的信号名在所述信号表中的排列顺序,对若干个所述数据包进行排序;将排序后的若干个所述数据包进行打包,得到若干个所述数据包的组合包;所述发送所述数据包,包括:发送所述组合包。Optionally, the number of the data packets includes several, the signal names corresponding to the data packets are stored in the signal table, and before the sending of the data packets, it also includes: The order of arrangement of the signal names in the signal table, sorting several of the data packets; packing the sorted several of the data packets to obtain a combination of several of the data packets; the sending The data packet includes: sending the combined packet.

可选地,在所述发送所述数据包时,若网络不可用,则生成所述组合包对应的缓存文件。Optionally, when the data packet is sent, if the network is unavailable, a cache file corresponding to the combination packet is generated.

本申请实施例还提供了一种数据解析方法,包括:接收并解析数据包,确定所述数据包中的存储位以及标志位的值,并根据所述存储位和所述标志位的值得到n个信号值;其中,根据所述存储位和所述标志位的值得到n个信号值,包括:针对被所述标志位标识为不同的第j位信号值,将所述存储位中存储的信号值设置为第j位对应的信号值;按照所述标志位的第1位至第n位的顺序,依次将被所述标志位标识为相同的第k位对应的信号值设置为第k-1位对应的信号值,k大于等于2。The embodiment of the present application also provides a data parsing method, including: receiving and parsing a data packet, determining the value of the storage bit and the flag bit in the data packet, and obtaining the n signal values; wherein, obtaining n signal values according to the value of the storage bit and the flag bit includes: for the jth signal value identified as different by the flag bit, storing in the storage bit Set the signal value of the signal value corresponding to the j-th bit; according to the order of the first bit to the n-th bit of the flag bit, set the signal value corresponding to the k-th bit identified as the same by the flag bit as the first The signal value corresponding to k-1 bits, where k is greater than or equal to 2.

可选地,所述接收并解析数据包,包括:接收若干个数据包组成的组合包;根据信号表中按照预设顺序存储的信号名,以及所述组合包中的若干个所述数据包的排列顺序,确定所述数据包对应的信号名。Optionally, the receiving and parsing of data packets includes: receiving a composite packet composed of several data packets; according to the signal names stored in a preset order in the signal table, and several of the data packets in the composite packet to determine the signal name corresponding to the data packet.

本申请实施例还提供了一种数据压缩及解析系统,包括:信号采集装置、车端处理装置、数据传输装置、云端处理装置;所述信号采集装置用于按照预设的采集周期采集信号值;所述车端处理装置用于生成所述n个信号值对应的数据包,所述数据包中包括存储位以及标志位,所述标志位的位数为n,所述标志位的第i位用于标识第i个与第i-1个信号值不同,i大于等于2,所述存储位用于存储第1个信号值以及被所述标志位标识为不同的第j信号值,j大于等于2;所述数据传输装置用于发送所述数据包;所述云端处理装置用于接收并解析所述数据包,确定所述数据包中的所述存储位以及所述标志位的值,并根据所述存储位和所述标志位的值得到所述n个信号值;其中,根据所述存储位和所述标志位的值得到n个信号值,包括:针对被所述标志位标识为不同的第j位信号值,将所述存储位中存储的信号值设置为第j位对应的信号值;按照所述标志位的第1位至第n位的顺序,依次将被所述标志位标识为相同的第k位对应的信号值设置为第k-1位对应的信号值,k大于等于2。The embodiment of the present application also provides a data compression and analysis system, including: a signal acquisition device, a vehicle-end processing device, a data transmission device, and a cloud processing device; the signal acquisition device is used to collect signal values according to a preset collection cycle The vehicle-end processing device is used to generate data packets corresponding to the n signal values, the data packets include storage bits and flag bits, the number of flag bits is n, and the ith of the flag bits The bit is used to identify that the i-th signal value is different from the i-1-th signal value, i is greater than or equal to 2, and the storage bit is used to store the first signal value and the j-th signal value identified as different by the flag bit, j Greater than or equal to 2; the data transmission device is used to send the data packet; the cloud processing device is used to receive and analyze the data packet, and determine the value of the storage bit and the flag bit in the data packet , and obtain the n signal values according to the value of the storage bit and the flag bit; wherein, obtain n signal values according to the value of the storage bit and the flag bit, including: for the value of the flag bit mark the different jth signal values, and set the signal value stored in the storage bit as the signal value corresponding to the jth bit; according to the order of the first bit to the nth bit of the flag bit, the The signal value corresponding to the k-th bit identified as the same flag bit is set as the signal value corresponding to the k-1th bit, and k is greater than or equal to 2.

本申请实施例还提供了一种车辆,包括:信号采集装置,用于按照预设的采集周期采集信号值;车端处理装置,用于生成所述n个信号值对应的数据包,所述数据包中包括存储位以及标志位,所述标志位的位数为n,所述标志位的第i位用于标识第i个与第i-1个信号值不同,i大于等于2,所述存储位用于存储第1个信号值以及被所述标志位标识为不同的第j信号值,j大于等于2;数据传输装置,用于发送所述数据包。The embodiment of the present application also provides a vehicle, including: a signal acquisition device, configured to acquire signal values according to a preset acquisition cycle; a vehicle-end processing device, configured to generate data packets corresponding to the n signal values, the The data packet includes storage bits and flag bits, the number of flag bits is n, and the i-th bit of the flag bits is used to identify that the i-th signal value is different from the i-1-th signal value, and i is greater than or equal to 2, so The storage bit is used to store the first signal value and the jth signal value identified as different by the flag bit, j is greater than or equal to 2; the data transmission device is used to send the data packet.

本申请实施例还提供了一种电子设备,包括:处理器、存储器、通信接口和通信总线,所述处理器、所述存储器和所述通信接口通过所述通信总线完成相互间的通信;所述存储器用于存放至少一可执行指令,所述可执行指令使所述处理器执行如上所述方法对应的操作。The embodiment of the present application also provides an electronic device, including: a processor, a memory, a communication interface, and a communication bus, and the processor, the memory, and the communication interface complete mutual communication through the communication bus; The memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform the operation corresponding to the method described above.

本申请实施例还提供了一种计算机存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述实施例所述的方法。The embodiment of the present application also provides a computer storage medium, on which a computer program is stored, and when the program is executed by a processor, the method described in the above embodiment is implemented.

由以上技术方案可见,首先按照预设的采集周期采集到n个信号值;生成n个信号值对应的数据包,数据包中包括存储位以及标志位,标志位的位数为n,标志位的第i位用于标识第i个与第i-1个信号值不同,i大于等于2,存储位用于存储第1个信号值以及被标志位标识为不同的第j信号值,j大于等于2;最后发送数据包。本申请通过将不重复的信号值存储于数据包内,过滤掉重复的信号值,并利用标志位对存储的信号值进行标识,通过优化数据组织形式过滤掉了采集的信号的重复值,从而减少数据体积,实现数据的压缩。对于车云数据传输来说,车端上传数据体积的减少使得数据上传至云端的带宽占用变小,这不仅可以降低网络流量成本,也提高了数据采集系统的稳定性,同时车端单次上传数据体积的减小,意味着单位时间内单个云端服务器可以接收更多车辆的数据,提高数据传输效率以及云端的并发数据处理能力,由此也降低了云端总体运维成本。It can be seen from the above technical solutions that firstly, n signal values are collected according to the preset acquisition cycle; data packets corresponding to n signal values are generated, and the data packets include storage bits and flag bits, the number of flag bits is n, and the flag bits The i-th bit of is used to identify that the i-th signal value is different from the i-1-th signal value, i is greater than or equal to 2, and the storage bit is used to store the first signal value and the j-th signal value identified as different by the flag bit, and j is greater than Equal to 2; send the packet last. This application stores non-repetitive signal values in data packets, filters out repeated signal values, uses flag bits to identify stored signal values, and filters out repeated values of collected signals by optimizing the data organization form, thereby Reduce data volume and realize data compression. For car-cloud data transmission, the reduction in the volume of uploaded data on the car end reduces the bandwidth occupied by data uploaded to the cloud, which not only reduces network traffic costs, but also improves the stability of the data collection system. At the same time, a single upload on the car end The reduction in data volume means that a single cloud server can receive more vehicle data per unit time, improving data transmission efficiency and concurrent data processing capabilities in the cloud, thereby reducing the overall cloud operation and maintenance costs.

附图说明Description of drawings

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请实施例中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments described in the embodiments of this application, and those skilled in the art can also obtain other drawings based on these drawings.

图1为本申请实施例一的一种数据压缩方法流程图;FIG. 1 is a flow chart of a data compression method in Embodiment 1 of the present application;

图2为本申请实施例一的一种数据包的信号值与对应标识的示意图;FIG. 2 is a schematic diagram of a signal value and a corresponding identifier of a data packet according to Embodiment 1 of the present application;

图3为本申请实施例二的一种数据包发送方法流程图;FIG. 3 is a flow chart of a data packet sending method according to Embodiment 2 of the present application;

图4为本申请实施例三的一种数据解析方法流程图;FIG. 4 is a flow chart of a data analysis method in Embodiment 3 of the present application;

图5为本申请实施例四的一种数据压缩及解析系统的示意图;FIG. 5 is a schematic diagram of a data compression and analysis system according to Embodiment 4 of the present application;

图6为本申请实施例四的一种数据传输的示意图;FIG. 6 is a schematic diagram of data transmission according to Embodiment 4 of the present application;

图7为本申请实施例六的一种电子设备的结构示意图。FIG. 7 is a schematic structural diagram of an electronic device according to Embodiment 6 of the present application.

具体实施方式Detailed ways

为了使本领域的人员更好地理解本申请实施例中的技术方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请实施例一部分实施例,而不是全部的实施例。基于本申请实施例中的实施例,本领域普通技术人员所获得的所有其他实施例,都应当属于本申请实施例保护的范围。In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the following will clearly and completely describe the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described The embodiments are only some of the embodiments of the present application, but not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in the embodiments of the present application shall fall within the protection scope of the embodiments of the present application.

需要说明的是,实施本申请实施例的任一技术方案必不一定需要同时达到以上的所有优点。下面结合本申请实施例附图进一步说明本申请实施例具体实现。It should be noted that implementing any technical solution of the embodiments of the present application does not necessarily need to achieve all the above advantages at the same time. The specific implementation of the embodiment of the present application will be further described below in conjunction with the accompanying drawings of the embodiment of the present application.

实施例一Embodiment one

图1为本申请实施例的一种数据压缩方法流程图,如图1所示,该数据压缩方法包括如下步骤:Fig. 1 is a kind of data compression method flowchart of the embodiment of the present application, as shown in Fig. 1, this data compression method comprises the following steps:

步骤S101、按照预设的采集周期采集到n个信号值。Step S101, collecting n signal values according to a preset collection period.

具体地,分别对若干个信号在某一时间范围内连续采集信号值,这里的“时间范围”即为采集周期,连续采集的两个信号值之间的时间为采集时间间隔。n个信号值为在同一个采集周期内采集到的信号值,n的值大于等于1,例如,n可以取值为10,这里的信号值可以表示具体的数值、某一状态等。具体地,信号值可以为采集到的信号的具体数值,也可以为将采集到的信号的具体的数值或者状态经过预设的转换方式生成的值,例如,信号值可以是将具体的数值经过预设的转换方式生成的二进制文本。另外,信号值也可以表示某一范围值,例如,若采集的车速在80公里每小时至90公里每小时之间,则信号值可以表示为8。此外,也可以用信号值来表示开关量、档位等状态,例如,可令开关为开启状态时信号值设置为1,关闭状态时信号值设置为2。Specifically, the signal values of several signals are continuously collected within a certain time range, where the "time range" is the collection period, and the time between two continuously collected signal values is the collection time interval. The n signal values are signal values collected in the same acquisition cycle, and the value of n is greater than or equal to 1. For example, n can be 10, and the signal value here can represent a specific value, a certain state, etc. Specifically, the signal value may be a specific numerical value of the collected signal, or a value generated by passing a specific numerical value or state of the collected signal through a preset conversion method. For example, the signal value may be a specific numerical value through Binary text generated by the preset conversion method. In addition, the signal value can also represent a certain range of values, for example, if the collected vehicle speed is between 80 km/h and 90 km/h, the signal value can be represented as 8. In addition, the signal value can also be used to indicate the status of the switch, gear position, etc. For example, the signal value can be set to 1 when the switch is in the on state, and set to 2 when the switch is in the off state.

需要说明的是,信号值所表示的具体数值或者状态,以及其具体的转换方式等根据实际需要进行设置,这里不做限制。It should be noted that the specific value or state represented by the signal value and its specific conversion mode are set according to actual needs, and are not limited here.

可选地,n个信号值为按照预设的采集周期采集到的同一个信号的信号值。Optionally, the n signal values are signal values of the same signal collected according to a preset collection period.

具体地,对一个信号在某一时间范围内连续采集信号值,采集信号值这一动作通常是瞬间完成的,连续采集的两个信号值之间的时间为采集时间间隔。n个信号值可以为同一个信号在一个采集周期内的n个不同采集时间进行采集得到的n个信号值,通常来说,为了方便观测与记录等,每个信号值之间的采集时间间隔是固定的。以车端为例,信号可以为车内温度、行驶速度、车门状态、前灯状态等信号。Specifically, for a signal, the signal value is continuously collected within a certain time range, and the action of collecting the signal value is usually completed instantaneously, and the time between two continuously collected signal values is the collection time interval. The n signal values can be n signal values obtained by collecting the same signal at n different acquisition times within one acquisition cycle. Generally speaking, in order to facilitate observation and recording, etc., the acquisition time interval between each signal value It is fixed. Taking the car terminal as an example, the signals can be signals such as the temperature inside the car, driving speed, door status, and headlight status.

本实施方式中,n个信号值为按照预设的采集周期采集到的同一个信号的信号值,对于大多数信号来说,单个信号的信号值通常不会频繁的变化,因此按照预设的采集周期采集到的同一个信号的信号值的重复率是很高的,在后续的信号压缩中过滤采集的信号的重复值的过程中,能够有助于减少打包得到的数据包的体积。In this embodiment, the n signal values are the signal values of the same signal collected according to the preset acquisition cycle. For most signals, the signal value of a single signal usually does not change frequently, so according to the preset The repetition rate of the signal value of the same signal collected in the collection period is very high, and in the process of filtering the repeated value of the collected signal in the subsequent signal compression, it can help to reduce the volume of the packaged data packet.

需要说明的是,本申请实施例的数据压缩方法均以车端信号为例,其他信号也在本申请的保护范围之内。It should be noted that the data compression methods in the embodiments of the present application all take the vehicle end signal as an example, and other signals are also within the scope of protection of the present application.

步骤S102、生成n个信号值对应的数据包,数据包中包括存储位以及标志位,标志位的位数为n,标志位的第i位用于标识第i个与第i-1个信号值不同,i大于等于2,存储位用于存储第1个信号值以及被标志位标识为不同的第j个信号值,j大于等于2。Step S102, generate data packets corresponding to n signal values, the data packets include storage bits and flag bits, the number of flag bits is n, and the i-th bit of the flag bits is used to identify the i-th and i-1-th signals The values are different, i is greater than or equal to 2, and the storage bit is used to store the first signal value and the jth signal value identified as different by the flag bit, and j is greater than or equal to 2.

具体地,数据包中包括存储位以及标志位,存储位用于存储信号值,标志位用于标识出存储的信号值,标志位的位数为n,标志位的每一位与n个信号值一一对应。其中标志位的值,可以为特定的数字或者符号,具体的数字或符号这里不做限制,可根据实际需求进行设置。Specifically, the data packet includes storage bits and flag bits. The storage bits are used to store signal values, and the flag bits are used to identify the stored signal values. The number of flag bits is n, and each bit of the flag bits is related to n signals Values correspond one to one. The value of the flag bit can be a specific number or symbol, and the specific number or symbol is not limited here, and can be set according to actual needs.

示例性地,标志位的第i位可以采用数字“1”来标识第i个与第i-1个信号值不同,标志位的第m位可以采用数字“0”来标识第m个与第m-1个信号值相同。For example, the i-th bit of the flag can use the number "1" to identify that the i-th is different from the i-1th signal value, and the m-th bit of the flag can use the number "0" to identify the m-th and the i-1th signal value m-1 signal values are the same.

可选地,标志位的第1位用于标识n个信号值全不相同。Optionally, the first bit of the flag bit is used to identify that the n signal values are all different.

具体地,当n个信号值中的所有信号值均不同时,可以采用标识信号值相同的数字或者符号作为n个标志位的值,同时存储位存储了n个信号值。当n个信号值中含有相同的信号值时,可以采用标识信号值不同的数字或者符号来对标志位的第1位进行标识。对于上述举例来说,采用数字“1”或者数字“0”来标识信号值不同或者信号值相同,那么标志位第1位为“0”时,就可以很直观的得出n个信号值全不相同的结论,当标志位第1位为“1”时,就可以知道n个信号值中至少部分相同。Specifically, when all the signal values in the n signal values are different, the same number or symbol identifying the signal value can be used as the value of the n flag bits, and the storage bits store the n signal values. When the n signal values contain the same signal value, the first bit of the flag can be identified by using a number or a symbol that identifies a different signal value. For the above example, if the number "1" or "0" is used to indicate that the signal values are different or the signal values are the same, then when the first bit of the flag is "0", it can be intuitively obtained that the n signal values are all Not the same conclusion, when the first bit of the flag is "1", it can be known that at least some of the n signal values are the same.

本实施方式中,通过利用标志位的第1位来标识n个信号值全不相同,可以很方便的对数据包进行解析,当标志位的第1位被标识为相同,直接就可以得出n个信号值全不相同的结论,并且在解析过程中,可以直接将存储位中存储的n个信号值分别设置为第1位至第n位对应的信号值,实现方法简单,提高了工作效率。In this embodiment, by using the first bit of the flag to identify that the n signal values are all different, the data packet can be easily analyzed. When the first bit of the flag is identified as the same, it can be directly obtained The conclusion that the n signal values are all different, and in the analysis process, the n signal values stored in the storage bits can be directly set as the signal values corresponding to the 1st bit to the nth bit, the implementation method is simple, and the work is improved efficiency.

步骤S103、发送数据包。Step S103, sending the data packet.

示例性地,可以将数据包发送至云端,对信号值解析还原之后再进行存储以及分析等。Exemplarily, the data packet can be sent to the cloud, and the signal value can be analyzed and restored before being stored and analyzed.

示例性地,图2为本申请实施例的一种数据包的信号值与对应标识的示意图。Exemplarily, FIG. 2 is a schematic diagram of signal values and corresponding identifiers of a data packet according to an embodiment of the present application.

图中的s1-sn用于标识信号名,每一个信号名对应一个数据包,其后的字符串为标志位,其下方的t1等为存储位。图2中以采集了10个信号值进行举例,并采用数字“1”或者数字“0”来标识信号值不同或者信号值相同。The s1-sn in the figure is used to identify the signal name, each signal name corresponds to a data packet, the following string is a flag bit, and the t1 below it is a storage bit. In FIG. 2, 10 signal values are collected as an example, and a number "1" or a number "0" is used to indicate that the signal values are different or the signal values are the same.

如图2,在数据包“S1”中,10个信号值均不相同,则将这10个信号值全部存入存储位,并将标志位的每一位均设置为数字“0”来进行标识,分别对应于图2中的t1-t10;在数据包“S4”中,第2、3、4个信号值与第1个信号值相同,第6、7、8个信号值与第5个信号值相同,第10个信号值与第9个信号值相同,那么将第1、5、9个信号值存入存储位,分别对应于图2中的t1、t5、t9,并将标志位的第1、5、9位设置为数字“1”,标志位的第2、3、4、6、7、8、10位设置为数字“0”来进行标识。As shown in Figure 2, in the data packet "S1", the 10 signal values are all different, then all the 10 signal values are stored in the storage bit, and each bit of the flag bit is set to a digital "0" to perform mark, respectively corresponding to t1-t10 in Figure 2; in the data packet "S4", the 2nd, 3rd, and 4th signal values are the same as the 1st signal value, and the 6th, 7th, and 8th signal values are the same as the 5th The 1st signal value is the same, the 10th signal value is the same as the 9th signal value, then the 1st, 5th, and 9th signal values are stored in the storage bits, corresponding to t1, t5, t9 in Figure 2 respectively, and the flag The 1st, 5th, and 9th bits of the bit are set to the number "1", and the 2nd, 3rd, 4th, 6th, 7th, 8th, and 10th bits of the flag are set to the number "0" for identification.

由以上技术方案可见,首先按照预设的采集周期采集到n个信号值;生成n个信号值对应的数据包,数据包中包括存储位以及标志位,标志位的位数为n,标志位的第i位用于标识第i个与第i-1个信号值不同,i大于等于2,存储位用于存储第1个信号值以及被标志位标识为不同的第j信号值,j大于等于2;最后发送数据包。本申请通过将不重复的信号值存储于数据包内,过滤掉重复的信号值,并利用标志位对存储的信号值进行标识,通过优化数据组织形式过滤掉了采集的信号的重复值,从而减少数据体积,实现数据的压缩。对于车云数据传输来说,车端上传数据体积的减少使得数据上传至云端的带宽占用变小,这不仅可以降低网络流量成本,也提高了数据采集系统的稳定性,同时车端单次上传数据体积的减小,意味着单位时间内单个云端服务器可以接收更多车辆的数据,提高数据传输效率以及云端的并发数据处理能力,由此也降低了云端总体运维成本。It can be seen from the above technical solutions that firstly, n signal values are collected according to the preset acquisition cycle; data packets corresponding to n signal values are generated, and the data packets include storage bits and flag bits, the number of flag bits is n, and the flag bits The i-th bit of is used to identify that the i-th signal value is different from the i-1-th signal value, i is greater than or equal to 2, and the storage bit is used to store the first signal value and the j-th signal value identified as different by the flag bit, and j is greater than Equal to 2; send the packet last. This application stores non-repetitive signal values in data packets, filters out repeated signal values, uses flag bits to identify stored signal values, and filters out repeated values of collected signals by optimizing the data organization form, thereby Reduce data volume and realize data compression. For car-cloud data transmission, the reduction in the volume of uploaded data on the car end reduces the bandwidth occupied by data uploaded to the cloud, which not only reduces network traffic costs, but also improves the stability of the data collection system. At the same time, a single upload on the car end The reduction in data volume means that a single cloud server can receive more vehicle data per unit time, improving data transmission efficiency and concurrent data processing capabilities in the cloud, thereby reducing the overall cloud operation and maintenance costs.

实施例二Embodiment two

图3为本申请实施例的一种数据包发送方法流程图,如图3所示,该数据包发送方法包括如下步骤:Fig. 3 is a flow chart of a method for sending a data packet according to an embodiment of the present application. As shown in Fig. 3, the method for sending a data packet includes the following steps:

步骤S301、按照预设的采集周期采集到n个信号值。Step S301, collecting n signal values according to a preset collection cycle.

步骤S302、生成n个信号值对应的数据包。Step S302, generating data packets corresponding to n signal values.

步骤S303、按照若干个数据包对应的信号名在信号表中的排列顺序,对若干个数据包进行排序。Step S303, sorting the several data packets according to the order in which the signal names corresponding to the several data packets are arranged in the signal table.

具体地,数据包的数量有多个,每个数据包分别对应着一个信号。信号名是指该信号的名称,例如“车内温度”、“剩余油量”等,信号表中存储若干个信号名,对于同一个信号表中的信号来说,每个信号的信号值的采集周期、采集时间以及信号的采集次数可以是相同的。此外,信号表中还可以存储有信号序号、数据类型、采集到的信号的具体的数值或者状态转换为信号值的转换方式等。信号序号用于指示信号的排列顺序,若干个数据包根据该排列顺序进行排序;数据类型是指该信号表中的信号的类型,例如数据类型为“ipd”,表示该信号表中的信号均为与智能驾驶相关的信号,每个信号表可以对应有一个数据类型,作为该信号表中存储的信号的数据类型。Specifically, there are multiple data packets, and each data packet corresponds to a signal. The signal name refers to the name of the signal, such as "in-vehicle temperature", "remaining oil level", etc. Several signal names are stored in the signal table. For the signals in the same signal table, the signal value of each signal is The acquisition cycle, acquisition time, and signal acquisition times may be the same. In addition, the signal table can also store signal serial numbers, data types, specific values of the collected signals or conversion methods for converting states into signal values, etc. The signal sequence number is used to indicate the sequence of the signals, and several data packets are sorted according to the sequence; the data type refers to the type of the signal in the signal table, for example, the data type is "ipd", which means that the signals in the signal table are For signals related to intelligent driving, each signal table may correspond to a data type as the data type of the signal stored in the signal table.

步骤S304、将排序后的若干个数据包进行打包,得到若干个数据包的组合包。Step S304, packing the sorted several data packets to obtain a combined packet of several data packets.

具体地,组合包为信号表中所有信号对应的数据包打包后的集合,在对若干个数据包进行打包形成组合包之后,还可以对组合包按照提前设置的命名规则进行命名,以便对数据包进行存储与分析等,命名规则至少要表达出该组合包的打包时间、信号来源、数据类型等。以车辆为例,命名规则可以为“数据类型-车辆VIN码-时间戳-本周期内的信号采集次数-信号表版本”,例如,组合包名称为“ipd-VIN12345678901234-1660010436000-10-1.2.dat”指得是该组合包中的全部信号为智能驾驶相关信号,车辆识别码为12345678901234,时间戳为1660010436000,周期内的信号采集次数为10次,信号标版本为1.2。时间戳是指数据包的打包完成时间的时间戳;车辆VIN码即车辆识别码,每一个车辆VIN码都代表了唯一的一辆车,车辆VIN码标志了该组合包的信号来源的车辆;信号表版本为该组合包中的信号对应的信号表的版本号,由于采集的信号或者信号值的转换方式等会随着时间的发展而进行更新,那么信号表也会随之进行更新,于是需要根据该组合包对应的信号表版本来对组合包进行命名,后续可以根据该数据类型以及信号表版本找到该组合包对应的信号表从而对组合包进行解析等。Specifically, the combination package is a packaged set of data packets corresponding to all signals in the signal table. After several data packages are packaged to form a combination package, the combination package can also be named according to the naming rules set in advance, so that the data The package is stored and analyzed, etc., and the naming rules must at least express the packaging time, signal source, and data type of the combined package. Taking vehicles as an example, the naming rule can be "data type-vehicle VIN code-time stamp-signal collection times in this period-signal table version", for example, the package name is "ipd-VIN12345678901234-1660010436000-10-1.2. dat” means that all the signals in the combination package are related to intelligent driving, the vehicle identification code is 12345678901234, the time stamp is 1660010436000, the number of signal collections in the cycle is 10 times, and the signal version is 1.2. The time stamp refers to the time stamp of the package completion time of the data package; the vehicle VIN code is the vehicle identification code, and each vehicle VIN code represents a unique vehicle, and the vehicle VIN code marks the vehicle from which the signal source of the combination package; The signal table version is the version number of the signal table corresponding to the signal in the combination package. Since the collected signal or the conversion method of the signal value will be updated with the development of time, the signal table will also be updated accordingly, so The combination package needs to be named according to the signal table version corresponding to the combination package, and then the signal table corresponding to the combination package can be found according to the data type and signal table version to analyze the combination package.

步骤S305、发送组合包。Step S305, sending the combined package.

具体地,发送数据包包括发送组合包,将若干个数据包打包生成组合包进行发送,可以方便传输,相比于每个数据包均单独发送提高了传输效率。Specifically, sending a data packet includes sending a composite packet, and packaging several data packets to generate a composite packet for transmission can facilitate transmission, and compared with sending each data packet separately, the transmission efficiency is improved.

可选地,在发送数据包时,若网络不可用,则生成组合包对应的缓存文件。Optionally, when the data packet is sent, if the network is unavailable, a cache file corresponding to the combination packet is generated.

具体地,若网络恢复为可用状态时,按照组合包的打包完成时间的先后顺序,发送缓存文件;或者,若网络不可用时间超过阈值,按照组合包的打包完成时间的先后顺序,根据剩余缓存空间将缓存文件进行删除。通过按照组合包的打包完成时间的先后顺序,发送缓存文件,能够使得多个组合包按照时间顺序依次发送,避免了同时发送所有的组合包导致的网络堵塞,且能够节省宽带流量,减小该数据发送端以及数据接收端的数据传输压力。另外,若网络不可用时间超过阈值,按照组合包的打包完成时间的先后顺序,根据剩余缓存空间将缓存文件进行删除,可以有效地释放缓存空间方便缓存新生成的缓存文件,防止缓存过多造成系统卡顿。Specifically, if the network is restored to an available state, the cache files are sent in the order of the package completion time of the combined package; space to delete cached files. By sending the cache files in the order of the package completion time of the package, multiple package packages can be sent sequentially in chronological order, avoiding network congestion caused by sending all package packages at the same time, and saving broadband traffic and reducing the The data transmission pressure of the data sending end and the data receiving end. In addition, if the network unavailable time exceeds the threshold, the cache files will be deleted according to the order of the package completion time of the combination package and the remaining cache space, which can effectively release the cache space and facilitate the caching of newly generated cache files, preventing excessive cache from causing The system freezes.

需要说明的是,网络不可用时间的阈值以及根据剩余缓存空间将缓存文件进行删除的删除规则可根据实际情况来设置,这里不做限制。It should be noted that the threshold of network unavailable time and the deletion rule for deleting cached files according to the remaining cache space can be set according to the actual situation, and there is no limitation here.

本实施方式中,通过在无网络时,生成组合包对应的缓存文件,可以有效地防止数据包丢失。In this embodiment, when there is no network, a cache file corresponding to the combination package is generated, which can effectively prevent data packet loss.

由以上技术方案可见,首先按照预设的采集周期采集到n个信号值,再生成n个信号值对应的数据包,按照若干个数据包对应的信号名在信号表中的排列顺序,对若干个数据包进行排序,将排序后的若干个数据包进行打包,得到若干个数据包的组合包,最后发送组合包。本实施例通过对若干个数据包按照信号表中指示的信号的排列顺序进行打包,生成组合包,同时每个数据包都可以在信号表中找到对应的信号名称、信号值的转换方式、数据类型等,避免了每个数据包中都要记载信号名以及信号值转换方式等,减少了数据上传的体积,将若干个数据包打包生成组合包进行发送,可以方便传输,提高了传输效率。It can be seen from the above technical scheme that firstly, n signal values are collected according to the preset acquisition period, and then the data packets corresponding to the n signal values are generated, and the signal names corresponding to several data packets are arranged in the signal table according to the order of arrangement of several data packets. Sort the data packets, pack the sorted data packets, get a combination package of several data packets, and finally send the combination package. In this embodiment, several data packets are packaged according to the arrangement order of the signals indicated in the signal table to generate a combined package. At the same time, each data packet can find the corresponding signal name, signal value conversion method, and data in the signal table. Type, etc., avoiding the need to record the signal name and signal value conversion method in each data packet, reducing the volume of data upload, packaging several data packets to generate a combined package for transmission, which can facilitate transmission and improve transmission efficiency.

实施例三Embodiment three

图4为本申请实施例的一种数据解析方法流程图,如图4所示,该数据解析方法包括如下步骤:Fig. 4 is a flow chart of a data parsing method according to an embodiment of the present application. As shown in Fig. 4, the data parsing method includes the following steps:

步骤S401、接收并解析数据包,确定数据包中的存储位以及标志位的值。Step S401, receiving and analyzing the data packet, and determining the value of the storage bit and the flag bit in the data packet.

具体地,接收到数据包之后需要对数据包中的数据进行解析,其中,数据包中包括存储位以及标志位,标志位的位数为n,标志位的第i位用于标识第i个与第i-1个信号值不同,i大于等于2,存储位用于存储第1个信号值以及被标志位标识为不同的第j个信号值,j大于等于2。具体的数据压缩方法可参考上述实施例一与实施例二,此处不再赘述。然后根据存储位和标志位的值将n个信号值进行还原。Specifically, after receiving the data packet, the data in the data packet needs to be parsed, wherein the data packet includes a storage bit and a flag bit, the number of flag bits is n, and the i-th bit of the flag bit is used to identify the i-th Different from the i-1th signal value, i is greater than or equal to 2, and the storage bit is used to store the first signal value and the jth signal value identified as different by the flag bit, and j is greater than or equal to 2. For a specific data compression method, reference may be made to the first and second embodiments above, and details are not repeated here. Then restore the n signal values according to the values of the storage bit and the flag bit.

可选地,接收若干个数据包组成的组合包,根据信号表中按照预设顺序存储的信号名,以及组合包中的若干个数据包的排列顺序,确定数据包对应的信号名。Optionally, receiving a combined package consisting of several data packages, and determining the signal name corresponding to the data package according to the signal names stored in the signal table in a preset order and the sequence of the several data packages in the combined package.

本实施方式中,信号表的作用以及信号表与数据包的关系可参考上述实施例二,此处不再赘述。若干个数据包打包生成组合包的顺序,是根据信号表指示的信号排列顺序进行排列的,因此根据信号表中的信号序号以及信号名等就可以确定组合包中的每个数据包对应的信号名,过程方便简单。In this implementation manner, the function of the signal table and the relationship between the signal table and the data packet may refer to the second embodiment above, which will not be repeated here. The order in which several data packets are packaged to generate a combined package is arranged according to the signal arrangement order indicated by the signal table, so the signal corresponding to each data package in the combined package can be determined according to the signal number and signal name in the signal table Name, the process is convenient and simple.

可选地,n个信号值为按照预设的采集周期采集到的同一个信号的信号值。Optionally, the n signal values are signal values of the same signal collected according to a preset collection period.

步骤S402、针对被标志位标识为不同的第j位信号值,将存储位中存储的信号值设置为第j位对应的信号值。Step S402 , for the signal values of the j-th bit identified as different by the flag bit, set the signal value stored in the storage bit as the signal value corresponding to the j-th bit.

具体地,被标志位标识为不同的第j位信号值,则该第j位信号值即为被存储位存储的标志位第j位对应的信号值,此外,若标志位的第1位标识为相同,则将存储位中存储的n个信号值分别设置为第1位至第n位对应的信号值。Specifically, if the flag bit is marked as a different j-th signal value, then the j-th signal value is the signal value corresponding to the j-th bit of the flag bit stored in the storage bit. In addition, if the first bit of the flag bit identifies If they are the same, the n signal values stored in the storage bits are respectively set as the signal values corresponding to the first bit to the nth bit.

步骤S403、按照标志位的第1位至第n位的顺序,依次将被标志位标识为相同的第k位对应的信号值设置为第k-1位对应的信号值,k大于等于2。Step S403 , according to the order of the first bit to the nth bit of the flag bit, sequentially set the signal value corresponding to the kth bit identified as the same by the flag bit as the signal value corresponding to the k-1th bit, where k is greater than or equal to 2.

示例性地,标志位采用数字“1”与数字“0”分别标识信号值不同与信号值相同,数据包中标志位的值为“100101”,存储位的值为“234”,对该数据包中的6个信号值进行解析还原,针对被标志位标识为不同的第1、4、6位信号值,将存储位中存储的信号值分别设置为第1、4、6位对应的信号值“2”、“3”、“4”;将标志位标识为相同的第2位对应的信号值设置为第1位对应的信号值“2”;按照标志位的第1位至第6位的顺序,接下来将标志位标识为相同的第3位对应的信号值设置为第2位对应的信号值“2”;最后将标志位标识为相同的第5位对应的信号值设置为第4位对应的信号值“3”。由此得到还原后的信号值“222334”。Exemplarily, the flag bit uses the number "1" and the number "0" to indicate that the signal value is different and the signal value is the same, the value of the flag bit in the data packet is "100101", and the value of the storage bit is "234". The 6 signal values in the package are analyzed and restored, and for the 1st, 4th, and 6th signal values identified by the flag bits as different, the signal values stored in the storage bits are respectively set to the signals corresponding to the 1st, 4th, and 6th bits Values "2", "3", "4"; set the signal value corresponding to the second bit with the same flag bit as the signal value "2" corresponding to the first bit; according to the first bit to the sixth bit of the flag bit The order of the bits, then set the signal value corresponding to the 3rd bit that is identified as the same as the signal value corresponding to the 2nd bit to "2"; finally set the signal value corresponding to the 5th bit that is identified as the same as The 4th bit corresponds to the signal value "3". Thus, the restored signal value "222334" is obtained.

由以上技术方案可见,接收并解析数据包,确定数据包中的存储位以及标志位的值,针对被标志位标识为不同的第j位信号值,将存储位中存储的信号值设置为第j位对应的信号值,按照标志位的第1位至第n位的顺序,依次将被标志位标识为相同的第k位对应的信号值设置为第k-1位对应的信号值,k大于等于2。本实施例根据存储位和标志位的值,能够很好的地对每个数据包对应n个信号值进行还原,且解析还原方式简单,易于实现。It can be seen from the above technical solution that the data packet is received and analyzed, the value of the storage bit and the flag bit in the data packet is determined, and the signal value stored in the storage bit is set as the jth signal value that is identified as different by the flag bit. The signal value corresponding to bit j, according to the order of the 1st bit to the nth bit of the flag bit, sequentially set the signal value corresponding to the kth bit identified as the same by the flag bit as the signal value corresponding to the k-1th bit, k greater than or equal to 2. According to the value of the storage bit and the flag bit, this embodiment can well restore the n signal values corresponding to each data packet, and the analysis and restoration method is simple and easy to implement.

实施例四Embodiment four

图5为本申请实施例的一种数据压缩及解析系统的示意图,如图5所示,该数据压缩系统及解析包括:Fig. 5 is a schematic diagram of a data compression and analysis system according to an embodiment of the present application. As shown in Fig. 5, the data compression system and analysis include:

信号采集装置501:信号采集装置用于按照预设的采集周期采集信号值;Signal collection device 501: the signal collection device is used to collect signal values according to a preset collection cycle;

车端处理装置502:车端处理装置用于生成n个信号值对应的数据包,数据包中包括存储位以及标志位,标志位的位数为n,标志位的第i位用于标识第i个与第i-1个信号值不同,i大于等于2,存储位用于存储第1个信号值以及被标志位标识为不同的第j信号值,j大于等于2;Vehicle-end processing device 502: the vehicle-end processing device is used to generate data packets corresponding to n signal values. The data packets include storage bits and flag bits. The number of flag bits is n, and the i-th bit of the flag bits is used to identify the first i is different from the i-1th signal value, i is greater than or equal to 2, and the storage bit is used to store the first signal value and the jth signal value identified as different by the flag bit, and j is greater than or equal to 2;

数据传输装置503:数据传输装置用于发送数据包;Data transmission device 503: the data transmission device is used to send data packets;

云端处理装置504:云端处理装置用于接收并解析数据包,确定数据包中的存储位以及标志位的值,并根据存储位和标志位的值得到n个信号值;其中,根据存储位和标志位的值得到n个信号值,包括:针对被标志位标识为不同的第j位信号值,将存储位中存储的信号值设置为第j位对应的信号值;按照标志位的第1位至第n位的顺序,依次将被标志位标识为相同的第k位对应的信号值设置为第k-1位对应的信号值,k大于等于2。Cloud processing device 504: the cloud processing device is used to receive and analyze the data packet, determine the value of the storage bit and the flag bit in the data packet, and obtain n signal values according to the value of the storage bit and the flag bit; wherein, according to the storage bit and the value of the flag bit The value of the flag bit obtains n signal values, including: for the jth signal value identified by the flag bit as different, the signal value stored in the storage bit is set as the signal value corresponding to the jth bit; In order from bit to nth bit, the signal value corresponding to the kth bit identified as the same by the flag bit is set as the signal value corresponding to the k-1th bit, and k is greater than or equal to 2.

示例性地,图6为本申请实施例的一种数据传输的示意图,图6中以在一个采集周期内,每个信号采集10次信号值进行举例。Exemplarily, FIG. 6 is a schematic diagram of data transmission according to an embodiment of the present application. In FIG. 6 , each signal collects 10 signal values within one collection period as an example.

如图6,首先通过信号采集装置进行信号值采集,如图6左下方所示,t1-t10表示统一采集周期内的采集时间,t1-t10的每个时间的下方为分别为n个信号在对应的时间采集到的信号值,例如t1下方的s3即为第三个信号在t1时间采集到的信号值。As shown in Figure 6, the signal value is first collected by the signal acquisition device, as shown in the lower left of Figure 6, t1-t10 represents the acquisition time in the unified acquisition cycle, and the bottom of each time of t1-t10 is respectively n signals in The signal value collected at the corresponding time, for example, s3 below t1 is the signal value collected by the third signal at time t1.

车端处理装置对采集周期内信号采集装置采集的信号值进行压缩,得到若干个数据包,如图6右下角所示,图中的s1-sn用于标识信号名,每一个信号名对应一个数据包,其后的字符串为标志位,其下方的t1等为存储位,并采用数字“1”或者数字“0”来标识信号值不同或者信号值相同。图中的数据包“S1”中,10个信号值均不相同,则将这10个信号值全部存入存储位,并将标志位的每一位均设置为数字“0”来进行标识,分别对应于图6中的t1-t10;在数据包“S3”中,第2-9个信号值与第1个信号值相同,那么将第1、10个信号值存入存储位,分别对应于图6中的t1和t10,并将标志位的第1、10位设置为数字“1”,标志位的第2-9位设置为数字“0”来进行标识。The vehicle-end processing device compresses the signal values collected by the signal collection device within the collection cycle to obtain several data packets, as shown in the lower right corner of Figure 6. The s1-sn in the figure is used to identify the signal name, and each signal name corresponds to a In the data packet, the following character string is a flag bit, and the t1 below it is a storage bit, and a number "1" or a number "0" is used to indicate that the signal value is different or the signal value is the same. In the data packet "S1" in the figure, the 10 signal values are all different, then all the 10 signal values are stored in the storage bit, and each bit of the flag bit is set as a number "0" for identification. Corresponding to t1-t10 in Figure 6; in the data packet "S3", the 2nd-9th signal value is the same as the 1st signal value, then the 1st and 10th signal values are stored in the storage bit, corresponding to For t1 and t10 in Figure 6, the 1st and 10th bits of the flag are set to the number "1", and the 2-9 bits of the flag are set to the number "0" for identification.

然后对数据包进行打包命名之后并通过数据传输装置上传至云端,该数据包打包后命名如图6中间位置所示“type-VI N12345678901234-1660010436000-10.dat”指得是该组数据包中的全部信号的数据类型为“type”,车辆识别码为“12345678901234”,时间戳为“1660010436000”,周期内的信号采集次数为10次。Then package and name the data package and upload it to the cloud through the data transmission device. The data type of all the signals is "type", the vehicle identification code is "12345678901234", the time stamp is "1660010436000", and the number of signal acquisitions in the cycle is 10 times.

最后云端处理装置对打包后的数据包进行解析还原,如图6右上方所示,每个数据包均还原得到n个信号值。Finally, the cloud processing device analyzes and restores the packaged data packets, as shown in the upper right of FIG. 6 , each data packet is restored to obtain n signal values.

由以上技术方案可见,通过信号采集装置,按照预设的采集周期采集信号值;并在车端粗粒装置生成n个信号值对应的数据包,数据包中包括存储位以及标志位,标志位的位数为n,标志位的第i位用于标识第i个与第i-1个信号值不同,i大于等于2,存储位用于存储第1个信号值以及被标志位标识为不同的第j信号值,j大于等于2;再通过数据传输装置发送数据包,最后通过云端处理装置对数据包进行解析还原信号值。本实施例通过将车端不重复的信号值存储于数据包内,过滤掉重复的信号值,并利用标志位对存储的信号值进行标识,通过优化数据组织形式过滤掉了采集的信号的重复值,车端上传数据体积的减少使得数据上传至云端的带宽占用变小,这不仅可以降低网络流量成本,同时车端单次上传数据体积的减小,意味着单位时间内单个云端服务器可以接收更多车辆的数据,提高数据传输效率以及云端的并发数据处理能力,由此也降低了云端总体运维成本。It can be seen from the above technical scheme that the signal value is collected according to the preset collection period through the signal collection device; and the data packets corresponding to n signal values are generated in the coarse-grained device at the vehicle end, and the data packets include storage bits and flag bits, flag bits The number of bits is n, the i-th bit of the flag is used to identify that the i-th signal value is different from the i-1-th signal value, i is greater than or equal to 2, the storage bit is used to store the first signal value and is identified as different by the flag bit The jth signal value of j is greater than or equal to 2; then the data packet is sent through the data transmission device, and finally the data packet is analyzed and restored by the cloud processing device to restore the signal value. In this embodiment, the repeated signal values are filtered out by storing the non-repeated signal values at the vehicle end in the data packet, and the stored signal values are identified by flag bits, and the repetition of the collected signals is filtered out by optimizing the data organization form Value, the reduction in the volume of data uploaded by the car end makes the bandwidth occupied by data uploaded to the cloud smaller, which not only reduces the cost of network traffic, but also reduces the volume of data uploaded by the car end once, which means that a single cloud server can receive data per unit time More vehicle data, improved data transmission efficiency and concurrent data processing capabilities of the cloud, thus reducing the overall cost of cloud operation and maintenance.

实施例五Embodiment five

本申请实施例还提供了一种车辆,所述车辆用于实现上述实施例所述的数据压缩方法,车辆包括:The embodiment of the present application also provides a vehicle, the vehicle is used to implement the data compression method described in the above embodiment, and the vehicle includes:

信号采集装置,用于按照预设的采集周期采集信号值;A signal acquisition device, configured to acquire signal values according to a preset acquisition cycle;

车端处理装置,用于生成n个信号值对应的数据包,数据包中包括存储位以及标志位,标志位的位数为n,标志位的第i位用于标识第i个与第i-1个信号值不同,i大于等于2,存储位用于存储第1个信号值以及被标志位标识为不同的第j信号值,j大于等于2;The vehicle-end processing device is used to generate data packets corresponding to n signal values. The data packets include storage bits and flag bits. The number of flag bits is n, and the i-th bit of the flag bits is used to identify the i-th -1 signal value is different, i is greater than or equal to 2, the storage bit is used to store the first signal value and the jth signal value identified as different by the flag bit, j is greater than or equal to 2;

数据传输装置,用于发送数据包。The data transmission device is used for sending data packets.

由以上技术方案可见,通过信号采集装置,按照预设的采集周期采集信号值;并在车端粗粒装置生成n个信号值对应的数据包,数据包中包括存储位以及标志位,标志位的位数为n,标志位的第i位用于标识第i个与第i-1个信号值不同,i大于等于2,存储位用于存储第1个信号值以及被标志位标识为不同的第j信号值,j大于等于2;最后通过数据传输装置发送数据包。本实施例通过将车端不重复的信号值存储于数据包内,过滤掉重复的信号值,并利用标志位对存储的信号值进行标识,通过优化数据组织形式过滤掉了采集的信号的重复值,车端上传数据体积的减少使得数据上传至云端的带宽占用变小,这不仅可以降低网络流量成本,同时车端单次上传数据体积的减小,意味着单位时间内单个云端服务器可以接收更多车辆的数据,提高数据传输效率。It can be seen from the above technical scheme that the signal value is collected according to the preset collection period through the signal collection device; and the data packets corresponding to n signal values are generated in the coarse-grained device at the vehicle end, and the data packets include storage bits and flag bits, flag bits The number of bits is n, the i-th bit of the flag is used to identify that the i-th signal value is different from the i-1-th signal value, i is greater than or equal to 2, the storage bit is used to store the first signal value and is identified as different by the flag bit The jth signal value of j is greater than or equal to 2; finally, the data packet is sent through the data transmission device. In this embodiment, the repeated signal values are filtered out by storing the non-repeated signal values at the vehicle end in the data packet, and the stored signal values are identified by flag bits, and the repetition of the collected signals is filtered out by optimizing the data organization form Value, the reduction in the volume of data uploaded by the car end makes the bandwidth occupied by data uploaded to the cloud smaller, which not only reduces the cost of network traffic, but also reduces the volume of data uploaded by the car end once, which means that a single cloud server can receive data per unit time More vehicle data, improve data transmission efficiency.

实施例六Embodiment six

图7为本申请实施例的一种电子设备的结构示意图,本申请具体实施例并不对电子设备的具体实现做限定。FIG. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The specific embodiment of the present application does not limit the specific implementation of the electronic device.

该电子设备可以包括:处理器(processor)702、通信接口(CommunicationsInterface)704、存储器(memory)706、以及通信总线708。The electronic device may include: a processor (processor) 702 , a communication interface (Communications Interface) 704 , a memory (memory) 706 , and a communication bus 708 .

其中:in:

处理器702、通信接口704、以及存储器706通过通信总线708完成相互间的通信。The processor 702 , the communication interface 704 , and the memory 706 communicate with each other through the communication bus 708 .

通信接口704,用于与其它电子设备或服务器进行通信。The communication interface 704 is used for communicating with other electronic devices or servers.

处理器702,用于执行程序710,具体可以执行上述方法实施例中的相关步骤。The processor 702 is configured to execute the program 710, and may specifically execute relevant steps in the foregoing method embodiments.

具体地,程序710可以包括程序代码,该程序代码包括计算机操作指令。Specifically, the program 710 may include program codes including computer operation instructions.

处理器702可能是CPU,或者是特定集成电路ASIC(Application SpecificIntegrated Circuit),或者是被配置成实施本申请实施例的一个或多个集成电路。智能设备包括的一个或多个处理器,可以是同一类型的处理器,如一个或多个CPU;也可以是不同类型的处理器,如一个或多个CPU以及一个或多个ASIC。The processor 702 may be a CPU, or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the smart device may be of the same type, such as one or more CPUs, or may be different types of processors, such as one or more CPUs and one or more ASICs.

存储器706,用于存放程序710。存储器706可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。The memory 706 is used to store the program 710 . The memory 706 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

程序710具体可以用于使得处理器702执行前述多个方法实施例中任一实施例所描述的方法对应的操作。The program 710 may be specifically configured to enable the processor 702 to perform operations corresponding to the method described in any one of the foregoing multiple method embodiments.

程序710中各步骤的具体实现可以参见上述方法实施例中的相应步骤和单元中对应的描述,并具有相应的有益效果,在此不赘述。所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的设备和模块的具体工作过程,可以参考前述方法实施例中的对应过程描述,在此不再赘述。For the specific implementation of each step in the program 710, refer to the corresponding descriptions in the corresponding steps and units in the above method embodiments, and have corresponding beneficial effects, so details are not repeated here. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the foregoing method embodiments, and details are not repeated here.

本申请实施例还提供了一种计算机存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述多个方法实施例中的任一方法对应的操作。The embodiment of the present application also provides a computer storage medium, on which a computer program is stored, and when the program is executed by a processor, the operation corresponding to any method in the above multiple method embodiments is implemented.

需要指出,根据实施的需要,可将本申请实施例中描述的各个部件/步骤拆分为更多部件/步骤,也可将两个或多个部件/步骤或者部件/步骤的部分操作组合成新的部件/步骤,以实现本申请实施例的目的。It should be pointed out that, according to the needs of implementation, each component/step described in the embodiment of the present application can be split into more components/steps, and two or more components/steps or partial operations of components/steps can also be combined into New components/steps to achieve the purpose of the embodiment of the present application.

上述根据本申请实施例的方法可在硬件、固件中实现,或者被实现为可存储在记录介质(诸如CD、ROM、RAM、软盘、硬盘或磁光盘)中的软件或计算机代码,或者被实现通过网络下载的原始存储在远程记录介质或非暂时机器可读介质中并将被存储在本地记录介质中的计算机代码,从而在此描述的方法可被存储在使用通用计算机、专用处理器或者可编程或专用硬件(诸如ASIC或FPGA)的记录介质上的这样的软件处理。可以理解,计算机、处理器、微处理器控制器或可编程硬件包括可存储或接收软件或计算机代码的存储组件(例如,RAM、ROM、闪存等),当软件或计算机代码被计算机、处理器或硬件访问且执行时,实现在此描述的方法。此外,当通用计算机访问用于实现在此示出的方法的代码时,代码的执行将通用计算机转换为用于执行在此示出的方法的专用计算机。The above method according to the embodiment of the present application can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as CD, ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or implemented Computer code downloaded over a network that is originally stored in a remote recording medium or a non-transitory machine-readable medium and will be stored in a local recording medium, so that the methods described herein can be stored on a computer code using a general-purpose computer, a dedicated processor, or a Such software processing on a recording medium of programming or dedicated hardware such as ASIC or FPGA. It is understood that a computer, processor, microprocessor controller, or programmable hardware includes memory components (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, when the software or computer code is or hardware when accessed and executed implements the methods described herein. Furthermore, when a general purpose computer accesses code for implementing the methods shown herein, execution of the code transforms the general purpose computer into a special purpose computer for performing the methods shown herein.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及方法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请实施例的范围。Those skilled in the art can appreciate that the units and method steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the embodiments of the present application.

以上实施方式仅用于说明本申请实施例,而并非对本申请实施例的限制,有关技术领域的普通技术人员,在不脱离本申请实施例的精神和范围的情况下,还可以做出各种变化和变型,因此所有等同的技术方案也属于本申请实施例的范畴,本申请实施例的专利保护范围应由权利要求限定。The above implementations are only used to illustrate the embodiments of the application, rather than to limit the embodiments of the application. Those of ordinary skill in the relevant technical fields can also make various implementations without departing from the spirit and scope of the embodiments of the application Changes and modifications, so all equivalent technical solutions also belong to the scope of the embodiments of the present application, and the scope of patent protection of the embodiments of the present application should be defined by the claims.

Claims (10)

1. A method of data compression, comprising:
n signal values are acquired according to a preset acquisition period;
generating a data packet corresponding to the n signal values, wherein the data packet comprises a storage bit and a flag bit, the bit number of the flag bit is n, the i bit of the flag bit is used for identifying that the i bit is different from the i-1 signal value, i is more than or equal to 2, the storage bit is used for storing the 1 st signal value and the j signal value which is identified as different by the flag bit, and j is more than or equal to 2;
and sending the data packet.
2. The method of claim 1, wherein bit 1 of the flag bit is used to identify that the n signal values are all different.
3. The method of claim 1, wherein the n signal values are signal values of a same signal acquired according to a preset acquisition period.
4. The method of claim 1, wherein the number of data packets includes a number, the signal names corresponding to the data packets are stored in a signal table, and further comprising, prior to the transmitting the data packets:
sorting the data packets according to the arrangement sequence of the signal names corresponding to the data packets in the signal table;
packaging the sequenced data packets to obtain a combined packet of the data packets;
the sending the data packet includes:
and sending the combined packet.
5. The method of claim 4, wherein when the data packet is transmitted, if a network is not available, generating a buffer file corresponding to the combined packet.
6. A data parsing method, comprising:
receiving and analyzing a data packet, determining values of storage bits and flag bits in the data packet, and obtaining n signal values according to the values of the storage bits and the flag bits;
wherein n signal values according to the values of the storage bit and the flag bit include:
setting the signal value stored in the storage bit as a signal value corresponding to the jth bit aiming at the jth bit signal value which is marked as different by the marker bit;
and setting the signal value corresponding to the kth bit identified as the same by the flag bit as the signal value corresponding to the kth-1 bit in sequence from the 1 st bit to the nth bit of the flag bit, wherein k is more than or equal to 2.
7. The method of claim 6, wherein said receiving and parsing the data packet comprises:
receiving a combined packet formed by a plurality of data packets;
and determining the signal names corresponding to the data packets according to the signal names stored in the signal table according to the preset sequence and the arrangement sequence of a plurality of data packets in the combined packet.
8. A vehicle, characterized by comprising:
the signal acquisition device is used for acquiring signal values according to a preset acquisition period;
the vehicle end processing device is used for generating a data packet corresponding to the n signal values, wherein the data packet comprises a storage bit and a flag bit, the bit number of the flag bit is n, the i bit of the flag bit is used for identifying that the i bit is different from the i-1 signal value, i is greater than or equal to 2, the storage bit is used for storing the 1 signal value and the j signal value which is identified as different by the flag bit, and j is greater than or equal to 2;
and the data transmission device is used for transmitting the data packet.
9. An electronic device, comprising: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
the memory is configured to store at least one executable instruction that causes the processor to perform operations corresponding to the method of any one of claims 1-7.
10. A computer storage medium, characterized in that the computer storage medium has stored thereon a computer program which, when executed by a processor, implements the method according to any of claims 1-7.
CN202310341060.9A 2023-03-31 2023-03-31 Data compression and analysis method, vehicle, electronic device and storage medium Pending CN116320041A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310341060.9A CN116320041A (en) 2023-03-31 2023-03-31 Data compression and analysis method, vehicle, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310341060.9A CN116320041A (en) 2023-03-31 2023-03-31 Data compression and analysis method, vehicle, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN116320041A true CN116320041A (en) 2023-06-23

Family

ID=86837822

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310341060.9A Pending CN116320041A (en) 2023-03-31 2023-03-31 Data compression and analysis method, vehicle, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN116320041A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6877017B1 (en) * 1999-01-14 2005-04-05 Lg Electronics Inc. Device and method for filtering added information
CN103792570A (en) * 2012-10-26 2014-05-14 中国石油化工股份有限公司 Seismic acquisition data compression and transmission method
CN113625971A (en) * 2021-08-17 2021-11-09 咪咕数字传媒有限公司 Data storage method, apparatus, device, and computer storage medium
CN115145883A (en) * 2021-03-30 2022-10-04 广州汽车集团股份有限公司 A data processing method, device and storage medium
CN115431901A (en) * 2022-02-18 2022-12-06 北京罗克维尔斯科技有限公司 A signal acquisition method, device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6877017B1 (en) * 1999-01-14 2005-04-05 Lg Electronics Inc. Device and method for filtering added information
CN103792570A (en) * 2012-10-26 2014-05-14 中国石油化工股份有限公司 Seismic acquisition data compression and transmission method
CN115145883A (en) * 2021-03-30 2022-10-04 广州汽车集团股份有限公司 A data processing method, device and storage medium
CN113625971A (en) * 2021-08-17 2021-11-09 咪咕数字传媒有限公司 Data storage method, apparatus, device, and computer storage medium
CN115431901A (en) * 2022-02-18 2022-12-06 北京罗克维尔斯科技有限公司 A signal acquisition method, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107634848B (en) System and method for collecting and analyzing network equipment information
CN112000502B (en) Processing method and device for mass error logs, electronic device and storage medium
CN110868336A (en) Data management method, device and computer readable storage medium
CN103888315B (en) A kind of adaptive burst flow detection means and its detection method
CN113434625B (en) Patent retrieval type coding method, device and storage medium
CN1304909C (en) Monitoring instrument of vehicle control system CAN/LIN network and its test method
CN114863582A (en) Vehicle-mounted diagnosis method and device, electronic equipment and readable storage medium
CN116545932A (en) Network card message transmission method, device, computer equipment and storage medium
CN104750814B (en) Automatic storage method of multi-heterogeneous data stream based on multi-sensor
CN110347726A (en) A kind of efficient time series data is integrated to store inquiry system and method
CN116320041A (en) Data compression and analysis method, vehicle, electronic device and storage medium
CN1866821A (en) Network monitoring data compression storing and combination detecting method based on similar data set
CN204790999U (en) Big data acquisition of industry and processing system
CN115794795B (en) Power distribution station electricity consumption data standardization cleaning method, device, system and storage medium
CN117792727A (en) Threat early warning model training and network threat early warning method, device and equipment
CN115454016A (en) A vehicle log collection method and log system
CN116821970A (en) Sampling detection method based on blockchain and Internet of Things
CN115348320A (en) Communication data conversion method and device and electronic equipment
CN114710559A (en) Internet of things data proxy equipment
CN103929404B (en) Method for analyzing HTTP chunked code data
CN112907111A (en) Intelligent monitoring data acquisition and analysis method based on Internet of things technology
CN112187600A (en) Data transmission method for CAN bus system of Internet of vehicles
CN116095015B (en) Electronic sentinel data transmission efficiency improving method, device, equipment and storage medium
CN110688416A (en) Data query method and device and electronic equipment
CN116074348B (en) Cloud computing-based resource node operation monitoring method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination