Access method for database intermediate table and computer program product

By constructing intermediate table access statement templates and interfaces, the access process of database intermediate tables is simplified, the problem of repeated encoding in existing ORM technologies is solved, and the development efficiency and access efficiency are improved.

CN119025561AInactive Publication Date: 2024-11-26XIANGYANG QIUJI WIN SOFTWARE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411046271.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-11-26
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing ORM technology fails to effectively utilize the unique structure of intermediate tables, resulting in users needing to create entity classes and write access codes for each intermediate table, resulting in a large number of repeated coding work, affecting development efficiency.

Method used

Provides an access method for database intermediate tables. By constructing intermediate table access statement templates and interfaces, the access process of intermediate tables is simplified. Users only need to provide entity names to generate intermediate table access statements and execute them, realizing multiple pairs of intermediate tables. Multi-relationship management.

Benefits of technology

It realizes rapid and efficient access and management of intermediate tables, simplifies the construction and calling code of intermediate table access function, saves time and human resources, and improves development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025561A_ABST
    Figure CN119025561A_ABST
Patent Text Reader

Abstract

The invention discloses an access method for a database intermediate table and a computer program product, and relates to the technical field of data table access, firstly, according to a first entity name and a second entity name provided by a user, a group of intermediate table access statement templates are constructed, and each intermediate table access statement template is constructed into a group of intermediate table access statement templates; the basic function is used for constructing an intermediate table access interface; determining a corresponding intermediate table access statement template based on the basic function of the called intermediate table access interface, and constructing an intermediate table access statement according to the calling parameter and executing the intermediate table access statement; different basic functions are called to realize addition, deletion and query operations on the intermediate table; according to the method, the intermediate table access interface containing all basic functions for operating the intermediate table can be realized, the construction and calling codes for realizing the intermediate table access function are simplified, and the consumption of time and human resources is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data table access, and in particular to a method for accessing an intermediate table of a database and a computer program product. Background Art

[0002] ORM (Object Relational Mapping) technology is a programming technology used to implement data conversion between different types of systems in object-oriented programming languages. It automatically persists objects in the program to a relational database by using metadata that describes the mapping between objects and databases, and acts as a bridge between the business logic layer and the database layer. ORM technology solves the mismatch between object-oriented and relational databases, allowing software developers to focus on business logic processing and improve development efficiency.

[0003] A many-to-many relationship is one of the many relationships between two entities defined in an Entity Relationship Diagram (ER diagram). When dealing with many-to-many relationships between entities, an intermediate table needs to be introduced. The intermediate table usually includes two foreign keys as joint primary keys, and these two foreign keys point to the primary keys of the entity tables corresponding to the two entities. Existing ORM technology does not take advantage of the unique structure of the intermediate table, and designs a set of data structures and interfaces for it separately, which results in users having to create a corresponding entity class for each intermediate table and write corresponding intermediate table access code for management, which involves a lot of repetitive coding work. Therefore, in order to further improve development efficiency, a method for quickly and efficiently accessing database intermediate tables is urgently needed. Summary of the invention

[0004] The purpose of this application is to provide a method and a computer program product for accessing an intermediate table of a database, which can quickly and efficiently implement access to the intermediate table for different needs.

[0005] To achieve the above objectives, this application provides the following solutions:

[0006] In a first aspect, the present application provides a method for accessing an intermediate table of a database, comprising the following steps:

[0007] A set of intermediate table access statement templates are constructed based on the first entity name and the second entity name provided by the user; there is a many-to-many relationship between the data table corresponding to the first entity name and the data table corresponding to the second entity name; each of the intermediate table access statement templates is used to construct a basic function of the intermediate table access interface; the intermediate table access interface is used to be called by the user to construct and execute an intermediate table access statement; the intermediate table is used to handle the many-to-many relationship between the data table corresponding to the first entity name and the data table corresponding to the second entity name.

[0008] According to the basic functions and calling parameters of the called intermediate table access interface, an intermediate table access statement is constructed and executed to complete the access to the intermediate table.

