UID encoding method, Open TSDB and server

By employing the snowflake algorithm and Region pre-splitting technology in Open TSDB, combined with cache write-back technology, the problems of low UID encoding efficiency and resource waste are solved, achieving efficient UID generation and storage optimization.

CN116126637BActive Publication Date: 2026-03-10SHENZHEN HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-10
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

When a large number of timelines are added instantly, the existing Open TSDB suffers from low UID encoding efficiency and excessive resource consumption, leading to write bottlenecks and resource waste.

Method used

By employing the snowflake algorithm and Region pre-splitting technology, multiple Region Servers assist nodes in generating UIDs, and cache write-back technology is used to age the UID table, thus solving the problems of low UID encoding efficiency and excessive resource consumption.

Benefits of technology

It improves UID generation speed by at least 20 times, avoids write bottlenecks, optimizes resource utilization, and ensures efficient UID encoding and storage performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116126637B_ABST
    Figure CN116126637B_ABST
Patent Text Reader

Abstract

A UID encoding method based on Open TSDB is proposed. Open TSDB eliminates the communication connection between a node and a single Resource Server (RS), allowing a node to establish communication connections with one or more RSs, and an RS to establish communication connections with one or more nodes. When a node suddenly adds a large number of timelines, multiple RSs assist a single node in generating UIDs, thereby improving the encoding efficiency of a single node and preventing write bottlenecks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Open TSDB technology, and more particularly to a UID encoding method, Open TSDB, and a server. Background Technology

[0002] Open Time Series Database (Open TSDB) is a distributed, scalable time series database based on HBase. Open TSDB is primarily used in the monitoring field to collect, store, and query monitoring metrics data for large-scale clusters, such as central processing unit (CPU) utilization and disk utilization. Large-scale cluster monitoring systems generate a large amount of monitoring metric data at regular intervals. Reducing storage costs is crucial for Open TSDB while ensuring effective querying. Summary of the Invention

[0003] To address the aforementioned issues, embodiments of this application provide a UID encoding method. When a node 110 suddenly adds a large number of timelines, multiple RS 210s assist a single node 110 in generating UIDs, thereby improving the encoding efficiency of a single node 110 and preventing write bottlenecks on the node 110. Furthermore, this application also provides a method for creating a UID table, OpenTSDB, and a server corresponding to the OpenTSDB-based UID encoding method.

[0004] Therefore, the following technical solutions are adopted in the embodiments of this application:

[0005] In a first aspect, this application provides a UID encoding method, wherein the Open TSDB includes TSDB and HBase, the TSDB includes multiple nodes, the HBase includes multiple RSs, and a node establishes a communication connection with at least one RS. The method includes: a target node determining a target RS based on a received string, the multiple nodes including the target node, and the multiple RSs including the target RS; the target node sending a request instruction to the HBase; the HBase controlling the target RS to establish a communication connection with the target node based on the request instruction; the target node sending the string to the target RS; and the target RS generating a UID based on the string.

[0006] In this implementation, Open TSDB removes the communication connection between a node and a single RS, allowing a node to establish communication connections with one or more RSs, and an RS to establish communication connections with one or more nodes. When a node suddenly adds a large number of timelines, multiple RSs assist a node in generating UIDs, thereby improving the encoding efficiency of a single node and preventing write bottlenecks.

[0007] In one implementation, the target node determines the target RS based on the received string, including: the target node inputs the string into a hash value generator to obtain a hash value; the target node processes the hash value and compares it with the identifiers of each RS stored in its own database to determine the target RS.

[0008] In one implementation, the target RS generates a UID based on the string, which includes: the target RS triggering a snowflake algorithm to generate the UID of the string based on the string.

[0009] In one implementation, the method further includes: the target RS writing the string and the UID into a UID table, and sending the UID to the target node.

