Data processing method and device, electronic equipment and readable storage medium

CN117493443BActive Publication Date: 2026-10-20INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311633318.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-30
Publication Date
2026-10-20
Estimated Expiration
2043-11-30

AI Technical Summary

Technical Problem

[0003]在实现本公开构思的过程中,发明人发现相关技术中至少存在如下问题,在数据库变更后,由于不同数据库的默认数据返回格式不同,为了适应数据库的变更,需要前后端系统进行大量的代码变更,以保证数据调用和数据处理逻辑的正确,为此,需要消耗大量人力,且难以保证变更后数据调用的准确性

Benefits of technology

[0018]根据本公开提供的数据处理方法及装置、电子设备和可读存储介质,通过在数据库和应用层之间设置格式转换工具,由格式转换工具基于目标转换规则对原始数据进行格式转换得到目标数据,无需改变原有前后端的代码逻辑和数据库结构,可以保证了数据调用的准确性,提升了数据处理的效率。由于通过格式转换工具基于目标转换规则进行格式转换,因此,至少部分的解决了数据转换过程需要消耗大量人力,且难以保证变更后数据调用的准确性的技术问题,实现了数据转换过程无需改变原有前后端的代码逻辑和数据库结构,且可以保证数据调用的准确性,提升数据处理的效率,降低人工工作量的技术效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117493443B_ABST
    Figure CN117493443B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data processing method and device, electronic equipment and readable storage medium, which can be applied to the fields of big data technology, cloud computing technology and financial technology. The data processing method comprises: in the case that a target application calls a target database is monitored, obtaining original data to be returned by the target database to the target application; obtaining a target conversion rule related to the original data; performing format conversion on the original data based on the target conversion rule to obtain target data; and returning the target data to the target application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the fields of big data technology, cloud computing technology and financial technology technology, and more specifically to a data processing method and apparatus, electronic device and readable storage medium. Background Technology

[0002] As business and technology evolve, it is often necessary to change the type of the system database, such as converting from Oracle to MySQL.

[0003] In the process of realizing the concept disclosed herein, the inventors discovered that the related technologies have at least the following problems: after the database is changed, since the default data return formats of different databases are different, in order to adapt to the database change, a large number of code changes are required in the front-end and back-end systems to ensure the correctness of data calling and data processing logic. This requires a lot of manpower and it is difficult to guarantee the accuracy of data calling after the change. Summary of the Invention

[0004] In view of the above problems, this disclosure provides a data processing method and apparatus, an electronic device and a readable storage medium.

[0005] One aspect of this disclosure provides a data processing method, comprising: upon detecting that a target application is calling a target database, obtaining the original data that the target database intends to return to the target application; obtaining target transformation rules related to the original data; performing format conversion on the original data based on the target transformation rules to obtain target data; and returning the target data to the target application.

[0006] According to embodiments of this disclosure, obtaining target transformation rules related to the original data includes: obtaining target transformation scenario parameters related to the original data; and reading the target transformation rules corresponding to the original data from the configuration center based on the target transformation scenario parameters.

[0007] According to embodiments of this disclosure, the target transformation scenario parameters include a first type of the original database and a second type of the target database. The original database is the database used before the database change, and the target database is the database used after the database change. Reading the target transformation rules corresponding to the original data from the configuration center based on the target transformation scenario parameters includes: using the first type and the second type as query fields to read the target transformation rules from the configuration center.

[0008] According to embodiments of this disclosure, format conversion of the original data based on target conversion rules to obtain target data includes: converting the original data from a second character format to a first character format, wherein the first character format is the format used by the data returned by the original database, and the second character format is the format used by the data returned by the target database.

[0009] According to embodiments of this disclosure, the target transformation scenario parameter includes the application scenario type of the original data; reading the target transformation rule corresponding to the original data from the configuration center based on the target transformation scenario parameter includes: using the application scenario type as the query field to read the target transformation rule from the configuration center.

[0010] According to embodiments of this disclosure, converting the original data into target data based on target conversion rules includes: converting the original data from a second character format to a first character format, wherein the first character format is a data format pre-configured in the target conversion rules that matches the application scenario type, and the second character format is the format used by the data returned by the target database.

[0011] According to embodiments of this disclosure, the application scenario type is one of multiple predetermined scenario types, which include at least system parameter type, business parameter type, and personalized parameter type. The original data is format-converted based on target conversion rules to obtain target data, including: when the application scenario type is system parameter type, converting the characters in the primary key of the original data to uppercase; when the application scenario type is business parameter type, converting the characters in the primary key of the original data to camelCase; and when the application scenario type is personalized parameter type, converting the characters in the primary key of the original data to a predefined personalized character format.

[0012] According to embodiments of this disclosure, the configuration center stores multiple pre-built transformation rules; the multiple transformation rules are stored in the form of a cache.

[0013] Another aspect of this disclosure provides a data processing system, comprising: an application layer including multiple applications; a target database for responding to data call requests from the application layer; a configuration center for pre-configuring and storing multiple transformation rules; and a data transformation layer for, upon detecting that a target application in the application layer is calling the target database, obtaining the original data that the target database intends to return to the target application, calling the target transformation rules related to the original data from the configuration center, performing format conversion on the original data based on the target transformation rules to obtain target data, and returning the target data to the target application.

[0014] Another aspect of this disclosure provides a data processing apparatus, comprising: a monitoring module for acquiring raw data that the target database intends to return to the target application when a target application is detected calling a target database; an acquisition module for acquiring target transformation rules related to the raw data; an obtaining module for performing format conversion on the raw data based on the target transformation rules to obtain target data; and a return module for returning the target data to the target application.

[0015] Another aspect of this disclosure provides an electronic device comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors perform the data processing method described above.

[0016] Another aspect of this disclosure provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the data processing method described above.

[0017] Another aspect of this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the above-described data processing method.

[0018] According to the data processing method, apparatus, electronic device, and readable storage medium provided in this disclosure, a format conversion tool is set between the database and the application layer. This tool converts the original data according to target conversion rules to obtain the target data, without changing the original front-end and back-end code logic and database structure. This ensures the accuracy of data retrieval and improves data processing efficiency. Because the format conversion is performed based on target conversion rules, it at least partially solves the technical problems of requiring significant manpower in the data conversion process and the difficulty in guaranteeing the accuracy of data retrieval after changes. It achieves the technical effect of ensuring data accuracy, improving data processing efficiency, and reducing manual workload while eliminating the need to change the original front-end and back-end code logic and database structure. Attached Figure Description

[0019] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0020] Figure 1 This diagram illustrates an application scenario of the data processing method according to an embodiment of the present disclosure.

[0021] Figure 2 A flowchart illustrating a data processing method according to an embodiment of the present disclosure is shown schematically.

[0022] Figure 3 The flowchart illustrates a process of converting raw data into target data in a scenario where the raw data is being converted according to an embodiment of the present disclosure.

[0023] Figure 4 A schematic diagram illustrating a system architecture for implementing the data processing method of embodiments of the present disclosure is shown.

[0024] Figure 5A schematic block diagram of a data processing apparatus according to embodiments of the present disclosure is shown; and

[0025] Figure 6 A block diagram schematically illustrates an electronic device suitable for implementing a data processing method according to an embodiment of the present disclosure. Detailed Implementation

[0026] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.

[0027] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0028] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0029] When using expressions such as "at least one of A, B, and C", they should generally be interpreted in accordance with the meaning that is commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B, and C, etc.).

[0030] In the technical solution disclosed herein, the user information (including but not limited to user personal information, user image information, user device information, such as location information) and data (including but not limited to data used for analysis, stored data, and displayed data) involved are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with the relevant laws, regulations, and standards of the relevant countries and regions, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Corresponding operation entry points are provided for users to choose to authorize or refuse.