[0009] Optionally, constructing a set of intermediate table access statement templates according to the first entity name and the second entity name provided by the user specifically includes the following steps:

[0010] According to the first entity name and the second entity name provided by the user, the intermediate table name is obtained according to the preset intermediate table name template. The intermediate table name template can be modified to format the intermediate table name according to the two entity names provided by the user.

[0011] According to the first entity name and the second entity name, the first foreign key name of the intermediate table and the second foreign key name of the intermediate table are obtained according to the preset foreign key name template. The foreign key name template can be modified to obtain the foreign key name according to the entity name provided by the user.

[0012] According to the intermediate table name, the first foreign key name of the intermediate table and the second foreign key name of the intermediate table, a template is constructed according to the intermediate table access statement to obtain an intermediate table access statement template.

[0013] Optionally, the intermediate table name is a character string composed of the first entity name and the second entity name arranged according to a rule of a preset intermediate table name template.

[0014] Optionally, the first foreign key name of the intermediate table is a string of the first entity name formatted according to a preset foreign key template name; the second foreign key name of the intermediate table is a string of the second entity name formatted according to a preset foreign key template name.

[0015] Optionally, according to the basic functions and calling parameters of the called intermediate table access interface, an intermediate table access statement is constructed and executed to complete the access to the intermediate table, which specifically includes the following steps:

[0016] According to the basic function of the called intermediate table access interface, a corresponding intermediate table access statement template is determined.

[0017] An intermediate table access statement is constructed according to the intermediate table access statement template and the calling parameters.

[0018] Submit the intermediate table access statement to the database for execution to complete the access to the intermediate table.

[0019] Optionally, according to the basic functions and calling parameters of the called intermediate table access interface, an intermediate table access statement is constructed and executed to complete the access to the intermediate table, which specifically includes the following steps:

[0020] According to the basic function of the called intermediate table access interface, the corresponding intermediate table access statement template is determined.

[0021] According to the intermediate table access statement template and the calling parameters, an intermediate table access statement containing placeholders and a corresponding parameter list are constructed.

[0022] Submit the intermediate table access statement and the parameter list to the database for execution, thereby completing the access to the intermediate table.

[0023] In a second aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the access method for the database intermediate table as described above.

[0024] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0025] The present application provides a method and a computer program product for accessing an intermediate table of a database. First, a group of intermediate table access statement templates are constructed according to a first entity name and a second entity name provided by a user, wherein each intermediate table access statement template is used to construct a basic function of an intermediate table access interface; then, based on the basic function of the called intermediate table access interface, a corresponding intermediate table access statement template is determined, and then an intermediate table access statement is constructed and executed according to the calling parameters, so that operations of adding, deleting and inserting different requirements on the intermediate table can be realized simply and quickly; an intermediate table access interface including all basic functions of operating the intermediate table can be realized, so that the construction and calling code for realizing the intermediate table access function are simplified, time and human resources are saved, and the problems existing in the existing ORM technology are well solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0027] Figure 1 A flowchart of a method for accessing an intermediate table of a database provided in one embodiment of the present application.

[0028] Figure 2 A flowchart of step S1 in a method for accessing an intermediate table of a database provided in one embodiment of the present application.

[0029] Figure 3 A flowchart of step S2 in a method for accessing an intermediate table of a database provided in one embodiment of the present application.

[0030] Figure 4 A flowchart of step S2 in a method for accessing an intermediate table of a database is provided in another embodiment of the present application.

[0031] Figure 5 A schematic diagram of an intermediate table between data tables in a method for accessing an intermediate table of a database provided in the present application. DETAILED DESCRIPTION

[0032] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0033] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0034] In an exemplary embodiment, Figure 1 As shown, a method for accessing an intermediate table of a database is provided, and the method includes the following steps S1 to S4:

[0035] S1. Construct a set of intermediate table access statement templates based on the first entity name and the second entity name provided by the user. There is a many-to-many relationship between the data table corresponding to the first entity name and the data table corresponding to the second entity name. Each intermediate table access statement template is used to construct a basic function of the intermediate table access interface; the intermediate table access interface is used to be called by the user to construct and execute the intermediate table access statement; the intermediate table is used to handle the many-to-many relationship between the data table corresponding to the first entity name and the data table corresponding to the second entity name. Figure 2 As shown in the flowchart, in this embodiment, step S1 specifically includes the following steps:

[0036] S11. Obtain an intermediate table name according to a preset intermediate table name template based on a first entity name and a second entity name provided by a user. The intermediate table name template can be modified to obtain an intermediate table name according to the format of the two entity names provided by the user. The intermediate table name is a string composed of the first entity name and the second entity name arranged according to the rules of the preset intermediate table name template.

[0037] For example, if the preset intermediate table name template is "a_<first entity name>_and_<second entity name>", and the first entity name and the second entity name provided by the user are "user" and "role" respectively, then according to the intermediate table name template, the intermediate table name obtained is "a_user_and_role". It can be understood that the above intermediate table name template "a_<first entity name>_and_<second entity name>" is only an example. In actual use, it may be in the form of "a_%s_and_%s", where "%s" is a placeholder, which is used to fill in the first entity name and the second entity name respectively. Of course, the use of templates in other placeholder forms is not excluded.

[0038] S12. Obtain the first foreign key name and the second foreign key name of the intermediate table according to the first entity name and the second entity name, respectively, according to the preset foreign key name template. The foreign key name template can be modified to obtain the foreign key name according to the entity name provided by the user. The first foreign key name of the intermediate table is a string obtained by formatting the first entity name according to the preset foreign key name template; the second foreign key name of the intermediate table is a string obtained by formatting the second entity name according to the preset foreign key name template.

[0039] For example, if the preset foreign key name template is "<entity name>_id", and the first entity name and the second entity name provided by the user are "user" and "role" respectively, then the first foreign key name and the second foreign key name are "user_id" and "role_id" respectively, which are used as the column names of the two foreign keys in the intermediate table between the two.

[0040] S13. According to the name of the intermediate table, the name of the first foreign key of the intermediate table and the name of the second foreign key of the intermediate table, the template for constructing the intermediate table access statement is used to obtain the template for constructing the intermediate table access statement. In the field of database access, access to a data table mainly includes "add, delete, modify and query". For the special structure of the intermediate table, the "modify" can be implemented by deleting first and then adding. A possible implementation method is that the intermediate table access statement construction template includes: a first query statement construction template, a second query statement construction template, a third query statement construction template, an insert statement construction template, a first delete statement construction template, a second delete statement construction template and a third delete statement construction template; the intermediate table access statement template includes a first query statement template, a second query statement template, a third query statement template, an insert statement template, a first delete statement template, a second delete statement template and a third delete statement template.

[0041] Any of the statement construction templates in the above embodiments is used to construct a corresponding statement template. In one implementation, one of the statement construction templates consists of a string "SELECT", <intermediate table first foreign key name>, a string "FROM", <intermediate table name>, a string "WHERE", <intermediate table second foreign key name>, a string "=" and a list of parameters to be passed in. When in use, the specific intermediate table name, the intermediate table first foreign key name and the intermediate table second foreign key name are passed into the above statement construction template to obtain the corresponding statement template; in another implementation, one of the statement construction templates consists of a string "SELECT", a template "<first entity name>_id", a string "FROM", a template "a_<first entity name>_and_<second entity name>", a string "WHERE", a template "<second entity name>_id", a string "=" and a list of parameters to be passed in. When in use, the first entity name and the second entity name are directly substituted into the above statement construction template to obtain the corresponding statement template.

[0042] In this embodiment, the correspondence between each intermediate table access statement template and its usage scenario is shown in Table 1.

[0043] Table 1 Intermediate table access statement templates and their usage scenarios

[0044]

[0045] It is understandable that the names of the calling methods in Table 1 above do not have to be named in this way, and this naming method is not particularly limited in this application. In addition, the above method can be applied to the access of intermediate tables of various databases. For ease of understanding, the following takes the application of the above method to the generation of intermediate table access statements of a relational database as an example to illustrate the composition of each intermediate table access statement template:

[0046] The first query statement template is a data table access statement consisting of a string "SELECT", the first foreign key name of the intermediate table, a string "FROM", the name of the intermediate table, a string "WHERE", the second foreign key name of the intermediate table, a string "=" and a list of parameters to be passed in, such as: "SELECTuser_id FROM a_user_and_role WHERErole_id=?", where "?" is a placeholder for the list of parameters to be passed in. In this embodiment, the calling method of the first query statement template is queryK1ByK2.

[0047] The second query statement template is a data table access statement consisting of a string "SELECT", the second foreign key name of the intermediate table, a string "FROM", the intermediate table name, a string "WHERE", the first foreign key name of the intermediate table, a string "=" and a list of parameters to be passed in, such as: "SELECT role_id FROM a_user_and_role WHERE user_id=?". In this embodiment, the calling method name of the second query statement template is queryK2ByK1.

[0048] The third query statement template is a data table access statement consisting of the string "SELECT count(*)FROM", the intermediate table name, the string "WHERE(", the first foreign key name of the intermediate table, the string ",", the second foreign key name of the intermediate table and the string ")IN(%s)", where the placeholder format corresponding to "%s" is "(?,?)[,(?,?)]", [] indicates that the content can be 0 or more, depending on the number of calling parameters, and "%s" can also be replaced by an id pair string generated according to the calling parameters, such as: "SELECT count(*)FROM a_user_and_role WHERE(user_id,role_id)IN(%s)". In this embodiment, the calling method name of the third query statement template is count.

[0049] The first delete statement template is a data table access statement consisting of a string "DETELE FROM", an intermediate table name, a string "WHERE", a first foreign key name of the intermediate table, a string "=" and a list of parameters to be passed in, such as: "DETELE FROMa_user_and_roleWHERE user_id=?". In this embodiment, the calling method name of the first delete statement template is deleteK2ByK1.

[0050] The second delete statement template is a data table access statement consisting of a string "DETELE FROM", the intermediate table name, a string "WHERE", the intermediate table second foreign key name, a string "=" and a list of parameters to be passed in, such as: "DETELE FROMa_user_and_roleWHERErole_id=?". In this embodiment, the calling method name of the second delete statement template is deleteK1ByK2.

[0051] The third delete statement template is a data table access statement consisting of the string "DETELE FROM", the intermediate table name, the string "WHERE(", the first foreign key name of the intermediate table, the string ",", the second foreign key name of the intermediate table and the string ")IN(%s)", such as: "DETELE FROM a_user_and_role WHERE(user_id,role_id)IN(%s)". In this embodiment, the calling method name of the third delete statement template is dissociate.

[0052] The insert statement template is a data table access statement consisting of a string "INSERT INTO", an intermediate table name, a string "(", a first foreign key name of the intermediate table, a string ",", a second foreign key name of the intermediate table and a string ")VALUES%s", such as: "INSERT INTO a_user_and_role(user_id, role_id)VALUES%s". In this embodiment, the calling method name of the insert statement template is associate.

[0053] S2. According to the basic functions and call parameters of the called intermediate table access interface, construct and execute the intermediate table access statement to complete the access to the intermediate table. The call parameters include at least one parameter; Figure 3 In the flowchart shown, step S2 specifically includes the following steps:

[0054] S21. Determine a corresponding intermediate table access statement template according to the basic function of the called intermediate table access interface.

[0055] S22. Construct an intermediate table access statement according to the intermediate table access statement template and the calling parameters.

[0056] S23. Submit the intermediate table access statement to the database for execution, completing the access to the intermediate table.

[0057] For example, assuming that in a system developed based on a relational database, the developer needs to provide the system operators with the function of handling the many-to-many relationship between the data tables user and role, then an instance of an intermediate table access interface can be created in the system based on the first entity name "user" and the second entity name "role".