[0010] Secondly, this application provides a method for creating a UID table, wherein the Open TSDB includes TSDB and HBase, and the method includes: a node of the TSDB sending a query request to the HBase, the query request instructing the HBase to query a target UID table and obtain the creation time of the target UID table; the HBase sending the creation time of the target UID table to the node of the TSDB based on the query request; the node of the TSDB determining the existence time of the target UID table based on the creation time of the target UID table and the current time, and in response to the existence time of the target UID table being greater than a set time, sending information to the HBase to construct a first UID table; the HBase constructing the first UID table based on the information of the first UID table, and writing the data of the target UID table into the first UID table.

[0011] In this implementation, Open TSDB utilizes cache write-back technology to directly write the UID table cache from the previous cycle into the UID table of the new cycle, thereby enabling the rapid creation of new UID tables and the aging of old UID tables, solving the problem of excessive resource consumption in existing Open TSDB.

[0012] In one implementation, writing data from the target UID table into the first UID table includes: HBase retrieving the cache container corresponding to the target UID table based on the target UID table; and HBase writing the data stored in the cache container corresponding to the target UID table into the first UID table.

[0013] In one implementation, before sending the information for building the first UID table to the HBase, the TSDB node builds the first UID table based on the information in the first UID table.

[0014] In one implementation, the method further includes: the HBase sending feedback information to the nodes of the TSDB; and the nodes of the TSDB setting the first UID table to a working state based on the feedback information.

[0015] Thirdly, this application provides an Open TSDB, comprising: a TSDB and an HBase, wherein the TSDB includes multiple nodes, the HBase includes multiple RSs, a node establishes a communication connection with at least one RS, the multiple nodes include the target node, and the multiple RSs include the target RS; the target node is configured to determine the target RS based on a received string and send a request instruction to the HBase; the HBase is configured to control the target RS to establish a communication connection with the target node based on the request instruction; the target node is further configured to send the string to the target RS; and the target RS is further configured to generate a UID based on the string.

[0016] In one implementation, the target node is specifically configured to input the string into a hash value generator to obtain a hash value; and to process the hash value and compare it with the identifiers of each RS stored therein to determine the target RS.

[0017] In one implementation, the target RS is specifically used to trigger the snowflake algorithm to generate the UID of the string based on the string.

[0018] In one implementation, the target RS is further configured to write the string and the UID into a UID table, and to send the UID to the target node.

[0019] Fourthly, this application provides an Open TSDB, comprising: a TSDB and an HBase. A node of the TSDB is configured to send a query request to the HBase, the query request instructing the HBase to query a target UID table and obtain the creation time of the target UID table. The HBase is configured to send the creation time of the target UID table to the node of the TSDB based on the query request. The node of the TSDB is further configured to determine the existence time of the target UID table based on the creation time of the target UID table and the current time, and, in response to the existence time of the target UID table being greater than a set time, send information to the HBase to construct a first UID table. The HBase is further configured to construct the first UID table based on the information of the first UID table and write the data of the target UID table into the first UID table.

[0020] In one implementation, the HBase is specifically used to retrieve the cache container corresponding to the target UID table based on the target UID table; and to write the data stored in the cache container corresponding to the target UID table into the first UID table.

[0021] In one implementation, the nodes of the TSDB are also used to construct the first UID table based on the information in the first UID table.

[0022] In one implementation, the HBase is further configured to send feedback information to the nodes of the TSDB; the nodes of the TSDB are further configured to set the first UID table to a working state based on the feedback information.

[0023] Fifthly, this application provides a server, characterized in that the server is deployed with Open TSDB as may be implemented in the third and fourth aspects.

[0024] In a sixth aspect, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the methods that may be implemented as described in the first and second aspects.

[0025] In a seventh aspect, this application provides a computer program product, characterized in that the computer program product stores instructions that, when executed by a computer, cause the computer to perform the methods that may be implemented as described in the first and second aspects. Attached Figure Description

[0026] The accompanying drawings used in the description of the embodiments or prior art are briefly introduced below.

