Movatterモバイル変換


[0]ホーム

URL:


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
CN114416695ACN202210061955.2ACN202210061955ACN114416695ACN 114416695 ACN114416695 ACN 114416695ACN 202210061955 ACN202210061955 ACN 202210061955ACN 114416695 ACN114416695 ACN 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.)
Granted
Application number
CN202210061955.2A
Other languages
Chinese (zh)
Other versions
CN114416695B (en
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 LtdfiledCriticalPing An Life Insurance Company of China Ltd
Priority to CN202210061955.2ApriorityCriticalpatent/CN114416695B/en
Publication of CN114416695ApublicationCriticalpatent/CN114416695A/en
Application grantedgrantedCritical
Publication of CN114416695BpublicationCriticalpatent/CN114416695B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

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

Translated fromChinese
数据拼接功能迁移方法、装置、计算机设备及存储介质Data splicing function migration method, device, computer equipment and storage medium

技术领域technical field

本申请涉及人工智能技术领域,尤其涉及一种数据拼接功能迁移方法、装置、计算机设备及存储介质。The present application relates to the technical field of artificial intelligence, and in particular, to a data splicing function migration method, device, computer equipment and storage medium.

背景技术Background technique

随着移动互联网和智能设备的快速发展和普及,互联网应用的数据库处理数据的压力越来越大,同时用户对请求响应时间的要求也愈加苛刻,应用对数据库能够稳定的提供服务的要求也更为提升。在数据库的性能提升已达一定瓶颈的背景下,使用更新型的数据库已成为提升稳定性和数据库响应速度的主要手段之一。With the rapid development and popularization of the mobile Internet and smart devices, the pressure on the database of Internet applications to process data is increasing. At the same time, the user's request response time requirements are becoming more and more demanding, and the application's requirements for the database to be able to provide services stably are also higher. for promotion. Under the background that the performance improvement of the database has reached a certain bottleneck, the use of an updated database has become one of the main means to improve the stability and response speed of the database.

在实现本申请的过程中,申请人发现现有技术存在如下技术问题:对于原始数据库存在数据拼接功能的情况,在使用更新型的数据库时,需要对数据拼接功能进行迁移。例如,数据拼接功能以前是在ignite数据库实现的,现在需要将其迁移到pg库,直接一次性迁移该数据拼接功能的话,要兼容两种数据库,需要改动的代码太多,工作量大且容易遗漏相关兼容信息,无法保证数据拼接功能迁移的准确性。In the process of realizing the present application, the applicant found that the prior art has the following technical problems: when the original database has a data splicing function, when using an updated database, the data splicing function needs to be migrated. For example, the data splicing function was previously implemented in the ignite database, and now it needs to be migrated to the pg library. If the data splicing function is directly migrated at one time, to be compatible with the two databases, the code needs to be changed too much, and the workload is heavy and easy. The omission of relevant compatibility information cannot guarantee the accuracy of the migration of the data stitching function.

因此,有必要提供一种数据拼接功能迁移方法,能够提高数据拼接功能迁移的准确性。Therefore, it is necessary to provide a data splicing function migration method, which can improve the accuracy of the data splicing function migration.

发明内容SUMMARY OF THE INVENTION

鉴于以上内容,有必要提出一种数据拼接功能迁移方法、数据拼接功能迁移装置、计算机设备及存储介质,能够提高数据拼接功能迁移的准确性。In view of the above content, it is necessary to propose a data splicing function migration method, data splicing function migration device, computer equipment and storage medium, which can improve the accuracy of data splicing function migration.

本申请实施例第一方面还提供一种数据拼接功能迁移方法,所述数据拼接功能迁移方法包括:A first aspect of the embodiments of the present application further provides a method for migrating a data splicing function, where the method for migrating a data splicing function includes:

当接收到数据拼接请求时,解析所述数据拼接请求,得到待拼接的第一数据与第二数据;When a data splicing request is received, the data splicing request is parsed to obtain the first data and the second data to be spliced;

获取所述第一数据对应的第一数据类型以及所述第二数据对应的第二数据类型,并分别根据所述第一数据类型与所述第二数据类型确定原始逻辑项与目标逻辑项;Obtain the first data type corresponding to the first data and the second data type corresponding to the second data, and determine the original logic item and the target logic item according to the first data type and the second data type respectively;

根据所述原始逻辑项遍历第一预设数据层,得到所述原始逻辑项对应的原始数据逻辑值,并根据所述目标逻辑项遍历第二预设数据层,得到所述目标逻辑项对应的目标数据逻辑值;Traverse the first preset data layer according to the original logical item to obtain the original data logical value corresponding to the original logical item, and traverse the second preset data layer according to the target logical item to obtain the corresponding logical value of the target logical item target data logical value;

获取原始数据库中的初始数据拼接代码;Get the initial data stitching code in the original database;

调用预设开关根据所述原始数据逻辑值与所述目标数据逻辑值调整所述初始数据拼接代码,得到目标数据拼接代码;Calling the preset switch to adjust the initial data splicing code according to the original data logical value and the target data logical value to obtain the target data splicing code;

调用所述目标数据拼接代码拼接处理所述第一数据与所述第二数据,得到数据拼接结果。Call the target data splicing code to splicing and process the first data and the second data to obtain a data splicing result.

进一步地,在本申请实施例提供的上述数据拼接功能迁移方法中,所述解析所述数据拼接请求,得到待拼接的第一数据与第二数据包括:Further, in the above-mentioned data splicing function migration method provided in the embodiment of the present application, the parsing of the data splicing request to obtain the first data and the second data to be spliced includes:

解析所述数据拼接请求,并检测所述数据拼接请求中是否携带数据标识;Parse the data splicing request, and detect whether the data splicing request carries a data identifier;

当检测结果为所述数据拼接请求中携带所述数据标识时,提取第一数据标识与第二数据标识;When the detection result is that the data splicing request carries the data identifier, extracting the first data identifier and the second data identifier;

根据所述第一数据标识与所述第二数据标识分别遍历预先设置的数据标识与数据的映射关系,得到待拼接的第一数据与第二数据。According to the first data identifier and the second data identifier, the preset mapping relationship between the data identifier and the data is traversed respectively, so as to obtain the first data and the second data to be spliced.

进一步地,在本申请实施例提供的上述数据拼接功能迁移方法中,所述分别根据所述第一数据类型与所述第二数据类型确定原始逻辑项与目标逻辑项包括:Further, in the above-mentioned data splicing function migration method provided in the embodiment of the present application, the determining of the original logic item and the target logic item according to the first data type and the second data type respectively includes:

根据所述第一数据类型遍历预先设置的数据类型与逻辑项的映射关系,得到所述第一数据类型对应的第一原始逻辑项与第一目标逻辑项;Traverse the mapping relationship between the preset data type and the logical item according to the first data type, and obtain the first original logical item and the first target logical item corresponding to the first data type;

根据所述第二数据类型遍历预先设置的数据类型与逻辑项的映射关系,得到所述第二数据类型对应的第二原始逻辑项与第二目标逻辑项。According to the second data type, the preset mapping relationship between the data type and the logic item is traversed, and the second original logic item and the second target logic item corresponding to the second data type are obtained.

进一步地,在本申请实施例提供的上述数据拼接功能迁移方法中,所述根据所述原始逻辑项遍历第一预设数据层,得到所述原始逻辑项对应的原始数据逻辑值包括:Further, in the above-mentioned data splicing function migration method provided by the embodiment of the present application, the step of traversing the first preset data layer according to the original logic item to obtain the original data logic value corresponding to the original logic item includes:

获取所述第一预设数据层中的第一代码配置信息;obtaining the first code configuration information in the first preset data layer;

检测所述第一代码配置信息中是否存在所述原始逻辑项;Detecting whether the original logic item exists in the first code configuration information;

当检测结果为所述第一代码配置信息中存在所述原始逻辑项时,确定所述第一代码配置信息中所述原始逻辑项的第一目标位置,并提取所述第一目标位置处的配置内容作为原始数据逻辑值。When the detection result is that the original logic item exists in the first code configuration information, determine the first target position of the original logic item in the first code configuration information, and extract the first target position of the original logic item. Configuration content as raw data logical value.

进一步地,在本申请实施例提供的上述数据拼接功能迁移方法中,所述获取原始数据库中的初始数据拼接代码包括:Further, in the above-mentioned data splicing function migration method provided by the embodiment of the present application, the obtaining the initial data splicing code in the original database includes:

获取所述原始数据库对应的第一预设层,并提取所述第一预设层中的第一代码配置信息;acquiring the first preset layer corresponding to the original database, and extracting the first code configuration information in the first preset layer;

检测所述第一代码配置信息中是否存在数据拼接标识;Detecting whether there is a data splicing identifier in the first code configuration information;

当检测结果为所述第一代码配置信息中存在所述数据拼接标识时,获取所述数据拼接标识对应的代码作为所述初始数据拼接代码。When the detection result is that the data splicing identifier exists in the first code configuration information, a code corresponding to the data splicing identifier is acquired as the initial data splicing code.

进一步地,在本申请实施例提供的上述数据拼接功能迁移方法中,所述调用预设开关根据所述原始数据逻辑值与所述目标数据逻辑值调整所述初始数据拼接代码,得到目标数据拼接代码包括:Further, in the above-mentioned data splicing function migration method provided by the embodiment of the present application, the calling preset switch adjusts the initial data splicing code according to the original data logical value and the target data logical value, and obtains the target data splicing. The code includes:

获取所述初始数据拼接代码;Obtain the initial data splicing code;

调用预设开关确定所述初始数据拼接代码中的所述原始数据逻辑值;Calling a preset switch to determine the original data logical value in the initial data splicing code;

替换所述原始数据逻辑值为目标数据逻辑值,得到目标数据拼接代码。The original data logical value is replaced with the target data logical value, and the target data splicing code is obtained.

进一步地,在本申请实施例提供的上述数据拼接功能迁移方法中,所述调用所述目标数据拼接代码拼接处理所述第一数据与所述第二数据,得到数据拼接结果包括:Further, in the above-mentioned data splicing function migration method provided in the embodiment of the present application, the calling of the target data splicing code to splicing and processing the first data and the second data, and obtaining a data splicing result includes:

解析所述数据拼接请求,得到数据拼接要求;Parse the data splicing request to obtain the data splicing request;

调用所述目标数据拼接代码按照所述数据拼接要求拼接处理所述第一数据与所述第二数据,得到数据拼接结果。Call the target data splicing code to splicing and process the first data and the second data according to the data splicing requirements, and obtain a data splicing result.

本申请实施例第二方面还提供一种数据拼接功能迁移装置,所述数据拼接功能迁移装置包括:A second aspect of the embodiments of the present application further provides a data splicing function migration device, where the data splicing function migration device includes:

请求解析模块,用于当接收到数据拼接请求时,解析所述数据拼接请求,得到待拼接的第一数据与第二数据;a request parsing module, configured to parse the data splicing request when receiving the data splicing request, and obtain the first data and the second data to be spliced;

类型获取模块,用于获取所述第一数据对应的第一数据类型以及所述第二数据对应的第二数据类型,并分别根据所述第一数据类型与所述第二数据类型确定原始逻辑项与目标逻辑项;a type acquisition module, configured to acquire the first data type corresponding to the first data and the second data type corresponding to the second data, and determine the original logic according to the first data type and the second data type respectively item and target logic item;

逻辑遍历模块,用于根据所述原始逻辑项遍历第一预设数据层,得到所述原始逻辑项对应的原始数据逻辑值,并根据所述目标逻辑项遍历第二预设数据层,得到所述目标逻辑项对应的目标数据逻辑值;The logic traversal module is configured to traverse the first preset data layer according to the original logic item, obtain the original data logical value corresponding to the original logic item, and traverse the second preset data layer according to the target logic item to obtain the Describe the target data logic value corresponding to the target logic item;

代码获取模块,用于获取原始数据库中的初始数据拼接代码;The code acquisition module is used to acquire the initial data splicing code in the original database;

代码调整模块,用于调用预设开关根据所述原始数据逻辑值与所述目标数据逻辑值调整所述初始数据拼接代码,得到目标数据拼接代码;a code adjustment module, configured to call a preset switch to adjust the initial data splicing code according to the original data logical value and the target data logical value, to obtain the target data splicing code;

代码拼接模块,用于调用所述目标数据拼接代码拼接处理所述第一数据与所述第二数据,得到数据拼接结果。A code splicing module is used to call the target data splicing code splicing to process the first data and the second data to obtain a data splicing result.

本申请实施例第三方面还提供一种计算机设备,所述计算机设备包括处理器,所述处理器用于执行存储器中存储的计算机程序时实现如上述任意一项所述数据拼接功能迁移方法。A third aspect of the embodiments of the present application further provides a computer device, the computer device includes a processor, and the processor is configured to implement the data splicing function migration method described in any one of the above when executing the computer program stored in the memory.

本申请实施例第四方面还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现上述任意一项所述数据拼接功能迁移方法。A 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 data splicing function migration according to any one of the above-mentioned items is implemented. method.

本申请实施例提供的上述数据拼接功能迁移方法、数据拼接功能迁移装置、计算机设备以及计算机可读存储介质,通过配置预设开关,并调用所述预设开关在数据拼接过程中实现数据拼接代码的一步步迭代迁移,避免一次性迁移导致的工作量大且容易发生遗漏的问题,能够减少工作量,不影响业务使用,且提高数据拼接功能迁移的准确性;且本申请通过配置两个预设数据层,分别用于存储原始数据库与目标数据库的代码配置信息,与所述预设开关协同工作,在预设开关需要选取原始数据逻辑值时遍历第一预设数据层,需要选取目标数据逻辑值时遍历第二预设数据层,能够提高数据逻辑值获取的准确性,从而提高数据拼接功能迁移的准确性。本申请可应用于智慧政务、智慧交通等智慧城市的各个功能模块中,比如智慧政务的数据拼接功能迁移模块等,能够促进智慧城市的快速发展。The above-mentioned data splicing function migration method, data splicing function migration device, computer equipment, and computer-readable storage medium provided in the embodiments of the present application implement data splicing code in the data splicing process by configuring a preset switch and invoking the preset switch. step-by-step iterative migration, avoiding the problem of large workload and easy omission caused by one-time migration, can reduce workload, do not affect business use, and improve the accuracy of data splicing function migration; and this application configures two presets. A data layer is set, which is used to store the code configuration information of the original database and the target database respectively, and works cooperatively with the preset switch. When the preset switch needs to select the logical value of the original data, the first preset data layer needs to be traversed, and the target data needs to be selected. Traversing the second preset data layer when the logical value is performed can improve the accuracy of obtaining the logical value of the data, thereby improving the accuracy of the migration of the data splicing function. The present application can be applied to various functional modules of smart cities such as smart government affairs, smart transportation, etc., such as the data splicing function migration module of smart government affairs, etc., which can promote the rapid development of smart cities.

附图说明Description of drawings

图1是本申请实施例一提供的数据拼接功能迁移方法的流程图。FIG. 1 is a flowchart of a method for migrating a data splicing function provided by Embodiment 1 of the present application.

图2是本申请实施例二提供的数据拼接功能迁移装置的结构图。FIG. 2 is a structural diagram of an apparatus for migrating a data splicing function according to Embodiment 2 of the present application.

图3是本申请实施例三提供的计算机设备的结构示意图。FIG. 3 is a schematic structural diagram of a computer device provided in Embodiment 3 of the present application.

如下具体实施方式将结合上述附图进一步说明本申请。The following specific embodiments will further illustrate the present application in conjunction with the above drawings.

具体实施方式Detailed ways

为了能够更清楚地理解本申请的上述目的、特征和优点,下面结合附图和具体实施例对本申请进行详细描述。需要说明的是,在不冲突的情况下,本申请的实施例及实施例中的特征可以相互组合。In order to more clearly understand the above objects, features and advantages of the present application, the present application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments may be combined with each other in the case of no conflict.

在下面的描述中阐述了很多具体细节以便于充分理解本申请,所描述的实施例是本申请一部分实施例,而不是全部的实施例。In the following description, many specific details are set forth in order to facilitate a full understanding of the present application, and the described embodiments are some, but not all, of the embodiments of the present application.

除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中在本申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this application belongs. The terms used herein in the specification of the application are for the purpose of describing specific embodiments only, and are not intended to limit the application.

本申请实施例可以基于人工智能技术对相关的数据进行获取和处理。其中,人工智能(Artificial Intelligence,AI)是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。The embodiments of the present application may acquire and process related data based on artificial intelligence technology. Among them, artificial intelligence (AI) is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. .

人工智能基础技术一般包括如传感器、专用人工智能芯片、云计算、分布式存储、大数据处理技术、操作/交互系统、机电一体化等技术。人工智能软件技术主要包括计算机视觉技术、机器人技术、生物识别技术、语音处理技术、自然语言处理技术以及机器学习/深度学习等几大方向。The basic technologies of artificial intelligence generally include technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation/interaction systems, and mechatronics. Artificial intelligence software technology mainly includes computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning/deep learning.

本发明实施例提供的数据拼接功能迁移方法由计算机设备执行,相应地,数据拼接功能迁移装置运行于计算机设备中。图1是本申请实施例一提供的数据拼接功能迁移方法的流程图。如图1所示,所述数据拼接功能迁移方法可以包括如下步骤,根据不同的需求,该流程图中步骤的顺序可以改变,某些可以省略:The data splicing function migration method provided by the embodiment of the present invention is executed by computer equipment, and correspondingly, the data splicing function migration apparatus runs in the computer equipment. FIG. 1 is a flowchart of a method for migrating a data splicing function provided by Embodiment 1 of the present application. As shown in Figure 1, the data splicing function migration method may include the following steps. According to different requirements, the order of the steps in the flowchart may be changed, and some may be omitted:

S11,当接收到数据拼接请求时,解析所述数据拼接请求,得到待拼接的第一数据与第二数据。S11, when a data splicing request is received, parse the data splicing request to obtain first data and second data to be spliced.

在本申请的至少一实施例中,所述数据拼接请求是指目标数据库发出的用于进行数据拼接处理的请求,进行数据拼接处理的数据的数量不做限制,可以为两个,也可以为两个以上,本申请实施例以两个为例,也即待拼接的数据为第一数据与第二数据。所述目标数据库是指待迁移数据拼接功能的数据库,数据拼接功能可以从原始数据库中获取,所述原始数据库中的数据拼接功能是指利用已配置好的数据拼接代码执行的相关功能。在一实施例中,所述目标数据库可以为pg数据库(PostgreSQL数据库),所述原始数据库可以为ignite数据库(内存数据库,响应速度快,但稳定性较差)。所述数据拼接请求中包含待拼接的第一数据的第一数据标识与第二数据的第二数据标识,数据标识的方式可以为数字、字母或颜色,在此不做限制。通过查询该数据标识,能够得到待拼接的相关数据信息。In at least one embodiment of the present application, the data splicing request refers to a request sent by the target database for data splicing processing, and the number of data splicing processing is not limited, which may be two or If there are more than two, the embodiment of the present application uses two as an example, that is, the data to be spliced are the first data and the second data. The target database refers to the database of the data splicing function to be migrated, and the data splicing function can be obtained from the original database. The data splicing function in the original database refers to the related function performed by using the 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 (an in-memory database, with fast response speed but poor stability). The data splicing request includes the first data identifier of the first data to be spliced and the second data identifier of the second data, and the data identifier may be numbers, letters or colors, which are not limited here. By querying the data identifier, relevant data information to be spliced can be obtained.

可选地,所述解析所述数据拼接请求,得到待拼接的第一数据与第二数据包括:Optionally, the parsing of the data splicing request to obtain the first data and the second data to be spliced includes:

解析所述数据拼接请求,并检测所述数据拼接请求中是否携带数据标识;Parse the data splicing request, and detect whether the data splicing request carries a data identifier;

当检测结果为所述数据拼接请求中携带所述数据标识时,提取第一数据标识与第二数据标识;When the detection result is that the data splicing request carries the data identifier, extracting the first data identifier and the second data identifier;

根据所述第一数据标识与所述第二数据标识分别遍历预先设置的数据标识与数据的映射关系,得到待拼接的第一数据与第二数据。According to the first data identifier and the second data identifier, the preset mapping relationship between the data identifier and the data is traversed respectively, so as to obtain the first data and the second data to be spliced.

其中,当检测结果为所述数据拼接请求中未携带所述数据标识时,说明此时所述数据拼接请求中未携带待拼接的数据信息,该数据拼接请求可能存在错误,可以报错给相关负责人进行纠错处理。Wherein, when the detection result is that the data splicing request does not carry the data identifier, it means that the data splicing request does not carry the data information to be spliced at this time, the data splicing request may have errors, and an error can be reported to the relevant responsible person Humans make corrections.

S12,获取所述第一数据对应的第一数据类型以及所述第二数据对应的第二数据类型,并分别根据所述第一数据类型与所述第二数据类型确定原始逻辑项与目标逻辑项。S12: Acquire a first data type corresponding to the first data and a second data type corresponding to the second data, and determine an original logic item and a target logic item according to the first data type and the second data type respectively item.

在本申请的至少一实施例中,不同数据均有相应的数据类型,所述数据类型可以为返回数据类型、日期数据类型、查询数据类型、外链接数据类型、函数数据类型、时间数据类型以及表类型等,在此不做限制。所述原始逻辑项是指原始数据库中与数据类型对应的逻辑项,所述目标逻辑项是指目标数据库中与数据类型对应的逻辑项。以所述原始数据库中的逻辑项为例,所述原始逻辑项可以包括但不限于返回逻辑项、日期逻辑项、查询逻辑项、外链接逻辑项、函数逻辑项、时间逻辑项以及表逻辑项。可以理解的是,所述原始逻辑项与所述目标逻辑项间存在映射关系,在一实施例中,所述原始逻辑项与所述目标逻辑项一一对应。数据类型与逻辑项间也存在映射关系,通过查询该映射关系,能够得到所述数据类型对应的逻辑项。In at least one embodiment of the present application, different data have corresponding data types, and the data types may be return data types, date data types, query data types, external link data types, function data types, time data types, and Table types, etc., are not limited here. The original logical item refers to the logical item corresponding to the data type in the original database, and the target logical item refers to the logical item corresponding to the data type in the target database. Taking the logic items in the original database as an example, the original logic items may include but are not limited to return logic items, date logic items, query logic items, external link logic items, function logic items, time logic items, and table logic items . It can be understood that there is a mapping relationship between the original logic item and the target logic item. In one embodiment, the original logic item corresponds to the target logic item one-to-one. There is also a mapping relationship between data types and logical items, and by querying the mapping relationship, the logical items corresponding to the data types can be obtained.

可选地,所述获取所述第一数据对应的第一数据类型以及所述第二数据对应的第二数据类型包括:Optionally, obtaining the first data type corresponding to the first data and the second data type corresponding to the second data includes:

获取所述第一数据对应的第一数据特征;obtaining a first data feature corresponding to the first data;

当原始数据库中存在与所述第一数据特征的相似度超过所述预设相似度阈值的数据类型定义时,确定该数据类型定义对应的数据类型为所述第一数据对应的第一数据类型;When a data type definition whose similarity with the first data feature exceeds the preset similarity threshold exists in the original database, it is determined that the data type corresponding to the data type definition is the first data type corresponding to the first data ;

获取所述第二数据对应的第二数据特征;acquiring second data features corresponding to the second data;

当目标数据库中存在与所述第二数据特征的相似度超过所述预设相似度阈值的数据类型定义时,确定该数据类型定义对应的数据类型为所述第二数据对应的第二数据类型。When a data type definition whose similarity with the second data feature exceeds the preset similarity threshold exists in the target database, it is determined that the data type corresponding to the data type definition is the second data type corresponding to the second data .

其中,所述第一数据特征是指所述第一数据中包含的关键词信息,所述数据类型定义是指数据类型包含的关键词信息,关键词信息可以通过关键词匹配等方式得到。在一实施例中,对于已知的数据类型或者逻辑项,可以预先设置若干关键词用于表征该数据类型或逻辑项,通过关键词匹配的方式获取所述第一数据包含的关键词作为第一数据特征。预先设置的若干关键词可以存储于预设数据库中,考虑到数据存储的可靠性与隐私性,所述预设数据库可以为区块链上的目标节点。Wherein, the first data feature refers to the keyword information contained in the first data, the data type definition refers to the keyword information contained in the data type, and the keyword information can be obtained by means of keyword matching or the like. In one embodiment, for a known data type or logical item, several keywords may be preset to represent the data type or logical item, and the keyword contained in the first data is obtained by keyword matching as the first keyword. a data feature. Several preset keywords can be stored in a preset database, and considering the reliability and privacy of data storage, the preset database can be a target node on the blockchain.

可选地,所述分别根据所述第一数据类型与所述第二数据类型确定原始逻辑项与目标逻辑项包括:Optionally, the determining the original logic item and the target logic item according to the first data type and the second data type respectively includes:

根据所述第一数据类型遍历预先设置的数据类型与逻辑项的映射关系,得到所述第一数据类型对应的第一原始逻辑项与第一目标逻辑项;Traverse the mapping relationship between the preset data type and the logical item according to the first data type, and obtain the first original logical item and the first target logical item corresponding to the first data type;

根据所述第二数据类型遍历预先设置的数据类型与逻辑项的映射关系,得到所述第二数据类型对应的第二原始逻辑项与第二目标逻辑项。According to the second data type, the preset mapping relationship between the data type and the logic item is traversed, and the second original logic item and the second target logic item corresponding to the second data type are obtained.

其中,所述第一数据类型包含相对应的原始逻辑项与目标逻辑项,所述第二数据类型也包含相对应的原始逻辑项与目标逻辑项,所述第一数据类型包含的原始逻辑项与目标逻辑项可以与所述第二数据类型包含的原始逻辑项与目标逻辑项相同,也可以不相同,在此不做限制。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 first data type includes original logic items. The target logic item may be the same as the original logic item and the target logic item included in the second data type, or may be different, which is not limited herein.

S13,根据所述原始逻辑项遍历第一预设数据层,得到所述原始逻辑项对应的原始数据逻辑值,并根据所述目标逻辑项遍历第二预设数据层,得到所述目标逻辑项对应的目标数据逻辑值。S13, traverse the first preset data layer according to the original logic item, obtain the original data logic value corresponding to the original logic item, and traverse the second preset data layer according to the target logic item to obtain the target logic item The corresponding target data logical value.

在本申请的至少一实施例中,所述第一预设层是指存储原始数据库相关配置信息(本申请也称第一代码配置信息)的数据层,相关配置信息可以包括所述原始逻辑项、所述原始逻辑对应的原始数据逻辑值以及初始数据拼接代码。所述第二预设数据层是指存储目标数据库相关配置信息的数据层,相关配置信息可以包括所述目标逻辑项、所述目标逻辑对应的目标数据逻辑值以及所述初始数据拼接代码。可以理解的是,所述第二预设数据层中的所述初始数据拼接代码需要随着一步一步的迭代进行代码迁移,继而得到目标数据拼接代码。在一实施例中,所述第一预设数据层可以为第一预设dao层,所述第二预设数据层可以为第二预设dao层,所述第一预设dao层与所述第二预设dao层主要做数据持久层的工作。In at least one embodiment of the present application, the first preset layer refers to a data layer that stores relevant configuration information of the original database (also referred to as first code configuration information in this application), and the relevant configuration information may include the original logic item , the original data logic value corresponding to the original logic, and the initial data splicing code. The second preset data layer refers to a data layer storing relevant configuration information of the target database, and the relevant configuration information may include the target logic item, the 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 be code migrated with step-by-step iteration, and then the target data splicing code is obtained. In one 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 all The second preset dao layer mentioned above mainly does the work of the data persistence layer.

在一实施例中,本申请提供数据拼接功能迁移系统,该系统至少包含controller层、dao层与service层,其中,controller层主要用于负责具体业务模块流程的控制,dao层主要用于数据持久层的工作,service层主要用于负责业务模块的应用逻辑应用设计。service层是建立在dao层之上的,建立了dao层后才可以建立service层,而service层又是在controller层之下的,因而service层应该既调用dao层的接口,又要提供接口给controller层的类来进行调用,它刚好处于一个中间层的位置。每个业务模块都有一个service接口,每个接口分别封装各自的业务处理方法。本申请提供的数据拼接功能的迁移改造过程中,不需要改变controller层,通过在service层加一个开关配置(例如,开关配置为switchActionUtil开关),新增dao层(本申请又称第二预设数据层)处理目标数据库(例如,目标数据库为pg数据库)迁移过来的逻辑。In one embodiment, the present application provides a data splicing function migration system, which at least includes a controller layer, a dao layer and a service layer, wherein the controller layer is mainly used for the control of specific business module processes, and the dao layer is mainly used for data persistence. The work of the layer, the service layer is mainly used for the application logic application design of the business module. The service layer is built on the dao layer. After the dao layer is established, the service layer can be established, and the service layer is under the controller layer. Therefore, the service layer should not only call the interface of the dao layer, but also provide an interface to the The class of the controller layer is called, which happens to be in a middle layer. Each business module has a service interface, and each interface encapsulates its own business processing method. During the migration and transformation process of the data splicing function provided by this application, it is not necessary to change the controller layer. By adding a switch configuration to the service layer (for example, the switch is configured as a switchActionUtil switch), a new dao layer (also referred to as the second preset in this application) is added. data layer) to process the logic migrated from the target database (for example, the target database is the pg database).

