Data migration method and device based on multi-dimensional evaluation system
Through the data migration method based on the multi-dimensional evaluation system, the problem of functional implementation, maintenance complexity and performance reduction of code when adapting between multiple operating systems is solved, and efficient migration of code between different platforms is achieved.
Patent Information
- Application Number
- CN202411602051.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-11-11
AI Technical Summary
When the code is adapted to multiple operating systems, the existing technology has problems such as inability to implement functions, complex maintenance and reduced performance, especially in domestic applications, which cannot convert code normally.
The data migration method based on the multi-dimensional evaluation system is adopted. By obtaining the dependency information of the data to be migrated, static scan is performed, the code content corresponding to the dependency information is obtained, the conversion scores of each code version are calculated, and the optimal code version is selected for migration.
It greatly improves the efficiency and user experience of data conversion and migration, reduces the difficulty of subsequent code modification, and makes the technology migration of code between different platforms smoother.
Smart Images

Figure CN119127299B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of data processing, and in particular, to a data migration method, apparatus, device, and computer-readable storage medium based on a multidimensional evaluation system. Background Art
[0002] With the development of IT technology, the traditional code development model has gradually been replaced, and some "zero-code" and "low-code" graphical interface development platforms have come out one after another. Generating business code by dragging and dropping through a visual configuration interface can effectively improve productivity.
[0003] In the existing technology, when the code is adapted to multiple operating systems, there are problems such as inability to realize functions, complex maintenance and reduced performance. Some platforms with the "one-click conversion" function of code cannot convert the code normally due to incomplete development packages, different hardware architectures, different operating environments, and uncalled dynamic link libraries. They cannot be used for some domestic applications. Summary of the invention
[0004] According to the embodiments of the present application, a data migration solution based on a multi-dimensional evaluation system is provided, a multi-system unified adaptation framework is constructed, and a set of codes is technically migrated between different platforms; the code version is interpreted, and the most suitable code version is selected for migration based on the evaluation, thereby reducing the difficulty of subsequent code modification to a minimum, greatly improving the efficiency of data conversion and migration and user experience.
[0005] In a first aspect of the present application, a data migration method based on a multidimensional evaluation system is provided. The method comprises:
[0006] Obtain dependency information of the data to be migrated;
[0007] Performing static scanning on the dependency information, and obtaining code content corresponding to the dependency information from the constructed business module code library;
[0008] Calculating the conversion score of each code version in the code content to obtain the optimal code version;
[0009] Based on the optimal code version, the data to be migrated is converted and / or modified.
[0010] Furthermore, the obtaining dependency information of the data to be migrated includes:
[0011] Through the built multi-platform code support tool, the package.json file content and / or node_modules directory stored in the multi-dimensional technology migration server are scanned for dependencies to obtain the dependency information of the data to be migrated.
[0012] Furthermore, the calculating of the conversion degree score of each code version in the code content to obtain the optimal code version includes:
[0013] Based on the code content, build a dependency set;
[0014] Based on the dependency set, calculating the correlation between the code content and the code dependency;
[0015] Extracting general business module information from the code content;
[0016] Building a general content set based on the general business module information;
[0017] Based on the universal content set, calculating the correlation between the code dependency relationship and the universal content relationship;
[0018] Based on the correlation between the code content and the code dependency relationship, and the correlation between the code dependency relationship and the general content relationship, the conversion degree score of each code version in the code content is calculated to obtain the optimal code version.
[0019] Further, the calculating the correlation between the code content and the code dependency based on the dependency set includes:
[0020] ;
[0021] Among them, C is the code package corresponding to the code content:
[0022] is the number of contents in the code that could not be converted due to dependencies;
[0023] The total amount of code dependencies that exist for the current code;
[0024] The dependency set is .
[0025] Furthermore, the calculating the correlation between the code dependency relationship and the universal content relationship based on the universal content set includes:
[0026] ;
[0027] is the number of contents in the code that cannot be converted due to common content relations;
[0028] The total number of common content relationships that exist for the current code;
[0029] The common content collection is .
[0030] Further, the calculating of the conversion degree score of each code version in the code content based on the correlation between the code content and the code dependency relationship, and the correlation between the code dependency relationship and the general content relationship, comprises:
[0031] Based on the correlation between the code content and the code dependency, and the correlation between the code dependency and the general content, the technical deviation of each factor is calculated as follows:
[0032] ;
[0033] Where m is the number of factors, m>1;
[0034] τ is to ensure the function range;
[0035] is the score of the impact of the mth dependency on code switching;
[0036] is the score of the impact of the mth general relationship on code conversion; based on the technical deviation, the importance of each factor is calculated as follows;
[0037] ;
[0038] The importance of each factor;
[0039] Based on the relevance between the code content and the code dependency, the relevance between the code dependency and the common content relationship, and the importance of each factor, the conversion degree score of each code version in the code content is calculated.
[0040] Furthermore, the calculating of the conversion degree score of each code version in the code content based on the correlation between the code content and the code dependency relationship, the correlation between the code dependency relationship and the common content relationship, and the importance of each factor includes:
[0041] ;
[0042] Among them, Z is the conversion score.
[0043] In a second aspect of the present application, a data migration device based on a multi-dimensional evaluation system is provided. The device comprises:
[0044] An acquisition module is used to obtain dependency information of data to be migrated;
[0045] A scanning module, used to perform static scanning on the dependency information, and obtain code content corresponding to the dependency information from the constructed business module code library;
[0046] A calculation module, used to calculate the conversion degree score of each code version in the code content to obtain the optimal code version;
[0047] A migration module is used to convert and / or modify the data to be migrated based on the optimal code version.
[0048] In a third aspect of the present application, an electronic device is provided, which includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the program, the method described above is implemented.
[0049] In a fourth aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method according to the first aspect of the present application is implemented.
[0050] The data migration method based on a multi-dimensional evaluation system provided in the embodiment of the present application obtains the dependency information of the data to be migrated; performs a static scan on the dependency information, and obtains the code content corresponding to the dependency information from the constructed business module code library; calculates the conversion score of each code version in the code content to obtain the optimal code version; based on the optimal code version, the data to be migrated is converted and / or modified, the code version can be interpreted, and the most suitable code version is selected for migration according to the evaluation, which minimizes the difficulty of subsequent code modification and greatly improves the efficiency of data conversion and migration and the user experience.
[0051] It should be understood that the contents described in the summary of the invention are not intended to limit the key or important features of the embodiments of the present application, nor are they intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The above and other features, advantages and aspects of the embodiments of the present application will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0053] Figure 1 is a flow chart of a data migration method based on a multidimensional evaluation system according to an embodiment of the present application;
[0054] Figure 2 is a block diagram of a data migration device based on a multi-dimensional evaluation system according to an embodiment of the present application;
[0055] Figure 3 It is a schematic diagram of the structure of a terminal device or a server suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0057] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0058] Figure 1 A flow chart of a data migration method based on a multidimensional evaluation system according to an embodiment of the present disclosure is shown. The method comprises:
[0059] S110, obtaining dependency information of the data to be migrated.
[0060] In some embodiments, the built multi-platform code support tool can be used to perform dependency scanning on the package.json file content and / or the node_modules directory stored in the multi-dimensional technology migration server to obtain dependency information of the data to be migrated.
[0061] The main function of traditional IDE is to provide developers with integrated tools. The multi-platform code support tool in the present disclosure can be embedded in IDEs of different languages as a plug-in, and a "technology migration" module is displayed on the front end. Users can see the configuration interface when entering the "technology migration" module. Therefore, the method of the present disclosure can also be set visually.
[0062] Among them, the multi-dimensional technology migration server is a technology base established at the system layer that includes multi-platform code packages, link libraries and / or operating environment configurations.
[0063] Specifically, taking Node.js as an example, we can obtain dependency information from the multi-dimensional technology migration server. That is, dependency scanning:
[0064] • Read the package.json file: extract all dependencies and their version numbers in the dependencies and devDependencies fields.
[0065] • Analyze the node_modules directory: further confirm the actual installed dependency version.
[0066] • Code static analysis: Scan the code for references to dependencies, and count usage scenarios and frequencies. Adapted dependent components.
[0067] • ffi-napi: A Node.js module for calling local dynamic link libraries (DLL or SO).
[0068] Windows x64: Fully compatible.
[0069] Linux x64: Fully compatible.
[0070] Ginga Kylin: Not suitable.
[0071] UOS: Not applicable.
[0072] • node-gyp: Build tool for compiling native C++ modules.
[0073] Windows x64: Fully compatible.
[0074] Linux x64: Fully compatible.
[0075] Kylin: Only some versions are compatible.
[0076] UOS: Only some versions are compatible.
[0077] • bcrypt: Node.js module for encryption and decryption.
[0078] Windows x64: Version 3.0.6: fully compatible, Version 4.0.1: fully compatible.
[0079] Linux x64: Version 3.0.6: fully compatible, version 4.0.1: not compatible.
[0080] Kylin: Version 3.0.6: not compatible, Version 4.0.1: fully compatible.
[0081] UOS: Version 3.0.6: not compatible, Version 4.0.1: fully compatible.
[0082] • sharp: Node.js module for image processing.
[0083] Windows x64: Version 0.22.1: fully compatible, Version 0.22.2: fully compatible.
[0084] Linux x64: Version 0.22.1: not compatible, Version 0.22.2: fully compatible.
[0085] Kylin: Version 0.22.1: Partial adaptation, Version 0.22.2: Full adaptation.
[0086] UOS: Version 0.22.1: fully compatible, version 0.22.2: not compatible.
[0087] S120, statically scanning the dependency information, and acquiring code content corresponding to the dependency information from a constructed business module code library.
[0088] In some embodiments, the dependency information is statically scanned, and the code content corresponding to the dependency information is obtained from the constructed business module code library, and it is determined whether the current data to be migrated has conversion risks and re-encoding requirements. The specific encoding requirements can be set according to the actual application scenario. For example, if the current code is the latest version and supports the system to be migrated, no transcoding is required.
[0089] The business module code base includes code data of various versions and types required for data migration, and can be constructed by acquiring big data, capturing historical data, and the like.
[0090] S130, calculating the conversion degree score of each code version in the code content to obtain the optimal code version.
[0091] In some embodiments, according to the static scanning result of step S120, the conversion degree score is calculated:
[0092] According to the obtained code content, build the dependency set of the corresponding code package C , further calculate the correlation between code content and code dependencies:
[0093] ;
[0094] in, is the number of contents in the code that could not be converted due to dependencies;
[0095] The total amount of code dependencies that exist for the current code;
[0096] Further, extract the general business module information in the code content to form a general content set of code package C , further calculate the correlation between code dependency and general content relationship:
[0097] ;
[0098] in, is the number of contents in the code that cannot be converted due to common content relations;
[0099] The total number of common content relationships that exist for the current code;
[0100] Furthermore, the impact of dependencies and general business module coverage in the calculation code on technology migration is first calculated by calculating the technology deviation of each factor. Assuming that m factors are found in this scan, the technology deviation can be calculated as follows:
[0101] ;
[0102] Among them, τ is to ensure the function range, which can be pre-defined by the program;
[0103] m is the number of factors, m>1
[0104] is the score of the impact of the mth dependency on code switching;
[0105] is the score of the influence of the mth general relationship on code conversion. Further, the importance of m factors is calculated according to the technical deviation obtained from the above formula:
[0106] ;
[0107] Furthermore, based on the correlation between the code content and the code dependency, the correlation between the code dependency and the common content, and the importance of each factor, the conversion score of each code version in the code content is calculated by the following formula:
[0108] ;
[0109] Among them, Z is the conversion score.
[0110] According to the conversion degree score, the optimal code version is selected.
[0111] S140: Convert and / or modify the data to be migrated based on the optimal code version.
[0112] In some embodiments, the data to be migrated is converted and / or modified (migrated) based on the optimal code version.
[0113] According to the embodiments of the present disclosure, the following technical effects are achieved:
[0114] The multi-platform code support tool can be embedded as a plug-in into the IDE of different languages, and the "Technology Migration" module is displayed on the front end. The code package in the current environment and the system environment to be converted are selected, and the code version is further selected to obtain the conversion degree. The user selects the code version with the highest conversion degree for conversion and modification, ensuring that the code runs normally in the new operating environment at the lowest cost. The code running with this method is more standardized, and the corresponding maintenance cost is lower. The data migration efficiency and user experience are greatly improved.
[0115] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0116] The above is an introduction to the method embodiment. The following is a further explanation of the scheme described in this application through an apparatus embodiment.
[0117] Figure 2 FIG. 4 shows a data migration device based on a multi-dimensional evaluation system according to an embodiment of the present application, such as Figure 2 Shown include:
[0118] An acquisition module 210 is used to acquire dependency information of the data to be migrated;
[0119] The scanning module 220 is used to perform static scanning on the dependency information and obtain code content corresponding to the dependency information from the constructed business module code library;
[0120] A calculation module 230, used to calculate the conversion degree score of each code version in the code content to obtain the optimal code version;
[0121] The migration module 240 is used to convert and / or modify the data to be migrated based on the optimal code version.
[0122] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0123] Figure 3 A schematic diagram of the structure of a terminal device or a server suitable for implementing an embodiment of the present application is shown.
[0124] like Figure 3As shown, the terminal device or server includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 into the random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the terminal device or server are also stored. CPU 301, ROM 302 and RAM 303 are connected to each other through a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0125] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed, so that a computer program read therefrom is installed into the storage section 308 as needed.
[0126] In particular, according to an embodiment of the present application, the above method flow steps can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a machine-readable medium, and the computer program includes a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 309, and / or installed from the removable medium 311. When the computer program is executed by the central processing unit (CPU) 301, the above-mentioned functions defined in the system of the present application are executed.
[0127] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0128] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of the code, and the aforementioned module, program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0129] The units or modules involved in the embodiments described in the present application may be implemented by software or hardware. The units or modules described may also be arranged in a processor. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.
[0130] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable storage medium stores one or more programs, and when the above programs are used by one or more processors to execute the method described in the present application.
[0131] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of application involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the aforementioned application concept. For example, the above features are replaced with (but not limited to) technical features with similar functions applied in the present application.
Claims
1. A data migration method based on a multidimensional evaluation system, characterized in that: include: Obtain dependency information of the data to be migrated; Performing static scanning on the dependency information, and obtaining code content corresponding to the dependency information from the constructed business module code library; Calculating the conversion score of each code version in the code content to obtain the optimal code version includes: Based on the code content, build a dependency set; Based on the dependency set, calculating the correlation between the code content and the code dependency; Extracting general business module information from the code content; Building a general content set based on the general business module information; Based on the universal content set, calculating the correlation between the code dependency relationship and the universal content relationship; Based on the correlation between the code content and the code dependency, and the correlation between the code dependency and the general content, the conversion score of each code version in the code content is calculated to obtain the optimal code version, including: Based on the correlation between the code content and the code dependency, and the correlation between the code dependency and the general content, the technical deviation of each factor is calculated as follows: ; Wherein, m is the number of factors; the number of factors is the sum of the number of influences of dependency on code conversion and the number of influences of common content on code conversion; τ is to ensure the function range; is the score of the impact of the nth dependency on code switching; is the score of the effect of the nth general relation on code switching; Based on the technical deviation, the importance of each factor is calculated as follows; ; The importance of each factor; Calculate the conversion score of each code version in the code content based on the correlation between the code content and the code dependency relationship, the correlation between the code dependency relationship and the general content relationship, and the importance of each factor; Based on the optimal code version, the data to be migrated is converted and / or modified.
2. The method according to claim 1, characterized in that The step of obtaining dependency information of the data to be migrated includes: Through the built multi-platform code support tool, the package.json file content and / or node_modules directory stored in the multi-dimensional technology migration server are scanned for dependencies to obtain the dependency information of the data to be migrated.
3. The method according to claim 2, characterized in that The calculating the correlation between the code content and the code dependency based on the dependency set includes: ; Wherein, C is the code package corresponding to the code content; is the number of contents in the code that could not be converted due to dependencies; The total number of code dependencies that exist for the current code.
4. The method according to claim 3, characterized in that The calculating the correlation between the code dependency relationship and the universal content relationship based on the universal content set includes: ; in, is the number of contents in the code that cannot be converted due to common content relations; The total number of common content relationships that exist for the current code.
5. The method according to claim 4, characterized in that The calculating of the conversion degree score of each code version in the code content based on the correlation between the code content and the code dependency relationship, the correlation between the code dependency relationship and the common content relationship, and the importance of each factor comprises: ; Among them, Z is the conversion score.
6. A data migration device based on a multi-dimensional evaluation system, characterized in that: include: An acquisition module is used to obtain dependency information of data to be migrated; A scanning module, used to perform static scanning on the dependency information and obtain code content corresponding to the dependency information from the constructed business module code library; A calculation module is used to calculate the conversion degree score of each code version in the code content to obtain the optimal code version, including: Based on the code content, build a dependency set; Based on the dependency set, calculating the correlation between the code content and the code dependency; Extracting general business module information from the code content; Building a general content set based on the general business module information; Based on the universal content set, calculating the correlation between the code dependency relationship and the universal content relationship; Based on the correlation between the code content and the code dependency, and the correlation between the code dependency and the general content, the conversion score of each code version in the code content is calculated to obtain the optimal code version, including: Based on the correlation between the code content and the code dependency, and the correlation between the code dependency and the general content, the technical deviation of each factor is calculated as follows: ; Wherein, m is the number of factors; the number of factors is the sum of the number of influences of dependency on code conversion and the number of influences of common content on code conversion; τ is to ensure the function range; is the score of the impact of the nth dependency on code switching; is the score of the effect of the nth general relation on code switching; Based on the technical deviation, the importance of each factor is calculated as follows; ; The importance of each factor; Calculate the conversion score of each code version in the code content based on the correlation between the code content and the code dependency relationship, the correlation between the code dependency relationship and the general content relationship, and the importance of each factor; A migration module is used to convert and / or modify the data to be migrated based on the optimal code version.
7. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Code transformation
CN101208660A
Application program migration method and device, equipment and storage medium
CN118708321A