[0027] Figure 1A diagram illustrating the UID table stored in HBase;

[0028] Figure 2 This is a schematic diagram of an Open TSDB architecture provided in an embodiment of this application;

[0029] Figure 3 A schematic diagram illustrating the process of creating a UID for the Open TSDB provided in this application embodiment;

[0030] Figure 4 This is a schematic diagram illustrating the process of creating a new UID table using Open TSDB as provided in this embodiment. Detailed Implementation

[0031] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0032] In this article, the term "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. The symbol " / " in this article indicates that the related objects are in an "or" relationship; for example, A / B means A or B.

[0033] The terms "first" and "second," etc., used in the specification and claims herein are used to distinguish different objects, not to describe a specific order of objects. For example, "first response message" and "second response message," etc., are used to distinguish different response messages, not to describe a specific order of response messages.

[0034] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0035] In the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more, for example, multiple processing units means two or more processing units, multiple elements means two or more elements, etc.

[0036] Open TSDB is a distributed, scalable time-series database. Its key features include providing time-series data storage with millisecond-level precision and the ability to permanently store raw data without loss of accuracy. Open TSDB boasts powerful data writing capabilities, supporting high-concurrency writes and offering virtually unlimited horizontally scalable storage capacity. This robust data writing and storage capability stems from its underlying HBase database and extensive storage optimizations in its table structure design. Open TSDB stores monitoring metrics data, measured in metrics. A metric is a monitored item, such as CPU utilization or memory utilization. Tags are used to describe metrics, such as tagging a server's CPU utilization; for example, a tag could be hostname=qatest.

[0037] To save storage space, OpenTSDB uses unique identifier (UID) encoding to compress monitoring metric data. The metrics and tags in the monitoring metric data are enumerable strings. When storing monitoring metric data, OpenTSDB maps the metric and tag strings to a unique identifier, i.e., a UID. After obtaining multiple UIDs, OpenTSDB concatenates these UIDs with the time according to certain rules to form a key. OpenTSDB then writes the key and the monitoring metric data value together into HBase to complete the storage function.

[0038] like Figure 1 As shown, HBase can store a UID table. The UID table includes forward relationships (string→UID) and reverse relationships (UID→string). The forward and reverse relationships of UIDs also need to be written to HBase.

[0039] To ensure that a string strictly corresponds to a UID, Open TSDB can use two methods from HBase: atomic increment and compare-and-set. When encoding the UID, Open TSDB calls HBase's atomic increment method to obtain the latest UID. Then, Open TSDB uses the compare-and-set method to check if the UID corresponding to the string exists. If the UID does not exist, Open TSDB writes the latest UID into HBase. If the UID already exists, the CAS operation fails. Open TSDB can also retrieve the UID corresponding to the string using the get method.

[0040] However, existing UID encoding schemes have two problems. First, the repeated use of HBase locks leads to poor UID encoding performance. Open TSDB ensures the global uniqueness of UIDs by using HBase locks during both UID generation and writing. When Open TSDB suddenly adds a large number of timelines, UID encoding becomes a bottleneck for write operations. Second, the UID table lacks an aging mechanism. Some monitored objects may be temporary, but their corresponding UIDs, once generated, exist permanently. As the system continues to run, the UID table may become very large, consuming excessive resources.

[0041] In the existing technology, two solutions have been proposed to address two problems with existing UID encoding schemes:

[0042] In the first approach, Open TSDB provides a method for randomly generating UIDs. Instead of relying on HBase's atomic increment method, Open TSDB obtains a random number when creating a UID, converts it to a UID, and uses it directly, thus improving the efficiency of UID allocation. This approach improves the speed of UID generation by Open TSDB. However, Open TSDB still faces locking issues when writing to the UID table, limiting the performance improvement. Furthermore, Open TSDB cannot guarantee that the UIDs generated by each node are globally unique, leading to potential conflicts and making it unsuitable for production use.

