Test data generation method for distributed and centralized databases of electricity consumption information acquisition system
By encoding multi-dimensional features and processing dual-task generation models of the electricity consumption information collection system, test data matching the database architecture is generated, solving the problem of poor test data adaptability in existing technologies and achieving efficient database performance verification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA SOUTHERN POWER GRID DIGITAL GRID GRP CO LTD
- Filing Date
- 2025-12-15
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies struggle to accommodate the varying requirements of different database architectures when generating test data for distributed and centralized databases in electricity information collection systems, resulting in poor adaptability of the test data.
By acquiring raw econometric data from multiple data sources, performing multi-dimensional feature encoding processing, generating multimodal feature vectors, and using a pre-trained dual-task generation model to generate test data, and combining the architecture type of the database to be tested for adaptation processing, target test data matching the architecture type is generated.
This improves the adaptability of test data, ensuring that the test data can effectively trigger the performance bottlenecks of the database under different architectures, and verify the stability and response speed of the database.
Smart Images

Figure CN121902020A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for generating test data for distributed and centralized databases of an electricity information collection system. Background Technology
[0002] As the scale of electricity information collection systems continues to expand, the demand for testing distributed and centralized databases is growing, and high-quality test data generation technology has become the key to ensuring system reliability.
[0003] In related technologies, test data is mainly generated through preset rules or random generation methods, such as batch generating test data that meets basic format requirements based on a fixed data template. However, this method struggles to accommodate the diverse needs of different database architectures. Therefore, these technologies suffer from poor adaptability in generating test data. Summary of the Invention
[0004] Based on this, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for generating test data for distributed and centralized databases of an electricity information acquisition system, which can improve the adaptability of the generated test data, in order to address the above-mentioned technical problems.
[0005] Firstly, this application provides a method for generating test data for distributed and centralized databases in an electricity consumption information collection system. The method includes:
[0006] Raw measurement data from multiple data sources is acquired, and multi-dimensional feature encoding is performed on the raw measurement data to obtain a multimodal feature vector; the multimodal feature vector includes data source feature vector, time series feature vector, and cross-source association feature vector;
[0007] The data source feature vector, the time-series feature vector, and the cross-source association feature vector are fused to obtain a multimodal fused feature vector;
[0008] The multimodal fusion feature vector is input into a pre-trained dual-task generation model to generate test data, thereby obtaining test data.
[0009] Based on the architecture type of the database to be tested, the test data is subjected to architecture adaptation processing to obtain target test data that matches the architecture type.
[0010] In one embodiment, the step of fusing the data source feature vector, the time-series feature vector, and the cross-source association feature vector to obtain a multimodal fused feature vector includes:
[0011] The data source feature vector, the time series feature vector, and the cross-source association feature vector are normalized respectively to obtain normalized feature vectors.
[0012] Determine the correlation weights between each normalized feature vector and a preset target; the preset target includes a data density balancing target and a missing data completion target.
[0013] Based on the correlation weights, the normalized feature vectors are weighted and fused to obtain the multimodal fusion feature vector.
[0014] In one embodiment, the step of inputting the multimodal fusion feature vector into a pre-trained dual-task generation model for test data generation processing to obtain test data includes:
[0015] The multimodal fusion feature vector is input into the density equalization branch of the dual-task generation model for density equalization processing to obtain the first test data with density equalization.
[0016] The multimodal fusion feature vector is input into the missing sample completion branch of the dual-task generation model for prediction completion processing to obtain the completed second test data;
[0017] The test data is generated based on the first test data of density equalization and the second test data after completion.
[0018] In one embodiment, the step of performing architecture adaptation processing on the test data according to the architecture type of the database to be tested, to obtain target test data that matches the architecture type, includes:
[0019] Obtain the architecture type of the database to be tested;
[0020] When the architecture type is a distributed database, the test data is subjected to distributed architecture adaptation processing to obtain the target test data;
[0021] When the architecture type is a centralized database type, the test data is subjected to centralized architecture adaptation processing to obtain the target test data.
[0022] In one embodiment, after performing architecture adaptation processing on the test data according to the architecture type of the database to be tested to obtain target test data that matches the architecture type, the method further includes:
[0023] Obtain the performance metrics information of the target test data during the database testing process;
[0024] Based on the performance index information, determine the fit of the target test data;
[0025] Based on the fitness level, the parameters of the dual-task generation model are updated.
[0026] In one embodiment, the dual-task generation model is built on a generative adversarial network architecture, and the dual-task generation model includes a generator and a discriminator;
[0027] The discriminator is used to determine the authenticity, density consistency, and temporal coherence of the data output by the generator.
[0028] The dual-task generation model is trained and optimized using a hybrid loss function, which includes adversarial loss, density loss, and temporal loss.
[0029] Secondly, this application also provides a test data generation device for a distributed and centralized database of an electricity information collection system. The device includes:
[0030] The data acquisition module is used to acquire raw measurement data from multiple data sources, perform multi-dimensional feature encoding processing on the raw measurement data, and obtain multi-modal feature vectors; the multi-modal feature vectors include data source feature vectors, time series feature vectors, and cross-source association feature vectors;
[0031] The feature fusion module is used to fuse the feature vector of the data source, the time-series feature vector, and the cross-source association feature vector to obtain a multimodal fused feature vector.
[0032] The feature input module is used to input the multimodal fusion feature vector into a pre-trained dual-task generation model for test data generation processing to obtain test data;
[0033] The data processing module is used to perform architecture adaptation processing on the test data according to the architecture type of the database to be tested, so as to obtain target test data that matches the architecture type.
[0034] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0035] Raw measurement data from multiple data sources is acquired, and multi-dimensional feature encoding is performed on the raw measurement data to obtain a multimodal feature vector; the multimodal feature vector includes data source feature vector, time series feature vector, and cross-source association feature vector;
[0036] The data source feature vector, the time-series feature vector, and the cross-source association feature vector are fused to obtain a multimodal fused feature vector;
[0037] The multimodal fusion feature vector is input into a pre-trained dual-task generation model to generate test data, thereby obtaining test data.
[0038] Based on the architecture type of the database to be tested, the test data is subjected to architecture adaptation processing to obtain target test data that matches the architecture type.
[0039] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0040] Raw measurement data from multiple data sources is acquired, and multi-dimensional feature encoding is performed on the raw measurement data to obtain a multimodal feature vector; the multimodal feature vector includes data source feature vector, time series feature vector, and cross-source association feature vector;
[0041] The data source feature vector, the time-series feature vector, and the cross-source association feature vector are fused to obtain a multimodal fused feature vector;
[0042] The multimodal fusion feature vector is input into a pre-trained dual-task generation model to generate test data, thereby obtaining test data.
[0043] Based on the architecture type of the database to be tested, the test data is subjected to architecture adaptation processing to obtain target test data that matches the architecture type.
[0044] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0045] Raw measurement data from multiple data sources is acquired, and multi-dimensional feature encoding is performed on the raw measurement data to obtain a multimodal feature vector; the multimodal feature vector includes data source feature vector, time series feature vector, and cross-source association feature vector;
[0046] The data source feature vector, the time-series feature vector, and the cross-source association feature vector are fused to obtain a multimodal fused feature vector;
[0047] The multimodal fusion feature vector is input into a pre-trained dual-task generation model to generate test data, thereby obtaining test data.
[0048] Based on the architecture type of the database to be tested, the test data is subjected to architecture adaptation processing to obtain target test data that matches the architecture type.
[0049] The aforementioned method, apparatus, computer equipment, computer-readable storage medium, and computer program product for generating test data for distributed and centralized databases of the electricity information acquisition system acquire raw metering data from multiple data sources, perform multi-dimensional feature encoding processing on the raw metering data to obtain multimodal feature vectors; the multimodal feature vectors include data source feature vectors, time-series feature vectors, and cross-source correlation feature vectors; the data source feature vectors, the time-series feature vectors, and the cross-source correlation feature vectors are fused to obtain multimodal fused feature vectors; the multimodal fused feature vectors are input into a pre-trained dual-task generation model for test data generation processing to obtain test data; according to the architecture type of the database to be tested, the test data undergoes architecture adaptation processing to obtain target test data matching the architecture type. This scheme performs multi-dimensional feature encoding on raw econometric data from multiple data sources to obtain multimodal feature vectors, including data source feature vectors, time-series feature vectors, and cross-source correlation feature vectors. This is beneficial for comprehensively capturing the data source characteristics, time-series characteristics, and cross-source correlation characteristics of the raw econometric data. By fusing the data source feature vectors, time-series feature vectors, and cross-source correlation feature vectors to obtain multimodal fused feature vectors, it is beneficial for comprehensively considering feature information from multiple dimensions. By inputting the multimodal fused feature vectors into a pre-trained dual-task generation model for test data generation, it is beneficial for generating test data that conforms to the characteristics of real econometric data. By performing architecture adaptation processing on the test data according to the architecture type of the database to be tested, it is beneficial for matching the test data with databases of different architecture types, thereby improving the adaptability of the generated test data. Attached Figure Description
[0050] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 This is a flowchart illustrating the test data generation method for the distributed and centralized databases of an electricity information collection system in one embodiment.
[0052] Figure 2 This is a flowchart illustrating the steps for determining a multimodal fusion feature vector in one embodiment;
[0053] Figure 3 This is a schematic diagram illustrating the implementation process of the test data generation method for the distributed and centralized databases of the electricity information collection system in another embodiment.
[0054] Figure 4 This is a structural block diagram of a test data generation device for a distributed and centralized database of an electricity information acquisition system in one embodiment.
[0055] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0057] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0058] In one exemplary embodiment, such as Figure 1 As shown, a method for generating test data for distributed and centralized databases in an electricity consumption information collection system is provided. This embodiment illustrates the application of this method to an electricity consumption information collection system (e.g., a terminal). It is understood that this method can also be applied to a server, and to a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, etc.; the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. In this embodiment, the method includes the following steps:
[0059] Step S101: Obtain raw measurement data from multiple data sources, perform multi-dimensional feature encoding on the raw measurement data to obtain multi-modal feature vectors; the multi-modal feature vectors include data source feature vectors, time series feature vectors, and cross-source association feature vectors;
[0060] Step S102: The data source feature vector, time series feature vector, and cross-source association feature vector are fused to obtain a multimodal fused feature vector;
[0061] Step S103: Input the multimodal fusion feature vector into the pre-trained dual-task generation model to generate test data and obtain test data;
[0062] Step S104: Based on the architecture type of the database to be tested, perform architecture adaptation processing on the test data to obtain target test data that matches the architecture type.
[0063] Among them, the electricity information collection system can be an automated system used to collect and process data from metering equipment.
[0064] Distributed databases can be database architectures with multiple data sources deployed in a distributed manner. Data is distributed across multiple storage nodes, and data can be synchronized between different nodes, making them suitable for multi-source concurrent load scenarios.
[0065] Centralized databases can be database architectures with unified data storage nodes, where all data is stored centrally on a single storage node. This is suitable for scenarios with high requirements for data integrity and index querying.
[0066] The test data can be simulated data used to verify the stability, response speed and data processing capabilities of the database under different deployment architectures. The test data must be realistic and consistent to ensure the reliability of the test results.
[0067] The data source can be a source that provides raw metering data, including different types of metering devices, such as voltage, current, power or energy consumption metering sources. Different data sources have different acquisition frequencies and data dimensions.
[0068] The raw measurement data can be unprocessed measurement data collected from multiple data sources. This data can include basic measurement data and extended monitoring data, with different collection frequencies, such as once every 1 minute, 5 minutes or 15 minutes.
[0069] Multi-dimensional feature encoding can be a process of extracting and encoding features from and encoding raw econometric data in multiple dimensions, including data source characteristic encoding, time series data feature encoding, and cross-source association feature encoding.
[0070] Among them, the multimodal feature vector can be a set of vectors containing multiple feature types obtained after multi-dimensional feature encoding processing. This set of vectors includes data source feature vectors, time series feature vectors, and cross-source association feature vectors.
[0071] Among them, the data source feature vector can be a feature vector obtained by encoding the characteristics of the data source. This vector can include basic attribute features and density features. The basic attribute features include information such as data source type, collection frequency, and data dimension, which are encoded into a 32-dimensional vector through the embedding layer. The density features include information such as historical data density, density fluctuation coefficient, and missed collection rate of the data source, which are normalized and concatenated into a 16-dimensional vector. The two are fused to output a 48-dimensional data source feature vector.
[0072] The time series feature vector can be a feature vector obtained by performing time series decomposition and feature extraction on time series data. The time series decomposition adopts the seasonal trend decomposition method to extract trend components, periodic components and residual components. The feature extraction calculates the statistical characteristics and time series correlation characteristics of each component, and maps them into a 64-dimensional time series feature vector through a fully connected layer.
[0073] The cross-source association feature vector can be a feature vector that describes the relationship between the target data source and other related data sources. By calculating the data correlation between the target data source and other related data sources, the average feature value of the top 3 related data sources with the highest correlation is taken and concatenated with the feature of the target data source to output a 128-dimensional cross-source association feature vector.
[0074] The fusion process can be a process of dynamically adjusting the feature weights of each dimension through an attention-gated fusion network. The feature vectors of the data source, the time series feature vectors, and the cross-source correlation feature vectors are normalized at each layer. The correlation weights of each feature with the data density balance and the missing data completion target are calculated, and the fusion is performed by weighted fusion through gating units.
[0075] Among them, the multimodal fusion feature vector can be a comprehensive feature vector obtained after fusion processing. This vector has a dimension of 128 and contains weighted fusion information of data source feature vector, time series feature vector and cross-source association feature vector.
[0076] Among them, the dual-task generation model can be a model designed based on the generative adversarial network architecture to simultaneously achieve data density balance and omission filling. The model includes a generator and a discriminator. The generator adopts an improved architecture that includes an encoder, a decoder and cross-layer connections, while the discriminator adopts a multi-scale discriminator architecture.
[0077] Pre-training can be the process of optimizing and training the model using a hybrid loss function before generating test data using the dual-task generation model. The hybrid loss function includes adversarial loss, density loss, and temporal loss.
[0078] The test data generation process can be a process in which multimodal fusion feature vectors are input into a dual-task generation model, and then test data that meets the target density threshold and fills in the missing data is generated through the density balancing branch and the missing data completion branch of the generator.
[0079] The database to be tested can be a database that needs to be tested for performance; this database can be a distributed database or a centralized database.
[0080] The architecture type can be the deployment architecture type of the database to be tested, including distributed database architecture and centralized database architecture. Different architecture types have different storage structures and performance characteristics.
[0081] Architecture adaptation processing can be a process of adjusting test data according to the architecture type of the database under test. For distributed databases, it involves data sharding optimization and synchronization latency simulation, while for centralized databases, it involves index field enhancement and batch read / write adaptation.
[0082] The target test data can be test data that matches the architecture type of the database under test after architecture adaptation processing. This data can effectively trigger the performance bottleneck of the database in scenarios such as concurrent read and write, cross-node synchronization, and index query, and is used to verify the stability, response speed and data processing capabilities of the database.
[0083] Optionally, the electricity information acquisition system obtains raw metering data from terminal metering devices of multiple data sources, performs multi-dimensional feature encoding on the raw metering data, extracts basic attribute features and density features through data source characteristic encoding, encodes the data source type, acquisition frequency, and data dimension into a 32-dimensional vector through an embedding layer, calculates the historical data density, density fluctuation coefficient, and missed sampling rate of the data source, and concatenates them into a 16-dimensional vector after normalization. This vector is then fused with the basic attribute features to output a 48-dimensional data source feature vector. Through time-series data feature encoding, a seasonal trend decomposition method is used to perform time-series decomposition on the historical metering data of each data source, extracting trend components, periodic components, and residual components. The statistical characteristics and time-series correlation features of each component are calculated and mapped into a 64-dimensional time-series feature vector through a fully connected layer. Through cross-source correlation feature encoding, the data correlation between the target data source and other relevant data sources is calculated. The mean of the features of the top three most correlated relevant data sources is concatenated with the target data source feature vector to output a 128-dimensional cross-source correlation feature vector. This results in a multimodal feature vector including data source feature vectors, time-series feature vectors, and cross-source correlation feature vectors. This is then processed through an attention-gated fusion network. Layer-level normalization is performed on the data source feature vector, temporal feature vector, and cross-source correlation feature vector. The correlation weights of each feature with the data density balance target and the missing data completion target are calculated. The features of each dimension are weighted and fused through a gating unit to obtain a 128-dimensional multimodal fusion feature vector. The multimodal fusion feature vector is input into a dual-task generation model that has been pre-trained and optimized using a hybrid loss function. The dual-task generation model includes a generator and a discriminator. The generator adopts an improved architecture including an encoder, a decoder, and cross-layer connections. The density balance branch adjusts the temporal distribution of the generated data according to the target density threshold. The missing data completion branch uses a temporal attention mechanism to model long-term temporal dependencies and predict and complete the missing data segments. The complete temporal data is output as test data. The discriminator performs authenticity judgment, density consistency judgment, and temporal coherence judgment on the generated data. The test data is adapted to the architecture type of the database to be tested. For distributed database architecture, data sharding optimization and synchronization delay simulation are performed. For centralized database architecture, index field enhancement and batch read / write adaptation are performed to obtain target test data that matches the architecture type.
[0084] In the aforementioned method for generating test data for distributed and centralized databases of the electricity information acquisition system, raw metering data from multiple data sources is acquired. Multi-dimensional feature encoding is then performed on the raw metering data to obtain multimodal feature vectors. These multimodal feature vectors include data source feature vectors, time-series feature vectors, and cross-source correlation feature vectors. These data source feature vectors, time-series feature vectors, and cross-source correlation feature vectors are then fused to obtain a multimodal fused feature vector. This multimodal fused feature vector is input into a pre-trained dual-task generation model for test data generation to obtain test data. Finally, based on the architecture type of the database to be tested, the test data undergoes architecture adaptation processing to obtain target test data that matches the architecture type. This scheme performs multi-dimensional feature encoding on raw econometric data from multiple data sources to obtain multimodal feature vectors, including data source feature vectors, time-series feature vectors, and cross-source correlation feature vectors. This is beneficial for comprehensively capturing the data source characteristics, time-series characteristics, and cross-source correlation characteristics of the raw econometric data. By fusing the data source feature vectors, time-series feature vectors, and cross-source correlation feature vectors to obtain multimodal fused feature vectors, it is beneficial for comprehensively considering feature information from multiple dimensions. By inputting the multimodal fused feature vectors into a pre-trained dual-task generation model for test data generation, it is beneficial for generating test data that conforms to the characteristics of real econometric data. By performing architecture adaptation processing on the test data according to the architecture type of the database to be tested, it is beneficial for matching the test data with databases of different architecture types, thereby improving the adaptability of the generated test data.
[0085] In one exemplary embodiment, reference is made to Figure 2 The feature vectors from the data source, the time series feature vector, and the cross-source association feature vector are fused to obtain a multimodal fused feature vector, including:
[0086] Step S201: Normalize the data source feature vector, time series feature vector, and cross-source association feature vector respectively to obtain normalized feature vectors.
[0087] Step S202: Determine the correlation weights between each normalized feature vector and the preset targets; the preset targets include data density balancing targets and missing data completion targets.
[0088] Step S203: Based on the correlation weights, perform weighted fusion processing on the normalized feature vectors to obtain the multimodal fusion feature vector.
[0089] The normalization process can be a process of performing layer-by-layer normalization on the feature vectors of the data source, the time-series feature vectors, and the cross-source correlation feature vectors, thereby eliminating the differences in dimensions and numerical ranges between different feature vectors.
[0090] Among them, the normalized feature vectors can be data source feature vectors, time series feature vectors, and cross-source association feature vectors obtained after normalization processing, and the normalized feature vectors have a uniform numerical distribution range.
[0091] Among them, the preset target can be the optimization target that needs to be achieved in the feature fusion process, including the data density balance target and the missing data completion target.
[0092] Among them, the data density balance target can be to ensure that the number of valid data records output by different data sources remains consistent within a unit of time, so that the density difference between the data sources does not exceed a set threshold.
[0093] The goal of missing data completion can be to predict and complete single missing data entries or continuous data disconnections in the data source to ensure the integrity of the test data.
[0094] Among them, the correlation weight can be a weight parameter that describes the correlation strength between each normalized feature vector and the data density balance target and the missing data completion target, and is used to guide the weighted fusion of feature vectors.
[0095] The weighted fusion process can be a process in which the normalized feature vectors are weighted and merged by the gating unit according to the correlation weight, so as to dynamically adjust the contribution ratio of each dimension feature in the multimodal fusion feature vector.
[0096] Optionally, the electricity information acquisition system fuses the data source feature vector, time-series feature vector, and cross-source correlation feature vector. An attention-gated fusion network is used to perform layer-level normalization on the 48-dimensional data source feature vector, the 64-dimensional time-series feature vector, and the 128-dimensional cross-source correlation feature vector, respectively, to obtain normalized feature vectors. The normalization process eliminates dimensional and numerical range differences between different feature vectors, and determines the correlation weights between each normalized feature vector and preset targets. These preset targets include a data density balance target and a data omission compensation target. The data density balance target ensures that the units output from different data sources are consistent. The number of valid data entries remains consistent within the time period. The goal of missing data collection and completion is to predict and complete the missing data in the data source to ensure data integrity. By calculating the correlation weights between the normalized feature vectors and the data density balance target, and the correlation weights between the normalized feature vectors and the missing data collection and completion target, the correlation weights of each feature vector are obtained. Based on the correlation weights, the normalized feature vectors are weighted and fused. The gating unit dynamically adjusts the contribution ratio of each dimension feature in the fusion process according to the correlation weights. The normalized feature vectors are then weighted and merged to obtain a 128-dimensional multimodal fusion feature vector.
[0097] The technical solution provided in this embodiment normalizes the data source feature vector, time-series feature vector, and cross-source correlation feature vector respectively, which helps to eliminate the differences in dimensions and numerical ranges between different feature vectors. By determining the correlation weights between each normalized feature vector and the data density balance target and the missing data completion target, it is beneficial to quantify the contribution of each feature vector to different optimization targets. By performing weighted fusion processing on each normalized feature vector according to the correlation weights, it is beneficial to dynamically adjust the weights of each dimension of features, thereby improving the expressive power of multimodal fusion feature vectors.
[0098] In an exemplary embodiment, the multimodal fusion feature vector is input into a pre-trained dual-task generation model for test data generation processing to obtain test data. This includes: inputting the multimodal fusion feature vector into the density equalization branch of the dual-task generation model for density equalization processing to obtain density-balanced first test data; inputting the multimodal fusion feature vector into the missing sample completion branch of the dual-task generation model for prediction completion processing to obtain completed second test data; and generating test data based on the density-balanced first test data and the completed second test data.
[0099] Among them, the density balancing branch can be a branch structure in the dual-task generation model used to achieve data density balancing. It introduces a density-aware attention mechanism to adjust the temporal distribution of the generated data according to the target density threshold.
[0100] Density equalization processing can be a process that adjusts the time distribution of generated data according to the target density threshold through a density equalization branch, ensuring that the number of data items generated per unit time is consistent.
[0101] Among them, the first test data for density equalization can be the test data obtained after density equalization processing, in which the number of valid data points per unit time remains consistent.
[0102] Among them, the missing data completion branch can be a branch structure in the dual-task generation model used to complete the missing data, and a time-series attention mechanism is used to model long-term time-series dependencies.
[0103] Among them, the predictive completion process can be a process of predictively completing single missing data segments and consecutive missing data segments through the missing data completion branch, and outputting complete time series data.
[0104] The completed second test data can be test data containing complete time series data obtained after prediction completion processing.
[0105] Optionally, the electricity information acquisition system inputs the multimodal fusion feature vector into a pre-trained dual-task generation model for test data generation. The multimodal fusion feature vector is then input into the density balancing branch of the dual-task generation model for density balancing. This branch introduces a density-aware attention mechanism, adjusting the temporal distribution of the generated data based on a user-defined target density threshold or a uniform density calculated by the system from various data sources. This ensures a consistent number of data points generated per unit time, resulting in density-balanced first test data. The multimodal fusion feature vector is then input into the missing data completion branch of the dual-task generation model for prediction and completion. This branch uses a temporal attention mechanism to model long-term temporal dependencies, predictively completing single missing data segments and consecutive missing data segments, outputting complete temporal data, resulting in completed second test data. The decoder then comprehensively processes the density-balanced first test data and the completed second test data, combining cross-layer connections to supplement detailed features, outputting test data containing the completed data in the same format as the original data.
[0106] The technical solution provided in this embodiment obtains density-balanced first test data by inputting the multimodal fusion feature vector into the density balancing branch for density balancing processing, which helps ensure the consistency of the number of data points generated per unit time. It also obtains completed second test data by inputting the multimodal fusion feature vector into the missing data completion branch for predictive completion processing, which helps to accurately complete the missing data segments. By generating test data based on the density-balanced first test data and the completed second test data, it is beneficial to simultaneously achieve data density balancing and missing data completion, thereby improving the quality of the generated test data.
[0107] In an exemplary embodiment, the test data is subjected to architecture adaptation processing according to the architecture type of the database to be tested to obtain target test data that matches the architecture type. This includes: obtaining the architecture type of the database to be tested; if the architecture type is a distributed database, performing distributed architecture adaptation processing on the test data to obtain target test data; if the architecture type is a centralized database, performing centralized architecture adaptation processing on the test data to obtain target test data.
[0108] Among them, the distributed database type can be a database architecture with multiple data sources and distributed deployment, where the data is distributed across multiple storage nodes.
[0109] Among them, distributed architecture adaptation processing can be the adjustment processing of test data for distributed database architecture, including splitting test data according to the corresponding dimensions according to the sharding rules of distributed database to simulate multi-node concurrent writing scenarios, and adding random delays to cross-shard data to simulate data synchronization delays between distributed nodes.
[0110] Among them, the centralized database type can be a database architecture with a unified data storage node, where all data is centrally stored on one storage node.
[0111] The centralized architecture adaptation process can be an adjustment to the test data for a centralized database architecture, including increasing the redundancy of index fields to simulate the index optimization scenario of a centralized database, and grouping the test data by batch size to simulate the batch read and write load of a centralized database.
[0112] Optionally, the electricity information acquisition system performs architecture adaptation processing on the test data according to the architecture type of the database under test. The architecture type includes distributed database type and centralized database type. When the architecture type is distributed database type, the test data is processed for distributed architecture adaptation. The test data is split according to the corresponding dimension according to the sharding rules of the distributed database, simulating the concurrent write scenario of multiple nodes. A random delay of 10 milliseconds to 100 milliseconds is added to the cross-shard data to simulate the data synchronization delay between distributed nodes, thus obtaining target test data that matches the distributed database architecture. When the architecture type is centralized database type, the test data is processed for centralized architecture adaptation. The redundancy of index fields is increased to simulate the index optimization scenario of centralized database. The test data is grouped according to the batch size to simulate the batch read and write load of centralized database, thus obtaining target test data that matches the centralized database architecture.
[0113] The technical solution provided in this embodiment, by obtaining the architecture type of the database to be tested, helps to clarify the target architecture characteristics that the test data needs to adapt to. By performing distributed architecture adaptation processing on the test data when the architecture type is a distributed database, it is beneficial to simulate the multi-node concurrent write and data synchronization latency scenarios of a distributed database. By performing centralized architecture adaptation processing on the test data when the architecture type is a centralized database, it is beneficial to simulate the index optimization and batch read / write scenarios of a centralized database, thereby improving the matching degree between the test data and databases of different architecture types.
[0114] In an exemplary embodiment, after performing architecture adaptation processing on the test data according to the architecture type of the database to be tested to obtain target test data that matches the architecture type, the method further includes: obtaining performance indicator information of the target test data during the database testing process; determining the fit of the target test data based on the performance indicator information; and updating the parameters of the dual-task generation model based on the fit.
[0115] Among them, performance metrics information can be indicator parameters that reflect database performance and are collected in real time during the database testing process, including metrics such as concurrent read and write performance, cross-node synchronization performance, and index query performance.
[0116] Among them, the fit can be a metric calculated based on performance index information to evaluate the degree of matching between the target test data and the database architecture type under test.
[0117] The update process can be a process of dynamically adjusting the parameters of the dual-task generation model based on the fit, thereby improving the test effectiveness of the generated data by optimizing the generator parameters.
[0118] Optionally, after the electricity information acquisition system performs architecture adaptation processing on the test data according to the architecture type of the database under test to obtain target test data that matches the architecture type, it acquires the performance index information of the target test data during the database testing process. The performance index information includes indicators reflecting database performance such as concurrent read / write performance, cross-node synchronization performance, and index query performance. Based on the performance index information, the adaptability of the target test data is determined. The adaptability is used to evaluate the degree of matching between the target test data and the architecture type of the database under test. The adaptability value is calculated by analyzing the performance bottleneck triggering situation in the performance index information. Based on the adaptability, the parameters of the dual-task generation model are updated. When the adaptability is lower than a preset threshold, the parameters of the generator are dynamically adjusted to optimize the test effectiveness of the generated data and form a closed-loop feedback adjustment mechanism.
[0119] The technical solution provided in this embodiment helps to understand the performance of the test data in the actual test environment by obtaining the performance index information of the target test data during the database test process. By determining the fit of the target test data based on the performance index information, it is beneficial to quantitatively evaluate the degree of matching between the test data and the database architecture. By updating the parameters of the dual-task generation model based on the fit, it is beneficial to dynamically optimize the parameters of the generator, thereby improving the test effectiveness of the generated data.
[0120] In an exemplary embodiment, the dual-task generation model is built on a generative adversarial network architecture. The dual-task generation model includes a generator and a discriminator. The discriminator is used to determine the authenticity, density consistency, and temporal coherence of the data output by the generator. The dual-task generation model is trained and optimized using a hybrid loss function. The hybrid loss function includes adversarial loss, density loss, and temporal loss.
[0121] Among them, the generative adversarial network architecture can be a neural network architecture based on adversarial training between a generator and a discriminator. The model is optimized through an adversarial process in which the generator generates data and the discriminator judges the authenticity of the data.
[0122] The generator can be a network structure used to generate test data in a dual-task generation model, and adopts an improved architecture that includes an encoder, a decoder, and cross-layer connections.
[0123] The discriminator can be a network structure in a dual-task generation model used to discriminate the data output by the generator, and it adopts a multi-scale discriminator architecture.
[0124] Among them, authenticity judgment can be the process by which the discriminator judges whether the data output by the generator conforms to the distribution pattern of real measurement data, including judging characteristics such as numerical range and trend.
[0125] Density consistency determination can be the process by which the discriminator verifies whether the density of the generated data meets the target density threshold, and checks whether the density differences between the data sources are within a reasonable range.
[0126] Among them, the temporal continuity judgment can be the process by which the discriminator checks the temporal continuity between the completed data and the valid data before and after it, and judges whether the magnitude of the abrupt change is within a reasonable range.
[0127] The hybrid loss function can be a loss function used for training and optimizing a dual-task generative model, including adversarial loss, density loss, and temporal loss.
[0128] Among them, adversarial loss can be a loss term that measures the difference in distribution between generated data and real data based on Wasserstein distance.
[0129] Density loss can be a loss term calculated using mean square error to account for the deviation between the generated data density and the target density.
[0130] Among them, the temporal loss can be a loss term that combines dynamic time warping and mean square error to measure the temporal coherence and numerical accuracy of the completed data.
[0131] The technical solution provided in this embodiment constructs a dual-task generation model based on a generative adversarial network architecture. This facilitates model optimization through adversarial training of the generator and discriminator. The discriminator performs authenticity, density consistency, and temporal coherence discrimination on the data output by the generator, which helps to evaluate the quality of the generated data from multiple dimensions. Training optimization through a hybrid loss function helps to comprehensively consider adversarial loss, density loss, and temporal loss, thereby improving the generation effect of the dual-task generation model.
[0132] The following example illustrates the test data generation method for the distributed and centralized databases of the electricity information collection system provided in this application. This example demonstrates the application of this method to a terminal.
[0133] The metering automation system (electricity consumption information acquisition system) needs to undergo performance testing with both distributed and centralized databases to verify the system's stability, response speed, and data processing capabilities under different deployment architectures. The distributed database employs a multi-data source distributed deployment approach, while the centralized database uses a unified data storage node approach. The authenticity and consistency of the test data directly determine the reliability of the test results, but current data generation methods have significant limitations.
[0134] Regarding the uneven data density, the collection frequency of each data source in the distributed system varies. For example, the terminal metering device collects data once every 1 minute, once every 5 minutes, or once every 15 minutes. The data dimensions also differ, including basic metering data and extended monitoring data. This results in the output data density of different data sources differing by more than 10 times. Data density refers to the number of valid data entries per unit time, which cannot simulate the balanced load of the database in real-world scenarios.
[0135] Regarding the failure of data completion due to missing data, data sources may experience random or continuous missing data due to communication interruptions, equipment failures, and network delays. Random missing data refers to the absence of a single data entry, while continuous missing data refers to the exponential discontinuation of data over hours. Traditional completion methods, such as linear interpolation and mean filling, do not consider the temporal correlation of metering data or the differences in data source characteristics, such as the periodicity of voltage data and the abrupt changes in power data. As a result, the completed data deviates significantly from the actual data distribution.
[0136] Regarding insufficient test adaptability, most existing data generation tools generate data using fixed templates, failing to consider the differences in storage architecture between distributed and centralized databases. As a result, the generated data cannot effectively trigger the performance bottlenecks of the database in scenarios such as concurrent read / write, cross-node synchronization, and query optimization, leading to distorted test results.
[0137] The key problem lies in the lack of an intelligent data generation mechanism that takes into account the characteristics of the data source, the time sequence of data, and the adaptation of the database architecture. It cannot simultaneously solve the dual needs of data density balancing and missing data filling, which restricts the effectiveness of database performance testing of the metering automation system.
[0138] Traditional data generation methods fail to model the differences in data density between different data sources and the temporal correlation characteristics of measurement data, resulting in poor consistency in the density of generated data. They cannot simulate the multi-source concurrent load scenario of distributed databases. Data completion relies on simple statistical methods, ignoring the periodicity, trend, and abrupt changes of measurement data, resulting in low completion accuracy. Furthermore, they are not adapted to the high requirements of centralized databases for data integrity, causing performance test results to deviate from the real scenario.
[0139] This embodiment achieves balanced generation of test data density and accurate completion of missing data in the database of the metrology automation system by constructing a deep neural network scheme with multi-source feature fusion, dual-task generation network and architecture adaptation and optimization. At the same time, it adapts to the testing requirements of distributed and centralized databases, improving the authenticity and effectiveness of performance testing.
[0140] The general implementation process of this embodiment is as follows: Figure 3 As shown, Figure 3 It includes three modules: a multi-source data feature fusion module, a dual-task generation network, and a database architecture adaptation and optimization module, which correspond to steps one, two, and three, respectively.
[0141] Combination Figure 3 The specific implementation process of this embodiment may include the following steps.
[0142] Step 1: Multi-source data feature fusion module.
[0143] The core of this module is to provide comprehensive feature support for data generation through data source characteristic modeling, time series feature extraction, and cross-source correlation analysis.
[0144] Multidimensional feature coding includes data source characteristic coding, time series data feature coding, and cross-source association feature coding.
[0145] The data source feature encoding includes two types of core features, which are then standardized to output a fixed-dimensional feature vector.
[0146] In terms of basic attribute features, the data source type, acquisition frequency, and data dimension are encoded into a 32-dimensional vector through an embedding layer. The data source type includes voltage metering source, current metering source, power metering source, and energy consumption metering source. The acquisition frequency includes acquisition once every 1 minute, once every 5 minutes, and once every 15 minutes. The data dimension includes the number of basic fields and the number of extended fields.
[0147] Regarding density features, the historical data density, density fluctuation coefficient, and missed sampling rate of the data source are calculated and normalized, then concatenated into a 16-dimensional vector. This vector is then fused with the basic attribute features to output a 48-dimensional data source feature vector. The historical data density of the data source refers to the number of valid data entries per unit time, the density fluctuation coefficient is the ratio of the standard deviation to the mean, and the missed sampling rate is the ratio of the number of missing data entries to the total number of data entries.
[0148] Time-series data feature encoding processes valid historical measurement data from various data sources.
[0149] In terms of time series decomposition, the seasonal trend decomposition (STL) method is used to extract trend components, periodic components, and residual components. The trend component is the long-term data change trend, the periodic component includes daily periodic fluctuations, weekly periodic fluctuations, and monthly periodic fluctuations, and the residual component is random fluctuation.
[0150] In terms of feature extraction, the statistical features and temporal correlation features of each component are calculated and mapped to a 64-dimensional temporal feature vector through a fully connected layer. The statistical features include mean, variance, peak value, and valley value, while the temporal correlation features include autocorrelation coefficient and cross-correlation coefficient.
[0151] Cross-source association feature encoding calculates the data correlation between the target data source and other related data sources. The average feature value of the top 3 related data sources with the highest correlation is taken and concatenated with the feature of the target data source to output a 128-dimensional cross-source association feature vector. The data correlation is calculated using the Pearson correlation coefficient.
[0152] The feature fusion mechanism dynamically adjusts the feature weights of each dimension through an attention-gated fusion network.
[0153] Layered normalization is performed on data source features, time series features, and cross-source association features respectively.
[0154] The correlation weights between each feature and the data density balance target and the missing data completion target are calculated. The weighted fusion is performed through gating units to output a 128-dimensional multimodal fusion feature vector.
[0155] Step 2: Generate a dual-task network.
[0156] The dual-task generation network includes a density balancing branch and a missing data completion branch. Based on the generative adversarial network architecture, a dual-task generator and discriminator are designed to simultaneously achieve data density balancing and missing data completion.
[0157] The generator design employs an improved architecture that includes an encoder, decoder, and cross-layer connections.
[0158] In terms of the encoder, a high-order representation of multimodal fusion features is extracted through a 4-layer convolutional neural network. The dimension of the output feature map of each layer is halved, namely 128-dimensional, 64-dimensional, 32-dimensional, and 16-dimensional.
[0159] In terms of the dual-task branches, the density balancing branch introduces a density-aware attention mechanism to adjust the temporal distribution of generated data according to the target density threshold, ensuring that the number of data items generated per unit time is consistent. The target density threshold is a unified density of each data source set by the user or calculated adaptively by the system. The missing data completion branch uses a temporal attention long short-term memory network to model long-term temporal dependencies, predictively completes the missing data segments, and outputs complete temporal data. The missing data segments include single missing data segments and consecutive missing data segments.
[0160] On the decoder side, the data dimensions are restored through a 4-layer deconvolutional network, and detailed features are supplemented by cross-layer connections. The output is generated data with the same format as the original data, and the generated data includes the complete data after completion.
[0161] The discriminator design adopts a multi-scale discriminator architecture, which can simultaneously perform three types of discrimination tasks.
[0162] The authenticity assessment determines whether the generated data conforms to the distribution pattern of real measurement data, such as the numerical range and trend.
[0163] Density consistency judgment verifies whether the density of the generated data meets the target density threshold and whether the density difference between the data sources is less than or equal to 5%.
[0164] The temporal continuity judgment checks the temporal continuity between the completed data and the valid data before and after it, and whether the abrupt change is within a reasonable range.
[0165] The loss function design employs a hybrid loss function to optimize dual-task training.
[0166] Adversarial loss is based on Wasserstein distance, which measures the difference in distribution between generated data and real data.
[0167] The density loss is calculated using mean square error to determine the deviation between the generated data density and the target density.
[0168] The temporal loss, combined with dynamic time warping and mean square error, measures the temporal coherence and numerical accuracy of the completed data.
[0169] The total loss function is a weighted sum of adversarial loss, density loss, and temporal loss, with a weighting coefficient of 0.3 for density loss and 0.5 for temporal loss.
[0170] Step 3: Database architecture adaptation and optimization module.
[0171] This module adapts and adjusts the generated data to accommodate the differences between distributed and centralized databases, ensuring the effectiveness of the tests.
[0172] Distributed database adaptation includes data sharding optimization and synchronization latency simulation.
[0173] In terms of data sharding optimization, the generated data is split according to the corresponding dimensions based on the sharding rules of the distributed database to simulate a multi-node concurrent write scenario.
[0174] In terms of synchronization delay simulation, random delays are added to the cross-shard data to simulate the data synchronization delay between distributed nodes. The random delay ranges from 10 milliseconds to 100 milliseconds.
[0175] Centralized database adaptation includes index field enhancement and batch read / write adaptation.
[0176] Regarding index field enhancement, redundancy in index fields is increased to simulate index optimization scenarios in centralized databases. For batch read / write adaptation, generated data is grouped by batch size to simulate the batch read / write load of a centralized database.
[0177] In terms of closed-loop feedback adjustment, performance indicators during the database testing process are collected in real time, the suitability of the generated data is calculated, the parameters of the generator are dynamically adjusted, and the testing effectiveness of the generated data is optimized.
[0178] This embodiment achieves the following technical effects through multi-source feature fusion, dual-task generation network, and architecture adaptation optimization: improved data density balance, simulating multi-source concurrent load scenarios of distributed databases; improved accuracy of missing data collection and completion, ensuring the integrity of test data; and the ability to dynamically adjust generated data according to the architectural characteristics of distributed or centralized databases, effectively triggering performance bottlenecks in scenarios such as concurrent read / write, cross-node synchronization, and index query.
[0179] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0180] Based on the same inventive concept, this application also provides a test data generation device for a distributed and centralized database of an electricity consumption information collection system, used to implement the test data generation method for the distributed and centralized database of the electricity consumption information collection system described above. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more test data generation devices for distributed and centralized databases of an electricity consumption information collection system provided below can be found in the limitations of the test data generation method for distributed and centralized databases of an electricity consumption information collection system described above, and will not be repeated here.
[0181] In one exemplary embodiment, such as Figure 4 As shown, a test data generation device for a distributed and centralized database of an electricity consumption information acquisition system is provided. The test data generation device 400 for the distributed and centralized database of the electricity consumption information acquisition system may include:
[0182] The data acquisition module 401 is used to acquire raw measurement data from multiple data sources, perform multi-dimensional feature encoding processing on the raw measurement data, and obtain multi-modal feature vectors; the multi-modal feature vectors include data source feature vectors, time series feature vectors, and cross-source association feature vectors;
[0183] The feature fusion module 402 is used to fuse the feature vectors of the data source, the time series feature vectors, and the cross-source association feature vectors to obtain a multimodal fused feature vector.
[0184] The feature input module 403 is used to input the multimodal fusion feature vector into the pre-trained dual-task generation model for test data generation processing to obtain test data;
[0185] The data processing module 404 is used to perform architecture adaptation processing on the test data according to the architecture type of the database to be tested, so as to obtain target test data that matches the architecture type.
[0186] In an exemplary embodiment, the feature fusion module 402 is further configured to normalize the data source feature vector, the time-series feature vector, and the cross-source correlation feature vector respectively to obtain normalized feature vectors; determine the correlation weight between the normalized feature vectors and the preset target; the preset target includes the data density balance target and the missing data completion target; and perform weighted fusion processing on the normalized feature vectors according to the correlation weight to obtain the multimodal fusion feature vector.
[0187] In an exemplary embodiment, the feature input module 403 is further configured to input the multimodal fusion feature vector into the density equalization branch of the dual-task generation model for density equalization processing to obtain density-equalized first test data; input the multimodal fusion feature vector into the omission completion branch of the dual-task generation model for prediction completion processing to obtain completed second test data; and generate test data based on the density-equalized first test data and the completed second test data.
[0188] In an exemplary embodiment, the data processing module 404 is further configured to obtain the architecture type of the database to be tested; if the architecture type is a distributed database, perform distributed architecture adaptation processing on the test data to obtain target test data; if the architecture type is a centralized database, perform centralized architecture adaptation processing on the test data to obtain target test data.
[0189] In an exemplary embodiment, the device 400 further includes: a parameter update module, configured to acquire performance index information of the target test data during the database testing process; determine the fit of the target test data based on the performance index information; and update the parameters of the dual-task generation model based on the fit.
[0190] In an exemplary embodiment, the dual-task generation model is built on a generative adversarial network architecture. The dual-task generation model includes a generator and a discriminator. The discriminator is used to determine the authenticity, density consistency, and temporal coherence of the data output by the generator. The dual-task generation model is trained and optimized using a hybrid loss function. The hybrid loss function includes adversarial loss, density loss, and temporal loss.
[0191] The modules in the test data generation device of the distributed and centralized databases of the aforementioned electricity information collection system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0192] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 5As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a method for generating test data for a distributed and centralized database of an electricity information acquisition system. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0193] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0194] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0195] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above-described method embodiments.
[0196] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0197] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0198] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0199] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for generating test data for a distributed and centralized database of an electricity information acquisition system, characterized in that, The method includes: Raw measurement data from multiple data sources is acquired, and multi-dimensional feature encoding is performed on the raw measurement data to obtain a multimodal feature vector; the multimodal feature vector includes data source feature vector, time series feature vector, and cross-source association feature vector; The data source feature vector, the time-series feature vector, and the cross-source association feature vector are fused to obtain a multimodal fused feature vector; The multimodal fusion feature vector is input into a pre-trained dual-task generation model to generate test data, thereby obtaining test data. Based on the architecture type of the database to be tested, the test data is subjected to architecture adaptation processing to obtain target test data that matches the architecture type.
2. The method according to claim 1, characterized in that, The process of fusing the data source feature vector, the time-series feature vector, and the cross-source association feature vector to obtain a multimodal fused feature vector includes: The data source feature vector, the time series feature vector, and the cross-source association feature vector are normalized respectively to obtain normalized feature vectors. Determine the correlation weights between each normalized feature vector and a preset target; the preset target includes a data density balancing target and a missing data completion target. Based on the correlation weights, the normalized feature vectors are weighted and fused to obtain the multimodal fusion feature vector.
3. The method according to claim 1, characterized in that, The step of inputting the multimodal fusion feature vector into a pre-trained dual-task generation model for test data generation processing to obtain test data includes: The multimodal fusion feature vector is input into the density equalization branch of the dual-task generation model for density equalization processing to obtain the first test data with density equalization. The multimodal fusion feature vector is input into the missing sample completion branch of the dual-task generation model for prediction completion processing to obtain the completed second test data; The test data is generated based on the first test data of density equalization and the second test data after completion.
4. The method according to claim 1, characterized in that, The step of performing architecture adaptation processing on the test data according to the architecture type of the database to be tested, to obtain target test data that matches the architecture type, includes: Obtain the architecture type of the database to be tested; When the architecture type is a distributed database, the test data is subjected to distributed architecture adaptation processing to obtain the target test data; When the architecture type is a centralized database type, the test data is subjected to centralized architecture adaptation processing to obtain the target test data.
5. The method according to claim 1, characterized in that, After performing architecture adaptation processing on the test data according to the architecture type of the database to be tested, and obtaining target test data that matches the architecture type, the process further includes: Obtain the performance metrics information of the target test data during the database testing process; Based on the performance index information, determine the fit of the target test data; Based on the fitness level, the parameters of the dual-task generation model are updated.
6. The method according to any one of claims 1 to 5, characterized in that, The dual-task generation model is built on a generative adversarial network architecture and includes a generator and a discriminator. The discriminator is used to determine the authenticity, density consistency, and temporal coherence of the data output by the generator. The dual-task generation model is trained and optimized using a hybrid loss function, which includes adversarial loss, density loss, and temporal loss.
7. A test data generation device for a distributed and centralized database of an electricity information acquisition system, characterized in that, The device includes: The data acquisition module is used to acquire raw measurement data from multiple data sources, perform multi-dimensional feature encoding processing on the raw measurement data, and obtain multi-modal feature vectors; the multi-modal feature vectors include data source feature vectors, time series feature vectors, and cross-source association feature vectors; The feature fusion module is used to fuse the feature vector of the data source, the time-series feature vector, and the cross-source association feature vector to obtain a multimodal fused feature vector. The feature input module is used to input the multimodal fusion feature vector into a pre-trained dual-task generation model for test data generation processing to obtain test data; The data processing module is used to perform architecture adaptation processing on the test data according to the architecture type of the database to be tested, so as to obtain target test data that matches the architecture type.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.