Data processing method, device, computing equipment and medium
By adopting the corresponding relationship between ORM framework and library tables in relational databases, the problem of low data processing efficiency caused by mismatch between the object model and the relational model is solved, and efficient data processing and performance improvement under high concurrency is achieved.
Patent Information
- Application Number
- CN202110505011.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-10
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2041-05-10
AI Technical Summary
In the prior art, since the object model does not match the relational model, it is difficult to efficiently process data on the relational database, especially in the case of high concurrency.
A database based on the ORM framework is adopted to establish the database database corresponding to the database table of the corresponding database, and perform data processing operations on the relational database through the database table correspondence relationship.
By establishing a mapping relationship between the object model and the relational model, it is possible to efficiently process data on the relational database, improve the concurrent processing performance of the ORM database, and avoid degradation of database processing performance due to large amounts of data.
Smart Images

Figure CN113111138B_ABST
Abstract
Description
Background Art
[0002] This section is intended to provide a background or context to the embodiments of the disclosure that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.
[0003] A relational database is a database that uses a relational model to organize data. Relational databases such as SQLite are widely used in various terminal devices such as embedded devices. How to process data in a relational database more efficiently has become a focus of attention.
[0004] In the related technical solutions, object-oriented object models are used for data processing in the business logic layer and the user interface layer, and relational models are used for data processing in the database layer. However, since the object model does not match the relational model, SQL statements are required to perform data processing operations on objects in the relational database, such as adding data, deleting data, etc. Summary of the invention
[0005] However, in the above technical solution, since the object model does not match the relational model, it is necessary to perform data processing operations on the relational database through SQL statements, which makes it difficult to efficiently process data on the relational database.
[0006] Therefore, an improved data processing method is needed to meet the high-concurrency data processing requirements.
[0007] In this context, embodiments of the present disclosure are intended to provide a data processing method, a data processing apparatus, a computing device, and a medium.
[0008] In a first aspect of an embodiment of the present disclosure, a data processing method is provided, which is applied to a database based on an object-relational mapping (ORM), wherein the database corresponds to a target application on a terminal device, and the target application is configured with a database information class file, wherein the database information class file is used to record the library-table correspondence between a sub-library of the database and a data table in the corresponding sub-library. The method comprises: in response to a data processing operation on the target application, determining identification information of a data table to be processed corresponding to the data processing operation; determining the sub-library information corresponding to the data table to be processed based on the identification information of the data table to be processed and the library-table correspondence; querying the data table to be processed from the sub-library corresponding to the sub-library information, and executing the data processing operation.
[0009] According to the first aspect, in some example embodiments, the method further includes: loading the database information class file when initializing the target application; reading the library table correspondence relationship from the database information class file; and storing the library table correspondence relationship in a memory corresponding to the target application.
[0010] According to the first aspect, in some example embodiments, determining the sub-library information corresponding to the data table to be processed based on the identification information of the data table to be processed and the library-table correspondence includes: reading the library-table correspondence from the memory corresponding to the target application; and determining the sub-library information corresponding to the data table to be processed from the read library-table correspondence based on the identification information of the data table to be processed.
[0011] According to the first aspect, in some example embodiments, the method further includes: in response to an operation of adding a new table to a target sub-library in the database, recording the library-table correspondence between identification information of the newly added data table and identification information of the target sub-library in the database information class file.
[0012] According to the first aspect, in some example embodiments, the library-table correspondence between the identification information of the newly added data table and the identification information of the target sub-library recorded in the database information class file includes: recording in the database information class file the correspondence between the identification information of the target sub-library, the identification information of the newly added data table and the universal resource identifier URI corresponding to the newly added data table; and / or recording in the database information class file the correspondence between the identification information of the target sub-library, the identification information of the newly added data table and the class file corresponding to the newly added data table.
[0013] According to the first aspect, in some example embodiments, each of the sub-library corresponds to a sub-library management class, and the method further includes: adding information of the newly added data table to the class file of the sub-library management class corresponding to the target sub-library; and creating the newly added data table in the target sub-library based on the sub-library management class.
[0014] According to the first aspect, in some example embodiments, the database information class file also records: a table-to-address correspondence between the identification information of the data table to be processed and the URI corresponding to the data table to be processed, and querying the data table to be processed from the sub-library corresponding to the sub-library information includes: determining the URI of the data table to be processed from the table-to-address correspondence based on the identification information of the data table to be processed; and querying the data table to be processed from the sub-library corresponding to the sub-library information based on the URI of the data table to be processed.
[0015] According to the first aspect, in some example embodiments, the database information class file also records: a table-class correspondence relationship between the identification information of the data table to be processed and the class file of the data table to be processed, and the execution of the data processing operation includes: determining the class file of the data table to be processed from the table-class correspondence relationship based on the identification information of the data table to be processed; and executing the data processing operation on the queried data table to be processed based on the class file.
[0016] According to the first aspect, in some example embodiments, each of the sub-library corresponds to a sub-library table management class, and the method further includes: in response to a data migration operation of migrating a source data table in a first sub-library of the database to a second sub-library, determining a first sub-library table management class corresponding to the first sub-library and a second sub-library table management class corresponding to the second sub-library; creating a target data table corresponding to the source data table in the second sub-library through the second sub-library table management class; migrating the data of the source data table from the first sub-library to the target data table of the second sub-library; and deleting the source data table in the first sub-library through the first sub-library management class.
[0017] According to the first aspect, in some example embodiments, determining the sub-library information corresponding to the data table to be processed includes: determining the sub-library configuration information corresponding to the data table to be processed, the sub-library configuration information including one or more of the sub-library name, sub-library version and corresponding operation type information.
[0018] According to the first aspect, in some example embodiments, the sub-library configuration information includes a sub-library name and a sub-library version, and querying the data table to be processed from the sub-library corresponding to the sub-library information includes: determining the corresponding sub-library according to the sub-library name and the sub-library version in the sub-library configuration information; and querying the data table to be processed from the corresponding sub-library.
[0019] In a second aspect of an embodiment of the present disclosure, a data processing device is provided, which is applied to a database based on an object-relational mapping (ORM), wherein the database corresponds to a target application on a terminal device, and the target application is configured with a database information class file, wherein the database information class file is used to record the library-table correspondence between a sub-library of the database and a data table in the corresponding sub-library. The device comprises: a table determination module, which is used to determine, in response to a data processing operation on the target application, identification information of a data table to be processed corresponding to the data processing operation; a sub-library determination module, which is used to determine, based on the identification information of the data table to be processed and the library-table correspondence, sub-library information corresponding to the data table to be processed; and a data processing module, which is used to query the data table to be processed from the sub-library corresponding to the sub-library information and execute the data processing operation.
[0020] According to the second aspect, in some example embodiments, the device further includes: a loading module, used to load the database information class file when initializing the target application; a relationship extraction module, used to read the library table correspondence relationship from the database information class file; and a relationship storage module, used to store the library table correspondence relationship in the memory corresponding to the target application.
[0021] According to the second aspect, in some example embodiments, the sub-library determination module includes: a relationship acquisition module, used to read the library-table correspondence relationship from the memory corresponding to the target application; and a sub-library determination unit, used to determine the sub-library information corresponding to the data table to be processed from the read library-table correspondence relationship based on the identification information of the data table to be processed.
[0022] According to the second aspect, in some example embodiments, the device further includes: a relationship recording module for recording, in response to an operation of adding a new table to a target sub-library in the database, the library-table correspondence between identification information of the newly added data table and identification information of the target sub-library in the database information class file.
[0023] According to the second aspect, in some example embodiments, the relationship recording module is also used to: record in the database information class file the correspondence between the identification information of the target sub-library, the identification information of the newly added data table, and the universal resource identifier URI corresponding to the newly added data table; and / or record in the database information class file the correspondence between the identification information of the target sub-library, the identification information of the newly added data table, and the class file corresponding to the newly added data table.
[0024] According to the second aspect, in some example embodiments, each of the sub-library corresponds to a sub-library management class, and the device further includes: an information adding module, used to add information of the newly added data table to the class file of the sub-library management class corresponding to the target sub-library; and a table creation module, used to create the newly added data table in the target sub-library based on the sub-library management class.
[0025] According to the second aspect, in some example embodiments, the database information class file also records: the table-to-address correspondence between the identification information of the data table to be processed and the URI corresponding to the data table to be processed, and the data processing module is also used to: determine the URI of the data table to be processed from the table-to-address correspondence based on the identification information of the data table to be processed; and query the data table to be processed from the sub-library corresponding to the sub-library information based on the URI of the data table to be processed.
[0026] According to the second aspect, in some example embodiments, the database information class file also records: a table-class correspondence between the identification information of the data table to be processed and the class file of the data table to be processed, and the data processing module is also used to: determine the class file of the data table to be processed from the table-class correspondence based on the identification information of the data table to be processed; and perform the data processing operation on the queried data table to be processed based on the class file.
[0027] According to the second aspect, in some example embodiments, each of the sub-library corresponds to a sub-library table management class, and the device further includes: a migration response module, used to determine a first sub-library table management class corresponding to the first sub-library and a second sub-library table management class corresponding to the second sub-library in response to a data migration operation of migrating a source data table in a first sub-library of the database to a second sub-library; a target table creation module, used to create a target data table corresponding to the source data table in the second sub-library through the second sub-library table management class; a migration module, used to migrate the data of the source data table from the first sub-library to the target data table of the second sub-library; and a table deletion module, used to delete the source data table in the first sub-library through the first sub-library management class.
[0028] According to the second aspect, in some example embodiments, the sub-library determination module includes: determining sub-library configuration information corresponding to the data table to be processed, the sub-library configuration information including one or more of a sub-library name, a sub-library version, and corresponding operation type information.
[0029] According to the second aspect, in some example embodiments, the sub-library configuration information includes a sub-library name and a sub-library version, and the data processing module is further used to: determine the corresponding sub-library according to the sub-library name and the sub-library version in the sub-library configuration information; and query the data table to be processed from the corresponding sub-library.
[0030] In a third aspect of an embodiment of the present disclosure, a computing device is provided, including: a processor and a memory, the memory storing executable instructions, the processor being used to call the executable instructions stored in the memory to execute a method as described in any one of the above-mentioned first aspects.
[0031] In a fourth aspect of the embodiments of the present disclosure, a medium is provided, on which a program is stored, and when the program is executed by a processor, the method as described in any one of the first aspects above is implemented.
[0032] According to the technical solution of the embodiment of the present disclosure, on the one hand, by adopting a database based on the ORM framework, it is possible to establish a mapping relationship between an object model and a relational model, so that data processing operations can be efficiently performed on the relational database through the mapping relationship; on the other hand, a library-table correspondence relationship between a sub-library of the database and a data table in the corresponding sub-library is established, and data processing operations are performed on the relational database through the library-table correspondence relationship, and the ORM database can be processed by sub-library, thereby improving the concurrent processing performance of the ORM database and avoiding the problem of reduced database processing performance due to a large amount of data. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The above and other purposes, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, in which:
[0034] Figure 1 A schematic diagram showing an application scenario of a data processing method according to some embodiments of the present disclosure;
[0035] Figure 2 The flowchart schematically shows a data processing method according to some embodiments of the present disclosure;
[0036] Figure 3 Schematically shows a flow chart of a data processing method according to some other embodiments of the present disclosure;
[0037] Figure 4 The structure diagram of the data processing device according to some embodiments of the present disclosure is schematically shown;
[0038] Figure 5 Schematically shows a flowchart of a newly added data table according to some embodiments of the present disclosure;
[0039] Figure 6 A schematic diagram schematically shows a database information class file according to some embodiments of the present disclosure;
[0040] Figure 7 A schematic diagram schematically illustrates a computer-readable storage medium according to some embodiments of the present disclosure;
[0041] Figure 8 The structure diagram of the data processing device according to some embodiments of the present disclosure is schematically shown;
[0042] Fig. 9 A schematic diagram of the structure of a computing device according to some embodiments of the present disclosure is schematically shown.
[0043] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION
[0044] The principles and spirit of the present disclosure will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0045] Those skilled in the art will appreciate that the embodiments of the present disclosure may be implemented as a system, device, apparatus, method or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0046] According to an embodiment of the present disclosure, a data processing method, apparatus, computing device and medium are proposed.
[0047] In this article, it is important to understand that the terms involved are:
[0048] ORM (Object Relational Mapping): ORM framework is a technology to solve the problem of incompatibility between object-oriented and relational databases. Through the ORM framework, you can operate the tables in the database like operating objects. Under the ORM framework, a class object corresponds to a data table in the database, each instance of the class object corresponds to a record in the data table, and each attribute of the class corresponds to a field in the data table.
[0049] Library-table correspondence: The database includes multiple sub-libraries, each of which has multiple tables. The library-table correspondence is used to record the correspondence between the sub-libraries in the database and the tables in the sub-libraries. This correspondence can be implemented through the MAP data structure.
[0050] URI (Universal Resource Identifier): the path information of the storage location of a data table in a database. The corresponding data table in the database can be accessed through the URI of the data table.
[0051] Table-address correspondence: the correspondence between the identification information of the data table in the database and the URI corresponding to the data table. This correspondence can be implemented through the MAP data structure.
[0052] Table-class correspondence: the correspondence between the identification information of a data table in the database and the class file of the data table. This correspondence can be implemented through the MAP data structure.
[0053] In addition, any number of elements in the drawings is for illustration and not limitation, and any naming is only for distinction and does not have any limiting meaning.
[0054] The principle and spirit of the present disclosure are explained in detail below with reference to several representative embodiments of the present disclosure. SUMMARY OF THE INVENTION
[0056] The inventors have found that in order to solve the problem that it is difficult to efficiently process data on a relational database, it is necessary to use SQL statements to process data on a relational database due to the mismatch between the object model and the relational model. In the related technical solution, an ORM (Object Relational Mapping) framework is used to process data on a relational database. The ORM framework is a technology for solving the mismatch between object-oriented and relational databases. Under an ORM framework such as GreenDao, objects in an application are automatically persisted in a relational database by using metadata describing the mapping relationship between objects and data tables. However, as the business develops, the amount of data in the database will increase, and a single database will affect the database data processing performance.
[0057] Based on the above content, the basic idea of the embodiment of the present disclosure is: using a database based on the ORM framework, establishing a library-table correspondence between the sub-library of the database and the data table in the corresponding sub-library, and performing data processing operations on the relational database through the library-table correspondence. On the one hand, using a database based on the ORM framework, it is possible to establish a mapping relationship between the object model and the relational model, so that data processing operations can be efficiently performed on the relational database through the mapping relationship; on the other hand, establishing a library-table correspondence between the sub-library of the database and the data table in the corresponding sub-library, performing data processing operations on the relational database through the library-table correspondence, and being able to perform sub-library processing on the ORM database, thereby improving the concurrent processing performance of the ORM database and avoiding the problem of reduced database processing performance due to large data volume.
[0058] After introducing the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure are described in detail below.
[0059] Application Scenario Overview
[0060] It should be noted that the following application scenarios are only shown to facilitate understanding of the spirit and principle of the present disclosure, and the embodiments of the present disclosure are not limited in this respect. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.
[0061] Figure 1A block diagram schematically shows an application scenario of the data processing method according to an embodiment of the present disclosure.
[0062] Reference Figure 1 As shown, the application scenario may include: at least one client 110 and a server 120, wherein the client 110 is installed with a variety of applications such as music applications, video applications, etc. The client 110 and the server 120 communicate through a network 130. The client 110 may be a terminal device such as a mobile phone, a tablet computer, a desktop computer, a portable notebook computer, or a vehicle-mounted terminal. The server 120 may be a physical server including an independent host, or a virtual server carried by a host cluster, or a cloud server, etc. The network 130 may be a wired network or a wireless network, for example, the network 130 may be a PSTN (Public Switched Telephone Network) or the Internet.
[0063] In some example embodiments, the target application is a music player application, and an ORM-based database is provided on the client 110. The database includes multiple sub-libraries. The database corresponds to the music player application on the client 110. The music player application is configured with a database information class file. The database information class file is used to record the library-table correspondence between the sub-libraries of the database and the data tables in the corresponding sub-libraries. A data processing operation is performed on the music player application on the client 110, such as adding the currently played music to the favorite song list. In response to the data processing operation on the music player application, the client 110 determines the identification information of the data table to be processed corresponding to the data processing operation, such as the identification information of the favorite song list; based on the identification information of the data table to be processed and the library-table correspondence, the sub-library information corresponding to the data table to be processed is determined; the data table to be processed, such as the favorite song list, is queried from the sub-library corresponding to the sub-library information, and a data processing operation, such as a song collection processing operation, is performed. Further, the client 110 can upload the newly added data in the database corresponding to the music player application to the server 120.
[0064] In other example embodiments, an ORM-based database is provided on the server 120, and the database corresponds to the music playing application on the client 110. The music playing application is configured with a database information class file, and the database information class file is used to record the library-table correspondence between the sub-library of the database and the data table in the corresponding sub-library. When a data processing operation is performed on the music playing application on the client 110, such as adding the currently playing music to the favorite playlist, the server 120 determines the identification information of the data table to be processed corresponding to the data processing operation, such as the identification information of the favorite playlist, in response to the data processing operation on the music playing application; determines the sub-library information corresponding to the data table to be processed based on the identification information of the data table to be processed and the library-table correspondence; queries the data table to be processed, such as the favorite playlist, from the sub-library corresponding to the sub-library information, and executes data processing operations, such as song collection processing operations.
[0065] It should be noted that although the target application is a music playback application as an example, a person skilled in the art should understand that the target application of the embodiment of the present disclosure may also be other appropriate applications such as video applications, information applications or shopping applications, which are also within the scope of protection of the present disclosure.
[0066] It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principle of the present disclosure, and the embodiments of the present disclosure are not limited in this respect. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.
[0067] Exemplary Methods
[0068] In combination with the above application scenarios, refer to Figure 2 The data processing method according to the exemplary embodiment of the present disclosure is described. The data processing method can be applied to Figure 1 The ORM database set on the client 110 or server 120 corresponds to the target application on the client 110. Figure 2 An exemplary embodiment of the present invention is described in detail.
[0069] Reference Figure 2 As shown, in step S210, in response to a data processing operation on a target application, identification information of a to-be-processed data table corresponding to the data processing operation is determined.
[0070] In the example embodiment, under the ORM framework, a class object corresponds to a data table in the database, each instance of the class object corresponds to a record in the data table, and each attribute of the class corresponds to a field in the data table. Through the ORM framework, the table in the database can be operated like an object. On the client 110, a data processing operation is performed on the object on the target application, and the identification information of the data table to be processed corresponding to the data processing operation is determined.
[0071] For example, assuming that the target application is a music playing application, and the object on the music playing application is the currently playing music, when the currently playing music of the music playing application is added to the favorite playlist on the client 110, the client 110 responds to the collection processing operation on the currently playing music of the music playing application, and determines the identification information of the favorite playlist corresponding to the collection processing operation.
[0072] It should be noted that although the target application is a music playback application as an example, a person skilled in the art should understand that the target application of the embodiment of the present disclosure may also be other appropriate applications such as video applications, information applications or shopping applications, which are also within the scope of protection of the present disclosure.
[0073] In step S220, based on the identification information of the data table to be processed and the library-table correspondence, the sub-library information corresponding to the data table to be processed is determined.
[0074] In an exemplary embodiment, the database corresponding to the target application includes multiple sub-libraries, each of which stores a data table. The target application is configured with a database information class file, which is used to record the library-table correspondence between the sub-libraries of the database and the data tables in the corresponding sub-libraries. The library-table correspondence can be a MAP data structure, which is a set of key-value pairs. For example, the key is the identification information of the table, and the value is the sub-library information of the table. There are three sub-libraries and 6 data tables. The library-table correspondence can be {(table1, sub-library 1), (table2, sub-library 1), (table3, sub-library 2), (table4, sub-library 2), (table5, sub-library 3), (table6, sub-library 3)}. Based on the identification information of the data table to be processed, the sub-library information corresponding to the data table to be processed is searched from the library-table correspondence of the MAP data structure.
[0075] For example, suppose the target application is a music player application, and the data table to be processed is a favorite playlist table. Perform a hash operation on the identification information of the favorite playlist table to obtain the corresponding hash value. According to the hash value of the identification information of the favorite playlist table, the corresponding sub-library information is searched from the library-table correspondence relationship.
[0076] It should be noted that although the data structure of the library-table correspondence relationship is taken as the MAP data structure as an example, those skilled in the art should understand that the data structure of the library-table correspondence relationship can also be other appropriate data structures such as a hash table data structure or a set data structure, which is also within the scope of protection of the present disclosure.
[0077] In some example embodiments, determining the sub-library information corresponding to the data table to be processed includes: determining the sub-library configuration information corresponding to the data table to be processed, the sub-library configuration information including one or more of the sub-library name, sub-library version, and corresponding operation type information.
[0078] In step S230, the data table to be processed is queried from the sub-library corresponding to the sub-library information, and a data processing operation is performed.
[0079] In the example embodiment, after obtaining the sub-library information, the data table to be processed is queried from the sub-library corresponding to the sub-library information, and a data processing operation is performed on the queried data table to be processed. For example, assuming that the target application is a music playing application, the data table to be processed is a favorite song list table, and the data processing operation is a favorite processing operation, the corresponding sub-library is determined according to the sub-library information, and the favorite song list table is queried from the corresponding sub-library according to the identification information of the favorite song list table, and a data adding operation of adding the currently playing music to the favorite song list table is performed, that is, a record is added to the favorite song list table.
[0080] It should be noted that although the data addition operation is used as an example for explanation, those skilled in the art should understand that the data processing operation can also be other appropriate processing operations, such as data deletion operations, data query operations or data modification operations, which are also within the scope of protection of the present disclosure.
[0081] In some example embodiments, the sub-library configuration information includes a sub-library name and a sub-library version, and querying the data table to be processed from the sub-library corresponding to the sub-library information includes: determining the corresponding sub-library according to the sub-library name and the sub-library version in the sub-library configuration information; and querying the data table to be processed from the corresponding sub-library.
[0082] according to Figure 2 The technical solution in the example embodiment, on the one hand, adopts a database based on the ORM framework, can establish a mapping relationship between the object model and the relational model, so that data processing operations can be efficiently performed on the relational database through the mapping relationship; on the other hand, a library-table correspondence between the sub-libraries of the database and the data tables in the corresponding sub-libraries is established, and data processing operations are performed on the relational database through the library-table correspondence, and the ORM database can be processed by sub-libraries, thereby improving the concurrent processing performance of the ORM database and avoiding the problem of reduced database processing performance due to large data volume.
[0083] In addition, in the example embodiment, the database information class file also records: the table-to-address correspondence between the identification information of the data table to be processed and the URI corresponding to the data table to be processed, and queries the data table to be processed from the sub-library corresponding to the sub-library information, including: based on the identification information of the data table to be processed, determining the URI of the data table to be processed from the table-to-address correspondence; based on the URI of the data table to be processed, querying the data table to be processed from the sub-library corresponding to the sub-library information.
[0084] Furthermore, in some example embodiments, the database information class file also records: a table-class correspondence relationship between identification information of the data table to be processed and the class file of the data table to be processed, and performs data processing operations, including: determining the class file of the data table to be processed from the table-class correspondence relationship based on the identification information of the data table to be processed; and performing the data processing operation on the queried data table to be processed based on the class file.
[0085] By recording the correspondence between the data table and the URI of the data table and the correspondence between the data table and the corresponding table structure information in the database information class file, the data processing operation is performed according to the above correspondence during the data processing operation, which not only improves the data processing efficiency, but also does not need to annotate the URI or table structure information of the data table in the database operation interface. In addition, since the application program interface call of the database operation can be simplified and parameter transmission through the application program interface call is avoided, the data processing efficiency is further improved.
[0086] Figure 3 The flowchart of the data processing method according to some other embodiments of the present disclosure is schematically shown.
[0087] In step S310, when initializing the target application, the database information class file is loaded.
[0088] In an example embodiment, when the target application is started, a database information class file is loaded from the file directory path of the target application. The database information class file is used to record the library-table correspondence between the sub-libraries of the database and the data tables in the corresponding sub-libraries.
[0089] For example, assuming that the target application is a music player application, when the music player application is started on the client 110, the code of the database information class file is loaded from the file directory path of the music player application.
[0090] In step S320, the library table correspondence relationship is read from the database information class file.
[0091] In an example embodiment, after loading the database information class file from the file directory path of the target application, the library-table correspondence is read from the database information class file. The library-table correspondence may be a MAP data structure. The MAP data structure is a collection of key-value pairs. For example, the key is the identification information of the table, and the value is the sub-library information of the table. The library-table correspondence is read from the MAP structure.
[0092] In step S330, the library table correspondence is stored in the memory corresponding to the target application.
[0093] In an example embodiment, the client 110 allocates a memory block for each running application, and stores the read library table correspondence relationship in the memory corresponding to the target application. Assume that the target application is a music playing application, the library table correspondence relationship is a MAP data structure, and the library table correspondence relationship of the MAP data structure is stored in the memory corresponding to the music playing application.
[0094] In step S340, in response to the data processing operation on the target application, identification information of the to-be-processed data table corresponding to the data processing operation is determined.
[0095] In the exemplary embodiment, the implementation process and effect of step S340 are substantially the same as those of step S210, and will not be described in detail herein.
[0096] In step S350, based on the identification information of the data table to be processed and the library-table correspondence, the sub-library information corresponding to the data table to be processed is determined.
[0097] In an example embodiment, the library-table correspondence is read from the memory corresponding to the target application; based on the identification information of the data table to be processed, the sub-library information corresponding to the data table to be processed is determined from the read library-table correspondence. For example, the library-table correspondence is assumed to be a MAP data structure, the data table to be processed is a favorite song list table, a hash operation is performed on the identification information of the favorite song list table, the hash operation value is used as the key KEY of the MAP data structure, and the sub-library information corresponding to the favorite song list table is determined from the MAP data structure through the KEY.
[0098] In step S360, the data table to be processed is queried from the sub-library corresponding to the sub-library information, and the data processing operation is performed.
[0099] In the exemplary embodiment, the implementation process and effect of step S360 are the same as those of step S230, and are not described in detail herein.
[0100] according to Figure 3According to the technical solution in the example embodiment, on the one hand, the library-table mapping relationship is stored in the memory, and the sub-library information corresponding to the data table is determined according to the library-table correspondence relationship. Since the access time of the memory is short, the sub-library information of the data table can be efficiently obtained; on the other hand, the application program interface call of the database operation can be simplified to avoid passing parameters through the application program interface call, thereby further improving the data processing efficiency; on the other hand, data processing operations are performed on the relational database through the library-table correspondence relationship. Since the ORM database can be sub-library, the concurrent processing performance of the ORM database can be improved, thereby avoiding the problem of reduced database processing performance due to large data volume.
[0101] Figure 4 The structural diagram of a data processing device according to some embodiments of the present disclosure is schematically shown.
[0102] Reference Figure 4 As shown, the data processing device includes a database table management class 410, namely DBHelper, a database information class 420, namely DBInfo, and a database configuration class 430, namely DBConfig, wherein the database table management class 410, namely DBHelper, is used to batch process the table information in the sub-library when the sub-library of the database is created or upgraded, and each database table management class corresponds to a sub-library; the database information class 420, namely DBInfo: is used to record the corresponding relationship between the sub-library of the database and the data table in the sub-library, maintain the mapping relationship between the sub-library and the data table in the sub-library, and according to the database information class DBInfo, it is convenient to dynamically query the sub-library information corresponding to the data table during CRUD (i.e., add (Create), query (Retrieve), update (Update) and delete (Delete)) operations. The database configuration class 430, namely DBConfig: is used to maintain the information of each sub-library in the database, including the sub-library version, name and CRUD data operation management class, database name, etc.
[0103] according to Figure 4 The technical solution in the example embodiment, on the one hand, establishes a library-table correspondence between a database sub-library and a data table in the corresponding sub-library, and performs data processing operations on the relational database through the library-table correspondence, which can simplify the application program interface calls of database operations, avoid passing parameters through application program interface calls, improve data processing efficiency, and reduce the intrusiveness of database sub-libraries on the business; on the other hand, since the ORM database can be sub-library, the concurrent processing performance of the ORM database can be improved, avoiding the problem of reduced database processing performance due to large data volume; on the other hand, since the top-level call does not need to know which table is in which library, the need to manually remember to distinguish the relationship between sub-libraries and tables during database operations is avoided.
[0104] Figure 5 The flowchart of adding a new data table according to some embodiments of the present disclosure is schematically shown.
[0105] Reference Figure 5 As shown, in step S510, the database table correspondence between the identification information of the newly added data table and the identification information of the corresponding sub-library is recorded in the database information class file.
[0106] In an exemplary embodiment, in response to a table addition operation on a target sub-library in a database, a library-table correspondence relationship between identification information of the newly added data table and identification information of the target sub-library is recorded in a database information class file. For example, assuming that the target application is a music playing application, the database includes an original table sub-library and a newly added table sub-library, and when a new song list is created on the music playing application on the client 110, the client 110 records the library-table correspondence relationship between identification information of the newly added song list table and identification information of the newly added table sub-library in a database information class file in response to a table addition operation on the newly added table sub-library in the database.
[0107] Furthermore, the correspondence between the identification information of the newly added data table and the identification information of the target sub-library is recorded in the database information class file, including: recording the correspondence between the identification information of the target sub-library, the identification information of the newly added data table and the URI corresponding to the newly added data table in the database information class file; and / or recording the correspondence between the identification information of the target sub-library, the identification information of the newly added data table and the class file corresponding to the newly added data table in the database information class file.
[0108] Reference Figure 6 As shown, the database information class includes the table-class correspondence class TableClassInfo and the table-address correspondence class TableURIInfo, wherein TableURIInfo is used to record the correspondence between the identification information of the target sub-library, the identification information of the newly added data table, and the URI corresponding to the newly added data table, and TableClassInfo is used to record the correspondence between the identification information of the target sub-library, the identification information of the newly added data table, and the class file corresponding to the newly added data table. The establishment of these two correspondences or mapping relationship sets is to enable more efficient query of table information during database CRUD operations.
[0109] By recording the correspondence between data tables and their URIs and the correspondence between data tables and their corresponding table structure information in database information class files, data processing operations are performed according to the above correspondences, which not only improves data processing efficiency but also eliminates the need to annotate the data table's URI or table structure information in the database operation interface.
[0110] In step S520, the information of the newly added data table is added to the class file of the sub-library management class.
[0111] In the example embodiment, each sub-library corresponds to a sub-library management class, and the information of the newly added data table is added to the class file of the sub-library management class corresponding to the target sub-library. The sub-library management class is used to create the newly added data table in the target sub-library.
[0112] In step S530, the database is upgraded through the sub-library table management class.
[0113] In an exemplary embodiment, each of the sub-libraries corresponds to a sub-library table management class, and the sub-library table management class is used to handle the creation of data tables and database upgrades of the database sub-libraries. If a version upgrade operation is performed on the first sub-library in the database, then in response to a data migration operation of migrating the source data table in the first sub-library of the database to the second sub-library, the first sub-library table management class corresponding to the first sub-library and the second sub-library table management class corresponding to the second sub-library are determined. For example, assuming that the target application is a music playback application, the corresponding database includes: an original table sub-library and a newly added table sub-library, the first sub-library is the original table sub-library, and the second sub-library is the newly added table sub-library. When the database is version upgraded, in response to a data migration operation of migrating the source data table in the first sub-library of the database to the second sub-library, the first sub-library table management class corresponding to the first sub-library and the second sub-library table management class corresponding to the second sub-library are determined.
[0114] Further, in the example embodiment, a target data table corresponding to the source data table is created in the second sub-library through the second sub-library table management class; the data of the source data table is migrated from the first sub-library to the target data table of the second sub-library; and the source data table in the first sub-library is deleted through the first sub-library table management class. The following code shows the methods for creating and deleting tables in the sub-library table management class, namely the createAllTables method and the dropAllTables method. These two methods are used to be called when processing the upgrade and downgrade of the database sub-library, and are used to create data tables in the sub-library or delete data tables in the sub-library.
[0115]
[0116] according to Figure 5 In the technical solution of the example implementation example, on the one hand, by establishing a correspondence between a database sub-library and a library-table of a newly added data table, data processing operations are performed on the relational database through the library-table correspondence, which can simplify the application program interface calls of database operations and avoid passing parameters through application program interface calls; on the other hand, since the top-level call does not need to know which table is in which library, the need to manually remember and distinguish the relationship between the sub-libraries and tables during database operations is avoided.
[0117] Exemplary Media
[0118] After introducing the method of the exemplary embodiment of the present disclosure, next, the medium of the exemplary embodiment of the present disclosure will be described.
[0119] In some possible embodiments, various aspects of the present disclosure may also be implemented as a medium on which program code is stored, which, when executed by a processor of a device, is used to implement the steps of the data processing method according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.
[0120] In some possible embodiments, the processor of the device is used to implement the following steps when executing the program code: step S210, in response to the data processing operation on the target application, determine the identification information of the data table to be processed corresponding to the data processing operation; step S220, based on the identification information of the data table to be processed and the correspondence between the library table and the library table, determine the sub-library information corresponding to the data table to be processed; step S230, query the data table to be processed from the sub-library corresponding to the sub-library information, and execute the data processing operation.
[0121] refer to Figure 7 As shown, a program product 700 for implementing the above data processing method according to an embodiment of the present disclosure is described, which can adopt a portable compact disk read-only memory and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto.
[0122] It should be noted that the above-mentioned medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical fiber, a portable compact disk read-only memory, an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0123] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to: electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0124] The program code contained on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, radio frequency signals, etc., or any suitable combination of the foregoing.
[0125] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user computing device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network or a wide area network, or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0126] Exemplary Devices
[0127] After introducing the medium of the exemplary embodiment of the present disclosure, next, reference is made to Figure 8 A data processing device according to an exemplary embodiment of the present disclosure is described.
[0128] Figure 8 The structural diagram of a data processing device according to some embodiments of the present disclosure is schematically shown.
[0129] Reference Figure 8 As shown, a data processing device 800 is applied to a database based on object-relational mapping (ORM), wherein the database corresponds to a target application on a terminal device, wherein the target application is configured with a database information class file, wherein the database information class file is used to record the library-table correspondence between the sub-library of the database and the data table in the corresponding sub-library. The device 800 includes: a table determination module 810, which is used to determine, in response to a data processing operation on the target application, identification information of a data table to be processed corresponding to the data processing operation; a sub-library determination module 820, which is used to determine, based on the identification information of the data table to be processed and the library-table correspondence, the sub-library information corresponding to the data table to be processed; and a data processing module 830, which is used to query the data table to be processed from the sub-library corresponding to the sub-library information and execute the data processing operation.
[0130] In some example embodiments, the device 800 also includes: a loading module, used to load the database information class file when initializing the target application; a relationship extraction module, used to read the library table correspondence relationship from the database information class file; and a relationship storage module, used to store the library table correspondence relationship in the memory corresponding to the target application.
[0131] In some example embodiments, the sub-library determination module 820 includes: a relationship acquisition module, used to read the library-table correspondence relationship from the memory corresponding to the target application; and a sub-library determination unit, used to determine the sub-library information corresponding to the data table to be processed from the read library-table correspondence relationship based on the identification information of the data table to be processed.
[0132] In some example embodiments, the device 800 also includes: a relationship recording module, which is used to record the library-table correspondence between the identification information of the newly added data table and the identification information of the target sub-library in the database information class file in response to the operation of adding a new table to the target sub-library in the database.
[0133] In some example embodiments, the relationship recording module is also used to: record in the database information class file the correspondence between the identification information of the target sub-library, the identification information of the newly added data table, and the universal resource identifier URI corresponding to the newly added data table; and / or record in the database information class file the correspondence between the identification information of the target sub-library, the identification information of the newly added data table, and the class file corresponding to the newly added data table.
[0134] In some example embodiments, each of the sub-library corresponds to a sub-library management class, and the device 800 further includes: an information adding module, used to add information of the newly added data table to the class file of the sub-library management class corresponding to the target sub-library; and a table creating module, used to create the newly added data table in the target sub-library based on the sub-library management class.
[0135] In some example embodiments, the database information class file also records: the table-to-address correspondence between the identification information of the data table to be processed and the URI corresponding to the data table to be processed, and the data processing module 830 is also used to: determine the URI of the data table to be processed from the table-to-address correspondence based on the identification information of the data table to be processed; and query the data table to be processed from the sub-library corresponding to the sub-library information based on the URI of the data table to be processed.
[0136] In some example embodiments, the database information class file also records: the table-class correspondence between the identification information of the data table to be processed and the class file of the data table to be processed, and the data processing module 830 is also used to: determine the class file of the data table to be processed from the table-class correspondence based on the identification information of the data table to be processed; and perform the data processing operation on the queried data table to be processed based on the class file.
[0137] In some example embodiments, each of the sub-library corresponds to a sub-library table management class, and the device 800 further includes: a migration response module, used to determine a first sub-library table management class corresponding to the first sub-library and a second sub-library table management class corresponding to the second sub-library in response to a data migration operation of migrating a source data table in a first sub-library of the database to a second sub-library; a target table creation module, used to create a target data table corresponding to the source data table in the second sub-library through the second sub-library table management class; a migration module, used to migrate the data of the source data table from the first sub-library to the target data table of the second sub-library; and a table deletion module, used to delete the source data table in the first sub-library through the first sub-library management class.
[0138] In some example embodiments, the sub-library determination module 820 includes: determining sub-library configuration information corresponding to the data table to be processed, wherein the sub-library configuration information includes one or more of a sub-library name, a sub-library version, and corresponding operation type information.
[0139] In some example embodiments, the sub-library configuration information includes a sub-library name and a sub-library version, and the data processing module 830 is further used to: determine the corresponding sub-library according to the sub-library name and the sub-library version in the sub-library configuration information; and query the data table to be processed from the corresponding sub-library.
[0140] because Figure 8 The various functional modules of the data processing device of the example embodiment correspond to the steps of the example embodiment of the above-mentioned data processing method. Therefore, for details not disclosed in the embodiment of the device of the present disclosure, please refer to the embodiment of the data processing method of the present disclosure.
[0141] Exemplary Computing Devices
[0142] After introducing the method, medium, and apparatus of the exemplary embodiment of the present disclosure, next, a computing device according to another exemplary embodiment of the present disclosure is introduced.
[0143] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0144] In some possible embodiments, a computing device according to an embodiment of the present disclosure may include at least one processor and at least one memory. The memory stores program code, and when the program code is executed by the processor, the processor executes the steps of the data processing method according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processor may execute the following steps: Figure 2 The steps shown in: step S210, in response to the data processing operation on the target application, determine the identification information of the data table to be processed corresponding to the data processing operation; step S220, based on the identification information of the data table to be processed and the library-table correspondence, determine the sub-library information corresponding to the data table to be processed; step S230, query the data table to be processed from the sub-library corresponding to the sub-library information, and perform the data processing operation. For another example, the processor may also perform the following Figure 3 Follow the steps shown in .
[0145] Refer to the following Fig. 9 An electronic device 900 according to an example embodiment of the present disclosure is described. Fig. 9 The electronic device 900 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0146] like Fig. 9 As shown, the electronic device 900 is in the form of a general computing device. The components of the electronic device 900 may include but are not limited to: at least one processing unit 910, at least one storage unit 920, and a bus 930 connecting different system components (including the storage unit 920 and the processing unit 910).
[0147] The bus 930 includes a data bus, an address bus, and a control bus.
[0148] The storage unit 920 may include a readable medium in the form of a volatile memory, such as a RAM (Random Access Memory) 921 and / or a cache memory 922 , and may further include a ROM (Read-Only Memory) 923 .
[0149] The storage unit 920 may also include a program / utility 925 having a set (at least one) of program modules 924, such program modules 924 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0150] The electronic device 900 may also communicate with one or more external devices 940 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), and such communication may be performed via an input / output (I / O) interface 950. Furthermore, the electronic device 900 may also communicate with one or more networks (e.g., local area networks, wide area networks, and / or public networks, such as the Internet) via a network adapter 960. As shown, the network adapter 960 communicates with other modules of the electronic device 900 via a bus 930. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID (Redundant Arrays of Independent Disks, independent redundant disk array) systems, tape drives, and data backup storage systems, etc.
[0151] It should be noted that although several units or subunits of the data processing device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to an embodiment of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0152] In addition, although the operations of the disclosed method are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0153] Although the spirit and principle of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present disclosure is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims.
Claims
1. A data processing method, characterized in that: Applied to a database based on object-relational mapping (ORM), the database corresponds to a target application on a terminal device, the target application is configured with a database information class file, the database information class file is used to record the library-table correspondence between the sub-library of the database and the data table in the corresponding sub-library, the method includes: In response to a data processing operation on the target application, determining identification information of a to-be-processed data table corresponding to the data processing operation; When initializing the target application, loading the database information class file; reading the library table correspondence relationship from the database information class file; storing the library table correspondence relationship in the memory corresponding to the target application; Reading the library-table correspondence relationship from the memory corresponding to the target application; determining the sub-library information corresponding to the data table to be processed from the read library-table correspondence relationship based on the identification information of the data table to be processed; The to-be-processed data table is queried from the sub-library corresponding to the sub-library information, and the data processing operation is performed.
2. The method according to claim 1, characterized in that: The method further comprises: In response to the operation of adding a new table to the target sub-library in the database, the database information class file records the library-table correspondence between the identification information of the newly added data table and the identification information of the target sub-library.
3. The method according to claim 2, characterized in that The database table correspondence between the identification information of the newly added data table and the identification information of the target sub-database recorded in the database information class file includes: Recording the corresponding relationship among the identification information of the target sub-database, the identification information of the newly added data table, and the universal resource identifier URI corresponding to the newly added data table in the database information class file; and / or The database information class file records the corresponding relationship among the identification information of the target sub-database, the identification information of the newly added data table, and the class file corresponding to the newly added data table.
4. The method according to claim 2, characterized in that: Each of the sub-libraries corresponds to a sub-library management class, and the method further includes: Adding information of the newly added data table to the class file of the sub-library management class corresponding to the target sub-library; The newly added data table is created in the target sub-library based on the sub-library management class.
5. The method according to claim 1, characterized in that The database information class file also records: the table-address correspondence between the identification information of the data table to be processed and the URI corresponding to the data table to be processed, and the querying of the data table to be processed from the sub-library corresponding to the sub-library information includes: Based on the identification information of the data table to be processed, determining the URI of the data table to be processed from the correspondence between the table and the address; Based on the URI of the data table to be processed, the data table to be processed is queried from the sub-library corresponding to the sub-library information.
6. The method according to claim 1, characterized in that The database information class file also records: the table-class correspondence between the identification information of the data table to be processed and the class file of the data table to be processed, and the execution of the data processing operation includes: Based on the identification information of the data table to be processed, determining the class file of the data table to be processed from the correspondence between the table and the class; The data processing operation is performed on the queried data table to be processed based on the class file.
7. The method according to claim 1, characterized in that Each of the sub-libraries corresponds to a sub-library table management class, and the method further includes: In response to a data migration operation of migrating a source data table in a first sub-library of the database to a second sub-library, determining a first sub-library table management class corresponding to the first sub-library and a second sub-library table management class corresponding to the second sub-library; Creating a target data table corresponding to the source data table in the second sub-database by using the second sub-database table management class; Migrating the data of the source data table from the first sub-database to the target data table of the second sub-database; The source data table in the first sub-library is deleted through the first sub-library management class.
8. The method according to any one of claims 1 to 7, characterized in that The determining of the sub-library information corresponding to the to-be-processed data table includes: Determine the sub-library configuration information corresponding to the data table to be processed, wherein the sub-library configuration information includes one or more of a sub-library name, a sub-library version, and corresponding operation type information.
9. The method according to claim 8, characterized in that The sub-library configuration information includes a sub-library name and a sub-library version, and querying the to-be-processed data table from the sub-library corresponding to the sub-library information includes: Determine the corresponding sub-library according to the sub-library name and the sub-library version in the sub-library configuration information; The to-be-processed data table is queried from the corresponding sub-database.
10. A data processing device, characterized in that: Applied to a database based on object-relational mapping (ORM), the database corresponds to a target application on a terminal device, the target application is configured with a database information class file, the database information class file is used to record the corresponding relationship between the sub-library of the database and the data table in the corresponding sub-library, the device comprises: A table determination module, configured to determine, in response to a data processing operation on the target application, identification information of a to-be-processed data table corresponding to the data processing operation; A loading module, used to load the database information class file when initializing the target application; a relationship extraction module, used to read the library table correspondence relationship from the database information class file; a relationship storage module, used to store the library table correspondence relationship in the memory corresponding to the target application; A sub-library determination module, used to determine the sub-library information corresponding to the data table to be processed based on the identification information of the data table to be processed and the library-table correspondence relationship; including: a relationship acquisition module, used to read the library-table correspondence relationship from the memory corresponding to the target application; a sub-library determination unit, used to determine the sub-library information corresponding to the data table to be processed from the read library-table correspondence relationship based on the identification information of the data table to be processed; The data processing module is used to query the to-be-processed data table from the sub-library corresponding to the sub-library information and execute the data processing operation.
11. The device according to claim 10, characterized in that The device also includes: The relationship recording module is used to record the library-table correspondence between the identification information of the newly added data table and the identification information of the target sub-library in the database information class file in response to the operation of adding a new table to the target sub-library in the database.
12. The device according to claim 11, characterized in that The relationship recording module is also used for: Recording the corresponding relationship among the identification information of the target sub-database, the identification information of the newly added data table, and the universal resource identifier URI corresponding to the newly added data table in the database information class file; and / or The database information class file records the corresponding relationship among the identification information of the target sub-database, the identification information of the newly added data table, and the class file corresponding to the newly added data table.
13. The device according to claim 11, characterized in that Each of the sub-libraries corresponds to a sub-library management class, and the device further includes: An information adding module, used for adding the information of the newly added data table to the class file of the sub-library management class corresponding to the target sub-library; A table creation module is used to create the newly added data table in the target sub-library based on the sub-library management class.
14. The device according to claim 10, characterized in that The database information file also records: the table-address correspondence between the identification information of the data table to be processed and the URI corresponding to the data table to be processed, and the data processing module is also used for: Based on the identification information of the data table to be processed, determining the URI of the data table to be processed from the correspondence between the table and the address; Based on the URI of the data table to be processed, the data table to be processed is queried from the sub-library corresponding to the sub-library information.
15. The device according to claim 10, characterized in that The database information class file also records: the table-class correspondence between the identification information of the data table to be processed and the class file of the data table to be processed, and the data processing module is also used for: Based on the identification information of the data table to be processed, determining the class file of the data table to be processed from the correspondence between the table and the class; The data processing operation is performed on the queried data table to be processed based on the class file.
16. The device according to claim 10, characterized in that Each of the sub-libraries corresponds to a sub-library table management class, and the device further includes: A migration response module, configured to determine a first sub-library table management class corresponding to the first sub-library and a second sub-library table management class corresponding to the second sub-library in response to a data migration operation of migrating a source data table in a first sub-library of the database to a second sub-library; A target table creation module, used to create a target data table corresponding to the source data table in the second sub-database through the second sub-database table management class; A migration module, used for migrating the data of the source data table from the first sub-database to the target data table of the second sub-database; A table deletion module is used to delete the source data table in the first sub-library through the first sub-library management class.
17. The device according to any one of claims 10 to 16, characterized in that The sub-library determination module includes: Determine the sub-library configuration information corresponding to the data table to be processed, wherein the sub-library configuration information includes one or more of a sub-library name, a sub-library version, and corresponding operation type information.
18. The device according to claim 17, characterized in that The sub-library configuration information includes the sub-library name and sub-library version. The data processing module is also used to: Determine the corresponding sub-library according to the sub-library name and the sub-library version in the sub-library configuration information; The to-be-processed data table is queried from the corresponding sub-database.
19. A computing device comprising: A processor and a memory, wherein the memory stores executable instructions, and the processor is used to call the executable instructions stored in the memory to execute the method according to any one of claims 1 to 9.
20. A medium having a program stored thereon, wherein the program implements the method according to any one of claims 1 to 9 when executed by a processor.
Citation Information
Patent Citations
Data processing method and apparatus, terminal and computer-readable storage medium
CN107463693A
Database partitioning and table partitioning method and device, medium and computer equipment
CN111339088A