[0031] It should be noted that the data processing methods, apparatus, electronic devices, and readable storage media of the present disclosure can be applied to the fields of big data technology, cloud computing technology, and financial technology, and can also be used in any field other than the fields of big data technology, cloud computing technology, and financial technology. The embodiments of the present disclosure do not limit the application fields of the above-mentioned data processing methods, apparatus, electronic devices, and readable storage media.

[0032] The embodiments of this disclosure provide a data processing method, including: when a target application calls a target database, obtaining the original data that the target database intends to return to the target application; obtaining target conversion rules related to the original data; converting the format of the original data based on the target conversion rules to obtain target data; and returning the target data to the target application.

[0033] Figure 1 The diagram illustrates an application scenario of the data processing method according to an embodiment of the present disclosure.

[0034] like Figure 1 As shown, application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0035] Users can interact with server 105 via network 104 using at least one of the first terminal device 101, second terminal device 102, and third terminal device 103 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, second terminal device 102, and third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0036] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0037] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.

[0038] In the application scenarios of this disclosure embodiment, a user can initiate a request to call a target database through a target application of a first terminal device 101, a second terminal device 102, and a third terminal device 103. In response to the above request, the server 105 can be used to execute the data processing method of this disclosure embodiment, including: upon detecting that a target application is calling a target database, obtaining the original data that the target database intends to return to the target application; obtaining target conversion rules related to the original data; performing format conversion on the original data based on the target conversion rules to obtain target data; and returning the target data to the target application.

[0039] It should be noted that the data processing method provided in this embodiment can generally be executed by server 105. Correspondingly, the data processing method apparatus provided in this embodiment can generally be located in server 105. The data processing method provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the data processing method apparatus provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.

[0040] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0041] The following will be based on Figure 1 The described scene, through Figures 2-6 The data processing method of the disclosed embodiments will be described in detail.

[0042] Figure 2 A flowchart illustrating a data processing method according to an embodiment of the present disclosure is shown schematically.

[0043] like Figure 2 As shown, the data processing method of this embodiment includes operations S201 to S204. The execution subject of the method in this embodiment is a format conversion tool.

[0044] In operation S201, the format conversion tool, upon detecting that the target application is calling the target database, obtains the original data that the target database intends to return to the target application;

[0045] In operation S202, the format conversion tool obtains the target conversion rules related to the original data;

[0046] In operation S203, the format conversion tool converts the original data based on the target conversion rules to obtain the target data;

[0047] In operation S204, the format conversion tool returns the target data to the target application.

[0048] The methods described in the embodiments of this disclosure can be applied to application scenarios involving the standardization of data formats during database migration. Since different databases may store data in different formats, after database migration, extensive code changes are required to ensure that the migrated data format meets user requirements and that the processing logic of the migrated data is correct. This process consumes a significant amount of manpower and makes it difficult to guarantee the accuracy of data retrieval after migration.

[0049] For example, during the conversion of software development from Oracle database storage to MySQL database storage, the different case handling methods of different databases lead to inconsistencies in the keys returned by MyBatis. For Oracle databases, Spring Boot processes the keys returned by MyBatis as uppercase; however, for MySQL databases, Spring Boot processes the keys returned by MyBatis as the same as the original values, for example, in the mapper, if the field was originally camelCase, it remains camelCase; if it was lowercase, it remains lowercase; and if it was uppercase, it remains uppercase. For instance, if all characters in data A are lowercase, after storing data A in an Oracle database, all characters in data A are converted to uppercase. Then, after migrating data A from an Oracle database to a MySQL database, all characters in data A are converted back to their original lowercase form. When the target application calls data A from the MySQL database, all characters in data A need to be converted from lowercase to uppercase (the target application requires uppercase). However, this process requires a lot of manpower and may cause changes to code logic and database structure, potentially reducing the accuracy of data retrieval.

