Time series data access method and device, equipment and medium

By generating routing rule identifiers in the newly added storage servers and using the effective time to match and determine the target storage server, the reliability and efficiency issues caused by time-series data migration are resolved, and efficient data access is achieved.

CN120994131APending Publication Date: 2025-11-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511106818.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-07
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

When adding a new storage server, existing technologies require migrating the already stored time-series data, which results in a time-consuming and resource-intensive migration process and may affect the reliability and efficiency of accessing the time-series data.

Method used

By generating multiple routing rule identifiers, each corresponding to a different storage server identifier with the same effective time, the target storage server is determined by matching the request time period with the effective time, thus avoiding time-series data migration and allowing direct access to data on the newly added storage server.

Benefits of technology

It improves the reliability of time-series data access, avoids time-consuming and resource-intensive migration processes, and ensures the efficiency and stability of data access.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120994131A_ABST
    Figure CN120994131A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a time series data access method and device, equipment and a medium. The method comprises the following steps: if an access request for time sequence data of equipment is received, acquiring a request time period and an equipment identifier of the equipment from the access request; then the request time period is matched with the effective time corresponding to each routing rule identifier to obtain a successfully matched target routing rule identifier, the same routing rule identifier corresponds to a plurality of routing rules, and the plurality of routing rules are generated when a storage server is newly added and correspond to the same effective time and different storage server identifiers; determining a target storage server identifier based on the device identifier and a plurality of target routing rules corresponding to the target routing rule identifier; and then accessing the time sequence data based on a target storage server corresponding to the target storage server identifier. According to the technical scheme, migration of the time series data is avoided, and the access reliability of the time series data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computers, in particular to a time series data access method, a time series data access device, an electronic device, and a computer readable medium. BACKGROUND

[0002] With the rapid development of the Internet of Things, the industrial Internet and other fields, time series data generated by devices (such as sensor readings, logs, etc.) is growing explosively. At this time, a single storage server cannot meet the storage of massive data, and it is necessary to expand the storage capacity by adding new storage servers.

[0003] In related technologies, when a new storage server is added, the stored time series data often needs to be migrated. However, the migration process is time-consuming and resource-consuming, and may affect the access of time series data during the migration process, resulting in low access efficiency, access failure and other phenomena.

[0004] Therefore, how to avoid the migration of time series data to improve the reliability of time series data access is a problem to be solved. SUMMARY

[0005] Embodiments of the present application provide a time series data access method, device, equipment and medium, which avoids the migration of time series data and improves the reliability of time series data access.

[0006] In a first aspect, embodiments of the present application provide a time series data access method, the method comprising: if an access request for time series data of a device is received, obtaining a request time period and a device identifier of the device from the access request; matching the request time period with the effective time corresponding to each routing rule identifier to obtain a target routing rule identifier that matches successfully; wherein a same routing rule identifier corresponds to multiple routing rules, and the multiple routing rules are generated when a new storage server is added, and correspond to a same effective time and different storage server identifiers; determining a target storage server identifier based on the device identifier and the multiple target routing rules corresponding to the target routing rule identifier; and accessing the time series data based on a target storage server corresponding to the target storage server identifier.

[0007] In a second aspect, an embodiment of the present application provides a time series data access device, the device comprising: an acquisition module configured to, if an access request for time series data of a device is received, acquire a request time period and a device identifier of the device from the access request; a matching module configured to match the request time period with an effective time corresponding to each routing rule identifier to obtain a target routing rule identifier for which the matching is successful; wherein a same routing rule identifier corresponds to a plurality of routing rules, the plurality of routing rules are generated when a storage server is newly added, and correspond to a same effective time and different storage server identifiers; a determination module configured to determine a target storage server identifier based on the device identifier and the plurality of target routing rules corresponding to the target routing rule identifier; and an access module configured to access the time series data based on a target storage server corresponding to the target storage server identifier.

[0008] In an embodiment of the present application, based on the foregoing scheme, the plurality of routing rules further correspond to different virtual node storage ranges, and one virtual node storage range corresponds to one storage server identifier; accordingly, the determination module is specifically configured to: acquire a virtual node storage value corresponding to the device identifier; and determine a target storage server identifier corresponding to a target virtual node storage range containing the virtual node storage value based on the virtual node storage value and the plurality of target routing rules corresponding to the target routing rule identifier.

[0009] In an embodiment of the present application, based on the foregoing scheme, the determination module is further specifically configured to: match the virtual node storage value with a virtual node storage range corresponding to each target routing rule to obtain a target virtual node storage range for which the matching is successful; and acquire a target storage server identifier corresponding to the target virtual node storage range.

[0010] In an embodiment of the present application, based on the foregoing scheme, the determination module is further specifically configured to: acquire a quantity of all virtual node storage values contained in a preset virtual node storage total range; wherein the preset virtual node storage total range is a union of the different virtual node storage ranges; perform a hash operation on the device identifier to obtain a hash value; and perform a modulo operation on the hash value and the quantity to obtain the virtual node storage value.

[0011] In an embodiment of the present application, based on the foregoing scheme, the target storage server identifier comprises a plurality; accordingly, the access module is specifically configured to: if the access request is a write request, write the time series data into the target storage servers corresponding to the plurality of target storage server identifiers respectively; if the access request is a read request, select a main target storage server from the target storage servers corresponding to the plurality of target storage server identifiers respectively, and read the time series data from the main target storage server.

[0012] In an embodiment of the present application, based on the foregoing scheme, the access module is further specifically configured to: evaluate the storage service capabilities of the target storage servers corresponding to the plurality of target storage server identifiers respectively to obtain evaluation results corresponding to the plurality of target storage servers respectively; and select the main target storage server from the plurality of target storage servers based on the evaluation results corresponding to the plurality of target storage servers respectively.

[0013] In an embodiment of the present application, based on the foregoing scheme, the evaluation result comprises an evaluation score; accordingly, the access module is further specifically configured to: for each target storage server, calculate the evaluation score based on the index values corresponding to the evaluation indexes; wherein the evaluation indexes comprise at least one of resource occupancy rate, network communication state, and service port availability; select the target storage server with the largest evaluation score from the plurality of target storage servers, and determine the selected target storage server as the main target storage server.

[0014] In an embodiment of the present application, based on the foregoing scheme, the evaluation indexes comprise a plurality; accordingly, the access module is further specifically configured to: obtain index values corresponding to the plurality of evaluation indexes respectively; and perform weighted summation operation on the index values corresponding to the plurality of evaluation indexes respectively to obtain the evaluation score.

[0015] In an embodiment of the present application, based on the foregoing scheme, the device further comprises a generation module configured to: if a new storage server is detected, generate a routing rule identifier and generate an effective time corresponding to the routing rule identifier; obtain a plurality of storage server identifiers corresponding to the routing rule identifier; wherein the plurality of storage server identifiers are storage server identifiers corresponding to all storage servers after the new storage server; associate the effective time with the plurality of storage server identifiers respectively to generate the plurality of routing rules; wherein each routing rule comprises the effective time and at least one storage server identifier, and different routing rules comprise different storage server identifiers.

[0016] In an embodiment of the present application, based on the foregoing scheme, the routing rule identifier comprises a target routing rule sequence number; accordingly, the generating module is specifically configured to: obtain the maximum routing rule sequence number among the existing routing rule sequence numbers, and increase the maximum routing rule sequence number by a specified unit to obtain the target routing rule sequence number; obtain the time of adding the new storage server, and determine the time of adding the new storage server or a time later than the time of adding the new storage server as the effective time.

[0017] In an embodiment of the present application, based on the foregoing scheme, the generating module is specifically configured to: divide the preset virtual node storage total range into a plurality of virtual node storage ranges; associate the plurality of virtual node storage ranges with the plurality of storage server identifiers respectively to obtain a plurality of association groups; wherein each association group comprises one virtual node storage range and at least one storage server identifier, different association groups comprise different virtual node storage ranges and different storage server identifiers; associate the effective time with the plurality of association groups respectively to generate the plurality of routing rules; wherein each routing rule comprises the effective time and one association group, and different routing rules comprise different association groups.

[0018] In an embodiment of the present application, based on the foregoing scheme, the generating module is further specifically configured to: determine the storage servers used for backup from the all storage servers; calculate a division number based on the number of the all storage servers and the number of the storage servers used for backup; and divide the preset virtual node storage total range equally based on the division number to obtain the plurality of virtual node storage ranges.