[0043] In the second approach, the lifecycle of the UID table is synchronized with that of the data table. Taking Open TSDB as an example, when the data table expires, Open TSDB can synchronously clear the UID table to address the UID table aging issue. However, at the moment Open TSDB clears the UID table, all newly written data needs to be encoded using UID. Since UID encoding is much slower than data writing, it may become a bottleneck for write operations.

[0044] To address the issue of low efficiency in UID encoding when adding a large number of timelines instantaneously in the existing Open TSDB, this application proposes a UID encoding method, a method for creating a UID table, an Open TSDB, and a server.

[0045] Figure 2 This is a schematic diagram of an Open TSDB architecture provided in an embodiment of this application. Figure 2 As shown, the OpenTSDB10 includes a time series database (TSDB) 100 and an HBase 200.

[0046] TSDB 100 is a specific type of database primarily used for processing time-stamped data (data that changes chronologically, i.e., time-series data). Time-stamped data is also known as time-series data. The largest application scenario for TSDB 100 is currently in monitoring. Monitoring services deploy various scripts on business servers. Clients collect server metrics (IO metrics, CPU metrics, bandwidth and memory metrics, etc.), business-related data (method call exception counts, response latency, JVM GC-related data, etc.), and database-related data (read latency, write latency, etc.). However, this data is all time-series related. After collection, the client sends it to the monitoring business server, which stores the data and provides a page for users to query. In this embodiment, TSDB 100 may include multiple nodes 110. Node 110 can be a business server.

[0047] HBase 200 is a column-oriented distributed database. Its underlying storage is based on the Hadoop Distributed File System (HDFS). Cluster management is based on ZooKeeper. HBase 200's robust distributed architecture allows for fast storage and random access to massive amounts of data. Based on data replication and partitioning mechanisms, HBase 200 can easily achieve online scaling up, scaling down, and data disaster recovery.

[0048] The scalability of HBase 200 is primarily based on the expansion of computing power (Region Servers). HBase 200 can improve its upper-layer processing capabilities by increasing the number of Region Server nodes. A Region Server is a service within HBase 200, typically deployed on a single physical server. A Region is the basic unit of data storage and management in HBase 200. A UID table can always contain one or more Regions. Each Region can only be served by one RegionServer. A RegionServer can serve multiple Regions simultaneously. In this embodiment, HBase 200 may include multiple Region Servers (referred to as "RS") 210. RS 210 can be processors used to store UID tables.

[0049] In this embodiment, Open TSDB10 comprehensively adopts the Snowflake algorithm, Region pre-splitting, and coprocessor technology to replace the built-in UID generation scheme of Open TSDB10. This allows Open TSDB10 to use a segmented lock-like approach instead of the HBase 200 global lock, achieving efficient UID encoding and improving UID generation speed by at least 20 times. When Open TSDB10 encounters performance bottlenecks in UID generation, it can be addressed through horizontal cluster scaling.

[0050] Figure 3 This diagram illustrates the process of creating a UID for the Open TSDB provided in this embodiment. The specific process of creating a UID between TSDB100 and HBase 200 in Open TSDB 10 is as follows:

[0051] Step S301: Target node 110 determines target RS 210 based on the string.

[0052] It is important to note that the communication connections between each node 110 of TSDB 100 and RS 210 of HBase 200 can be established not only in a one-to-one manner but also in a one-to-many manner. That is, a node 110 can establish a communication connection with one or more RS 210s. In this application, the communication connection between a node 110 and an RS 210 is terminated, allowing one node to establish communication connections with one or more RS 210s. When a node 110 suddenly adds a large number of timelines, multiple RS 210s assist the node 110 in generating UIDs, thereby improving the coding efficiency of a single node 110. Conversely, an RS 210 can establish a communication connection with one or more nodes 110. When a node 110 with an RS 210 communication connection is idle, the RS 210 can establish communication connections with other nodes 110 to generate UIDs for them, thereby improving the working efficiency of each RS 210.