[0050] According to embodiments of this disclosure, a format conversion tool can be added between the application layer and the database. Traditional data retrieval methods involve an application requesting access to a database, after which the database directly sends data to the application. However, due to differences in the development methods of different databases, the case of the characters returned by the database may differ from the case of the data required by the application. By adding a format conversion tool between the application layer and the database, the tool can first obtain the data returned by the database, convert it to the format required by the application, and then send the converted data to the application. The format conversion tool can be, for example, a character case processor.

[0051] According to embodiments of this disclosure, the format conversion tool can convert all characters of the data into a uniform format without changing the original code logic and database structure.

[0052] According to embodiments of this disclosure, Spring Boot's aspect-oriented programming technique can be used to mark data key values ​​with specific placeholders. A format conversion tool can parse the placeholders and convert the key values ​​into a uniform format according to the format specified by the placeholders. Table 1 shows the placeholders and their corresponding explanations.

[0053] Table 1

[0054] Upper capital Lower lower case Camel-Case Camel Hump

[0055] For example, when the placeholder for the key value of a certain data is #{name:upper}, it means that the format conversion tool needs to convert the key (name) value of the above data to uppercase.

[0056] According to an embodiment of this disclosure, in operation S201, the target application can be an application that needs to call a database; the target database can be a database that stores the data required by the target application, and the original data can be the data that the target application needs to call from the target database.

[0057] According to embodiments of this disclosure, when a target application initiates a request to call a target database, the target database sends the raw data to be called to a format converter.

[0058] In embodiments of this disclosure, user consent or authorization may be obtained before acquiring user information. For example, a request to acquire user information may be sent to the user before operation S201. If the user consents or authorizes the acquisition of user information, operation S201 is performed.

[0059] According to embodiments of this disclosure, in operation S202, depending on the original database and target database corresponding to the original data, the original data can correspond to different target conversion rules. For example, all original data migrated from an Oracle database (original database) to a MySQL database (target database) can be subject to the first type of target conversion rule; all original data migrated from an Oracle database (original database) to an SQLite database (target database) can be subject to the second type of target conversion rule. After receiving the original data, the format conversion tool can obtain the target conversion rules related to the original data.

[0060] According to embodiments of this disclosure, target transformation rules can be stored, for example, in a configuration center. The format conversion tool can obtain target transformation rules related to the original data by reading the configuration center.

[0061] According to an embodiment of this disclosure, in operation S203, since the original data is migrated from the original database to the target database, and the original database and the target database have different ways of handling character case format, the character case format of the original data may be different from the format required by the target application. Therefore, the format conversion tool needs to convert the character case format of the original data into the format required by the target application based on the target conversion rules corresponding to the original data.

[0062] According to embodiments of this disclosure, the target data may be the original data after format conversion.

[0063] According to an embodiment of this disclosure, in operation S204, after the format conversion is completed, the format converter sends the original data after format conversion to the target application.

[0064] For example, an application needs to access data A from a MySQL database. Data A was migrated from an Oracle database to a MySQL database. Since the original database for data A is Oracle and the target database is MySQL, data A corresponds to the first type of target conversion rule. The first type of target conversion rule converts the characters in the primary key of the original data to uppercase. The conversion tool is a character case processor. After the application accesses the MySQL database, the MySQL database sends data A to the character case processor. The character case processor retrieves the first type of target conversion rule corresponding to data A from the configuration center and converts all characters in the primary key of data A to uppercase based on the first type of target conversion rule. The character case processor then sends the converted data A to the application.

[0065] According to embodiments of this disclosure, by setting up a format conversion tool between the database and the application layer, the format conversion tool converts the original data into target data based on the target conversion rules. This does not require changing the original front-end and back-end code logic and database structure, thus ensuring the accuracy of data retrieval, improving data processing efficiency, and reducing manual workload.

[0066] According to embodiments of this disclosure, obtaining target transformation rules related to the original data includes: obtaining target transformation scenario parameters related to the original data; and reading the target transformation rules corresponding to the original data from the configuration center based on the target transformation scenario parameters.