[0019] In a third aspect, the embodiments of the present application provide an electronic device, comprising one or more processors; a memory for storing one or more computer programs, which, when executed by the one or more processors, cause the electronic device to implement the time series data access method as described above.

[0020] In a fourth aspect, the embodiments of the present application provide a computer readable medium having a computer program stored thereon, which, when executed by a processor, implements the time series data access method as described above.

[0021] In a fifth aspect, the embodiments of the present application provide a computer program product comprising computer instructions, which, when executed by a processor, implement the time series data access method as described above.

[0022] In the technical solution provided by the embodiments of the present application: when a new storage server is added, a plurality of routing rules corresponding to the routing rule identifier are generated, the plurality of routing rules share the same effective time, and are directed to different storage server identifiers; thus, when an access request for device time series data is received, by matching the request time period requested in the access request with the effective time in the routing rule, the target routing rule effective in the time period to which the time series data belongs can be located, and then by means of the device identifier of the device in the access request and the target routing rule, the target storage server to which the time series data should be routed can be determined, so that the time series data is accessed in the target storage server.

[0023] In this way, in the case of adding a new storage server, by adding the effective time in the routing rule, time series data access based on the effective time and the request time is realized, without the need to migrate the already stored time series data, avoiding the phenomena of time-consuming and resource-consuming in the migration process, and affecting the time series data access; therefore, the technical solution of the present application improves the reliability of time series data access.

[0024] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS

[0025] Figure 1 is a schematic diagram of an exemplary implementation environment to which the technical solution of the embodiments of the present application can be applied.

[0026] Figure 2 is a flowchart of a time series data access method according to an exemplary embodiment of the present application.

[0027] Figure 3 is a schematic diagram of a time series data access system according to an exemplary embodiment of the present application.

[0028] Figure 4 is a schematic diagram of a routing rule table generated according to an exemplary embodiment of the present application.

[0029] Figure 5 is a schematic diagram of stored time series data according to an exemplary embodiment of the present application.

[0030] Figure 6 is a schematic diagram of querying time series data according to an exemplary embodiment of the present application.

[0031] Figure 7 is a block diagram of a time series data access device according to an exemplary embodiment of the present application.

[0032] Figure 8 is a structural schematic diagram of a computer system of an electronic device suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION

[0033] Detailed description of exemplary embodiments will be made with reference to the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments are not meant to represent all implementations in accordance with the present application. Rather they are merely examples of apparatuses and methods that can be used in conjunction with some aspects of the present application, as detailed in the appended claims.

[0034] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined target, and can be implemented in whole or in part by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an integral module or unit that includes the functions of the module or unit.

[0035] The block diagrams shown in the drawings are only functional entities, and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0036] The flowcharts shown in the drawings are only exemplary illustrations, and do not necessarily include all contents and operations / steps, nor do they necessarily have to be executed in the order described. For example, some operations / steps can be further divided, and some operations / steps can be combined or partially combined, so the actual execution order can be changed according to the actual situation.

[0037] It should be noted that "multiple" as mentioned in the present application refers to two or more. The association relationship of "and / or" associated objects indicates that there can be three relationships, for example, A and / or B can represent the three cases of A alone, A and B together, and B alone. The character " / " generally represents an "or" relationship between the associated objects before and after it.

[0038] In the related art, when a new storage server is added, the stored time series data often needs to be migrated, but the migration process is time-consuming and resource-consuming, and may affect the access of time series data during the migration process, causing low access efficiency, access failure, and other phenomena.

[0039] Therefore, in order to avoid the migration of time series data and improve the reliability of time series data access, the present application provides a time series data access scheme. Please refer to Figure 1 , Figure 1is a schematic diagram of an implementation environment to which the present application relates. The implementation environment mainly includes a terminal device 101 and a server 102; wherein:

[0040] The terminal device 101 includes but is not limited to an extended reality device (a virtual reality device, an augmented reality device, a mixed reality device, etc.), a mobile phone, a computer (a tablet computer, a notebook computer, a desktop computer, etc.), a smart home device (a television, a refrigerator, an air conditioner, a washing machine, a sweeping and mopping robot, etc.), a smart wearable device (a bracelet, a watch, etc.), etc.

[0041] The server 102 can be a standalone physical server, or a server cluster or a distributed system composed of multiple physical servers, wherein the server cluster or the distributed system includes cloud servers for providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, etc.

[0042] It can be understood that the terminal device 101 and the server 102 establish a communication connection through a wired or wireless network. Exemplarily, the wireless network or the wired network uses standard communication technologies and / or protocols. The network is usually the Internet, but can also be any other network, including but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a private network or any combination of a virtual private network, etc.

[0043] In an embodiment of the present application, the time series data access method can be executed by the terminal device 101, specifically: if an access request for time series data of a device is received, a request time period and a device identifier of the device are obtained from the access request; then the request time period is matched with an effective time corresponding to each routing rule identifier, to obtain a target routing rule identifier that matches successfully, a plurality of routing rules corresponding to the same routing rule identifier, the plurality of routing rules being generated when a storage server is newly added, and corresponding to the same effective time and different storage server identifiers; then based on the device identifier and a plurality of target routing rules corresponding to the target routing rule identifier, a target storage server identifier is determined; then the time series data is accessed based on a target storage server corresponding to the target storage server identifier.

[0044] In an embodiment of the present application, the time series data access method can be executed by the server 102, specifically: if an access request for time series data of a device is received, a request time period and a device identifier of the device are obtained from the access request; then the request time period is matched with an effective time corresponding to each routing rule identifier, to obtain a target routing rule identifier of which the matching is successful, a same routing rule identifier corresponds to multiple routing rules, the multiple routing rules are generated when a storage server is newly added, and correspond to a same effective time and different storage server identifiers; then a target storage server identifier is determined based on the device identifier and the multiple target routing rules corresponding to the target routing rule identifier; and then the time series data is accessed based on the target storage server corresponding to the target storage server identifier.

[0045] It should be noted that, Figure 1 The number of terminal devices 101 and servers 102 in

[0046] It should be noted that, in the specific embodiments of the present application, user-related data is involved, and when the embodiments of the present application are applied to specific products or technologies, user permission or consent needs to be obtained, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of the country and region.

[0047] The various implementation details of the technical solutions of the embodiments of the present application are described in detail as follows:

[0048] Please refer to Figure 2 , Figure 2 is a flowchart of a time series data access method according to an embodiment of the present application. As Figure 2 shown, the time series data access method at least includes S201 to S204, which are described in detail as follows:

[0049] S201, if an access request for time series data of a device is received, a request time period and a device identifier of the device are obtained from the access request.

[0050] The device in the embodiments of the present application refers to an entity generating or providing time series data, which includes but is not limited to at least one of a server, a switch, a sensor, a router, a firewall, etc. The time series data refers to a sequence of relevant data reflecting the state of device resources, which is collected / recorded continuously over time or at fixed time intervals. For example, for a server, the time series data includes but is not limited to the state of resources such as CPU occupancy, memory usage, disk read / write speed, network traffic, etc. For a switch, the time series data includes but is not limited to the state of resources such as port bandwidth utilization, error packet count, port state change, etc. For a sensor, the time series data includes but is not limited to the state of resources such as temperature, humidity, pressure, light intensity, etc. It can be understood that these data all contain timestamps and specific measurement values corresponding to each timestamp.

[0051] The access request in the embodiments of the present application refers to a request for accessing time series data of a device. The access includes but is not limited to at least one of writing, reading, etc. The writing can be adding (i.e. storing time series data), modifying (i.e. modifying stored time series data), deleting (i.e. deleting stored time series data), and the reading refers to querying time series data. The access request includes a request time period, which refers to a time range corresponding to the time series data that the access object (e.g. a user) wants to access. For example, "from the beginning of last month to the end of last month", "the last 24 hours", "today 09:00-10:00", etc. The access request also includes a device identifier, which refers to information for uniquely identifying a device, including but not limited to at least one of an identifier (ID), a serial number, a host name, an Internet Protocol (IP) address, etc.

[0052] The access object can issue an access request according to actual access requirements. Correspondingly, the access request sent by the access object is received, and the request time period and the device identifier can be extracted from the access request.

