CN113342823A - Data changing method and device, computer equipment and storage medium - Google Patents

Data changing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113342823A
CN113342823A CN202110739257.9A CN202110739257A CN113342823A CN 113342823 A CN113342823 A CN 113342823A CN 202110739257 A CN202110739257 A CN 202110739257A CN 113342823 A CN113342823 A CN 113342823A
Authority
CN
China
Prior art keywords
data
changed
target
change
data table
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110739257.9A
Other languages
Chinese (zh)
Inventor
张梁
袁纯璋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Merchants Finance Technology Co Ltd
Original Assignee
China Merchants Finance Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Merchants Finance Technology Co Ltd filed Critical China Merchants Finance Technology Co Ltd
Priority to CN202110739257.9A priority Critical patent/CN113342823A/en
Publication of CN113342823A publication Critical patent/CN113342823A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/214Database migration support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data change method, a data change device, computer equipment and a storage medium, wherein the data change method comprises the following steps: acquiring a data change request, wherein the data change request comprises an original platform identifier, a target platform identifier and a data identifier to be changed; acquiring a data table to be changed corresponding to the data identifier to be changed from an original cloud service platform corresponding to the original platform identifier, and judging whether the data table to be changed has changeability; if the data table to be changed has changeability, acquiring a data storage mode of the data table to be changed; and changing the data table to be changed to a target cloud service platform corresponding to the target platform identification by adopting data change logic corresponding to the data storage mode. According to the technical scheme, the data of the cloud platform can be changed, and the data sheet to be changed is reliably and efficiently changed to the target cloud service platform corresponding to the target platform identification.

Description

Data changing method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of cloud technologies, and in particular, to a data change method and apparatus, a computer device, and a storage medium.
Background
A cloud platform refers to a comprehensive management platform that will contain virtualized resource pools of computing, networking, storage, security, and the like. The cloud platform mainly comprises a cloud host, a cloud disk, network equipment, a cloud database and the like. The existing cloud platform is under fixed projects and the asset items of specific users after the users purchase the platform, namely, the platform is created, and the platform cannot be changed among different cloud platforms. For example, cloud platform data is changed from a public cloud platform to a private cloud platform, and the data cannot be classified under a specific project and a specific user, so great inconvenience is brought to IT asset management and financial affairs record work, and once a virtual asset allocation error exists, a way mode is not changed, and management of data resources of the cloud platform is not facilitated.
Disclosure of Invention
The embodiment of the invention provides a data change method and device, computer equipment and a storage medium, and aims to solve the problems that cloud platform data cannot be changed among different cloud platforms and management of data resources of the cloud platforms is not facilitated.
A method of data alteration, comprising:
acquiring a data change request, wherein the data change request comprises an original platform identifier, a target platform identifier and a data identifier to be changed;
acquiring a data table to be changed corresponding to the data identifier to be changed from an original cloud service platform corresponding to the original platform identifier, and judging whether the data table to be changed has changeability;
if the data table to be changed has changeability, acquiring a data storage mode of the data table to be changed;
and changing the data table to be changed to the target cloud service platform corresponding to the target platform identification by adopting the data change logic corresponding to the data storage mode.
Further, the determining whether the data table to be changed has changeability includes:
acquiring an external key constraint relation and a business logic constraint relation of the data sheet to be changed;
and judging whether the data table to be changed has changeability or not based on the foreign key constraint relation and the business logic constraint relation.
Further, the changing the to-be-changed data table to the target cloud service platform corresponding to the target platform identifier by using the data change logic corresponding to the data storage mode includes:
if the data storage mode is direct storage, changing the data table to be changed to a data storage area of a target cloud service platform corresponding to the target platform identification, generating a first data change notification, and sending the first data change notification to the target cloud service platform;
and if the data storage mode is redis cache storage, changing the data table to be changed to a data cache region of a target cloud service platform corresponding to the target platform identifier, generating a second data change notification, and sending the second data change notification to the cache service corresponding to the data table to be changed.
Further, the changing the to-be-changed data table to the target cloud service platform corresponding to the target platform identifier further includes:
acquiring target change data by adopting a change data interface;
and changing the data table to be changed to a target cloud service platform corresponding to the target platform identification by adopting data change service based on the target change data.
Further, before the obtaining of the target change data by using the change data interface, the method includes:
acquiring a target resource class based on a cloud service platform standard;
and acquiring the change data interface based on the target resource class.
Further, the changing the to-be-changed data table to the target cloud service platform corresponding to the target platform identifier includes:
acquiring an ID to be changed and a data table to be changed associated with the ID to be changed based on the original platform identification;
determining a data change script according to the original platform identification, the target platform identification and the data identification to be changed;
and executing the data change script, and changing the data table to be changed to the target cloud service platform corresponding to the target platform identification.
Further, after the data change logic corresponding to the data storage manner changes the data table to be changed, the method includes:
acquiring a target change data table;
and detecting whether the target change data table is abnormal or not, and acquiring and displaying an abnormal detection result.
A data alteration apparatus comprising:
the request acquisition module is used for acquiring a data change request, wherein the data change request comprises an original platform identifier, a target platform identifier and a data identifier to be changed;
the data acquisition module is used for acquiring a data table to be changed corresponding to the data identifier to be changed from an original cloud service platform corresponding to the original platform identifier and judging whether the data table to be changed has changeability or not;
the storage mode module is used for acquiring the data storage mode of the data table to be changed if the data table to be changed has changeability;
and the data change module is used for changing the data table to be changed to the target cloud service platform corresponding to the target platform identification by adopting the data change logic corresponding to the data storage mode.
Further, the data acquisition module comprises:
the relation obtaining submodule is used for obtaining the foreign key constraint relation and the business logic constraint relation of the data sheet to be changed;
and the data judgment submodule is used for judging whether the data table to be changed has changeability or not based on the foreign key constraint relation and the business logic constraint relation.
Further, the data change module includes:
the first notification submodule is used for changing the data table to be changed to a data storage area of a target cloud service platform corresponding to the target platform identification if the data storage mode is direct storage, generating a first data change notification, and sending the first data change notification to the target cloud service platform;
and the second notification submodule is used for changing the data table to be changed to a data cache region of the target cloud service platform corresponding to the target platform identifier if the data storage mode is the redis cache storage mode, generating a second data change notification, and sending the second data change notification to the cache service corresponding to the data table to be changed.
Further, the data change module further comprises:
the data interface submodule is used for acquiring target change data by adopting a change data interface;
and the change service sub-module is used for changing the data table to be changed to a target cloud service platform corresponding to the target platform identification based on the target change data by adopting data change service.
Further, the data changing apparatus further includes:
the resource class acquisition module is used for acquiring a target resource class based on the cloud service platform standard;
and the interface acquisition module is used for acquiring the changed data interface based on the target resource class.
Further, the data change module further comprises:
the data table acquisition submodule is used for acquiring the ID to be changed and the data table to be changed related to the ID to be changed based on the original platform identification;
the change script submodule is used for determining a data change script according to the original platform identification, the target platform identification and the data identification to be changed;
and the script execution submodule is used for executing the data change script and changing the data table to be changed to the target cloud service platform corresponding to the target platform identification.
Further, the data changing apparatus further includes:
the target data table module is used for acquiring a target change data table;
and the abnormity detection module is used for detecting whether the target change data table is abnormal or not, and acquiring and displaying an abnormity detection result.
A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the data alteration method when executing the computer program.
A computer-readable storage medium, which stores a computer program that, when executed by a processor, implements the above-described data alteration method.
The data change method, the data change device, the computer equipment and the storage medium are characterized in that firstly, a data change request is obtained, a data table to be changed corresponding to a data identification to be changed is obtained from an original cloud service platform corresponding to the original platform identification according to an original platform identification in the data change request, whether the data table to be changed has changeability or not is judged, and the data table which can not be changed by a user is prevented from being changed, so that the reliability of the data table to be changed in the change process is ensured; and then, when the data sheet to be changed has changeability, acquiring a data storage mode of the data sheet to be changed, and changing the data sheet to be changed to a target cloud service platform corresponding to the target platform identifier by adopting a data change logic corresponding to the data storage mode, so that the data sheet to be changed is reliably and efficiently changed to the target cloud service platform corresponding to the target platform identifier.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a flow chart of a data change method according to an embodiment of the present invention;
FIG. 2 is another flow chart of a data change method according to an embodiment of the present invention;
FIG. 3 is another flow chart of a method of changing data according to an embodiment of the present invention;
FIG. 4 is another flow chart of a method of changing data according to an embodiment of the present invention;
FIG. 5 is another flow chart of a method of changing data according to an embodiment of the present invention;
FIG. 6 is another flow chart of a method of changing data according to an embodiment of the present invention;
FIG. 7 is another flow chart of a method of changing data according to an embodiment of the present invention;
FIG. 8 is a diagram of a data modification apparatus according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of a computer device according to an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart illustrating a data change method according to the present embodiment. The data change method is applied to the cloud service platform, is used for changing the cloud platform data stored in the cloud service platform, and is used for solving the problem that the cloud platform data cannot be changed among different cloud service platforms, is not beneficial to the management of data resources of the cloud service platform, and improves the management efficiency of the cloud service platform data. As shown in fig. 1, the data modification method includes steps S11 to S14, which are detailed as follows:
s11: and acquiring a data change request, wherein the data change request comprises an original platform identifier, a target platform identifier and a data identifier to be changed.
The data change request is a request for changing the data to be changed. And the data to be changed is the data stored in the cloud service platform. Alternatively, the cloud service platform may be OpenStack, cloudstack, VMware, and the like. The data to be changed is cloud platform data to be changed on the cloud service platform. For example, the data to be changed is cloud platform data corresponding to virtual resources on the cloud service platform. The data to be changed may be, for example, a data table to be changed. Alternatively, the virtual resource may be a virtual host, a cloud disk, a network device, a cloud database, and the like. The data to be changed is data corresponding to virtual resources under items to which the user belongs on different cloud service platforms.
In a specific embodiment, the changing of the data to be changed may be changing of data corresponding to virtual resources between different cloud service platforms. Illustratively, data corresponding to the virtual resources on the heterogeneous cloud platform is migrated, for example, the data corresponding to the virtual resources is migrated from a public cloud to a private cloud.
The original platform identification is an identification corresponding to a cloud service platform where the data to be changed are located. Illustratively, the original platform identification may be an original cloud service platform ID of a cloud service platform where the data to be changed is located. The target platform identification is an identification corresponding to the cloud service platform where the data to be changed is located after being changed. Illustratively, the target platform identification may be a target cloud service platform ID of a cloud service platform where the data to be changed is changed. And the identifier of the data to be changed is the identifier corresponding to the data to be changed. Optionally, the identifier of the data to be changed includes a user ID and a virtual resource ID corresponding to the user ID. Illustratively, the user ID is used to determine a user corresponding to the data to be changed, and the virtual resource ID is used to determine a virtual resource that needs to be changed and corresponds to the user. The virtual resource ID may be a to-be-changed data table ID.
In this example, by obtaining the data change request, the original cloud service platform where the data to be changed is located may be determined according to the original platform identifier, then the data to be changed is determined according to the data identifier to be changed, and finally, the target cloud service platform where the data to be changed is determined according to the target platform identifier, so that the data to be changed is changed to the cloud service platform corresponding to the target platform identifier in the subsequent step.
S12: and acquiring a data table to be changed corresponding to the data identifier to be changed from the original cloud service platform corresponding to the original platform identifier, and judging whether the data table to be changed has changeability.
The original cloud service platform is a cloud service platform corresponding to the original platform identification.
Specifically, after step S11, that is, after the data change request is obtained, the original cloud service platform is determined according to the original platform identifier in the data change request, the data table to be changed corresponding to the data identifier to be changed is obtained from the original cloud service platform according to the data identifier to be changed, and by determining whether the data table to be changed has changeability, the reliability of the data table to be changed in the change process is ensured. For example, changes to user-unchangeable data tables are avoided. Alternatively, the immutable data table may be an immutable field in a data table, a cascaded data table, or the like. Illustratively, an immutable field of a charging service related table in a cloud service platform or a data table cascaded with the charging service related table of a user cannot be directly changed, so that charging errors are avoided, and reliability of the data table to be changed in a changing process is ensured.
In a specific embodiment, by determining whether the data table to be changed has a specific association relationship with other data tables in the original cloud service platform, if the data table to be changed has a specific association relationship with other data tables in the original cloud service platform, the data table to be changed does not have changeability. If the data table to be changed does not have a specific association relation with other data tables in the original cloud service platform, the data table to be changed has changeability, and the data table to be changed can be changed. Optionally, the specific association relationship may be a foreign key association relationship, a business logic association relationship, and the like between the data table to be changed and other data tables in the original cloud service platform.
In this example, the data table to be changed corresponding to the data identifier to be changed is obtained from the original cloud service platform corresponding to the original platform identifier, and whether the data table to be changed has changeability is determined, so that the data table which cannot be changed by a user is prevented from being changed, and the reliability of the data table to be changed in the changing process is ensured.
S13: and if the data table to be changed has changeability, acquiring the data storage mode of the data table to be changed.
The data storage mode is a storage mode of the data table to be changed in the original cloud service platform.
Specifically, when the data table to be changed is judged to have changeability, the data storage mode of the data table to be changed is obtained. It should be noted that, because the data table to be changed has different data storage manners, different data storage manners are required to be processed for different data storage manners, so as to avoid errors occurring in the process of changing the data table to be changed, and improve the accuracy and reliability in the process of changing the data table to be changed.
Optionally, the data storage manner may be that the data table to be changed is directly stored in a database corresponding to the original cloud service platform, or the data table to be changed is stored in a cache service of the original cloud service platform.
In this embodiment, if the data table to be changed has changeability, the data storage manner of the data table to be changed is obtained, so that the data to be changed in different data storage manners is changed in the subsequent steps by using different data storage manners, thereby achieving the purpose of improving the accuracy and reliability in the process of changing the data table to be changed.
S14: and changing the data table to be changed to a target cloud service platform corresponding to the target platform identification by adopting data change logic corresponding to the data storage mode.
The data change logic is processing logic for changing the data table to be changed. The data change logic can change the data table to be changed according to the data storage mode of the data table to be changed.
Specifically, for different data storage modes, data change logics corresponding to the data storage modes are needed, and the data table to be changed is changed to the target cloud service platform corresponding to the target platform identifier, so that errors are avoided in the process of changing the data table to be changed.
In the example, for different data storage modes, the data table to be changed is changed by adopting the data change logic corresponding to the data storage mode, so that the data table to be changed can be reliably and efficiently changed to the target cloud service platform corresponding to the target platform identifier. That is to say, the data change logic can change the data sheet to be changed in different data storage modes to the target cloud service platform corresponding to the target platform identifier, so that errors can be avoided in the process of changing the data sheet to be changed, and the accuracy and reliability in the process of changing the data sheet to be changed are improved.
In this embodiment, first, a data change request is obtained, a to-be-changed data table corresponding to a to-be-changed data identifier is obtained from an original cloud service platform corresponding to the original platform identifier according to an original platform identifier in the data change request, and whether the to-be-changed data table has changeability or not is judged, so that a user-unchangeable data table is prevented from being changed, and reliability of the to-be-changed data table in a change process is ensured; and then, when the data sheet to be changed has changeability, acquiring a data storage mode of the data sheet to be changed, and changing the data sheet to be changed to a target cloud service platform corresponding to the target platform identifier by adopting a data change logic corresponding to the data storage mode, so that the data sheet to be changed is reliably and efficiently changed to the target cloud service platform corresponding to the target platform identifier.
In one embodiment, as shown in fig. 2, the step S12 of determining whether the data table to be changed has changeability includes:
s21: and acquiring the foreign key constraint relation and the business logic constraint relation of the data sheet to be changed.
S22: and judging whether the data table to be changed has changeability or not based on the foreign key constraint relation and the business logic constraint relation.
The foreign key constraint relationship is a foreign key relationship between the data table to be changed and other data tables in the original cloud service platform. The business logic constraint relation is a business logic relation between the data table to be changed and other data tables in the original cloud service platform.
Specifically, by obtaining the foreign key constraint relationship and the business logic constraint relationship of the data table to be changed, it can be determined whether the data table to be changed has changeability according to the foreign key constraint relationship and the business logic constraint relationship.
As an example, if the derived data entity in the a transaction is the data table a to be changed, and the derived data entity in the B transaction is the data table B, the data table B is derived from the data table a to be changed, and the data table a to be changed is decisive for the existence of the data table B and the attribute of the data table B, so that the data table a to be changed can be changed, that is, the data table a to be changed has changeability.
As another example, if the data table a to be changed is a foreign key constraint of the data table c, the data table a to be changed cannot be directly changed, i.e. the data table a to be changed has no changeability.
In this embodiment, the foreign key constraint relationship and the business logic constraint relationship of the data table to be changed may be obtained first; and then, judging whether the data sheet to be changed has changeability or not based on the foreign key constraint relation and the business logic constraint relation, and changing the data sheet to be changed according to whether the data sheet to be changed has changeability or not, so that the situation that the data sheet which cannot be changed by a user is changed is avoided, and the reliability of the data sheet to be changed in the changing process is ensured.
In an embodiment, as shown in fig. 3, in step S14, changing the to-be-changed data table to the target cloud service platform corresponding to the target platform identifier by using the data change logic corresponding to the data storage manner includes:
s31: and if the data storage mode is direct storage, changing the data table to be changed to a data storage area of the target cloud service platform corresponding to the target platform identification, generating a first data change notification, and sending the first data change notification to the target cloud service platform.
S32: and if the data storage mode is redis cache storage, changing the data table to be changed to a data cache region of the target cloud service platform corresponding to the target platform identification, generating a second data change notification, and sending the second data change notification to the cache service corresponding to the data table to be changed.
Wherein, the data storage area is an area for directly storing the data table. The data cache region is a region for caching and storing a data table. The first data change notification is formed by changing a data table to be changed, the data storage mode of which is directly stored. The second data change notification is a notification formed after a data table to be changed, which is cached and stored in a Remote Dictionary service (Remote Dictionary service, redis for short), is changed. The cache service is a service on the original cloud service platform and is used for caching the data table to be changed.
In a specific embodiment, the data storage manner may be direct storage, and for example, the direct storage may be that the data table to be changed is directly stored in a data cache region of the original cloud service platform. If the data storage mode is direct storage, the data table to be changed stored in the database of the original cloud service platform is directly modified, and meanwhile, in order to avoid errors of a data management system of the target cloud service platform after the data table to be changed is changed, a first data change notification needs to be sent to the target cloud service platform to indicate the target cloud service platform to refresh the old data table.
In a specific embodiment, the data storage manner may be a redis cache storage, and exemplarily, the redis cache storage may be a redis service that caches the data table to be changed in a data cache region of the original cloud service platform. If the data storage mode is a redis cache storage mode, modifying a data table to be changed stored in a redis service of the original cloud service platform, and meanwhile, in order to avoid an error occurring in a data management system of the target cloud service platform after the data table to be changed is changed, sending a second data change notification to a cache service of the target cloud service platform to instruct the cache service of the target cloud service platform to refresh an old data table.
It should be noted that, the data table corresponding to the target cloud service platform with the specific function needs to be initialized. For example, for a target cloud service platform with a charging function, a charging entry for initializing the target cloud service platform with the charging function needs to be performed to avoid causing a charging error.
In this embodiment, if the data storage mode is direct storage, the data table to be changed is changed to the data storage area of the target cloud service platform corresponding to the target platform identifier, a first data change notification is generated, and the first data change notification is sent to the target cloud service platform; if the data storage mode is direct storage, the data sheet to be changed is changed to a data cache region of the target cloud service platform corresponding to the target platform identification, a first data change notification is generated, and the first data change notification is sent to the target cloud service platform, so that the safety and the reliability of the data sheet to be changed in the changing process are improved.
In an embodiment, as shown in fig. 4, in step S14, changing the to-be-changed data table to the target cloud service platform corresponding to the target platform identifier further includes:
s41: and acquiring target change data by adopting a change data interface.
S42: and changing the data table to be changed to a target cloud service platform corresponding to the target platform identification by adopting data change service based on the target change data.
The change data interface is an interface for acquiring target change data. The target change data is data for changing the data table to be changed. The data change service is a service for changing the data sheet to be changed to the target cloud service platform corresponding to the target platform identification.
In a specific embodiment, the change data interface may be a wsgi interface in the target cloud service platform, and if the target cloud service platform is an OpenStack platform, the wsgi interface of the OpenStack platform can obtain target change data input by a user performing a modification operation at the transmission front end. As another example, the data change service may be a change data API (Application Programming Interface, API for short) service. For example, the change data API service update _ source _ id is implemented inside the OpenStack platform, and exists inside the nova service for implementing the computing power in the OpenStack platform. And the API service update _ source _ id changes the data table to be changed to a target cloud service platform corresponding to the target platform identifier through an interface of a database service contact in the OpenStack platform, so that the change of the data table to be changed is realized. The data table to be changed is changed to the target cloud service platform corresponding to the target platform identifier by using the data change service, and the change mode of the data table to be changed is an invasive change mode, so that the reliability is high.
In this embodiment, the data change service is used only when the target change data is acquired by using the change data interface, and the purpose of changing the data table to be changed to the target cloud service platform corresponding to the target platform identifier is achieved based on the target change data.
In one embodiment, as shown in fig. 5, before step S41, that is, before the modified data interface is used to obtain the target modified data, the method includes:
s51: and acquiring a target resource class based on the cloud service platform standard.
S52: and acquiring a change data interface based on the target resource class.
The cloud service platform standard is a standard for acquiring a target resource class. The target resource class criteria is a class for obtaining a change data interface.
In a specific embodiment, the original cloud service platform may be an OpenStack platform, and the cloud service platform standard may be a novailant console specification standard in the OpenStack platform. The target resource class may be a base. And inheriting the base.resource class through a novaclent console specification standard in the OpenStack platform, so that a changed data interface can be obtained according to the base.resource class.
In the embodiment, the target resource class is obtained based on the cloud service platform standard, and the purpose of obtaining the changed data interface is achieved based on the target resource class.
In an embodiment, as shown in fig. 6, in step S14, changing the to-be-changed data table to the target cloud service platform corresponding to the target platform identifier includes:
s61: and acquiring the ID to be changed and the data table to be changed associated with the ID to be changed based on the original platform identification.
S62: and determining a data change script according to the original platform identifier, the target platform identifier and the data identifier to be changed.
S63: and executing a data change script, and changing the data table to be changed to a target cloud service platform corresponding to the target platform identifier.
Wherein the ID to be changed is the ID of the user to be changed. The ID to be changed may be, for example, a tenant ID on the cloud service platform, and is used for changing of a tenant on the cloud service platform. The data change script is a script set by a user in a self-defined mode and used for changing the data sheet to be changed to the target cloud service platform corresponding to the target platform identification.
As an example, the ID to be changed and the data table to be changed associated with the ID to be changed are obtained based on the original platform identifier, for example, the ID to be changed and the data table to be changed associated with the ID to be changed are obtained from the original cloud service platform corresponding to the original platform identifier through the original platform identifier.
As another example, when the data table to be changed is changed to the target cloud service platform corresponding to the target platform identifier through the data change script, the original cloud service platform, the data table to be changed associated with the ID to be changed, and the target cloud service platform may be determined according to the original platform identifier, the target platform identifier, and the data identifier to be changed, and then the data change script may be determined through a change relationship among the original cloud service platform, the data table to be changed associated with the ID to be changed, and the target cloud service platform.
As another example, a data change script is executed, and the data table to be changed is changed to the target cloud service platform corresponding to the target platform identification. Illustratively, the data change script may be a script formed by an sql statement, and the data table to be changed is changed to the target cloud service platform corresponding to the target platform identifier through the script formed by the sql statement.
The data table to be changed is changed to the target cloud service platform corresponding to the target platform identifier by using the data change script, and the change mode of the data table to be changed is a non-invasive change mode.
In the embodiment, based on the original platform identifier, the ID to be changed and the data table to be changed associated with the ID to be changed are obtained; determining a data change script according to the original platform identification, the target platform identification and the data identification to be changed; and executing a data change script, and changing the data table to be changed to the target cloud service platform corresponding to the target platform identifier, wherein the change mode of the data table to be changed is a non-invasive change mode, and the security is high.
In an embodiment, as shown in fig. 7, after the step S14, after the data table to be changed is changed based on the data change logic corresponding to the data storage method, the method includes:
s71: and acquiring a target change data table.
S72: and detecting whether the target change data table is abnormal or not, and acquiring and displaying an abnormal detection result.
The target change data table is a data table obtained after the data table to be changed is changed. And the abnormal result is the result obtained by changing the data table to the target.
In one embodiment, after the target change data table is acquired, whether the target change data table is abnormal or not is detected, and an abnormal detection result is acquired and displayed. Optionally, detecting whether the target change data table is abnormal may include detecting whether the change content in the target change data table matches the target change data, and determining the accuracy of the target change data table. If the change content in the target change data table is matched with the target change data, the abnormality detection result is no abnormality; and if the changed content in the target changed data table is not matched with the target changed data, judging that an abnormal detection result is abnormal. Or detecting whether all other services or applications in the target cloud service platform operate normally, and if all other services or applications in the target cloud service platform operate normally, determining that the abnormal detection result is abnormal; and if all other services or applications in the target cloud service platform are not normally operated, determining that the abnormal detection result is abnormal.
In the embodiment, a target change data table is obtained; and detecting whether the target change data sheet is abnormal or not, and acquiring and displaying an abnormal detection result so that a user can find the abnormality in the change process of the data sheet to be changed in time, thereby further improving the reliability in the change process of the data sheet to be changed.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
In one embodiment, a data modification apparatus is provided, and the data modification apparatus corresponds to the data modification method in the above embodiments one to one. As shown in fig. 8, the data modification apparatus includes a request acquisition module 10, a data acquisition module 20, a storage mode module 30, and a data modification module 40. The functional modules are explained in detail as follows:
the request obtaining module 10 is configured to obtain a data change request, where the data change request includes an original platform identifier, a target platform identifier, and a to-be-changed data identifier;
the data obtaining module 20 is configured to obtain a to-be-changed data table corresponding to the to-be-changed data identifier from the original cloud service platform corresponding to the original platform identifier, and determine whether the to-be-changed data table has changeability;
the storage mode module 30 is used for acquiring the data storage mode of the data table to be changed if the data table to be changed has changeability;
and the data change module 40 is configured to change the data table to be changed to the target cloud service platform corresponding to the target platform identifier by using the data change logic corresponding to the data storage mode.
Further, the data acquisition module 20 includes:
the relation acquisition submodule is used for acquiring the foreign key constraint relation and the business logic constraint relation of the data table to be changed;
and the data judgment submodule is used for judging whether the data table to be changed has changeability or not based on the foreign key constraint relation and the business logic constraint relation.
Further, the data change module 40 includes:
the first notification submodule is used for changing the data table to be changed to a data storage area of the target cloud service platform corresponding to the target platform identification if the data storage mode is direct storage, generating a first data change notification and sending the first data change notification to the target cloud service platform;
and the second notification submodule is used for changing the data table to be changed to a data cache region of the target cloud service platform corresponding to the target platform identifier if the data storage mode is the redis cache storage mode, generating a second data change notification, and sending the second data change notification to the cache service corresponding to the data table to be changed.
Further, the data change module 40 further includes:
the data interface submodule is used for acquiring target change data by adopting a change data interface;
and the change service submodule is used for changing the data sheet to be changed to a target cloud service platform corresponding to the target platform identification by adopting data change service based on the target change data.
Further, the data changing apparatus further includes:
the resource class acquisition module is used for acquiring a target resource class based on the cloud service platform standard;
and the interface acquisition module is used for acquiring the changed data interface based on the target resource class.
Further, the data change module 40 further includes:
the data table acquisition submodule is used for acquiring the ID to be changed and the data table to be changed related to the ID to be changed based on the original platform identification;
the change script submodule is used for determining a data change script according to the original platform identifier, the target platform identifier and the data identifier to be changed;
and the script execution submodule is used for executing the data change script and changing the data table to be changed to the target cloud service platform corresponding to the target platform identifier.
Further, the data changing apparatus further includes:
the target data table module is used for acquiring a target change data table;
and the abnormality detection module is used for detecting whether the target change data table is abnormal or not, and acquiring and displaying an abnormality detection result.
For the specific limitation of the data modification apparatus, reference may be made to the above limitation on the data modification method, and details are not described herein. The modules in the data modification apparatus may be implemented in whole or in part by software, hardware, or a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 9. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for the change of data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a data alteration method.
In an embodiment, a computer device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the data modification method in the foregoing embodiments is implemented, for example, steps S11 to S14, which are not repeated herein to avoid repetition. Alternatively, the processor implements the functions of the modules/units in the embodiment of the data modification apparatus when executing the computer program, for example, the modules 10 to 40, which are not described herein again to avoid repetition.
In an embodiment, a computer-readable storage medium is provided, and a computer program is stored on the computer-readable storage medium, and when being executed by a processor, the computer program implements the data changing method in the foregoing embodiments, for example, steps S11 to S14, which are not repeated herein for avoiding repetition. Alternatively, the computer program, when executed by the processor, implements the functions of the modules/units in the embodiment of the data modification apparatus, such as the modules 10 to 40, which are not described herein again to avoid repetition.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A method of data alteration, comprising:
acquiring a data change request, wherein the data change request comprises an original platform identifier, a target platform identifier and a data identifier to be changed;
acquiring a data table to be changed corresponding to the data identifier to be changed from an original cloud service platform corresponding to the original platform identifier, and judging whether the data table to be changed has changeability;
if the data table to be changed has changeability, acquiring a data storage mode of the data table to be changed;
and changing the data table to be changed to the target cloud service platform corresponding to the target platform identification by adopting the data change logic corresponding to the data storage mode.
2. The data change method according to claim 1, wherein the determining whether the data table to be changed has changeability comprises:
acquiring an external key constraint relation and a business logic constraint relation of the data sheet to be changed;
and judging whether the data table to be changed has changeability or not based on the foreign key constraint relation and the business logic constraint relation.
3. The data change method according to claim 1, wherein changing the to-be-changed data table to the target cloud service platform corresponding to the target platform identifier by using the data change logic corresponding to the data storage manner includes:
if the data storage mode is direct storage, changing the data table to be changed to a data storage area of a target cloud service platform corresponding to the target platform identification, generating a first data change notification, and sending the first data change notification to the target cloud service platform;
and if the data storage mode is redis cache storage, changing the data table to be changed to a data cache region of a target cloud service platform corresponding to the target platform identifier, generating a second data change notification, and sending the second data change notification to the cache service corresponding to the data table to be changed.
4. The data change method of claim 1, wherein changing the to-be-changed data table to a target cloud service platform corresponding to the target platform identification further comprises:
acquiring target change data by adopting a change data interface;
and changing the data table to be changed to a target cloud service platform corresponding to the target platform identification by adopting data change service based on the target change data.
5. The data change method of claim 4, prior to said obtaining target change data using the change data interface, comprising:
acquiring a target resource class based on a cloud service platform standard;
and acquiring the change data interface based on the target resource class.
6. The data change method of claim 1, wherein changing the to-be-changed data table to the target cloud service platform corresponding to the target platform identification comprises:
acquiring an ID to be changed and a data table to be changed associated with the ID to be changed based on the original platform identification;
determining a data change script according to the original platform identification, the target platform identification and the data identification to be changed;
and executing the data change script, and changing the data table to be changed to the target cloud service platform corresponding to the target platform identification.
7. The data change method according to claim 1, wherein after the data change logic corresponding to the data storage method changes the data table to be changed, the method includes:
acquiring a target change data table;
and detecting whether the target change data table is abnormal or not, and acquiring and displaying an abnormal detection result.
8. A data modification apparatus, comprising:
the request acquisition module is used for acquiring a data change request, wherein the data change request comprises an original platform identifier, a target platform identifier and a data identifier to be changed;
the data acquisition module is used for acquiring a data table to be changed corresponding to the data identifier to be changed from an original cloud service platform corresponding to the original platform identifier and judging whether the data table to be changed has changeability or not;
the storage mode module is used for acquiring the data storage mode of the data table to be changed if the data table to be changed has changeability;
and the data change module is used for changing the data table to be changed to the target cloud service platform corresponding to the target platform identification by adopting the data change logic corresponding to the data storage mode.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the data alteration method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, implements a data alteration method according to any one of claims 1 to 7.
CN202110739257.9A 2021-06-30 2021-06-30 Data changing method and device, computer equipment and storage medium Pending CN113342823A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110739257.9A CN113342823A (en) 2021-06-30 2021-06-30 Data changing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110739257.9A CN113342823A (en) 2021-06-30 2021-06-30 Data changing method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113342823A true CN113342823A (en) 2021-09-03

Family

ID=77482049

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110739257.9A Pending CN113342823A (en) 2021-06-30 2021-06-30 Data changing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113342823A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101243469A (en) * 2005-08-22 2008-08-13 微软公司 Digital license migration from first platform to second platform
CN107103007A (en) * 2016-02-23 2017-08-29 阿里巴巴集团控股有限公司 A kind of SQL code conversion method and device
CN108073688A (en) * 2017-11-20 2018-05-25 苏宁云商集团股份有限公司 A kind of method and device of Data Migration
CN108829727A (en) * 2018-05-09 2018-11-16 上海陆家嘴国际金融资产交易市场股份有限公司 Date storage method, device, computer equipment and storage medium
CN110297813A (en) * 2019-05-22 2019-10-01 平安银行股份有限公司 Data migration method, device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101243469A (en) * 2005-08-22 2008-08-13 微软公司 Digital license migration from first platform to second platform
CN107103007A (en) * 2016-02-23 2017-08-29 阿里巴巴集团控股有限公司 A kind of SQL code conversion method and device
CN108073688A (en) * 2017-11-20 2018-05-25 苏宁云商集团股份有限公司 A kind of method and device of Data Migration
CN108829727A (en) * 2018-05-09 2018-11-16 上海陆家嘴国际金融资产交易市场股份有限公司 Date storage method, device, computer equipment and storage medium
CN110297813A (en) * 2019-05-22 2019-10-01 平安银行股份有限公司 Data migration method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110297672B (en) Page dynamic generation method and device, computer equipment and storage medium
CN108170740B (en) Data migration method, system and computer readable storage medium
CN109361628B (en) Message assembling method and device, computer equipment and storage medium
CN110633160A (en) Interface calling method and device, computer equipment and storage medium
CN110716960B (en) Database query method, device, equipment and storage medium
CN112528274A (en) Data processing method and device, electronic equipment and storage medium
CN113377381B (en) Distribution method and device of small program package, electronic equipment and medium
CN114090113B (en) Method, device, equipment and storage medium for dynamically loading data source processing plug-in
CN110677506A (en) Network access method, device, computer equipment and storage medium
CN112650689A (en) Test method, test device, electronic equipment and storage medium
CN113760318A (en) Information processing method, information processing apparatus, server, and storage medium
CN113342823A (en) Data changing method and device, computer equipment and storage medium
CN112527416A (en) Task processing method and device, computer equipment and storage medium
CN115374083A (en) Data source switching method and device, electronic equipment and storage medium
CN112732513A (en) Memory monitoring method and device, computer readable storage medium and computer equipment
CN112052171B (en) Test message processing method and device, computer equipment and storage medium
CN114218188A (en) Data migration method, device, equipment and storage medium
WO2021121130A1 (en) Method and apparatus for information collection, computer device, and storage medium
CN114185521A (en) Method, device and system for managing multi-manufacturer controls in online banking system
CN112583890B (en) Message pushing method and device based on enterprise office system and computer equipment
EP3676741A1 (en) Off node scanning
CN112667323A (en) Application system page processing method and device, computer equipment and storage medium
CN113407419A (en) Memory leak detection method and device, computer equipment and storage medium
CN109634636B (en) Application processing method, device, equipment and medium
CN112463836A (en) Data query method and device based on Django framework, computer equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination