A method and device for transmitting time series data
By performing protocol conversion of the timing data sent by the terminal device in the edge device and transmitting it in an array, the problem of wasted time series data transmission resources in the industrial Internet of Things is solved, and more efficient use of transmission resources is achieved.
Patent Information
- Application Number
- CN202510027093.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-01-08
AI Technical Summary
During the data transmission process of the Industrial Internet of Things, the sequence data sent by the terminal device will be amplified during the protocol conversion process, resulting in waste of transmission resources.
By performing protocol conversion on the timing data sent by the terminal device in the edge device, the timing data converted after the protocol is transmitted in an array, reducing the filling operation for each data, thereby reducing the amount of data and improving the utilization efficiency of transmission resources.
This method effectively reduces the amount of time series data converted by the protocol and improves the efficiency of the utilization of transmission resources. Especially when processing different types of time series data, the applicability and efficiency are significantly improved.
Smart Images

Figure CN119484549B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computers, and in particular to a method and device for transmitting time series data. Background Art
[0002] As a branch of the Internet of Things, the Industrial Internet of Things (IIoT) focuses on applications in the industrial field and has been widely developed in recent years. The Industrial Internet of Things connects terminal devices, edge devices, and platform devices to the network to achieve real-time monitoring, data collection, analysis, and optimization of industrial equipment and processes.
[0003] In the current data transmission scheme of the Industrial Internet of Things, the terminal device reports the collected sequence data to the edge device. The edge device needs to convert the sequence data into the protocol format required by the platform device, and then report the sequence data to the platform device. After the access layer of the platform device receives the sequence data, it also needs to convert the format of the sequence data again before persisting it in the storage. Finally, the platform device performs real-time or offline analysis on the stored sequence data.
[0004] However, during the protocol conversion process of the above-mentioned edge devices and platform devices, the sequence data sent by the terminal device will be amplified during the conversion process. For example, during the protocol conversion process, the edge device needs to complete some metadata or model names required by the protocol for each data in the sequence data. The supplementary content of each data in the sequence data occupies a large amount of transmission resources, resulting in a waste of transmission resources. Summary of the invention
[0005] The embodiment of the present application provides a time series data transmission method for improving the utilization efficiency of transmission resources. The embodiment of the present application also provides a time series data transmission device, a computing device, a computer-readable storage medium and a computer program product corresponding to the time series data transmission method.
[0006] In the first aspect, the embodiment of the present application provides a method for transmitting time series data, which can be executed by a computing device, or by a component of the computing device, such as a processor, chip or chip system of the computing device, or by a logic module or software that can realize all or part of the functions of the computing device. Taking the edge device as an example of the computing device, the method provided in the first aspect includes: the edge device receives the first time series data sent by the terminal device, and the first time series data includes multiple data values collected by the terminal device and timestamps corresponding to the multiple data values. The edge device performs protocol conversion on the first time series data to obtain second time series data, and the protocol conversion includes modifying the transmission format of the first time series data. The second time series data includes a data array, a start time and an end time, and the data array includes multiple data values. The start time is used to indicate the minimum timestamp among the timestamps corresponding to the multiple data values, and the end time is used to indicate the maximum timestamp among the timestamps corresponding to the multiple data values. The edge device sends the second time series data to the platform device, so that the platform device stores the second time series data based on the data transmission format of the second time series data.
[0007] In the embodiment of the present application, the edge device can perform protocol conversion on the timing data sent by the terminal device, so that the timing data after protocol conversion can be transmitted in the form of an array. Compared with the current solution, the edge device needs to supplement the data value and time value of each timing data with the content required by the protocol format when performing protocol conversion on the timing data sent by the terminal device. The timing data transmission method provided in the embodiment of the present application supplements the content required by the protocol format in the form of an array, and there is no need to supplement each data, thereby reducing the data volume of the timing data after the protocol conversion and improving the utilization efficiency of transmission resources.
[0008] In one possible implementation, before the edge device performs protocol conversion on the first time series data, the edge device identifies the equidistant transmission of the first time series data and determines the transmission type of the first time series data. The transmission types include equidistant transmission and unequally spaced transmission. The equidistant transmission indicates that the timestamp intervals corresponding to the multiple data values are equal, and the unequally spaced transmission indicates that the timestamp intervals corresponding to the multiple data values are not equal.
[0009] In the embodiment of the present application, the edge device can identify the equidistant transmission of the first time series data. For the first time series data of different transmission types, the edge device can use different transmission formats to perform protocol conversion on the first time series data, thereby improving the applicability of processing time series data of different transmission types and further improving the utilization efficiency of transmission resources.
[0010] In one possible implementation, when it is determined that the transmission type of the first time series data is equidistant transmission, the second time series data also includes an incremental time, and the incremental time is used to indicate the same time interval of multiple data values in the data array. The edge device can restore the timestamp corresponding to each data value in the time series data based on the start time and the incremental time.
[0011] In the embodiment of the present application, after the edge device determines that the transmission type of the first time series data is equidistant transmission, the edge device can represent the timestamps corresponding to multiple data values in the first time series data based on the start time, end time and incremental time, thereby eliminating the need to transmit the timestamps corresponding to multiple data values, reducing the amount of transmitted data and improving the utilization efficiency of transmission resources.
[0012] In one possible implementation, during the process of the edge device performing protocol conversion on the first time series data, when the transmission type of the first time series data is equidistant transmission, the edge device generates a data array based on multiple data values in the first time series data, and generates time metadata based on multiple timestamps in the first time series data, and the time metadata includes a start time, an end time, and an incremental time.
[0013] In an embodiment of the present application, the edge device can generate a data array based on multiple data values in the first time series data transmitted at equal intervals, and generate time metadata based on multiple timestamps in the first time series data transmitted at equal intervals, thereby reducing the amount of data transmitted in the time series data and improving the utilization efficiency of transmission resources.
[0014] In one possible implementation, when the edge device determines that the transmission type of the first time series data is non-equidistant transmission, the second time series data also includes a time array, and the time array includes timestamps corresponding to multiple data values; or, when the edge device determines that the transmission type of the first time series data is non-equidistant transmission, the second time series data also includes an incremental time array, and the incremental time array includes different time intervals corresponding to multiple data values.
[0015] In the embodiment of the present application, after the edge device determines that the transmission type of the first time series data is non-equidistant transmission, the edge device can represent the timestamps corresponding to multiple data values in the first time series data based on the start time, end time and time array, or the edge device can represent the timestamps corresponding to multiple data values in the first time series data based on the start time, end time and incremental time array, thereby eliminating the need to supplement the timestamp corresponding to each data value with the format content, reducing the amount of transmitted data and improving the utilization efficiency of transmission resources.
[0016] In one possible implementation, during the process of the edge device performing protocol conversion on the first time series data, when the transmission type of the first time series data is non-equidistant transmission, the edge device generates a data array based on multiple data values in the first time series data, and generates time metadata and a time array based on multiple timestamps in the first time series data, or the edge device generates time metadata and an incremental time array based on multiple timestamps in the first time series data, and the time metadata includes a start time and an end time.
[0017] In an embodiment of the present application, the edge device can generate a data array based on multiple data values in the first time series data transmitted at non-equidistant intervals, and generate time metadata based on multiple timestamps in the first time series data transmitted at non-equidistant intervals, thereby reducing the amount of data transmitted in the time series data and improving the utilization efficiency of transmission resources.
[0018] In a possible implementation, the edge device receives third time series data sent by the terminal device, the transmission type of the third time series data is equidistant transmission, and the third time series data includes a data array, a start time, an end time, and an incremental time.
[0019] In the embodiment of the present application, when the terminal device sends equally spaced timing data, it can also send it in the form of data array, start time, end time and incremental time, thereby improving the utilization efficiency of transmission resources.
[0020] In one possible implementation, the edge device receives third timing data sent by the terminal device, the transmission type of the third timing data is non-equidistant transmission, and the third timing data includes a data array, a start time, an end time, and a time array, or the third timing data includes a data array, a start time, an end time, and an incremental time array.
[0021] In the embodiment of the present application, when the terminal device sends non-uniformly spaced timing data, it can also be sent in the form of data array, start time, end time and time array, or it can be sent in the form of data array, start time, end time and incremental time array, thereby improving the utilization efficiency of transmission resources.
[0022] In a possible implementation, after the edge device sends the second time series data to the platform device, the platform device receives a data read request, where the data read request is used to obtain multiple data values and corresponding timestamps in the second time series data. The platform device responds to the data read request based on the data array and time metadata, and the platform device responds to the data read request based on the persistently stored time column and data column.
[0023] In the embodiment of the present application, the platform device can receive a data read request for time series data from an external system, and the platform device can then restore the time series data to be read by the external system based on the data array and time metadata, thereby improving the feasibility of reading time series data from the platform device in the embodiment of the present application.
[0024] In a second aspect, an embodiment of the present application provides a transmission device for time series data, the device comprising a transceiver unit and a processing unit, wherein the transceiver unit is used to receive first time series data sent by a terminal device, the first time series data comprising multiple data values collected by the terminal device and timestamps corresponding to the multiple data values. The processing unit is used to perform protocol conversion on the first time series data to obtain second time series data, the protocol conversion comprising modifying the transmission format of the first time series data, the second time series data comprising a data array, a start time and an end time, the data array comprising multiple data values, the start time being used to indicate the minimum timestamp among the timestamps corresponding to the multiple data values, and the end time being used to indicate the maximum timestamp among the timestamps corresponding to the multiple data values. The transceiver unit is also used to send the second time series data to the platform device, so that the platform device stores the second time series data based on the data transmission format of the second time series data.
[0025] In one possible implementation, the processing unit is also used to identify equidistant transmission of the first time series data and determine the transmission type of the first time series data, the transmission type including equidistant transmission and unequally spaced transmission, the equidistant transmission indicating that the timestamp intervals corresponding to the multiple data values are equal, and the unequally spaced transmission indicating that the timestamp intervals corresponding to the multiple data values are not equal.
[0026] In a possible implementation, the processing unit is further configured to, when determining that the transmission type of the first timing data is equal-interval transmission, the second timing data further includes an incremental time, and the incremental time is used to indicate the same time interval between multiple data values in the data array.
[0027] In one possible implementation, the processing unit is specifically used to generate a data array based on multiple data values in the first time series data, and generate time metadata based on multiple timestamps in the first time series data, wherein the time metadata includes a start time, an end time, and an incremental time.
[0028] In one possible implementation, the processing unit is also used to, when it is determined that the transmission type of the first time series data is non-equidistant transmission, the second time series data also includes a time array, and the time array includes timestamps corresponding to multiple data values; or, when it is determined that the transmission type of the first time series data is non-equidistant transmission, the second time series data also includes an incremental time array, and the incremental time array includes different time intervals corresponding to multiple data values.
[0029] In one possible implementation, the processing unit is specifically used to generate a data array based on multiple data values in the first time series data, generate time metadata and a time array based on multiple timestamps in the first time series data, or generate time metadata and an incremental time array based on multiple timestamps in the first time series data, wherein the time metadata includes a start time and an end time.
[0030] In a possible implementation, the transceiver unit is further used to receive third timing data sent by the terminal device, the transmission type of the third timing data is equidistant transmission, and the third timing data includes a data array, a start time, an end time, and an incremental time.
[0031] In one possible implementation, the transceiver unit is also used to receive third timing data sent by the terminal device, the transmission type of the third timing data is non-equidistant transmission, and the third timing data includes a data array, a start time, an end time, and a time array, or the third timing data includes a data array, a start time, an end time, and an incremental time array.
[0032] In a possible implementation, the transceiver unit is further configured to receive a data read request, the data read request being used to obtain a plurality of data values and corresponding timestamps in the second time series data. The processing unit is further configured to respond to the data read request based on the data array and the time metadata.
[0033] In a third aspect, an embodiment of the present application provides a computing device, comprising a processor, the processor being coupled to a memory, the processor being used to store instructions, and when the instructions are executed by the processor, the computing device executes the method described in the first aspect or any possible implementation of the first aspect.
[0034] In a fourth aspect, an embodiment of the present application provides a computing device cluster, the computing device cluster includes one or more computing devices, the computing device includes a processor, the processor is coupled to a memory, the processor is used to store instructions, when the instructions are executed by the processor, the computing device cluster executes the method described in the first aspect or any possible implementation method of the first aspect.
[0035] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium having instructions stored thereon. When the instructions are executed, the computer executes the method described in the first aspect or any possible implementation manner of the first aspect.
[0036] In a sixth aspect, an embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed, the computer implements the method described in the first aspect or any possible implementation method of the first aspect.
[0037] It can be understood that the beneficial effects that can be achieved by any of the time series data transmission devices, computing devices, computing device clusters, computer-readable media or computer program products provided above can be referred to the beneficial effects in the corresponding methods and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A schematic diagram of the system architecture of a time series data transmission system provided in an embodiment of the present application;
[0039] Figure 2 A schematic diagram of a flow chart of a method for transmitting time series data provided in an embodiment of the present application;
[0040] Figure 3 A schematic diagram of the structure of a first time series data provided in an embodiment of the present application;
[0041] Figure 4 A schematic diagram of a flow chart of another method for transmitting time series data provided in an embodiment of the present application;
[0042] Figure 5 A schematic diagram of a flow chart of another method for transmitting time series data provided in an embodiment of the present application;
[0043] Figure 6 A schematic diagram of a process for reading time series data provided in an embodiment of the present application;
[0044] Figure 7 A schematic diagram of an index structure of time series data provided in an embodiment of the present application;
[0045] Figure 8 A schematic diagram of the structure of a transmission device for time series data provided in an embodiment of the present application;
[0046] Fig. 9 A schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0047] Fig.10 A schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;
[0048] Fig.11 A schematic diagram of the structure of another computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] The embodiments of the present application provide a method and device for transmitting time series data, which are used to improve the utilization efficiency of transmission resources.
[0050] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0051] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0052] First, some terms involved in the embodiments of the present application are introduced to facilitate technical personnel in this field to understand the technical solution.
[0053] Influxdb line protocol is a simple text format used by the InfluxDB database to write time series data. This protocol allows users to easily write data points to InfluxDB.
[0054] Minimum time (mintime) refers to the minimum time of time series data generated within a period of time in the industrial Internet of Things, which may also be referred to as the start time in the embodiment of the present application.
[0055] The maximum time (maxtime) refers to the maximum time of the time series data generated within a period of time in the industrial Internet of Things, which may also be called the end time in the embodiment of the present application.
[0056] Delta time refers to the incremental value obtained by subtracting the current time from a certain start time.
[0057] In order to make the technical solution of the present application clearer and easier to understand, the system architecture of the present application is introduced below with reference to the accompanying drawings.
[0058] See also Figure 1 , Figure 1 A schematic diagram of the system architecture of a time series data transmission system provided in an embodiment of the present application. Figure 1In the example shown, the time series data transmission system 10 includes a terminal device 101, an edge device 102, and a platform device 103, wherein the edge device 102 includes a point acquisition module 1021 and a protocol conversion module 1022, and the platform device 103 includes an access layer 1031, a storage layer 1032, and an open interface 1033. The functions of each module are described in detail below.
[0059] The terminal device 101 is a front-end device of the time series data transmission system 10, which is used to obtain various data in the production environment, thereby obtaining time series data in the industrial Internet of Things. The terminal device 101 can also be called a field device or a collection device. The time series data obtained by the terminal device 101 can be time series data with equal intervals, such as periodically collected data, or can be time series data with non-equal intervals, such as data collected by triggering certain conditions.
[0060] In addition to acquiring time series data, the terminal device 101 also has functions such as data processing, transmission and remote management. For example, the terminal device 101 is also used to report time series data to the edge device 102. The time series data can be time series data collected by other devices of the terminal device 101, or it can be time series data generated by the terminal device 101, without specific limitation.
[0061] The terminal device 101 includes various types of sensors for monitoring physical quantities in the production environment, such as temperature sensors, pressure sensors, and humidity sensors, etc. The terminal device 101 also includes various types of monitors, controllers, and actuators, such as programmable controllers and intelligent meters, etc.
[0062] The edge device 102 is located between the terminal device 101 and the platform device 103, and is used to pre-process the time series data reported by the terminal device 101, including protocol conversion of the message sent by the terminal device 101. The edge device 102 is usually deployed at the production site or close to the data source, and the edge device 102 is, for example, an edge computing gateway or an edge server.
[0063] The edge device 102 includes a point acquisition module 1021 and a protocol conversion module 1022. The point acquisition module 1021 is used for time series data reported by one or more terminal devices 101, and these time series data can also be called point data. For example, the point acquisition module 1021 can actively send a polling acquisition command to periodically obtain the point data of the terminal device.
[0064] The acquisition process of the point acquisition module 1021 requires the configuration of the terminal device address, point register and other information to be collected in the edge device in advance, and this information is added to the edge device in the form of a point table. When the point acquisition module 1021 receives the acquisition command, it will access the corresponding terminal device, register, etc. according to the information in the point table, read the data and save it.
[0065] The protocol conversion module 1022 is used to convert the communication protocols used by different devices into a unified protocol format. Since different terminal devices 101 may use different communication protocols, such as Modbus, RS232, RS485, TCP / IP, etc., when the edge device 102 receives sequence data from different protocols, the protocol conversion module 1022 can identify the source and format of the data and convert it into a unified format or protocol, so that data between different devices can be exchanged and processed on the same platform.
[0066] The platform device 103 is used for centralized storage, analysis and application of time series data. The platform device 103 may also be referred to as a cloud platform or an industrial Internet of Things platform in the embodiment of the present application. The platform device 103 is usually deployed in the cloud or data center, has powerful computing and storage capabilities, and provides a wealth of applications and services.
[0067] The platform device 103 includes an access layer 1031, a storage layer 1032, and an open interface 1033. The access layer 1031 is used to receive the time series data sent by the edge device 102. The access layer 1031 includes a time series data access interface protocol newly added in the embodiment of the present application. The time series data access interface protocol can process the time series data in the form of an array, thereby avoiding the Influxdb line protocol conversion, and can directly transmit the time series data in the form of an array to the storage layer 1032.
[0068] The storage layer 1032 is used to persistently store the time series data from the access layer 1031. Specifically, since the time series data from the access layer 1031 is time series data processed according to the time series data access interface protocol, the storage layer 1032 can directly determine the data column and time metadata of the time series data based on the time series data.
[0069] The storage layer 1032 can also compress the time series data from the access layer 1031, thereby achieving high-density storage of the time series data. The storage layer 1032 can also provide services such as time series data query, regular backup and data recovery.
[0070] The open interface 1033 is an interface for the IIoT platform to interact with external systems. The open interface 1033 may be an application programming interface (API), and the IIoT platform allows external systems or applications to access the functions and data of the IIoT platform through the open interface 1033. For example, the IIoT platform can also provide subscriptions to time series data for external systems through the open interface 1033, so that the external system can receive the time series data of the IIoT platform in real time.
[0071] It should be noted that the time series data transmission system 10 in the embodiment of the present application can be applied to the Internet of Things scenarios in industries such as industry, electricity, pharmaceuticals, and tobacco, and can also be applied to other scenarios such as processor, memory, and disk monitoring scenarios, without specific limitation. In addition, the data characteristics of the time series data processed by the time series data transmission system 10 in the embodiment of the present application include that the data is continuously generated as time changes, and the generated data does not change.
[0072] based on Figure 1 The time series data transmission system 10 shown in the figure, the present application also provides a time series data transmission method. The time series data transmission method provided by the embodiment of the present application is introduced below in combination with the embodiment.
[0073] See also Figure 2 , Figure 2 A flow chart of a method for transmitting time series data provided in an embodiment of the present application. Figure 2 In the example shown, the method includes the following steps:
[0074] 201. The edge device receives first time series data sent by the terminal device, where the first time series data includes multiple data values collected by the terminal device and timestamps corresponding to the multiple data values.
[0075] The terminal device 101 sends first time series data to the edge device 102, where the first time series data includes multiple data values collected by the terminal device 101 and timestamps corresponding to the multiple data values, where the multiple data values can also be referred to as multiple points of sequence data. For example, the first time series data can be speed data collected by the terminal device 101 at different time points.
[0076] In the embodiment of the present application, the transmission type of the first sequence data includes equidistant transmission and non-equidistant transmission, wherein equidistant transmission means that multiple data values in the first time series data have the same time interval, for example, multiple data values in the first time series data are data values collected by the terminal device 101 at a fixed frequency, and non-equidistant transmission means that the time intervals of multiple data values in the first time series data are not the same, for example, multiple data values in the first time series data are data values collected by the terminal device 101 according to trigger conditions, and the collection time intervals are not fixed.
[0077] It should be noted that the first time series data received by the edge device 102 may be the first time series data sent from multiple terminal devices 101. Therefore, the first time series data may also include the device number of the terminal device, which is used to identify the terminal device corresponding to the first time series data value.
[0078] In the process of sending the first time series data, the terminal device 101 in the embodiment of the present application can send the data value and the timestamp corresponding to the data value in the first time series data in a single point according to the current drive protocol, that is, each data value and the corresponding timestamp in the first time series data are sent independently as a single point. The terminal device 101 can also send the first time series data in accordance with the protocol format provided in the embodiment of the present application. It can be understood that the terminal device 101 sends the first sequence data in accordance with the protocol format provided in the embodiment of the present application, which can avoid the edge device 102 from converting the transmission format of the first time series data. The protocol format provided in the embodiment of the present application is described in detail below.
[0079] In the protocol format provided in the embodiment of the present application, multiple data values in the first time series data can be transmitted in the form of a data array, and multiple timestamps can also be transmitted in the form of a time array. Further, when the transmission type of the first sequence data is equidistant transmission, multiple timestamps can also be represented by time metadata, and the time metadata includes a start time, an end time, and an incremental time, wherein the incremental time interval is the equidistant time. When the transmission type of the first sequence data is non-equidistant transmission, multiple timestamps can also be represented by a start time, an end time, and a time array, wherein the time data group is a time array composed of multiple timestamps.
[0080] In addition, the protocol format provided in the embodiment of the present application also supports further compression of the first sequence data of the non-equidistant transmission type. In the first sequence data of the non-equidistant transmission type, multiple timestamps can also be represented based on the start time, end time and incremental time array, wherein the incremental time array includes multiple incremental times, which are different time intervals corresponding to multiple data values in the first sequence data of the non-equidistant transmission type.
[0081] See also Figure 3, Figure 3 A schematic diagram of the structure of a first time series data provided in an embodiment of the present application. Figure 3 In the example shown, (a) is a schematic code of the terminal device 101 sending the first timing data in a single point according to the current driving protocol, and (b) is a schematic code of the terminal device 101 sending the first timing data in the protocol format provided in the embodiment of the present application.
[0082] In the example shown in Figure (a), the terminal device 101 sends the first sequence data in a single point in the form of a device number, a data value and a timestamp, wherein each set of device number, data value and timestamp is regarded as a single point. For example, the content sent in the first sequence data is "id: device1, speed: 1235.419, time:1564081764000", which respectively represent the device number, speed value and timestamp of the terminal device 101 sending the timing data.
[0083] In the example shown in (b), the terminal device 101 sends the first sequence data in the form of a device number, a data array and time metadata. For example, the content of the first sequence data is "device Id: device1, name: speed, minTime: 1564081764000, maxTime: 1564081765000, delta: 1000 values: [1235.419, 1234.708, 1230.394, 1247.352, 1248.49, 1251.505, 1251.346]". The device number is the "deviceId" field, the data array is the "values" field, and the time metadata is the "minTime" field, the "maxTime" field and the "delta" field.
[0084] exist Figure 3 In the example shown, by comparing the examples shown in Figure (a) and Figure (b), it can be seen that under the protocol format provided in the embodiment of the present application, the terminal device 101 does not need to repeatedly send some fields, such as "speed" and "time", etc., thereby saving transmission resources. At the same time, for the first sequence data of the equidistant transmission type, the terminal device 101 only needs to send the start time, end time and incremental time in the time metadata, without sending each timestamp, thereby further saving the transmission resources between the terminal device 101 and the edge device 102.
[0085] In a possible implementation, the terminal device 101 sends third time series data to the edge device 102. The transmission type of the third time series data is equidistant transmission, and the third time series data includes a data array, a start time, an end time, and an incremental time. For example, the start time of the third time series data is timestamp 1, the end time is timestamp n, the incremental time is δt, and the data array includes data value 1, data value 2, ..., data value n.
[0086] In a possible implementation, the terminal device 101 sends third time series data to the edge device 102. The transmission type of the third time series data is non-equidistant transmission. The third time series data includes a data array, a start time, an end time, and a time array. For example, the start time of the third time series data is timestamp 1, the end time is timestamp n, the data array includes data value 1, data value 2, ..., data value n, and the time array includes timestamp 1, timestamp 2, ..., timestamp n. Alternatively, the third time series data includes a data array, a start time, an end time, and an incremental time array. For example, the start time of the third time series data is timestamp 1, the end time is timestamp n, the data array includes data value 1, data value 2, ..., data value n, and the incremental time array includes δt1, δt2, ..., δt(n-1).
[0087] 202. The edge device performs protocol conversion on the first time series data to obtain second time series data. The protocol conversion includes modifying the transmission format of the first time series data. The second time series data includes a data array, a start time, and an end time.
[0088] After the edge device 102 receives the first sequence data sent by the terminal device 101, it performs protocol conversion on the first time series data to obtain second time series data. The protocol conversion includes modifying the transmission format of the first time series data. The second time series data includes a data array, a start time and an end time, wherein the data array includes multiple data values, the start time is used to indicate the minimum timestamp among the timestamps corresponding to the multiple data values, and the end time is used to indicate the maximum timestamp among the timestamps corresponding to the multiple data values.
[0089] It should be noted that when the terminal device 101 sends the data value and the timestamp corresponding to the data value in the first time series data in a single point according to the current driving protocol, the edge device 102 needs to convert the transmission format of the first sequence data sent by the terminal device 101. When the terminal device 101 sends the first sequence data in accordance with the protocol format provided in the embodiment of the present application, the edge device 102 can avoid converting the transmission format of the first time series data.
[0090] In one possible implementation, after the edge device 102 receives the first time series data, the edge device 102 performs equidistant transmission identification on the first time series data and determines the transmission type of the first time series data, wherein the transmission type includes equidistant transmission and unequally spaced transmission, the equidistant transmission indicates that the timestamp intervals corresponding to the multiple data values are equal, and the unequally spaced transmission indicates that the timestamp intervals corresponding to the multiple data values are not equal.
[0091] See also Figure 4 , Figure 4 A flow chart of another method for transmitting time series data provided in an embodiment of the present application. Figure 4 In steps 1 to 3 of the example shown, after edge device 102 receives the first sequence data sent by terminal device 101, edge device 102 caches the first sequence data, and edge device 102 can automatically identify whether the first sequence data is equidistant transmission data. For equidistant transmission data and non-equidistant transmission data, edge device 102 adopts different transmission format modification methods.
[0092] In a possible implementation, when it is determined that the transmission type of the first timing data is equal-interval transmission, the second timing data further includes an incremental time, and the incremental time is used to indicate the same time interval between multiple data values in the data array.
[0093] In one possible implementation, during the process of the edge device 102 performing protocol conversion on the first time series data, when it is determined that the transmission type of the first time series data is equidistant transmission, the edge device 102 generates a data array based on multiple data values in the first time series data, and generates time metadata based on multiple timestamps in the first time series data, and the time metadata includes a start time, an end time, and an incremental time.
[0094] Please continue reading Figure 4 ,exist Figure 4 In steps 4 to 5 of the example shown, after the edge device 102 identifies that the first sequence data is equally spaced transmission data, the edge device 102 compresses multiple numerical data columns in the first sequence data into a data array, and compresses the time data column in the first sequence data into time metadata, which includes a start time, an end time, and an incremental time.
[0095] See also Figure 5 , Figure 5 A flow chart of another method for transmitting sequence data provided in an embodiment of the present application. Figure 5In the example shown, the edge device 102 receives the first sequence data which is speed data sent at a single point, and the first sequence data is, for example, “id: device1, speed: 1235.419, time:1564081764000, …, id: device1, speed: 1251.346, time:1564081765000”.
[0096] exist Figure 5 In the example of the equally spaced second time series data shown, during the process of protocol conversion of the first sequence data by the edge device 102, multiple speed values in the first sequence data are compressed into a speed value array, and multiple timestamps in the first sequence data are compressed into a start time mintime, an end event maxtime and an incremental time delta. For example, the second sequence data after protocol conversion is "device Model: A, device Id: device1, name: speed, minTime: 1564081764000, maxTime: 1564081765000, delta: 1000, values: [1235.419, 1234.708, 1230.394, 1247.352, 1248.49, 1251.505, 1251.346]".
[0097] In one possible implementation, when it is determined that the transmission type of the first time series data is non-equidistant transmission, the second time series data also includes a time array, and the time array includes timestamps corresponding to multiple data values; or, when it is determined that the transmission type of the first time series data is non-equidistant transmission, the second time series data also includes an incremental time array, and the incremental time array includes different time intervals corresponding to multiple data values.
[0098] In one possible implementation, during the process of the edge device 102 performing protocol conversion on the first time series data, when it is determined that the transmission type of the first time series data is non-equidistant transmission, the edge device 102 generates a data array based on multiple data values in the first time series data, generates time metadata and a time array based on multiple timestamps in the first time series data, or generates time metadata and an incremental time array based on multiple timestamps in the first time series data, wherein the time metadata includes a start time and an end time.
[0099] Please continue reading Figure 4 ,exist Figure 4In steps 10 to 11 of the example shown, after the edge device 102 identifies that the first sequence data is non-equidistant transmission data, the edge device 102 compresses multiple numerical data columns in the first sequence data into a data array, and generates time metadata based on the start time and end time in the first sequence data, and the time metadata includes the start time and the end time.
[0100] exist Figure 5 In the example shown, when the first sequence data received by the edge device 102 is non-equidistant transmission data, the edge device 102 compresses multiple speed values in the first sequence data into a speed value array, and compresses multiple timestamps in the first sequence data into a start time, end time and time array during the protocol conversion of the first sequence data. For example, the second sequence data after the protocol conversion is "device Model: A, device Id: device1, name: speed, minTime: 1564081764000, maxTime: 1564081765000, values: [1235.419, 1234.708, 1230.394, 1247.352, 1248.49, 1251.505, 1251.346], times: [1564081764000, …, 1564081765000]".
[0101] 203. The edge device sends the second time series data to the platform device, so that the platform device stores the second time series data based on the data transmission format of the second time series data.
[0102] After the edge device 102 obtains the second time series data through protocol conversion, it sends the second time series data to the platform device 103, so that the platform device 103 stores the second time series data based on the data protocol format of the second time series data. Specifically, in the embodiment of the present application, the platform device 103 adds a data access interface protocol, which supports the edge device 102 to generate the protocol format of the second time series data, that is, the access layer 1031 of the platform device 103 supports the processing of data values and timestamps in the form of arrays, and the access layer 1031 can directly operate the storage layer 1032, thereby avoiding the conversion of the Influxdb line protocol.
[0103] In a possible implementation, when the platform device 103 stores the second time series data based on the data protocol format of the second time series data, the platform device 103 stores the data array and the time array in the second time series data as data columns, and stores the time metadata as time column metadata. For the second time series data transmitted at equal intervals, the content of the data column includes the data array, and the content of the time column includes the start time, the end time, the first offset, and the incremental time, wherein the first offset is 0, indicating that the stored data is sequence data transmitted at equal intervals.
[0104] For the second time series data transmitted at non-equidistant intervals, the content of the data column includes a data array and a time array, and the content of the time column includes a start time, an end time, and a second offset, wherein the second offset represents the offset of the time array in the data column. For example, if the second offset is 17, it means that the time array starts from the 17th bit in the data column.
[0105] Please continue reading Figure 4 , Figure 4 In steps 6 to 9 of the example shown, the edge device 102 reports the second time series data to the platform device 103. The platform device 103 persistently stores the equally spaced second time series data based on the data access interface protocol, stores the data arrays in the second time series data as data columns, and stores the time metadata in the second time series data as time column metadata.
[0106] exist Figure 4 In steps 12 to 16 of the example shown, the platform device 103 persistently stores the non-uniformly spaced second time series data based on the data access interface protocol, stores the data arrays in the second time series data as data columns, stores the time metadata in the second time series data as time column metadata, and stores the time arrays in the second time series data as time columns. The storage location of the time column is after the data column. Therefore, in the embodiment of the present application, the time column can also be referred to as a data column.
[0107] Please refer to Figure 5 ,exist Figure 5 In the example shown, the platform device 103 adds an access interface protocol for time series data, and the access layer 1031 of the platform device 103 supports multi-modal second time series data storage, and can directly operate the storage layer 1032. For example, when the stored time series data is equidistant time series data, the time column metadata after persistent storage by the platform device 103 includes the start time, the end time, the first offset and the incremental time, and the data column after persistent storage by the platform device 103 includes the data value of the data array, wherein the first offset is 0, and the data column also includes the check bit CRC.
[0108] For another example, when the stored time series data is non-equidistant time series data, the time column metadata after persistent storage by the platform device 103 includes a start time, an end time, and a second offset, and the data column after persistent storage by the platform device 103 includes a data value of the data array and a timestamp of the time array, wherein the second offset indicates the position of the time data in the data column.
[0109] In a possible implementation, after the edge device 102 sends the second time series data to the platform device 103, when the platform device 103 receives a data read request, the data read request may be a data read request sent by an external system calling the open interface 1033, and the data read request is used to obtain multiple data values and corresponding timestamps in the second time series data stored by the platform device 103. The platform device 103 may respond to the data read request based on the data array and the time metadata, that is, the platform device 103 responds to the data read request based on the time column and the data column of the persistent storage.
[0110] In the embodiment of the present application, the data reading process of the platform device 103 usually involves multiple levels of indexing and metadata access. Specifically, the platform device 103 first locates the footer field at the end of the storage format, and indexes the trailer through the footer in the storage format, wherein the trailer contains pointers to different parts of the content. Afterwards, the platform device 103 reads the metadata index meta index through the trailer and loads it into the memory, wherein the meta index is a first-level index, and the platform device 103 can index the data block chunk meta through the meta index, and the chunk meta is the metadata information of the sequence data.
[0111] The platform device 103 further parses the chunk meta to obtain time meta and column meta, where timemeta is the metadata of the time column and column meta is the metadata of the data column. Among them, the platform device 103 can read the data column column data based on columnmeta, where the data column is the data value in the time series data. The platform device 103 can read the time column time data based on time meta, where the time column is the timestamp in the time series data. The time meta also includes an offset. When the offset is 0, the platform device 103 can identify the sequence data as equidistant data, and further restore the time information based on the min time, max time and delta contained in the time meta. When the offset is not 0, the platform device 103 can identify the sequence data as non-equidistant data, and further determine the time information from the time data based on the offset.
[0112] See also Figure 6 , Figure 6 A schematic diagram of a process for reading time series data provided in an embodiment of the present application. Figure 6 In steps 1 to 5 of the illustrated example, when the platform device 103 reads the data value and timestamp of the second time series data, the platform device 103 indexes chunk meta based on meta index, and parses chunk meta to obtain time column metadata timemeta and data column metadata column meta. The platform device 103 can read the data column column data according to the data column metadata column meta. When the second time series data is equally spaced data, the data column column data includes the data values in the data array.
[0113] exist Figure 6 In steps 6 to 8 of the example shown, the platform device 103 can identify whether the second time series data is equally spaced data based on the offset in the time meta. If it is identified as equally spaced data, the platform device 103 restores the time information of the second time series data based on the min time, max time and delta in the time meta. If it is identified as non-equally spaced data, the platform device 103 reads the time information from the time data based on the offset in the time meta.
[0114] See also Figure 7 , Figure 7 A schematic diagram of an index structure of time series data provided in an embodiment of the present application. Figure 7 In the example shown, the end of the storage format of the time series data includes an 8-byte footer field, which contains an index pointing to the tail trailer field, wherein the tail trailer field provides an index for quick access to other fields. For example, the tail trailer field can indicate data block offset / size chunk data blocks offset / size information, metadata block offset / size chunk meta blocks offset / size information, metadata index offset / size meta index offset / size information, bloom filter offset / size information, etc.
[0115] exist Figure 7In the example shown, the data block offset / size information indicates the offset or size of the data block, the metadata block offset / size information indicates the metadata offset or size of the data block, the metadata index offset / size information indicates the offset and size of the metadata index, and the Bloom filter offset / size information indicates the offset or size of the Bloom filter.
[0116] It can be seen from the above embodiments that the edge device in the embodiments of the present application can perform protocol conversion on the timing data sent by the terminal device, so that the timing data after the protocol conversion can be transmitted in the form of an array, thereby reducing the data volume of the timing data after the protocol conversion and improving the utilization efficiency of transmission resources.
[0117] Based on the above method embodiment, the embodiment of the present application also provides a transmission device for time series data. The transmission device for time series data provided by the embodiment of the present application is described in detail below.
[0118] See also Figure 8 , Figure 8 A schematic diagram of the structure of a transmission device for time series data provided in an embodiment of the present application. Figure 8 In the example shown, the transmission device 800 for time series data is used to implement the various steps performed by the time series data transmission system in the above-mentioned embodiments. The transmission device 800 for time series data includes a transceiver unit 801 and a processing unit 802 .
[0119] Among them, the transceiver unit 801 is used to receive the first time series data sent by the terminal device, and the first time series data includes multiple data values collected by the terminal device and timestamps corresponding to the multiple data values. The processing unit 802 is used to perform protocol conversion on the first time series data to obtain second time series data, and the protocol conversion includes modifying the transmission format of the first time series data. The second time series data includes a data array, a start time and an end time. The data array includes multiple data values. The start time is used to indicate the minimum timestamp among the timestamps corresponding to the multiple data values, and the end time is used to indicate the maximum timestamp among the timestamps corresponding to the multiple data values. The transceiver unit 801 is also used to send the second time series data to the platform device, so that the platform device stores the second time series data based on the data transmission format of the second time series data.
[0120] In one possible implementation, the processing unit 802 is also used to identify equidistant transmission of the first time series data and determine the transmission type of the first time series data, where the transmission type includes equidistant transmission and unequally spaced transmission. The equidistant transmission indicates that the timestamp intervals corresponding to the multiple data values are equal, and the unequally spaced transmission indicates that the timestamp intervals corresponding to the multiple data values are not equal.
[0121] In a possible implementation, the processing unit 802 is further configured to, when determining that the transmission type of the first timing data is equal-interval transmission, the second timing data further includes an incremental time, and the incremental time is used to indicate the same time interval between multiple data values in the data array.
[0122] In one possible implementation, the processing unit 802 is specifically used to generate a data array based on multiple data values in the first time series data, and generate time metadata based on multiple timestamps in the first time series data, where the time metadata includes a start time, an end time, and an incremental time.
[0123] In one possible implementation, the processing unit 802 is also used to, when it is determined that the transmission type of the first time series data is non-equidistant transmission, the second time series data also includes a time array, and the time array includes timestamps corresponding to multiple data values; or, when it is determined that the transmission type of the first time series data is non-equidistant transmission, the second time series data also includes an incremental time array, and the incremental time array includes different time intervals corresponding to multiple data values.
[0124] In one possible implementation, the processing unit 802 is specifically used to generate a data array based on multiple data values in the first time series data, generate time metadata and a time array based on multiple timestamps in the first time series data, or generate time metadata and an incremental time array based on multiple timestamps in the first time series data, and the time metadata includes a start time and an end time. In one possible implementation, the transceiver unit 801 is also used to receive third time series data sent by a terminal device, the transmission type of the third time series data is equidistant transmission, and the third time series data includes a data array, a start time, an end time, and an incremental time.
[0125] In a possible implementation, the transceiver unit 801 is also used to receive third timing data sent by the terminal device, the transmission type of the third timing data is non-equidistant transmission, and the third timing data includes a data array, a start time, an end time, and a time array, or the third timing data includes a data array, a start time, an end time, and an incremental time array.
[0126] In a possible implementation, the transceiver unit 801 is further configured to receive a data read request, the data read request being used to obtain multiple data values and corresponding timestamps in the second time series data. The processing unit 802 is further configured to respond to the data read request based on the data array and the time metadata.
[0127] It is understandable that the transceiver unit 801 and the processing unit 802 in the time series data transmission device 800 can be used as functional modules and Figure 1 There is a mapping between each module in the time series data transmission system 10, so as to realize the function of each module in the time series data transmission system 10.
[0128] It should be understood that the division of the units in the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And the units in the device can all be implemented in the form of software calling through processing elements; they can also be all implemented in the form of hardware; some units can also be implemented in the form of software calling through processing elements, and some units can be implemented in the form of hardware. For example, each unit can be a separately established processing element, or it can be integrated in a certain chip of the device. In addition, it can also be stored in the memory in the form of a program, and called and executed by a certain processing element of the device. The function of the unit. In addition, all or part of these units can be integrated together, or they can be implemented independently. The processing element described here can also be a processor, which can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each unit above can be implemented by an integrated logic circuit of hardware in the processor element or in the form of software calling through a processing element.
[0129] It is worth noting that, for the above method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited to the described order of actions. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required for the present application.
[0130] Other reasonable step combinations that can be thought of by those skilled in the art based on the above description also fall within the scope of protection of this application. Secondly, those skilled in the art should also be familiar with the fact that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by this application.
[0131] See also Fig. 9 , Fig. 9 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. Fig. 9As shown, the computing device 900 includes: a processor 901, a memory 902, a communication interface 903 and a bus 904, and the processor 901, the memory 902 and the communication interface 903 are coupled through a bus (not marked in the figure). The memory 902 stores instructions, and when the execution instructions in the memory 902 are executed, the computing device 900 executes the method executed by the time series data transmission system in the above method embodiment. That is, the computing device 900 can be the terminal device 101, the edge device 102 or the platform device 103 in the above time series data transmission system 10.
[0132] The computing device 900 may be one or more integrated circuits configured to implement the above method, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (digital signal processors, DSP), or one or more field programmable gate arrays (FPGA), or a combination of at least two of these integrated circuit forms. For another example, when a unit in the device can be implemented in the form of a processing element scheduler, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call a program. For another example, these units may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0133] The processor 901 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, transistor logic devices, hardware components or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0134] The memory 902 may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0135] The memory 902 stores executable program codes, and the processor 901 executes the executable program codes to respectively implement the functions of the aforementioned units or modules, thereby implementing the aforementioned node load control method. That is, the memory 902 stores instructions for executing the aforementioned node load control method.
[0136] The communication interface 903 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 900 and other devices or a communication network.
[0137] In addition to the data bus, the bus 904 may also include a power bus, a control bus, a status signal bus, etc. The bus may be a peripheral component interconnect express (PCIe) bus, or an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus may be divided into an address bus, a data bus, a control bus, etc.
[0138] See also Fig.10 , Fig.10 A schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application. Fig.10 As shown, the computing device cluster 1000 includes at least one computing device 900 .
[0139] like Fig.10 As shown, the computing device cluster 1000 includes at least one computing device 900. The memory 902 in one or more computing devices 900 in the computing device cluster 1000 may store the same instructions for executing the above-mentioned node load control method.
[0140] In some possible implementations, the memory 902 of one or more computing devices 900 in the computing device cluster 1000 may also respectively store some instructions for executing the above-mentioned node load control method. In other words, the combination of one or more computing devices 900 may jointly execute the instructions for executing the above-mentioned node load control method.
[0141] It should be noted that the memory 902 in different computing devices 900 in the computing device cluster 1000 can store different instructions, which are respectively used to execute part of the functions of the above-mentioned node load control device. That is, the instructions stored in the memory 902 in different computing devices 900 can realize the functions of one or more modules in the processing unit and the transceiver unit.
[0142] In some possible implementations, one or more computing devices 900 in the computing device cluster 1000 may be connected via a network, which may be a wide area network or a local area network.
[0143] See also Fig.11 , Fig.11This is a schematic diagram of the structure of another computing device cluster provided in an embodiment of the present application. Fig.11 As shown, the first computing device 900A and the second computing device 900B are connected via a network. Specifically, they are connected to the network via a communication interface in each computing device.
[0144] In a possible implementation, the memory in the first computing device 900A stores instructions for executing the functions of the transceiver unit, and the memory in the second computing device 900B stores instructions for executing the functions of the processing unit.
[0145] It should be understood that Fig.11 The functions of the first computing device 900A shown in FIG. 1 may also be completed by multiple computing devices. Similarly, the functions of the second computing device 900B may also be completed by multiple computing devices.
[0146] In another embodiment of the present application, a computer-readable storage medium is provided, in which computer-executable instructions are stored. When the processor of the device executes the computer-executable instructions, the device executes the method executed by the timing data transmission system in the above method embodiment.
[0147] In another embodiment of the present application, a computer program product is provided, the computer program product includes computer execution instructions, the computer execution instructions are stored in a computer readable storage medium. When the processor of the device executes the computer execution instructions, the device executes the method executed by the time series data transmission system in the above method embodiment.
[0148] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0149] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0150] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0151] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0152] If the integrated 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 technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.
Claims
1. A method for transmitting time series data, characterized in that: include: Receive first time series data sent by a terminal device, where the first time series data includes multiple data values collected by the terminal device and timestamps corresponding to the multiple data values; Performing equal-interval transmission identification on the first time series data, determining a transmission type of the first time series data, the transmission type including equal-interval transmission and non-equal-interval transmission, the equal-interval transmission indicating that time stamp intervals corresponding to the multiple data values are equal, and the non-equal-interval transmission indicating that time stamp intervals corresponding to the multiple data values are not equal; Performing protocol conversion on the first time series data to obtain second time series data, the protocol conversion comprising modifying a transmission format of the first time series data, the second time series data comprising a data array, a start time and an end time, the data array comprising the multiple data values, the start time being used to indicate a minimum timestamp among the timestamps corresponding to the multiple data values, and the end time being used to indicate a maximum timestamp among the timestamps corresponding to the multiple data values; when it is determined that the transmission type of the first time series data is equidistant transmission, the second time series data further comprises an incremental time, and the incremental time is used to indicate the same time interval of multiple data values in the data array; The second time series data is sent to a platform device, so that the platform device stores the second time series data based on a data transmission format of the second time series data.
2. The method according to claim 1, characterized in that: The performing protocol conversion on the first time series data includes: generating the data array based on a plurality of data values in the first time series data; Time metadata is generated based on multiple timestamps in the first time series data, and the time metadata includes the start time, the end time and the incremental time.
3. The method according to claim 1, characterized in that The method further comprises: When it is determined that the transmission type of the first time series data is non-equidistant transmission, the second time series data further includes a time array, and the time array includes timestamps corresponding to the multiple data values; Alternatively, when it is determined that the transmission type of the first time series data is non-equidistant transmission, the second time series data further includes an incremental time array, and the incremental time array includes different time intervals corresponding to the multiple data values.
4. The method according to claim 3, characterized in that The performing protocol conversion on the first time series data includes: generating the data array based on a plurality of data values in the first time series data; The time metadata and the time array are generated based on a plurality of time stamps in the first time series data, or the time metadata and the incremental time array are generated based on a plurality of time stamps in the first time series data, wherein the time metadata includes the start time and the end time.
5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: Receive third timing data sent by the terminal device, where the transmission type of the third timing data is equidistant transmission, and the third timing data includes the data array, the start time, the end time and the incremental time.
6. The method according to any one of claims 1 to 4, characterized in that The method further comprises: Receive the third timing data sent by the terminal device, the transmission type of the third timing data is non-equidistant transmission, and the third timing data includes the data array, the start time, the end time and the time array, or the third timing data includes the data array, the start time, the end time and the incremental time array.
7. The method according to claim 2 or 4, characterized in that: After sending the second time series data to the platform device, the method further includes: Receive a data read request, where the data read request is used to obtain multiple data values and corresponding timestamps in the second time series data; The data read request is responded to based on the data array and the temporal metadata.
8. A transmission device for time series data, characterized in that: include: A transceiver unit, configured to receive first time series data sent by a terminal device, wherein the first time series data includes a plurality of data values collected by the terminal device and timestamps corresponding to the plurality of data values; A processing unit, configured to perform equidistant transmission identification on the first time series data, and determine a transmission type of the first time series data, wherein the transmission type includes equidistant transmission and non-equidistant transmission, wherein the equidistant transmission indicates that time stamp intervals corresponding to the multiple data values are equal, and the non-equidistant transmission indicates that time stamp intervals corresponding to the multiple data values are not equal; Performing protocol conversion on the first time series data to obtain second time series data, the protocol conversion comprising modifying a transmission format of the first time series data, the second time series data comprising a data array, a start time and an end time, the data array comprising the multiple data values, the start time being used to indicate a minimum timestamp among the timestamps corresponding to the multiple data values, and the end time being used to indicate a maximum timestamp among the timestamps corresponding to the multiple data values; when it is determined that the transmission type of the first time series data is equidistant transmission, the second time series data further comprises an incremental time, and the incremental time is used to indicate the same time interval of multiple data values in the data array; The transceiver unit is further configured to send the second time series data to the platform device, so that the platform device stores the second time series data based on a data transmission format of the second time series data.
9. The device according to claim 8, characterized in that The processing unit is specifically used for: generating the data array based on a plurality of data values in the first time series data; Time metadata is generated based on multiple timestamps in the first time series data, and the time metadata includes the start time, the end time and the incremental time.
10. The device according to claim 8, characterized in that The processing unit is also used for: When it is determined that the transmission type of the first time series data is non-equidistant transmission, the second time series data further includes a time array, and the time array includes timestamps corresponding to the multiple data values; Alternatively, when it is determined that the transmission type of the first time series data is non-equidistant transmission, the second time series data further includes an incremental time array, and the incremental time array includes different time intervals corresponding to the multiple data values.
11. The device according to claim 10, characterized in that The processing unit is specifically used for: generating the data array based on a plurality of data values in the first time series data; The time metadata and the time array are generated based on a plurality of time stamps in the first time series data, or the time metadata and the incremental time array are generated based on a plurality of time stamps in the first time series data, wherein the time metadata includes the start time and the end time.
12. The device according to any one of claims 8 to 11, characterized in that The transceiver unit is also used for: Receive third timing data sent by the terminal device, where the transmission type of the third timing data is equidistant transmission, and the third timing data includes the data array, the start time, the end time and the incremental time.
13. The device according to any one of claims 8 to 11, characterized in that The transceiver unit is also used for: Receive the third timing data sent by the terminal device, the transmission type of the third timing data is non-equidistant transmission, and the third timing data includes the data array, the start time, the end time and the time array, or the third timing data includes the data array, the start time, the end time and the incremental time array.
14. The device according to claim 9 or 11, characterized in that The transceiver unit is also used for: Receive a data read request, where the data read request is used to obtain multiple data values and corresponding timestamps in the second time series data; The processing unit is further configured to respond to the data read request based on the data array and the time metadata.
15. A computing device, characterized in that: The device comprises a processor coupled to a memory, wherein the processor is used to store instructions. When the instructions are executed by the processor, the computing device performs the method according to any one of claims 1 to 7.
16. A computing device cluster, characterized in that: The method comprises at least one computing device, wherein the computing device comprises a processor, wherein the processor is coupled to a memory, and wherein the processor is used to store instructions. When the instructions are executed by the processor, the computing device cluster performs the method according to any one of claims 1 to 7.
17. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed, the computer is caused to perform the method according to any one of claims 1 to 7.
18. A computer program product, comprising instructions, characterized in that: When the instructions are executed, the computer implements the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Time series data storage and reading method and device, equipment and storage medium
CN114817645A
Method and device for collecting and synchronizing time series data of different protocols
CN117648379A