Data transmission and conversion method for time series data
By generating MQTT theme namespaces on the edge device side and combining time-series data transmission methods, the problem of low timing data transmission and conversion efficiency of onboard edge devices is solved, efficient data transmission and storage is achieved, and the system's processing capability and scalability are improved.
Patent Information
- Application Number
- CN202411914970.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-05-06
AI Technical Summary
The prior art is difficult to achieve efficient transmission and conversion when processing timing data generated by onboard edge devices, and there are problems of redundancy and repeated descriptions, resulting in waste of system resources and inefficient processing.
Efficient data transmission and conversion are achieved by generating an MQTT topic namespace based on sensor identifiers at the edge device end, and combining the transmission of time series data. The specific steps include obtaining the sensor identifier and data points, generating the MQTT topic namespace, transmitting the data to the cloud platform through the MQTT topic client, and parsing and mapping the time series data model of the tree structure in the cloud, and finally writing it to the timing database.
This method greatly reduces the redundant description during data transmission, improves the data interaction efficiency between edge devices and cloud platforms, optimizes the storage structure and query analysis speed of time-series data, and enhances the scalability and flexibility of the system.
Smart Images

Figure CN119938751A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of integrated circuits, and in particular to a data transmission and conversion method for time series data. Background Art
[0002] With the continuous development of airborne equipment and sensors in the aviation field, the health management (PHM) system of civil aircraft faces unprecedented challenges in data collection and transmission. Civil aircraft PHM systems usually rely on a large number of sensor networks to monitor various performance indicators of the aircraft in real time, such as temperature, humidity, vibration, etc. The collected time series data (time series data) plays a vital role throughout the life cycle. Time series data refers to a collection of the same indicator recorded in chronological order, and each piece of data contains a timestamp and a metric value. By analyzing these time series data, it is possible to predict equipment failures and optimize maintenance processes, thereby improving the safety and operational efficiency of aircraft.
[0003] In traditional time series data management, data collection, storage, transmission and analysis mainly rely on centralized cloud platforms. However, with the increase in the number of device types and sensors, traditional data management methods can no longer meet the needs of efficient transmission and real-time processing. In order to meet this challenge, edge computing technology has been widely used in recent years. Under the edge computing architecture, data processing and analysis tasks are completed on edge devices near the device, reducing data transmission delays and bandwidth consumption, and improving the real-time response capability of the system.
[0004] In this context, the large amount of time series data generated by sensors connected to airborne edge devices must be efficiently transmitted and managed. The management of time series data requires not only that the storage system has the ability to read and write quickly, but also that it must be able to process multi-level metadata and support complex queries and analysis. To achieve this goal, the existing technology proposes two time series data modeling methods based on tags and tree structures. However, the existing models usually have the following problems:
[0005] Although the label-based model can effectively identify the basic attributes of data, it is difficult to express hierarchical device relationships;
[0006] The tree-structured model can describe the hierarchical relationship between devices, but it is insufficient in processing complex query logic, and it is prone to repeated descriptions when processing time series data, resulting in a waste of system resources.
[0007] In addition, data transmission and conversion between edge devices and cloud platforms are still difficult. Edge devices usually have limited computing and storage capabilities, and the temporal data patterns generated by sensors are complex and changeable. An efficient mechanism is needed to achieve seamless connection between edge devices and cloud platforms and reduce redundant and repeated descriptions during data transmission.
[0008] Therefore, how to ensure efficient and real-time data transmission while achieving efficient transmission and conversion of time series data and its data between edge devices and cloud platforms has become one of the important technical issues facing the civil aircraft PHM field. Summary of the invention
[0009] In a first aspect of the present disclosure, a method for transmitting and converting time series data is provided, comprising:
[0010] Obtain an identifier and data point of a sensor connected to the airborne edge device, wherein the identifier is divided into a label and an indicator name, wherein the label includes an edge gateway number, a sensor number, and an edge tenant number corresponding to the sensor, the indicator name corresponds to the sensor name, and the data point includes detection data of the sensor and a detection time point corresponding to the detection data;
[0011] Generate a corresponding MQTT topic namespace according to the tag of the sensor, fuse the indicator name and time point of the sensor into time series data, and correspond the MQTT topic namespace to the time series data;
[0012] The MQTT topic namespace and the corresponding time series data are transmitted to the cloud platform MQTT topic client through the MQTT topic client, and the cloud platform MQTT topic client parses the data hierarchy of the sensor according to the cloud MQTT topic namespace and the indicator name in the transmitted data, and maps it into a tree-structured time series data model;
[0013] The detection data of the sensor is written into a time series database based on the time series data model.
[0014] In combination with the first aspect, the label of the sensor connected to the airborne edge device also includes a physical attribute label and a logical attribute label of the sensor, the physical attribute label represents the physical characteristics of the sensor, and the logical attribute label represents the tenant affiliation of the sensor.
[0015] In combination with the first aspect, the generation of the MQTT topic namespace includes:
[0016] Generate a first layer of the MQTT topic namespace according to the edge tenant number, the first layer determining the tenant to which the data belongs, so that the data is isolated between different tenants;
[0017] Generate a second layer of the MQTT topic namespace according to the edge gateway number, the second layer is based on the first layer and distinguishes sensors connected to different edge devices;
[0018] A third layer of the MQTT topic namespace is generated according to the sensor number, and the third layer is based on the second layer and identifies the data collected by the sensor.
[0019] In combination with the first aspect, the time series data is generated by the following steps:
[0020] Extracting the timestamp of the detection data from the data point of the sensor as the time point of the time series data;
[0021] Combining the time point with the indicator name to form a unique identifier for the time series data;
[0022] The unique identifier is bound to the corresponding detection data to form complete time series data.
[0023] In combination with the first aspect, the correspondence between the MQTT topic namespace and the time series data is stored in the form of a key-value pair, where the key is the MQTT topic namespace and the value is the corresponding time series data set.
[0024] In combination with the first aspect, the transmitting of time series data through the MQTT topic client includes the following steps:
[0025] Pack each sensor's time series data into an MQTT payload;
[0026] Classifying and matching the payload according to the MQTT topic namespace;
[0027] The matching payload is sent to the corresponding MQTT topic namespace of the cloud platform through the MQTT topic client.
[0028] In combination with the first aspect, the step of the cloud platform MQTT topic client parsing the transmission data includes:
[0029] Determine the hierarchical structure of the data based on the received MQTT topic namespace;
[0030] Extract indicator names and corresponding detection data from time series data;
[0031] The data model is reconstructed according to the hierarchical relationship of the tenant layer, gateway layer, and sensor layer.
[0032] In combination with the first aspect, the step of writing the detection data of the sensor into the time series database includes:
[0033] Map the tree-structured time series data model obtained through parsing into a hierarchical data table in the database;
[0034] Automatically update or append corresponding detection data according to the time point of time series data;
[0035] Configure indexes for the root node and hierarchical paths of the database.
[0036] According to a second aspect of the present disclosure, there is provided an electronic device, comprising:
[0037] one or more processors;
[0038] A storage unit is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors can implement the data transmission and conversion method for time series data.
[0039] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, characterized in that when the computer program is executed by a processor, the method for data transmission and conversion for time series data can be implemented.
[0040] Beneficial effects: The present invention can significantly reduce redundant descriptions in the data transmission process by generating an MQTT topic namespace based on the sensor identifier at the edge device end and combining it with the transmission of time series data, thereby improving the data interaction efficiency between the edge device and the cloud platform. This method not only optimizes the storage structure of time series data and improves the query and analysis speed, but also clearly expresses the hierarchical relationship between devices through a layered namespace design, thereby enhancing the scalability and flexibility of the system. Overall, this method reduces the burden on edge devices while achieving efficient transmission, management, and storage of time series data, providing a more efficient and real-time solution for data processing in civil aircraft PHM systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A flowchart of a method for transmitting and converting time series data according to an embodiment of the present disclosure;
[0042] Figure 2 A time series data mapping diagram of an embodiment of the present disclosure;
[0043] Figure 3 An electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0044] Here, exemplary embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the embodiments of the present disclosure.
[0045] The terms used in the disclosed embodiments are only for the purpose of describing specific embodiments and are not intended to limit the disclosed embodiments. The singular forms of "a", "said" and "the" used in the disclosed embodiments and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0046] It should be understood that although the terms first, second, third, etc. may be used to describe various information in the disclosed embodiments, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the disclosed embodiments, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0047] With the application of a new generation of data acquisition and transmission equipment in civil aircraft, time series data has become the main body of big data in the field of civil aircraft PHM.
[0048] Time series data, also known as time series data, refers to a collection of data on the same indicator recorded in chronological order.
[0049] Time series data is divided into two parts: one is the identifier (label, indicator name) for easy query and filtering; the other is the data point, including the sensor's detection data (metric value) and the detection time point (timestamp) corresponding to the detection data.
[0050] One of the main sources of time series data is airborne equipment and sensors. Each sensor has multiple tags associated with it. These tags represent the static properties of the sensor, such as the aircraft, equipment, manufacturer, etc.
[0051] like Figure 1 FIG. 1 is a flow chart of a method for transmitting and converting time series data according to an embodiment of the present disclosure, including:
[0052] S101: Obtain the identifier and data point of the sensor connected to the airborne edge device, where the identifier is divided into a label and an indicator name, the label includes the edge gateway number, sensor number and edge tenant number corresponding to the sensor, the indicator name corresponds to the sensor name, and the data point includes the detection data of the sensor and the detection time point corresponding to the detection data.
[0053] Specific, combined Figure 2 The temperature and humidity sensor sht11 collects the physical quantities of temperature temp and humidity humidity. The sensor sht11 is connected to the edge gateway e01. The sensor number d01, the edge gateway e01 number and the edge device tenant t01 constitute the label, wherein the indicator name of the sensor sht11 corresponds to the sensor name sht11, and the data point of the sensor sht11 includes its detection data (field and value) and the detection time point (timestamp) corresponding to the detection data.
[0054] Continue to combine Figure 2 , the present disclosure provides another embodiment, specifically, the sensor sht11 is connected to the edge gateway e02, the sensor number d02, the edge gateway e02 number and the edge device tenant t02 constitute a tag, wherein the indicator name of the sensor sht11 corresponds to the sensor name sht11, and the data point of the sensor sht11 includes its detection data (field and value) and the detection time point (timestamp) corresponding to the detection data;
[0055] The tag consisting of sensor number d01, edge gateway e01 number and edge device tenant t01 and the tag consisting of sensor number d02, edge gateway e02 number and edge device tenant t02 constitute a tag set.
[0056] It should be noted that the edge gateway, sensor number and number of edge device tenants corresponding to the sensor can be set according to data transmission requirements, and this embodiment does not impose specific restrictions here.
[0057] S102: Generate a corresponding MQTT topic namespace according to the tag of the sensor, merge the indicator name and time point of the sensor into time series data, and correspond the MQTT topic namespace to the time series data.
[0058] In MQTT, a topic is a string used to identify and classify messages. A topic consists of one or more levels, separated by slashes ( / ). Topics act as key identifiers for publishing and subscribing messages in MQTT, allowing messages to be accurately routed and delivered to the corresponding subscribers. Therefore, using MQTT topics as an intermediate model to convert between the time series metadata tag model and the tree model has a natural advantage.
[0059] Specifically, continue to combine Figure 2 , according to the label of sensor sht11, namely tenant layer-edge gateway layer-sensor layer, generate its corresponding MQTT topic namespace:
[0060] namespace / tenant-id / edge-id / device-id / . namespace is the MQTT topic namespace prefix. The indicator name sht11 and time point (field, value and timestamp) of sensor sht11 are merged into time series data. The MQTT topic namespace corresponds to the time series data. For example, the MQTT topic namespace of sensor sht11 corresponds to the time series data, and the MQTT topic namespace of sensor sht12 (not shown in the figure) corresponds to the time series data.
[0061] S103: The MQTT topic namespace and its corresponding time series data are transmitted to the cloud platform MQTT topic client through the MQTT topic client. The cloud platform MQTT topic client parses the data hierarchy of the sensor according to the cloud MQTT topic namespace and the indicator name in the transmitted data, and maps it into a tree-structured time series data model.
[0062] Specifically, through step 2, each sensor tag set is mapped to an MQTT topic.
[0063] Then configure the topic as the publishing topic of each MQTT client instance. The time series data collected by the sensor is packaged into an MQTT payload and published by each MQTT client instance to the corresponding publishing topic of the MQTT agent on the cloud platform to complete the transmission process of the time series data.
[0064] The cloud platform MQTT client subscribes to all topics, parses the time series data and its hierarchical relationship based on the cloud MQTT topic namespace and the indicator name in the payload, and maps it into a tree-structured time series data model.
[0065] The tree-structured time series data model is a tree structure with root as the root node, which connects storage groups, devices, and sensors in series. In the tree, each leaf node corresponds to a sensor, and each sensor has its corresponding edge device.
[0066] Furthermore, according to the MQTT topic namespace, the MQTT topic and indicator name are parsed to re-form the metadata of the hierarchical organization structure and the indicator name metadata and time series data. The metadata of the hierarchical organization structure is the tenant layer-edge gateway layer-sensor layer, where root is the root node. Each node of the indicator name metadata and time series data is a leaf node, and the data model is defined in a tree structure. A time series is named by the path from the root node to the leaf node, and the layers are connected by ".", for example, Figure 2 The time series name corresponding to the leftmost path is root.t01.e01.d01.temp.
[0067] S104: Writing the detection data of the sensor into a time series database based on the time series data model.
[0068] Specifically, the cloud platform storage program integrates the metadata of the hierarchical organizational structure and the indicator name metadata and the time series data, writes them into the time series database based on the tree model, and completes the storage process.
[0069] The tree model can manage physical equipment entities with complex organizational relationships in a tree structure and use wildcards to fuzzily match these metadata. Therefore, in the field of civil aircraft PHM, a time series database based on a tree model is used to store massive time series data, which meets the extremely high intensity of write operations. In the time series database, any prefix path can be set as a database.
[0070] If there are 4 time series:
[0071] root.t01.e01.d01.temp,root.t01.e01.d01.humidity,
[0072] root.t01.e02.d02.temp,root.t01.e02.d02.humidity,
[0073] The two edge device entities e01 and e02 under the path root.t01 may belong to the same aircraft. In this case, the prefix path root.t0 can be designated as a database.
[0074] In the future, new entities added under root.t01 will also belong to this database. Therefore, it meets the flexible and changeable characteristics of data collection points in the field of civil aircraft PHM, as well as the diverse needs for metadata in complex scenarios.
[0075] Furthermore, the label of the sensor connected to the airborne edge device also includes a physical attribute label and a logical attribute label of the sensor, wherein the physical attribute label indicates the physical characteristics of the sensor, and the logical attribute label indicates the tenant affiliation of the sensor.
[0076] Specifically, the physical property label is used to indicate the actual physical characteristics of the sensor, including but not limited to the type, model, manufacturer, installation location, measurement range, accuracy level and other information of the sensor. For example, the physical property label of a temperature and humidity sensor may include "Model: SHT11", "Measurement range: -40℃ to 85℃", "Accuracy: ±1℃", etc. These labels help to distinguish different types of sensors and equipment of different specifications, ensuring that the physical characteristics of each sensor can be accurately identified during data collection and processing.
[0077] Logical attribute labels indicate the logical ownership of sensors in the system, and are mainly used to identify the tenant ownership information of sensors. These labels usually include tenant numbers, edge gateway numbers, device numbers, etc., which help determine the management unit where the sensor is located. For example, the tenant number to which the sensor belongs (such as "tenant t01") indicates which airline or maintenance company the sensor belongs to, the edge gateway number (such as "gateway e01") identifies the edge device to which the sensor is connected, and the device number (such as "device d01") specifically points to the device where the sensor is located. These logical attribute labels are crucial for data management, permission control, and cross-system collaboration.
[0078] This labeling mechanism not only improves the accuracy of data management, but also provides strong data support for subsequent maintenance, fault diagnosis and optimization work, making the entire system more scalable and operable when facing the complex management needs of different devices and sensors.
[0079] Furthermore, the generation of the MQTT topic namespace includes:
[0080] Generate a first layer of the MQTT topic namespace according to the edge tenant number, the first layer determining the tenant to which the data belongs, so that the data is isolated between different tenants;
[0081] Generate a second layer of the MQTT topic namespace according to the edge gateway number, the second layer is based on the first layer and distinguishes sensors connected to different edge devices;
[0082] A third layer of the MQTT topic namespace is generated according to the sensor number, and the third layer is based on the second layer and identifies the data collected by the sensor.
[0083] Specifically, the namespace of the first layer is generated based on the edge tenant number, which is mainly used to identify the tenant to which the data belongs. The tenant number usually represents a specific user or service unit, such as an airline or maintenance company. By using the tenant number as the first layer, it can ensure that the data between different tenants is completely isolated. In this way, even if multiple tenants share the same physical device and sensor, their data will not interfere with or leak each other. The design of this layer ensures the privacy and security of the data, avoids access conflicts between tenants, and is particularly suitable for multi-tenant environments.
[0084] The second-layer namespace is generated based on the edge gateway number, with the purpose of distinguishing sensors connected to different edge devices under the same tenant. In actual applications, multiple edge devices may be located under the same tenant. For example, an airline may deploy multiple edge devices on different aircraft, and each device may be connected to multiple sensors. Therefore, the second layer can accurately distinguish and manage sensor data on different edge devices by incorporating the edge gateway number into the namespace. This layer ensures that data can be classified according to different devices, which helps to clearly identify the source of the device when processing data, thereby facilitating subsequent device management and data analysis.
[0085] The third-layer namespace is generated based on the sensor number and identifies the data collected by the specific sensor. Each sensor on an edge device usually has a unique number that represents the sensor itself. As the third layer, the sensor number can accurately identify the data collected by each sensor. Sensor data usually includes physical quantities such as temperature, humidity, and pressure. These data can be matched one-to-one with specific sensors through the third-layer identification, thereby improving the accuracy of data processing. For example, the data collected by temperature and humidity sensors, pressure sensors, acceleration sensors, etc. can be clearly distinguished by their numbers and namespaces to avoid data confusion.
[0086] Through this hierarchical design, the MQTT topic namespace not only clearly identifies the source and ownership of the data, but also has good scalability and flexibility. The naming structure of each layer can be adjusted and optimized according to actual business needs, further improving the configurability of the system. For example, as the system expands, new edge devices or sensors can be added to the existing namespace through simple naming rules without changing the existing data structure. At the same time, this hierarchical approach makes data routing more efficient during transmission, which can reduce unnecessary data transmission and resource consumption. Through hierarchical management of namespaces, the response speed and processing efficiency during data transmission can be effectively improved, and network bandwidth and storage pressure can be reduced.
[0087] Furthermore, the time series data is generated by the following steps:
[0088] Extracting the timestamp of the detection data from the data point of the sensor as the time point of the time series data;
[0089] Combining the time point with the indicator name to form a unique identifier for the time series data;
[0090] The unique identifier is bound to the corresponding detection data to form complete time series data.
[0091] Specifically, each sensor data point usually has a timestamp associated with it, marking the specific moment when the data was collected. In time series data, time is a crucial element, because the core feature of time series data is that it is arranged in chronological order. By extracting the timestamp from each sensor data point, the accuracy and continuity of the data in the time dimension are ensured.
[0092] In the process of generating time series data, the timestamp becomes a "time point" to identify the moment when the data occurs. The key to this step is to ensure that the time information of each data point is accurate and reliable. For example, a sensor may record data once a second, in which case each data point has an accurate timestamp as its identifier.
[0093] Time series data includes not only the time point, but also the indicator name, that is, the specific physical quantity measured (such as temperature, humidity, pressure, etc.). Each sensor usually has multiple indicator names, representing the different parameters it monitors. By combining the time point with the indicator name, a unique identifier can be generated for each data point. This identifier can indicate both the time when the data was collected and which indicator the data represents.
[0094] The combination of time point and indicator name can ensure the uniqueness of each time series data. For example, if the temperature sensor collects data at 12:00 on December 4, 2024, the unique identifier of the data may be "temperature_2024-12-04T12:00". This combination can avoid data confusion and help subsequent query, storage, and analysis operations.
[0095] When generating time series data, one of the most important steps is to bind a unique identifier (consisting of a time point and a metric name) to the sensor's detection data. This step ensures the integrity of each time series data point: that is, each time series data not only has a time identifier and a metric name, but also contains the actual measurement value.
[0096] Forming complete time series data: Through this binding, the time series data becomes complete, structured, and easy to store and process. Time series data usually includes the following parts:
[0097] Time point: the time when the data was collected.
[0098] Indicator name: The physical quantity or measurement object represented by the data.
[0099] Data value: The actual measurement data or numerical value.
[0100] Unique Identifier: A unique identifier that combines the time point and the metric name.
[0101] For example, if the temperature sensor detects a temperature of 25°C at a certain moment and records the timestamp as 12:00 on December 4, 2024, then the time series data can be structured as follows:
[0102] Unique identifier: "temperature_2024-12-04T12:00", data value: "25℃", time point: "2024-12-04T12:00", metric name: "temperature".
[0103] Furthermore, the correspondence between the MQTT topic namespace and the time series data is stored in the form of a key-value pair, where the key is the MQTT topic namespace and the value is the corresponding time series data set.
[0104] Key-Value Pair is a common data storage and management method, in which each pair of key and corresponding value is closely associated. The key is usually used to uniquely identify a data item, while the value stores the specific content or data of the data item. In the present invention, the key is the MQTT topic namespace, and the value is the time series data set corresponding to the namespace.
[0105] Optionally, you can use other names as keys and the time series data sets corresponding to the other names as values.
[0106] Furthermore, the transmission of time series data through the MQTT topic client includes the following steps:
[0107] Pack each sensor's time series data into an MQTT payload;
[0108] Classifying and matching the payload according to the MQTT topic namespace;
[0109] The matching payload is sent to the corresponding MQTT topic namespace of the cloud platform through the MQTT topic client.
[0110] Payload refers to the actual data part transmitted in the MQTT protocol. In the present invention, the time series data needs to be packaged as an MQTT payload so as to be transmitted through the MQTT protocol.
[0111] Packaging process of time series data:
[0112] First, for each sensor, the system integrates the collected time series data (e.g., timestamp, indicator name, detection value, etc.) into a data packet (i.e., payload).
[0113] This data packet not only contains the sensor's detection data, but also includes sensor-related information, such as sensor number, sensor name, and the edge device to which it belongs.
[0114] The packaged payload has a clear and compact structure, making it easy to transmit over the network.
[0115] When transmitting, each sensor's time series data payload is matched with its corresponding MQTT topic namespace. This namespace is usually generated based on the sensor's attributes (such as edge tenant number, edge gateway number, sensor number, etc.) to ensure that the data can be bound to the correct topic.
[0116] Once the payload and topic namespace are matched, the MQTT topic client is responsible for sending these matched payloads to the cloud platform. The cloud platform also has a corresponding MQTT topic namespace, and the system will send the data to the corresponding namespace.
[0117] Furthermore, the step of the cloud platform MQTT topic client parsing the transmission data includes:
[0118] Determine the hierarchical structure of the data based on the received MQTT topic namespace;
[0119] Extract indicator names and corresponding detection data from time series data;
[0120] The data model is reconstructed according to the hierarchical relationship of the tenant layer, gateway layer, and sensor layer.
[0121] Furthermore, the step of writing the detection data of the sensor into the time series database includes:
[0122] Map the tree-structured time series data model obtained through parsing into a hierarchical data table in the database;
[0123] Automatically update or append corresponding detection data according to the time point of time series data;
[0124] Configure indexes for the root node and hierarchical paths of the database.
[0125] The electronic device 300 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 300 may include, but is not limited to, a processor 301 and a memory 302. Those skilled in the art will appreciate that Figure 3It is only an example of the electronic device 300 and does not constitute a limitation of the electronic device 300. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.
[0126] The processor 301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0127] The memory 302 may be an internal storage unit of the electronic device 300, for example, a hard disk or memory of the electronic device 300. The memory 302 may also be an external storage device of the electronic device 300, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 300. Further, the memory 302 may also include both an internal storage unit of the electronic device 300 and an external storage device. The memory 302 is used to store the computer program 303 and other programs and data required by the electronic device. The memory 302 may also be used to temporarily store data that has been output or is to be output.
[0128] In the embodiments provided in the present disclosure, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. Multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection of devices or units, which may be electrical, mechanical or other forms.
[0129] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present disclosure implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.
[0130] The above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should all be included in the protection scope of the present disclosure.
Claims
1. A data transmission and conversion method for time series data, characterized in that: include: Obtain an identifier and data point of a sensor connected to the airborne edge device, wherein the identifier is divided into a label and an indicator name, wherein the label includes an edge gateway number, a sensor number, and an edge tenant number corresponding to the sensor, the indicator name corresponds to the sensor name, and the data point includes detection data of the sensor and a detection time point corresponding to the detection data; Generate a corresponding MQTT topic namespace according to the tag of the sensor, fuse the indicator name and time point of the sensor into time series data, and correspond the MQTT topic namespace to the time series data; The MQTT topic namespace and the corresponding time series data are transmitted to the cloud platform MQTT topic client through the MQTT topic client, and the cloud platform MQTT topic client parses the data hierarchy of the sensor according to the cloud MQTT topic namespace and the indicator name in the transmitted data, and maps it into a tree-structured time series data model; The detection data of the sensor is written into a time series database based on the time series data model.
2. The method according to claim 1, characterized in that The label of the sensor connected to the airborne edge device also includes a physical attribute label and a logical attribute label of the sensor, wherein the physical attribute label indicates the physical characteristics of the sensor, and the logical attribute label indicates the tenant affiliation of the sensor.
3. The method according to claim 1, characterized in that: The generation of the MQTT topic namespace includes: Generate a first layer of the MQTT topic namespace according to the edge tenant number, the first layer determining the tenant to which the data belongs, so that the data is isolated between different tenants; Generate a second layer of the MQTT topic namespace according to the edge gateway number, the second layer is based on the first layer and distinguishes sensors connected to different edge devices; A third layer of the MQTT topic namespace is generated according to the sensor number, and the third layer is based on the second layer and identifies the data collected by the sensor.
4. The method according to claim 1, characterized in that The time series data is generated by the following steps: Extracting the timestamp of the detection data from the data point of the sensor as the time point of the time series data; Combining the time point with the indicator name to form a unique identifier for the time series data; The unique identifier is bound to the corresponding detection data to form complete time series data.
5. The method according to claim 1, characterized in that The correspondence between the MQTT topic namespace and the time series data is stored in the form of a key-value pair, where the key is the MQTT topic namespace and the value is the corresponding time series data set.
6. The method according to claim 1, characterized in that The transmission of time series data through the MQTT topic client includes the following steps: Pack each sensor's time series data into an MQTT payload; Classifying and matching the payload according to the MQTT topic namespace; The matching payload is sent to the corresponding MQTT topic namespace of the cloud platform through the MQTT topic client.
7. The method according to claim 1, characterized in that The steps of the cloud platform MQTT topic client parsing the transmitted data include: Determine the hierarchical structure of the data based on the received MQTT topic namespace; Extract indicator names and corresponding detection data from time series data; The data model is reconstructed according to the hierarchical relationship of the tenant layer, gateway layer, and sensor layer.
8. The method according to claim 1, characterized in that: The step of writing the detection data of the sensor into the time series database comprises: Map the tree-structured time series data model obtained through parsing into a hierarchical data table in the database; Automatically update or append corresponding detection data according to the time point of time series data; Configure indexes for the root node and hierarchical paths of the database.
9. An electronic device, characterized in that: include: one or more processors; A storage unit, used to store one or more programs, which, when executed by the one or more processors, enable the one or more processors to implement the data transmission and conversion method for time series data according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it can implement the data transmission and conversion method for time series data according to any one of claims 1 to 8.