可选地,所述根据所述原始逻辑项遍历第一预设数据层,得到所述原始逻辑项对应的原始数据逻辑值包括:Optionally, traversing the first preset data layer according to the original logic item to obtain the original data logic value corresponding to the original logic item includes:

获取所述第一预设数据层中的第一代码配置信息;obtaining the first code configuration information in the first preset data layer;

检测所述第一代码配置信息中是否存在所述原始逻辑项;Detecting whether the original logic item exists in the first code configuration information;

当检测结果为所述第一代码配置信息中存在所述原始逻辑项时,确定所述第一代码配置信息中所述原始逻辑项的第一目标位置,并提取所述第一目标位置处的配置内容作为原始数据逻辑值。When the detection result is that the original logic item exists in the first code configuration information, determine the first target position of the original logic item in the first code configuration information, and extract the first target position of the original logic item. Configuration content as raw data logical value.

其中,所述第一代码配置信息是指所述原始数据库的相关配置信息,所述第一代码配置信息可以包括所述原始逻辑项、所述原始逻辑对应的原始数据逻辑值以及初始数据拼接代码。所述检测所述第一代码配置信息中是否存在所述原始逻辑项也即检测所述第一代码配置信息中是否存在所述原始逻辑项对应的关键字信息,当检测结果为所述第一代码配置信息中存在所述原始逻辑项对应的关键字信息时,确定所述第一代码配置信息中存在所述原始逻辑项。在所述第一代码配置信息中,所述原始逻辑项与所述原始数据逻辑值是按照预设数据格式存储的,在一实施例中,所述预设数据格式可以为{原始逻辑项,原始数据逻辑值}。所述第一目标位置是指所述原始逻辑项在所述第一代码配置信息中的位置,通过上述预设数据格式,可以确定所述第一目标位置处的配置内容为原始数据逻辑值。The first code configuration information refers to the relevant configuration information of the original database, and the first code configuration information may include the original logic item, the original data logic value corresponding to the original logic, and the initial data splicing code . The detecting whether the original logic item exists in the first code configuration information is to detect whether the keyword information corresponding to the original logic item exists in the first code configuration information. When the detection result is the first When the keyword information corresponding to the original logic item exists in the code configuration information, it is determined 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 in a preset data format. In one embodiment, the preset data format may be {original logic item, raw data logical value}. The first target position refers to the position of the original logic item in the first code configuration information. Through the above preset data format, it can be determined that the configuration content at the first target position is the original data logic value.

