Battery swap station data migration method, equipment and medium
Through synchronization tools and crc16 verification algorithm, the problem of data loss or inconsistency during the data migration of the battery swap station is solved, the accuracy and completeness of the data migration are achieved, and the reliability of the user's battery swap process and data query efficiency are improved.
Patent Information
- Application Number
- CN202410541946.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-12-29
- Filing Date
- 2024-04-30
- Publication Date
- 2025-07-08
AI Technical Summary
During the data migration of battery swap stations, there are problems of data loss or inconsistency, resulting in errors during the battery swap process, affecting query efficiency and user experience.
Through the synchronization tool, compare the data volume and verification value consistency of the old warehouse and the new warehouse, gradually migrate the data, and set the data volume for a single migration based on the type, quantity of the battery swap station and the warehouse processing capacity. Use the crc16 verification algorithm to ensure data integrity and consistency.
Ensure the accuracy and completeness of the data migration process, avoid data loss or inconsistency, improve the reliability and smoothness of the user's battery swap process, and improve data query performance.
Smart Images

Figure CN120277049A_ABST
Abstract
Description
[0001] This application claims priority based on the invention patent application filed with the China National Intellectual Property Administration on December 29, 2023, with the application number 202311872281.5 and the invention title "A Method, Device and Medium for Evaluating the Battery Replacement Efficiency of a Battery Replacement Station". The entire text of the above Chinese patent application is incorporated herein by reference. Technical Field
[0002] This specification relates to the technical field of new energy electric vehicle battery replacement, and particularly to a method, device and medium for migrating battery replacement station data. Background Art
[0003] With the increase in the number of constructed battery replacement stations and the number of users of electric vehicles, the data at the battery replacement station end has also increased. However, since the battery replacement station data is stored in an old big data analysis platform, the query efficiency has gradually decreased, bringing a poor experience to users. In order to support more and more data queries, the battery replacement station data needs to be migrated to a new big data storage platform.
[0004] During the process of migrating battery replacement station data, since the battery replacement station data is stored in an old big data platform, when migrating to a new big data storage platform, there may be a situation where the battery replacement station data is lost or inconsistent. This is because there may be data omissions or incorrect operations during the migration process of the battery replacement station data. If there is data loss or inconsistency in the battery replacement station data after migration, it may cause errors in the battery replacement station data of some users, and there may be problems in the subsequent battery replacement process of users. Summary of the Invention
[0005] One or more embodiments of this specification provide a method, device and medium for migrating battery replacement station data to solve the technical problems raised in the background art.
[0006] One or more embodiments of this specification adopt the following technical solutions:
[0007] A method for migrating battery replacement station data provided by one or more embodiments of this specification includes:
[0008] Migrate the data to be migrated of the battery replacement station in the old warehouse to the new warehouse through a synchronization tool, and determine the first amount of migrated data corresponding to the old warehouse and the second amount of migrated data corresponding to the new warehouse;
[0009] Compare whether the first amount of migrated data is consistent with the second amount of migrated data;
[0010] If they are consistent, sample and compare whether the verification values corresponding to the same identifier in the old warehouse and the new warehouse are consistent;
[0011] If they are consistent, complete the migration of the data to be migrated from the old warehouse to the new warehouse.
[0012] It should be noted that in the embodiments of this specification, by comparing the consistency of the first migration data volume and the second migration data volume, and comparing the consistency of the verification values of the data with the same identifier in the old warehouse and the new warehouse, the consistency of the data in the swapping station during the migration process can be verified, ensuring the accuracy and integrity of the data.
[0013] Meanwhile, by using the synchronization tool to gradually migrate the data to be migrated to the new warehouse, data omission and incorrect operations can be reduced, thereby avoiding the loss or inconsistency of the data in the swapping station during the migration process.
[0014] Moreover, by ensuring the accuracy and consistency of the data migration in the swapping station, problems with incorrect data encountered by users during the swapping process can be avoided, improving the reliability and smoothness of the user's swapping process.
[0015] In addition, by comparing the consistency of the verification values, the integrity of the data with the same identifier in the old warehouse and the new warehouse can be ensured, avoiding changes or damage to the data in the swapping station during the migration process.
[0016] Furthermore, before migrating the data to be migrated of the swapping station in the old warehouse to the new warehouse through the synchronization tool according to one or more embodiments of this specification, it includes:
[0017] Determining whether the data volume of the data to be migrated of the swapping station in the old warehouse exceeds the preset single - migration data volume;
[0018] If so, dividing the data to be migrated into multiple migration data volumes according to the preset single - migration data volume.
[0019] It should be noted that in the embodiments of this specification, by determining whether the data volume of the data to be migrated of the swapping station in the old warehouse exceeds the preset single - migration data volume, and when the data volume of the data to be migrated of the swapping station exceeds the preset single - migration data volume, dividing the data into multiple migration data volumes, the efficiency and accuracy of data migration can be improved. This can avoid problems such as data loss or inconsistency caused by migrating too much data at one time. Dividing into multiple migration data volumes can reduce the possibility of data omission or incorrect operations, ensuring the integrity and accuracy of the data. This method can improve the security and reliability of the data and reduce the probability of problems occurring during the user's swapping process.
[0020] Furthermore, before determining whether the data volume of the data to be migrated of the swapping station in the old warehouse exceeds the preset single - migration data volume according to one or more embodiments of this specification, the method further includes:
[0021] Set the amount of data migrated each time according to the type of the battery swapping station, the number of the battery swapping stations, the processing capacity of the old warehouse, and the processing capacity of the new warehouse.
[0022] It should be noted that in the embodiments of this specification, by setting the amount of data migrated each time in advance according to the type and number of the battery swapping stations and the processing capacities of the old warehouse and the new warehouse, the workload of data migration can be reasonably allocated, ensuring the efficiency and stability of the data migration process. By setting an appropriate amount of data migrated each time, the risk of data migration can be reduced, and the possibility of data loss or inconsistency can be decreased. This can improve the security and reliability of the entire data migration process, ensuring the integrity and accuracy of the data of the battery swapping station. In addition, setting the amount of data migrated each time according to specific circumstances can also increase the speed of data migration, shorten the data migration process of the user's battery swapping station, and reduce the problems that may occur during the battery swapping process of the user.
[0023] Further, in one or more embodiments of this specification, setting the amount of data migrated each time according to the type of the battery swapping station, the number of the battery swapping stations, the processing capacity of the old warehouse, and the processing capacity of the new warehouse includes:
[0024] Estimate the time required to migrate the data to be migrated to the new warehouse according to the type of the battery swapping station, the number of the battery swapping stations, and the initially set amount of data migrated each time in advance;
[0025] If the difference between the required time and the pre-set migration time exceeds the preset value, reset the amount of data migrated each time according to the pre-set migration time, the type of the battery swapping station, the number of the battery swapping stations, the processing capacity of the old warehouse, and the processing capacity of the new warehouse.
[0026] It should be noted that in the embodiments of this specification, by setting the amount of data migrated each time in advance according to the type and number of the battery swapping stations and the processing capacities of the old warehouse and the new warehouse, and estimating the required time, the workload and time of data migration can be reasonably allocated, improving the efficiency and accuracy of data migration. If there is a large difference between the estimated required time and the pre-set migration time, the amount of data migrated each time can be reset according to the actual situation to meet the requirements of the migration time. This can avoid problems such as data loss or inconsistency caused by too large a data volume during the data migration process, and ensure the accuracy and integrity of the subsequent data of the user's battery swapping station. This method can improve the controllability and reliability of data migration, reduce the risk of data migration, and ensure the smooth progress of the user's battery swapping process.
[0027] Further, before estimating the time required to migrate the data to be migrated to the new warehouse according to the type of the battery swapping station, the number of the battery swapping stations, and the preset initial single - time migration data volume, the method further includes:
[0028] Determine a single - time migration data threshold according to the processing capacity of the old warehouse and the processing capacity of the new warehouse;
[0029] If the initial single - time migration data volume does not meet the single - time migration data threshold, reset the single - time migration data volume according to the preset migration time, the type of the battery swapping station, the number of the battery swapping stations, the processing capacity of the old warehouse, and the processing capacity of the new warehouse.
[0030] It should be noted that, by determining the single - time migration data volume threshold according to the processing capacity of the warehouse in the embodiments of this specification, the warehouse resources can be fully utilized, and data loss or inconsistency caused by over - load can be avoided.
[0031] Moreover, by resetting the single - time migration data volume according to the preset migration time and the processing capacity of the warehouse, the migration time can be reasonably arranged to ensure that the data migration is completed within the limited time range, reducing the delay and uncertainty during the migration process.
[0032] At the same time, by resetting the single - time migration data volume, the migration efficiency and speed can be improved on the premise of ensuring the integrity and accuracy of the data, reducing possible problems in the subsequent battery swapping process of users.
[0033] In addition, by adjusting the single - time migration data volume according to the actual situation, the characteristics of different warehouses and battery swapping stations can be flexibly coped with, meeting the data migration requirements in different scenarios.
[0034] Further, the processing capacity in one or more embodiments of this specification includes one or more of storage capacity, processing speed, and network bandwidth.
[0035] It should be noted that, by analyzing that the processing capacity includes storage capacity, processing speed, and network bandwidth in the embodiments of this specification, the data migration method of the battery swapping station can be optimized from multiple aspects to reduce the situation of data loss or inconsistency, thereby improving the effect of data migration.
[0036] Further, in one or more embodiments of this specification, if the data volume of the data to be migrated exceeds the single - time migration data volume;
[0037] Migrate the data to be migrated of the power exchange station in the old warehouse to the new warehouse through the synchronization tool, and determine the first migration data volume corresponding to the old warehouse and the second migration data volume corresponding to the new warehouse; compare whether the first migration data volume is consistent with the second migration data volume, including:
[0038] According to the multiple migration data volumes, use the synchronization tool to sequentially migrate the data to be migrated of the power exchange station in the old warehouse to the new warehouse, and respectively determine the first migration data component corresponding to the old warehouse and the second migration data component corresponding to the new warehouse;
[0039] Respectively compare whether each first migration data component is consistent with the corresponding second migration data component.
[0040] It should be noted that in the embodiments of this specification, dividing the data to be migrated into multiple migration data volumes can reduce the amount of data migrated each time and reduce the risk of data loss or errors. By comparing whether the first migration data volume is consistent with the second migration data volume, problems that may occur during the data migration process can be discovered in a timely manner, thereby reducing the situation of data inconsistency.
[0041] At the same time, in the embodiments of this specification, by migrating the data sequentially, the data can be verified after each migration to ensure the accuracy of the migrated data. This can avoid the situation where problems occur during the large-scale data migration process and lead to the need to re-migrate the data, thereby improving the efficiency of data migration.
[0042] In addition, in the embodiments of this specification, by setting the amount of data migrated each time, the workload of data migration can be reasonably divided according to the processing capabilities of the old warehouse and the new warehouse, avoiding the situation where the amount of data migrated at one time is too large, resulting in too long a migration time or too much resource occupation.
[0043] Furthermore, the verification value corresponding to the same identifier in one or more embodiments of this specification is the crc16 value.
[0044] It should be noted that according to the verification value corresponding to the same identifier being the crc16 value, the accuracy and integrity of the power exchange station data migration can be further enhanced, and the reliability of data verification can be increased. Using crc16 as the verification value can compare whether the data with the same identifier in the old warehouse and the new warehouse is consistent during the data migration process. crc16 is a commonly used verification algorithm that generates a 16-bit verification value by calculating the data. If the crc16 values corresponding to the same identifier in the old warehouse and the new warehouse are consistent, it can be considered that no data loss or incorrect operation has occurred during the data migration process, thereby increasing the reliability of the data migration.
[0045] In summary, CRC16 check can effectively detect whether bit errors or data loss occur during data transmission. If the CRC16 check is consistent, it can ensure the consistency of the migrated data between the old warehouse and the new warehouse, thus guaranteeing data integrity. If the CRC16 check is inconsistent, the specific data number can be traced, so as to discover possible data omissions or incorrect operations during the data migration process. This helps to promptly identify problems, make corrections, and reduce the risk of data errors. By sampling and comparing the CRC16 check values corresponding to the same identifiers, the verification of all data can be reduced while ensuring data integrity, thereby improving the efficiency of data migration.
[0046] Further, in one or more embodiments of this specification, if the first migrated data volume is inconsistent with the second migrated data volume, the method further includes:
[0047] Determining whether the number of times of migrating the data to be migrated of the substation in the old warehouse to the new warehouse again through the synchronization tool exceeds a first preset number of times;
[0048] If not, migrating the data to be migrated of the substation in the old warehouse to the new warehouse again through the synchronization tool, and determining the third migrated data volume corresponding to the old warehouse and the fourth migrated data volume corresponding to the new warehouse;
[0049] Comparing whether the third migrated data volume is consistent with the fourth migrated data volume.
[0050] It should be noted that if the data volumes are inconsistent after migration, the embodiments of this specification can determine whether the number of migration times exceeds the first preset number of times. If not, the synchronization tool will be used again for migration to ensure data integrity and consistency. This can promptly correct possible errors during the data migration process and avoid data loss or inconsistency problems.
[0051] Meanwhile, through the comparison of the third migrated data volume and the fourth migrated data volume in the embodiments of this specification, the accuracy and integrity of the migration can be further verified. If the third migrated data volume is consistent with the fourth migrated data volume, it can be confirmed that the data volumes of the data migration are consistent, which effectively prevents the uncertainty of data migration and improves the success rate of data migration.
[0052] Further, in one or more embodiments of this specification, if the check values corresponding to the same identifiers in the old warehouse and the new warehouse are inconsistent in the sampling comparison, the method further includes:
[0053] Determining whether the number of times of migrating the data to be migrated of the substation in the old warehouse to the new warehouse again through the synchronization tool exceeds a second preset number of times;
[0054] Otherwise, migrate the data to be migrated of the power swap stations in the old warehouse to the new warehouse again through the synchronization tool, and determine the fifth migration data volume corresponding to the old warehouse and the sixth migration data volume corresponding to the new warehouse;
[0055] Compare whether the fifth migration data volume is consistent with the sixth migration data volume;
[0056] If they are consistent, resample and compare whether the check values corresponding to the same identifiers in the old warehouse and the new warehouse are consistent.
[0057] It should be noted that if the check values after resampling and comparison after migration are inconsistent, the embodiments of this specification can determine whether the number of migrations exceeds the second preset number. If not, the synchronization tool will be used again for migration to ensure data integrity and consistency. This can timely correct possible errors in the data migration process and avoid data loss or inconsistency problems.
[0058] Meanwhile, the embodiments of this specification can further verify the accuracy and integrity of the migration by comparing the fifth migration data volume and the sixth migration data volume. If the fifth migration data volume and the sixth migration data volume are consistent, the check values can be resampled and compared to see if they are consistent. If the check values after resampling and comparison are consistent, it can be confirmed that the data migration is successful. This effectively prevents the uncertainty of data migration and improves the success rate of data migration.
[0059] Further, the resampling and comparison of whether the check values corresponding to the same identifiers in the old warehouse and the new warehouse are consistent in one or more embodiments of this specification includes:
[0060] Sample multiple groups of data with the same identifier in the old warehouse and the new warehouse. The multiple groups of data include the first sampled data corresponding to the old warehouse and the second sampled data corresponding to the new warehouse;
[0061] Determine the first check value corresponding to the old warehouse according to the first sampled data corresponding to the old warehouse;
[0062] Determine the second check value corresponding to the new warehouse according to the second sampled data corresponding to the new warehouse;
[0063] Compare whether the first check value is consistent with the second check value to determine whether the data in the old warehouse and the new warehouse is consistent;
[0064] Preferably, the check value corresponding to the same identifier is the crc16 value.
[0065] It should be noted that in the embodiments of this specification, by sampling in combination with multiple groups of data to generate a first check value and a second check value, it is possible to quickly determine whether the data sets with the same identifiers in the old warehouse and the new warehouse are consistent. This fast comparison mechanism reduces waiting time and resource consumption, especially when dealing with a large amount of data.
[0066] At the same time, in the embodiments of this specification, by generating check values in combination with multiple groups of data, the accuracy of error detection can be improved. Compared with the check of a single data point, the method of combining multiple data can more comprehensively reflect the overall state of the data, thus effectively reducing misjudgments caused by accidental data errors or deviations.
[0067] A data migration device for a battery swapping station provided by one or more embodiments of this specification includes:
[0068] At least one processor; and,
[0069] A memory communicatively connected to the at least one processor; wherein,
[0070] The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor can implement the data migration method for the battery swapping station as described in any of the above embodiments, specifically including:
[0071] Migrate the data to be migrated of the battery swapping station in the old warehouse to the new warehouse through a synchronization tool, and determine the first migration data volume corresponding to the old warehouse and the second migration data volume corresponding to the new warehouse;
[0072] Compare whether the first migration data volume is consistent with the second migration data volume;
[0073] If they are consistent, sample and compare whether the check values corresponding to the same identifiers in the old warehouse and the new warehouse are consistent;
[0074] If they are consistent, complete the migration of the data to be migrated from the old warehouse to the new warehouse.
[0075] A non - volatile computer storage medium provided by one or more embodiments of this specification stores computer - executable instructions, and when the computer - executable instructions are executed by a computer, they can implement the data migration method for the battery swapping station as described in any of the above embodiments, specifically including:
[0076] Migrate the data to be migrated of the battery swapping station in the old warehouse to the new warehouse through a synchronization tool, and determine the first migration data volume corresponding to the old warehouse and the second migration data volume corresponding to the new warehouse;
[0077] Compare whether the first migration data volume is consistent with the second migration data volume;
[0078] If they are consistent, sample and compare whether the verification values corresponding to the same identifiers in the old warehouse and the new warehouse are consistent;
[0079] If they are consistent, complete the migration of the data to be migrated from the old warehouse to the new warehouse.
[0080] The above at least one technical solution adopted in the embodiments of this specification can achieve the following beneficial effects:
[0081] In the embodiments of this specification, by comparing the consistency of the first migration data volume and the second migration data volume, and comparing the consistency of the verification values of the data with the same identifier in the old warehouse and the new warehouse, the consistency of the data in the battery swapping station during the migration process can be verified, ensuring the accuracy and integrity of the data.
[0082] At the same time, by using the synchronization tool to gradually migrate the data to be migrated to the new warehouse, data omission and incorrect operations can be reduced, thereby avoiding the loss or inconsistency of the data in the battery swapping station during the migration process.
[0083] Moreover, by ensuring the accuracy and consistency of the data migration in the battery swapping station, problems of data errors encountered by users during the battery swapping process can be avoided, improving the reliability and smoothness of the user's battery swapping process.
[0084] In addition, by comparing the consistency of the verification values, the integrity of the data with the same identifier in the old warehouse and the new warehouse can be ensured, avoiding changes or damage to the data in the battery swapping station during the migration process. Description of the Drawings
[0085] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in this specification. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings. In the drawings:
[0086] Figure 1 It is a flowchart of a method for migrating data in a battery swapping station provided by one or more embodiments of this specification;
[0087] Figure 2 It is a flowchart of a method for migrating station-side data without loss provided by one or more embodiments of this specification;
[0088] Figure 3 It is a flowchart of data migration verification provided by one or more embodiments of this specification;
[0089] Figure 4Schematic diagram of a data migration device for a battery swapping station provided for one or more embodiments of this specification. Detailed implementation
[0090] Embodiments of this specification provide a method, device, and medium for data migration in a battery swapping station.
[0091] In order to enable those skilled in the art to better understand the technical solutions in this specification, the following will clearly and completely describe the technical solutions in the embodiments of this specification in conjunction with the accompanying drawings in the embodiments of this specification. Obviously, the described embodiments are only a part of the embodiments of this specification, rather than all the embodiments. Based on the embodiments of this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this specification.
[0092] Figure 1 Flow diagram of a data migration method for a battery swapping station provided for one or more embodiments of this specification. This process can be executed by a data migration system for a battery swapping station. Some input parameters or intermediate results in the process allow manual intervention and adjustment to help improve accuracy.
[0093] The method flow steps of the embodiments of this specification are as follows:
[0094] S102: Migrate the data to be migrated of the battery swapping station in the old warehouse to the new warehouse through a synchronization tool, and determine the first migration data volume corresponding to the old warehouse and the second migration data volume corresponding to the new warehouse.
[0095] In the embodiments of this specification, regarding migrating the data to be migrated in the old warehouse to the new warehouse, the following specific implementation steps can be adopted:
[0096] Determine the data structure and field mapping relationship between the old warehouse and the new warehouse: Obtain the data structure and fields in the old warehouse, as well as the corresponding data structure and fields in the new warehouse. Ensure that the data can be correctly mapped and migrated to the new warehouse.
[0097] Select a suitable synchronization tool: Select a suitable synchronization tool according to the actual situation. Select a suitable tool, such as DataX, Sqoop, Flume, Kafka, etc., according to the data volume, frequency, and synchronization requirements. Ensure that the selected tool can meet the requirements of the migration process.
[0098] Configure the synchronization tool: Configure the synchronization tool according to the configuration information of the old warehouse and the new warehouse. Include connection information, authentication information, synchronization rules, etc. Ensure that the synchronization tool can correctly connect and synchronize data.
[0099] Start the synchronization tool for data migration: According to the configuration of the synchronization tool, start the data migration process. The synchronization tool will read the data to be migrated from the old repository according to the configuration information and migrate it to the new repository.
[0100] Determine the dataset to be migrated in the old repository: Determine the dataset that needs to be migrated from the old repository. The data range to be migrated can be determined according to business requirements and data usage.
[0101] Evaluate the data volume in the old repository: Evaluate the data to be migrated in the old repository to determine its data volume. The data volume can be estimated by querying the number of records in the old repository or by counting the size of relevant data tables.
[0102] Determine the data structure in the new repository: Understand the data structure and fields in the new repository to determine the target structure after data migration. This will help determine the conversion and mapping relationships during the data migration process.
[0103] Estimate the data volume in the new repository: Based on the data volume in the old repository and the target data structure in the new repository, estimate the data volume in the new repository. The estimation can be made according to the number of fields and the average size of data records.
[0104] It should be noted that in the embodiments of this specification, the first migration data volume can correspond to the data volume of the data removed from the old repository, and the second migration data volume in the embodiments of this specification can correspond to the data volume of the data migrated into the new repository.
[0105] In the embodiments of this specification, before migrating the data to be migrated of the battery swapping station in the old repository to the new repository through the synchronization tool, it can be first determined whether the data volume of the data to be migrated of the battery swapping station in the old repository exceeds the pre-set single migration data volume; if so, divide the data to be migrated into multiple migration data volumes according to the pre-set single migration data volume, and if not, the data to be migrated of the battery swapping station in the old repository can be directly migrated to the new repository.
[0106] It should be noted that the relevant content for determining whether the data volume of the data to be migrated of the battery swapping station in the old repository exceeds the pre-set single migration data volume is as follows: the following are the specific implementation steps.
[0107] Pre-set the single migration data volume: Pre-set the data volume for each migration, which can be the maximum data volume that can be processed in one migration to ensure the smooth progress of the migration process.
[0108] Determine the total amount of data to be migrated: Evaluate and determine the total amount of data to be migrated in the old repository. The total amount of data can be estimated by querying the number of records or by counting the size of relevant data tables.
[0109] Determine whether the total amount exceeds the single migration data volume: Compare the total amount of data to be migrated with the pre-set single migration data volume. If the total amount exceeds the single migration data volume, data segmentation is required to divide the data to be migrated into multiple batches.
[0110] Calculate the number of migrations: Calculate the number of migrations required by dividing the total amount by the amount of data that needs to be migrated. This will determine the number of batches for the migration.
[0111] Divide the migration data: Divide the data to be migrated into multiple batches according to the number of migrations. Ensure that the amount of data in each batch does not exceed the pre-set single migration amount.
[0112] Configure the synchronization tool: Configure the synchronization tool according to the divided migration batches. Ensure that the synchronization tool can migrate the data of each migration batch from the old warehouse to the new warehouse according to the predetermined order and rules.
[0113] Start the synchronization tool for data migration: According to the configuration of the synchronization tool, start the migration process. The synchronization tool will migrate data from the old warehouse to the new warehouse batch by batch according to the specified migration order.
[0114] It should be noted that the embodiments of this specification can improve the efficiency and accuracy of data migration by determining whether the amount of data to be migrated at the battery swap station in the old warehouse exceeds the pre-set single migration data amount, and dividing the data into multiple migration data amounts when the amount of data to be migrated at the battery swap station exceeds the pre-set single migration data. This can avoid the problem of data loss or inconsistency caused by migrating too much data at one time. Dividing the data into multiple migration amounts can reduce the possibility of data omissions or erroneous operations, and ensure the integrity and accuracy of the data. This method can improve the security and reliability of data and reduce the probability of problems encountered by users during the battery swap process.
[0115] Furthermore, before determining whether the amount of data to be migrated in the battery swap stations in the old warehouse exceeds the preset single migration data amount, the embodiments of the present specification can first set the single migration data amount based on the type of battery swap stations, the number of battery swap stations, the processing capacity of the old warehouse, and the processing capacity of the new warehouse.
[0116] Among them, the processing capacity of the new warehouse in the embodiment of this specification may include storage capacity, processing speed and network bandwidth.
[0117] It should be noted that the embodiments of this specification can optimize the data migration method of the battery swap station from multiple aspects by analyzing the processing capabilities including storage capacity, processing speed and network bandwidth, so as to reduce data loss or inconsistency, thereby improving the effect of data migration.
[0118] It should be noted that regarding the above content of setting the amount of data migrated per time, the following are the specific implementation steps:
[0119] Understand the types and quantities of battery swapping stations: Evaluate the types and quantities of battery swapping stations to be migrated. The types and total numbers of battery swapping stations can be understood based on system records, station lists, or other relevant business data.
[0120] Evaluate the processing capabilities of the old warehouse and the new warehouse: Evaluate the processing capabilities of the old warehouse and the new warehouse. Consider factors such as the hardware specifications, storage capacity, and processing speed of the old warehouse and the new warehouse. In addition, the limitations of network bandwidth also need to be considered.
[0121] Set the amount of data migrated per time: Based on the types of battery swapping stations, the quantities of battery swapping stations, and the processing capabilities of the old warehouse and the new warehouse, set an appropriate amount of data migrated per time. Comprehensively consider factors such as system resources, network bandwidth, and migration time limits to ensure that the amount of data migrated per time is reasonable and feasible.
[0122] Configure the migration tool or script: Configure the pre-set amount of data migrated per time into the migration tool or script. Ensure that the migration tool can perform data migration operations according to the pre-set amount of data migrated per time.
[0123] It should be noted that in the embodiments of this specification, by setting the pre-set amount of data migrated per time according to the types, quantities of battery swapping stations, and the processing capabilities of the old warehouse and the new warehouse, the workload of data migration can be reasonably allocated, ensuring the efficiency and stability of the data migration process. By setting an appropriate amount of data migrated per time, the risk of data migration can be reduced, and the possibility of data loss or inconsistency can be minimized. This can improve the security and reliability of the entire data migration process, ensuring the integrity and accuracy of the battery swapping station data. In addition, setting the amount of data migrated per time according to specific circumstances can also increase the speed of data migration, shorten the battery swapping station data migration process of users, and reduce the problems that may occur during the battery swapping process of users.
[0124] Specifically, in the process of setting the amount of data migrated per time according to the types, quantities of battery swapping stations, the processing capabilities of the old warehouse, and the processing capabilities of the new warehouse in the embodiments of this specification, the time required to migrate the data to be migrated to the new warehouse can be estimated based on the types, quantities of battery swapping stations, and the pre-set initial amount of data migrated per time; if the difference between the required time and the pre-set migration time exceeds the preset value, the amount of data migrated per time is re-set according to the pre-set migration time, the types, quantities of battery swapping stations, the processing capabilities of the old warehouse, and the processing capabilities of the new warehouse.
[0125] It should be noted that regarding the relevant content of setting the amount of data migrated per time above, the following are the specific implementation steps:
[0126] Determine the type of the battery swapping station: Based on the requirements and actual situation, determine the type of the battery swapping station to be built, such as a fast battery swapping station, an ordinary battery swapping station, etc.
[0127] Determine the number of battery swapping stations: Based on the requirements and actual situation, determine the number of battery swapping stations to be built.
[0128] Analyze the processing capacity of the old warehouse: Understand the processing capacity of the old warehouse, including data migration speed and capacity, etc.
[0129] Analyze the processing capacity of the new warehouse: Understand the processing capacity of the new warehouse, including data migration speed and capacity, etc.
[0130] Set the initial amount of data migrated per single time: Based on the type and number of battery swapping stations, set the initial amount of data migrated per single time.
[0131] Estimate the time required for migration: Based on the initial amount of data migrated per single time, estimate the time required to migrate the data to be migrated to the new warehouse.
[0132] Check the difference in migration time: Compare the difference between the estimated time required for migration and the pre-set migration time, and determine whether it exceeds the pre-set value.
[0133] Reset the amount of data migrated per single time: If the difference between the required time and the pre-set migration time exceeds the pre-set value, then based on the pre-set migration time, the type of battery swapping station, the number of battery swapping stations, the processing capacity of the old warehouse, and the processing capacity of the new warehouse, reset the amount of data migrated per single time.
[0134] In addition, if the difference between the required time and the pre-set migration time does not exceed the pre-set value, the data can be migrated through the initial amount of data migrated per single time.
[0135] Through the above steps, based on the type and number of battery swapping stations and the processing capacity of the warehouse, the amount of data migrated per single time can be reasonably set to meet the pre-set migration time requirements.
[0136] It should be noted that when resetting the amount of data migrated per single time, the specific implementation steps are as follows:
[0137] Analyze the difference between the migration time and the pre-set value: Calculate the difference between the estimated time required for migration and the pre-set migration time.
[0138] Analyze the reason for the difference: Based on the magnitude and direction of the difference, analyze the reason for the difference exceeding the pre-set value, which may include insufficient number of battery swapping stations, inappropriate selection of the type of battery swapping station, insufficient processing capacity of the old warehouse, or insufficient processing capacity of the new warehouse, etc.
[0139] Check the number and type of battery swap stations: Check whether the set number and type of battery swap stations are suitable for the migration process. If the number is insufficient or the type is not properly selected, adjustments need to be made.
[0140] Analyze the processing capacity of the warehouse: Understand the processing capacity of the old and new warehouses, including data migration speed and capacity, etc.
[0141] Reset the amount of data migrated each time according to the actual situation: Combine the preset migration time, the type and number of battery swap stations, the processing capacity of the old warehouse, and the processing capacity of the new warehouse to reset the amount of data migrated each time.
[0142] Re-estimate the migration time: According to the adjusted amount of data migrated each time, re-estimate the time required to migrate the data to be migrated to the new warehouse.
[0143] Check the adjustment effect: Compare the re-estimated migration time with the preset migration time to check whether it meets the preset value requirements.
[0144] Adjust repeatedly: If there is still a difference exceeding the preset value, you can continue to make repeated adjustments until the preset value requirements are met.
[0145] Through the above steps, according to the direction and magnitude of the difference, combined with the preset migration time, the type and number of battery swap stations, the processing capacity of the old warehouse, and the processing capacity of the new warehouse, the amount of data migrated each time can be reset to achieve the preset migration time target.
[0146] It should be noted that in the embodiments of this specification, by setting the preset amount of data migrated each time according to the type and number of battery swap stations and the processing capacity of the old and new warehouses, and estimating the required time, the workload and time of data migration can be reasonably allocated, improving the efficiency and accuracy of data migration. If there is a large difference between the estimated required time and the preset migration time, the amount of data migrated each time can be reset according to the actual situation to meet the requirements of the migration time. This can avoid data loss or inconsistency problems caused by excessive data volume during the data migration process and ensure the accuracy and integrity of the subsequent battery swap station data of users. This method can improve the controllability and reliability of data migration, reduce the risk of data migration, and ensure the smooth progress of the battery swapping process for users.
[0147] Further, the initial amount of data migrated in a single time may not match the processing capabilities of the old warehouse and the new warehouse. Before estimating the time required to migrate the data to be migrated to the new warehouse according to the type of the battery swapping station, the number of battery swapping stations, and the preset initial amount of data migrated in a single time, the threshold of the amount of data migrated in a single time can be determined according to the processing capabilities of the old warehouse and the new warehouse; if the initial amount of data migrated in a single time does not meet the threshold of the amount of data migrated in a single time, the amount of data migrated in a single time can be reset according to the preset migration time, the type of the battery swapping station, the number of battery swapping stations, the processing capabilities of the old warehouse, and the processing capabilities of the new warehouse.
[0148] It should be noted that the specific implementation steps for setting the amount of data migrated in a single time are as follows:
[0149] Analyze the processing capabilities of the old warehouse and the new warehouse: Understand the processing capabilities of the old warehouse and the new warehouse, including data migration speed, capacity, etc.
[0150] Determine the threshold of the amount of data migrated in a single time: According to the processing capabilities of the old warehouse and the new warehouse, combined with the type and number of battery swapping stations, determine the threshold of the amount of data migrated in a single time, that is, the amount of data migrated each time should not exceed the processing capabilities of the old warehouse and the new warehouse.
[0151] Check the initial amount of data migrated in a single time: Check whether the set initial amount of data migrated in a single time meets the threshold of the amount of data migrated in a single time.
[0152] Reset the amount of data migrated in a single time according to the actual situation: If the initial amount of data migrated in a single time does not meet the threshold of the amount of data migrated in a single time, reset the amount of data migrated in a single time according to the preset migration time, the type, number, processing capabilities of the old warehouse, and processing capabilities of the new warehouse of the battery swapping station.
[0153] Estimate the migration time: According to the reset amount of data migrated in a single time, estimate the time required to migrate the data to be migrated to the new warehouse.
[0154] Check the adjustment effect: Compare the estimated migration time with the preset migration time to check whether it meets the preset value requirements.
[0155] Adjust repeatedly: If there are still non-compliant situations, repeated adjustments can be made until the preset value requirements are met.
[0156] Through the above steps, the threshold of the amount of data migrated in a single time can be determined according to the processing capabilities of the old warehouse and the new warehouse, and the amount of data migrated in a single time can be reset according to the actual situation, so as to achieve the preset migration time target and ensure that the data is migrated within the processing capabilities of the old warehouse and the new warehouse.
[0157] It should be noted that in the embodiments of this specification, the threshold of the amount of data migrated at one time is determined according to the processing capacity of the warehouse, which can make full use of the warehouse resources and avoid data loss or inconsistency caused by overloading.
[0158] Moreover, according to the preset migration time and the processing capacity of the warehouse, the amount of data migrated at one time is reset, which can reasonably arrange the migration time, ensure the completion of data migration within the limited time range, and reduce the delay and uncertainty during the migration process.
[0159] At the same time, by resetting the amount of data migrated at one time, the efficiency and speed of migration can be improved on the premise of ensuring the integrity and accuracy of the data, and the problems that may occur during the subsequent battery replacement process of users can be reduced.
[0160] In addition, by adjusting the amount of data migrated at one time according to the actual situation, the characteristics of different warehouses and battery replacement stations can be flexibly coped with, and the data migration requirements under different scenarios can be met.
[0161] S104. Compare whether the first migration data volume is the same as the second migration data volume.
[0162] In the embodiments of this specification, comparing whether the first migration data volume and the second migration data volume are the same means judging whether the two are equal.
[0163] Furthermore, if the amount of data to be migrated exceeds the amount of data migrated at one time; the data to be migrated of the battery replacement station in the old warehouse can be migrated to the new warehouse one by one through a synchronization tool according to the amount of data migrated multiple times, and the first migration data component corresponding to the old warehouse and the second migration data component corresponding to the new warehouse are determined respectively; compare whether each first migration data component is the same as the corresponding second migration data component respectively.
[0164] It should be noted that the migration process when the amount of data to be migrated exceeds the amount of data migrated at one time can be carried out through the following specific implementation steps:
[0165] Set the amount of data migrated multiple times: If the amount of data to be migrated exceeds the amount of data migrated at one time, set the amount of data migrated multiple times according to the actual situation, that is, divide the data to be migrated into multiple batches for migration.
[0166] Use the synchronization tool for sequential migration: Use a suitable synchronization tool to sequentially migrate the data to be migrated of the battery replacement station in the old warehouse to the new warehouse according to the set amount of data migrated multiple times.
[0167] Determine the first migration data component and the second migration data component: Determine the first migration data component corresponding to the old warehouse and the second migration data component corresponding to the new warehouse respectively to ensure the consistency and accuracy of the data.
[0168] Compare the first migration data component with the second migration data component: Compare whether each first migration data component is consistent with the corresponding second migration data component to ensure the correct migration of data.
[0169] Calibrate the data volume: If it is found that the first migration data component is inconsistent with the second migration data component, calibrate the data volume, find out the reason for the difference and make corrections.
[0170] Through the above steps, when the data volume to be migrated exceeds the single - migration data volume, the synchronization tool can be used to migrate the data in the old warehouse to the new warehouse successively, and compare the consistency between the first migration data component and the second migration data component to ensure the accurate migration of data.
[0171] It should be noted that in the embodiments of this specification, the data to be migrated is divided into multiple migration data volumes, which can reduce the data volume migrated each time and reduce the risk of data loss or errors. By comparing whether the first migration data volume and the second migration data volume are consistent, problems that may exist during the data migration process can be detected in a timely manner, thereby reducing the situation of data inconsistency.
[0172] At the same time, in the embodiments of this specification, by migrating data successively, the data can be verified after each migration to ensure the accuracy of the migrated data. This can avoid the situation where problems occur during large - scale data migration and lead to the need to re - migrate the data, thereby improving the efficiency of data migration.
[0173] In addition, in the embodiments of this specification, by setting the single - migration data volume, the workload of data migration can be reasonably divided according to the processing capabilities of the old warehouse and the new warehouse, avoiding the situation where the one - time migration data volume is too large, resulting in too long a migration time or excessive resource occupation.
[0174] S106, if they are consistent, sample and compare whether the verification values corresponding to the same identifiers in the old warehouse and the new warehouse are consistent. That is, the first migration data volume is consistent with the second migration data volume.
[0175] In the embodiments of this specification, if they are inconsistent, that is, the first migration data volume is inconsistent with the second migration data volume, it can be determined whether the number of times of migrating the data to be migrated of the power exchange station in the old warehouse to the new warehouse again through the synchronization tool exceeds a first preset number of times. The first preset quantity can be set according to the actual situation. For example, the first preset number of times is 3; if it has exceeded the first preset number of times, the process can be terminated; if it has not exceeded the first preset number of times, the data to be migrated of the power exchange station in the old warehouse can be migrated to the new warehouse again through the synchronization tool, determine the third migration data volume corresponding to the old warehouse and the fourth migration data volume corresponding to the new warehouse; compare whether the third migration data volume is consistent with the fourth migration data volume.
[0176] It should be noted that if the data volumes after migration are inconsistent, the embodiments of this specification can determine whether the number of migrations exceeds a first preset number. If not, the synchronization tool will be reused for migration to ensure data integrity and consistency. This can timely correct possible errors during data migration and avoid data loss or inconsistency problems.
[0177] Meanwhile, the embodiments of this specification can further verify the accuracy and integrity of migration by comparing the third migration data volume and the fourth migration data volume. If the third migration data volume is consistent with the fourth migration data volume, it can be confirmed that the data volumes of the data migration are the same, which effectively prevents the uncertainty of data migration and improves the success rate of data migration.
[0178] S108, if they are consistent, the data to be migrated is completed from the old warehouse to the new warehouse. That is, the verification values corresponding to the same identifier in the old warehouse and the new warehouse are consistent.
[0179] In the embodiments of this specification, if they are inconsistent, that is, the verification values corresponding to the same identifier in the old warehouse and the new warehouse are inconsistent, it can be determined whether the number of times of migrating the data to be migrated of the power exchange station in the old warehouse to the new warehouse again through the synchronization tool exceeds a second preset number. The second preset number can be set according to the actual situation. For example, the second preset number is 3; if it has exceeded the second preset number, the process can be terminated; if it has not exceeded the second preset number, the data to be migrated of the power exchange station in the old warehouse can be migrated to the new warehouse again through the synchronization tool, and the fifth migration data volume corresponding to the old warehouse and the sixth migration data volume corresponding to the new warehouse are determined; whether the fifth migration data volume is consistent with the sixth migration data volume is compared; if the fifth migration data volume and the sixth migration data volume are compared, the verification values corresponding to the same identifier in the old warehouse and the new warehouse are resampled and compared whether they are consistent.
[0180] It should be noted that if the verification values compared by resampling after migration are inconsistent, the embodiments of this specification can determine whether the number of migrations exceeds the second preset number. If not, the synchronization tool will be reused for migration to ensure data integrity and consistency. This can timely correct possible errors during data migration and avoid data loss or inconsistency problems.
[0181] Meanwhile, the embodiments of this specification can further verify the accuracy and integrity of migration by comparing the fifth migration data volume and the sixth migration data volume. If the fifth migration data volume is consistent with the sixth migration data volume, the verification values can be resampled and compared whether they are consistent. If the verification values compared by resampling are consistent, it can be confirmed that the data migration is successful, which effectively prevents the uncertainty of data migration and improves the success rate of data migration.
[0182] It should be noted that the specific implementation steps of the above S106 and S108 are as follows:
[0183] Sampling and comparing check values: Randomly select a part of the data from the old warehouse and the new warehouse, and calculate their check values. The check values corresponding to the same identifier can be crc16 values or hash values.
[0184] Comparing check values: Compare whether the check values of the data with the same identifier in the old warehouse and the new warehouse are consistent. If the check values are consistent, it means that the data has not changed during the migration process.
[0185] Completing data migration: If the check values are consistent, that is, the data with the same identifier in the old warehouse and the new warehouse remains consistent after migration, it means that the data to be migrated has been successfully migrated from the old warehouse to the new warehouse.
[0186] It should be noted that according to the check value corresponding to the same identifier being the crc16 value, the accuracy and integrity of the data migration in the battery swapping station can be further enhanced, and the reliability of data verification can be increased. Using crc16 as the check value can compare whether the data with the same identifier in the old warehouse and the new warehouse is consistent during the data migration process. crc16 is a commonly used verification algorithm that generates a 16-bit check value by calculating the data. If the crc16 values corresponding to the same identifier in the old warehouse and the new warehouse are consistent, it can be considered that there is no data loss or incorrect operation during the data migration process, thereby increasing the reliability of the data migration.
[0187] In summary, crc16 verification can effectively detect whether bit errors or data loss have occurred during data transmission. If the crc16 verification is consistent, it can ensure the consistency of the migrated data between the old warehouse and the new warehouse, thereby guaranteeing the integrity of the data. If the crc16 verification is inconsistent, the specific data number can be traced, thereby discovering possible data omissions or incorrect operations during the data migration process. This helps to promptly discover problems, make corrections, and reduce the risk of data errors. By sampling and comparing the crc16 check values corresponding to the same identifier, the verification of all data can be reduced while ensuring data integrity, improving the efficiency of data migration.
[0188] Furthermore, in order to more quickly compare whether the check values corresponding to the same identifier in the sampled data of the old warehouse and the new warehouse are consistent, a check value for the overall sampled data can be determined. Specifically, it can be implemented through the following specific implementation plan:
[0189] Sample multiple groups of data with the same identifier in the old warehouse and the new warehouse. The multiple groups of data include first sampled data corresponding to the old warehouse and second sampled data corresponding to the new warehouse. Determine a first check value corresponding to the old warehouse according to the first sampled data corresponding to the old warehouse. Determine a second check value corresponding to the new warehouse according to the second sampled data corresponding to the new warehouse. Compare whether the first check value and the second check value are consistent to determine whether the data in the old warehouse and the new warehouse are consistent. The check value corresponding to the same identifier can be a crc16 value.
[0190] It should be noted that in the embodiments of this specification, by sampling in combination with multiple groups of data to generate a first check value and a second check value, it is possible to quickly determine whether the data sets with the same identifier in the old warehouse and the new warehouse are consistent. This fast comparison mechanism reduces waiting time and resource consumption, especially when dealing with a large amount of data.
[0191] At the same time, in the embodiments of this specification, by generating check values in combination with multiple groups of data, the accuracy of error detection can be improved. Compared with the verification of a single data point, the method of combining multiple data can more comprehensively reflect the overall state of the data, thus effectively reducing misjudgments caused by accidental data errors or deviations.
[0192] It should be noted that as the number of battery swapping stations increases, the number of users also increases. There is more and more data at the station end. The query speed of the old big data platform is getting slower and slower, bringing a bad user experience to users. Since the data of the battery swapping station is stored in the old big data analysis platform, it needs to be migrated to a new big data storage platform to support more and more data queries. During the big data migration process, how to ensure zero data loss and consistency is a very important topic. During the data migration process, first ensure that the total number of data in the old and new warehouses is the same to ensure zero loss, and then randomly sample the data and verify the data according to the crc algorithm to ensure data consistency. Through the above process and verification, the data quality is ensured, the smooth transition of the new and old platform systems is realized, and users can query and analyze data in the new system, bringing a better experience to users.
[0193] Figure 2 It is a flow chart of a method for migrating station-end data without data loss provided by one or more embodiments of this specification. The old warehouse (hive) of the station-end data and the new warehouse (olap) of the station-end data migrate the station-end data through a scheduling system. During this period, the verified data is judged whether it is consistent through the synchronization tool (datax) of the scheduling system and the data verification algorithm.
[0194] Figure 3The flow diagram of data migration verification provided for one or more embodiments of this specification. The old warehouse (hive) scheduling and synchronization system of the station-side data is synchronized to the new warehouse (olap) of the station-side data. The total number of data in the old and new warehouses is counted and judged whether they are consistent. If they are consistent, one-thousandth of the total number of data in the old and new warehouses is taken, and the crc16 values of the old and new data are calculated and judged whether they are consistent. If they are consistent, it ends. If they are inconsistent, it is judged whether to retry three times. If so, an alarm message is sent and the problem is processed manually.
[0195] It should be noted that the embodiments of this specification provide a method for migrating station-side data without loss, specifically including:
[0196] 1. Use the big data synchronization tool datax to migrate the data in the old warehouse to the new warehouse;
[0197] 2. Count the total amount of data in the migrated data tables, compare the total amount of data in the two old and new warehouses. If they are inconsistent, use the data synchronization tool datax to migrate the data in the old warehouse to the new warehouse again;
[0198] 3. If it is still inconsistent after retrying three times, send an alarm email;
[0199] 4. If they are consistent, then sample. Randomly take 100,000 unique id values from the old warehouse table, and then randomly sample 1,000 ids, and take out these 1,000 pieces of data from the old and new reports;
[0200] 5. Calculate the crc16 values in the old and new warehouses, and then make a comparison and judgment;
[0201] 6. If they are inconsistent, retry three times. Each time during the retry, use the data synchronization tool datax to migrate the data in the old warehouse to the new warehouse again;
[0202] 7. If it is still inconsistent after retrying three times, send an email or text message for notification;
[0203] 8. Developers receive the alarm and perform manual intervention and processing.
[0204] It should be noted that when the station-side data is migrated to a new data warehouse, the data verification algorithm is used to ensure data consistency and zero loss. At the same time, during the migration process, data integrity is achieved. After being used in the new big data platform, the query performance is improved, which better serves the company and customers.
[0205] Figure 4 The structural diagram of a data migration device for a battery swapping station provided for one or more embodiments of this specification includes:
[0206] At least one processor; and,
[0207] A memory communicatively connected to at least one processor; wherein,
[0208] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to implement the data migration method of the battery swapping station as described in any one of the above embodiments, specifically including:
[0209] Migrate the data to be migrated of the battery swapping station in the old warehouse to the new warehouse through a synchronization tool, and determine the first migration data volume corresponding to the old warehouse and the second migration data volume corresponding to the new warehouse;
[0210] Compare whether the first migration data volume is consistent with the second migration data volume;
[0211] If they are consistent, sample and compare whether the check values corresponding to the same identifiers in the old warehouse and the new warehouse are consistent;
[0212] If they are consistent, complete the migration of the data to be migrated from the old warehouse to the new warehouse.
[0213] A non - volatile computer storage medium provided by one or more embodiments of this specification, storing computer - executable instructions, and when the computer - executable instructions are executed by a computer, they can implement the data migration method of the battery swapping station as described in any one of the above embodiments, specifically including:
[0214] Migrate the data to be migrated of the battery swapping station in the old warehouse to the new warehouse through a synchronization tool, and determine the first migration data volume corresponding to the old warehouse and the second migration data volume corresponding to the new warehouse;
[0215] Compare whether the first migration data volume is consistent with the second migration data volume;
[0216] If they are consistent, sample and compare whether the check values corresponding to the same identifiers in the old warehouse and the new warehouse are consistent;
[0217] If they are consistent, complete the migration of the data to be migrated from the old warehouse to the new warehouse.
[0218] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the embodiments of the device and the non - volatile computer storage medium, since they are basically similar to the method embodiments, the description is relatively simple, and for the relevant parts, reference can be made to the partial description of the method embodiments.
[0219] The above description has been made of specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0220] The above is only one or more embodiments of this specification and is not intended to limit this specification. For those skilled in the art, various changes and modifications can be made to one or more embodiments of this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of one or more embodiments of this specification shall be included within the scope of the claims of this specification.
Claims
1. A method for data migration of a battery swapping station, characterized in that, The method includes: Migrate the data to be migrated of the battery swapping stations in the old warehouse to the new warehouse through a synchronization tool, and determine the first migration data volume corresponding to the old warehouse and the second migration data volume corresponding to the new warehouse; Compare whether the first migration data volume is consistent with the second migration data volume; If they are consistent, sample and compare whether the verification values corresponding to the same identifiers in the old warehouse and the new warehouse are consistent; If they are consistent, complete the migration of the data to be migrated from the old warehouse to the new warehouse.
2. The method according to claim 1, wherein Before migrating the data to be migrated of the battery swapping stations in the old warehouse to the new warehouse through the synchronization tool, it includes: Determine whether the data volume of the data to be migrated of the battery swapping stations in the old warehouse exceeds the preset single - migration data volume; If so, divide the data to be migrated into multiple migration data volumes according to the preset single - migration data volume; Preferably, before determining whether the data volume of the data to be migrated of the battery swapping stations in the old warehouse exceeds the preset single - migration data volume, the method further includes: Set the single - migration data volume according to the type of the battery swapping stations, the number of the battery swapping stations, the processing capacity of the old warehouse, and the processing capacity of the new warehouse.
3. The method according to claim 2, wherein Setting the single - migration data volume according to the type of the battery swapping stations, the number of the battery swapping stations, the processing capacity of the old warehouse, and the processing capacity of the new warehouse includes: Estimate the time required to migrate the data to be migrated to the new warehouse according to the type of the battery swapping stations, the number of the battery swapping stations, and the preset initial single - migration data volume; If the difference between the required time and the preset migration time exceeds the preset value, reset the single - migration data volume according to the preset migration time, the type of the battery swapping stations, the number of the battery swapping stations, the processing capacity of the old warehouse, and the processing capacity of the new warehouse.
4. The method according to claim 3, characterized in that, Before estimating the time required to migrate the data to be migrated to the new warehouse according to the type of the battery swapping stations, the number of the battery swapping stations, and the preset initial single - migration data volume, the method further includes: Determine the single - migration data threshold according to the processing capacity of the old warehouse and the processing capacity of the new warehouse; If the initial single - migration data volume does not meet the single - migration data threshold, reset the single - migration data volume according to the preset migration time, the type of the battery swapping stations, the number of the battery swapping stations, the processing capacity of the old warehouse, and the processing capacity of the new warehouse.
5. The method according to claim 2, wherein If the data volume of the data to be migrated exceeds the single - migration data volume; Migrate the data to be migrated of the battery swapping stations in the old warehouse to the new warehouse through a synchronization tool, and determine the first migration data volume corresponding to the old warehouse and the second migration data volume corresponding to the new warehouse; Comparing whether the first migration data volume is consistent with the second migration data volume includes: According to the multiple migration data volumes, migrate the data to be migrated of the battery swapping stations in the old warehouse to the new warehouse through the synchronization tool successively, and respectively determine the first migration data component corresponding to the old warehouse and the second migration data component corresponding to the new warehouse; Compare whether each first migration data component is consistent with the corresponding second migration data component respectively.
6. The method according to claim 1, wherein If the first migration data volume is inconsistent with the second migration data volume, the method further includes: Determine whether the number of times of migrating the data to be migrated of the power exchange station in the old warehouse to the new warehouse again through the synchronization tool exceeds a first preset number of times; If not, migrate the data to be migrated of the power exchange station in the old warehouse to the new warehouse again through the synchronization tool, and determine the third migration data volume corresponding to the old warehouse and the fourth migration data volume corresponding to the new warehouse; Compare whether the third migration data volume is consistent with the fourth migration data volume.
7. The method according to claim 1, characterized in that If the verification values corresponding to the same identifiers in the old warehouse and the new warehouse are inconsistent in the sampling comparison, the method further includes: Determine whether the number of times of migrating the data to be migrated of the power exchange station in the old warehouse to the new warehouse again through the synchronization tool exceeds a second preset number of times; If not, migrate the data to be migrated of the power exchange station in the old warehouse to the new warehouse again through the synchronization tool, and determine the fifth migration data volume corresponding to the old warehouse and the sixth migration data volume corresponding to the new warehouse; Compare whether the fifth migration data volume is consistent with the sixth migration data volume; If they are consistent, resample and compare whether the verification values corresponding to the same identifiers in the old warehouse and the new warehouse are consistent.
8. The method according to claim 1, characterized in that The sampling comparison of whether the verification values corresponding to the same identifiers in the old warehouse and the new warehouse are consistent includes: Sample multiple groups of data with the same identifier in the old warehouse and the new warehouse, and the multiple groups of data include the first sampled data corresponding to the old warehouse and the second sampled data corresponding to the new warehouse; Determine the first verification value corresponding to the old warehouse according to the first sampled data corresponding to the old warehouse; Determine the second verification value corresponding to the new warehouse according to the second sampled data corresponding to the new warehouse; Compare whether the first verification value is consistent with the second verification value to determine whether the data in the old warehouse and the new warehouse is consistent; Preferably, the verification value corresponding to the same identifier is the crc16 value.
9. A data migration device for an electric vehicle battery swapping station, characterized in that, Includes: At least one processor; And, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can implement the power exchange station data migration method according to any one of claims 1-8.
10. A non-volatile computer storage medium, characterized in that, Stores computer-executable instructions, and when the computer-executable instructions are executed by a computer, the power exchange station data migration method according to any one of claims 1-8 can be implemented.