[0053] like Figure 2 As shown, TSDB 100 includes K nodes 110. K is a positive integer greater than or equal to 1. HBase 200 includes M RS210s. M is a positive integer greater than or equal to 2. A node 110 can establish a communication connection with at least one RS 210, allowing at least one RS 210 to generate a UID. In one embodiment, node 110-1 can establish a communication connection with RS 210-1, RS 210-2, and RS 210-3. In one embodiment, node 110-2 can establish a communication connection with RS 210-1, RS 210-2, RS 210-3, and RS210-N.

[0054] Each node 110 stores the identifier of RS 210 that can establish a communication connection. In one embodiment, the identifier of RS 210 can be a number. HBase 200 assigns a number to each RS 210. HBase 200 sends the number of each RS 210 to the corresponding node 110 based on the relationship between each RS 210 and the nodes 110 that can establish a communication connection. In other embodiments, the identifier of RS 210 can be letters, numbers, mixed letters, or other symbols.

[0055] In this application, after receiving the metric, the target node 110 processes the string of the metric, associating the string with the identifier of RS 210, so that node 110 can select the target RS 210 to process the string. In one embodiment, the target node 110 can input the string into a hash value generator, which generates a hash value. The hash value is a numerical value. Each Region on RS 210 has its own working range. The target node 110 compares the working range of the Region of RS 210 stored in its own database with the hash value of the string to determine the target RS 210.

[0056] In one embodiment, target node 110 can input a string into a hash value generator, which then generates a hash value. The hash value is a numerical value. Target node 110 divides the hash value of the string by a feature value to obtain the remainder. Based on its stored identifier for RS 210, target node 110 selects the RS 210 with the same remainder as the string as the target RS 210. In other embodiments, target node 110 can determine the target RS 210 for processing the string using other methods, such as the relationship between the last few digits of the string and the identifier of RS 210.

[0057] In step S302, the target node 110 sends a request command to HBase 200.

[0058] In step S303, HBase 200, according to the request instruction, enables the target RS 210 to establish a communication connection with the target node 110.

[0059] HBase 200 can have internal nodes that can manage, control, and monitor the various RS 210s within HBase 200. Upon receiving a request command, an HBase 200 node identifies the target RS 210 for establishing a communication connection with target node 110, and then establishes a communication connection between target RS 210 and target node 110, enabling data transmission between them.

[0060] In step S304, target RS 210 sends feedback information to target node 110.

[0061] Step S305: Target node 110 sends a string to target RS 210.

[0062] Step S306: Target RS 210 generates a UID based on the string.

[0063] After establishing a communication connection with target node 110, target RS 210 can send feedback information to target node 110. Upon receiving the feedback information, target node 110 confirms the established communication connection with target RS 210 and can then send data to target RS 210. In this application, target node 110 can send the string corresponding to the received metric to target RS 210.

[0064] After receiving a string, the target RS 210 uses the snowflake algorithm to obtain the corresponding UID. The snowflake algorithm is a distributed ID generation algorithm that can generate a 64-bit UID. In this application, the RS 210 utilizes the snowflake algorithm to generate unique UIDs in a high-concurrency distributed environment, capable of generating millions of unique UIDs per second. Based on creation time and the auto-incrementing sequence number within the same creation time, the UIDs are guaranteed to be ordered and incremented. The snowflake algorithm is simple, allowing the RS 210 to encode efficiently.

[0065] In step S307, target RS 210 writes the string and the corresponding UID into the UID table.

[0066] Step S308: Target RS 210 sends its UID to target node 110.

[0067] After obtaining the UID from the string, target RS 210 writes the string and its corresponding UID into its UID table. Simultaneously, target RS 210 sends the UID corresponding to the string to target node 110, allowing target node 110 to write data based on the UID.

