Query method and device based on Mybatis real-time configuration
By configuring the data interface in the Mybatis framework in real time, the problems of low data query efficiency and poor stability in the existing technology are solved, and an efficient, stable and secure data query solution is realized to adapt to enterprise data needs.
Patent Information
- Application Number
- CN202411040363.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-11-12
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing data query solutions may cause slower query, increased system response time or even system crashes when processing large data volumes. Frequent updates of code will affect system stability and there is a risk of data redundancy and privacy issues.
Using Mybatis-based real-time configuration method, the data interface configuration information is constructed according to the needs through a preset auxiliary interface, the target data interface is configured, and the target interface is provided for user call, to realize flexible data query, avoid frequent code updates and resources Waste ensures system stability and data security.
It realizes efficient and stable data query, reduces system response time, reduces data redundancy and privacy risks, adapts to business changes, and improves database performance and resource utilization.
Smart Images

Figure CN118939714A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field related to data query, and specifically to a query method and device based on Mybatis real-time configuration. Background Art
[0002] With the trend of data-driven decision-making, enterprises are increasingly dependent on data, and data departments need to provide a large amount of statistical and analytical data for various business lines within the enterprise. However, there are some problems with existing data query solutions.
[0003] There are currently two main existing technical solutions: Solution 1: The data department saves the data required by the business line in a database agreed upon by both parties, and the business line queries the data by itself according to product requirements. However, this method will affect the performance of the database when saving data, especially when the amount of data is large, which may cause slower queries, increased system response time, and even system crashes. In addition, in order to ensure the consistency and accuracy of the data, it may be necessary to perform a data quality check first, resulting in data redundancy and waste of resources. If sensitive data is involved, the risk of data query and privacy issues will also increase. Solution 2: The data department customizes and develops the corresponding data interface according to the data query requirements of the business line, and the business line obtains data by requesting the data query data interface. Compared with Solution 1, this solution makes up for some of the shortcomings, but with the development and changes of the business, it may be necessary to frequently update the code and restart the entire application or service, which seriously affects the stability of the system.
[0004] Therefore, there is an urgent need for an efficient and stable data query solution to meet the needs of enterprises. Summary of the invention
[0005] In view of this, the embodiments of the present application are committed to providing a query method and device based on Mybatis real-time configuration to achieve efficient and stable data query.
[0006] This application provides a query method based on Mybatis real-time configuration, including:
[0007] Obtain data interface configuration information; wherein the data interface configuration information is constructed by the user in a preset auxiliary interface based on a preset Mybatis framework according to his own needs, and is used to configure the target data interface;
[0008] Based on the data interface configuration information, configure the target data interface;
[0009] Provides a target interface for users to call and query data.
[0010] In some embodiments, the auxiliary interface includes: a plurality of text boxes for filling in text;
[0011] Each text box is marked with corresponding prompt information within the preset range;
[0012] The multiple text boxes are used for users to fill in or select different configuration parameter information:
[0013] The configuration parameter information includes: unique identification information, API name, data source, timeout period, SQL statement, and parameter information of the API interface.
[0014] In some embodiments, it also includes:
[0015] Testing the target data interface;
[0016] If the target data interface passes the test, the target data interface is put online, otherwise, it is prompted that the configuration of the target data interface fails.
[0017] In some embodiments, accounts are added, deleted, and managed.
[0018] In some embodiments, performing account management includes: adjusting permissions of the account;
[0019] The permissions include determining the target interface that the account can access.
[0020] In some embodiments, the database is configured with different data sources:
[0021] When you access a database through different data sources, you can access unused data in the database.
[0022] The present application also provides a query device based on Mybatis real-time configuration, including:
[0023] An acquisition module is used to acquire data interface configuration information; wherein the data interface configuration information is constructed by the user in a preset auxiliary interface based on a preset Mybatis framework according to his own needs, and is used to configure a target data interface;
[0024] A configuration module, configured to configure a target data interface based on the data interface configuration information;
[0025] Provides a module for providing a target interface for users to call to query data.
[0026] The present application also provides an electronic device, comprising:
[0027] A processor, and a memory for storing a program executable by the processor;
[0028] The processor is used to implement the above-mentioned query method based on Mybatis real-time configuration by running the program in the memory.
[0029] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the processor executes the query method based on Mybatis real-time configuration as described above.
[0030] The present application also provides a computer program product, including a computer program, which implements the above-mentioned query method based on Mybatis real-time configuration when executed by a processor.
[0031] A query method based on Mybatis real-time configuration provided by the present application obtains data interface configuration information; wherein the data interface configuration information is constructed by the user in a preset auxiliary interface based on a preset Mybatis framework according to their own needs, and is used to configure the target data interface; based on the data interface configuration information, the target data interface is configured; and the target interface is provided for the user to call and query the data. With such a setting, the user can build the data interface configuration information based on the Mybatis framework in the preset auxiliary interface according to their own needs, so as to easily integrate and expand with other systems or services to meet the needs of different businesses. In this way, the user can flexibly configure the target data interface, directly complete the launch or change operation of the data product, and adapt to the development and changes of the business. The method is configured and queried based on the Mybatis framework, and the query service executed at the bottom layer still maintains the execution efficiency of the Mybatis persistence layer framework, which is the same as the efficiency of the traditional configuration method with xml files. Without changing the source code, the user can configure and query according to his own needs, eliminating the unknown risks caused by the restart of the service update system, and ensuring the stability of the system. Providing a target interface for users to call for data query, so that users can easily obtain the required data, improving the efficiency and convenience of data query. Based on this, the present application provides an efficient and stable data query solution to meet the needs of enterprises. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] By describing the embodiments of the present application in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present application will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0033] Figure 1It is a flowchart of a query method based on Mybatis real-time configuration provided by an embodiment of the present application.
[0034] Figure 2 It is a partial flow chart of a method provided by an embodiment of the present application.
[0035] Figure 3 It is a structural diagram of a query device based on Mybatis real-time configuration provided by an embodiment of the present application.
[0036] Figure 4 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] Application Overview
[0039] With the trend of data-driven decision-making, enterprises are increasingly dependent on data, and data departments need to provide a large amount of statistical and analytical data for various business lines within the enterprise. However, there are some problems with existing data query solutions.
[0040] There are currently two main existing technical solutions: Solution 1: The data department saves the data required by the business line in a database agreed upon by both parties, and the business line queries the data by itself according to product requirements. However, this method will affect the performance of the database when saving data, especially when the amount of data is large, which may cause slower queries, increased system response time, and even system crashes. In addition, in order to ensure the consistency and accuracy of the data, it may be necessary to perform a data quality check first, resulting in data redundancy and waste of resources. If sensitive data is involved, the risk of data query and privacy issues will also increase. Solution 2: The data department customizes and develops the corresponding data interface according to the data query requirements of the business line, and the business line obtains data by requesting the data query data interface. Compared with Solution 1, this solution makes up for some of the shortcomings, but with the development and changes of the business, it may be necessary to frequently update the code and restart the entire application or service, which seriously affects the stability of the system.
[0041] Therefore, there is an urgent need for an efficient and stable data query solution to meet the needs of enterprises.
[0042] In order to solve the above problems, the present application provides a solution, a query method based on Mybatis real-time configuration, to obtain data interface configuration information; wherein, the data interface configuration information is a preset auxiliary interface for users, based on the preset Mybatis framework, and constructed according to their own needs, for configuring the target data interface; based on the data interface configuration information, the target data interface is configured; and the target interface is provided for users to call and query data. The solution has the following advantages: Real-time configuration: By configuring the data interface in real time, it can quickly respond to changes in business needs, without frequent code updates and system restarts, thereby improving the stability and flexibility of the system. Efficient query: Based on the Mybatis framework, it can give full play to its efficient data query capabilities, ensuring that it can still maintain a faster query speed in the case of large amounts of data, and reducing system response time. Data query: Strictly manage and verify data accounts to ensure that only authorized users can access data, reducing the risk of data query and privacy issues. Resource optimization: Avoids data redundancy and waste of resources, and improves database performance and resource utilization. Easy to expand: Can be easily integrated with other systems or services to meet the growing business needs of enterprises. Through the above solution, the problems existing in the existing data query solution can be effectively solved, providing enterprises with an efficient, stable and secure data query solution.
[0043] After introducing the basic principles of the present application, various non-limiting embodiments of the present application will be described in detail with reference to the accompanying drawings.
[0044] Exemplary Methods
[0045] Figure 1 1 is a flowchart of a query method based on Mybatis real-time configuration provided by an embodiment of the present application. Figure 1 As shown, the method includes the following contents.
[0046] Step S110, obtaining data interface configuration information; wherein the data interface configuration information is constructed by the user in a preset auxiliary interface based on a preset Mybatis framework according to the user's own needs, and is used to configure the target data interface;
[0047] In this step, users use the preset auxiliary interface and the preset Mybatis framework to build data interface configuration information according to their own needs. These configuration information will be used to determine the specific settings of the target data interface, such as interface parameters, data sources, query logic, etc. Users can perform corresponding operations in the auxiliary interface to meet their specific data query needs.
[0048] Step S120: configuring the target data interface based on the data interface configuration information:
[0049] Specifically, based on the data interface configuration information obtained in step S110, the system will configure the target data interface. This includes converting the configuration information into actual interface settings to ensure that the interface can perform data query and interaction as expected by the user. For example, the system may create a corresponding database connection, set query statements, configure parameters, etc. according to the configuration information.
[0050] Step S130, providing a target interface for users to call and query data.
[0051] After completing the configuration of the target data interface, the system will provide these target interfaces so that users can call them to query data. Users can send query requests to the system by calling these interfaces and get the corresponding data returned. In this way, users can easily obtain the data they need to meet business needs.
[0052] In general, these three steps implement a data query process based on Mybatis real-time configuration, allowing users to flexibly configure data interfaces according to their own needs and perform efficient data queries through these interfaces.
[0053] The auxiliary interface includes: multiple text boxes for filling in text; corresponding prompt information is marked within the preset range of each text box; wherein, the multiple text boxes are used for users to fill in or select different configuration parameter information: the configuration parameter information includes: unique identification information, API name, data source, timeout period, SQL statement, and parameter information of API interface.
[0054] Specifically, in the auxiliary interface, there are multiple text boxes, which are used for users to fill in relevant text information. Each text box has its preset range, and the corresponding prompt information is marked within the range to guide users to correctly fill in or select relevant content. These text boxes are used for users to fill in or select different configuration parameter information, including the following: Unique identification information: information used to uniquely identify relevant configurations to ensure its uniqueness. API name: users can fill in the name of the API here to facilitate identification and understanding of the functions of the API. Data source: users need to select a suitable data source from the provided options to ensure that the API can correctly connect to the required data source. Timeout: users can set the timeout for SQL execution. If the time exceeds this time, the system will actively disconnect and return an exception. SQL statement: users can fill in the SQL statement for executing data query here, and can use custom variables such as ${val}. These variables will be replaced with the real values in the parameters during execution. Parameter information of the API interface: users need to fill in the parameter information required by the API interface, such as parameter name, parameter value, whether it is required, and whether the parameter value is a list type.
[0055] Through such auxiliary interface design, users can clearly understand the function of each text box and the content that needs to be filled in, so as to fill in and select configuration parameters more accurately, improving the efficiency and accuracy of configuration.
[0056] In some embodiments, the target data interface is tested; if the target data interface passes the test, the target data interface is brought online, otherwise, a prompt indicating that the target data interface configuration has failed is displayed.
[0057] Specifically,
[0058] Test the target data interface:
[0059] In the data product module, users can enter simulation parameters to test the target data interface.
[0060] The system will perform a series of operations, including concatenating the fixed test ID number "TcDataSearchGh ostMapper.TcDataGhostValidSqlInvoke" and the SQL template into an XML format string recognized by Mybatis, and then parsing it into an XML node.
[0061] Get the KV collection information of Mybatis's MappedStatementMaps, add the parsed xml node to the collection, and use Id as the key value of the collection.
[0062] Refresh the MappedStatementMaps to the Mybatis cache.
[0063] According to the ID and the input simulation parameters, the Myabtis framework is called to execute the corresponding query statement to obtain the query results.
[0064] The returned results are rendered into a list on the page and displayed to the user to verify whether the data interface functions normally.
[0065] If the target data interface passes the test, it will be put online:
[0066] If the test results meet expectations, the user can click the operation button to launch the data product.
[0067] The system will generate a formal product ID number, and its rule is "TcDataSearchGhostMap per.${domain}", where domain is the character set in the previous configuration.
[0068] Similarly, concatenate the ID number and SQL template into an XML format string and parse it into an XML node, obtain the KV collection information of MappedStatementMaps, add the XML node to the collection, use the ID as the key value, and refresh the MappedStatementMaps to the Mybatis cache.
[0069] At the same time, a set of kv key-value pairs is generated, with the key being "TcDataSearchGhostMapper.${domain}" and the value being the update time of the data product recorded in the database. The key-value pairs and product information are updated to the redis cache middleware at the same time, and a copy of the kv key-value pairs is saved in the local cache.
[0070] Otherwise, it prompts that the target data interface configuration fails:
[0071] If the target data interface fails the test, the system will prompt that the target data interface configuration failed. The user needs to check the configuration information and make corresponding adjustments and repairs.
[0072] Through such a testing and online process, the stability and reliability of the target data interface can be ensured. Only the interface that passes the test can be put online for use, thereby improving the overall quality and performance of the system.
[0073] In some embodiments, the solution provided by the present application also includes: adding, deleting and managing accounts.
[0074] Add an account: Add an account in the preset data account module to generate a set of corresponding appId and tokenId. AppId is the account for calling the API service, and tokenId is the key character of this account, which consists of 32-bit numbers and lowercase letters.
[0075] Delete account: Corresponding deletion operation options can be set in the preset data account module.
[0076] Management account: In the data account module, the business line account created can open the corresponding data product permissions. After receiving the request message from the business line application, the platform will extract the request header information, find the account key information from the database according to the account, and then regenerate the signature value with other information and key in the request header, and compare the signature value to see if it is consistent, so as to verify and manage the account.
[0077] To summarize, account creation, deletion, and management are mainly performed in the data account module to ensure account security and reasonable allocation of permissions.
[0078] In some embodiments, performing account management includes: adjusting permissions of the account; the permissions include determining target interfaces that the account can access.
[0079] In actual operation, the following settings may be made in the data account module: Set corresponding permission rules for each account to clarify which target interfaces the account can access. When you need to adjust the account permissions, you can modify the permission rules of the account in the data account module, such as adding or deleting the target interfaces that can be accessed.
[0080] When a business line application initiates a request, the platform will determine whether the account has the right to access the requested target interface based on the account's permission rules. If it has the right to access, the request will continue to be processed; otherwise, access will be denied and the corresponding prompt information will be returned. This account management method can effectively control the account's access rights to the target interface and ensure data security and compliance.
[0081] In some embodiments, the database is configured with different data sources: when accessing the database through different data sources, different data in the database can be accessed.
[0082] Specifically, each data source is associated with a specific part or data set in the database. When accessing through a data source, the system will be directed to the corresponding part of the database based on the configuration information of the data source, so as to obtain the data in that part.
[0083] This design allows users to select the appropriate data source to access the required data according to their needs, which improves the flexibility and pertinence of data access. At the same time, it also helps to classify and protect the data in the database, ensuring that different users or applications can only access the data they are authorized to access.
[0084] The solution provided by this application is described below in conjunction with specific embodiments: Figure 2 ,
[0085] Step 201, write calculation results: The big data calculation results are written to a table in the public result library:
[0086] Specifically, the data department maintains a query database that is not visible to the outside world. The big data calculation results are written into a table in the public result library, that is, the business data is entered into the database. This database is maintained by the data department and is not visible to the outside world.
[0087] Step 202, configure the data source: configure the link information of the public result library to the data source module of the system, and test whether the link is successful.
[0088] Specifically, in the data source module, configure the data source information, which includes: the data source link address, link port number, link protocol header, account number and password.
[0089] Step 203, configure the data product: add the product domain, associated data source, query SQL template and query parameters of the result table to the data product module.
[0090] Under the data product module, configure data query information:
[0091] Associated data source: used to indicate which data source is used to run SQL.
[0092] Domain name: unique value verification, and only letters can be entered. Address suffix used for API calls to locate the product that the user wants to use.
[0093] SQL template: SQL statements used for execution, supports input of variable information. The format and usage of variables are the same as those of MyBatis, and supports MyBatis logical tags.
[0094] SQL query parameters: used to check if parameters are required when calling API. Variable fields in SQL templates can be configured as required or optional.
[0095] Step 204, test data product: in the data product module, input simulation parameters for testing. After clicking the test, set ld to the fixed value of "TcDataSearchGhostMapper.TcDataGhostValidS qllnvoke". Then combine the Id and SQL templates and parse them into an xml format string. Then parse the xml format string into an xml node. Then obtain the KV collection information of the MappedStatementa ps of mybatis. Then add the above-parsed xml node to the collection information of MappedStatementMaps, use Id as the key value of the collection and then refresh MappedStatementMaps to the cache of Mybatis. Then call the Myabtis framework according to the id and input simulation parameters, execute the corresponding query statement, and obtain the query result. Then render the returned result into the list of the page and show it to the user.
[0096] Specifically, after entering the product information, you need to conduct product testing in advance, and enter the test value after the parameter for testing. Generate an ID number. In order to identify and distinguish between the test and the official product, a fixed test ID number is used for the test product. The test ID number is a fixed value "TcDataSearchGhost Mapper.TcDataGhostValidSqlInvoke". Then splice the ID number and the SQL template into an XML format string recognized by mybatis. Then parse the XML format string into an XML node. Then obtain the KV collection information of the MappedStatementMaps of mybatis. Then add the above-parsed XML node to the collection information of MappedStatementMaps, and use Id as the key value of the collection. Then refresh the MappedStatementMaps to the cache of Mybatis. Then call the Myabtis framework according to the ID and the input simulation parameters, execute the corresponding query statement, and get the query result. Then render the returned results into the list on the page and display them to the user.
[0097] Step 205, online data product: After the above test results meet the expected results, the online data product can be operated. After clicking the online data product, the domain, SQL template information and query parameter information saved in step S203 are obtained, and then the domain and SQL template information are combined and parsed into an XML format string. Then the XML format string is parsed into an XML node. Then the KV collection information of the MappedStatementMaps of mybatis is obtained. Then the above-parsed XML node is added to the collection information of MappedStatementMaps, and "TcDataSearchGhostMapper.${domain}" is used as the key value of the collection: Then the MappedStatementMaps is refreshed to the cache of Mybatis.
[0098] Specifically, after the product test passes, the product can be saved. The saved product is in an offline state and cannot be used for API calls. Offline products need to be put online. After clicking the data product online, the system will generate a formal product ID number. The rule of the ID number is "TcDataSearchG hostMapper.${domain}", and domain is the domain character configured in step S203. Then concatenate the ID number and the SQL template into an XML format string recognized by mybatis. Then parse the XML format string into XML nodes. Then obtain the KV collection information of the MappedStatementMaps of mybatis. Then add the above-parsed XML nodes to the collection information of MappedStatementMaps, and use Id as the key value of the collection. Then refresh the MappedStatementMaps to the Mybatis cache. At the same time, a set of kv key-value pairs is generated, the key is TcDataSearchGhostMapper.${domain}, the value is the update time recorded in the database for the data product, the key-value pair and product information are updated to the redis cache middleware at the same time, and a copy of the kv key-value pair is saved in the local cache.
[0099] Step 206, using API service: the platform generates a set of account and key information in the data account module and sends it to the business line application. The business line application assembles the request parameters: the request header is the account, request timestamp, 16 random numbers, time + random number + key MD5 encrypted as a sign, and the request body is the query parameters configured in step S203 converted to json format. The business line application sends the request message to the platform host and uses the request address configured in step S203 with domain as the suffix.
[0100] Specifically, a new account operation is performed in the data account module to generate a set of corresponding appId and tokenId. AppId is the account for calling the API service, and tokenId is the key character of this account, which consists of 32-bit numbers and lowercase letters. Under the data account module, the created business line account activates the corresponding data product permissions. The business line application assembles the request parameters: the request header is the account number, request timestamp, a random number consisting of 16 alphanumeric digits, and timestamp + random number + key are encrypted with MD5 as a sign. The request body is the query parameters configured in step S203 converted to json format. The business line application sends the request message to the platform host, and uses the request address with domain as the suffix configured in step S203.
[0101] Step 207, processing the request: After receiving the request message from the business line application, the platform takes out the request header information, finds the key information of the account from the database according to the account, and then regenerates the signature value with the other information in the request header and the key, and compares whether the signature value is consistent. If not, it returns that the signature is incorrect. If consistent, proceed to the subsequent steps.
[0102] Specifically, after receiving the request message from the business line application, the platform extracts the request header information, finds the key information of the account from the database according to the account, and then regenerates the signature value with the other information in the request header and the key, and compares whether the signature value is consistent. If not, it returns that the signature is incorrect and the process ends. If consistent, proceed to step S208.
[0103] Step 208, query SQL results: intercept the domain string according to the request suffix, and query the associated data source, SQL template, and query parameters configured in step S203 according to the domain string. Then check whether there is link information of the associated data source in the system cache. If not, query the link, account, and key information configured in the data source according to the associated data source, create a link, save it in the system's mybatis link pool cache, then take out the data source link session from the mybatis sessionFactory, call the session's selectList method, pass in the TcDataSearchGhostMapper${domain} statement ld and the query parameters of the request body, get the query result, and then encapsulate the query result response in json format to form a unified parameter format for the platform: including status code code, query description msg query result data, and respond to the business line application.
[0104] That is: according to the suffix of the request, the domain string is intercepted, and the update time of TcDataSearchGhostMapper.${domain} recorded in the local cache is queried to see if it is consistent with the update time recorded in redis. If it is inconsistent, the mybatis cache operation is updated in step S205, because the effective scope of mybatis is a single service node, and the mybatis configuration information needs to be refreshed. This operation is to ensure that the data product configuration of each service node in a distributed environment is consistent. According to the domain string, the associated data source, SQL template, and query parameters configured in step S203 are queried. Then check whether there is link information of the associated data source in the system's cache. If not, the link, account, and key information of the data source configuration are queried according to the associated data source, and a link is created and saved in the link pool cache of the system's mybatis. Then take out the link session of the data source from the sessionFactory of mybatis, call the selectList method of session, pass in the TcDataSearchGhostMapper.${domain} statement Id and the query parameters of the request body, and obtain the query result. The query result response is then encapsulated in JSON format to form a unified parameter format for the platform: including status code, query description msg, query result data, and the response is given to the business line application.
[0105] Exemplary Devices
[0106] The device embodiments of the present application can be used to execute the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
[0107] Figure 3 FIG. 1 is a block diagram of a query device based on Mybatis real-time configuration provided by an embodiment of the present application. Figure 3 As shown, the device comprises:
[0108] The acquisition module 31 is used to acquire data interface configuration information; wherein the data interface configuration information is constructed by the user in a preset auxiliary interface based on a preset Mybatis framework according to his own needs, and is used to configure the target data interface;
[0109] A configuration module 32, configured to configure a target data interface based on the data interface configuration information;
[0110] The module 33 is provided to provide a target interface for users to call and query data.
[0111] Exemplary Electronic Devices
[0112] Below, reference Figure 4 To describe an electronic device according to an embodiment of the present application. Figure 4 A block diagram of an electronic device according to an embodiment of the present application is illustrated.
[0113] like Figure 4 As shown, electronic device 400 includes one or more processors 410 and memory 420 .
[0114] The processor 410 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 400 to perform desired functions.
[0115] The memory 420 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 410 may run the program instructions to implement the query method based on Mybatis real-time configuration of each embodiment of the present application described above and / or other desired functions. Various contents such as category correspondences may also be stored in the computer-readable storage medium.
[0116] In one example, the electronic device 400 may further include: an input device 430 and an output device 440 , and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0117] In addition, the input device 430 may also include, for example, a keyboard, a mouse, an interface, etc. The output device 440 may output various information to the outside, including analysis results, etc. The output device 440 may include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, etc.
[0118] Of course, to simplify, Figure 4 Only some of the components in the electronic device related to the present application are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, the electronic device may further include any other appropriate components according to specific application conditions.
[0119] Exemplary computer program products and computer-readable storage media
[0120] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the query method based on Mybatis real-time configuration according to various embodiments of the present application described in the above "Exemplary Method" section of this specification.
[0121] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0122] In addition, an embodiment of the present application may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the query method based on My batis real-time configuration according to various embodiments of the present application described in the above "Exemplary Method" section of this specification.
[0123] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0124] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present application to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A query method based on Mybatis real-time configuration, It is characterized in that include: Obtain data interface configuration information; wherein the data interface configuration information is constructed by the user in a preset auxiliary interface based on a preset Mybatis framework according to his own needs, and is used to configure the target data interface; Based on the data interface configuration information, configure the target data interface; Provides a target interface for users to call and query data.
2. According to the query method based on Mybatis real-time configuration according to claim 1, It is characterized in that The auxiliary interface includes: a plurality of text boxes for filling in text; The preset range of each text box is marked with corresponding prompt information; The multiple text boxes are used for users to fill in or select different configuration parameter information: The configuration parameter information includes: unique identification information, API name, data source, timeout period, SQL statement, and parameter information of the API interface.
3. According to the query method based on Mybatis real-time configuration according to claim 1, It is characterized in that Also includes: Testing the target data interface; If the target data interface passes the test, the target data interface is put online, otherwise, it is prompted that the configuration of the target data interface fails.
4. According to the query method based on Mybatis real-time configuration according to claim 1, It is characterized in that Add, delete and manage accounts.
5. According to the query method based on Mybatis real-time configuration according to claim 1, It is characterized in that Account management includes: adjusting account permissions; The permissions include determining the target interface that the account can access.
6. According to the query method based on Mybatis real-time configuration according to claim 1, It is characterized in that The database is configured with different data sources: When you access a database through different data sources, you can access unused data in the database.
7. A query device based on Mybatis real-time configuration, It is characterized in that include: An acquisition module is used to acquire data interface configuration information; wherein the data interface configuration information is constructed by the user in a preset auxiliary interface based on a preset Mybatis framework according to his own needs, and is used to configure a target data interface; A configuration module, configured to configure a target data interface based on the data interface configuration information; Provides a module for providing a target interface for users to call to query data.
8. An electronic device, It is characterized in that include: A processor, and a memory for storing a program executable by the processor; The processor is used to implement the query method based on Mybatis real-time configuration as described in any one of claims 1 to 6 by running the program in the memory.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, enables the processor to execute the query method based on Mybatis real-time configuration as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the query method based on Mybatis real-time configuration according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Dynamic management method and system for service interface
CN115309566A
Method and device for realizing data interface based on dynamic configuration
CN115543280A
Interface creating method and related equipment
CN115982257A
Data query method and system
US11250012B1