[0053] In the embodiments of the present application, the request time period is matched with the effective time corresponding to each routing rule identifier, and the target routing rule identifier that matches successfully is obtained. The same routing rule identifier corresponds to multiple routing rules, and the multiple routing rules are generated when a storage server is added, and correspond to the same effective time and different storage server identifiers.

[0054] In the embodiments of the present application, after the request time period is obtained, the request time period is matched with the effective time corresponding to each routing rule identifier, so that the target routing rule identifier that matches successfully is obtained.

[0055] The routing rule identifier in the embodiments of the present application refers to information used to uniquely identify routing rules with the same effective time and different storage server identifiers, which includes but is not limited to routing rule sequence numbers obtained by sorting, and the like. One routing rule identifier usually corresponds to multiple routing rules. For example, as shown in Table 1, routing rule sequence number 1 corresponds to two routing rules, and the two routing rules correspond to the same effective time "2024-01-10" and different storage server identifiers "172.16.0.1, 172.16.0.2". Routing rule sequence number 2 corresponds to three routing rules, and the three routing rules correspond to the same effective time "2024-12-10" and different storage server identifiers "172.16.0.1, 172.16.0.2, 172.16.0.3". Meanwhile, the three routing rules are generated when a new storage server (i.e., 172.16.0.3) is added.

[0056] Routing rule identification Storage server identification Effective time 1 172.16.0.1 2024-01-10 1 172.16.0.2 2024-01-10 2 172.16.0.1 2024-12-10 2 172.16.0.2 2024-12-10 2 172.16.0.3 2024-12-10

[0057] Table 1

[0058] Next, the generation process of the multiple routing rules corresponding to any routing rule identifier is introduced.

[0059] In an embodiment of the present application, the multiple routing rules corresponding to any routing rule identifier are obtained in the following manner: if a new storage server is detected, a routing rule identifier is generated, and an effective time corresponding to the routing rule identifier is generated; multiple storage server identifiers corresponding to the routing rule identifier are obtained; the multiple storage server identifiers are storage server identifiers respectively corresponding to all storage servers after the new storage server is added; the effective time is associated with the multiple storage server identifiers respectively, and multiple routing rules are generated; each routing rule includes an effective time and at least one storage server identifier, and the storage server identifiers included in different routing rules are different.

[0060] That is, in the optional embodiment, whether there is a new storage server is detected in real time. When the new storage server is detected, a new routing rule identifier is generated, the effective time and the multiple storage server identifiers corresponding to the routing rule identifier are obtained, and then the multiple routing rules are generated based on the effective time and the multiple storage server identifiers.

[0061] In optional embodiments, the multiple storage server identifiers corresponding to the routing rule identifier can be obtained after the new storage server is added, and each of the multiple storage servers corresponds to a storage server identifier. For example, as shown in Table 1, there are two storage servers (i.e., 172.16.0.1 and 172.16.0.2) originally, and after the new storage server (i.e., 172.16.0.3) is added, there are three storage servers in total (i.e., 172.16.0.1, 172.16.0.2, and 172.16.0.3).

[0062] In optional embodiments, one routing rule includes an effective time and at least one storage server identifier. It can be understood that when one routing rule includes one storage server identifier, it indicates that the storage server is not currently used for backup. For example, as shown in Table 1, each routing rule includes one storage server identifier, and when the time series data is accessed, it can be accessed from the corresponding storage server. When one routing rule includes multiple storage server identifiers, it indicates that the storage server is currently used for backup. For example, as shown in Table 2, each routing rule includes two storage server identifiers, and when the time series data is accessed, it can be accessed from the corresponding two storage servers.

[0063] Routing rule identification Storage server identification Effective time 1 172.16.0.1,172.16.0.2 2024-01-10 1 172.16.0.3,172.16.0.4 2024-01-10 2 172.16.0.1,172.16.0.2 2024-12-10 2 172.16.0.3,172.16.0.4 2024-12-10 2 172.16.0.5,172.16.0.6 2024-12-10

[0064] Table 2

[0065] In this way, by implementing optional embodiments, the multiple routing rules corresponding to the routing rule identifier can be generated simply and accurately with the help of the effective time and the storage server identifier.

[0066] In some embodiments, the routing rule identifier includes a target routing rule sequence number. As described in the foregoing embodiments, the routing rule identifier includes a routing rule sequence number obtained by sequencing, which is referred to as a target routing rule sequence number for subsequent distinction.

[0067] Correspondingly, the process of generating the routing rule identifier can include: obtaining the largest routing rule sequence number from the existing routing rule sequence numbers, and increasing the largest routing rule sequence number by a specified unit to obtain the target routing rule sequence number.

[0068] That is, in optional embodiments, the largest routing rule sequence number from the existing routing rule sequence numbers is obtained, and the largest routing rule sequence number is increased by a specified unit to obtain the target routing rule sequence number.

[0069] For example, as described in the foregoing Table 1 example, in the case of adding a new storage server (i.e., 172.16.0.3), the largest routing rule sequence number is 1, and 2 (i.e., the specified unit is 1) can be determined as the target routing rule sequence number.

[0070] In this way, by implementing the optional embodiment, the target routing rule sequence number is generated according to the number of newly added storage servers, and the target routing rule sequence number is regularly generated, so that the number of newly added storage servers can be more intuitively reflected through the target routing rule sequence number.

[0071] In some embodiments, the process of generating the effective time corresponding to the routing rule identifier can include: obtaining the time of adding the newly added storage server, and determining the time of adding the newly added storage server or a time later than the time of adding the newly added storage server as the effective time.

[0072] That is, in the optional embodiment, the time of adding the newly added storage server (referred to as the adding time) is recorded, and a time equal to or later than the adding time is determined as the effective time.

[0073] For example, taking the example of the preceding Table 1, in the case of adding a storage server (i.e., 172.16.0.3), assuming that the storage server (i.e., 172.16.0.3) is added at time "2024-12-09", then the time "2024-12-10" later than the time "2024-12-09" can be determined as the effective time.

[0074] In this way, by implementing the optional embodiment, the effective time is generated according to the time of adding the newly added storage server, ensuring the accuracy of the effective time.

[0075] In some embodiments, the process of generating the effective time corresponding to the routing rule identifier can include: obtaining the time of adding the newly added storage server, and determining the time of adding the newly added storage server or a time later than the time of adding the newly added storage server as the effective time.

[0076] That is, in the optional embodiment, after generating a new routing rule identifier, the multiple virtual node storage ranges corresponding to the routing rule identifier are also obtained, and then multiple routing rules are generated based on the effective time, the multiple storage servers, and the multiple virtual node storage ranges.

[0077] In optional embodiments, the storage range of the virtual node corresponding to the routing rule identifier can be obtained by dividing the preset total storage range of the virtual node, thereby obtaining the storage range of the virtual node. For example, as shown in Table 3, the total storage range of the virtual node is [0, 1023], the storage range of the virtual node corresponding to the routing rule sequence number 1 is [0, 511] and [512, 1023], and the storage range of the virtual node corresponding to the routing rule sequence number 2 is [0, 341], [342, 682] and [683, 1023].

[0078] Routing rule identification Virtual node storage range Storage server identification Effective time 1 [0,511] 172.16.0.1 2024-01-10 1 [512,1023] 172.16.0.2 2024-01-10 2 [0,341] 172.16.0.1 2024-12-10 2 [342,682] 172.16.0.2 2024-12-10 2 [683,1023] 172.16.0.3 2024-12-10

[0079] Table 3

[0080] In optional embodiments, one routing rule includes one effective time and one associated group. Since one associated group includes one storage range of the virtual node and at least one storage server identifier, one routing rule includes one effective time, one storage range of the virtual node, and at least one storage server identifier. Similarly, when one routing rule includes one storage server identifier, it indicates that the storage server is not currently used for backup. For example, as shown in Table 3, each routing rule includes one storage server identifier, and when the time series data is accessed, it can be accessed from the corresponding storage server. When one routing rule includes multiple storage server identifiers, it indicates that the storage server is currently used for backup. For example, as shown in Table 4, each routing rule includes two storage server identifiers, and when the time series data is accessed, it can be accessed from the corresponding two storage servers.