[0068] In this embodiment, Open TSDB 10 terminates the communication connection between a node 110 and an RS 210, allowing a node to establish communication connections with one or more RS 210s, and an RS 210 to establish communication connections with one or more nodes 110. When a node 110 suddenly adds a large number of timelines, multiple RS 210s assist a node 110 in generating UIDs, thereby improving the encoding efficiency of a single node 110 and preventing the node 110 from experiencing a write bottleneck.

[0069] The existing data table corresponding to node 110 of TSDB 100 is permanently generated, causing Open TSDB 10 to consume excessive resources as the system continues to run. In this embodiment, Open TSDB 10 uses a cache write-back technique to age the old UID table and quickly create a new UID table, which can solve the problem of Open TSDB 10 consuming excessive resources.

[0070] Figure 4This is a schematic diagram illustrating the process of creating a new UID table using Open TSDB as provided in this embodiment. The specific process of creating a UID between TSDB 100 and HBase 200 in Open TSDB10 is as follows:

[0071] In step S401, node 110 sends a query command to HBase 200. The query command instructs HBase 200 to query the creation time of the target UID table.

[0072] In step S402, HBase 200 obtains the creation time of the target UID table according to the query instruction and sends the creation time of the target UID table to node 110.

[0073] In step S403, node 110 determines the existence time of the target UID table based on its creation time and the current time, and checks whether the existence time of the target UID table is greater than a set time. If node 110 determines that the existence time of the target UID table is not greater than the set time, step S401 is executed. If node 110 determines that the existence time of the target UID table is greater than the set time, step S404 is executed.

[0074] The UID table stored in HBase 200 is not permanent. Once the UID table's existence exceeds the specified storage time, node 110 will clear the UID table to prevent Open TSDB 10 from consuming excessive resources. Node 110 can periodically send query commands to HBase 200. HBase 200 can have internal nodes that manage, control, and monitor various RS 210s within HBase 200. The HBase 200 node receives and, based on the query command, finds the target UID table containing strings that can be written to node 110. The HBase 200 node obtains the creation time of the target UID table and sends this creation time to node 110.

[0075] Node 110 determines the existence time of the target UID table based on its creation time and the current time. Node 110 then checks if the existence time of the target UID table is greater than a preset time. If the existence time is less than the preset time, Node 110 considers the target UID table to have been created relatively recently and does not need to be recreated. In this case, Node 110 can periodically send query commands to HBase 200 to check if the target UID table has expired.

[0076] If the target UID table has existed for a longer period than a set time, node 110 can assume that the target UID table has been established for too long and a new UID table needs to be established. In this application, the set time is less than the storage time specified for the UID table, which can prevent node 110 from being unable to write data during the process of establishing a new UID table because the target UID table has expired and has been deleted by node 110.

[0077] In step S404, node 110 determines to construct the first UID table and sends the information of the first UID table to HBase 200. The information of the first UID table includes the table name, storage time, and other information.

[0078] When node 110 determines that the target UID table is about to expire, node 110 creates a new UID table to replace the target UID table. After creating the new UID table, node 110 packages the new UID table name, storage time, and other information together and sends it to HBase 200, allowing HBase 200 to create the new UID table. Optionally, node 110 may choose not to create a new UID table and instead send the information about creating a new UID table to HBase 200.

[0079] In step S405, HBase 200 receives the information from the first UID table and constructs the first UID table based on the information from the first UID table.

[0080] In step S406, node 110 obtains the cache container corresponding to the target UID table and writes the data stored in the cache container corresponding to the target UID table into the first UID table.

[0081] After receiving information about the new UID table, the HBase 200 node constructs a new UID table identical to the one on node 110. The HBase 200 node uses the received table name as the name of the new UID table. The HBase 200 node uses the received storage time as the time to clear the new UID table. After constructing the new UID table, the HBase 200 node retrieves the cache container corresponding to the target UID table and writes the hot data from the target UID table cache into the new UID table. When the target UID table expires, node 110 clears it, and the new UID table completely replaces the target UID table, allowing node 110 to write data uninterruptedly.

