Data migration method, system, terminal device, and storage medium
Patent Information
- Application Number
- CN202611449612.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-17
- Publication Date
- 2026-10-30
AI Technical Summary
[0003]当现场存在多个相同或相似的站端屏设备,在调试完成后,其项目配置(参数、逻辑、画面关联)无法高效地同步到新设备或替换设备,需人工逐台重新设置,易出错、效率低和运行数据迁移风险高
使得普通电工或现场人员无需懂编程、不懂网络配置,只需导入项目配置压缩包文件即可看到可视化画面(包括柜面图和电气线路图),真正实现即插即用。另外相比传统方法需数小时甚至数天的开发调试,本申请将部署时间缩短至几秒钟,极大降低了实施成本。
Smart Images

Figure CN123011334A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a data migration method, system, terminal device, and storage medium. Background Technology
[0002] The substation terminal screen is a local integrated monitoring device deployed in the substation. It integrates industrial touch display, data acquisition, logic control and communication transmission functions, and can display the operating parameters, switch status and environmental security information of electrical equipment such as high and low voltage switchgear and transformers in real time.
[0003] When multiple identical or similar station-end screen devices exist on-site, their project configurations (parameters, logic, screen associations) cannot be efficiently synchronized to new or replaced devices after commissioning. This necessitates manual reconfiguration for each device, which is error-prone, inefficient, and carries a high risk of data migration issues. While online server synchronization or dedicated engineering software can sometimes be used, these methods are unsuitable when on-site networks are unstable or professional tools are lacking. Summary of the Invention
[0004] In view of this, embodiments of this application provide a data migration method, system, terminal device, and storage medium, which can effectively solve the above problems.
[0005] In a first aspect, embodiments of this application provide a data migration method, the method comprising: Obtain the project configuration compressed file and decompress it to obtain the project configuration decompressed file; Perform step-by-step mapping parsing on the project configuration decompression file to obtain the target format string; The target format string is stored in the application cache directory of the local application to obtain a local configuration file, which includes at least a device list and a loop name. Based on the device list and the circuit name, a cabinet layout diagram is generated and saved to the local configuration file, and the configuration of the local configuration file is refreshed.
[0006] Secondly, embodiments of this application provide a data migration system, the system comprising: The decompression module is used to obtain the project configuration compressed package file and decompress the project configuration compressed package file to obtain the project configuration decompressed file; The parsing module is used to perform step-by-step mapping parsing on the project configuration decompression file to obtain the target format string; The storage module is used to store the target format string to the application cache directory of the local application to obtain a local configuration file, wherein the local configuration file includes at least a device list and a loop name; The configuration module is used to generate a cabinet diagram based on the device list and the circuit name, save it to the local configuration file, and refresh the configuration of the local configuration file.
[0007] Thirdly, this application also provides a terminal device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps: Obtain the project configuration compressed file and decompress it to obtain the project configuration decompressed file; Perform step-by-step mapping parsing on the project configuration decompression file to obtain the target format string; The target format string is stored in the application cache directory of the local application to obtain a local configuration file, which includes at least a device list and a loop name. Based on the device list and the circuit name, a cabinet layout diagram is generated and saved to the local configuration file, and the configuration of the local configuration file is refreshed.
[0008] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps: Obtain the project configuration compressed file and decompress it to obtain the project configuration decompressed file; Perform step-by-step mapping parsing on the project configuration decompression file to obtain the target format string; The target format string is stored in the application cache directory of the local application to obtain a local configuration file, which includes at least a device list and a loop name. Based on the device list and the circuit name, a cabinet layout diagram is generated and saved to the local configuration file, and the configuration of the local configuration file is refreshed.
[0009] The embodiments of this application have the following beneficial effects: This allows ordinary electricians or field personnel to access a visual interface (including countertop diagrams and electrical wiring diagrams) simply by importing the project configuration compressed file, without needing programming or network configuration knowledge, truly achieving plug-and-play functionality. Furthermore, compared to traditional methods that require hours or even days of development and debugging, this application reduces deployment time to mere seconds, significantly lowering implementation costs. Attached Figure Description
[0010] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This paper illustrates a first flowchart of a data migration method according to an embodiment of the present application. Figure 2 This paper illustrates a schematic diagram of the process for generating the project configuration decompression file according to an embodiment of this application. Figure 3 A second flowchart of the data migration method according to an embodiment of this application is shown; Figure 4 This paper illustrates a backup process diagram of the data migration method according to an embodiment of this application; Figure 5 A schematic diagram of the data migration system according to an embodiment of this application is shown. Detailed Implementation
[0012] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.
[0013] The components of the embodiments of this application described and illustrated in the accompanying drawings can be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of this application provided in the drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0014] In the following text, the terms "comprising," "having," and their cognates, which may be used in various embodiments of this application, are intended only to indicate a particular feature, number, step, operation, element, component, or combination thereof, and should not be construed as primarily excluding the presence of one or more other features, numbers, steps, operations, elements, components, or combinations thereof, or adding the possibility of one or more combinations thereof. Furthermore, the terms "first," "second," "third," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance.
[0015] Unless otherwise specified, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments of this application pertain. Terms (such as those defined in commonly used dictionaries) shall be interpreted as having the same meaning as in their contextual meaning in the relevant technical field and shall not be construed as having an idealized or overly formal meaning, unless clearly defined in the various embodiments of this application.
[0016] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0017] When there are multiple identical or similar station-end screen devices on site, after debugging, their project configuration (parameters, logic, screen association) cannot be efficiently synchronized to the new or replaced devices. They need to be manually reset one by one, which is prone to errors, inefficient, and carries a high risk of data migration.
[0018] Therefore, this application provides a data migration method, system, terminal device, and storage medium. This allows ordinary electricians or field personnel, without programming or network configuration knowledge, to simply import the project configuration compressed file to see a visual interface, and reduces deployment time to a few seconds, significantly lowering implementation costs.
[0019] The following describes the data migration method, system, terminal device, and storage medium using specific embodiments.
[0020] Figure 1 A schematic flowchart of a first embodiment of the data migration method of this application is shown. Exemplarily, the data migration method includes the following steps: Step S102: Obtain the project configuration compressed file and decompress it to obtain the project configuration decompressed file.
[0021] The user interface can be a file manager interface, which is a system-level document selection interface provided by the Android system natively, used by users to browse local storage and select ZIP format project configuration archives when offline; the project configuration archive file is a ZIP format archive file that conforms to a preset directory structure; the project configuration decompressed file is a set of files obtained by decompressing the project configuration archive file in a temporary decompressed directory created under the application cache directory.
[0022] Specifically, the process begins with the user selecting a project configuration archive file for import via a file manager (a system file selector). This involves invoking the Android system's storage access framework, triggering a system-level intent to open a document, and launching the system's native file manager interface. After the user selects a project configuration archive file of a specified type within the interface, the system returns a resource unified identifier (URI). The application uses this identifier to obtain read permissions and data streams for the target file, thus enabling the secure import of the project configuration archive file.
[0023] Optionally, for the imported data as a ZIP format project configuration compressed file, the main contents include: the project configuration decompressed file, named app_config.xlsx; and a folder named svg (Scalable Vector Graphics) that stores the electrical wiring diagrams corresponding to each circuit, in svg format, such as incoming line cabinet.svg.
[0024] Then, a temporary decompression directory is created in the application cache directory, and the project configuration compressed file is decompressed to the temporary decompression directory to obtain multiple decompressed sub-files; based on the actual output path of each decompressed sub-file, at least one target decompressed sub-file is selected from the multiple decompressed sub-files; based on the target decompressed sub-file, the project configuration decompressed file is determined and written to the application cache directory.
[0025] Optional, see reference Figure 2 When selecting import in the file manager interface, a temporary decompression directory is created under the application cache directory (a type of system cache directory) to hold the decompression results. The purpose is to avoid directly overwriting online data; to support a secure process of verification before disk writing; and to allow deletion and re-decompression after decompression failure / verification failure.
[0026] Before actual decompression, the list of compressed files is read, and each item in the list is configured to perform two levels of security checks. The first level of check is path semantic security check, which rejects absolute paths, drive letter paths, and directory crossings. The second level of check is normalized absolute path out-of-bounds check, which means that the output path must be normalized and within the normalized prefix of the target directory.
[0027] The project configuration compressed file, after passing the above two levels of security checks, is decompressed. Optionally, this application adopts a decompression strategy that prioritizes the Chinese character internal code extension specification and Unicode conversion format -8 bits. Specifically, it attempts to decode and read the file header information using the Chinese character internal code extension specification and decompress it; if an exception is thrown during decompression, the temporary directory is deleted and Unicode conversion format -8 bits is used to decompress it again; if decompression is successful but fails in subsequent vector graphics resource (SVG) verification, and the failure is due to the electrical circuit diagram not being found, it is determined that the filename mismatch may be caused by encoding, and a second rollback of Unicode conversion format -8 bits re-decompression + re-parsing + re-verification is performed.
[0028] Through the above embodiments, the native file selector is triggered to achieve secure and compliant import of compressed packages in an offline environment; two-level path verification (semantic + standardized out-of-bounds) effectively prevents directory traversal and unauthorized writing, ensuring system file security and decompression reliability.
[0029] Step S104: Perform step-by-step mapping parsing on the project configuration decompression file to obtain the target format string.
[0030] The target format string refers to the structured JSON text generated through serialization after step-by-step mapping parsing, which is also known as the target JSON string.
[0031] It should be noted that the unzipped project configuration file (Excel file, app_config.xlsx) has the following structure: different types of configurations are stored in different sub-tables, mainly including global configuration, MQTT configuration, device loop information, and other entries (wireless temperature measurement mapping and SVG mapping, etc.). All sub-table names and headers are named in Chinese. Configuration information can be added later by adding new sheets.
[0032] The information contained in each sub-table is as follows: The global configuration includes the configuration file version, description, and other relevant information; the MQTT configuration includes the MQTT service configuration information subscribed to by the project, and multiple MQTT services can be configured. The station-side screen receives telemetry and remote adjustment information from each loop device through the configured MQTT parameters; the device list includes device ID, device name, gateway, loop topology, device model, and other information. Optionally, other table entries typically contain configuration information for some devices, such as a mapping table of temperature sensor measuring points and cabinet electrical wiring diagrams, depending on actual needs.
[0033] Specifically, using a spreadsheet processing framework tool, the system reads each worksheet line by line according to the order of the worksheets in the project configuration decompression file to obtain the cell data corresponding to each worksheet; it then maps the cell data of each worksheet to Java entity objects in memory; using a data serialization tool, it formats and converts the Java entity objects to obtain candidate JSON strings, and returns the candidate JSON strings through a preset interface; it then performs vector existence validation on the candidate JSON strings, and uses the candidate JSON strings that pass the validation as the target format string.
[0034] Optionally, the project configuration unzipped file (Excel) import strategy uses a distributed mapping mechanism, rather than directly and tightly coupling the Excel data to the final configuration object. Specifically, this includes: First, relying on a spreadsheet processing framework tool, the contents of the Excel file are read line by line, one sheet at a time. After extracting the data from each cell, it is directly mapped into Java entity objects in memory, and basic data normalization is performed during the mapping process (such as normalizing and completing the deployment location information of smoke / water immersion sensors, such as cabinets and loops).
[0035] Then, using a data serialization tool, the Java entity objects in memory are converted into formatted JSON strings (as intermediate states) and returned through an interface. Understandably, the advantage of introducing intermediate states is that it decouples the underlying Excel parsing logic from the upper-level business logic, making configuration data transfer across modules (from utility classes to UI controllers) more secure and transparent, facilitating logging and tracking, and improving data readability and fault tolerance.
[0036] Finally, after the import manager receives the intermediate "JSON string", it uses the data serialization tool to deserialize the JSON string into a brand new core configuration object, i.e., the target format string.
[0037] Through the above embodiments, a step-by-step mapping mechanism is adopted to decouple the parsing logic from the business logic; Chinese table headers are automatically mapped to entity attributes and data normalization is completed, improving configuration compatibility and fault tolerance, and avoiding parsing crashes or semantic misalignments caused by strong coupling.
[0038] Step S106: Store the target format string in the application cache directory of the local application to obtain the local configuration file. The local configuration file includes at least the device list and loop name.
[0039] Among them, the application cache directory refers to the private cache path allocated by the Android system for the application of this application, which is used to store temporary decompressed files, intermediate data during the import process, and temporary backups before database recovery; the local configuration file refers to the file generated after the target format string is persistently written to the application's private file directory; the device list refers to the structured data set recorded in the device loop information worksheet in the local configuration file; and the loop name refers to the unique string that identifies the electrical loop logic unit in the device list.
[0040] Specifically, after obtaining the target format string, advanced business validations such as vector graphics (SVG) existence checks are performed on it. If the validation passes, the target format string is stored in the local application's application cache directory, resulting in a local configuration file. This local configuration file includes at least a device list and loop names. For example, after successful validation, the target JSON string is directly persisted to the system's private file directory, uniformly named app_config.json.
[0041] Step S108: Based on the device list and loop name, generate the cabinet diagram and save it to the local configuration file, and refresh the configuration of the local configuration file.
[0042] Among them, the cabinet layout diagram refers to a static bitmap image generated by dynamically splicing multiple pre-set PNG (Portable Network Graphics) slices according to the number of circuits, which is used to intuitively display the front layout and circuit quantity overview of each distribution cabinet on the main interface of the station screen; the electrical wiring diagram refers to the wiring diagram of a single cabinet system drawn based on SVG vector format.
[0043] Specifically, refer to Figure 3 The generation of the counter layout diagram includes the following steps: S302, Traverse the device list, and determine the statistical value of the number of circuits for each device cabinet based on the name of the device cabinet and the name of the circuit.
[0044] Among them, the equipment cabinet name refers to the naming string used to uniquely identify a physical distribution cabinet or control cabinet, which is usually predefined by the user in the project configuration; the circuit name refers to the identifier that represents an independent power supply path or functional path in the electrical system, which is defined by the user in the spreadsheet configuration file; the equipment cabinet refers to the physical electrical complete equipment unit actually deployed in the power distribution room, computer room or industrial site; the number of circuits refers to the number of circuit names belonging to the same equipment cabinet that have been resolved and confirmed to be valid.
[0045] S304 maps the statistical value of the number of loops in each equipment cabinet to image slices.
[0046] Among them, image slices refer to pre-made and stored in the resource directory, standardized bitmap image fragments. Each slice uniquely corresponds to the visualization of a certain loop type at a specific cabinet location.
[0047] The slice path strings corresponding to each image slice are concatenated into an image path string according to preset symbols, and a counter image is generated based on the image path strings. This also includes: S306, read each image slice based on the image path string.
[0048] Among them, the image path string refers to a single-line text string composed of the complete file paths of multiple image slices concatenated according to a preset delimiter.
[0049] S308 decodes the bitmap object for each image slice during the reading process.
[0050] A bitmap object is a memory-resident image data structure that is loaded from an image slice file through the system image decoding API in the Android / iOS mobile platform runtime environment. It contains attributes such as pixel array, width and height, and color format, and supports subsequent memory-level stitching operations.
[0051] S310 stitches together the bitmap objects of each image slice to generate a counter view.
[0052] In one example, the automatic generation of graphic elements includes automatically generating the counter layout and electrical wiring diagrams required to be displayed on the station screen, based on the verified project configuration decompression file output from the above steps.
[0053] First, generate the cabinet layout: traverse the device list, deduplicating the number of circuits for each cabinet by combining the cabinet name and circuit name; map the statistical value of each cabinet to an image slice, for example, the corresponding image path is: svg / AP{count}.png; concatenate multiple slice paths into a unified image path string, separated by commas; the interface display side reads each slice image sequentially from the application's built-in asset directory, decodes it into a bitmap object, and then displays it horizontally.
[0054] Secondly, the electrical wiring diagram is extracted directly from the project configuration compressed file and further displayed.
[0055] Finally, save the counter layout diagram and electrical wiring diagram to the local configuration file, and refresh the configuration file accordingly.
[0056] Through the above embodiments, cabinet diagrams (sliced and stitched) and electrical circuit diagrams (SVG priority loading) are dynamically generated based on the equipment list and circuit names, achieving zero manual configuration of graphic resources; configuration-driven visualization is automatically generated, greatly improving deployment consistency and on-site adaptation efficiency, and eliminating manual drawing errors and version mismatch issues.
[0057] In one embodiment, before writing the project configuration decompression file to the application cache directory, the method further includes: creating a backup subdirectory named after the current system timestamp; and copying and saving the project configuration decompression file under the application cache directory to the backup subdirectory.
[0058] Specifically, before overwriting the resources, configurations, and databases under the system's private file directory (i.e., the application cache directory), a timestamp-stamped backup directory is automatically created, and the following contents are backed up through code: counter layout resource directory, vector graphics resource directory, core configuration files, and historical database.
[0059] In one embodiment, before refreshing the configuration of the local configuration file, the method further includes: calling a system interface to perform backup processing on the historical data in the currently running database, obtaining the backup historical data, and temporarily storing the backup historical data in the application cache directory; overwriting the project configuration compressed file into the default database path of the local application; if the project configuration compressed file fails to be verified after being overwritten, then reading the backup historical data from the application cache directory for restoration.
[0060] Specifically, during data recovery, a "double insurance" mechanism is used: a system-level backup is performed first (independent of importing a temporary backup); then the database files in the import package are overwritten and restored to the application database path.
[0061] In one embodiment, reference Figure 4 This application employs a task scheduler's periodic tasks to achieve daily automatic backups, while also supporting custom backup directories in industrial settings. Understandably, this application primarily involves two backup strategies: The first method is a daily automatic backup process: the backup scheduling method is called to calculate the initial delay and configure storage constraints; the task is submitted through a unique periodic task method to prevent duplicate scheduling; when the worker thread (class name, Worker) runs, the database backup management method is called to perform the actual backup; if the backup fails, a task retry instruction is returned according to the system policy, and if the maximum number of attempts is exceeded, a task failure instruction is returned.
[0062] The second method is a custom backup path: To meet the backup needs of custom directories in industrial sites, users can select custom backup directories such as USB drives and shared directory mappings in the interface. The system-level content parser requests and obtains persistent unified resource identifier permissions for persistent read and write authorization, which remains effective even if the device restarts. During writing, the document file object is used to create backup files in the user's directory based on the tree-structured URI of the authorized directory. The backup file naming rules include timestamp information to prevent duplication. After a successful backup, the remaining backup files in the directory are cleaned up, and only the latest one is kept to control storage usage.
[0063] Figure 5 A schematic diagram of the framework of a data migration system according to an embodiment of this application is shown. Exemplarily, the data migration system 500 includes: The decompression module 502 is used to obtain the project configuration compressed package file selected and imported by the user in the file manager interface, and to decompress the project configuration compressed package file to obtain the project configuration decompressed file; Parsing module 504 is used to perform step-by-step mapping parsing on the project configuration decompression file to obtain the target format string; Storage module 506 is used to store the target format string to the application cache directory of the local application to obtain a local configuration file, which includes at least a device list and loop name; Configuration module 508 is used to generate a cabinet diagram based on the device list and circuit name, save the cabinet diagram to a local configuration file, and refresh the configuration of the local configuration file.
[0064] In one embodiment, the decompression module 502 is used to create a temporary decompression directory under the application cache directory, decompress the project configuration compressed package file to the temporary decompression directory to obtain multiple decompressed sub-files; according to the actual output path of each decompressed sub-file, at least one target decompressed sub-file is selected from the multiple decompressed sub-files; based on the target decompressed sub-file, the project configuration decompressed file is determined, and the project configuration decompressed file is written to the application cache directory.
[0065] In one embodiment, the parsing module 504 is used to read the worksheets line by line in the project configuration decompression file according to the arrangement order of each worksheet using a spreadsheet processing framework tool, to obtain the cell data corresponding to each worksheet; map the cell data corresponding to each worksheet to Java entity objects in memory; format and convert the Java entity objects using a data serialization tool to obtain candidate JSON strings, and return the candidate JSON strings through a preset interface; perform vector existence verification on the candidate JSON strings, and use the candidate JSON strings that pass the verification as the target format string.
[0066] In one embodiment, the configuration module 508 is used to traverse the device list, determine the statistical value of the number of circuits in each device cabinet based on the traversed device cabinet name and circuit name; map the statistical value of the number of circuits in each device cabinet to an image slice; concatenate the slice path string corresponding to each image slice according to preset symbols to form an image path string, and generate a cabinet diagram based on the image path string.
[0067] In one embodiment, the configuration module 508 is used to read each image slice based on the image path string; decode the bitmap object of each image slice during the reading process; and splice the bitmap objects of each image slice to generate a countertop image.
[0068] In one embodiment, the data migration system 500 further includes a first backup module 510, which is used to create a backup subdirectory named after the current system timestamp based on the current system timestamp; and to copy and save the project configuration decompression files under the application cache directory to the backup subdirectory.
[0069] In one embodiment, the data migration system 500 further includes a second backup module 512, which is used to call the system interface to perform backup processing on the historical data of the currently running database, obtain the backup historical data, and temporarily store the backup historical data in the application cache directory; overwrite the project configuration compressed package file into the default database path of the local application; if the project configuration compressed package file fails to be verified after overwriting, the backup historical data is read from the application cache directory for restoration.
[0070] It is understood that the apparatus in this embodiment corresponds to the data migration method in the above embodiments, and the options in the above embodiments are also applicable to this embodiment, so they will not be described again here.
[0071] This application also provides a terminal device, exemplary of which includes a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to enable the terminal device to perform the functions of the various modules in the above-described data migration method or data migration system.
[0072] The processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including at least one of a Central Processing Unit (CPU), Graphics Processing Unit (GPU), Network Processor (NP), Digital Signal Processor (DSP), Application-Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application.
[0073] Memory can be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), and Electrically Erasable Programmable Read-Only Memory (EEPROM). Memory is used to store computer programs, and the processor can execute these programs upon receiving execution instructions.
[0074] This application also provides a computer-readable storage medium for storing computer programs used in the aforementioned terminal devices. For example, the computer-readable storage medium may include, but is not limited to, various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0075] In the several embodiments provided in this application, it should be understood that the disclosed systems and methods can also be implemented in other ways. The system embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that, in alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0076] In addition, the functional modules or units in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0077] If a function is implemented as a software module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a smartphone, personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application.
[0078] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A data migration method, characterized in that, include: Obtain the project configuration compressed file and decompress it to obtain the project configuration decompressed file; Perform step-by-step mapping parsing on the project configuration decompression file to obtain the target format string; The target format string is stored in the application cache directory of the local application to obtain a local configuration file, which includes at least a device list and a loop name. Based on the device list and the circuit name, a cabinet layout diagram is generated and saved to the local configuration file, and the configuration of the local configuration file is refreshed.
2. The method according to claim 1, characterized in that, The process of decompressing the project configuration compressed file to obtain a project configuration decompressed file includes: Create a temporary decompression directory under the application cache directory, and decompress the project configuration compressed package file to the temporary decompression directory to obtain multiple decompressed sub-files; Based on the actual output path of each of the decompressed sub-files, at least one target decompressed sub-file is selected from the plurality of decompressed sub-files; Based on the target decompression sub-file, the project configuration decompression file is determined and written to the application cache directory.
3. The method according to claim 1, characterized in that, The step-by-step mapping and parsing of the project configuration decompression file yields the target format string, including: Using a spreadsheet processing framework tool, the data is read line by line according to the order of the worksheets in the project configuration decompression file to obtain the cell data corresponding to each worksheet. Map the cell data corresponding to each worksheet to Java entity objects in memory; The Java entity object is formatted and converted using a data serialization tool to obtain a candidate JSON string, and the candidate JSON string is returned through a preset interface; Perform a vector image existence check on the candidate JSON string, and use the candidate JSON string that passes the check as the target format string.
4. The method according to claim 1, characterized in that, The step of generating a cabinet layout based on the device list and the circuit names includes: Traverse the device list and determine the statistical value of the number of circuits for each device cabinet based on the name of the device cabinet and the name of the circuit. The statistical value of the number of loops in each of the aforementioned equipment cabinets is mapped to image slices; Each slice path string corresponding to each image slice is concatenated into an image path string according to preset symbols, and a counter image is generated based on the image path string.
5. The method according to claim 4, characterized in that, The step of generating a counter view based on the image path string includes: Each image slice is read based on the image path string; During the reading process, the bitmap object for each of the image slices is decoded; The bitmap objects of each image slice are stitched together and displayed to generate a countertop image.
6. The method according to claim 2, characterized in that, Before writing the project configuration decompression file to the application cache directory, the method further includes: Create a backup subdirectory named after the current system timestamp; Extract the project configuration file from the application cache directory and copy it to the backup subdirectory.
7. The method according to claim 1, characterized in that, Before refreshing the configuration of the local configuration file, the method further includes: Call the system interface to perform backup processing on the historical data in the currently running database, obtain the backup historical data, and temporarily store the backup historical data in the application cache directory; Write the project configuration compressed file to overwrite the default database path of the local application; If the project configuration compressed file fails to be verified after being overwritten, the backup historical data is read from the application cache directory for restoration.
8. A data migration system, characterized in that, include: The decompression module is used to obtain the project configuration compressed package file and decompress the project configuration compressed package file to obtain the project configuration decompressed file; The parsing module is used to perform step-by-step mapping parsing on the project configuration decompression file to obtain the target format string; The storage module is used to store the target format string to the application cache directory of the local application to obtain a local configuration file, wherein the local configuration file includes at least a device list and a loop name; The configuration module is used to generate a cabinet diagram based on the device list and the circuit name, save it to the local configuration file, and refresh the configuration of the local configuration file.
9. A terminal device, characterized in that, The terminal device includes a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the data migration method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed on a processor, implements the data migration method according to any one of claims 1-7.