可选地,所述根据所述目标逻辑项遍历第二预设数据层,得到所述目标逻辑项对应的目标数据逻辑值包括:Optionally, traversing the second preset data layer according to the target logic item to obtain the 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;

当检测结果为所述第二代码配置信息中存在所述目标逻辑项时,确定所述第二代码配置信息中所述目标逻辑项的第二目标位置,并提取所述第二目标位置处的配置内容作为目标数据逻辑值。When the detection result is that the target logic item exists in the second code configuration information, the second target position of the target logic item in the second code configuration information is determined, and the second target position is extracted. Configure the content as the target data logical value.

示例性地,所述原始逻辑项与所述目标逻辑项均可以包括但不限于返回逻辑项、日期逻辑项、查询逻辑项、外链接逻辑项、函数逻辑项、时间逻辑项以及表逻辑项。其中,对于所述返回逻辑项来说,对应的原始数据逻辑值为:原始数据库在返回Map时,查询字段默认为大写;对应的目标数据逻辑值为:目标数据库在返回Map时,查询字段默认为小写。对于所述日期逻辑项来说,对应的原始数据逻辑值为:日期格式为年-月-日;对应的原始数据逻辑值为:年月日。对于所述查询逻辑项来说,对应的原始数据逻辑值为:子查询无需添加别名;对应的目标数据逻辑值为:子查询需添加别名。每一逻辑项对应的原始数据逻辑与目标数据逻辑均为预先设置的,在此不做赘述。Exemplarily, both the original logic item and the target logic item may include, but are not limited to, a return logic item, a date logic item, a query logic item, an external link logic item, a function logic item, a time logic item, and a table logic item. Wherein, for the return logic item, the corresponding original data logic value is: when the original database returns the Map, the query field defaults to uppercase; the corresponding target data logic value is: when the target database returns the Map, the query field defaults to lowercase. For the date logic item, the corresponding original data logic value is: the date format is year-month-day; the corresponding original data logic value is: year-month-day. For the query logic item, the corresponding original data logic value is: subquery does not need to add an alias; the corresponding target data logic value is: subquery needs to add an alias. The original data logic and the target data logic corresponding to each logic item are preset, and will not be repeated here.

S14,获取原始数据库中的初始数据拼接代码。S14, obtain the initial data splicing code in the original database.

在本申请的至少一实施例中,所述第一预设层中存储原始数据库相关配置信息(本申请也称第一代码配置信息),相关配置信息可以包括所述原始逻辑项、所述原始逻辑对应的原始数据逻辑值以及初始数据拼接代码。在一实施例中,所述初始数据拼接代码设有相应的代码标识用于表征该模块的代码用于实现数据拼接功能。In at least one embodiment of the present application, the first preset layer stores relevant configuration information of the original database (also referred to as first code configuration information in this application), and the relevant configuration information may include the original logic item, the original Logical corresponding original data logical value and initial data splicing code. In one embodiment, the initial data splicing code is provided with a corresponding code identifier to represent the code of the module for implementing the data splicing function.

可选地,所述获取原始数据库中的初始数据拼接代码包括:Optionally, obtaining the initial data splicing code in the original database includes:

获取所述原始数据库对应的第一预设层,并提取所述第一预设层中的第一代码配置信息;acquiring the first preset layer corresponding to the original database, and extracting the first code configuration information in the first preset layer;

检测所述第一代码配置信息中是否存在数据拼接标识;Detecting whether there is a data splicing identifier in the first code configuration information;

当检测结果为所述第一代码配置信息中存在所述数据拼接标识时,获取所述数据拼接标识对应的代码作为所述初始数据拼接代码。When the detection result is that the data splicing identifier exists in the first code configuration information, a code corresponding to the data splicing identifier is acquired as the initial data splicing code.

S15,调用预设开关根据所述原始数据逻辑值与所述目标数据逻辑值调整所述初始数据拼接代码,得到目标数据拼接代码。S15, calling a preset switch to adjust the initial data splicing code according to the original data logical value and the target data logical value to obtain the target data splicing code.

在本申请的至少一实施例中,所述预设开关可以为switchActionUtil开关,通过调用所述预设开关可以完成数据逻辑切换,也即调用所述预设开关将所述初始数据拼接代码中的所述原始数据逻辑值变更为所述目标数据逻辑值,得到目标数据拼接代码。In at least one embodiment of the present application, the preset switch can be a switchActionUtil switch, and data logic switching can be completed by calling the preset switch, that is, calling the preset switch to splicing the initial data into the code. The original data logical value is changed to the target data logical value to obtain the target data splicing code.

在一实施例中,通过ark配置中心配置目标数据库的数据源,在公共的工具类中写一个预设开关切换的公共类,预设开关切换的公共类里定义action变量用来获取ark配置中心的数据源的值,写一个方法get这个action的值然后返回这个值,代码里用这个公共方法来做逻辑判断,开关打开就执行目标数据库对应的数据逻辑,开关关闭就执行原始数据库对应的数据逻辑。In one embodiment, the data source of the target database is configured through the ark configuration center, a public class for preset switch switching is written in a public tool class, and an action variable is defined in the public class for preset switch switching to obtain the ark configuration center. The value of the data source, write a method to get the value of the action and return the value. This public method is used in the code to make logical judgments. When the switch is turned on, the data logic corresponding to the target database is executed. When the switch is turned off, the data corresponding to the original database is executed. logic.

可选地,所述调用预设开关根据所述原始数据逻辑值与所述目标数据逻辑值调整所述初始数据拼接代码,得到目标数据拼接代码包括:Optionally, the calling preset switch adjusts the initial data splicing code according to the original data logical value and the target data logical value, and obtaining the target data splicing code includes:

获取所述初始数据拼接代码;Obtain the initial data splicing code;

调用预设开关确定所述初始数据拼接代码中的所述原始数据逻辑值;Calling a preset switch to determine the original data logical value in the initial data splicing code;

替换所述原始数据逻辑值为目标数据逻辑值,得到目标数据拼接代码。The original data logical value is replaced with the target data logical value, and the target data splicing code is obtained.

可以理解的是,所述目标数据拼接代码此时是用于拼接处理所述第一数据与所述第二数据的,对于所述数据拼接请求用于请求拼接其他数据类型的数据,例如,所述数据拼接请求用于请求拼接第三数据与第四数据时,还需通过上述若干步骤继续实现数据拼接代码的一步步迭代迁移,直至目标数据库对应的数据拼接代码能够处理所有数据类型的数据拼接。It can be understood that the target data splicing code is used for splicing and processing the first data and the second data at this time, and the data splicing request is used to request splicing data of other data types, for example, the When the data splicing request is used to request splicing of the third data and the fourth data, it is necessary to continue to realize the step-by-step iterative migration of the data splicing code through the above several steps, until the data splicing code corresponding to the target database can handle the data splicing of all data types. .

S16,调用所述目标数据拼接代码拼接处理所述第一数据与所述第二数据,得到数据拼接结果。S16, calling the target data splicing code to splicing and processing 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 invoked to splicing and processing the first data and the second data according to the splicing requirements in the data splicing request, to obtain a data splicing result. The splicing requirements may include a data splicing sequence. The data splicing sequence may refer to the splicing sequence of the first data and the second data, for example, the first data is sorted before the second data.

可选地,所述调用所述目标数据拼接代码拼接处理所述第一数据与所述第二数据,得到数据拼接结果包括:Optionally, calling the target data splicing code to splicing and processing the first data and the second data, and obtaining a data splicing result includes:

解析所述数据拼接请求,得到数据拼接要求;Parse the data splicing request to obtain the data splicing request;

调用所述目标数据拼接代码按照所述数据拼接要求拼接处理所述第一数据与所述第二数据,得到数据拼接结果。Call the target data splicing code to splicing and process the first data and the second data according to the data splicing requirements, and obtain a data splicing result.

本申请实施例提供的上述数据拼接功能迁移方法,通过配置预设开关,并调用所述预设开关在数据拼接过程中实现数据拼接代码的一步步迭代迁移,避免一次性迁移导致的工作量大且容易发生遗漏的问题,能够减少工作量,不影响业务使用,且提高数据拼接功能迁移的准确性;且本申请通过配置两个预设数据层,分别用于存储原始数据库与目标数据库的代码配置信息,与所述预设开关协同工作,在预设开关需要选取原始数据逻辑值时遍历第一预设数据层,需要选取目标数据逻辑值时遍历第二预设数据层,能够提高数据逻辑值获取的准确性,从而提高数据拼接功能迁移的准确性。本申请可应用于智慧政务、智慧交通等智慧城市的各个功能模块中,比如智慧政务的数据拼接功能迁移模块等,能够促进智慧城市的快速发展。The above-mentioned data splicing function migration method provided by the embodiment of the present application realizes step-by-step iterative migration of the data splicing code during the data splicing process by configuring a preset switch and invoking the preset switch, avoiding the heavy workload caused by one-time migration. Moreover, the problem of omission is easy to occur, which can reduce the workload, does not affect business use, and improves the accuracy of data splicing function migration; and this application configures two preset data layers, which are used to store the codes of the original database and the target database respectively. The configuration information cooperates with the preset switch to traverse the first preset data layer when the preset switch needs to select the logical value of the original data, and traverse the second preset data layer when the logical value of the target data needs to be selected, which can improve the data logic The accuracy of value acquisition, thereby improving the accuracy of data stitching function migration. The present application can be applied to various functional modules of smart cities such as smart government affairs, smart transportation, etc., such as the data splicing function migration module of smart government affairs, etc., which can promote the rapid development of smart cities.

图2是本申请实施例二提供的数据拼接功能迁移装置的结构图。FIG. 2 is a structural diagram of an apparatus for migrating a data splicing function according to Embodiment 2 of the present application.

在一些实施例中,所述数据拼接功能迁移装置20可以包括多个由计算机程序段所组成的功能模块。所述数据拼接功能迁移装置20中的各个程序段的计算机程序可以存储于计算机设备的存储器中,并由至少一个处理器所执行,以执行(详见图1描述)数据拼接功能迁移的功能。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 each program segment in the data splicing function migration device 20 may be stored in the memory of the computer device and executed by at least one processor to perform (see description in FIG. 1 for details) the data splicing function migration function.

本实施例中,所述数据拼接功能迁移装置20根据其所执行的功能,可以被划分为多个功能模块。所述功能模块可以包括:请求解析模块201、类型获取模块202、逻辑遍历模块203、代码获取模块204、代码调整模块205以及代码拼接模块206。本申请所称的模块是指一种能够被至少一个处理器所执行并且能够完成固定功能的一系列计算机程序段,其存储在存储器中。在本实施例中,关于各模块的功能将在后续的实施例中详述。In this embodiment, the data splicing function migration device 20 may be divided into multiple functional modules according to the functions performed by the data splicing function migration device 20 . The functional modules may include: a request parsing module 201 , a type acquisition module 202 , a logic traversal module 203 , a code acquisition module 204 , a code adjustment module 205 and a code splicing module 206 . A module referred to in this application refers to a series of computer program segments that can be executed by at least one processor and can perform fixed functions, and are stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.

所述请求解析模块201用于当接收到数据拼接请求时,解析所述数据拼接请求,得到待拼接的第一数据与第二数据。The request parsing module 201 is configured to, when a data splicing request is received, parse the data splicing request to obtain the first data and the second data to be spliced.

在本申请的至少一实施例中,所述数据拼接请求是指目标数据库发出的用于进行数据拼接处理的请求,进行数据拼接处理的数据的数量不做限制,可以为两个,也可以为两个以上,本申请实施例以两个为例,也即待拼接的数据为第一数据与第二数据。所述目标数据库是指待迁移数据拼接功能的数据库,数据拼接功能可以从原始数据库中获取,所述原始数据库中的数据拼接功能是指利用已配置好的数据拼接代码执行的相关功能。在一实施例中,所述目标数据库可以为pg数据库(PostgreSQL数据库),所述原始数据库可以为ignite数据库(内存数据库,响应速度快,但稳定性较差)。所述数据拼接请求中包含待拼接的第一数据的第一数据标识与第二数据的第二数据标识,数据标识的方式可以为数字、字母或颜色,在此不做限制。通过查询该数据标识,能够得到待拼接的相关数据信息。In at least one embodiment of the present application, the data splicing request refers to a request sent by the target database for data splicing processing, and the number of data splicing processing is not limited, which may be two or If there are more than two, the embodiment of the present application uses two as an example, that is, the data to be spliced are the first data and the second data. The target database refers to the database of the data splicing function to be migrated, and the data splicing function can be obtained from the original database. The data splicing function in the original database refers to the related function performed by using the 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 (an in-memory database, with fast response speed but poor stability). The data splicing request includes the first data identifier of the first data to be spliced and the second data identifier of the second data, and the data identifier may be numbers, letters or colors, which are not limited here. By querying the data identifier, relevant data information to be spliced can be obtained.

可选地,所述解析所述数据拼接请求,得到待拼接的第一数据与第二数据包括:Optionally, the parsing of the data splicing request to obtain the first data and the second data to be spliced includes:

解析所述数据拼接请求,并检测所述数据拼接请求中是否携带数据标识;Parse the data splicing request, and detect whether the data splicing request carries a data identifier;

当检测结果为所述数据拼接请求中携带所述数据标识时,提取第一数据标识与第二数据标识;When the detection result is that the data splicing request carries the data identifier, extracting the first data identifier and the second data identifier;

根据所述第一数据标识与所述第二数据标识分别遍历预先设置的数据标识与数据的映射关系,得到待拼接的第一数据与第二数据。According to the first data identifier and the second data identifier, the preset mapping relationship between the data identifier and the data is traversed respectively, so as to obtain the first data and the second data to be spliced.

其中,当检测结果为所述数据拼接请求中未携带所述数据标识时,说明此时所述数据拼接请求中未携带待拼接的数据信息,该数据拼接请求可能存在错误,可以报错给相关负责人进行纠错处理。Wherein, when the detection result is that the data splicing request does not carry the data identifier, it means that the data splicing request does not carry the data information to be spliced at this time, the data splicing request may have errors, and an error can be reported to the relevant responsible person Humans make corrections.

所述类型获取模块202用于获取所述第一数据对应的第一数据类型以及所述第二数据对应的第二数据类型,并分别根据所述第一数据类型与所述第二数据类型确定原始逻辑项与目标逻辑项。The type acquisition module 202 is configured to acquire the first data type corresponding to the first data and the second data type corresponding to the second data, and determine respectively according to the first data type and the second data type. The original logical item and the target logical item.

在本申请的至少一实施例中,不同数据均有相应的数据类型,所述数据类型可以为返回数据类型、日期数据类型、查询数据类型、外链接数据类型、函数数据类型、时间数据类型以及表类型等,在此不做限制。所述原始逻辑项是指原始数据库中与数据类型对应的逻辑项,所述目标逻辑项是指目标数据库中与数据类型对应的逻辑项。以所述原始数据库中的逻辑项为例,所述原始逻辑项可以包括但不限于返回逻辑项、日期逻辑项、查询逻辑项、外链接逻辑项、函数逻辑项、时间逻辑项以及表逻辑项。可以理解的是,所述原始逻辑项与所述目标逻辑项间存在映射关系,在一实施例中,所述原始逻辑项与所述目标逻辑项一一对应。数据类型与逻辑项间也存在映射关系,通过查询该映射关系,能够得到所述数据类型对应的逻辑项。In at least one embodiment of the present application, different data have corresponding data types, and the data types may be return data types, date data types, query data types, external link data types, function data types, time data types, and Table types, etc., are not limited here. The original logical item refers to the logical item corresponding to the data type in the original database, and the target logical item refers to the logical item corresponding to the data type in the target database. Taking the logic items in the original database as an example, the original logic items may include but are not limited to return logic items, date logic items, query logic items, external link logic items, function logic items, time logic items, and table logic items . It can be understood that there is a mapping relationship between the original logic item and the target logic item. In one embodiment, the original logic item corresponds to the target logic item one-to-one. There is also a mapping relationship between data types and logical items, and by querying the mapping relationship, the logical items corresponding to the data types can be obtained.

可选地,所述获取所述第一数据对应的第一数据类型以及所述第二数据对应的第二数据类型包括:Optionally, obtaining the first data type corresponding to the first data and the second data type corresponding to the second data includes:

获取所述第一数据对应的第一数据特征;obtaining a first data feature corresponding to the first data;

当原始数据库中存在与所述第一数据特征的相似度超过所述预设相似度阈值的数据类型定义时,确定该数据类型定义对应的数据类型为所述第一数据对应的第一数据类型;When a data type definition whose similarity with the first data feature exceeds the preset similarity threshold exists in the original database, it is determined that the data type corresponding to the data type definition is the first data type corresponding to the first data ;

获取所述第二数据对应的第二数据特征;acquiring second data features corresponding to the second data;

当目标数据库中存在与所述第二数据特征的相似度超过所述预设相似度阈值的数据类型定义时,确定该数据类型定义对应的数据类型为所述第二数据对应的第二数据类型。When a data type definition whose similarity with the second data feature exceeds the preset similarity threshold exists in the target database, it is determined that the data type corresponding to the data type definition is the second data type corresponding to the second data .

其中,所述第一数据特征是指所述第一数据中包含的关键词信息,所述数据类型定义是指数据类型包含的关键词信息,关键词信息可以通过关键词匹配等方式得到。在一实施例中,对于已知的数据类型或者逻辑项,可以预先设置若干关键词用于表征该数据类型或逻辑项,通过关键词匹配的方式获取所述第一数据包含的关键词作为第一数据特征。预先设置的若干关键词可以存储于预设数据库中,考虑到数据存储的可靠性与隐私性,所述预设数据库可以为区块链上的目标节点。Wherein, the first data feature refers to the keyword information contained in the first data, the data type definition refers to the keyword information contained in the data type, and the keyword information can be obtained by means of keyword matching or the like. In one embodiment, for a known data type or logical item, several keywords may be preset to represent the data type or logical item, and the keyword contained in the first data is obtained by keyword matching as the first keyword. a data feature. Several preset keywords can be stored in a preset database, and considering the reliability and privacy of data storage, the preset database can be a target node on the blockchain.

可选地,所述分别根据所述第一数据类型与所述第二数据类型确定原始逻辑项与目标逻辑项包括:Optionally, the determining the original logic item and the target logic item according to the first data type and the second data type respectively includes:

根据所述第一数据类型遍历预先设置的数据类型与逻辑项的映射关系,得到所述第一数据类型对应的第一原始逻辑项与第一目标逻辑项;Traverse the mapping relationship between the preset data type and the logical item according to the first data type, and obtain the first original logical item and the first target logical item corresponding to the first data type;

根据所述第二数据类型遍历预先设置的数据类型与逻辑项的映射关系,得到所述第二数据类型对应的第二原始逻辑项与第二目标逻辑项。According to the second data type, the preset mapping relationship between the data type and the logic item is traversed, and the second original logic item and the second target logic item corresponding to the second data type are obtained.

其中,所述第一数据类型包含相对应的原始逻辑项与目标逻辑项,所述第二数据类型也包含相对应的原始逻辑项与目标逻辑项,所述第一数据类型包含的原始逻辑项与目标逻辑项可以与所述第二数据类型包含的原始逻辑项与目标逻辑项相同,也可以不相同,在此不做限制。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 first data type includes original logic items. The target logic item may be the same as the original logic item and the target logic item included in the second data type, or may be different, which is not limited herein.

所述逻辑遍历模块203用于根据所述原始逻辑项遍历第一预设数据层,得到所述原始逻辑项对应的原始数据逻辑值,并根据所述目标逻辑项遍历第二预设数据层,得到所述目标逻辑项对应的目标数据逻辑值。The logic traversal module 203 is configured to traverse the first preset data layer according to the original logic item, obtain the original data logical value corresponding to the original logic item, and traverse the second preset data layer according to the target logic item, The target data logical value corresponding to the target logical item is obtained.

在本申请的至少一实施例中,所述第一预设层是指存储原始数据库相关配置信息(本申请也称第一代码配置信息)的数据层,相关配置信息可以包括所述原始逻辑项、所述原始逻辑对应的原始数据逻辑值以及初始数据拼接代码。所述第二预设数据层是指存储目标数据库相关配置信息的数据层,相关配置信息可以包括所述目标逻辑项、所述目标逻辑对应的目标数据逻辑值以及所述初始数据拼接代码。可以理解的是,所述第二预设数据层中的所述初始数据拼接代码需要随着一步一步的迭代进行代码迁移,继而得到目标数据拼接代码。在一实施例中,所述第一预设数据层可以为第一预设dao层,所述第二预设数据层可以为第二预设dao层,所述第一预设dao层与所述第二预设dao层主要做数据持久层的工作。In at least one embodiment of the present application, the first preset layer refers to a data layer that stores relevant configuration information of the original database (also referred to as first code configuration information in this application), and the relevant configuration information may include the original logic item , the original data logic value corresponding to the original logic, and the initial data splicing code. The second preset data layer refers to a data layer storing relevant configuration information of the target database, and the relevant configuration information may include the target logic item, the 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 be code migrated with step-by-step iteration, and then the target data splicing code is obtained. In one 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 all The second preset dao layer mentioned above mainly does the work of the data persistence layer.