[0082] In step S407, HBase 200 sends feedback information to node 110.

[0083] In step S408, node 110 sets the first UID table to working status based on the feedback information.

[0084] After an HBase 200 node successfully builds a new UID table, it sends a feedback message to node 110. Node 110, upon receiving this feedback, knows that HBase 200 has successfully built the new UID table and can continue writing data. If an HBase 200 node fails to build the new UID table, it sends a command to node 110 to reconstruct the UID table, ensuring that node 110 rebuilds the new table. This prevents node 110 from being unable to write data after deleting the target UID table.

[0085] In this embodiment, Open TSDB 10 utilizes cache write-back technology to directly write the UID table cache from the previous cycle into the UID table of the new cycle, thereby enabling the rapid creation of new UID tables and the aging of old UID tables, thus solving the problem of excessive resource consumption in the existing Open TSDB 10.

[0086] This application embodiment also provides a server that can be deployed with Open TSDB, which can perform operations such as... Figures 1-4 The aforementioned corresponding protection technical solutions enable the server to have the technical effects of the aforementioned protection technical solutions.

[0087] This application embodiment also provides a computer-readable storage medium storing a computer program thereon, which, when executed in a computer, causes the computer to perform the above-described actions. Figures 1-4 And any of the methods described in the corresponding description.

[0088] This application also provides a computer program product, which stores instructions that, when executed by a computer, cause the computer to perform the above-described actions. Figures 1-4 And any of the methods described in the corresponding description.

[0089] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application.

[0090] Furthermore, various aspects or features of the embodiments of this application can be implemented as methods, apparatus, or articles of manufacture using standard programming and / or engineering techniques. The term "article of manufacture" as used in this application encompasses a computer program accessible from any computer-readable device, carrier, or medium. For example, computer-readable media may include, but are not limited to: magnetic storage devices (e.g., hard disks, floppy disks, or magnetic tapes), optical discs (e.g., compact discs (CDs), digital versatile discs (DVDs), etc.), smart cards, and flash memory devices (e.g., erasable programmable read-only memory (EPROMs), cards, sticks, or key drives, etc.). Additionally, the various storage media described herein may represent one or more devices and / or other machine-readable media for storing information. The term "machine-readable medium" may include, but is not limited to, wireless channels and various other media capable of storing, containing, and / or carrying instructions and / or data.

[0091] In the above embodiments, Open TSDB can be implemented entirely or partially through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., high-density digital video discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).

[0092] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of this application.

[0093] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0094] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0095] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0096] If the aforementioned function is implemented as 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 this application embodiment, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or an access network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0097] The above description is merely a specific implementation of the embodiments of this application, but the protection scope of the embodiments of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the embodiments of this application should be covered within the protection scope of the embodiments of this application.

Claims

1. A UID encoding method, characterized by, The open TSDB includes a TSDB including a plurality of nodes and an HBase including a plurality of RSs, one node is in communication connection with at least one RS, and the method includes: The target node determines a target RS according to a received string, the plurality of nodes include the target node, the string is a string of metric and tags of monitoring index data, and the plurality of RSs include the target RS; The target node sends a request instruction to the HBase; The HBase controls the target RS to establish a communication connection with the target node based on the request instruction; The target node sends the string to the target RS; The target RS generates a UID according to the string.

2. The method of claim 1, wherein, The target node determines a target RS according to a received string, including: The target node inputs the string into a hash value generator to obtain a hash value; The target node processes the hash value and compares the hash value with the identifiers of the RSs stored by the target node to determine the target RS.

3. The method of claim 1, wherein, The target RS generates a UID according to the string, including: The target RS triggers a snowflake algorithm to generate the UID of the string according to the string.

4. The method according to any one of claims 1 to 3, characterized in that, Further including: The target RS writes the string and the UID into a UID table and sends the UID to the target node.