[0081] Routing rule identification Virtual node storage range Storage server identification Effective time 1 [0,511] 172.16.0.1,172.16.0.2 2024-01-10 1 [512,1023] 172.16.0.3,172.16.0.4 2024-01-10 2 [0,341] 172.16.0.1,172.16.0.2 2024-12-10 2 [342,682] 172.16.0.3,172.16.0.4 2024-12-10 2 [683,1023] 172.16.0.5,172.16.0.6 2024-12-10

[0082] Table 4

[0083] In this way, by implementing optional embodiments, the storage range of the virtual node can be simply and accurately generated, and the routing rule can be simply and accurately generated.

[0084] Optionally, the process of dividing the preset total storage range of the virtual node into multiple storage ranges of the virtual node can include: determining the storage servers used for backup from all storage servers; calculating the division number based on the number of all storage servers and the number of storage servers used for backup; and equally dividing the preset total storage range of the virtual node based on the division number to obtain the multiple storage ranges of the virtual node.

[0085] That is, in the optional embodiment, the storage server used for backup is determined from all storage servers first, and then the division number is calculated based on the number of all storage servers and the number of storage servers used for backup, and the preset virtual node storage total range is equally divided according to the division number to obtain a plurality of virtual node storage ranges.

[0086] For example, taking the example of the preceding Table 3, in the case of adding a storage server (namely 172.16.0.3), there is no storage server used for backup in all storage servers (namely 172.16.0.1, 172.16.0.2, and 172.16.0.3), that is, the number of storage servers used for storing backup is 0, and the number of all storage servers is 3, at this time, the division number 3 can be obtained, thereby three virtual node storage ranges (namely [0, 341], [342, 682], and [683, 1023]) are obtained.

[0087] Or taking the example of the preceding Table 4, in the case of adding storage servers (namely 172.16.0.5 and 172.16.0.6), there are storage servers used for backup (namely any one of 172.16.0.1 and 172.16.0.2, any one of 172.16.0.3 and 172.16.0.4, and any one of 172.16.0.5 and 172.16.0.6) in all storage servers (namely 172.16.0.1, 172.16.0.2, 172.16.0.3, 172.16.0.4, 172.16.0.5, and 172.16.0.6), that is, the number of storage servers used for storing backup is 3, and the number of all storage servers is 6, at this time, the division number 3 can be obtained, thereby three virtual node storage ranges (namely [0, 341], [342, 682], and [683, 1023]) are obtained.

[0088] In this way, by implementing the optional embodiment, the plurality of virtual node storage ranges are generated by equal division, which to some extent guarantees the storage balance among the plurality of storage servers.

[0089] So far, it is the generation process of the plurality of routing rules corresponding to any routing rule identifier, and returns to the request process.

[0090] The target routing rule identifier in the embodiment of the application refers to the routing rule identifier in which the effective time matches the request time period successfully.

[0091] For example, taking the example of the preceding Table 1, assume that the request time period is "2024-12-08 to 2024-12-11", which includes a first sub-time period "2024-12-08 to 2024-12-09" and a second sub-time period "2024-12-10 to 2024-12-11", and the first sub-time period "2024-12-08 to 2024-12-09" matches the effective time "2024-01-10" successfully, and the second sub-time period "2024-12-10 to 2024-12-11" matches the effective time "2024-12-10" successfully, so the target routing rule identifier 1 and the target routing rule identifier 2 are obtained.

[0092] S203, determining a target storage server identifier based on the device identifier and a plurality of target routing rules corresponding to the target routing rule identifier.

[0093] As described in the foregoing embodiments, the same routing rule identifier corresponds to a plurality of routing rules, the target routing rule identifier is any / multiple of the routing rule identifiers, and accordingly, the target routing rule identifier also corresponds to a plurality of routing rules. For the sake of subsequent distinction, each routing rule corresponding to the target routing rule identifier is referred to as a target routing rule.

[0094] After obtaining the device identifier and the plurality of target routing rules in the embodiments of the present application, the target storage server identifier can be determined based on the device identifier and the plurality of target routing rules, wherein the target storage server identifier refers to any / multiple of the plurality of storage server identifiers.

[0095] For example, taking the example of the preceding Table 1, assume that the device identifier is q, and the routing rule sorting number 1 corresponds to two routing rules, and the routing rule sorting number 2 corresponds to three routing rules, then the target storage server identifier is determined based on the device identifier q and the five routing rules.

[0096] In an embodiment of the present application, the plurality of routing rules also correspond to different virtual node storage ranges, and one virtual node storage range corresponds to one storage server identifier. For example, as shown in Table 3 and Table 4, one routing rule includes one effective time, one virtual node storage range, and at least one storage server identifier.

[0097] Accordingly, the process of determining the target storage server identifier based on the device identifier and the plurality of target routing rules corresponding to the target routing rule identifier in S203 can include: obtaining a virtual node storage value corresponding to the device identifier; and determining a target storage server identifier corresponding to a target virtual node storage range containing the virtual node storage value based on the virtual node storage value and the plurality of target routing rules corresponding to the target routing rule identifier.

[0098] That is, in an optional embodiment, the target storage server identifier corresponding to the target virtual node storage range containing the virtual node storage value is determined based on the virtual node storage value corresponding to the device identifier and the multiple target routing rules corresponding to the target routing rule identifier.

[0099] For example, taking the example of the preceding Table 3, assume that the virtual node storage value corresponding to the device identifier q is 430, and the request time period is “2024-12-08 to 2024-12-11”, which contains a first sub-time period “2024-12-08 to 2024-12-09” and a second sub-time period “2024-12-10 to 2024-12-11”, obtaining target routing rule identifier 1 and target routing rule identifier 2. Among them, for the first sub-time period, because the virtual node storage value 430 is in the virtual node storage range “[0, 511]” corresponding to the target routing rule identifier 1, the target storage server identifier “172.16.0.1” is obtained; for the second sub-time period, because the virtual node storage value 430 is in the virtual node storage range “[342, 682]” corresponding to the target routing rule identifier 2, the target storage server identifier “172.16.0.2” is obtained.

[0100] In this way, by implementing the optional embodiment, the target storage server identifier can be conveniently and accurately determined by means of the virtual node storage value corresponding to the device identifier.

[0101] In some embodiments, the process of determining the target storage server identifier corresponding to the target virtual node storage range containing the virtual node storage value based on the virtual node storage value and the multiple target routing rules corresponding to the target routing rule identifier can include: matching the virtual node storage value with the virtual node storage range corresponding to each target routing rule to obtain a target virtual node storage range that matches successfully; and obtaining the target storage server identifier corresponding to the target virtual node storage range.

[0102] That is, in an optional embodiment, the virtual node storage value is matched with the virtual node storage range corresponding to each target routing rule to obtain a target virtual node storage range that matches successfully, and the target storage server identifier corresponding to the target virtual node storage range is obtained.

[0103] Among them, the target virtual node storage range in the optional embodiment refers to the virtual node storage range containing the virtual node storage value in the multiple virtual node storage ranges; it can be understood that the virtual node storage range containing the virtual node storage value means that the matching with the virtual node storage value is successful, and the virtual node storage range not containing the virtual node storage value means that the matching with the virtual node storage value is failed.

[0104] For example, taking the preceding Table 3 example as an example, for the first sub-time period, the virtual node storage value 430 is matched with the two virtual node storage ranges "[0, 511], [512, 1023]" corresponding to the target routing rule identifier 1 respectively. Obviously, the virtual node storage value 430 is in the virtual node storage range "[0, 511]" corresponding to the target routing rule identifier 1, and since the virtual node storage range "[0, 511]" corresponds to the storage server identifier "172.16.0.1", the target storage server identifier "172.16.0.1" is obtained. For the second sub-time period, the virtual node storage value 430 is matched with the three virtual node storage ranges "[0, 341], [342, 682], [683, 1023]" corresponding to the target routing rule identifier 2 respectively. Obviously, the virtual node storage value 430 is in the virtual node storage range "[342, 682]" corresponding to the target routing rule identifier 2, and since the virtual node storage range "[342, 682]" corresponds to the storage server identifier "172.16.0.2", the target storage server identifier "172.16.0.2" is obtained.

[0105] In this way, by implementing the optional embodiment, the virtual node storage value corresponding to the device identifier is matched with the virtual node storage range corresponding to each target routing rule respectively, which avoids the matching omission phenomenon and improves the accuracy of determining the target storage server identifier.