在一实施例中,本申请提供数据拼接功能迁移系统,该系统至少包含controller层、dao层与service层,其中,controller层主要用于负责具体业务模块流程的控制,dao层主要用于数据持久层的工作,service层主要用于负责业务模块的应用逻辑应用设计。service层是建立在dao层之上的,建立了dao层后才可以建立service层,而service层又是在controller层之下的,因而service层应该既调用dao层的接口,又要提供接口给controller层的类来进行调用,它刚好处于一个中间层的位置。每个业务模块都有一个service接口,每个接口分别封装各自的业务处理方法。本申请提供的数据拼接功能的迁移改造过程中,不需要改变controller层,通过在service层加一个开关配置(例如,开关配置为switchActionUtil开关),新增dao层(本申请又称第二预设数据层)处理目标数据库(例如,目标数据库为pg数据库)迁移过来的逻辑。In one embodiment, the present application provides a data splicing function migration system, which at least includes a controller layer, a dao layer and a service layer, wherein the controller layer is mainly used for the control of specific business module processes, and the dao layer is mainly used for data persistence. The work of the layer, the service layer is mainly used for the application logic application design of the business module. The service layer is built on the dao layer. After the dao layer is established, the service layer can be established, and the service layer is under the controller layer. Therefore, the service layer should not only call the interface of the dao layer, but also provide an interface to the The class of the controller layer is called, which happens to be in a middle layer. Each business module has a service interface, and each interface encapsulates its own business processing method. During the migration and transformation process of the data splicing function provided by this application, it is not necessary to change the controller layer. By adding a switch configuration to the service layer (for example, the switch is configured as a switchActionUtil switch), a new dao layer (also referred to as the second preset in this application) is added. data layer) to process the logic migrated from the target database (for example, the target database is the pg database).

可选地,所述根据所述原始逻辑项遍历第一预设数据层,得到所述原始逻辑项对应的原始数据逻辑值包括:Optionally, traversing the first preset data layer according to the original logic item to obtain the original data logic value corresponding to the original logic item includes:

获取所述第一预设数据层中的第一代码配置信息;obtaining the first code configuration information in the first preset data layer;

检测所述第一代码配置信息中是否存在所述原始逻辑项;Detecting whether the original logic item exists in the first code configuration information;

当检测结果为所述第一代码配置信息中存在所述原始逻辑项时,确定所述第一代码配置信息中所述原始逻辑项的第一目标位置,并提取所述第一目标位置处的配置内容作为原始数据逻辑值。When the detection result is that the original logic item exists in the first code configuration information, determine the first target position of the original logic item in the first code configuration information, and extract the first target position of the original logic item. Configuration content as raw data logical value.

其中,所述第一代码配置信息是指所述原始数据库的相关配置信息,所述第一代码配置信息可以包括所述原始逻辑项、所述原始逻辑对应的原始数据逻辑值以及初始数据拼接代码。所述检测所述第一代码配置信息中是否存在所述原始逻辑项也即检测所述第一代码配置信息中是否存在所述原始逻辑项对应的关键字信息,当检测结果为所述第一代码配置信息中存在所述原始逻辑项对应的关键字信息时,确定所述第一代码配置信息中存在所述原始逻辑项。在所述第一代码配置信息中,所述原始逻辑项与所述原始数据逻辑值是按照预设数据格式存储的,在一实施例中,所述预设数据格式可以为{原始逻辑项,原始数据逻辑值}。所述第一目标位置是指所述原始逻辑项在所述第一代码配置信息中的位置,通过上述预设数据格式,可以确定所述第一目标位置处的配置内容为原始数据逻辑值。The first code configuration information refers to the relevant configuration information of the original database, and the first code configuration information may include the original logic item, the original data logic value corresponding to the original logic, and the initial data splicing code . The detecting whether the original logic item exists in the first code configuration information is to detect whether the keyword information corresponding to the original logic item exists in the first code configuration information. When the detection result is the first When the keyword information corresponding to the original logic item exists in the code configuration information, it is determined 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 in a preset data format. In one embodiment, the preset data format may be {original logic item, raw data logical value}. The first target position refers to the position of the original logic item in the first code configuration information. Through the above preset data format, it can be determined that the configuration content at the first target position is the original data logic value.

可选地,所述根据所述目标逻辑项遍历第二预设数据层,得到所述目标逻辑项对应的目标数据逻辑值包括:Optionally, traversing the second preset data layer according to the target logic item to obtain the 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;

当检测结果为所述第二代码配置信息中存在所述目标逻辑项时,确定所述第二代码配置信息中所述目标逻辑项的第二目标位置,并提取所述第二目标位置处的配置内容作为目标数据逻辑值。When the detection result is that the target logic item exists in the second code configuration information, the second target position of the target logic item in the second code configuration information is determined, and the second target position is extracted. Configure the content as the target data logical value.

示例性地,所述原始逻辑项与所述目标逻辑项均可以包括但不限于返回逻辑项、日期逻辑项、查询逻辑项、外链接逻辑项、函数逻辑项、时间逻辑项以及表逻辑项,其中,对于所述返回逻辑项来说,对应的原始数据逻辑值为:原始数据库在返回Map时,查询字段默认为大写,对应的目标数据逻辑值为:目标数据库在返回Map时,查询字段默认为小写。对于所述日期逻辑项来说,对应的原始数据逻辑值为:日期格式为年-月-日,对应的原始数据逻辑值为:年月日。对于所述查询逻辑项来说,对应的原始数据逻辑值为:子查询无需添加别名,对应的目标数据逻辑值为:子查询需添加别名。每一逻辑项对应的原始数据逻辑与目标数据逻辑均为预先设置的,在此不做赘述。Exemplarily, both the original logic item and the target logic item may include, but are not limited to, a return logic item, a date logic item, a query logic item, an external link logic item, a function logic item, a time logic item, and a table logic item, Wherein, for the return logic item, the corresponding original data logic value is: when the original database returns the Map, the query field defaults to uppercase, and the corresponding target data logic value is: when the target database returns the Map, the query field defaults to lowercase. For the date logical item, the corresponding raw data logical value is: date format is year-month-day, and the corresponding raw data logical value is: year-month-day. For the query logic item, the corresponding original data logic value is: subquery does not need to add an alias, and the corresponding target data logic value is: subquery needs to add an alias. The original data logic and the target data logic corresponding to each logic item are preset, and will not be repeated here.

所述代码获取模块204用于获取原始数据库中的初始数据拼接代码。The code obtaining module 204 is used to obtain the initial data splicing code in the original database.

在本申请的至少一实施例中,所述第一预设层中存储原始数据库相关配置信息(本申请也称第一代码配置信息),相关配置信息可以包括所述原始逻辑项、所述原始逻辑对应的原始数据逻辑值以及初始数据拼接代码。在一实施例中,所述初始数据拼接代码设有相应的代码标识用于表征该模块的代码用于实现数据拼接功能。In at least one embodiment of the present application, the first preset layer stores relevant configuration information of the original database (also referred to as first code configuration information in this application), and the relevant configuration information may include the original logic item, the original Logical corresponding original data logical value and initial data splicing code. In one embodiment, the initial data splicing code is provided with a corresponding code identifier to represent the code of the module for implementing the data splicing function.

可选地,所述获取原始数据库中的初始数据拼接代码包括:Optionally, obtaining the initial data splicing code in the original database includes:

获取所述原始数据库对应的第一预设层,并提取所述第一预设层中的第一代码配置信息;acquiring the first preset layer corresponding to the original database, and extracting the first code configuration information in the first preset layer;

检测所述第一代码配置信息中是否存在数据拼接标识;Detecting whether there is a data splicing identifier in the first code configuration information;

当检测结果为所述第一代码配置信息中存在所述数据拼接标识时,获取所述数据拼接标识对应的代码作为所述初始数据拼接代码。When the detection result is that the data splicing identifier exists in the first code configuration information, a code corresponding to the data splicing identifier is acquired as the initial data splicing code.

所述代码调整模块205用于调用预设开关根据所述原始数据逻辑值与所述目标数据逻辑值调整所述初始数据拼接代码,得到目标数据拼接代码。The code adjustment module 205 is configured to call 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 the target data splicing code.

在本申请的至少一实施例中,所述预设开关可以为switchActionUtil开关,通过调用所述预设开关可以完成数据逻辑切换,也即调用所述预设开关将所述初始数据拼接代码中的所述原始数据逻辑值变更为所述目标数据逻辑值,得到目标数据拼接代码。In at least one embodiment of the present application, the preset switch can be a switchActionUtil switch, and data logic switching can be completed by calling the preset switch, that is, calling the preset switch to splicing the initial data into the code. The original data logical value is changed to the target data logical value to obtain the target data splicing code.

在一实施例中,通过ark配置中心配置目标数据库的数据源,在公共的工具类中写一个预设开关切换的公共类,预设开关切换的公共类里定义action变量用来获取ark配置中心的数据源的值,写一个方法get这个action的值然后返回这个值,代码里用这个公共方法来做逻辑判断,开关打开就执行目标数据库对应的数据逻辑,开关关闭就执行原始数据库对应的数据逻辑。In one embodiment, the data source of the target database is configured through the ark configuration center, a public class for preset switch switching is written in a public tool class, and an action variable is defined in the public class for preset switch switching to obtain the ark configuration center. The value of the data source, write a method to get the value of the action and return the value. This public method is used in the code to make logical judgments. When the switch is turned on, the data logic corresponding to the target database is executed. When the switch is turned off, the data corresponding to the original database is executed. logic.

可选地,所述调用预设开关根据所述原始数据逻辑值与所述目标数据逻辑值调整所述初始数据拼接代码,得到目标数据拼接代码包括:Optionally, the calling preset switch adjusts the initial data splicing code according to the original data logical value and the target data logical value, and obtaining the target data splicing code includes:

获取所述初始数据拼接代码;Obtain the initial data splicing code;

调用预设开关确定所述初始数据拼接代码中的所述原始数据逻辑值;Calling a preset switch to determine the original data logical value in the initial data splicing code;

替换所述原始数据逻辑值为目标数据逻辑值,得到目标数据拼接代码。The original data logical value is replaced with the target data logical value, and the target data splicing code is obtained.

可以理解的是,所述目标数据拼接代码此时是用于拼接处理所述第一数据与所述第二数据的,对于所述数据拼接请求用于请求拼接其他数据类型的数据,例如,所述数据拼接请求用于请求拼接第三数据与第四数据时,还需通过上述若干步骤继续实现数据拼接代码的一步步迭代迁移,直至目标数据库对应的数据拼接代码能够处理所有数据类型的数据拼接。It can be understood that the target data splicing code is used for splicing and processing the first data and the second data at this time, and the data splicing request is used to request splicing data of other data types, for example, the When the data splicing request is used to request splicing of the third data and the fourth data, it is necessary to continue to realize the step-by-step iterative migration of the data splicing code through the above several steps, until the data splicing code corresponding to the target database can handle the data splicing of all data types. .

所述代码拼接模块206用于调用所述目标数据拼接代码拼接处理所述第一数据与所述第二数据,得到数据拼接结果。The code splicing module 206 is configured to call the target data splicing code splicing to process the first data and the second data, and obtain a data splicing result.