[0058] When the operator wants to delete all associated roles for the data with id 2 in the user table, the function deleteByK1 of the instance is called with parameter "2". According to the called function, the intermediate table access statement template is determined to be the first delete statement template "DETELE FROM a_user_and_role WHERE user_id=?". According to the first delete statement template and parameter "2", the intermediate table access statement "DETELE FROM a_user_and_role WHERE user_id=2" is obtained. After submitting the statement to the database for execution, all records with user_id 2 in the intermediate table a_user_and_role are deleted. That is to say, all data with id 2 in the user table and the data associated with the role table are deleted.

[0059] When the operator wants to add an association relationship between the data with id 1 in the user table and the data with id 2 and 3 in the role table, and between the data with id 2 in the user table and the data with id 3 in the role table, the function associate of the instance is called with the parameter "(1,2),(1,3),(2,3)", where (1,2) represents a set of id pairs corresponding to the data with id 1 in the user table and the data with id 2 in the role table. During implementation, a data structure containing the first entity id and the second entity id can be defined for it to facilitate the construction and transfer of parameters. According to the called function, the intermediate table access statement template is determined to be the insert statement template "INSERT INTO a_user_and_role(user_id,role_id)VALUES%s". According to the passed parameters, the intermediate table access statement "INSERT INTO a_user_and_role(user_id,role_id)VALUES(1,2),(1,3),(2,3)" is obtained. After executing the statement, the above association relationship is added.

[0060] In the implementation based on relational database, in order to prevent SQL injection problems and improve the execution performance of SQL statements, placeholders in SQL statements are usually reserved, and a parameter list corresponding to the placeholders is provided when the SQL statement is executed. Therefore, Figure 4 In the flowchart shown, another implementation step of step S2 is:

[0061] S21. Determine a corresponding intermediate table access statement template according to the basic function of the called intermediate table access interface.

[0062] S22. According to the intermediate table access statement template and the calling parameters, an intermediate table access statement containing placeholders and a corresponding parameter list are constructed.

[0063] S23. Submit the intermediate table access statement and parameter list to the database for execution, completing the access to the intermediate table.

[0064] When the operator wants to add an association relationship between the data with id 1 in the user table and the data with id 2 and 3 in the role table, and between the data with id 2 in the user table and the data with id 3 in the role table, the associate function is called with the parameter "(1,2),(1,3),(2,3)". According to the called function, the intermediate table access statement template is determined to be the insert statement template "INSERT INTO a_user_and_role(user_id,role_id)VALUES%s"; according to the calling parameters and the SQL syntax, the corresponding placeholder string is obtained as "(?,?),(?,?),(?,?)", which is substituted into the above template to obtain the corresponding access statement "INSERT INTO a_user_and_role(user_id,role_id)VALUES(?,?),(?,?),(?,?)", and the corresponding parameter list is determined to be [1,2,1,3,2,3]; finally, the access statement and parameter list are submitted to the database for execution to complete the access to the intermediate table.

[0065] Specifically, in the Java language embodiment, the variable name of the calling parameter can be defined as uniqueKeys, and its type is Set <uniquekey>, where UniqueKey is a Java class containing the first entity id and the second entity id. The code for calling the associate function is specifically: "int ret = userAndRoleAssociationService.associate(uniqueKeys)", to add multiple associations to the intermediate table. Figure 5 In the example, the access device for the intermediate table a_user_and_role between the two data tables named t_user and t_role can be constructed with only the following two lines of code:

[0066] AssociationService<Long,Integer> userAndRoleAssociationService=

[0067] new JdbcAssociationService<>("user","role"){};

[0068] userAndRoleAssociationService.setDatabaseOperations(databaseOperations)

[0069] Among them, AssociationService is the name of the intermediate table access interface, JdbcAssociationService is the name of the implementation class of the interface AssociationService, userAndRoleAssociationService is an instance of the intermediate table access interface created in the system to access the intermediate table corresponding to the first entity name user and the second entity name role, and databaseOperations is the name of the database access statement execution module.

[0070] Similarly, for Figure 5 The construction code of the access device of the intermediate table a_role_and_perm, which has two data tables named t_role and t_perm, is as follows:

[0071] AssociationService<Integer,Integer> roleAndPermAssociationService=

[0072] new JdbcAssociationService<>("role","perm"){};

[0073] roleAndPermAssociationService.setDatabaseOperations(databaseOperations)

[0074] The access method for the database intermediate table provided in this embodiment can realize an intermediate table access interface that includes all basic functions for operating the intermediate table, simplifies the construction and calling code for implementing the intermediate table access function, saves time and human resources, and well solves the problems existing in the existing ORM technology.

[0075] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0076] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0077] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by a computer program executed by a processor, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. The computer program is applicable to different programming languages. The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto.

[0078] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0079] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.< / uniquekey>

Claims

1. A method for accessing an intermediate table of a database, characterized in that: The access method for the database intermediate table includes: A set of intermediate table access statement templates is constructed based on the first entity name and the second entity name provided by the user; there is a many-to-many relationship between the data table corresponding to the first entity name and the data table corresponding to the second entity name; each of the intermediate table access statement templates is used to construct a basic function of the intermediate table access interface; the intermediate table access interface is used to be called by the user to construct and execute the intermediate table access statement; the intermediate table is used to process the many-to-many relationship between the data table corresponding to the first entity name and the data table corresponding to the second entity name; According to the basic functions and calling parameters of the called intermediate table access interface, an intermediate table access statement is constructed and executed to complete the access to the intermediate table.

2. The method for accessing a database intermediate table according to claim 1, characterized in that: The constructing a set of intermediate table access statement templates according to the first entity name and the second entity name provided by the user specifically includes: According to the first entity name and the second entity name provided by the user, an intermediate table name is obtained according to a preset intermediate table name template; the intermediate table name template can be modified to obtain the intermediate table name according to the format of the two entity names provided by the user; According to the first entity name and the second entity name, respectively, according to a preset foreign key name template, a first foreign key name of the intermediate table and a second foreign key name of the intermediate table are obtained; the foreign key name template can be modified to obtain a foreign key name according to the entity name provided by the user in a formatted manner; According to the intermediate table name, the first foreign key name of the intermediate table and the second foreign key name of the intermediate table, a template is constructed according to the intermediate table access statement to obtain an intermediate table access statement template.

3. The method for accessing a database intermediate table according to claim 2, characterized in that: The intermediate table name is a character string composed of the first entity name and the second entity name arranged according to the rules of a preset intermediate table name template.

4. The method for accessing a database intermediate table according to claim 2, characterized in that: The first foreign key name of the intermediate table is a string of the first entity name formatted according to a preset foreign key name template; the second foreign key name of the intermediate table is a string of the second entity name formatted according to a preset foreign key name template.

5. The method for accessing a database intermediate table according to claim 1, characterized in that: According to the basic functions and calling parameters of the called intermediate table access interface, construct and execute the intermediate table access statement to complete the access to the intermediate table, including: Determine the corresponding intermediate table access statement template according to the basic function of the called intermediate table access interface; Constructing an intermediate table access statement according to the intermediate table access statement template and calling parameters; Submit the intermediate table access statement to the database for execution to complete the access to the intermediate table.

6. The method for accessing a database intermediate table according to claim 1, characterized in that: According to the basic functions and calling parameters of the called intermediate table access interface, construct and execute the intermediate table access statement to complete the access to the intermediate table, including: Determine the corresponding intermediate table access statement template according to the basic function of the called intermediate table access interface; According to the intermediate table access statement template and the calling parameters, construct an intermediate table access statement containing placeholders and a corresponding parameter list; Submit the intermediate table access statement and the parameter list to the database for execution, thereby completing the access to the intermediate table.

7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for accessing a database intermediate table described in any one of claims 1 to 6 is implemented.