[0106] In some embodiments, the process of obtaining the virtual node storage value corresponding to the device identifier can include: obtaining the number of all virtual node storage values contained in a preset virtual node storage total range; wherein the preset virtual node storage total range is the union of different virtual node storage ranges; performing a hash operation on the device identifier to obtain a hash value; and performing a modulo operation on the hash value and the number to obtain the virtual node storage value.

[0107] That is, in the optional embodiment, the number of all virtual node storage values contained in the preset virtual node storage total range is obtained, then a hash operation is performed on the device identifier to obtain a hash value, and a modulo operation is performed on the hash value and the number, thereby obtaining the virtual node storage value.

[0108] As previously introduced in the embodiments, since the preset virtual node storage total range can be divided into a plurality of virtual node storage ranges, the union of the plurality of virtual node storage ranges is the preset virtual node storage total range.

[0109] In optional embodiments, the hash operation corresponds to at least one of a cryptographic hash algorithm (e.g., MD5, SHA-1, SHA-3, SHA-256, etc.), a non-cryptographic hash algorithm (e.g., MurmurHash, CRC series, etc.), a consistent hash algorithm (e.g., Ketama, Jump Consistent Hash, etc.), etc.

[0110] For example, assume that the total range of the preset virtual node storage is [0, 1023], i.e., the number of all virtual node storage values contained is 1024, and the device identifier is q, then the virtual node storage value Q = (hash(q)) / 1024.

[0111] In this way, by implementing optional embodiments, the virtual node storage value can be conveniently and accurately calculated by means of hash operation.

[0112] S204, access the target storage server access timing data corresponding to the target storage server identifier.

[0113] In the embodiments of the present application, after obtaining the target storage server identifier, the target storage server access timing data corresponding to the target storage server identifier can be accessed, thereby realizing the access of the timing data.

[0114] In an embodiment of the present application, the target storage server identifier includes a plurality of target storage server identifiers, wherein:

[0115] It is possible that in the stage of matching based on the request time period, a plurality of target routing rule identifiers are obtained, thereby finally obtaining a plurality of target storage server identifiers; for example, in the aforementioned Table 3 example, because the target routing rule identifier 1 and the target routing rule identifier 2 are obtained, correspondingly, the target routing rule identifier 1 and the target routing rule identifier 2 correspond to the target storage server identifier "172.16.0.1, 172.16.0.2", respectively.

[0116] It is possible that multiple target storage server identifiers are obtained in the stage of determining based on the device identifier, i.e., the case where multiple target storage server identifiers exist due to backup. For example, taking the example in Table 4 as an example, it is assumed that the virtual node storage value corresponding to the device identifier q is 430, and the request time period is "2024-12-10 to 2024-12-11", which matches the effective time "2024-12-10" successfully to obtain the target routing rule identifier 2. Among them, because the virtual node storage value 430 is in the virtual node storage range "[342, 682]" corresponding to the target routing rule identifier 2, and the virtual node storage range "[342, 682]" corresponds to the storage server identifier "172.16.0.3, 172.16.04", so the target storage server identifier "172.16.0.3, 172.16.04" is obtained.

[0117] Correspondingly, the process of accessing the timing data based on the target storage server identifier in S204 can include: if the access request is a write request, writing the timing data into the target storage servers corresponding to the multiple target storage server identifiers respectively; if the access request is a read request, selecting a main target storage server from the target storage servers corresponding to the multiple target storage server identifiers respectively, and reading the timing data from the main target storage server.

[0118] As described in the foregoing embodiments, the access includes at least one of writing and reading, etc. When the access is writing, the access request is a write request, and at this time the timing data can be written into the target storage servers corresponding to the multiple target storage server identifiers respectively, thereby ensuring the consistency of timing data writing. When the access is reading, the access request is a read request, and at this time a main target storage server can be selected from the target storage servers corresponding to the multiple target storage server identifiers respectively, and the timing data can be read from the main target storage server, thereby improving the efficiency of timing data reading.

[0119] In some embodiments, the process of selecting a main target storage server from the target storage servers corresponding to the multiple target storage server identifiers respectively can include: randomly selecting a main target storage server from the target storage servers corresponding to the multiple target storage server identifiers respectively.

[0120] That is, in the case where there are multiple target storage servers and timing data needs to be read in the optional embodiment, a target storage server is randomly selected as a main target storage server. In the case where the timing data fails to be read from the main target storage server, a target storage server can be randomly selected again as a new main target storage server, and so on, until the timing data is successfully read.

[0121] Thus, by implementing the optional embodiment, the main target storage server is randomly selected, and the flexibility of reading the time-series data is improved.

[0122] In some embodiments, the process of selecting the main target storage server from the plurality of target storage servers respectively corresponding to the target storage server identifiers can include: evaluating the storage service capabilities of the plurality of target storage servers respectively corresponding to the target storage server identifiers to obtain evaluation results respectively corresponding to the plurality of target storage servers; and selecting the main target storage server from the plurality of target storage servers based on the evaluation results respectively corresponding to the plurality of target storage servers.

[0123] That is, in the optional embodiment, when there are multiple target storage servers and the time-series data needs to be read, one target storage server is selected as the main target storage server based on the evaluation results of the storage service capabilities of the plurality of target storage servers respectively corresponding to the target storage server identifiers.

[0124] Thus, by implementing the optional embodiment, the main target storage server is selected, and the efficiency of reading the time-series data is improved.

[0125] Optionally, the evaluation result includes an evaluation score. Correspondingly, the process of evaluating the storage service capabilities of the plurality of target storage servers respectively corresponding to the target storage server identifiers to obtain evaluation results respectively corresponding to the plurality of target storage servers can include: for each target storage server, calculating an evaluation score based on the index value corresponding to the evaluation index. The evaluation index includes at least one of resource occupancy, network communication status, and service port availability. Correspondingly, the process of selecting the main target storage server from the plurality of target storage servers based on the evaluation results respectively corresponding to the plurality of target storage servers can include: selecting the target storage server with the maximum evaluation score from the plurality of target storage servers, and determining the selected target storage server as the main target storage server.

[0126] That is, in the optional embodiment, for each target storage server, an evaluation score is calculated based on the index value corresponding to the evaluation index, so as to obtain the evaluation result corresponding to each target storage server, and then the target storage server with the maximum evaluation score is selected from the plurality of target storage servers, and the selected target storage server is the main target storage server.

[0127] In optional embodiments, the evaluation indexes include, but are not limited to, at least one of resource occupancy, network communication status, and service port availability. The resource occupancy is used to reflect the consumption state of the underlying hardware resources of the storage server, and includes, but is not limited to, at least one of CPU occupancy (for example, CPU usage percentage, CPU load queue length, CPU context switching frequency, etc.), memory occupancy (for example, physical memory usage, Swap partition usage, memory page fault exception rate), disk input / output (Input Output, IO) (for example, disk read / write IOPS (i.e., number of I / O operations per second), disk throughput, I / O waiting queue length, disk response delay, etc.), and the like. The network communication status is used to reflect the connectivity and transmission quality of the network stack of the storage server, and includes, but is not limited to, at least one of Internet Control Message Protocol (ICMP) layer detection (i.e., network layer reachability), Transmission Control Protocol (TCP) layer detection (i.e., transport layer reliability), User Datagram Protocol (UDP) layer detection (i.e., application layer reachability), and the like. The service port availability is used to reflect the application server reachability and functional integrity of the storage server, and includes, but is not limited to, at least one of basic port detection (for example, TCP port scanning to verify the corresponding state), protocol level detection (for example, sending an application layer handshake request to verify the protocol response format), service level detection (for example, sending a simulated service request to verify the service response integrity), and the like.

[0128] In this way, by implementing optional embodiments, the storage service capability of each target storage server is quantitatively evaluated, the accuracy of selecting the main target storage server is improved, and the efficiency of reading time series data is further improved.

[0129] For example, the evaluation indexes include multiple indexes, and accordingly, the process of calculating the evaluation score based on the index values corresponding to the evaluation indexes can include: obtaining the index values corresponding to the multiple evaluation indexes respectively; and performing weighted summation operation on the index values corresponding to the multiple evaluation indexes respectively to obtain the evaluation score.

