Data exporting method and device, electronic equipment and readable storage medium
Through precise query and storage space management, the metric data of the management platform is directly exported to the local storage space, which solves the problem of users' download time for too long and improves the ease of use and user experience of the management platform.
Patent Information
- Application Number
- CN202510443554.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-08-01
AI Technical Summary
The export file downloaded by users from the client is too long, especially when the number of management objects and metric values increase, the storage space requirements cannot be effectively predicted, resulting in an increase in download waiting time.
By obtaining the time period, objects and indicators in the export task, accurately query the indicator values and generate data, determine the target storage space based on the storage space occupancy, and directly export the data to the local storage space to avoid storage failure.
Reduces the time for users to wait for download files, improves the ease of use and user experience of the management platform, and avoids storage failures.
Smart Images

Figure CN120407159A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data technology, and in particular to a data export method, apparatus, electronic device and readable storage medium. Background Art
[0002] During the operation of the management platform, various indicators of the management object are regularly collected or obtained, and the indicator values of the management object are stored in the database of the management platform. When the user needs to export the indicator values of the management object, the user can create an export task through the client of the management platform, and the client sends the export task to the server. Based on the export task, the server queries the database, writes the corresponding indicator values queried from the database into the template file, and returns it to the client, so that the user can download it on the client.
[0003] However, when the number of management objects to be exported increases and the indicator values of each management object also increase accordingly, the exported file becomes larger, resulting in a longer time for the user to download the file from the client. Summary of the Invention
[0004] This application provides a data export method, apparatus, electronic device and readable storage medium to at least solve the problem that the time for the user to download the exported file from the client is relatively long in the related art.
[0005] This application provides a data export method, including: obtaining an export task, where the export task includes an export time period, multiple export objects, and export indicators corresponding to each export object; within the export time period, querying the indicator values corresponding to each export object under the export indicators to generate multiple pieces of indicator data; determining the target storage space occupancy for storing all the indicator data based on the storage space occupancy corresponding to each export object; determining a target storage space in the local storage space that is greater than or equal to the target storage space occupancy, and exporting the indicator data corresponding to each export object to the target storage space.
[0006] This application also provides a data export apparatus, including: a first obtaining module for obtaining an export task, where the export task includes an export time period, multiple export objects, and export indicators corresponding to each export object; a query module for querying the indicator values corresponding to each export object under the export indicators within the export time period to generate multiple pieces of indicator data; a first determining module for determining the target storage space occupancy for storing all the indicator data based on the storage space occupancy corresponding to each export object; an export module for determining a target storage space in the local storage space that is greater than or equal to the target storage space occupancy, and exporting the indicator data corresponding to each export object to the target storage space.
[0007] The present application also provides an electronic device, including: a memory for storing a computer program; a processor for implementing the steps of any of the above data export methods when executing the computer program.
[0008] The present application also provides a computer-readable storage medium storing a computer program, wherein the computer program implements the steps of any of the above data export methods when executed by a processor.
[0009] In the data export method provided by the present application, after obtaining the export time period, multiple export objects, and the export metrics corresponding to each export object in the export task, it is possible to accurately query the metric values corresponding to each export metric of each export object within the export time period, thereby generating multiple pieces of metric data corresponding to each export object. Then, based on the storage space occupancy corresponding to each export object, it is possible to accurately determine the target storage space occupancy for storing all the pieces of metric data corresponding to all export objects, avoiding the situation of not knowing how much storage space to reserve. After that, based on the target storage space occupancy, it is possible to determine from the local storage space the target storage space corresponding to the target storage space occupancy, avoiding the situation where the local storage space fails to provide the storage space corresponding to the target storage space occupancy, resulting in the failure to store the metric data corresponding to each export object. Finally, export the metric data corresponding to each export object to the target storage space, so that the user does not need to download the metric data corresponding to each export object on the client side, reducing the waiting time for the user to obtain each piece of metric data, thereby solving the problem that the time for the user to download the exported file from the client side is relatively long. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] To more clearly illustrate the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0011] Figure 1 It is a schematic diagram of the architecture of a management platform provided by an embodiment of the present application;
[0012] Figure 2 It is a schematic diagram of an interface for creating an export task provided by an embodiment of the present application;
[0013] Figure 3 It is a schematic flowchart of a data export method provided by an embodiment of the present application;
[0014] Figure 4 It is a schematic flowchart of another data export method provided by an embodiment of the present application;
[0015] Figure 5 Schematic flowchart of creating an export task provided by an embodiment of the present application;
[0016] Figure 6 Schematic flowchart of executing an export task provided by an embodiment of the present application;
[0017] Figure 7 Schematic structural diagram of a data export device provided by an embodiment of the present application;
[0018] Figure 8 Schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0019] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.
[0020] It should be noted that in the description of the present application, the terms "include", "comprise" or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0021] During the operation of the management platform, it will regularly collect or obtain the metric values of the management objects and display the historical curves corresponding to each management object on the client of the management platform for a period of time. Since the management platform can store the historical statistical data in the database of the management platform, the query interface of the server of the management platform can be queried through the client, so that the metric values of the corresponding management objects can be queried from the database of the management platform.
[0022] For example, when the user has a need to export the metric values of the management objects, the user can create an export task through the client of the management platform, and the client sends the export task to the server. Based on the export task, the server queries the database, writes the corresponding metric values queried from the database into the template file, and returns it to the client, so that the user can download it on the client.
[0023] When there are multiple management objects in the management platform, for example, there are multiple hard disks on a management device. According to the above method, after querying the metric values of the hard disks, each hard disk corresponds to an export file. The user saves the export file locally and then views the metric values of each hard disk. However, as the number of selected management objects for export increases and / or the export time grows, if the export continues from the client, there will be problems such as being unable to predict how much storage space to reserve, a relatively long waiting time for the user to download the file, being unable to predict the remaining export time, and the export progress. These problems will result in poor usability of the management platform and a poor user experience.
[0024] In view of this, the present application provides a data export method, device, electronic device, and readable storage medium to at least solve the problem in the related art that the time for the user to download the exported file from the client is relatively long. The data export method includes: obtaining an export task, where the export task includes an export time period, multiple export objects, and export metrics corresponding to each export object; within the export time period, querying the metric values corresponding to each export object under the export metrics to generate multiple pieces of metric data; based on the storage space occupancy corresponding to each export object, determining the target storage space occupancy for storing all the metric data; determining a target storage space from the local storage space that is greater than or equal to the target storage space occupancy, and exporting the metric data corresponding to each export object to the target storage space.
[0025] For the data export method provided by the present application, after obtaining the export time period, multiple export objects, and export metrics corresponding to each export object in the export task, it can accurately query the metric values corresponding to each export object under each export metric within the export time period, thereby generating multiple pieces of metric data corresponding to each export object. After that, based on the storage space occupancy corresponding to each export object, it can accurately determine the target storage space occupancy for storing all the metric data corresponding to all the export objects, avoiding not knowing how much storage space to reserve. Then, based on the target storage space occupancy, a target storage space that can provide the corresponding target storage space occupancy can be determined from the local storage space, avoiding the situation where the storage of the metric data corresponding to each export object fails because the local storage space cannot provide the corresponding storage space. Finally, the metric data corresponding to each export object is exported to the target storage space, so that the user does not need to download the metric data corresponding to each export object on the client, reducing the waiting time for the user to obtain the metric data, thereby solving the problem that the time for the user to download the exported file from the client is relatively long.
[0026] To enable those skilled in the art of this technical field to better understand the solution of the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0027] In combination with the specific application environment architecture or specific hardware architecture on which the execution of the data export method depends, the specific application environment architecture or specific hardware architecture is described herein.
[0028] The data export method provided in this application can be applied to a management platform. For example, Figure 1 As shown, the management platform includes a client and a server. Among them, the client and the server are connected through a network. When the user has an export requirement, the user can create an export task on the client. After creating the export task, the export task is sent to the server through the network. After receiving the export task, the server starts to query and export, that is, starts to execute the export task.
[0029] For example, Figure 2 As shown, the user can create an export task on the client. When creating the export task, specifically, the export objects 1, 2,..., n can be selected in the export object list. If the export object has a sub-list, the sub-objects can also be selected from the corresponding sub-list of the export object. For example, when the export object 1 is a server, the server has a sub-list (storage, ports, power supply, etc.), so the export object to be exported can also be selected from the sub-list of the server. In addition, when creating the export task, the start time, end time, and export date (XX year XX month XX day) of the export also need to be selected. For example, it can be selected from 14:00 to 15:00 in a day, and from XX year XX month 1st to XX year XX month 3rd, that is, the export time period is the index values between 14:00 and 15:00 every day from XX year XX month 1st to XX year XX month 3rd. Of course, the export time period can also not be selected. In the data export method of this application, the export time is the previous day of the moment when this export task is created by default. Finally, the export indicators corresponding to each export object are selected. For example, the export indicator 1 of export object 1, the export indicator 2 of export object 2,..., the export indicator n of export object n. In practical applications, one export object can correspond to one export indicator, and of course, it can also correspond to multiple export indicators. This application does not limit this.
[0030] According to an embodiment of the present invention, an embodiment of a data export method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0031] In this embodiment, a data export method is provided, which can be used in electronic devices such as mobile phones, tablets, computers, etc. Figure 3 It is a flowchart of the data export method according to an embodiment of the present invention. For example, Figure 3As shown, the process includes the following steps:
[0032] Step S301, obtain an export task, where the export task includes an export time period, multiple export objects, and export metrics corresponding to each export object.
[0033] An export task is to extract data from a storage system or application and save it in a specific format to another storage medium or location for further analysis, processing, sharing, archiving, etc. In this application, the export task can be set according to the actual export requirements of the user.
[0034] An export object can be an object for which corresponding metric values need to be exported. For example, the export object can be a server, or it can also be a hard disk, a port, etc. under the server. When the export object is a hard disk, the corresponding export metrics can be hard disk utilization, IOPS (Input / Output Operations Per Second), bandwidth, and latency, etc. When the export object is a port, the corresponding export metrics can be IOPS, bandwidth, and latency, etc.
[0035] The export time period can be a certain time period in a day, or it can be the time period corresponding to the entire day. For example, the export time period can be XX year XX month XX day, the export time period can also be from 14:00 to 15:00 on XX year XX month 1st, and the export time period can also be from 14:00 to 15:00 from XX year XX month 1st to XX year XX month 3rd. In practical applications, the export time period can also be from 14:00 to 15:00 on XX year XX month 1st and from 15:00 to 16:00 on XX year XX month 2nd. This application does not limit this, and the export time period can be flexibly set according to actual needs.
[0036] The export time periods and export metrics corresponding to each export object can be the same or different. For example, the export time period corresponding to export object 1 can be from 14:00 to 15:00 on XX year XX month 1st and the export metrics are export metric 1 and export metric 2; the export time period corresponding to export object 2 can be from 15:00 to 16:00 on XX year XX month 2nd and the export metrics are export metric 1 and export metric 2; the export time period corresponding to export object 3 can be from 15:00 to 16:00 on XX year XX month 2nd, and the export metrics can be export metric 3 and export metric 4. This application does not limit the export time periods and export metrics corresponding to each export object, and users can flexibly set export objects, export time periods, and export metrics according to actual export requirements or data statistics requirements.
[0037] For the acquisition of the export task, it can be obtained from the client, or of course, from various cloud servers. This application does not impose any restrictions on this and can be flexibly adjusted according to the actual application architecture or application requirements.
[0038] Step S302, within the export time period, query the metric values corresponding to each export object under the export metrics, and generate multiple metric data records.
[0039] The metric values corresponding to each export object under each export metric within the export time period are the actual values corresponding to each export metric at each export time point for each export object. The export time point is a time point within the export time period. For example, when the export object is a port, the export metric is bandwidth, and the export time period is from 14:00 to 15:00 on XX / XX / 1, then the metric value of the bandwidth is the actual value of the bandwidth at 14:00, 14:01, …, 15:00.
[0040] Within the export time period, querying the metric values corresponding to each export object under the export metrics means querying the metric values actually stored in the database. For example, if the export time period is from 14:00 to 15:00 on XX / XX / 1, and the actual bandwidth of the port (the export object) is stored as one metric value per minute, then there will be 60 metric values for the port's bandwidth within this export time period. If the port's latency is stored as one metric value per 5 minutes, then there will be 12 metric values for the port's latency within this export time period. After selecting the export time period and the export object, it is also possible to select the table to be queried from the database based on the export time period and the export object, and then query the metric values corresponding to each export object under each export metric within the export time period from this table. For example, if the export time period is from XX / XX / 1 to XX / XX / 2, for the metric values corresponding to each export metric of the hard disk, the corresponding tables in the database can be determined as DISK_XX / XX / 1 and DISK_XX / XX / 2.
[0041] For one metric data record, it can be the metric values of each export metric of each export object at the same export time point. For example, if the export object is the port of a server, the corresponding export metrics can be IOPS, bandwidth, and latency, and IOPS, bandwidth, and latency are all stored once per minute. Therefore, the metric values of the port's IOPS, bandwidth, and latency corresponding to each minute can be used as one metric data record.
[0042] Step S303, based on the storage space occupancy corresponding to each export object, determine the target storage space occupancy for storing all the metric data records.
[0043] The storage space occupancy corresponding to each exported object can be the average of the storage spaces occupied by multiple pieces of metric data corresponding to each exported object, or it can be an empirical value. For example, in the case where the storage space occupancy is the average of the storage spaces occupied by multiple pieces of metric data corresponding to each exported object, the process of determining the storage space occupancy can be as follows: Assume that the export time period is from 14:00 to 15:00 on XX year XX month 1st, the exported object is the port of the server, the exported metrics are IOPS, bandwidth, and latency, and IOPS, bandwidth, and latency are stored once per minute. Therefore, the IOPS, bandwidth, and latency of the port for each minute can be regarded as one piece of metric data, and there are a total of 60 pieces of metric data. The storage space occupancy corresponding to this port can be composed of the average of the storage spaces occupied by storing the metric values of these 60 IOPS, the average of the storage spaces occupied by storing the metric values of these 60 bandwidths, and the average of the storage spaces occupied by storing the metric values of these 60 latencies. In the case where the storage space occupancy is an empirical value, it can be estimated based on the storage spaces occupied by historical stored metric data corresponding to the exported object.
[0044] For determining the target storage space occupancy for storing all metric data based on the storage space occupancy corresponding to each exported object, the storage space occupancy corresponding to each exported object can be multiplied by the total number of pieces of metric data corresponding to each exported object to obtain the total target storage space occupancy.
[0045] Step S304, determine a target storage space in the local storage space that is greater than or equal to the target storage space occupancy, and export each piece of metric data corresponding to each exported object to the target storage space.
[0046] The local storage space refers to the space on a local device (such as a personal computer, mobile phone, server, etc.) used to store data. Determining a target storage space in the local storage space that is greater than or equal to the target storage space occupancy means, that is, selecting a target storage space from the local storage space that can provide the storage space corresponding to the target storage space occupancy. For example, if the storage space required for all pieces of metric data is 5MB, then a target storage space that can accommodate 5MB needs to be selected from the local storage space.
[0047] For a target storage space determined from the local storage space to be greater than or equal to the target storage space occupancy, after determining the target storage space occupancy, a notification for the client to select a target storage space corresponding to the target storage space occupancy can be sent, so that the user can select a target storage space from the local storage space. Of course, after determining the target storage space occupancy, the local storage space can also be traversed to select a target storage space from the local storage space, and the specific path where the target storage space is located can be sent to the client, so that the user can know the actual storage path corresponding to the target storage space.
[0048] Exporting the index data corresponding to each exported object to the target storage space can be directly exporting the index data corresponding to each exported object to the target storage space, or importing the index data corresponding to each exported object into a template file to generate a corresponding target file, and then sending the target file to the target storage space. This application does not limit this.
[0049] It should be noted that in this application, when the index values corresponding to each export index of each exported object during the export time period are queried, a download link is not generated on the client for the user to download. Instead, the index values corresponding to each export index of each exported object during the export time period are directly sent to the target storage space, so that the user does not need to download anymore.
[0050] The data export method provided in this embodiment, after obtaining the export time period, multiple exported objects, and the export indexes corresponding to each exported object in the export task, can accurately query the index values corresponding to each export index of each exported object during the export time period, so as to generate multiple index data corresponding to each exported object. Then, based on the storage space occupancy corresponding to each exported object, the target storage space occupancy for storing all the index data corresponding to all exported objects can be accurately determined, avoiding not knowing how much storage space to reserve. Then, based on the target storage space occupancy, a target storage space corresponding to the target storage space occupancy can be determined from the local storage space, avoiding the situation where the storage of the index data corresponding to each exported object fails because the local storage space cannot provide the storage space corresponding to the target storage space occupancy. Finally, the index data corresponding to each exported object is exported to the target storage space, so that the user does not need to download the index data corresponding to each exported object on the client, reducing the waiting time for the user to obtain each index data, thus solving the problem that the time for the user to download the exported file from the client is relatively long.
[0051] In this embodiment, a data export method is provided, which can be used in electronic devices, such as mobile phones, tablets, computers, etc. Figure 4is a flowchart of the data export method according to an embodiment of the present invention. As Figure 4 shown, the process includes the following steps:
[0052] Step S401, obtain an export task, where the export task includes an export time period, multiple export objects, and export metrics corresponding to each export object. For details, please refer to Figure 3 step S301 of the embodiment shown herein, which will not be elaborated herein.
[0053] Step S402, within the export time period, query the metric values corresponding to each export object under the export metrics, and generate multiple pieces of metric data.
[0054] Specifically, the above step S402 includes:
[0055] Step S4021, obtain a query rule and a topology map corresponding to each export object.
[0056] The query rule is used to define a series of conditions and criteria for extracting which data from the data source and how to extract the data. In practical applications, the query rule includes, but is not limited to, exact query, fuzzy query, and association query, etc.
[0057] The exact query is a query method that requires strict matching of specific conditions in data retrieval or query operations. Specifically, the specific rules of the exact query can be set in the export task configuration interface. For example, the export threshold of the export metric can be set, and the metric data greater than or less than the export threshold can be filtered during export, and at the same time, the time period when the export metric exceeds or is lower than the export threshold can be restricted. The export threshold of the maximum value (MAX) or minimum value (MIN) or average value (AVG) or sum (SUM) of any export metric can also be set, and at the same time, the time period when the metric value of the export metric exceeds or is lower than the export threshold can be restricted. Multiple threshold rules can also be set simultaneously, and the logical relationships (AND, OR, NOT) between multiple rules can be established. For example, the ports with IOPS greater than 10,000 and (AND) latency greater than 3 seconds between 2:00 and 3:00 every day. Another example is the hard disks with IOPS greater than 10,000 or (OR) bandwidth greater than 2000 MBPS and (AND) duration greater than 30 minutes; another example is the export device with an average CPU utilization rate not exceeding 5% (NOT).
[0058] The fuzzy query is a query method that allows approximate matching between the query conditions and the data in the data source during data retrieval. For example, the data of all volumes whose volume names contain "windows" in the last 1 day. Another example is the utilization data of hard disks whose hard disk types start with ST in the hard disks.
[0059] It should be understood that the management platform will automatically convert the export tasks set by the user in the export task configuration interface and the selected query rules into corresponding logical rules (such as AND, OR, NOT, etc.), and then query the database of the management platform.
[0060] Step S4022, if the query rule is an association query, use the topological relationships in the topological diagrams corresponding to each export object to determine the associated objects associated with each export object.
[0061] An association query exports the data of the management objects associated with the export objects together. For example, when the user selects an association query, the management platform will query the topological relationships of the physical connections of the selected export objects, and also export the index values of the export indexes of the associated associated objects during the export time period. For example, the fiber optic port 1 of the storage is connected to the fiber optic switch port 2, the fiber optic switch port 3 is connected to the port 4 of the host, and they are in the same zone. Therefore, when the export object selects the fiber optic port 1 of the storage and enables the associated export, the management platform will also export the index values of the export indexes of the fiber optic switch port 2, the fiber optic switch port 3, and the port 4 of the host during the export time period.
[0062] In actual applications, when the user sets the query rules, the user can set both an exact query and an association query, or set both a fuzzy query and an association query at the same time.
[0063] Step S4023, during the export time period, query the index values corresponding to each export object under the export index and the index values corresponding to each associated object under the export index from the database, and generate multiple pieces of index data corresponding to each export object and multiple pieces of index data corresponding to each associated object.
[0064] When performing an association query, the index values corresponding to each associated object under each export time period and each export index will be exported together. Therefore, at this time, the user does not need to set the export time period and export index of the associated object. Of course, based on the user's export requirements, statistical requirements, or requirements for analyzing error reasons, the user can also set the export indexes and export time periods for each associated object, which is convenient for the user to perform fault analysis or performance analysis, etc. based on the exported data.
[0065] Step S403, based on the storage space occupancy corresponding to each export object, determine the target storage space occupancy for storing all index data. For details, please refer to Figure 3 Step S303 of the illustrated embodiment, which will not be elaborated here.
[0066] Step S404: Determine a target storage space greater than or equal to the target storage space occupancy from the local storage space, and export the metric data corresponding to each export object to the target storage space. For details, please refer to Figure 3 Step S304 of the embodiment shown, which will not be elaborated here.
[0067] The data export method provided in this embodiment, after obtaining the export time period, multiple export objects, and the export metrics corresponding to each export object in the export task, can accurately query the metric values corresponding to each export metric of each export object within the export time period and the metrics corresponding to each export metric of each associated object within the export time period based on the query rule and the topology diagram corresponding to each export object, so as to generate multiple metric data corresponding to each export object and multiple metric data corresponding to each associated object. Then, based on the storage space occupancy corresponding to each export object, the target storage space occupancy for storing all the metric data corresponding to all export objects can be accurately determined, avoiding the situation of not knowing how much storage space to reserve. After that, based on the target storage space occupancy, a target storage space corresponding to the target storage space occupancy can be determined from the local storage space, avoiding the situation where the storage space corresponding to the target storage space occupancy cannot be provided by the local storage space, resulting in the failure to store the metric data corresponding to each export object. Finally, export the metric data corresponding to each export object to the target storage space, so that the user does not need to download the metric data corresponding to each export object on the client side, reducing the waiting time for the user to obtain each metric data, thus solving the problem that the time for the user to download the exported file from the client side is relatively long.
[0068] In an optional embodiment, determining the target storage space occupancy for storing all metric data based on the storage space occupancy corresponding to each export object includes: determining an export sub-time period and the number of export days from the export time period; obtaining the total number of metric data of each export object within the export sub-time period, obtaining the first total number; using the average value of the storage space occupied by the multiple metric data of each export object within the export sub-time period to determine the storage space occupancy of each export object; and determining the product of the storage space occupancy of each export object, the first total number, and the number of export days as the target storage space occupancy.
[0069] In the actual application process, the export time period can be from 14:00 to 15:00 on a certain date from XX year XX month 1st to XX year XX month 3rd. Thus, the export sub-time period can be from 14:00 to 15:00, and the number of export days can be 3 days.
[0070] For example, when the exported object is only a port and the exported metrics are only bandwidth and latency, the metric values of the bandwidth and the metric values of the latency of the port between 14:00 and 15:00 can be exported together, and the total number of the metric values of the bandwidth and the metric values of the latency can be counted. If there is one metric value of the bandwidth corresponding to one minute and one metric value of the latency corresponding to one minute, then there will be 60 metric values of the bandwidth and 60 metric values of the latency between 14:00 and 15:00, that is, there are 60 pieces of metric data for the exported object of the port. At this time, the average storage space occupied by storing one metric value of the bandwidth is obtained by the ratio of the storage space occupied by 60 metric values of the bandwidth to 60, and the average storage space occupied by storing one metric value of the latency is obtained by the ratio of the storage space occupied by 60 metric values of the latency to 60, and the sum of the average storage space occupied by storing one metric value of the bandwidth and the average storage space occupied by storing one metric value of the latency constitutes the storage space occupancy of the port. In this way, it is equivalent to determining the storage space occupancy of one piece of metric data. Then, multiplying the storage space occupancy of one piece of metric data, the total number of the metric data of the port (60), and the number of exported days (3 days) can accurately calculate the target storage space occupancy.
[0071] In the above embodiment, the target storage space occupancy is obtained by multiplying the storage space occupancy of one piece of metric data, the first total number, and the number of exported days, so that the target storage space occupancy can be accurately and quickly determined.
[0072] For example, in the case where precise query, fuzzy query, and association query are not selected and the export task does not include the limitation of the export time period within one day, the calculation method of the target storage space occupancy at this time is as follows: Assume that a total of N export devices are selected, the number of exported objects selected by the first export device is d1, the number of exported objects selected by the second export device is d2,..., the number of exported objects selected by the Nth export device is dn, the number of exported days corresponding to the export time period is T, and the number of records of each export device per day is R (assuming one record per minute, then the total number of metric data R is 1440). For each selected exported object, calculate the average storage space occupied by each exported metric of all records of the exported object on that day in the daily data table, and export it as one piece of metric data. Then, there are d1 + d2 +... + dn pieces of metric data in the daily table, and there are T×(d1 + d2 +... + dn) pieces of metric data in T days. Calculate the storage space occupied by the d1 + d2 +... + dn pieces of metric data in T days as P, then the target storage space occupied by exporting all pieces of metric data is R×P, that is, the target storage space occupancy is R×P.
[0073] For another example, when precise query or fuzzy query is selected and the export time period includes a time period within one day (i.e., there is a sub-export time period), since the indicator values in the database will be filtered at this time, there may be no indicator values that meet the filtering conditions of the sub-export time period in the data of a certain day, that is, the number of indicator data of each export object is no longer fixed at R. At this time, the calculation method of the target storage space occupancy is as follows: Suppose a total of N export devices are selected, the number of export objects selected by the first export device is d1, the number of export objects selected by the second export device is d2,..., the number of export objects selected by the Nth export device is dn, the number of export days across the export time period is T, and the sub-export time period is t, then the number of records per device per day is Rt. If the sub-export time period is from 2:00 to 3:00, then the total number of indicator data per day is 60. For each selected export object, calculate the average value of the indicator values of the records in the sub-export time period of that day in the daily data table and export it as an indicator data. There are T records in T days, and the total number of indicator data of d1 + d2 +... + dn export objects is T×(d1 + d2 +... + dn). Calculate the storage space occupied by these indicator data as P, then the target storage space occupied by exporting all indicator data is (d1 + d2 +... + dn)×T×Rt = Rt×P.
[0074] In the case where the query rule is an association query, the indicator values of the export indicators of the associated objects associated with each export object will be exported together. Therefore, when calculating the target storage space occupancy, it is also necessary to calculate the storage space occupied by the indicator values of the export indicators of the associated objects. Thus, in an optional embodiment, in order to accurately determine the target storage space occupancy, based on the storage space occupancy corresponding to each export object, determining the target storage space occupancy for storing all indicator data includes: determining a sub-export time period and the number of export days from the export time period; obtaining the total number of indicator data of each export object in the sub-export time period to obtain a first total number; obtaining the total number of indicator data of each associated object in the sub-export time period to obtain a second total number; using the average value of the storage space occupied by multiple indicator data of each export object in the sub-export time period to determine the storage space occupancy of each export object; using the average value of the storage space occupied by multiple indicator data of each associated object in the sub-export time period to determine the storage space occupancy of each associated object; multiplying the storage space occupancy of each export object, the first total number, and the number of export days to determine a first storage space occupancy; multiplying the storage space occupancy of each associated object, the second total number, and the number of export days to determine a second storage space occupancy; and adding the first storage space occupancy and the second storage space occupancy to determine the target storage space occupancy.
[0075] For example, when the associated query is selected and there is no limit on the export time period within a day in the export task, the storage space occupied by the associated objects needs to be added to the calculation of the target storage occupancy. Assume that the number of associated objects for each exported object in d1 is g1, the number of associated objects for each exported object in d2 is g2, …, and the number of associated objects for each exported object in dn is gn. The number of export days spanned by the export time period is T, and the number of records per export device per day is R (assuming one record per minute, the total number of index data records R is 1440). For each selected exported object, calculate the average storage space occupied by each export index of all records of the exported object on each day in the daily data table, and export it as a piece of index data. Then, there are d1 + d2 + … + dn pieces of index data in the daily table, and there are T×(d1 + d2 + … + dn) pieces of index data in T days. Calculate the storage space occupied by the d1 + d2 + … + dn pieces of index data in T days as P1. For each selected associated object, calculate the average storage space occupied by each export index of all records of the exported object on each day in the daily data table, and export it as a piece of index data. Then, there are g1 + g2 + … + gn pieces of index data in the daily table, and there are T×(g1 + g2 + … + gn) pieces of index data in T days. Calculate the storage space occupied by the g1 + g2 + … + gn pieces of index data in T days as P2. Thus, the target storage occupancy is (P1 + P2)×T.
[0076] It should be understood that when the associated query is selected and the export time period includes a time period within a day (i.e., there is an export sub - time period), the method for calculating the target storage occupancy is similar to the method without selecting the associated query described above, and will not be elaborated here one by one.
[0077] In an alternative embodiment, exporting the index data corresponding to each exported object to the target storage space includes: determining the folder - level structure corresponding to each exported object based on a pre - set storage rule; sending the folder - level structure to the client, and the client creates a corresponding target folder in the target storage space based on the folder - level structure; importing the multiple pieces of index data corresponding to each exported object into a template file respectively to generate multiple target files; and sending the multiple target files to the corresponding target folder in the target storage space.
[0078] Storage rules refer to a series of pre-set guidelines and specifications in the process of data storage and management to ensure the orderly storage, convenient retrieval, and maintenance of data. For example, the export device includes a first export device and a second export device. The first export device includes a first export object and a second export object. The second export device includes a third export object and a fourth export object. The corresponding folder hierarchy structures can be \\First Export Device\\First Export Object, \\First Export Device\\Second Export Object, \\Second Export Device\\Third Export Object, and \\Second Export Device\\Fourth Export Object respectively. That is, the folder corresponding to the first export device includes the folder of the first export object and the folder of the second export object, and the folder of the second export device includes the folder of the third export object and the folder of the fourth export object. Another example is that when the export object is a hard disk and the export time period is January 1, 2025, and January 2, 2025, Server A will execute the task of exporting the disk_20250101 table, and Server B will execute the task of exporting the disk_20250102 table. Among them, the export objects executed by Server A are Hard Disk 1 and Hard Disk 2 under Storage 1, that is, two hard disk objects, disk1 and disk2, including Storage 1, which will be stored in / 20250101 / Storage 1 / Hard Disk / disk1.csv and disk2.csv respectively; the export objects executed by Server B are Hard Disk 1 and Hard Disk 2 under Storage 1, that is, two hard disk objects, disk1 and disk2, including Storage 1, which will be stored in / 20250102 / Storage 1 / Hard Disk / disk1.csv and disk2.csv respectively. Among them, it should be noted that the export of disk1 and disk2 on the same server is also performed in parallel.
[0079] After starting the export task, the management platform performs parallel and load balancing of the export task through multiple servers within the local area network. That is, the tasks are allocated according to the number of existing servers according to the database schedule. For example, Server A exports the metric values on January 1 of XX year and XX month, and Server B exports the metric values on January 2 of XX year and XX month. Another example is that on a single server, the export metrics corresponding to each export object can be exported in parallel. Since importing all the metric data into the same template file will cause very difficult reading and writing, the data is also exported in parallel on the same server during the export task, that is, the metric data of different export objects are written into different template files respectively.
[0080] Optionally, after the server sends multiple target files to the target storage space, the multiple target files on the server can be deleted, which can save the storage space on the server.
[0081] In the above embodiments, based on the pre-set storage rules, the folder hierarchy structure corresponding to each export object is determined, so that the target folders for each export object can be created in the target storage space, avoiding the situation where the index data of multiple export objects are placed in the same folder, resulting in a large and messy content. In addition, the multiple index data corresponding to each export object are respectively imported into the template file, avoiding writing the multiple index data of multiple export objects into the same template file, which may lead to slow writing of the target file and difficulty in statistics for users.
[0082] In the actual application process, the number of index data corresponding to each export object may be different, or the size of the occupied storage space may be different, which may lead to different times for generating and transmitting the target files of each export object. Therefore, the remaining export time and export progress are values that change continuously with time. Therefore, in an alternative embodiment, the data export method further includes: during the process of exporting the index data to the target storage space, importing the multiple index data corresponding to the i-th export object into the template file to generate the i-th target file, obtaining the generation time of the i-th target file, where the generation time is the time between starting to import the multiple index data of the i-th export object into the template file and storing the generated i-th target file in the target storage space, and i is a positive integer; obtaining the total number of the index data corresponding to each export object within the export time period to obtain the third total number; obtaining the total number of the index data corresponding to each associated object within the export time period to obtain the fourth total number; obtaining the total number of the index data in the i-th target file to obtain the fifth total number; using to determine the total export time, where T is used to represent the total export time, M is used to represent the sum of the third total number and the fourth total number, and Δt i , i , i ,
[0083] , , , , is used to represent the generation time of the i-th target file, m i is used to represent the fifth total number, m1 is used to represent the total number of the index data in the target file corresponding to the first export object, and m2 is used to represent the total number of the index data in the target file corresponding to the second export object; using to determine the remaining export time, where T - Δt i is used to represent the remaining export time corresponding to after exporting the i-th target file to the target storage space; using to determine the export progress, where S is used to represent the export progress corresponding to after exporting the i-th target file to the target storage space.
[0083] It should be noted that i is a positive integer, and i can start from 1 and take values up to N, where N is the total number of target files.
[0084] For example, during the process of the server writing the metric data corresponding to each export object into the template file, the client listens for the output events of a single target file on the server. Record the start time t0 when the server imports multiple metric data of the first export object into the template file. When the first target file on the server is finished being written, the server sends a notification to the client that the first target file has been written successfully. The notification content includes the file storage path and file name of the first target file on the server, etc. After receiving the notification, the client creates a subfolder under the client's file storage path and sends a message to the server that the first target file can start being transferred. After receiving the message, the server starts sending the first target file to the client. After receiving the first target file, the client records the save time of the first target file and the total number of metric data in the first target file. Assume that the time t1 when the first target file is saved to the target storage space and the total number of metric data in the first target file is m1. Assume that the total number of metric data for this export task is M, and the generation time of the first target file is Δt1 = t1 - t0. Therefore, after the first target file is output, when calculating the total export time as T, there is Δt1 / T = m1 / M, that is, T = M×Δt1 / m1. Then the remaining time is updated to T - Δt1 = (M - m1)×Δt1 / m1, and the export progress is the total number of items in the first target file and the total number of metric data for this export task, that is, m / M. By analogy, after the i-th target file is generated, assume that the output completion time of the i-th target file is ti, and the total number of items in the i-th target file is mi. Then there is Δti = ti - t0, Δti / T = (m1 + m2 + … + mi) / M, that is, T = M×Δti / (m1 + m2 + … + mi). That is, the remaining export time is updated to T - Δti = (M - m1 - m2 - … - mi)×Δti / (m1 + m2 + … + mi), and the export progress is updated to (m1 + m2 + … + mi) / M.
[0085] It should be noted that for the generation time of a target file, it includes the import time and the transmission time. Among them, the import time can be the time period from the start of importing the corresponding metric data into the template file until all the corresponding metric data is imported into the template. The transmission time can be the time period from when the server starts sending the target file to the target storage space until the target file is successfully sent to the target storage space.
[0086] In some alternative embodiments, the data export method further includes: sending the remaining export time and the export progress to the client, so that the client can display the remaining export time and the export progress on the graphical user interface, which facilitates the user to timely know the remaining export time and the export progress of the current export task, and provides a better user experience and better usability of the management platform.
[0087] During the export process, the remaining export time and the export progress can be notified to the client in real time through WebSocket (a protocol for full-duplex communication over a single TCP connection). Of course, in practical applications, it is not limited to notifying the client of the remaining export time and the export progress in real time through WebSocket. Long polling or long connection can also be used to notify the client of the remaining export time and the export progress in real time.
[0088] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method.
[0089] To facilitate the understanding of the data export method of the present application, the following will be combined with Figure 5 and Figure 6 to further introduce the data export method of the present application.
[0090] As Figure 5 shown, it is a schematic flowchart of creating an export task in the data export method of the present application. This flowchart includes steps S501 to S511.
[0091] Step S501, start.
[0092] Step S502, create an export task. For example, an export task can be created in the export task configuration interface.
[0093] Step S503, select the export objects and the export metrics corresponding to each export object.
[0094] Step S504, determine whether to enable associated query. If the associated query is enabled, determine the associated objects related to each export object, and then execute step S505, as well as steps S506 to S511; if the associated query is not enabled, directly execute step S505, as well as steps S506 to S511.
[0095] Step S505, add the associated objects related to each export object to the export object list.
[0096] Step S506, select the start time and end time of the export.
[0097] Step S507, determine whether to perform an exact query. If the user selects an exact query, execute steps S509 to S511; if the user does not select an exact query, execute steps S508 to S511.
[0098] Step S508, determine whether to perform a fuzzy query. If the user selects a fuzzy query, execute steps S509 to S511. If the user does not select a fuzzy query, execute steps S509 to S511 according to the default query rule.
[0099] Step S509, according to the query rule, export the index values corresponding to each export object under the export index, generate multiple pieces of index data corresponding to each export object, and calculate the occupied amount of the target storage space. It should be noted that in this step, if neither step S507 nor step S508 selects the corresponding query rule, the query starts according to the default query rule of the management platform. If either step S507 or step S508 selects the corresponding query rule, the query starts according to the query rule selected by the user.
[0100] Step S510, after calculating the occupied amount of the target storage space, determine the target storage space in the local storage space that is greater than or equal to the occupied amount of the target storage space.
[0101] Step S511, end.
[0102] As Figure 6 shown, it is a flow diagram of executing an export task in the data export method of this application. This flow diagram includes steps S601 to S608.
[0103] Step S601, click the button to start the export task on the management platform.
[0104] Step S602, query the index values of each export object under each export index within the export time period from the database, and generate multiple pieces of index data corresponding to each export object.
[0105] Step S603, write the index values of each export object under each export index within the export time period to the template file on the server side to generate multiple target files.
[0106] Step S604, send multiple target files to the target storage space.
[0107] Step S605, during the process of sending multiple target files to the target storage space, calculate the remaining export time and the export progress.
[0108] Step S606: Send the remaining export time and export progress to the client via WebSocket, which facilitates the user to know the execution progress of the current export task in a timely manner.
[0109] Step S607: Determine whether the export progress reaches 100%. If the export progress does not reach 100%, repeat steps S603 to S608; if the export progress reaches 100%, execute step S608.
[0110] Step S608: The user views the exported target files in the target storage space.
[0111] An embodiment of the present application further provides a data export device, as Figure 7 shown, the device includes:
[0112] The first acquisition module 701 is configured to acquire an export task, where the export task includes an export time period, a plurality of export objects, and export metrics corresponding to each export object;
[0113] The query module 702 is configured to query the metric values corresponding to each export object under the export metric within the export time period, and generate multiple pieces of metric data;
[0114] The first determination module 703 is configured to determine the target storage space occupancy for storing all the metric data based on the storage space occupancy corresponding to each export object;
[0115] The export module 704 is configured to determine a target storage space in the local storage space that is greater than or equal to the target storage space occupancy, and export the metric data corresponding to each export object to the target storage space.
[0116] In some alternative embodiments, the query module includes a first acquisition sub-module, a first determination sub-module, and a first generation sub-module. Among them, the first acquisition sub-module is configured to acquire a query rule and the topology diagrams corresponding to each export object; the first determination sub-module is configured to, if the query rule is an association query, use the topological relationships in the topology diagrams corresponding to each export object to determine the associated objects associated with each export object; the first generation sub-module is configured to query the metric values corresponding to each export object under the export metric, and the metric values corresponding to each associated object under the export metric, from the database within the export time period, and generate multiple pieces of metric data corresponding to each export object and multiple pieces of metric data corresponding to each associated object.
[0117] In an alternative embodiment, the first determination module includes a second determination sub-module, a second acquisition sub-module, a third determination sub-module, and a fourth determination sub-module. Among them, the second determination sub-module is used to determine an export sub-time period and the number of export days within the export time period; the second acquisition sub-module is used to acquire the total number of index data of each export object within the export sub-time period to obtain a first total number; the third determination sub-module is used to determine the storage space occupancy of each export object by using the average value of the storage space occupied by multiple index data of each export object within the export sub-time period; the fourth determination sub-module is used to determine the target storage space occupancy by multiplying the storage space occupancy of each export object, the first total number, and the number of export days.
[0118] In an alternative embodiment, the first determination module further includes a fifth determination sub-module, a third acquisition sub-module, a fourth acquisition sub-module, a sixth determination sub-module, a seventh determination sub-module, an eighth determination sub-module, a ninth determination sub-module, and a tenth determination sub-module. Among them, the fifth determination sub-module is used to determine an export sub-time period and the number of export days within the export time period; the third acquisition sub-module is used to acquire the total number of index data of each export object within the export sub-time period to obtain a first total number; the fourth acquisition sub-module is used to acquire the total number of index data of each associated object within the export sub-time period to obtain a second total number; the sixth determination sub-module is used to determine the storage space occupancy of each export object by using the average value of the storage space occupied by multiple index data of each export object within the export sub-time period; the seventh determination sub-module is used to determine the storage space occupancy of each associated object by using the average value of the storage space occupied by multiple index data of each associated object within the export sub-time period; the eighth determination sub-module is used to determine the first storage space occupancy by multiplying the storage space occupancy of each export object, the first total number, and the number of export days; the ninth determination sub-module is used to determine the second storage space occupancy by multiplying the storage space occupancy of each associated object, the second total number, and the number of export days; the tenth determination sub-module is used to determine the target storage space occupancy by adding the first storage space occupancy and the second storage space occupancy.
[0119] In an alternative embodiment, the export module includes an eleventh determination sub-module, a first sending sub-module, a second generating sub-module, and a second sending sub-module. Among them, the eleventh determination sub-module is used to determine the folder hierarchy structure corresponding to each export object based on a pre-set storage rule; the first sending sub-module is used to send the folder hierarchy structure to the client, and the client creates a corresponding target folder in the target storage space based on the folder hierarchy structure; the second generating sub-module is used to import the multiple index data corresponding to each export object into a template file respectively to generate multiple target files; the second sending sub-module is used to send the multiple target files to the corresponding target folder in the target storage space.
[0120] In an alternative embodiment, the data export device further includes an import module, a second acquisition module, a third acquisition module, a fourth acquisition module, a second determination module, a third determination module, and a fourth determination module. Among them, the import module is configured to import multiple pieces of metric data corresponding to the i-th export object into a template file during the process of exporting the metric data to the target storage space, generate the i-th target file, and obtain the generation time of the i-th target file. The generation time is the time between starting to import multiple pieces of metric data of the i-th export object into the template file and storing the generated i-th target file in the target storage space, where i is a positive integer; the second acquisition module is configured to obtain the total number of pieces of metric data corresponding to each export object within the export time period to obtain the third total number; the third acquisition module is configured to obtain the total number of pieces of metric data corresponding to each associated object within the export time period to obtain the fourth total number; the fourth acquisition module is configured to obtain the total number of pieces of metric data in the i-th target file to obtain the fifth total number; the second determination module is configured to use to determine the total export time, where T is used to represent the total export time, M is used to represent the sum of the third total number and the fourth total number, and Δt i is used to represent the generation time of the i-th target file, and m i is used to represent the fifth total number, m1 is used to represent the total number of pieces of metric data in the target file corresponding to the first export object, and m2 is used to represent the total number of pieces of metric data in the target file corresponding to the second export object; the third determination module is configured to use to determine the remaining export time, where T - Δt i is used to represent the remaining export time corresponding to after exporting the i-th target file to the target storage space; the fourth determination module is configured to use to determine the export progress, where S is used to represent the export progress corresponding to after exporting the i-th target file to the target storage space.
[0121] In some alternative implementations, the data export device further includes a sending module, configured to send the remaining export time and the export progress to the client, so that the client displays the remaining export time and the export progress on the graphical user interface.
[0122] The data export device provided by the embodiments of the present application can accurately query the index values corresponding to each export index of each export object within the export time period based on the export time period, multiple export objects, and the export indexes corresponding to each export object in the export task, so as to generate multiple pieces of index data corresponding to each export object. Based on the storage space occupancy corresponding to each export object, it can accurately determine the target storage space occupancy for storing all the pieces of index data corresponding to all export objects, avoiding the situation of not knowing how much storage space to reserve. It can determine the target storage space corresponding to the target storage space occupancy from the local storage space based on the target storage space occupancy, avoiding the situation where the local storage space fails to provide the storage space corresponding to the target storage space occupancy, resulting in the failure to store each piece of index data corresponding to each export object. Export each piece of index data corresponding to each export object to the target storage space, so that users do not need to download each piece of index data corresponding to each export object on the client side, reducing the waiting time for users to obtain each piece of index data, thereby solving the problem that the time for users to download the exported files from the client side is relatively long.
[0123] For the description of the features in the corresponding embodiments of the data export device, reference can be made to the relevant descriptions in the corresponding embodiments of the data export method, which will not be elaborated here one by one.
[0124] An embodiment of the present application further provides an electronic device, as Figure 8 shown, including a memory 810 and a processor 820. A computer program is stored in the memory 810, and the processor 820 is configured to run the computer program to execute the steps in any one of the above-mentioned embodiments of the data export method.
[0125] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps in any one of the above-mentioned embodiments of the data export method when running.
[0126] In an exemplary embodiment, the above-mentioned computer-readable storage medium may include, but is not limited to: USB flash drives, read-only memories (ROM for short), random access memories (RAM for short), mobile hard disks, magnetic disks, or optical discs and other various media that can store computer programs.
[0127] An embodiment of the present application further provides a computer program product. The above-mentioned computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in any one of the above-mentioned embodiments of the data export method.
[0128] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps in any of the above-described data export method embodiments are implemented.
[0129] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0130] The above has introduced in detail a data export method, device, electronic device, and readable storage medium provided by the present application. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. A data export method, characterized in that, Including: Obtain an export task, where the export task includes an export time period, multiple export objects, and export metrics corresponding to each of the export objects; During the export time period, query the metric values corresponding to each of the export objects under the export metrics, and generate multiple pieces of metric data; Based on the storage space occupancy corresponding to each of the export objects, determine the target storage space occupancy for storing all the metric data; Determine a target storage space in the local storage space that is greater than or equal to the target storage space occupancy, and export each piece of metric data corresponding to each of the export objects to the target storage space.
2. The method according to claim 1, wherein During the export time period, query the metric values corresponding to each of the export objects under the export metrics, and generate multiple pieces of metric data, including: Obtain a query rule and a topology map corresponding to each of the export objects; If the query rule is an associated query, use the topological relationships in the topology maps corresponding to each of the export objects to determine associated objects associated with each of the export objects; During the export time period, query from the database the metric values corresponding to each of the export objects under the export metrics, and the metric values corresponding to each of the associated objects under the export metrics, and generate multiple pieces of the metric data corresponding to each of the export objects and multiple pieces of the metric data corresponding to each of the associated objects.
3. The method according to claim 1, wherein Based on the storage space occupancy corresponding to each of the export objects, determine the target storage space occupancy for storing all the metric data, including: Determine an export sub-time period and the number of export days from the export time period; Obtain the total number of the metric data of each of the export objects during the export sub-time period, to obtain a first total number; Use the average value of the storage space occupied by multiple pieces of the metric data of each of the export objects during the export sub-time period to determine the storage space occupancy of each of the export objects; Determine the product of the storage space occupancy of each of the export objects, the first total number, and the number of export days as the target storage space occupancy.
4. The method according to claim 2, wherein Based on the storage space occupancy corresponding to each of the export objects, determine the target storage space occupancy for storing all the metric data, including: Determine an export sub-time period and the number of export days from the export time period; Obtain the total number of the metric data of each of the export objects during the export sub-time period, to obtain a first total number; Obtain the total number of the metric data of each of the associated objects during the export sub-time period, to obtain a second total number; Use the average value of the storage space occupied by multiple pieces of the metric data of each of the export objects during the export sub-time period to determine the storage space occupancy of each of the export objects; Use the average value of the storage space occupied by multiple pieces of the metric data of each of the associated objects during the export sub-time period to determine the storage space occupancy of each of the associated objects; Determine the product of the storage space occupancy of each of the export objects, the first total number, and the number of export days as a first storage space occupancy; Determine the product of the storage space occupancy, the second total number, and the export days of each of the associated objects as the second storage space occupancy; Determine the sum of the first storage space occupancy and the second storage space occupancy as the target storage space occupancy.
5. The method according to claim 1, wherein Export each of the index data corresponding to each of the export objects to the target storage space, including: Based on a pre-set storage rule, determine the folder hierarchy structure corresponding to each of the export objects; Send the folder hierarchy structure to the client, and the client creates a corresponding target folder in the target storage space based on the folder hierarchy structure; Import the multiple pieces of index data corresponding to each of the export objects into a template file to generate multiple target files; Send the multiple target files to the corresponding target folder in the target storage space.
6. The method according to claim 2, wherein The method further includes: During the process of exporting the index data to the target storage space, import the multiple pieces of index data corresponding to the i-th export object into a template file to generate the i-th target file, and obtain the generation time of the i-th target file, where the generation time is the time between starting to import the multiple pieces of index data of the i-th export object into the template file and storing the generated i-th target file in the target storage space, and i is a positive integer; Obtain the total number of the index data corresponding to each of the export objects during the export time period to obtain a third total number; Obtain the total number of the index data corresponding to each of the associated objects during the export time period to obtain a fourth total number; Obtain the total number of the index data in the i-th target file to obtain a fifth total number; Utilize Determine the total export time, where T is used to represent the total export time, M is used to represent the sum of the third total number and the fourth total number, and Δt i is used to represent the generation time of the i-th target file, and m i is used to represent the fifth total number, m1 is used to represent the total number of the index data in the target file corresponding to the first export object, and m2 is used to represent the total number of the index data in the target file corresponding to the second export object; Utilize Determine the remaining export time, where T - Δt i Used to represent the corresponding remaining export time after exporting the i-th target file to the target storage space; Utilize Determine the export progress, where S is used to represent the corresponding export progress after exporting the i-th target file to the target storage space.
7. The method according to claim 6, wherein The method further includes: Send the remaining export time and the export progress to the client so that the client displays the remaining export time and the export progress on the graphical user interface.
8. A data export device, characterized in that, Includes: A first acquisition module, configured to acquire an export task, where the export task includes an export time period, multiple export objects, and the export indexes corresponding to each of the export objects; A query module, configured to query the index values corresponding to each of the export objects under the export indexes during the export time period to generate multiple pieces of index data; A first determination module, configured to determine the target storage space occupancy for storing all the index data based on the storage space occupancy corresponding to each of the export objects; An export module, configured to determine a target storage space greater than or equal to the target storage space occupancy from the local storage space, and export each of the index data corresponding to each of the export objects to the target storage space.
9. An electronic device, characterized in that, Includes: A memory, configured to store a computer program; A processor, configured to implement the steps of the data export method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, where the computer program implements the steps of the data export method according to any one of claims 1 to 7 when executed by a processor.