5. A method of creating a UID table, characterized by, The open TSDB includes a TSDB and an HBase, and the method includes: A node of the TSDB sends a query request to the HBase, the query request instructs the HBase to query a target UID table and obtain a creation time of the target UID table; The HBase sends the creation time of the target UID table to the node of the TSDB based on the query request; The node of the TSDB determines an existence time of the target UID table according to the creation time of the target UID table and a current time, and in response to the existence time of the target UID table being greater than a set time, sends information for constructing a first UID table to the HBase; The HBase constructs the first UID table based on the information of the first UID table, and writes data of the target UID table into the first UID table.

6. The method of claim 5, wherein, The writing of the data of the target UID table into the first UID table includes: The HBase retrieves a cache container corresponding to the target UID table according to the target UID table; The HBase writes data stored in the cache container corresponding to the target UID table into the first UID table.

7. The method of claim 6, wherein, Before the sending of the information for constructing the first UID table to the HBase, including: The node of the TSDB constructs the first UID table based on the information of the first UID table.

8. The method according to any one of claims 5-7, characterized in that, Further including: The HBase sends feedback information to the node of the TSDB; The node of the TSDB sets the first UID table to a working state based on the feedback information.

9. An Open TSDB, characterized in that, Including: The TSDB comprises a plurality of nodes, the HBase comprises a plurality of RSs, one node is in communication connection with at least one RS, the plurality of nodes comprises a target node, and the plurality of RSs comprises a target RS; The target node is configured to determine the target RS according to a received string, and send a request instruction to the HBase, wherein the string is a string of metric and tags of monitored index data; The HBase is configured to control the target RS to establish a communication connection with the target node based on the request instruction; The target node is further configured to send the string to the target RS; The target RS is further configured to generate a UID according to the string.

10. The Open TSDB of claim 9, wherein, The target node is specifically configured to input the string into a hash value generator to obtain a hash value; and The hash value is processed, and the identifier of each RS stored by the target node is compared to determine the target RS.

11. The Open TSDB of claim 9, wherein, The target RS is specifically configured to trigger a snowflake algorithm to generate a UID of the string according to the string.

12. The Open TSDB according to any of claims 9-11, characterized in that, The target RS is further configured to write the string and the UID into a UID table, and send the UID to the target node.

13. An Open TSDB, characterized in that, Comprise: A TSDB and an HBase, A node of the TSDB is configured to send a query request to the HBase, wherein the query request instructs the HBase to query a target UID table and acquire a creation time of the target UID table; The HBase is configured to send the creation time of the target UID table to the node of the TSDB based on the query request; The node of the TSDB is further configured to determine an existence time of the target UID table according to the creation time of the target UID table and a current time, and in response to the existence time of the target UID table being greater than a set time, send information of constructing a first UID table to the HBase; The HBase is further configured to construct the first UID table based on the information of the first UID table, and write data of the target UID table into the first UID table.

14. The Open TSDB of claim 13, wherein, The HBase is specifically configured to retrieve a cache container corresponding to the target UID table according to the target UID table; and Write data stored in the cache container corresponding to the target UID table into the first UID table.

15. The Open TSDB of claim 13, wherein, The node of the TSDB is further configured to construct the first UID table based on the information of the first UID table.

16. The Open TSDB according to any of claims 13-15, wherein, The HBase is further configured to send feedback information to the node of the TSDB; The node of the TSDB is further configured to set the first UID table to a working state based on the feedback information.

17. A server, characterized by The server is deployed with the OpenTSDB of any one of claims 9-16.

18. A computer readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method of any one of claims 1-8.

19. A computer program product, characterised in that, The computer program product stores instructions which, when executed by a computer, cause the computer to implement the method of any one of claims 1-8.

Citation Information

Patent Citations

  • Method and device for real-time monitoring on time sequence database of system

    CN106503276A

  • File attribution information recording method and device, storage medium and terminal

    CN109408465A