[0067] According to embodiments of this disclosure, format conversion of raw data can correspond to different conversion scenarios, and different conversion scenarios can correspond to different target conversion scenario parameters, thereby corresponding to different conversion methods.

[0068] For example, the conversion scenarios can include two different scenarios. The first scenario is a database type change scenario, specifically a change from the original database to the target database; for example, a system that originally used an Oracle database may switch to a MySQL database after a database change. Since the default data return formats of these two databases are different, to adapt to the database change without requiring extensive code changes to upstream and downstream systems interfacing with the database, the format conversion tool of this disclosure can be used directly for data format conversion. The second scenario involves changing the format of the data returned by the database based on a user-defined conversion method, even if the database type changes or not. These two conversion scenarios can correspond to different target conversion scenario parameters, and thus different conversion methods.

[0069] According to embodiments of this disclosure, data can be transformed in different ways based on different transformation scenarios, which can better meet the actual needs of users.

[0070] According to embodiments of this disclosure, specifically in a first scenario, the target conversion scenario parameters include a first type of the original database and a second type of the target database, wherein the original database is the database used before the database migration, and the target database is the database used after the database migration.

[0071] According to embodiments of this disclosure, reading the target transformation rules corresponding to the original data from the configuration center based on the target transformation scenario parameters includes: using the first type and the second type as query fields to read the target transformation rules from the configuration center.

[0072] For example, if data A is migrated from an Oracle database to a MySQL database, then the Oracle database is the origin database, and the target database is the MySQL database. The target transformation scenario parameters for data A include a first type and a second type, where the first type corresponds to the Oracle database and the second type corresponds to the MySQL database. Using the Oracle database and MySQL database as query fields, the format conversion tool can read the target transformation rules corresponding to data A from the configuration center.

[0073] According to embodiments of this disclosure, in a first scenario, converting the original data into target data based on target conversion rules may include: converting the original data from a second character format to a first character format, wherein the first character format is the format used by the data returned by the original database, and the second character format is the format used by the data returned by the target database.

[0074] For example, data A was migrated from an Oracle database to a MySQL database. Therefore, the first character format is the format used by the Oracle database to return data, i.e., uppercase, and the second character format is the format used by the MySQL database to return data, i.e., the original format of data A. An application needs to access data A stored in the MySQL database. The format conversion tool obtains data A stored in the MySQL database, reads the target conversion rule corresponding to data A from the configuration center, and then performs format conversion based on the target conversion rule: converting data A to the format used by the Oracle database to return data, that is, converting the characters in the primary key of data A to uppercase, thus obtaining the target data.

[0075] According to embodiments of this disclosure, based on the types of the original database and the target database, the format conversion tool of this disclosure can be used to directly perform data format conversion without requiring extensive code changes to the upstream and downstream systems that interface with the database. It can also ensure the correctness of data calling and data processing logic, guarantee the accuracy of data calling after the change, and save manual workload.

[0076] According to embodiments of this disclosure, specifically in the second scenario, the target transformation scenario parameter may include the application scenario type of the original data; reading the target transformation rule corresponding to the original data from the configuration center based on the target transformation scenario parameter includes: using the application scenario type as the query field to read the target transformation rule from the configuration center.

[0077] According to embodiments of this disclosure, different application scenario types can be, for example, system parameter types, personalized parameter types, etc. Different application scenario types can correspond to different target conversion rules. Using the application scenario type as a query field, the format conversion tool can read the target conversion rules corresponding to the application scenario type of the original data from the configuration center.

[0078] According to an embodiment of this disclosure, in the second scenario, converting the original data into target data based on the target conversion rules includes: converting the original data from a second character format to a first character format, wherein the first character format is a data format pre-configured in the target conversion rules that matches the application scenario type, and the second character format is the format used by the data returned by the target database.

[0079] According to embodiments of this disclosure, in scenarios where application scenarios are transformed based on raw data, target transformation rules corresponding to various application scenarios can be pre-set and stored in a configuration center.

[0080] For example: Data A is stored in a MySQL database, and the application scenario corresponding to data A is a system parameter type. The format conversion tool uses "system parameter type" as the query field and reads the target conversion rule corresponding to data A from the configuration center: converting data A from the second character format to the first character format, where the second character format is the format used by the data returned by the MySQL database, and the first character format is the preset target conversion rule corresponding to "system parameter type".

[0081] According to embodiments of this disclosure, specifically, the application scenario type is one of a plurality of predetermined scenario types, which include at least system parameter types, business parameter types, and personalized parameter types.

[0082] Figure 3 The flowchart illustrates a process of converting raw data into target data in a scenario where the raw data is being converted according to an embodiment of the present disclosure.

[0083] like Figure 3 As shown, in the scenario of converting application scenarios based on original data, the method for converting the format of original data to obtain target data in this embodiment includes operations S301 to S303.

[0084] When operating S301, if the application scenario type is system parameter type, convert the characters in the primary key of the original data to uppercase format;

[0085] When operating S302, if the application scenario type is business parameter type, convert the characters in the primary key of the original data to camelCase format.

[0086] When operating S303, if the application scenario type is personalized parameter type, the characters in the primary key of the original data are converted into a predefined personalized character format.

[0087] According to embodiments of this disclosure, in the case of a personalized parameter type application scenario, the user can customize the conversion of characters in the primary key of the original data into a certain format. For example, in the case of a personalized parameter type application scenario, the user specifies that the characters in the primary key of the original data be converted to lowercase format. When the user calls data A through the target application, the format conversion tool can convert the characters in the primary key of data A to lowercase format.

[0088] According to embodiments of this disclosure, different conversion methods can be used depending on the application scenario type of the original data, thereby improving the applicability of format conversion and enhancing user experience.

[0089] According to embodiments of this disclosure, the configuration center stores multiple pre-built transformation rules; the multiple transformation rules are stored in the form of a cache.

[0090] According to embodiments of this disclosure, the configuration center stores transformation rules in the form of a cache, eliminating the need to read data from the database each time data processing is performed, thus significantly reducing the number of I / O operations and improving data processing efficiency.

[0091] Figure 4 A schematic diagram of a system architecture for implementing the data processing method of embodiments of the present disclosure is shown.

[0092] like Figure 4 As shown, the data processing system of this embodiment includes an application layer, a target database, a configuration center, and a data conversion layer.

[0093] According to embodiments of this disclosure, the application layer includes multiple applications; a target database for responding to data call requests from the application layer; a configuration center for pre-configuring and storing multiple conversion rules; and a data conversion layer for, upon detecting that a target application in the application layer is calling a target database, obtaining the original data that the target database intends to return to the target application, calling the target conversion rules related to the original data from the configuration center, converting the format of the original data based on the target conversion rules to obtain target data, and returning the target data to the target application.

[0094] Based on the above data processing method, this disclosure also provides a data processing apparatus. The following will be combined with... Figure 5 The device is described in detail.

[0095] Figure 5 A schematic block diagram of a data processing apparatus according to an embodiment of the present disclosure is shown.

[0096] like Figure 5 As shown, the data processing device 500 of this embodiment includes a monitoring module 510, an acquisition module 520, a conversion module 530, and a return module 540.

[0097] The monitoring module 510 is used to obtain the original data that the target database intends to return to the target application when it detects that the target application is calling the target database. In one embodiment, the monitoring module 510 can be used to perform the operation S201 described above, which will not be repeated here.

[0098] The acquisition module 520 is used to acquire the target transformation rules related to the original data. In one embodiment, the acquisition module 520 can be used to perform the operation S202 described above, which will not be repeated here.

[0099] The conversion module 530 is used to convert the format of the original data based on the target conversion rules to obtain the target data. In one embodiment, the conversion module 530 can be used to perform the operation S203 described above, which will not be repeated here.

[0100] The return module 540 is used to return target data to the target application. In one embodiment, the obtaining module 540 can be used to perform the operation S204 described above, which will not be repeated here.

[0101] According to embodiments of this disclosure, the acquisition module 520 includes an acquisition submodule and a reading submodule.

[0102] The acquisition submodule is used to acquire target transformation scenario parameters related to the original data; the reading submodule is used to read the target transformation rules corresponding to the original data from the configuration center based on the target transformation scenario parameters.

[0103] According to embodiments of this disclosure, the reading submodule includes a first reading unit.

[0104] The first reading unit is used to read the target transformation rules from the configuration center using the first type and the second type as query fields.

[0105] According to an embodiment of this disclosure, the conversion module 530 includes a first conversion submodule.

[0106] The conversion submodule is used to convert the original data from the second character format to the first character format, where the first character format is the format used by the original database to return the data, and the second character format is the format used by the target database to return the data.

[0107] According to embodiments of this disclosure, the reading submodule further includes a second reading unit.

[0108] The second reading unit is used to read the target transformation rules from the configuration center using the application scenario type as the query field.

[0109] According to embodiments of this disclosure, the conversion module 530 further includes a second conversion submodule.

[0110] The second conversion submodule is used to convert the original data from the second character format to the first character format. The first character format is a data format that is pre-configured in the target conversion rules and matches the application scenario type. The second character format is the format used by the data returned by the target database.

[0111] According to embodiments of this disclosure, the conversion module 530 further includes a third conversion submodule, a fourth conversion submodule, and a fifth conversion submodule.

[0112] The third conversion submodule is used to convert the characters in the primary key of the original data to uppercase when the application scenario type is system parameter type; the fourth conversion submodule is used to convert the characters in the primary key of the original data to camelCase when the application scenario type is business parameter type; the fifth conversion submodule is used to convert the characters in the primary key of the original data to a predefined personalized character format when the application scenario type is personalized parameter type.

[0113] According to embodiments of this disclosure, any plurality of modules among the monitoring module 510, acquisition module 520, conversion module 530, and return module 540 may be combined into one module, or any one of these modules may be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of this disclosure, at least one of the monitoring module 510, acquisition module 520, conversion module 530, and return module 540 may be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), programmable logic array (PLA), system-on-a-chip, system-on-a-substrate, system-on-package, application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the monitoring module 510, acquisition module 520, conversion module 530, and return module 540 may be at least partially implemented as a computer program module, which, when run, can perform corresponding functions.

[0114] Figure 6 A block diagram schematically illustrates an electronic device suitable for implementing a data processing method according to an embodiment of the present disclosure.

[0115] like Figure 6As shown, an electronic device 600 according to an embodiment of this disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage portion 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this disclosure.

[0116] RAM 603 stores various programs and data required for the operation of electronic device 600. Processor 601, ROM 602, and RAM 603 are interconnected via bus 604. Processor 601 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 602 and / or RAM 603. It should be noted that programs may also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in one or more memories.

[0117] According to embodiments of this disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to a bus 604. The electronic device 600 may also include one or more of the following components connected to the input / output (I / O) interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the input / output (I / O) interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 610 as needed so that computer programs read from it can be installed into the storage section 608 as needed.

[0118] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.

[0119] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 602 and / or RAM 603 and / or one or more memories other than ROM 602 and RAM 603 described above.

[0120] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to enable the computer system to implement the data processing methods provided in the embodiments of this disclosure.

[0121] When the computer program is executed by the processor 601, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0122] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 606, and / or installed from the removable medium 611. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0123] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 606, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0124] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0125] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0126] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.

[0127] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.

Claims