[0130] That is, in optional embodiments, when there are multiple evaluation indexes, the index values corresponding to the multiple evaluation indexes are subjected to weighted summation operation to obtain the evaluation score.

[0131] For example, A represents a specific value of resource occupancy, a represents the weight of resource occupancy, B represents a specific value of network communication status, b represents the weight of network communication status, C represents a specific value of service port availability, and c represents the weight of service port availability. Then, the evaluation score L = a x A + b x B + c x C.

[0132] In this way, by implementing the optional embodiment, the factors are comprehensively considered by means of the weighted summation operation, the accuracy of the storage service capability evaluation is improved, and the efficiency of the time series data reading is further improved.

[0133] In the embodiment of the present application, in the case of adding a new storage server, the time series data access based on the effective time and the request time is realized by adding the effective time in the routing rule, without migrating the already stored time series data, avoiding the time-consuming and resource-consuming of the migration process, and affecting the time series data access, thereby greatly improving the reliability of the time series data access.

[0134] The specific scenarios of the embodiments of the present application are described in detail as follows:

[0135] Please refer to Figure 3 , Figure 3 is a schematic diagram of a time series data access system according to an embodiment of the present application. The time series data access system in the embodiment of the present application includes a storage module, a query module, and a plurality of storage servers, wherein:

[0136] The storage module is configured to, when receiving a storage request for time series data of a device, determine a target storage server to which the time series data should be stored from the plurality of storage servers based on a pre-set routing rule table, and then store the time series data in the target storage server.

[0137] The query module is configured to, when receiving a query request for time series data of a device, determine a target storage server in which the time series data is stored from the plurality of storage servers based on a pre-set routing rule table, and then read the time series data from the target storage server.

[0138] Optionally, the routing rule table can be Table 3 or Table 4 in the foregoing embodiments.

[0139] Based on the foregoing time series data access system, as shown in Figure 4 The process of deriving the routing rule table at least includes S401 to S405, which are described in detail as follows:

[0140] S401, if a new storage server is detected, a routing rule identifier is generated, and an effective time corresponding to the routing rule identifier is generated.

[0141] Optionally, the process of generating the routing rule identifier can include: obtaining a maximum routing rule sequence number in the existing routing rule sequence numbers, and adding 1 to the maximum routing rule sequence number to obtain a target routing rule sequence number. At this time, the target routing rule sequence number is the routing rule identifier.

[0142] Optionally, the process of generating the effective time corresponding to the routing rule identifier can include: obtaining an addition time when the storage server is added, and determining a time later than the addition time as the effective time.

[0143] S402, obtain a plurality of virtual node storage ranges corresponding to the routing rule identifier, and obtain a plurality of storage server identifiers corresponding to the routing rule identifier.

[0144] Optionally, the process of obtaining the plurality of virtual node storage ranges corresponding to the routing rule identifier can include: determining a storage server used for backup from all storage servers after the storage server is added; calculating a division number based on the number of all storage servers and the number of storage servers used for backup; and equally dividing a preset virtual node storage total range based on the division number to obtain the plurality of virtual node storage ranges.

[0145] Optionally, the process of obtaining the plurality of storage server identifiers corresponding to the routing rule identifier can include: obtaining storage server identifiers respectively corresponding to all storage servers after the storage server is added. At this time, the storage server identifiers respectively corresponding to all storage servers are the plurality of storage server identifiers.

[0146] S403, associate the plurality of virtual node storage ranges with the plurality of storage server identifiers respectively to obtain a plurality of association groups, each association group including a virtual node storage range and at least one storage server identifier, different association groups including different virtual node storage ranges and different storage server identifiers.

[0147] S404, associate the effective time with the plurality of association groups respectively to generate a plurality of routing rules, each routing rule including the effective time and an association group, different routing rules including different association groups.

[0148] S405, generate a routing rule table based on the plurality of routing rules.

[0149] It can be understood that S401 to S404 are the generation process of a plurality of routing rules corresponding to one routing rule identifier, wherein when it is the first time to add a storage server (i.e., the storage server is from nothing to something), at this time, the routing rule table is created, when it is not the first time to add a storage server (i.e., the number of storage servers is increased), at this time, the original routing rule table is updated to obtain an updated routing rule table, and subsequently, the access of time series data is implemented based on the updated routing rule table.

[0150] In the case of adding a new storage server in the embodiments of the present application, the effective time is added in the routing rule, thereby providing strong support for subsequent time series data access, without the need to migrate the already stored time series data, avoiding time-consuming and resource-consuming migration process, and affecting time series data access and other phenomena, thereby greatly improving the reliability of time series data access.

[0151] Based on the routing rule table generated as described above, as shown in Figure 5 The storage process of the time series data at least includes S501 to S506, which are described in detail as follows:

[0152] S501, if a storage request for time series data of a device is received, the request time period and the device identifier of the device are obtained from the storage request.

[0153] S502, the request time period is matched with the effective time corresponding to each routing rule identifier contained in the routing rule table, and a target routing rule identifier with a matching success is obtained.

[0154] S503, the virtual node storage value corresponding to the device identifier is calculated.

[0155] Optionally, the process of calculating the virtual node storage value corresponding to the device identifier can include: obtaining the number of all virtual node storage values contained in a preset virtual node storage total range, the preset virtual node storage total range being the union of different virtual node storage ranges; performing a hash operation on the device identifier to obtain a hash value; and performing a modulo operation on the hash value and the number to obtain the virtual node storage value.

[0156] S504, the virtual node storage value is matched with the virtual node storage range contained in each target routing rule corresponding to the target routing rule identifier, and a target virtual node storage range with a matching success is obtained.

[0157] S505, the target storage server identifier corresponding to the target virtual node storage range is obtained.

[0158] S506, the time series data is stored in the target storage server corresponding to the target storage server identifier.

[0159] In some embodiments, when the target storage server identifier is multiple, the time series data is stored in each target storage server corresponding to the target storage server identifier.

[0160] The application embodiment can locate the target routing rule in effect in the time period to which the time series data belongs by means of matching between the requested time period in the storage request and the effective time of the routing rule in the routing rule table, and then determine the target storage server to which the time series data should be routed by means of the device identifier of the device in the storage request and the target routing rule, so as to store the time series data in the target storage server, and ensure the reliability of time series data storage.

[0161] Based on the routing rule table generated as described above, the query process of the time series data includes at least S601 to S606, and details are as follows: Figure 6

[0162] S601, if a query request for the time series data of the device is received, the request time period and the device identifier of the device are obtained from the query request.

[0163] S602, the request time period is matched with the effective time corresponding to each routing rule identifier contained in the routing rule table, and a target routing rule identifier with which the matching is successful is obtained.

[0164] S603, a virtual node storage value corresponding to the device identifier is calculated.

[0165] Optionally, the process of calculating the virtual node storage value corresponding to the device identifier can include: obtaining the number of all virtual node storage values contained in a preset virtual node storage total range, the preset virtual node storage total range being the union of different virtual node storage ranges; performing a hash operation on the device identifier to obtain a hash value; and performing a modulo operation on the hash value and the number to obtain the virtual node storage value.

[0166] S604, the virtual node storage value is matched with the virtual node storage range contained in each target routing rule corresponding to the target routing rule identifier, and a target virtual node storage range with which the matching is successful is obtained.

[0167] S605, a target storage server identifier corresponding to the target virtual node storage range is obtained.

[0168] S606, the time series data is queried from a target storage server corresponding to the target storage server identifier.

[0169] In some embodiments, when the target storage server identifier is multiple, a main target storage server is selected from the target storage servers corresponding to the multiple target storage server identifiers respectively, and the time series data is queried from the main target storage server.

[0170] ​Optionally, the process of selecting the main target storage server from the plurality of target storage servers corresponding to the respective target storage servers can include: for each target storage server, calculating an evaluation score based on the index value corresponding to the evaluation index, the evaluation index including at least one of resource occupancy rate, network communication state, and service port availability; and selecting the target storage server with the largest evaluation score from the plurality of target storage servers. At this time, the selected target storage server is the main target storage server.

[0171] Exemplarily, when there are multiple evaluation indexes, the index values corresponding to the multiple evaluation indexes are subjected to a weighted summation operation, thereby obtaining the evaluation score.