在本申请的至少一实施例中,调用所述目标数据拼接代码按照所述数据拼接请求中的拼接要求拼接处理所述第一数据与所述第二数据,得到数据拼接结果。其中,所述拼接要求可以包括数据拼接顺序。所述数据拼接顺序可以是指所述第一数据与所述第二数据的拼接顺序,例如,所述第一数据排序在所述第二数据之前。In at least one embodiment of the present application, the target data splicing code is invoked to splicing and processing the first data and the second data according to the splicing requirements in the data splicing request, to obtain a data splicing result. The splicing requirements may include a data splicing sequence. The data splicing sequence may refer to the splicing sequence of the first data and the second data, for example, the first data is sorted before the second data.

可选地,所述调用所述目标数据拼接代码拼接处理所述第一数据与所述第二数据,得到数据拼接结果包括:Optionally, calling the target data splicing code to splicing and processing the first data and the second data, and obtaining a data splicing result includes:

解析所述数据拼接请求,得到数据拼接要求;Parse the data splicing request to obtain the data splicing request;

调用所述目标数据拼接代码按照所述数据拼接要求拼接处理所述第一数据与所述第二数据,得到数据拼接结果。Call the target data splicing code to splicing and process the first data and the second data according to the data splicing requirements, and obtain a data splicing result.

参阅图3所示,为本申请实施例三提供的计算机设备的结构示意图。在本申请较佳实施例中,所述计算机设备3包括存储器31、至少一个处理器32、至少一条通信总线33及收发器34。Referring to FIG. 3 , it is a schematic structural diagram of a computer device according to Embodiment 3 of the present application. In a preferred embodiment of the present application, the computer device 3 includes amemory 31 , at least oneprocessor 32 , at least onecommunication bus 33 and atransceiver 34 .

本领域技术人员应该了解,图3示出的计算机设备的结构并不构成本申请实施例的限定,既可以是总线型结构,也可以是星形结构,所述计算机设备3还可以包括比图示更多或更少的其他硬件或者软件,或者不同的部件布置。Those skilled in the art should understand that the structure of the computer device shown in FIG. 3 does not constitute a limitation of the embodiments of the present application, and may be a bus-type structure or a star-shaped structure. more or less other hardware or software, or a different arrangement of components is shown.

在一些实施例中,所述计算机设备3是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的设备,其硬件包括但不限于微处理器、专用集成电路、可编程门阵列、数字处理器及嵌入式设备等。所述计算机设备3还可包括客户设备,所述客户设备包括但不限于任何一种可与客户通过键盘、鼠标、遥控器、触摸板或声控设备等方式进行人机交互的电子产品,例如,个人计算机、平板电脑、智能手机、数码相机等。In some embodiments, the computer device 3 is a device that can automatically perform numerical calculation and/or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits, Programmable gate arrays, digital processors and embedded devices, etc. The computer equipment 3 may also include client equipment, including but not limited to any electronic product that can interact with the client through a keyboard, a mouse, a remote control, a touchpad or a voice-activated device, etc., for example, Personal computers, tablets, smartphones, digital cameras, etc.

需要说明的是,所述计算机设备3仅为举例,其他现有的或今后可能出现的电子产品如可适应于本申请,也应包含在本申请的保护范围以内,并以引用方式包含于此。It should be noted that the computer equipment 3 is only an example, and other existing or future electronic products, if applicable to the present application, should also be included within the protection scope of the present application, and incorporated herein by reference .

在一些实施例中,所述存储器31中存储有计算机程序,所述计算机程序被所述至少一个处理器32执行时实现如所述的数据拼接功能迁移方法中的全部或者部分步骤。所述存储器31包括只读存储器(Read-Only Memory,ROM)、可编程只读存储器(ProgrammableRead-Only Memory,PROM)、可擦除可编程只读存储器(Erasable Programmable Read-OnlyMemory,EPROM)、一次可编程只读存储器(One-time Programmable Read-Only Memory,OTPROM)、电子擦除式可复写只读存储器(Electrically-Erasable Programmable Read-Only Memory,EEPROM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)或其他光盘存储器、磁盘存储器、磁带存储器、或者能够用于携带或存储数据的计算机可读的任何其他介质。In some embodiments, a computer program is stored in thememory 31, and when the computer program is executed by the at least oneprocessor 32, all or part of the steps in the data splicing function migration method as described above are implemented. Thememory 31 includes a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable Read-Only Memory, PROM), an erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), a once Programmable Read-Only Memory (One-time Programmable Read-Only Memory, OTPROM), Electronically Erasable Programmable Read-Only Memory (EEPROM), Compact Disc Read-Only Memory , CD-ROM) or other optical disk storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store 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 by at least one function, and the like; The data created by the use of the node, etc.

本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。The blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain, essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block. The blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.

在一些实施例中,所述至少一个处理器32是所述计算机设备3的控制核心(Control Unit),利用各种接口和线路连接整个计算机设备3的各个部件,通过运行或执行存储在所述存储器31内的程序或者模块,以及调用存储在所述存储器31内的数据,以执行计算机设备3的各种功能和处理数据。例如,所述至少一个处理器32执行所述存储器中存储的计算机程序时实现本申请实施例中所述的数据拼接功能迁移方法的全部或者部分步骤;或者实现数据拼接功能迁移装置的全部或者部分功能。所述至少一个处理器32可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。In some embodiments, the at least oneprocessor 32 is a control core (Control Unit) of the computer device 3, using various interfaces and lines to connect various components of the entire computer device 3, and by running or executing storage in the computer device 3 The programs or modules in thememory 31 and the data stored in thememory 31 are called to perform various functions of the computer device 3 and process data. For example, when the at least oneprocessor 32 executes the computer program stored in the memory, all or part of the steps of the data splicing function migration method described in the embodiments of the present application are realized; or all or part of the data splicing function migration device is realized. Function. The at least oneprocessor 32 may be composed of integrated circuits, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits packaged with the same function or different functions, including one or more central processing units. (Central Processing Unit, CPU), microprocessor, digital processing chip, graphics processor and combination of various control chips, etc.

在一些实施例中,所述至少一条通信总线33被设置为实现所述存储器31以及所述至少一个处理器32等之间的连接通信。In some embodiments, the at least onecommunication bus 33 is configured to enable connection communication between thememory 31 and the at least oneprocessor 32 and the like.