1. A data processing method, comprising: If the target application is detected to be calling the target database, the original data that the target database intends to return to the target application is obtained; Obtain target transformation scenario parameters related to the original data, wherein the target transformation scenario parameters include a first type of the original database and a second type of the target database, or the target transformation scenario parameters include the application scenario type of the original data, wherein the original database is the database used before the database change and the target database is the database used after the database change; Based on the target transformation scenario parameters, the target transformation rules corresponding to the original data are read from the configuration center; The process of converting the original data to the target data based on the target conversion rules includes: converting the original data from a second character format to a first character format; wherein the second character format is the format used by the data returned by the target database; when the target conversion scenario parameters include the first type and the second type, the first character format is the format used by the data returned by the original database; when the target conversion scenario parameters include the application scenario type, the first character format is a data format pre-configured in the target conversion rules that matches the application scenario type. Return the target data to the target application.

2. The method according to claim 1, wherein: Based on the target transformation scenario parameters, the target transformation rules corresponding to the original data are read from the configuration center, including: Using the first type and the second type as query fields, the target conversion rules are read from the configuration center.

3. The method according to claim 1, wherein: Based on the target transformation scenario parameters, the target transformation rules corresponding to the original data are read from the configuration center, including: Using the application scenario type as the query field, the target conversion rule is read from the configuration center.

4. The method according to claim 1, wherein, The application scenario type is one of a plurality of predetermined scenario types, which include at least system parameter type, business parameter type, and personalized parameter type; Converting the original data from the second character format to the first character format includes: When the application scenario type is system parameter type, the characters in the primary key of the original data are converted to uppercase format; When the application scenario type is a business parameter type, the characters in the primary key of the original data are converted to camelCase format; When the application scenario type is a personalized parameter type, the characters in the primary key of the original data are converted into a predefined personalized character format.

5. The method according to claim 1, wherein: The configuration center stores multiple pre-built conversion rules; The multiple conversion rules are stored in a cache.

6. A data processing system, comprising: The application layer includes multiple applications; The target database is used to respond to data call requests from the application layer; The configuration center is used to pre-configure and store multiple transformation rules; The data transformation layer is used to perform the following operations: If the target application in the application layer is detected to call the target database, the original data that the target database intends to return to the target application is obtained; Obtain target transformation scenario parameters related to the original data, wherein the target transformation scenario parameters include a first type of the original database and a second type of the target database, or the target transformation scenario parameters include the application scenario type of the original data, wherein the original database is the database used before the database change and the target database is the database used after the database change; Based on the target transformation scenario parameters, the target transformation rules related to the original data are retrieved from the configuration center; The target data is obtained by format conversion of the original data based on the target conversion rules, including: converting the original data from a second character format to a first character format; wherein the second character format is the format used by the data returned by the target database; when the target conversion scenario parameters include the first type and the second type, the first character format is the format used by the data returned by the original database; when the target conversion scenario parameters include the application scenario type, the first character format is a data format pre-configured in the target conversion rules that matches the application scenario type. Return the target data to the target application.

7. A data processing apparatus, comprising: The monitoring module is used to obtain the original data that the target database intends to return to the target application when the target application calls the target database. The acquisition module is used to acquire target transformation scenario parameters related to the original data, wherein the target transformation scenario parameters include a first type of the original database and a second type of the target database, or the target transformation scenario parameters include the application scenario type of the original data, wherein the original database is the database used before the database change and the target database is the database used after the database change; and the module reads the target transformation rules corresponding to the original data from the configuration center based on the target transformation scenario parameters. A conversion module is used to perform format conversion on the original data based on the target conversion rules to obtain target data, including converting the original data from a second character format to a first character format; wherein the second character format is the format used by the data returned by the target database; when the target conversion scenario parameters include the first type and the second type, the first character format is the format used by the data returned by the original database; when the target conversion scenario parameters include the application scenario type, the first character format is a data format pre-configured in the target conversion rules that matches the application scenario type; and The return module is used to return the target data to the target application.

8. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the method according to any one of claims 1 to 5.

9. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 5.

10. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data table generation method and device, computer device and storage medium

    CN110851446A

  • Query method, device and system, electronic equipment and storage medium

    CN116166700A