[0172] In the embodiment of the application, by matching the requested time period in the query request with the effective time of the routing rule in the routing rule table, the target routing rule effective in the time period to which the time series data belongs can be located, and then by means of the device identifier of the device in the query request and the target routing rule, the target storage server to which the time series data should be routed can be determined, thereby realizing the query of the time series data in the target storage server and ensuring the reliability of the query of the time series data.

[0173] Figure 7 is a block diagram of a time series data access device according to an embodiment of the application. As shown in Figure 7 the device includes:

[0174] The acquisition module 701 is configured to, if an access request for time series data of a device is received, acquire a request time period and a device identifier of the device from the access request.

[0175] The matching module 702 is configured to match the request time period with the effective time corresponding to each routing rule identifier, and obtain a target routing rule identifier that matches successfully. Wherein, a same routing rule identifier corresponds to a plurality of routing rules, and the plurality of routing rules are generated when a new storage server is added, and correspond to a same effective time and different storage server identifiers.

[0176] The determination module 703 is configured to determine a target storage server identifier based on the device identifier and the plurality of target routing rules corresponding to the target routing rule identifier.

[0177] The access module 704 is configured to access the time series data based on the target storage server corresponding to the target storage server identifier.

[0178] In an embodiment of the present application, based on the foregoing scheme, the plurality of routing rules further correspond to different virtual node storage ranges, one virtual node storage range corresponding to one storage server identifier; accordingly, the determining module 703 is specifically configured to: obtain a virtual node storage value corresponding to the device identifier; based on the virtual node storage value and the plurality of target routing rules corresponding to the target routing rule identifier, determine a target virtual node storage range containing the virtual node storage value corresponding to a target storage server identifier.

[0179] In an embodiment of the present application, based on the foregoing scheme, the determining module 703 is further specifically configured to: match the virtual node storage value with the virtual node storage range corresponding to each target routing rule to obtain a target virtual node storage range that matches successfully; and obtain a target storage server identifier corresponding to the target virtual node storage range.

[0180] In an embodiment of the present application, based on the foregoing scheme, the determining module 703 is further specifically configured to: obtain a quantity of all virtual node storage values contained in a preset virtual node storage total range; wherein the preset virtual node storage total range is a union of the different virtual node storage ranges; perform a hash operation on the device identifier to obtain a hash value; and perform a modulo operation on the hash value and the quantity to obtain the virtual node storage value.

[0181] In an embodiment of the present application, based on the foregoing scheme, the target storage server identifier includes a plurality of target storage server identifiers; accordingly, the access module 704 is specifically configured to: if the access request is a write request, write the time series data into target storage servers corresponding to the plurality of target storage server identifiers respectively; and if the access request is a read request, select a main target storage server from the target storage servers corresponding to the plurality of target storage server identifiers respectively, and read the time series data from the main target storage server.

[0182] In an embodiment of the present application, based on the foregoing scheme, the access module 704 is further specifically configured to: evaluate the storage service capabilities of the target storage servers corresponding to the plurality of target storage server identifiers respectively to obtain a plurality of evaluation results corresponding to the target storage servers respectively; and based on the evaluation results corresponding to the target storage servers respectively, select the main target storage server from the plurality of target storage servers.

[0183] In an embodiment of the present application, based on the foregoing scheme, the evaluation result comprises an evaluation score; accordingly, the access module 704 is further specifically configured to: for each target storage server, calculate the evaluation score based on the index value corresponding to the evaluation index; wherein the evaluation index comprises at least one of resource occupancy rate, network communication state, and service port availability; select the target storage server with the largest evaluation score from the plurality of target storage servers, and determine the selected target storage server as the main target storage server.

[0184] In an embodiment of the present application, based on the foregoing scheme, the evaluation index comprises a plurality; accordingly, the access module 704 is further specifically configured to: obtain the index value corresponding to each of the plurality of evaluation indexes; and perform weighted summation operation on the index value corresponding to each of the plurality of evaluation indexes to obtain the evaluation score.

[0185] In an embodiment of the present application, based on the foregoing scheme, the device further comprises a generation module configured to: if a new storage server is detected, generate a routing rule identifier and generate an effective time corresponding to the routing rule identifier; obtain a plurality of storage server identifiers corresponding to the routing rule identifier; wherein the plurality of storage server identifiers are storage server identifiers corresponding to all storage servers after the new storage server is added; associate the effective time with the plurality of storage server identifiers respectively to generate the plurality of routing rules; wherein each routing rule comprises the effective time and at least one storage server identifier, and different routing rules comprise different storage server identifiers.

[0186] In an embodiment of the present application, based on the foregoing scheme, the routing rule identifier comprises a target routing rule sequence number; accordingly, the generation module is specifically configured to: obtain the largest routing rule sequence number among the existing routing rule sequence numbers, and increase the largest routing rule sequence number by a specified unit to obtain the target routing rule sequence number; obtain the time when the new storage server is added, and determine the time when the new storage server is added or a time later than the time when the new storage server is added as the effective time.

[0187] In an embodiment of the present application, based on the foregoing scheme, the generating module is specifically configured to: divide the preset virtual node storage total range into a plurality of virtual node storage ranges; associate the plurality of virtual node storage ranges with the plurality of storage server identifiers respectively to obtain a plurality of association groups; wherein each association group includes one virtual node storage range and at least one storage server identifier, different association groups include different virtual node storage ranges and different storage server identifiers; associate the effective time with the plurality of association groups respectively to generate the plurality of routing rules; wherein each routing rule includes the effective time and one association group, and different routing rules include different association groups.

[0188] In an embodiment of the present application, based on the foregoing scheme, the generating module is further specifically configured to: determine a storage server used for backup from the all storage servers; calculate a division number based on the number of the all storage servers and the number of the storage server used for backup; and divide the preset virtual node storage total range equally based on the division number to obtain the plurality of virtual node storage ranges.

[0189] In the embodiment of the present application, in the case of adding a new storage server, the time sequence data access based on the effective time and the request time is realized by adding the effective time in the routing rule, without migrating the already stored time sequence data, avoiding the time-consuming and resource-consuming migration process and the influence on the time sequence data access, thereby greatly improving the reliability of the time sequence data access.

[0190] It should be noted that the apparatus provided by the foregoing embodiments and the method provided by the foregoing embodiments belong to the same concept, and the specific manner in which each module and unit performs operations has been described in detail in the method embodiments.

[0191] Embodiments of the present application also provide an electronic device, comprising: one or more processors; a memory for storing one or more computer programs, when the one or more computer programs are executed by the one or more processors, the electronic device implements the foregoing time sequence data access method.

[0192] Figure 8 FIG. 8 is a structural schematic diagram of a computer system of an electronic device suitable for implementing embodiments of the present application.

[0193] It should be noted that, Figure 8 The computer system 800 of the electronic device shown is only an example and should not limit the functions and use range of the embodiments of the present application.

[0194] As Figure 8As shown, the computer system 800 includes a central processing unit (CPU) 801 which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from the storage section 808 into a random access memory (RAM) 803, such as performing the methods in the above-described embodiments. In the RAM 803, various computer programs and data required for system operation are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0195] Connected to the I / O interface 805 are an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as necessary. A removable recording medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 810 as necessary, so that a computer program read therefrom is installed into the storage section 808 as necessary.

[0196] In particular, according to embodiments of the present application, the processes described above with reference to the flowcharts can be implemented as a computer program. For example, embodiments of the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer instructions for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via the communication section 809, and / or installed from the removable recording medium 811. When the computer program is executed by the central processing unit (CPU) 801, various functions defined in the systems of the present application are performed.

[0197] It should be noted that the computer-readable medium in the embodiments of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable medium may, for example, be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples of the computer-readable medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, the computer-readable medium can be any tangible medium containing or storing a computer program that can be used by or in connection with an instruction execution system, apparatus or device. In this application, the computer-readable signal medium can include a data signal carrying a computer program in a baseband or as a part of a carrier wave. Such a propagated data signal can take on various forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium that can transmit, propagate or transport a program for use by or in connection with an instruction execution system, apparatus or device. The computer program contained in the computer-readable medium can be transmitted or propagated using any suitable medium, including but not limited to wireless, wired, or the like, or any suitable combination thereof.

[0198] The flowcharts and block diagrams in the drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. Each block in the flowcharts or block diagrams can represent a module, a program segment, or a portion of code that contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks noted in succession can in fact be executed substantially concurrently or in the reverse order, depending on the functionality involved. It should also be noted that each block in the flowcharts or block diagrams, and combinations of blocks in the flowcharts or block diagrams, can be implemented by special-purpose hardware-based systems that perform the specified functions or operations, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0199] The units described in the embodiments of the present application can be implemented in the form of software, or can be implemented in the form of hardware, and the units described can also be arranged in a processor. In some cases, the names of the units do not constitute a limitation on the units themselves.

[0200] Another aspect of the present application also provides a computer readable medium having a computer program stored thereon, the computer program being executed by a processor to implement the timing data access method as described above. The computer readable medium can be included in the electronic device described in the above embodiments, or can exist separately and not be assembled into the electronic device.

[0201] Another aspect of the present application also provides a computer program product or computer program, which includes computer instructions stored in a computer readable medium. The processor of the electronic device reads the computer instructions from the computer readable medium, and the processor executes the computer instructions to enable the electronic device to perform the timing data access method provided in the above embodiments.

[0202] The above description is merely preferred exemplary embodiments of the present application, and is not intended to limit the implementation of the present application. Based on the main concept and spirit of the present application, those skilled in the art can easily make corresponding modifications or variations, and therefore the protection scope of the present application should be subject to the protection scope required by the claims.

Claims

1. A time-series data access method, characterized in that, include: If an access request for time-series data of a device is received, the requested time period and the device identifier of the device are obtained from the access request. The requested time period is matched with the effective time corresponding to each routing rule identifier to obtain the target routing rule identifier that is successfully matched; wherein, the same routing rule identifier corresponds to multiple routing rules, and the multiple routing rules are generated when a new storage server is added, and correspond to the same effective time but different storage server identifiers; Based on the device identifier and the multiple target routing rules corresponding to the target routing rule identifier, the target storage server identifier is determined; Access the time-series data based on the target storage server corresponding to the target storage server identifier.

2. The method according to claim 1, characterized in that, The multiple routing rules also correspond to different virtual node storage ranges, and one virtual node storage range corresponds to one storage server identifier; The step of determining the target storage server identifier based on the device identifier and multiple target routing rules corresponding to the target routing rule identifier includes: Obtain the virtual node storage value corresponding to the device identifier; Based on the virtual node storage value and the multiple target routing rules corresponding to the target routing rule identifier, the target storage server identifier corresponding to the target virtual node storage range containing the virtual node storage value is determined.

3. The method according to claim 2, characterized in that, The step of determining the target storage server identifier corresponding to the target virtual node storage range containing the virtual node storage value based on the virtual node storage value and multiple target routing rules corresponding to the target routing rule identifier includes: The virtual node storage value is matched with the virtual node storage range corresponding to each target routing rule to obtain the target virtual node storage range that is successfully matched; Obtain the target storage server identifier corresponding to the target virtual node storage range.

4. The method according to claim 2, characterized in that, The step of obtaining the virtual node storage value corresponding to the device identifier includes: Obtain the number of all virtual node storage values ​​included in the preset total virtual node storage range; wherein, the preset total virtual node storage range is the union of the different virtual node storage ranges; Perform a hash operation on the device identifier to obtain a hash value; The virtual node storage value is obtained by performing a modulo operation on the hash value and the quantity.

5. The method according to claim 1, characterized in that, The target storage server identifier includes multiple identifiers; accessing the time-series data based on the target storage server corresponding to the target storage server identifier includes: If the access request is a write request, then the time-series data is written to the target storage servers corresponding to the multiple target storage server identifiers. If the access request is a read request, then a primary target storage server is selected from the target storage servers corresponding to the plurality of target storage server identifiers, and the time-series data is read from the primary target storage server.

6. The method according to claim 5, characterized in that, The step of selecting the primary target storage server from the target storage servers corresponding to the plurality of target storage server identifiers includes: The storage service capabilities of the target storage servers corresponding to the multiple target storage server identifiers are evaluated to obtain the evaluation results for each of the multiple target storage servers. Based on the evaluation results corresponding to the multiple target storage servers, the primary target storage server is selected from the multiple target storage servers.

7. The method according to claim 6, characterized in that, The evaluation results include evaluation scores; the evaluation of the storage service capabilities of the target storage servers corresponding to the plurality of target storage server identifiers, to obtain evaluation results for each of the plurality of target storage servers, includes: For each target storage server, the evaluation score is calculated based on the corresponding indicator value of the evaluation indicator; wherein, the evaluation indicator includes at least one of resource utilization, network communication status, and service port availability; The step of selecting the primary target storage server from the plurality of target storage servers based on the evaluation results corresponding to the plurality of target storage servers includes: Select the target storage server with the highest evaluation score from the plurality of target storage servers, and determine the selected target storage server as the main target storage server.

8. The method according to claim 7, characterized in that, The evaluation indicators include multiple indicators; the calculation of the evaluation score based on the indicator values ​​corresponding to the evaluation indicators includes: Obtain the index values ​​corresponding to the multiple evaluation indicators respectively; The evaluation score is obtained by performing a weighted summation operation on the index values ​​corresponding to the multiple evaluation indicators.

9. The method according to any one of claims 1 to 8, characterized in that, Multiple routing rules corresponding to any given routing rule are obtained in the following way: If a new storage server is detected, a routing rule identifier is generated, along with the effective time corresponding to that routing rule identifier. Obtain multiple storage server identifiers corresponding to the routing rule identifier; wherein, the multiple storage server identifiers are the storage server identifiers corresponding to all storage servers after the addition of a storage server; The effective time is associated with the plurality of storage server identifiers to generate the plurality of routing rules; wherein each routing rule includes the effective time and at least one storage server identifier, and different routing rules include different storage server identifiers.

10. The method according to claim 9, characterized in that, The routing rule identifier includes the target routing rule sequence number; the process of generating the routing rule identifier and generating the effective time corresponding to the routing rule identifier includes: Obtain the largest routing rule sort number among the existing routing rule sort numbers, and increment the largest routing rule sort number by a specified unit to obtain the target routing rule sort number; The time of addition when a new storage server is added is obtained, and the time of addition or a time later than the time of addition is determined as the effective time.

11. The method according to claim 9, characterized in that, The step of associating the effective time with the plurality of storage server identifiers to generate the plurality of routing rules includes: The preset total virtual node storage range is divided into multiple virtual node storage ranges; The storage ranges of the multiple virtual nodes are associated with the identifiers of the multiple storage servers to obtain multiple association groups; wherein each association group includes a storage range of a virtual node and at least one identifier of a storage server, and different association groups include different storage ranges of virtual nodes and different identifiers of storage servers; The effective time is associated with each of the multiple association groups to generate the multiple routing rules; wherein each routing rule includes the effective time and an association group, and different routing rules include different association groups.

12. The method according to claim 11, characterized in that, The step of dividing the preset total virtual node storage range into multiple virtual node storage ranges includes: Determine the storage server to be used for backup from all of the aforementioned storage servers; The number of partitions is calculated based on the total number of all storage servers and the number of storage servers used for backup; The total storage range of the preset virtual nodes is equally divided based on the number of divisions to obtain the storage range of the multiple virtual nodes.

13. A timing data access device, characterized in that, include: The acquisition module is configured to, if it receives an access request for time-series data of a device, obtain the requested time period and the device identifier of the device from the access request; The matching module is configured to match the requested time period with the effective time corresponding to each routing rule identifier to obtain the target routing rule identifier that is successfully matched; wherein, the same routing rule identifier corresponds to multiple routing rules, and the multiple routing rules are generated when a new storage server is added, and correspond to the same effective time but different storage server identifiers; The determination module is configured to determine the target storage server identifier based on the device identifier and multiple target routing rules corresponding to the target routing rule identifier; The access module is configured to access the time-series data based on the target storage server corresponding to the target storage server identifier.

14. An electronic device, characterized in that, include: One or more processors; A memory for storing one or more computer programs, which, when executed by the electronic device, cause the electronic device to implement the timing data access method as described in any one of claims 1 to 12.

15. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the timing data access method as described in any one of claims 1 to 12.

16. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the timing data access method as described in any one of claims 1 to 12.