尽管未示出,所述计算机设备3还可以包括给各个部件供电的电源(比如电池),优选的,电源可以通过电源管理装置与所述至少一个处理器32逻辑相连,从而通过电源管理装置实现管理充电、放电、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述计算机设备3还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。Although not shown, the computer device 3 may also include a power source (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to the at least oneprocessor 32 through a power management device, so as to be implemented by the power management device Manage charging, discharging, and power management functions. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components. The computer device 3 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

上述以软件功能模块的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能模块存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,计算机设备,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的部分。The above-mentioned integrated units implemented in the form of software functional modules may be stored in a computer-readable storage medium. The above-mentioned software function modules are stored in a storage medium, and include several instructions to make a computer device (which may be a personal computer, a computer device, or a network device, etc.) or a processor (processor) to execute the methods described in the various embodiments of the present application. part.

在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the modules is only a logical function division, and there may be other division manners in actual implementation.

所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,既可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, and may be located in one place or distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.

对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附图标记视为限制所涉及的权利要求。此外,显然“包括”一词不排除其他单元或,单数不排除复数。说明书中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第一,第二等词语用来表示名称,而并不表示任何特定的顺序。It will be apparent to those skilled in the art that the present application is not limited to the details of the above-described exemplary embodiments, but that the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application. Accordingly, the embodiments are to be regarded in all respects as illustrative and not restrictive, and the scope of the application is to be defined by the appended claims rather than the foregoing description, which is therefore intended to fall within the scope of the claims. All changes within the meaning and scope of the equivalents of , are included in this application. Any reference signs in the claims shall not be construed as limiting the involved claim. Furthermore, it is clear that the word "comprising" does not exclude other units or, and the singular does not exclude the plural. A plurality of units or devices stated in the specification can also be implemented by one unit or device through software or hardware. The terms first, second, etc. are used to denote names and do not denote any particular order.

最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application rather than limitations. Although the present application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present application can be Modifications or equivalent substitutions can be made without departing from the spirit and scope of the technical solutions of the present application.

Claims (10)

Translated fromChinese
1.一种数据拼接功能迁移方法,其特征在于,所述数据拼接功能迁移方法包括:1. a data splicing function migration method, is characterized in that, described data splicing function migration method comprises:当接收到数据拼接请求时,解析所述数据拼接请求,得到待拼接的第一数据与第二数据;When a data splicing request is received, the data splicing request is parsed to obtain the first data and the second data to be spliced;获取所述第一数据对应的第一数据类型以及所述第二数据对应的第二数据类型,并分别根据所述第一数据类型与所述第二数据类型确定原始逻辑项与目标逻辑项;Obtain the first data type corresponding to the first data and the second data type corresponding to the second data, and determine the original logic item and the target logic item according to the first data type and the second data type respectively;根据所述原始逻辑项遍历第一预设数据层,得到所述原始逻辑项对应的原始数据逻辑值,并根据所述目标逻辑项遍历第二预设数据层,得到所述目标逻辑项对应的目标数据逻辑值;Traverse the first preset data layer according to the original logical item to obtain the original data logical value corresponding to the original logical item, and traverse the second preset data layer according to the target logical item to obtain the corresponding logical value of the target logical item target data logical value;获取原始数据库中的初始数据拼接代码;Get the initial data stitching code in the original database;调用预设开关根据所述原始数据逻辑值与所述目标数据逻辑值调整所述初始数据拼接代码,得到目标数据拼接代码;Calling the preset switch to adjust the initial data splicing code according to the original data logical value and the target data logical value to obtain the target data splicing code;调用所述目标数据拼接代码拼接处理所述第一数据与所述第二数据,得到数据拼接结果。Call the target data splicing code to splicing and process the first data and the second data to obtain a data splicing result.2.根据权利要求1所述的数据拼接功能迁移方法,其特征在于,所述解析所述数据拼接请求,得到待拼接的第一数据与第二数据包括:2. The data splicing function migration method according to claim 1, wherein the parsing of the data splicing request to obtain the first data and the second data to be spliced comprises:解析所述数据拼接请求,并检测所述数据拼接请求中是否携带数据标识;Parse the data splicing request, and detect whether the data splicing request carries a data identifier;当检测结果为所述数据拼接请求中携带所述数据标识时,提取第一数据标识与第二数据标识;When the detection result is that the data splicing request carries the data identifier, extracting the first data identifier and the second data identifier;根据所述第一数据标识与所述第二数据标识分别遍历预先设置的数据标识与数据的映射关系,得到待拼接的第一数据与第二数据。According to the first data identifier and the second data identifier, the preset mapping relationship between the data identifier and the data is traversed respectively, so as to obtain the first data and the second data to be spliced.3.根据权利要求1所述的数据拼接功能迁移方法,其特征在于,所述分别根据所述第一数据类型与所述第二数据类型确定原始逻辑项与目标逻辑项包括:3. The data splicing function migration method according to claim 1, wherein the determining the original logic item and the target logic item according to the first data type and the second data type respectively comprises:根据所述第一数据类型遍历预先设置的数据类型与逻辑项的映射关系,得到所述第一数据类型对应的第一原始逻辑项与第一目标逻辑项;Traverse the mapping relationship between the preset data type and the logical item according to the first data type, and obtain the first original logical item and the first target logical item corresponding to the first data type;根据所述第二数据类型遍历预先设置的数据类型与逻辑项的映射关系,得到所述第二数据类型对应的第二原始逻辑项与第二目标逻辑项。According to the second data type, the preset mapping relationship between the data type and the logic item is traversed, and the second original logic item and the second target logic item corresponding to the second data type are obtained.4.根据权利要求1所述的数据拼接功能迁移方法,其特征在于,所述根据所述原始逻辑项遍历第一预设数据层,得到所述原始逻辑项对应的原始数据逻辑值包括:4. The data splicing function migration method according to claim 1, wherein the step of traversing the first preset data layer according to the original logic item to obtain the original data logic value corresponding to the original logic item comprises:获取所述第一预设数据层中的第一代码配置信息;obtaining the first code configuration information in the first preset data layer;检测所述第一代码配置信息中是否存在所述原始逻辑项;Detecting whether the original logic item exists in the first code configuration information;当检测结果为所述第一代码配置信息中存在所述原始逻辑项时,确定所述第一代码配置信息中所述原始逻辑项的第一目标位置,并提取所述第一目标位置处的配置内容作为原始数据逻辑值。When the detection result is that the original logic item exists in the first code configuration information, determine the first target position of the original logic item in the first code configuration information, and extract the first target position of the original logic item. Configuration content as raw data logical value.5.根据权利要求1所述的数据拼接功能迁移方法,其特征在于,所述获取原始数据库中的初始数据拼接代码包括:5. data splicing function migration method according to claim 1, is characterized in that, described obtaining the initial data splicing code in original database comprises:获取所述原始数据库对应的第一预设层,并提取所述第一预设层中的第一代码配置信息;acquiring the first preset layer corresponding to the original database, and extracting the first code configuration information in the first preset layer;检测所述第一代码配置信息中是否存在数据拼接标识;Detecting whether there is a data splicing identifier in the first code configuration information;当检测结果为所述第一代码配置信息中存在所述数据拼接标识时,获取所述数据拼接标识对应的代码作为所述初始数据拼接代码。When the detection result is that the data splicing identifier exists in the first code configuration information, a code corresponding to the data splicing identifier is acquired as the initial data splicing code.6.根据权利要求1所述的数据拼接功能迁移方法,其特征在于,所述调用预设开关根据所述原始数据逻辑值与所述目标数据逻辑值调整所述初始数据拼接代码,得到目标数据拼接代码包括:6. The data splicing function migration method according to claim 1, wherein the calling preset switch adjusts the initial data splicing code according to the original data logical value and the target data logical value to obtain the target data The stitching code includes:获取所述初始数据拼接代码;Obtain the initial data splicing code;调用预设开关确定所述初始数据拼接代码中的所述原始数据逻辑值;Calling a preset switch to determine the original data logical value in the initial data splicing code;替换所述原始数据逻辑值为目标数据逻辑值,得到目标数据拼接代码。The original data logical value is replaced with the target data logical value, and the target data splicing code is obtained.7.根据权利要求1所述的数据拼接功能迁移方法,其特征在于,所述调用所述目标数据拼接代码拼接处理所述第一数据与所述第二数据,得到数据拼接结果包括:7. data splicing function migration method according to claim 1, is characterized in that, described calling described target data splicing code splicing process described first data and described second data, and obtaining data splicing result comprises:解析所述数据拼接请求,得到数据拼接要求;Parse the data splicing request to obtain the data splicing request;调用所述目标数据拼接代码按照所述数据拼接要求拼接处理所述第一数据与所述第二数据,得到数据拼接结果。Call the target data splicing code to splicing and process the first data and the second data according to the data splicing requirements, and obtain a data splicing result.8.一种数据拼接功能迁移装置,其特征在于,所述数据拼接功能迁移装置包括:8. A data splicing function migration device, wherein the data splicing function migration device comprises:请求解析模块,用于当接收到数据拼接请求时,解析所述数据拼接请求,得到待拼接的第一数据与第二数据;a request parsing module, configured to parse the data splicing request when receiving the data splicing request, and obtain the first data and the second data to be spliced;类型获取模块,用于获取所述第一数据对应的第一数据类型以及所述第二数据对应的第二数据类型,并分别根据所述第一数据类型与所述第二数据类型确定原始逻辑项与目标逻辑项;a type acquisition module, configured to acquire the first data type corresponding to the first data and the second data type corresponding to the second data, and determine the original logic according to the first data type and the second data type respectively item and target logic item;逻辑遍历模块,用于根据所述原始逻辑项遍历第一预设数据层,得到所述原始逻辑项对应的原始数据逻辑值,并根据所述目标逻辑项遍历第二预设数据层,得到所述目标逻辑项对应的目标数据逻辑值;The logic traversal module is configured to traverse the first preset data layer according to the original logic item, obtain the original data logical value corresponding to the original logic item, and traverse the second preset data layer according to the target logic item to obtain the Describe the target data logic value corresponding to the target logic item;代码获取模块,用于获取原始数据库中的初始数据拼接代码;The code acquisition module is used to acquire the initial data splicing code in the original database;代码调整模块,用于调用预设开关根据所述原始数据逻辑值与所述目标数据逻辑值调整所述初始数据拼接代码,得到目标数据拼接代码;a code adjustment module, configured to call a preset switch to adjust the initial data splicing code according to the original data logical value and the target data logical value, to obtain the target data splicing code;代码拼接模块,用于调用所述目标数据拼接代码拼接处理所述第一数据与所述第二数据,得到数据拼接结果。A code splicing module is used to call the target data splicing code splicing to process the first data and the second data to obtain a data splicing result.9.一种计算机设备,其特征在于,所述计算机设备包括处理器,所述处理器用于执行存储器中存储的计算机程序时实现如权利要求1至7中任意一项所述数据拼接功能迁移方法。9. A computer device, characterized in that the computer device comprises a processor, and the processor is used to implement the data splicing function migration method according to any one of claims 1 to 7 when the processor is used to execute the computer program stored in the memory .10.一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至7中任意一项所述数据拼接功能迁移方法。10. A computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the data according to any one of claims 1 to 7 is realized Splice function migration method.
CN202210061955.2A2022-01-192022-01-19 Data splicing function migration method, device, computer equipment and storage mediumActiveCN114416695B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202210061955.2ACN114416695B (en)2022-01-192022-01-19 Data splicing function migration method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202210061955.2ACN114416695B (en)2022-01-192022-01-19 Data splicing function migration method, device, computer equipment and storage medium

Publications (2)

Publication NumberPublication Date
CN114416695Atrue CN114416695A (en)2022-04-29
CN114416695B CN114416695B (en)2025-05-27

Family

ID=81274637

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202210061955.2AActiveCN114416695B (en)2022-01-192022-01-19 Data splicing function migration method, device, computer equipment and storage medium

Country Status (1)

CountryLink
CN (1)CN114416695B (en)

Cited By (1)

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

Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US7263590B1 (en)*2003-04-232007-08-28Emc CorporationMethod and apparatus for migrating data in a computer system
US7516084B1 (en)*2001-07-122009-04-07Lawson Software, Inc.Approach for managing forecast data
CN109325041A (en)*2018-08-142019-02-12中国平安人寿保险股份有限公司Business data processing method, device, computer equipment and storage medium
CN109947788A (en)*2017-10-302019-06-28北京京东尚科信息技术有限公司Data query method and apparatus
CN112667596A (en)*2019-10-162021-04-16北京京东尚科信息技术有限公司Substitution representation method and device for multiple logical data type fields
CN112732759A (en)*2020-12-312021-04-30青岛海尔科技有限公司Data processing method and device, storage medium and electronic device
CN112860670A (en)*2021-03-292021-05-28中信银行股份有限公司Data migration method and device, electronic equipment and computer storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US7516084B1 (en)*2001-07-122009-04-07Lawson Software, Inc.Approach for managing forecast data
US7263590B1 (en)*2003-04-232007-08-28Emc CorporationMethod and apparatus for migrating data in a computer system
CN109947788A (en)*2017-10-302019-06-28北京京东尚科信息技术有限公司Data query method and apparatus
CN109325041A (en)*2018-08-142019-02-12中国平安人寿保险股份有限公司Business data processing method, device, computer equipment and storage medium
CN112667596A (en)*2019-10-162021-04-16北京京东尚科信息技术有限公司Substitution representation method and device for multiple logical data type fields
CN112732759A (en)*2020-12-312021-04-30青岛海尔科技有限公司Data processing method and device, storage medium and electronic device
CN112860670A (en)*2021-03-292021-05-28中信银行股份有限公司Data migration method and device, electronic equipment and computer storage medium

Cited By (1)

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

Also Published As

Publication numberPublication date
CN114416695B (en)2025-05-27

Similar Documents

PublicationPublication DateTitle
CN112612462B (en)Method and device for adjusting conversation configuration, electronic equipment and storage medium
CN112347042A (en)File uploading method and device, electronic equipment and storage medium
WO2023226197A1 (en)Cloud native storage method and apparatus based on kubernetes, and device and medium
CN114398345A (en) Data migration method, device, computer equipment and storage medium
CN114969261A (en)Data query method and device based on artificial intelligence, electronic equipment and medium
CN116089535A (en)Data synchronization method, device, equipment and storage medium
CN114840765A (en)Paging processing method and device, electronic device and storage medium
CN115033605A (en)Data query method and device, electronic equipment and storage medium
CN116089473A (en) Data query method, device, electronic equipment and storage medium
CN114416695A (en)Data splicing function migration method and device, computer equipment and storage medium
CN114116673B (en)Data migration method based on artificial intelligence and related equipment
CN110968566A (en)Migration tool-based domestic application system migration method
CN105426119A (en)Storage apparatus and data processing method
CN114138243A (en)Function calling method, device, equipment and storage medium based on development platform
CN114333102A (en)Parameter configuration method and configuration device of unmanned equipment
CN114706790B (en)Automatic software testing method, device and equipment
CN113434359B (en)Data traceability system construction method and device, electronic device and readable storage medium
CN115114297A (en) Data lightweight storage and search method, device, electronic device and storage medium
CN115146078A (en) Index data processing method, device, computer equipment and storage medium
CN115270757A (en)Text recognition method and device, electronic equipment and storage medium
CN114418585A (en) Smart contract generation method, device and related equipment
CN114218894A (en)Data conversion method and device, electronic equipment and storage medium
WO2023275945A1 (en)Database management device, database management method, and database management program
CN116561106B (en)Configuration item data management method and system
CN114925688A (en)Data processing method and device based on artificial intelligence, electronic equipment and medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp