CN114416695A - Data splicing function migration method and device, computer equipment and storage medium - Google Patents

Data splicing function migration method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114416695A
CN114416695A CN202210061955.2A CN202210061955A CN114416695A CN 114416695 A CN114416695 A CN 114416695A CN 202210061955 A CN202210061955 A CN 202210061955A CN 114416695 A CN114416695 A CN 114416695A
Authority
CN
China
Prior art keywords
data
splicing
original
target
code
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
CN202210061955.2A
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.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202210061955.2A priority Critical patent/CN114416695A/en
Publication of CN114416695A publication Critical patent/CN114416695A/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/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/24553Query execution of query operations
    • G06F16/24554Unary operations; Data partitioning operations
    • G06F16/24556Aggregation; Duplicate elimination

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)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to an artificial intelligence technology, and provides a data splicing function migration method, a device, computer equipment and a storage medium, which comprise the following steps: analyzing the data splicing request to obtain first data and second data to be spliced; acquiring a first data type of first data and a second data type of second data, and determining an original logic item and a target logic item according to the first data type and the second data type respectively; traversing the first preset data layer according to the original logic item to obtain an original data logic value, and traversing the second preset data layer according to the target logic item to obtain a target data logic value; acquiring an initial data splicing code; adjusting the initial data splicing code according to the logic value of the original data and the logic value of the target data to obtain a target data splicing code; and calling a target data splicing code to splice and process the first data and the second data to obtain a data splicing result. The application can improve the accuracy of data splicing function migration, and promotes the rapid development of the smart city.

Description

Data splicing function migration method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to a data splicing function migration method and apparatus, a computer device, and a storage medium.
Background
With the rapid development and popularization of mobile internet and intelligent devices, the data processing pressure of the database applied to the internet is higher and higher, the requirement of a user on request response time is more and more strict, and the requirement of the application on the database for stably providing service is further improved. On the background that the performance improvement of the database reaches a certain bottleneck, the use of the updated database has become one of the main means for improving the stability and the response speed of the database.
In the process of implementing the present application, the applicant finds that the following technical problems exist in the prior art: in the case where the original database is in the data splicing function, the data splicing function needs to be migrated when an updated database is used. For example, the data splicing function is previously implemented in the agnite database, and if the data splicing function needs to be migrated to the pg database at one time, the two databases need to be compatible, so that too many codes need to be changed, the workload is large, related compatible information is easy to miss, and the accuracy of migration of the data splicing function cannot be ensured.
Therefore, it is necessary to provide a data splicing function migration method, which can improve the accuracy of data splicing function migration.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a data splicing function migration method, a data splicing function migration apparatus, a computer device, and a storage medium, which can improve the accuracy of data splicing function migration.
The first aspect of the embodiments of the present application further provides a data splicing function migration method, where the data splicing function migration method includes:
when a data splicing request is received, analyzing the data splicing request to obtain first data and second data to be spliced;
acquiring a first data type corresponding to the first data and a second data type corresponding to the second data, and determining an original logic item and a target logic item according to the first data type and the second data type respectively;
traversing a first preset data layer according to the original logic item to obtain an original data logic value corresponding to the original logic item, and traversing a second preset data layer according to the target logic item to obtain a target data logic value corresponding to the target logic item;
acquiring an initial data splicing code in an original database;
calling a preset switch to adjust the initial data splicing code according to the logic value of the original data and the logic value of the target data to obtain a target data splicing code;
and calling the target data splicing code to splice and process the first data and the second data to obtain a data splicing result.
Further, in the data splicing function migration method provided in the embodiment of the present application, the analyzing the data splicing request to obtain the first data and the second data to be spliced includes:
analyzing the data splicing request, and detecting whether the data splicing request carries a data identifier or not;
when the detection result is that the data splicing request carries the data identifier, extracting a first data identifier and a second data identifier;
and traversing the mapping relation between the preset data identification and the data according to the first data identification and the second data identification to obtain the first data and the second data to be spliced.
Further, in the foregoing data splicing function migration method provided in this embodiment of the present application, the determining an original logical item and a target logical item according to the first data type and the second data type respectively includes:
traversing a preset mapping relation between the data type and the logic item according to the first data type to obtain a first original logic item and a first target logic item corresponding to the first data type;
and traversing a preset mapping relation between the data type and the logic item according to the second data type to obtain a second original logic item and a second target logic item corresponding to the second data type.
Further, in the data splicing function migration method provided in the embodiment of the present application, traversing a first preset data layer according to the original logical item to obtain an original data logical value corresponding to the original logical item includes:
acquiring first code configuration information in the first preset data layer;
detecting whether the original logic item exists in the first code configuration information;
and when the detection result shows that the original logic item exists in the first code configuration information, determining a first target position of the original logic item in the first code configuration information, and extracting configuration content at the first target position as an original data logic value.
Further, in the above data splicing function migration method provided in the embodiment of the present application, the acquiring an initial data splicing code in an original database includes:
acquiring a first preset layer corresponding to the original database, and extracting first code configuration information in the first preset layer;
detecting whether a data splicing identifier exists in the first code configuration information;
and when the detection result indicates that the data splicing identification exists in the first code configuration information, acquiring a code corresponding to the data splicing identification as the initial data splicing code.
Further, in the data splicing function migration method provided in the embodiment of the present application, the calling a preset switch to adjust the initial data splicing code according to the original data logical value and the target data logical value, and obtaining a target data splicing code includes:
acquiring the initial data splicing code;
calling a preset switch to determine the original data logic value in the initial data splicing code;
and replacing the original data logic value as a target data logic value to obtain a target data splicing code.
Further, in the data splicing function migration method provided in the embodiment of the present application, the invoking the target data splicing code to splice and process the first data and the second data, and obtaining a data splicing result includes:
analyzing the data splicing request to obtain a data splicing requirement;
and calling the target data splicing code to splice and process the first data and the second data according to the data splicing requirement to obtain a data splicing result.
A second aspect of the embodiments of the present application further provides a data splicing function migration apparatus, where the data splicing function migration apparatus includes:
the request analysis module is used for analyzing the data splicing request when the data splicing request is received to obtain first data and second data to be spliced;
the type acquisition module is used for acquiring a first data type corresponding to the first data and a second data type corresponding to the second data, and determining an original logic item and a target logic item according to the first data type and the second data type respectively;
the logic traversing module is used for traversing a first preset data layer according to the original logic item to obtain an original data logic value corresponding to the original logic item, and traversing a second preset data layer according to the target logic item to obtain a target data logic value corresponding to the target logic item;
the code acquisition module is used for acquiring initial data splicing codes in an original database;
the code adjusting module is used for calling a preset switch to adjust the initial data splicing code according to the original data logic value and the target data logic value to obtain a target data splicing code;
and the code splicing module is used for calling the target data splicing code to splice the first data and the second data to obtain a data splicing result.
The third aspect of the embodiments of the present application further provides a computer device, where the computer device includes a processor, and the processor is configured to implement the data splicing function migration method according to any one of the above items when executing the computer program stored in the memory.
The fourth aspect of the embodiments of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the method for migrating a data splicing function is implemented by any one of the above methods.
According to the data splicing function migration method, the data splicing function migration device, the computer equipment and the computer readable storage medium, the preset switch is configured and called to realize one-step iterative migration of the data splicing code in the data splicing process, so that the problems of large workload and easiness in omission caused by one-time migration are solved, the workload can be reduced, the service use is not influenced, and the accuracy of data splicing function migration is improved; and the two preset data layers are configured and respectively used for storing the code configuration information of the original database and the code configuration information of the target database, and the two preset data layers cooperate with the preset switch to work, so that the first preset data layer is traversed when the logic value of the original data needs to be selected by the preset switch, and the second preset data layer is traversed when the logic value of the target data needs to be selected, the accuracy of acquiring the logic value of the data can be improved, and the accuracy of transferring the data splicing function is improved. This application can be applied to in each functional module in wisdom cities such as wisdom government affairs, wisdom traffic, for example the data concatenation function migration module of wisdom government affairs etc. can promote the rapid development in wisdom city.
Drawings
Fig. 1 is a flowchart of a data splicing function migration method according to an embodiment of the present application.
Fig. 2 is a structural diagram of a data splicing function migration apparatus according to a second embodiment of the present application.
Fig. 3 is a schematic structural diagram of a computer device provided in the third embodiment of the present application.
The following detailed description will further illustrate the present application in conjunction with the above-described figures.
Detailed Description
In order that the above objects, features and advantages of the present application can be more clearly understood, a detailed description of the present application will be given below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.
In the following description, numerous specific details are set forth to provide a thorough understanding of the present application, and the described embodiments are a part, but not all, of the present application.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
The data splicing function migration method provided by the embodiment of the invention is executed by computer equipment, and accordingly, the data splicing function migration device runs in the computer equipment. Fig. 1 is a flowchart of a data splicing function migration method according to an embodiment of the present application. As shown in fig. 1, the data splicing function migration method may include the following steps, and according to different requirements, the order of the steps in the flowchart may be changed, and some of the steps may be omitted:
and S11, when the data splicing request is received, analyzing the data splicing request to obtain the first data and the second data to be spliced.
In at least one embodiment of the present application, the data splicing request refers to a request sent by a target database for data splicing processing, the number of data to be subjected to data splicing processing is not limited, and may be two or more. The target database is a database with a data splicing function to be migrated, the data splicing function can be acquired from an original database, and the data splicing function in the original database is a related function executed by using a configured data splicing code. In one embodiment, the target database may be a pg database (PostgreSQL database), and the original database may be an ignite database (in-memory database, which has a fast response speed but poor stability). The data splicing request includes a first data identifier of first data to be spliced and a second data identifier of second data, and the data identifiers may be numbers, letters, or colors, which is not limited herein. By inquiring the data identification, the related data information to be spliced can be obtained.
Optionally, the analyzing the data splicing request to obtain the first data and the second data to be spliced includes:
analyzing the data splicing request, and detecting whether the data splicing request carries a data identifier or not;
when the detection result is that the data splicing request carries the data identifier, extracting a first data identifier and a second data identifier;
and traversing the mapping relation between the preset data identification and the data according to the first data identification and the second data identification to obtain the first data and the second data to be spliced.
When the detection result indicates that the data splicing request does not carry the data identifier, it indicates that the data splicing request does not carry the data information to be spliced, and the data splicing request may have an error and may report the error to a relevant responsible person for error correction.
S12, acquiring a first data type corresponding to the first data and a second data type corresponding to the second data, and determining an original logical item and a target logical item according to the first data type and the second data type respectively.
In at least one embodiment of the present application, different data all have corresponding data types, and the data types may be a return data type, a date data type, a query data type, an external link data type, a function data type, a time data type, a table type, and the like, which is not limited herein. The original logic item refers to a logic item corresponding to the data type in the original database, and the target logic item refers to a logic item corresponding to the data type in the target database. Taking the logical entries in the raw database as an example, the raw logical entries may include, but are not limited to, return logical entries, date logical entries, query logical entries, outlink logical entries, function logical entries, time logical entries, and table logical entries. It is to be understood that there is a mapping relationship between the original logical items and the target logical items, and in one embodiment, the original logical items and the target logical items correspond one to one. A mapping relation also exists between the data type and the logic item, and the logic item corresponding to the data type can be obtained by inquiring the mapping relation.
Optionally, the obtaining a first data type corresponding to the first data and a second data type corresponding to the second data includes:
acquiring a first data characteristic corresponding to the first data;
when a data type definition with the similarity of the first data characteristic exceeding the preset similarity threshold exists in the original database, determining that the data type corresponding to the data type definition is a first data type corresponding to the first data;
acquiring a second data characteristic corresponding to the second data;
and when a data type definition with the similarity of the second data characteristic exceeding the preset similarity threshold exists in the target database, determining that the data type corresponding to the data type definition is a second data type corresponding to the second data.
The first data characteristics refer to keyword information contained in the first data, the data type definition refers to keyword information contained in the data type, and the keyword information can be obtained through keyword matching and the like. In an embodiment, for a known data type or logic item, a plurality of keywords may be preset to characterize the data type or logic item, and the keywords included in the first data are obtained in a keyword matching manner to serve as the first data feature. The preset keywords can be stored in a preset database, and the preset database can be a target node on the block chain in consideration of reliability and privacy of data storage.
Optionally, the determining the original logical item and the target logical item according to the first data type and the second data type respectively includes:
traversing a preset mapping relation between the data type and the logic item according to the first data type to obtain a first original logic item and a first target logic item corresponding to the first data type;
and traversing a preset mapping relation between the data type and the logic item according to the second data type to obtain a second original logic item and a second target logic item corresponding to the second data type.
The first data type includes corresponding original logic items and target logic items, the second data type also includes corresponding original logic items and target logic items, and the original logic items and the target logic items included in the first data type may be the same as or different from those included in the second data type, which is not limited herein.
And S13, traversing a first preset data layer according to the original logic item to obtain an original data logic value corresponding to the original logic item, and traversing a second preset data layer according to the target logic item to obtain a target data logic value corresponding to the target logic item.
In at least one embodiment of the present application, the first preset layer is a data layer storing related configuration information (also referred to as first code configuration information) of an original database, where the related configuration information may include the original logic item, an original data logic value corresponding to the original logic item, and an initial data splicing code. The second preset data layer is a data layer for storing relevant configuration information of a target database, and the relevant configuration information may include the target logic item, a target data logic value corresponding to the target logic, and the initial data splicing code. It can be understood that the initial data splicing code in the second preset data layer needs to perform code migration with iteration step by step, and then obtain the target data splicing code. In an embodiment, the first preset data layer may be a first preset dao layer, the second preset data layer may be a second preset dao layer, and the first preset dao layer and the second preset dao layer mainly work as a data persistence layer.
In an embodiment, the present application provides a data splicing function migration system, where the system at least includes a controller layer, a dao layer, and a service layer, where the controller layer is mainly used to control a specific service module process, the dao layer is mainly used to work a data persistence layer, and the service layer is mainly used to design an application logic application of a service module. The service layer is established above the dao layer, and can be established after the dao layer is established, and the service layer is also under the controller layer, so that the service layer not only calls the interface of the dao layer, but also provides the interface for the class of the controller layer to call, and the service layer is just at the position of an intermediate layer. Each service module has a service interface, and each interface respectively encapsulates a respective service processing method. In the migration and transformation process of the data splicing function, a controller layer does not need to be changed, and a switch configuration (for example, the switch configuration is a switchaction switch) is added on a service layer, and a dao layer (also referred to as a second preset data layer in the present application) is added to process the logic migrated from a target database (for example, the target database is a pg database).
Optionally, traversing a first preset data layer according to the original logical item to obtain an original data logical value corresponding to the original logical item includes:
acquiring first code configuration information in the first preset data layer;
detecting whether the original logic item exists in the first code configuration information;
and when the detection result shows that the original logic item exists in the first code configuration information, determining a first target position of the original logic item in the first code configuration information, and extracting configuration content at the first target position as an original data logic value.
The first code configuration information refers to relevant configuration information of the original database, and the first code configuration information may include the original logic item, an original data logic value corresponding to the original logic item, and an original data splicing code. The detecting whether the original logic item exists in the first code configuration information, that is, whether the keyword information corresponding to the original logic item exists in the first code configuration information, and when the detecting result indicates that the keyword information corresponding to the original logic item exists in the first code configuration information, determining that the original logic item exists in the first code configuration information. In the first code configuration information, the original logic item and the original data logic value are stored according to a preset data format, and in an embodiment, the preset data format may be { original logic item, original data logic value }. The first target position refers to a position of the original logic item in the first code configuration information, and the configuration content at the first target position can be determined to be an original data logic value through the preset data format.
Optionally, the traversing a second preset data layer according to the target logic item to obtain a target data logic value corresponding to the target logic item includes:
acquiring second code configuration information in the second preset data layer;
detecting whether the target logic item exists in the second code configuration information;
and when the detection result shows that the target logic item exists in the second code configuration information, determining a second target position of the target logic item in the second code configuration information, and extracting configuration content at the second target position as a target data logic value.
Illustratively, the original logical term and the target logical term may each include, but are not limited to, a return logical term, a date logical term, a query logical term, an outlink logical term, a function logical term, a time logical term, and a table logical term. For the return logic item, the corresponding original data logic value is: when the original database returns Map, the default of the query field is capitalization; the corresponding target data logical values are: when the target database returns the Map, the query field is in lowercase by default. For the date logical item, the corresponding raw data logical value is: the date format is year-month-day; the corresponding raw data logical values are: year, month and day. For the query logical term, the corresponding raw data logical values are: the sub-queries do not need to add aliases; the corresponding target data logical values are: the sub-query requires the addition of an alias. The original data logic and the target data logic corresponding to each logic item are preset, and are not described herein.
And S14, acquiring the initial data splicing code in the original database.
In at least one embodiment of the present application, the first preset layer stores related configuration information (also referred to as first code configuration information) of an original database, where the related configuration information may include the original logic item, an original data logic value corresponding to the original logic item, and an original data splicing code. In an embodiment, the initial data splicing code is provided with a corresponding code identifier for characterizing the module, so as to implement the data splicing function.
Optionally, the obtaining the initial data splicing code in the original database includes:
acquiring a first preset layer corresponding to the original database, and extracting first code configuration information in the first preset layer;
detecting whether a data splicing identifier exists in the first code configuration information;
and when the detection result indicates that the data splicing identification exists in the first code configuration information, acquiring a code corresponding to the data splicing identification as the initial data splicing code.
And S15, calling a preset switch to adjust the initial data splicing code according to the original data logic value and the target data logic value to obtain a target data splicing code.
In at least one embodiment of the present application, the preset switch may be a switchactionutility switch, and the data logic switching may be completed by invoking the preset switch, that is, the preset switch is invoked to change the original data logic value in the initial data splicing code into the target data logic value, so as to obtain the target data splicing code.
In one embodiment, a data source of a target database is configured through an ark configuration center, a public class switched by a preset switch is written in a public tool class, an action variable is defined in the public class switched by the preset switch to obtain ark a value of the data source of the configuration center, a method get is written, the value of the action is returned, a logic judgment is made in a code by using the public method, a data logic corresponding to the target database is executed when the switch is opened, and a data logic corresponding to an original database is executed when the switch is closed.
Optionally, the calling a preset switch to adjust the initial data splicing code according to the original data logic value and the target data logic value, and obtaining a target data splicing code includes:
acquiring the initial data splicing code;
calling a preset switch to determine the original data logic value in the initial data splicing code;
and replacing the original data logic value as a target data logic value to obtain a target data splicing code.
It can be understood that the target data splicing code is used for splicing and processing the first data and the second data, and the data splicing request is used for requesting to splice data of other data types, for example, when the data splicing request is used for requesting to splice third data and fourth data, the data splicing code needs to be continuously migrated in one step through the above steps until the data splicing code corresponding to the target database can process data splicing of all data types.
And S16, calling the target data splicing code to splice the first data and the second data to obtain a data splicing result.
In at least one embodiment of the present application, the target data splicing code is called to splice and process the first data and the second data according to the splicing requirement in the data splicing request, so as to obtain a data splicing result. Wherein the splicing requirement may include a data splicing order. The data splicing order may refer to a splicing order of the first data and the second data, for example, the first data is ordered before the second data.
Optionally, the invoking the target data splicing code to splice the first data and the second data, and obtaining a data splicing result includes:
analyzing the data splicing request to obtain a data splicing requirement;
and calling the target data splicing code to splice and process the first data and the second data according to the data splicing requirement to obtain a data splicing result.
According to the data splicing function migration method provided by the embodiment of the application, the preset switch is configured and called to realize one-step iterative migration of the data splicing codes in the data splicing process, so that the problems of large workload and easiness in omission caused by one-time migration are solved, the workload can be reduced, the service use is not influenced, and the accuracy of data splicing function migration is improved; and the two preset data layers are configured and respectively used for storing the code configuration information of the original database and the code configuration information of the target database, and the two preset data layers cooperate with the preset switch to work, so that the first preset data layer is traversed when the logic value of the original data needs to be selected by the preset switch, and the second preset data layer is traversed when the logic value of the target data needs to be selected, the accuracy of acquiring the logic value of the data can be improved, and the accuracy of transferring the data splicing function is improved. This application can be applied to in each functional module in wisdom cities such as wisdom government affairs, wisdom traffic, for example the data concatenation function migration module of wisdom government affairs etc. can promote the rapid development in wisdom city.
Fig. 2 is a structural diagram of a data splicing function migration apparatus according to a second embodiment of the present application.
In some embodiments, the data splicing function migration apparatus 20 may include a plurality of functional modules composed of computer program segments. The computer programs of the respective program segments in the data splicing function migration apparatus 20 may be stored in a memory of a computer device and executed by at least one processor to perform the functions of data splicing function migration (described in detail in fig. 1).
In this embodiment, the data splicing function migration apparatus 20 may be divided into a plurality of functional modules according to the functions executed by the apparatus. The functional module may include: a request parsing module 201, a type obtaining module 202, a logic traversing module 203, a code obtaining module 204, a code adjusting module 205, and a code splicing module 206. A module as referred to herein is a series of computer program segments capable of being executed by at least one processor and capable of performing a fixed function and is stored in a memory. In the present embodiment, the functions of the modules will be described in detail in the following embodiments.
The request analysis module 201 is configured to, when a data splicing request is received, analyze the data splicing request to obtain first data and second data to be spliced.
In at least one embodiment of the present application, the data splicing request refers to a request sent by a target database for data splicing processing, the number of data to be subjected to data splicing processing is not limited, and may be two or more. The target database is a database with a data splicing function to be migrated, the data splicing function can be acquired from an original database, and the data splicing function in the original database is a related function executed by using a configured data splicing code. In one embodiment, the target database may be a pg database (PostgreSQL database), and the original database may be an ignite database (in-memory database, which has a fast response speed but poor stability). The data splicing request includes a first data identifier of first data to be spliced and a second data identifier of second data, and the data identifiers may be numbers, letters, or colors, which is not limited herein. By inquiring the data identification, the related data information to be spliced can be obtained.
Optionally, the analyzing the data splicing request to obtain the first data and the second data to be spliced includes:
analyzing the data splicing request, and detecting whether the data splicing request carries a data identifier or not;
when the detection result is that the data splicing request carries the data identifier, extracting a first data identifier and a second data identifier;
and traversing the mapping relation between the preset data identification and the data according to the first data identification and the second data identification to obtain the first data and the second data to be spliced.
When the detection result indicates that the data splicing request does not carry the data identifier, it indicates that the data splicing request does not carry the data information to be spliced, and the data splicing request may have an error and may report the error to a relevant responsible person for error correction.
The type obtaining module 202 is configured to obtain a first data type corresponding to the first data and a second data type corresponding to the second data, and determine an original logical item and a target logical item according to the first data type and the second data type, respectively.
In at least one embodiment of the present application, different data all have corresponding data types, and the data types may be a return data type, a date data type, a query data type, an external link data type, a function data type, a time data type, a table type, and the like, which is not limited herein. The original logic item refers to a logic item corresponding to the data type in the original database, and the target logic item refers to a logic item corresponding to the data type in the target database. Taking the logical entries in the raw database as an example, the raw logical entries may include, but are not limited to, return logical entries, date logical entries, query logical entries, outlink logical entries, function logical entries, time logical entries, and table logical entries. It is to be understood that there is a mapping relationship between the original logical items and the target logical items, and in one embodiment, the original logical items and the target logical items correspond one to one. A mapping relation also exists between the data type and the logic item, and the logic item corresponding to the data type can be obtained by inquiring the mapping relation.
Optionally, the obtaining a first data type corresponding to the first data and a second data type corresponding to the second data includes:
acquiring a first data characteristic corresponding to the first data;
when a data type definition with the similarity of the first data characteristic exceeding the preset similarity threshold exists in the original database, determining that the data type corresponding to the data type definition is a first data type corresponding to the first data;
acquiring a second data characteristic corresponding to the second data;
and when a data type definition with the similarity of the second data characteristic exceeding the preset similarity threshold exists in the target database, determining that the data type corresponding to the data type definition is a second data type corresponding to the second data.
The first data characteristics refer to keyword information contained in the first data, the data type definition refers to keyword information contained in the data type, and the keyword information can be obtained through keyword matching and the like. In an embodiment, for a known data type or logic item, a plurality of keywords may be preset to characterize the data type or logic item, and the keywords included in the first data are obtained in a keyword matching manner to serve as the first data feature. The preset keywords can be stored in a preset database, and the preset database can be a target node on the block chain in consideration of reliability and privacy of data storage.
Optionally, the determining the original logical item and the target logical item according to the first data type and the second data type respectively includes:
traversing a preset mapping relation between the data type and the logic item according to the first data type to obtain a first original logic item and a first target logic item corresponding to the first data type;
and traversing a preset mapping relation between the data type and the logic item according to the second data type to obtain a second original logic item and a second target logic item corresponding to the second data type.
The first data type includes corresponding original logic items and target logic items, the second data type also includes corresponding original logic items and target logic items, and the original logic items and the target logic items included in the first data type may be the same as or different from those included in the second data type, which is not limited herein.
The logic traversal module 203 is configured to traverse a first preset data layer according to the original logic item to obtain an original data logic value corresponding to the original logic item, and traverse a second preset data layer according to the target logic item to obtain a target data logic value corresponding to the target logic item.
In at least one embodiment of the present application, the first preset layer is a data layer storing related configuration information (also referred to as first code configuration information) of an original database, where the related configuration information may include the original logic item, an original data logic value corresponding to the original logic item, and an initial data splicing code. The second preset data layer is a data layer for storing relevant configuration information of a target database, and the relevant configuration information may include the target logic item, a target data logic value corresponding to the target logic, and the initial data splicing code. It can be understood that the initial data splicing code in the second preset data layer needs to perform code migration with iteration step by step, and then obtain the target data splicing code. In an embodiment, the first preset data layer may be a first preset dao layer, the second preset data layer may be a second preset dao layer, and the first preset dao layer and the second preset dao layer mainly work as a data persistence layer.
In an embodiment, the present application provides a data splicing function migration system, where the system at least includes a controller layer, a dao layer, and a service layer, where the controller layer is mainly used to control a specific service module process, the dao layer is mainly used to work a data persistence layer, and the service layer is mainly used to design an application logic application of a service module. The service layer is established above the dao layer, and can be established after the dao layer is established, and the service layer is also under the controller layer, so that the service layer not only calls the interface of the dao layer, but also provides the interface for the class of the controller layer to call, and the service layer is just at the position of an intermediate layer. Each service module has a service interface, and each interface respectively encapsulates a respective service processing method. In the migration and transformation process of the data splicing function, a controller layer does not need to be changed, and a switch configuration (for example, the switch configuration is a switchaction switch) is added on a service layer, and a dao layer (also referred to as a second preset data layer in the present application) is added to process the logic migrated from a target database (for example, the target database is a pg database).
Optionally, traversing a first preset data layer according to the original logical item to obtain an original data logical value corresponding to the original logical item includes:
acquiring first code configuration information in the first preset data layer;
detecting whether the original logic item exists in the first code configuration information;
and when the detection result shows that the original logic item exists in the first code configuration information, determining a first target position of the original logic item in the first code configuration information, and extracting configuration content at the first target position as an original data logic value.
The first code configuration information refers to relevant configuration information of the original database, and the first code configuration information may include the original logic item, an original data logic value corresponding to the original logic item, and an original data splicing code. The detecting whether the original logic item exists in the first code configuration information, that is, whether the keyword information corresponding to the original logic item exists in the first code configuration information, and when the detecting result indicates that the keyword information corresponding to the original logic item exists in the first code configuration information, determining that the original logic item exists in the first code configuration information. In the first code configuration information, the original logic item and the original data logic value are stored according to a preset data format, and in an embodiment, the preset data format may be { original logic item, original data logic value }. The first target position refers to a position of the original logic item in the first code configuration information, and the configuration content at the first target position can be determined to be an original data logic value through the preset data format.
Optionally, the traversing a second preset data layer according to the target logic item to obtain a target data logic value corresponding to the target logic item includes:
acquiring second code configuration information in the second preset data layer;
detecting whether the target logic item exists in the second code configuration information;
and when the detection result shows that the target logic item exists in the second code configuration information, determining a second target position of the target logic item in the second code configuration information, and extracting configuration content at the second target position as a target data logic value.
For example, the original logical item and the target logical item may include, but are not limited to, a return logical item, a date logical item, a query logical item, an outer link logical item, a function logical item, a time logical item, and a table logical item, wherein for the return logical item, the corresponding original data logical value is: when the original database returns Map, the default of the query field is capitalization, and the corresponding target data logic value is as follows: when the target database returns the Map, the query field is in lowercase by default. For the date logical item, the corresponding raw data logical value is: the date format is year-month-day, and the corresponding logical values of the original data are as follows: year, month and day. For the query logical term, the corresponding raw data logical values are: the sub-query does not need to add an alias, and the corresponding target data logic value is as follows: the sub-query requires the addition of an alias. The original data logic and the target data logic corresponding to each logic item are preset, and are not described herein.
The code obtaining module 204 is configured to obtain an initial data splicing code in an original database.
In at least one embodiment of the present application, the first preset layer stores related configuration information (also referred to as first code configuration information) of an original database, where the related configuration information may include the original logic item, an original data logic value corresponding to the original logic item, and an original data splicing code. In an embodiment, the initial data splicing code is provided with a corresponding code identifier for characterizing the module, so as to implement the data splicing function.
Optionally, the obtaining the initial data splicing code in the original database includes:
acquiring a first preset layer corresponding to the original database, and extracting first code configuration information in the first preset layer;
detecting whether a data splicing identifier exists in the first code configuration information;
and when the detection result indicates that the data splicing identification exists in the first code configuration information, acquiring a code corresponding to the data splicing identification as the initial data splicing code.
The code adjusting module 205 is configured to invoke a preset switch to adjust the initial data splicing code according to the original data logical value and the target data logical value, so as to obtain a target data splicing code.
In at least one embodiment of the present application, the preset switch may be a switchactionutility switch, and the data logic switching may be completed by invoking the preset switch, that is, the preset switch is invoked to change the original data logic value in the initial data splicing code into the target data logic value, so as to obtain the target data splicing code.
In one embodiment, a data source of a target database is configured through an ark configuration center, a public class switched by a preset switch is written in a public tool class, an action variable is defined in the public class switched by the preset switch to obtain ark a value of the data source of the configuration center, a method get is written, the value of the action is returned, a logic judgment is made in a code by using the public method, a data logic corresponding to the target database is executed when the switch is opened, and a data logic corresponding to an original database is executed when the switch is closed.
Optionally, the calling a preset switch to adjust the initial data splicing code according to the original data logic value and the target data logic value, and obtaining a target data splicing code includes:
acquiring the initial data splicing code;
calling a preset switch to determine the original data logic value in the initial data splicing code;
and replacing the original data logic value as a target data logic value to obtain a target data splicing code.
It can be understood that the target data splicing code is used for splicing and processing the first data and the second data, and the data splicing request is used for requesting to splice data of other data types, for example, when the data splicing request is used for requesting to splice third data and fourth data, the data splicing code needs to be continuously migrated in one step through the above steps until the data splicing code corresponding to the target database can process data splicing of all data types.
The code splicing module 206 is configured to invoke the target data splicing code to splice the first data and the second data, so as to obtain a data splicing result.
In at least one embodiment of the present application, the target data splicing code is called to splice and process the first data and the second data according to the splicing requirement in the data splicing request, so as to obtain a data splicing result. Wherein the splicing requirement may include a data splicing order. The data splicing order may refer to a splicing order of the first data and the second data, for example, the first data is ordered before the second data.
Optionally, the invoking the target data splicing code to splice the first data and the second data, and obtaining a data splicing result includes:
analyzing the data splicing request to obtain a data splicing requirement;
and calling the target data splicing code to splice and process the first data and the second data according to the data splicing requirement to obtain a data splicing result.
Fig. 3 is a schematic structural diagram of a computer device according to a third embodiment of the present application. In the preferred embodiment of the present application, the computer device 3 includes a memory 31, at least one processor 32, at least one communication bus 33, and a transceiver 34.
It will be appreciated by those skilled in the art that the configuration of the computer device shown in fig. 3 is not a limitation of the embodiments of the present application, and may be a bus-type configuration or a star-type configuration, and that the computer device 3 may include more or less hardware or software than those shown, or a different arrangement of components.
In some embodiments, the computer device 3 is a device capable of automatically performing numerical calculation and/or information processing according to instructions set or stored in advance, and the hardware includes but is not limited to a microprocessor, an application specific integrated circuit, a programmable gate array, a digital processor, an embedded device, and the like. The computer device 3 may also include a client device, which includes, but is not limited to, any electronic product capable of interacting with a client through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device, for example, a personal computer, a tablet computer, a smart phone, a digital camera, etc.
It should be noted that the computer device 3 is only an example, and other existing or future electronic products, such as those that may be adapted to the present application, are also included in the scope of the present application and are incorporated herein by reference.
In some embodiments, the memory 31 has stored therein a computer program which, when executed by the at least one processor 32, implements all or part of the steps of the data splicing function migration method as described. The Memory 31 includes a Read-Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), a One-time Programmable Read-Only Memory (OTPROM), an electronically Erasable rewritable Read-Only Memory (Electrically-Erasable Programmable Read-Only Memory (EEPROM)), an optical Read-Only disk (CD-ROM) or other optical disk Memory, a magnetic disk Memory, a tape Memory, or any other medium readable by a computer capable of carrying or storing data.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
The block chain referred by the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
In some embodiments, the at least one processor 32 is a Control Unit (Control Unit) of the computer device 3, connects various components of the entire computer device 3 by using various interfaces and lines, and executes various functions and processes data of the computer device 3 by running or executing programs or modules stored in the memory 31 and calling data stored in the memory 31. For example, the at least one processor 32, when executing the computer program stored in the memory, implements all or part of the steps of the data splicing function migration method described in the embodiments of the present application; or realize all or part of the functions of the data splicing function migration device. The at least one processor 32 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips.
In some embodiments, the at least one communication bus 33 is arranged to enable connection communication between the memory 31 and the at least one processor 32 or the like.
Although not shown, the computer device 3 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 32 through a power management device, so as to implement functions of managing charging, discharging, and power consumption through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The computer device 3 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
The integrated unit implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a computer device, or a network device) or a processor (processor) to execute parts of the methods according to the embodiments of the present application.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the present application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or that the singular does not exclude the plural. A plurality of units or means recited in the specification may also be implemented by one unit or means through software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only used for illustrating the technical solutions of the present application and not for limiting, and although the present application is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions can be made on the technical solutions of the present application without departing from the spirit and scope of the technical solutions of the present application.

Claims (10)

1. A data splicing function migration method is characterized by comprising the following steps:
when a data splicing request is received, analyzing the data splicing request to obtain first data and second data to be spliced;
acquiring a first data type corresponding to the first data and a second data type corresponding to the second data, and determining an original logic item and a target logic item according to the first data type and the second data type respectively;
traversing a first preset data layer according to the original logic item to obtain an original data logic value corresponding to the original logic item, and traversing a second preset data layer according to the target logic item to obtain a target data logic value corresponding to the target logic item;
acquiring an initial data splicing code in an original database;
calling a preset switch to adjust the initial data splicing code according to the logic value of the original data and the logic value of the target data to obtain a target data splicing code;
and calling the target data splicing code to splice and process the first data and the second data to obtain a data splicing result.
2. The data splicing function migration method according to claim 1, wherein the analyzing the data splicing request to obtain the first data and the second data to be spliced comprises:
analyzing the data splicing request, and detecting whether the data splicing request carries a data identifier or not;
when the detection result is that the data splicing request carries the data identifier, extracting a first data identifier and a second data identifier;
and traversing the mapping relation between the preset data identification and the data according to the first data identification and the second data identification to obtain the first data and the second data to be spliced.
3. The data splicing function migration method according to claim 1, wherein the determining the original logical item and the target logical item according to the first data type and the second data type respectively comprises:
traversing a preset mapping relation between the data type and the logic item according to the first data type to obtain a first original logic item and a first target logic item corresponding to the first data type;
and traversing a preset mapping relation between the data type and the logic item according to the second data type to obtain a second original logic item and a second target logic item corresponding to the second data type.
4. The data splicing function migration method according to claim 1, wherein the traversing a first preset data layer according to the original logical item to obtain an original data logical value corresponding to the original logical item includes:
acquiring first code configuration information in the first preset data layer;
detecting whether the original logic item exists in the first code configuration information;
and when the detection result shows that the original logic item exists in the first code configuration information, determining a first target position of the original logic item in the first code configuration information, and extracting configuration content at the first target position as an original data logic value.
5. The data splicing function migration method according to claim 1, wherein the obtaining the initial data splicing code in the original database comprises:
acquiring a first preset layer corresponding to the original database, and extracting first code configuration information in the first preset layer;
detecting whether a data splicing identifier exists in the first code configuration information;
and when the detection result indicates that the data splicing identification exists in the first code configuration information, acquiring a code corresponding to the data splicing identification as the initial data splicing code.
6. The data splicing function migration method according to claim 1, wherein the calling a preset switch to adjust the initial data splicing code according to the original data logic value and the target data logic value to obtain a target data splicing code comprises:
acquiring the initial data splicing code;
calling a preset switch to determine the original data logic value in the initial data splicing code;
and replacing the original data logic value as a target data logic value to obtain a target data splicing code.
7. The data splicing function migration method according to claim 1, wherein the calling the target data splicing code to splice and process the first data and the second data, and obtaining a data splicing result comprises:
analyzing the data splicing request to obtain a data splicing requirement;
and calling the target data splicing code to splice and process the first data and the second data according to the data splicing requirement to obtain a data splicing result.
8. A data splicing function migration apparatus, characterized in that the data splicing function migration apparatus comprises:
the request analysis module is used for analyzing the data splicing request when the data splicing request is received to obtain first data and second data to be spliced;
the type acquisition module is used for acquiring a first data type corresponding to the first data and a second data type corresponding to the second data, and determining an original logic item and a target logic item according to the first data type and the second data type respectively;
the logic traversing module is used for traversing a first preset data layer according to the original logic item to obtain an original data logic value corresponding to the original logic item, and traversing a second preset data layer according to the target logic item to obtain a target data logic value corresponding to the target logic item;
the code acquisition module is used for acquiring initial data splicing codes in an original database;
the code adjusting module is used for calling a preset switch to adjust the initial data splicing code according to the original data logic value and the target data logic value to obtain a target data splicing code;
and the code splicing module is used for calling the target data splicing code to splice the first data and the second data to obtain a data splicing result.
9. A computer device comprising a processor for implementing a data stitching function migration method as claimed in any one of claims 1 to 7 when executing a computer program stored in a memory.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the data splicing function migration method according to any one of claims 1 to 7.
CN202210061955.2A 2022-01-19 2022-01-19 Data splicing function migration method and device, computer equipment and storage medium Pending CN114416695A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210061955.2A CN114416695A (en) 2022-01-19 2022-01-19 Data splicing function migration method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210061955.2A CN114416695A (en) 2022-01-19 2022-01-19 Data splicing function migration method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114416695A true CN114416695A (en) 2022-04-29

Family

ID=81274637

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210061955.2A Pending CN114416695A (en) 2022-01-19 2022-01-19 Data splicing function migration method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114416695A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116070601A (en) * 2023-03-28 2023-05-05 联仁健康医疗大数据科技股份有限公司 Data splicing method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116070601A (en) * 2023-03-28 2023-05-05 联仁健康医疗大数据科技股份有限公司 Data splicing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108073688B (en) Data migration method and device
CN109947770A (en) A kind of data base query method, terminal device and storage medium
CN112364107A (en) System analysis visualization method and device, electronic equipment and computer readable storage medium
CN116361290A (en) Cold and hot data processing method and device, electronic equipment and storage medium
CN112612462A (en) Method and device for adjusting phone configuration, electronic equipment and storage medium
CN114416695A (en) Data splicing function migration method and device, computer equipment and storage medium
CN114201212A (en) Configuration file processing method and device, computer equipment and storage medium
CN114020892A (en) Answer selection method and device based on artificial intelligence, electronic equipment and medium
JP5206268B2 (en) Rule creation program, rule creation method and rule creation device
CN114398345A (en) Data migration method and device, computer equipment and storage medium
CN116341523A (en) Text error correction method, device, computer equipment and storage medium
CN114116673A (en) Data migration method based on artificial intelligence and related equipment
CN115114297A (en) Data lightweight storage and search method and device, electronic equipment and storage medium
CN114239538A (en) Assertion processing method and device, computer equipment and storage medium
CN115048456A (en) User label generation method and device, computer equipment and readable storage medium
CN116414801A (en) Data migration method, device, computer equipment and storage medium
CN114418585A (en) Intelligent contract generation method and device and related equipment
CN113127428A (en) Data batch import method and device and related equipment
CN112000671A (en) Block chain-based database table processing method, device and system
CN115373639A (en) Data processing method and device, computer equipment and storage medium
CN116776366A (en) User permission control method and device, electronic equipment and storage medium
CN114925688A (en) Data processing method and device based on artificial intelligence, electronic equipment and medium
CN114860314B (en) Deployment upgrading method, device, equipment and medium based on database compatibility
CN114969261A (en) Data query method and device based on artificial intelligence, electronic equipment and medium
CN116561106B (en) Configuration item data management method and system

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