Database access method and apparatus, electronic device, and storage medium

By introducing target middleware between the front-end page and the back-end database to convert query commands, the problems of query anomalies and business crashes during the front-end and back-end transformation were solved, and the decoupling and independent upgrade of front-end and back-end services were achieved.

CN114564504BActive Publication Date: 2026-02-06PING AN INT FINANCIAL LEASING CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210200084.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-02
Publication Date
2026-02-06
Estimated Expiration
2042-03-02

AI Technical Summary

Technical Problem

During the upgrade and transformation of front-end and back-end services, the inability to locate the affected front-end pages in a timely manner can lead to low database access efficiency and may even cause business services to crash.

Method used

A target middleware is introduced to convert query commands between the front-end page and the back-end database. The target middleware converts the first query command that cannot be recognized into a second query command that the back-end database can recognize, and retrieves the feedback data from the back-end database for display on the front end.

Benefits of technology

It decouples the front-end and back-end services, allowing them to be upgraded and transformed independently, avoiding query anomalies and business crashes, and ensuring that the back-end database can be accessed normally after the front-end is transformed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114564504B_ABST
    Figure CN114564504B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a database access method and device, electronic equipment and a storage medium. The method comprises: in the loading and displaying process of a target page, extracting a first query instruction built in the target page; verifying whether the first query instruction can be recognized by a backend database; if it is determined that the first query instruction cannot be recognized by the backend database, constructing an instruction conversion request matched with the first query instruction, and sending the instruction conversion request to a target middleware; wherein the target middleware is configured to convert the first query instruction in the instruction conversion request into a second query instruction that can be recognized by the backend database, and obtain database feedback data matched with the second query instruction from the backend database; receiving the database feedback data sent by the target middleware, and performing front-end display on the database feedback data. The technical solution of the embodiments of the present application can isolate the front end and the backend during the upgrading of the database front end and the backend, and does not affect the normal operation of the business.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of computer technology, and particularly relate to a database access method and device, electronic equipment and storage medium. BACKGROUND

[0002] The existing database system mainly provides various data access services through front-end and back-end interaction. Users can access the back-end database and obtain the required business services by opening the front-end page in the terminal device.

[0003] Generally, users can indirectly access the back-end database through the back-end service interface provided in the front-end page, or generate SQL (Structured Query Language) statements related to user operations to directly access the back-end database.

[0004] The inventor found that the prior art has the following defects in the process of implementing the present application: when the table structure of the back-end database needs to be updated in the process of front-end and back-end service upgrade, the range of the affected front-end page cannot be located in time, which will cause various query abnormalities and affect the user's database access efficiency. In particular, for websites or application programs with complex business functions, a data access error can affect multiple business services, and in severe cases, it can even cause the collapse of business services. SUMMARY

[0005] Embodiments of the present application provide a database access method and device, electronic equipment and storage medium to accurately and efficiently provide database access services in the database system transformation scenario.

[0006] In a first aspect, the embodiments of the present application provide a database access method, comprising:

[0007] extracting a first query instruction built-in in the target page in the loading and displaying process of the target page;

[0008] verifying whether the first query instruction can be recognized by the back-end database;

[0009] if it is determined that the first query instruction cannot be recognized by the back-end database, constructing an instruction conversion request matched with the first query instruction, and sending the instruction conversion request to a target middleware;

[0010] The target middleware is configured to convert the first query instruction in the instruction conversion request into a second query instruction that can be recognized by the back-end database, and obtain database feedback data matched with the second query instruction from the back-end database.

[0011] receive the database feedback data sent by the target middleware, and perform front-end display on the database feedback data.

[0012] In a second aspect, an embodiment of the present application provides a database access method, comprising:

[0013] when receiving an instruction conversion request matched with a first query instruction in a target page, converting the first query instruction into a second query instruction recognizable by a back-end database;

[0014] accessing the back-end database according to the second query instruction, and obtaining database feedback data returned by the back-end database for the second query instruction;

[0015] sending the database feedback data to the target page to perform page front-end display on the database feedback data.

[0016] In a third aspect, an embodiment of the present application further provides a database access device, comprising:

[0017] a query instruction extraction module configured to extract a first query instruction built in a target page during loading and display of the target page;

[0018] a recognition verification module configured to verify whether the first query instruction is recognizable by a back-end database;

[0019] an instruction conversion module configured to, if it is determined that the first query instruction is not recognizable by the back-end database, construct an instruction conversion request matched with the first query instruction, and send the instruction conversion request to a target middleware;

[0020] wherein the target middleware is configured to convert the first query instruction in the instruction conversion request into a second query instruction recognizable by the back-end database, and obtain database feedback data matched with the second query instruction from the back-end database;

[0021] a front-end display module configured to receive the database feedback data sent by the target middleware, and perform front-end display on the database feedback data.

[0022] In a fourth aspect, an embodiment of the present application further provides a database access device, comprising:

[0023] an instruction conversion module configured to, when receiving an instruction conversion request matched with a first query instruction in a target page, convert the first query instruction into a second query instruction recognizable by a back-end database;

[0024] The database access module is configured to access a backend database according to the second query instruction, and obtain database feedback data returned by the backend database in response to the second query instruction;

[0025] The data feedback module is configured to send the database feedback data to the target page, so as to perform front-end page display on the database feedback data.

[0026] In a fifth aspect, an electronic device is provided, and the electronic device includes:

[0027] one or more processors;

[0028] a storage device configured to store one or more programs;

[0029] When the one or more computer programs are executed by the one or more processors, the one or more processors perform the computer programs, and thus the database access method provided by any of the embodiments of the present application is implemented.

[0030] In a sixth aspect, a computer storage medium is provided, and the computer storage medium stores a computer program, which is executed by a processor to implement the database access method provided by any of the embodiments of the present application.

[0031] The technical scheme provided by the embodiments of the present application can achieve the technical effect that the reconstructed front-end page effectively accesses the unreconstructed backend database with the assistance of the target middleware, and thus the developer can reconstruct the backend database after completing the reconstruction of all the front-end pages, the front-end reconstruction and the backend reconstruction are separated in the time dimension, the problem of query exception or even business collapse that is easily introduced in the mixed reconstruction scenario of the front-end and the backend of the database system in the prior art is solved, the decoupling of the front-end service and the backend service in the database system is achieved, the front-end and the backend can be independently upgraded and reconstructed, and normal business service is ensured during the upgrading and reconstruction. BRIEF DESCRIPTION OF DRAWINGS

[0032] Figure 1 A flowchart of a database access method provided by the embodiments of the present application is shown in the figure;

[0033] Figure 2 A flowchart of another database access method provided by an embodiment of the present application is shown in FIG. 4;

[0034] Figure 3 A flowchart of another database access method provided by an embodiment of the present application is shown in FIG. 4;

[0035] Figure 4 A structure block diagram of a database access device provided by an embodiment of the present application is shown in FIG. 5;

[0036] Figure 5 A structure block diagram of a database access device provided by an embodiment of the present application is shown in FIG. 5;

[0037] Figure 6 A structure block diagram of an electronic device provided by an embodiment of the present application is shown in FIG. 6. DETAILED DESCRIPTION

[0038] The present application will be further described below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are intended to be merely illustrative of the present application and not in limitation thereof.

[0039] It should also be noted that, for the sake of brevity, the figures herein only show portions of the application rather than attempting to show all possible embodiments of the application. Before discussing the example embodiments in more detail, it is noted that some example embodiments are described as processes depicted as flow charts or methods. Although the processes are described in a particular sequential order, many of the processes can be performed concurrently, in parallel, or simultaneously. In addition, the order of the processes can be re-arranged. The processes can terminate when their functions are completed, but the processes can also terminate without completing their functions. The processes can correspond to methods, functions, procedures, subroutines, subprograms, etc.

[0040] The terms "first" and "second", and the like, in the description and in the claims of the present application and the drawings are used for distinguishing between similar objects and not necessarily for describing a specific sequential or chronological order. The terms "comprises", "comprising", "includes", "including" and the like can be used herein simply to denote the presence of stated elements or steps or the like and the like, and not to preclude the presence or addition of one or more other steps, elements, components or the like.

[0041] For the sake of illustration, the main inventive concepts of the embodiments of the present application are first described.

[0042] The embodiments of the present application are mainly applicable to the following system architecture modification and upgrade application scenarios:

[0043] Specifically, the system architecture includes: a front-end page and a back-end database. The front-end page can directly access the back-end database through an embedded query instruction (typically, an SQL query instruction) to obtain matching data for front-end page display. The front-end page can also indirectly access the back-end database by calling a back-end service interface to obtain matching data for front-end page display. The front-end page can be a user-visible interface, such as a web page or various H5 pages, and provides business service buttons and user interaction experiences. The back-end database can be any database in the art, such as an Oracle database, a MySQL database, or a PostgreSQL database, and the present application does not make specific limitations.

[0044] When upgrading the system architecture, if the front-end and back-end are upgraded simultaneously, for example, the back-end database updates the table structure of a data table, then the query instructions embedded in each front-end page that match the data table need to be uniformly modified. If the above-mentioned upgrade is performed simultaneously in the front-end and back-end, it will bring a lot of downtime, causing inconvenience to users using the database, and if one or more pages are not successfully modified, it will cause various query abnormalities.

[0045] In this embodiment, a new architecture is proposed to cope with the upgrade of the system architecture. Specifically, a target middleware is introduced between the front-end page and the back-end database. First, only the front-end pages can be improved or simplified, and the back-end database is not improved, for example, the query instruction C for data item B in data table A in the front-end page is changed to query instruction C'. Further, the target middleware provides a conversion method for converting the modified query instruction into an original query instruction that can be recognized by the back-end database, that is, the query instruction C' can be converted to the query instruction C in the target middleware. At this time, when the target middleware sends the converted original query instruction to the back-end database, the back-end database can respond to the original query instruction directly without sensing the modification of the front-end page, and feedback the correct query result data.

[0046] Based on this, developers can upgrade all front-end pages and debug them successfully, and then make matching improvements to the back-end database, for example, modifying the response to query instruction C' after modifying the response to query instruction C. When the back-end database is improved and upgraded, the target middleware can be removed to realize the upgrade of the entire system framework.

[0047] Figure 1is a schematic diagram of a database access method provided by an embodiment of the present application. The embodiment can be applied to the case of accessing a back-end database through a front-end page in a database system. The method can be executed by a database access device, which can be implemented by software and / or hardware, and can be integrated in an application client or a target page accessed by the application client, and used in cooperation with a target middleware, which can be used as a functional plug-in and built in a browser or a target page.

[0048] Correspondingly, as shown in Figure 1 the method comprises the following steps:

[0049] S110, extracting a first query instruction built in the target page during loading and displaying of the target page.

[0050] The method of the embodiment of the present application can be executed by a browser or a functional plug-in built in a front-end page, and the embodiment does not limit this.

[0051] The target page is a front-end page for accessing a back-end database to provide various database access services for users. As described above, the target page in the embodiment of the present application can refer to a page that has been completely or partially upgraded.

[0052] The specific upgrading and reconstruction mode of the target page can be that one or more query instructions included in the target page are simplified and reconstructed, for example, a query instruction A in the target page is simplified and reconstructed into A'. Or, the specific upgrading and reconstruction mode of the target page can also be that one or more auxiliary query functions provided by the target page are lightweightly reconstructed, for example, an original authentication function in the target page is transplanted to the back-end database.

[0053] The first query instruction specifically refers to a data query instruction built in the target page and used for obtaining a set data item in the back-end database. The number of the first query instructions included in the target page can be one or more, which is not limited herein.

[0054] In a specific example, if the target page includes a weather display control, in which a first query instruction is built in for querying the weather information of the area where the requester of the target page is located at the current system time. Correspondingly, when the client A requests to load and display the target page, the target page will first obtain the current system time and the geographic location information corresponding to the client A, and then fill the current system time and the geographic location information into the first query instruction and send the first query instruction to the backend server. The matched weather information can be obtained from the backend server, and after the weather information is backfilled to the currently loaded target page, the function of displaying the weather information in the target page can be realized.

[0055] In the embodiment of the application, when the browser or the application client loads and displays the target page, if the target page includes the first query instruction, the first query instruction is sent to the backend database by directly or indirectly accessing the backend database, and the query result (hereinafter also referred to as database feedback data) matched with the first query instruction is obtained from the backend database. After obtaining the database feedback data, the database feedback data can be added to the target page for user display.

[0056] For example, the user opens the target page through the browser client. The target page can be the page corresponding to the web page link clicked by the user in the browser client. During the process of loading and displaying the target page by the browser receiving the request of the user clicking the target page, one or more first query instructions included in the target page are extracted, and the first query instructions are sent to the backend server. The backend server processes the first query instructions and returns the matched database feedback data to the browser. The browser receives the database feedback data and completes the loading and display of the target page.

[0057] S120, verifying whether the first query instruction can be recognized by the backend database.

[0058] The backend database can be the database queried by the first query instruction. It can be understood that in the field, the front-end page is responsible for sending the data query instruction. After receiving the data query instruction, the backend database is responsible for obtaining the query result data according to the data query instruction and returning the query result data as the database feedback data to the front-end page.

[0059] In the embodiment of the present application, after the browser or the target page extracts the first query instruction, it is first verified whether the first query instruction can be recognized by the backend database. If it is determined that the first query instruction can be recognized by the backend database, it means that the first query instruction in the target page has not been modified in the upgrading and modification process of the front-end page, and the first query instruction can normally access the backend database. If it is determined that the first query instruction cannot be recognized by the backend database, it means that the first query instruction in the target page has been modified in the upgrading and modification process of the front-end page, and the backend database cannot be directly accessed through the first query instruction. At this time, the assistance of the target middleware is needed.

[0060] The verification of whether the first query instruction can be recognized by the backend database can be performed in the following ways:

[0061] It is verified whether the first query instruction contains a modified identifier. If yes, it is determined that the first query instruction is a modified query instruction in the target page, and it is further determined that the first query instruction cannot be recognized by the backend database.

[0062] Alternatively, the verification of whether the first query instruction can be recognized by the backend database can also be performed in the following way:

[0063] The first query instruction is subjected to regular matching with the pre-set standard modified instruction format. If the matching is successful, it is determined that the first query instruction is a modified query instruction in the target page, and it is further determined that the first query instruction cannot be recognized by the backend database.

[0064] S130, if it is determined that the first query instruction cannot be recognized by the backend database, an instruction conversion request matching the first query instruction is constructed, and the instruction conversion request is sent to the target middleware.

[0065] The target middleware is configured to convert the first query instruction in the instruction conversion request into a second query instruction that can be recognized by the backend database, and obtain database feedback data matching the second query instruction from the backend database.

[0066] The instruction conversion request can be a conversion request for converting the first query instruction into the second query instruction. The second query instruction can be a query instruction that can be recognized by the backend database which has not been upgraded and modified. The target middleware is a target middleware introduced between the front-end page and the backend database during the upgrading and modification process of the front-end page and the backend database.

[0067] The database feedback data can be database data matched by the backend database according to the query instruction.

[0068] As described above, if the first query instruction cannot be recognized by the backend database, the target middleware needs to be used to convert the first query instruction into a second query instruction recognizable by the backend database, and then the target middleware can request the backend database for query results matching the second query instruction instead of the target page, and resend the query results as database feedback data to the target page or a client requesting to display the target page.

[0069] The instruction conversion request contains the first query instruction, and the instruction conversion request is used to request the target middleware to convert the first query instruction into a second query instruction recognizable by the backend database.

[0070] In the embodiment of the application, when it is determined that the backend database cannot recognize the first query instruction, that is, the first query instruction is an upgraded query instruction, the application client or the target page generates an instruction conversion request matching the first query instruction according to the first query instruction, and sends the generated instruction conversion request to the target middleware built in the application client or the target page. The target middleware obtains the first query instruction in the instruction conversion request according to the received instruction conversion request, forms a second query instruction recognizable by the backend database according to the first query instruction, converts the first query instruction into the second query instruction, and then sends the converted second query instruction to the backend database. The backend database matches corresponding database feedback data in the database according to the second query instruction, and sends the matched database feedback data to the target middleware.

[0071] Optionally, the target middleware can also call the backend service interface to access the backend database and obtain the database feedback data returned by the backend service interface for the first query instruction.

[0072] Optionally, the target middleware can store an instruction correspondence table of improved query instructions and pre-improved query instructions included in the front-end page, that is, the instruction correspondence table stores the query instruction before upgrading and the upgraded query instruction corresponding to the query instruction. When the instruction conversion request is obtained, the second query instruction in the instruction correspondence table corresponding to the first query instruction in the instruction conversion request can be obtained and returned to the backend database.

[0073] Optionally, in another conversion mode, the target middleware stores a standard improvement format of all first query instructions, and when the instruction conversion request is obtained, the first query instruction in the instruction conversion request is restored to a second standard instruction according to the corresponding standard improvement format and returned to the backend database.

[0074] S140, receiving the database feedback data sent by the target middleware, and performing front-end display on the database feedback data.

[0075] The front-end display can fill the database feedback data into the target page and render and display the target page.

[0076] In another embodiment of the application, the target middleware is a pluggable middleware; and the method further comprises: when receiving a backend adaptation modification completion instruction fed back by the backend database, removing the target middleware to establish direct communication between the target middleware and the backend database.

[0077] The pluggable middleware can be a dynamic middleware, and loading the dynamic middleware can automatically run and unloading the dynamic middleware can automatically stop. It can be understood that the loading and unloading of the pluggable middleware does not affect the overall service of the system.

[0078] In the embodiment of the application, when the system is overall upgraded, the front-end page is upgraded, the backend adaptation modification is needed, the target middleware is inserted in the process of upgrading the front-end page to guarantee the communication between the front-end and the backend and the business service of the front-end and the backend, when receiving the backend adaptation modification completion instruction fed back by the backend database, it means that the upgrading and modification of the front-end and the backend are completed, the front-end and the backend can directly communicate and provide business service, and at this time, the target middleware can be removed to establish direct communication between the target middleware and the backend database.

[0079] In the embodiment of the application, in the loading and displaying process of the target page, the first query instruction built-in the target page is extracted, if it is determined that the first query instruction cannot be recognized by the backend database, an instruction conversion request matched with the first query instruction is constructed, and the instruction conversion request is sent to the target middleware, the first query instruction in the instruction conversion request is converted into a second query instruction that can be recognized by the backend database by the target middleware, and the database feedback data matched with the second query instruction is obtained from the backend database; the database feedback data sent by the target middleware is received by the front-end, and the database feedback data is front-end displayed, which can achieve the technical effect that the modified front-end page effectively accesses the unmodified backend database with the assistance of the target middleware, and then the developer can modify the backend database after completing the modification of all the front-end pages, the front-end modification and the backend modification are separated in the time dimension, the query exception or even the business collapse problem easily introduced in the mixed modification scene of the front-end and the backend of the database system in the prior art is solved, the front-end and the backend services in the database system are decoupled, the front-end and the backend can be independently upgraded and modified, and normal business service is guaranteed in the upgrading and modification process.

[0080] Figure 2A flowchart of another database access method provided by the embodiment of the present application is shown in the figure, which is optimized based on the above-mentioned optional embodiments, and gives a plurality of specific optional implementation manners after verifying whether the first query instruction can be recognized by the backend database, and accordingly, as shown in the figure, the method comprises the following steps: Figure 2

[0081] S210, extracting the first query instruction built in the target page in the loading and displaying process of the target page.

[0082] S220, verifying whether the first query instruction can be recognized by the backend database: if yes, performing S230; otherwise, performing S240.

[0083] S230, identifying the target auxiliary query function matched with the first query instruction according to the mapping relationship between the query instruction and the auxiliary query function, and performing S250.

[0084] In the system architecture upgrading and reforming, the auxiliary query function included in the front-end page can be transplanted to the backend database. Further, in the system architecture upgrading and reforming, the auxiliary query function included in the front-end page can be transplanted to the target middleware. It can be understood that, when the front-end page is reformed, in order to realize the lightweight front-end page, the auxiliary query function included in the front-end page can be transplanted to the backend database, and if the backend database has not transplanted the corresponding auxiliary query function because the upgrading and reforming has not been completed, the corresponding auxiliary query function needs to be transplanted to the target middleware.

[0085] In the embodiment of the present application, when it is determined that the backend database can recognize the first query instruction, the target auxiliary query function matched with the first query instruction needs to be identified.

[0086] Optionally, the auxiliary query function can include the functions of locally caching the first query instruction, performing permission authentication on the first query instruction, and monitoring and recording the user behavior information included in the first query instruction.

[0087] In the embodiment, the upgrading and reforming of the system architecture can also include transplanting some auxiliary query functions included in the front-end page to the backend database to realize the lightweight front-end page. In addition, if only the front-end page is reformed, for example, the permission authentication function is removed, at this time, since the backend database does not correspondingly increase the above-mentioned function, the auxiliary query function is missing, at this time, the auxiliary query function removed from the front-end page can be added to the target middleware, and the target middleware is used to realize the above-mentioned auxiliary query function, so as to ensure good and stable database query service in the transition stage of the front-end and back-end reform. ​

[0088] In the embodiment, a mapping relationship between the query instruction and the auxiliary query function can be established in the target page in advance. The mapping relationship can be a general mapping relationship between the query instruction and the auxiliary query function, that is, all query instructions correspond to the same auxiliary query function; or the mapping relationship can also be a refined mapping relationship between different query instructions and different auxiliary query functions. By querying the mapping relationship, it can be identified which auxiliary query functions need to be executed first before the first query instruction in the target page is sent to the backend server.

[0089] S240, an instruction conversion request matched with the first query instruction is constructed, and the instruction conversion request is sent to the target middleware, and S2100 is executed.

[0090] S250, it is verified whether the target auxiliary query function belongs to the tailored function of the target page: if yes, S260 is executed; otherwise, S270 is executed.

[0091] The tailored function can be a function that is tailored off or removed from the target page in the upgrading process.

[0092] In the embodiment, after the target auxiliary query function is acquired, it is further verified whether the target query function belongs to the tailored function of the target page; optionally, the tailored function database matched with the target page can be queried to determine whether the auxiliary query function belongs to the tailored function of the target page. The tailored function database is used to store all tailored functions of the target page.

[0093] S260, an auxiliary function processing request matched with the target auxiliary query function of the first query instruction is constructed, and the auxiliary function processing request is sent to the target middleware, and S2100 is executed.

[0094] The target middleware is used to perform auxiliary processing on the first query instruction by using the target auxiliary query function, and obtain database feedback data matched with the first query instruction from a backend database.

[0095] The auxiliary query function processing request can be a request for the auxiliary query function of the target middleware. The target auxiliary query function can be an auxiliary query function corresponding to the auxiliary function processing request in the target middleware. The auxiliary processing can be processing of the first query instruction by the target middleware according to the auxiliary query function.

[0096] In the embodiment of the application, if it is determined that the target auxiliary query function belongs to the clipping function of the target page, the target page generates an auxiliary function processing request matched with the target auxiliary query function according to the target auxiliary query function, and sends the generated auxiliary function processing request to the target middleware between the front-end page and the back-end database. The target middleware acquires the target auxiliary query function in the auxiliary function processing request according to the received auxiliary function processing request, performs auxiliary processing on the first query instruction according to the target auxiliary query function, and sends the first query instruction to the back-end database after the auxiliary processing is completed. The back-end database matches corresponding database feedback data in the database according to the first query instruction, and sends the matched database feedback data to the target middleware. Optionally, the back-end service interface can also be called to access the back-end database, and the database feedback data returned by the back-end service interface for the first query instruction can be acquired.

[0097] S270, verifying whether the first query instruction needs to be forwarded to the back-end database across domains: if yes, performing S280; otherwise, performing S2110.

[0098] The cross-domain forwarding can be a request for acquiring resources of other domains. For example, in a browser, when an application requests resources from a server, due to the same source policy restriction, the application can only request resources from the same domain. If the server and the application are not in the same domain, a cross-domain request is initiated.

[0099] In the embodiment of the application, after the target auxiliary query function is acquired, it is further verified whether the target query function belongs to the clipping function of the target page. Optionally, the clipping function database matched with the target page can be queried to determine whether the auxiliary query function belongs to the clipping function of the target page. If it is determined that the target auxiliary query function does not belong to the clipping function of the target page, it is judged whether the first query instruction requests to acquire resources of other domains according to the resource request in the first query instruction, and it is verified whether the first query instruction needs to be forwarded to the back-end database across domains.

[0100] S280, verifying whether the cross-domain forwarding function belongs to the clipping function of the target page: if yes, performing S290; otherwise, performing S2110.

[0101] The cross-domain forwarding function can be a function clipped by the target page in the upgrading process.

[0102] In the embodiment of the present application, it is determined that the first query instruction needs to obtain other domain resources according to the resource request in the first query instruction, and then it is determined that the first query instruction needs to be forwarded to the backend database across domains, and it is further verified whether the cross-domain forwarding function belongs to the clipping function of the target page. Optionally, it can be determined whether the cross-domain forwarding function belongs to the clipping function of the target page by querying the pre-established clipping function database matched with the target page.

[0103] S290, a cross-domain forwarding request matched with the first query instruction is constructed, and the cross-domain forwarding request is sent to the target middleware, and S2100 is executed.

[0104] The target middleware is configured to forward the first query instruction to the backend database by using the cross-domain forwarding function, and obtain database feedback data matched with the first query instruction from the backend database.

[0105] The cross-domain forwarding request can be a cross-domain forwarding function of the target middleware. The cross-domain forwarding function can be a cross-domain forwarding function corresponding to the cross-domain forwarding request in the target middleware.

[0106] In the embodiment of the present application, if it is determined that the cross-domain forwarding function belongs to the clipping function of the target page, the target page generates a cross-domain forwarding request matched with the cross-domain forwarding function according to the cross-domain forwarding function, and sends the generated cross-domain forwarding request to the target middleware between the front-end page and the backend database. The target middleware obtains the cross-domain forwarding function in the cross-domain forwarding request according to the received cross-domain forwarding request, sends the first query instruction to the backend database, and the backend database matches the corresponding database feedback data in the database according to the first query instruction, and sends the matched database feedback data to the target middleware.

[0107] S2100, the database feedback data sent by the target middleware is received, and the database feedback data is front-end displayed.

[0108] S2110, the database feedback data matched with the first query instruction is obtained from the backend database, and the database feedback data is front-end displayed.

[0109] In another embodiment, after verifying whether the first query instruction needs to be forwarded to the backend database across domains, it can also include: if it is determined that the first query instruction does not need to be forwarded to the backend database across domains, or the cross-domain forwarding function does not belong to the clipping function of the target page, the database feedback data matched with the first query instruction is obtained from the backend database, and the database feedback data is front-end displayed.

[0110] In the embodiment of the present application, if it is determined that the first query instruction does not need to be forwarded to the backend database across domains, or the cross-domain forwarding function does not belong to the clipping function of the target page, the target page can directly send the first query instruction to the backend database, and the backend database matches corresponding database feedback data in the database according to the first query instruction, and sends the matched database feedback data to the target page for front-end display of the target page.

[0111] In the embodiment of the present application, by extracting the first query instruction built-in in the target page in the loading and display process of the target page, if it is determined that the first query instruction cannot be recognized by the backend database, an instruction conversion request matched with the first query instruction is constructed, and the instruction conversion request is sent to the target middleware. The first query instruction in the instruction conversion request is converted into a second query instruction that can be recognized by the backend database by the target middleware, and database feedback data matched with the second query instruction is obtained from the backend database. The front end receives the database feedback data sent by the target middleware, and performs front-end display on the database feedback data. With the assistance of the target middleware, the technical effect that the reconstructed front-end page can effectively access the un-reconstructed backend database is achieved, and then the developer can reconstruct the backend database after completing the reconstruction of all front-end pages. In the time dimension, the separation of front-end reconstruction and backend reconstruction is realized, the problem of query exception or even business collapse easily introduced in the mixed reconstruction scene of front-end and backend of the database system in the prior art is solved, the decoupling of front-end and backend services in the database system is realized, and the front-end and the backend can be independently upgraded and reconstructed, and normal business services are ensured during the upgrading and reconstruction process.

[0112] Figure 3 is a schematic diagram of another database access method provided by the embodiment of the present application. The embodiment can be applied to the case that the front-end page accesses the backend database in the database system. The method can be executed by the target middleware pre-inserted between the front-end page and the backend database. The target middleware can be realized by software and / or hardware, and can be integrated in the application client or the target page accessed by the application client, and is used in cooperation with the application client or the target page.

[0113] Correspondingly, as shown in Figure 3 , the method comprises the following steps:

[0114] S310, when receiving the instruction conversion request matched with the first query instruction in the target page, the first query instruction is converted into a second query instruction that can be recognized by the backend database.

[0115] In the embodiment of the present application, the target middleware converts the request according to the instruction generated by the application client or the target page, acquires the first query instruction in the instruction conversion request, acquires the second query instruction recognizable by the back-end database according to the first query instruction, and converts the first query instruction into the second query instruction.

[0116] Optionally, the target middleware can store an instruction correspondence table including all the first query instructions and the second query instructions in the front-end page, the instruction correspondence table correspondingly stores the second query instruction before upgrading and the first query instruction after upgrading of the second query instruction, and when the instruction conversion request is acquired, the second query instruction in the instruction correspondence table can be correspondingly acquired according to the first query instruction in the instruction conversion request.

[0117] Optionally, in another conversion mode, the target middleware stores the standard upgrading format of all the first query instructions, and when the instruction conversion request is acquired, the first query instruction in the instruction conversion request is restored into the second standard instruction according to the corresponding standard upgrading format.

[0118] S320, according to the second query instruction, accessing the back-end database, and acquiring the database feedback data returned by the back-end database for the second query instruction.

[0119] In the embodiment of the present application, after the target middleware converts the first query instruction into the second query instruction, the back-end database is accessed according to the second query instruction, the corresponding database feedback data is matched in the back-end database through the second query instruction, and the matched database feedback data is returned. Optionally, the back-end service interface can also be called to access the back-end database, and the database feedback data returned by the back-end service interface for the second query instruction is acquired.

[0120] S330, sending the database feedback data to the target page to perform front-end page display of the database feedback data.

[0121] In the embodiment of the present application, after the target middleware receives the database feedback data, the database feedback data is sent to the target page corresponding to the first query instruction according to the first query instruction, so as to perform front-end display of the target page.

[0122] The target middleware of the embodiment of the application converts the first query instruction into a second query instruction that can be recognized by the backend database when receiving an instruction conversion request matched with the first query instruction in the target page, then accesses the backend database according to the second query instruction, and obtains database feedback data returned by the backend database for the second query instruction, and finally sends the database feedback data to the target page for page front-end display of the database feedback data. The decoupling of the front end and the backend in the database system is realized through the target middleware, and normal business services can be ensured in the process of independent upgrading and modification of the front end and the backend.

[0123] On the basis of the above embodiments, the method can further include: when receiving an auxiliary function processing request matched with the first query instruction in the target page, extracting a target auxiliary query function included in the auxiliary function processing request; using the target auxiliary query function to assist in processing the first query instruction; after the processing is completed, accessing the backend database according to the first query instruction, and obtaining database feedback data returned by the backend database for the first query instruction; and sending the database feedback data to the target page for page front-end display of the database feedback data.

[0124] In the embodiment of the application, the target page generates an auxiliary function processing request matched with the target auxiliary query function according to the target auxiliary query function, and sends the generated auxiliary function processing request to the target middleware, and the target middleware extracts the target auxiliary query function included in the auxiliary function processing request according to the received auxiliary function processing request.

[0125] Further, the target middleware extracts the target auxiliary query function included in the auxiliary function processing request according to the received auxiliary function processing request, and then assists in processing the first query instruction according to the target auxiliary query function. After the auxiliary processing is completed, the target middleware accesses the backend database according to the first query instruction, and matches corresponding database feedback data in the database according to the first query instruction in the backend database, and returns the matched database feedback data. Optionally, the backend service interface can also be called to access the backend database, and database feedback data returned by the backend service interface for the first query instruction is obtained. After receiving the database feedback data, the target middleware sends the database feedback data to the target page corresponding to the first query instruction according to the first query instruction, to perform front-end display on the target page.

[0126] On the basis of each of the above embodiments, the target auxiliary query function is used to perform auxiliary processing on the first query instruction, including at least one of the following: calling a cache component integrated in the target middleware to perform local caching on the first query instruction; calling an authentication component integrated in the target middleware to perform permission authentication on the first query instruction; and calling a monitoring component integrated in the target middleware to perform monitoring recording on user behavior information in the first query instruction.

[0127] The cache component can be a local cache service and can be used to store some commonly used interface data, thereby improving system service performance. For example, the cache component of a browser can temporarily store recently used web pages and data in the browser cache, and the user's browsing speed can be improved by locally downloading web page components in the browser cache. The authentication component can authenticate the operation permissions of a user, such as the operation permissions of a user who has not logged in, the operation permissions of a user who has logged in, and the operation permissions of an administrator, and the like. The monitoring component can be a process manager that can perform monitoring recording on user behavior information in a service running process.

[0128] On the basis of each of the above embodiments, the method can further include: when a cross-domain forwarding request matching the first query instruction in the target page is received, calling a cross-domain access component integrated in the target middleware to send the first query instruction to a back-end database that belongs to a different domain from the front-end page; obtaining database feedback data returned by the back-end database in response to the first query instruction; and sending the database feedback data to the target page to perform front-end page display on the database feedback data.

[0129] The cross-domain access component can be a component that accesses different domains.

[0130] In the embodiments of the application, the target page generates a cross-domain forwarding request matching the cross-domain forwarding function according to the cross-domain forwarding function, and sends the generated cross-domain forwarding request to the target middleware. When the target middleware receives the cross-domain forwarding request generated by the target page, the target middleware calls a cross-domain access component integrated in the target middleware, sends the first query instruction to a back-end database that belongs to a different domain from the front-end page through the cross-domain access component, and then obtains database feedback data returned by the back-end database in response to the first query instruction, and sends the database feedback data to the target page to perform front-end page display on the database feedback data.

[0131] It should be noted that any arrangement and combination of the technical features in each of the above embodiments also belongs to the protection scope of the application.

[0132] Figure 4 is a schematic diagram of a database access device provided by an embodiment of the present application, as shown in the figure, the device comprises: a query instruction extraction module 410, an identification verification module 420, an instruction conversion module 430 and a front-end display module 440, wherein: Figure 4

[0133] The query instruction extraction module 410 is configured to extract a first query instruction built-in in a target page during a loading and displaying process of the target page.

[0134] The identification verification module 420 is configured to verify whether the first query instruction can be identified by a back-end database.

[0135] The instruction conversion module 430 is configured to, if it is determined that the first query instruction cannot be identified by the back-end database, construct an instruction conversion request matched with the first query instruction, and send the instruction conversion request to a target middleware.

[0136] The target middleware is configured to convert the first query instruction in the instruction conversion request into a second query instruction that can be identified by the back-end database, and obtain database feedback data matched with the second query instruction from the back-end database.

[0137] The front-end display module 440 is configured to receive the database feedback data sent by the target middleware, and perform front-end display on the database feedback data.

[0138] The technical scheme provided by the embodiment of the present application can achieve the technical effect that the reformed front-end page effectively accesses the un-reformed back-end database with the assistance of the target middleware, and then the developers can reform the back-end database after completing the reform of all the front-end pages, thereby realizing the separation of front-end reform and back-end reform in the time dimension, solving the problem of query abnormality or even business collapse easily introduced in the mixed reform of the front-end and the back-end of the database system in the prior art, realizing the decoupling of the front-end and the back-end, and enabling the front-end and the back-end to be developed independently and to realize normal business services in the development process.

[0139] ​Optionally, the identification verification module 420 is specifically configured to: if it is determined that the first query instruction can be identified by the backend database, identify a target auxiliary query function matched with the first query instruction; verify whether the target auxiliary query function belongs to the clipping function of the target page; if it is determined that the target auxiliary query function belongs to the clipping function of the target page, construct an auxiliary function processing request matched with the target auxiliary query function of the first query instruction, and send the auxiliary function processing request to the target middleware; wherein the target middleware is configured to perform auxiliary processing on the first query instruction by using the target auxiliary query function, and obtain database feedback data matched with the first query instruction from the backend database; and receive the database feedback data sent by the target middleware, and perform front-end display on the database feedback data.

[0140] The identification verification module 420 is specifically further configured to: if it is determined that the target auxiliary query function does not belong to the clipping function of the target page, verify whether the first query instruction needs to be cross-domain forwarded to the backend database; if it is determined that the first query instruction needs to be cross-domain forwarded to the backend database, verify whether a cross-domain forwarding function belongs to the clipping function of the target page; if it is determined that the cross-domain forwarding function belongs to the clipping function of the target page, construct a cross-domain forwarding request matched with the first query instruction, and send the cross-domain forwarding request to the target middleware; wherein the target middleware is configured to forward the first query instruction to the backend database by using the cross-domain forwarding function, and obtain database feedback data matched with the first query instruction from the backend database; and receive the database feedback data sent by the target middleware, and perform front-end display on the database feedback data.

[0141] The identification verification module 420 is specifically further configured to: if it is determined that the first query instruction does not need to be cross-domain forwarded to the backend database, or the cross-domain forwarding function does not belong to the clipping function of the target page, obtain database feedback data matched with the first query instruction from the backend database, and perform front-end display on the database feedback data.

[0142] Optionally, the target middleware is a pluggable middleware, and the apparatus further comprises a removal module configured to remove the target middleware to establish direct communication between the apparatus and the backend database when receiving a backend adaptation completion instruction fed back by the backend database.

[0143] The database access apparatus can execute the database access method provided by any embodiment of the application, has the corresponding function modules and beneficial effects of the execution method. Technical details not described in detail in the embodiment can be referred to the database access method provided by any embodiment of the application.

[0144] Since the database access apparatus introduced above is an apparatus that can execute the database access method in the embodiments of the present application, based on the database access method introduced in the embodiments of the present application, those skilled in the art can understand the specific implementation of the database access apparatus of the embodiments and various changes thereof, so how the database access apparatus implements the database access method in the embodiments of the present application will not be introduced in detail here. As long as the apparatus used to implement the database access method in the embodiments of the present application is implemented by those skilled in the art, it belongs to the scope of protection of the present application.

[0145] Figure 5 is a schematic diagram of a database access apparatus provided by the embodiments of the present application, as shown in Figure 5 the apparatus includes an instruction conversion module 510, a database access module 520, and a data feedback module 530, wherein:

[0146] The instruction conversion module 510 is configured to, when receiving an instruction conversion request matching a first query instruction in a target page, convert the first query instruction into a second query instruction that can be recognized by a backend database.

[0147] The database access module 520 is configured to access the backend database according to the second query instruction, and obtain database feedback data returned by the backend database for the second query instruction.

[0148] The data feedback module 530 is configured to send the database feedback data to the target page for page front-end display of the database feedback data.

[0149] The target middleware of the embodiments of the present application converts the first query instruction into a second query instruction that can be recognized by a backend database when receiving an instruction conversion request matching a first query instruction in a target page, then accesses the backend database according to the second query instruction, and obtains database feedback data returned by the backend database for the second query instruction, and finally sends the database feedback data to the target page for page front-end display of the database feedback data. Through the target middleware, the front-end and the back-end are decoupled, and the front-end and the back-end provide normal business services in the process of independent development.

[0150] Optionally, the apparatus further includes an auxiliary function processing module:

[0151] When receiving an accessibility processing request that matches a first query instruction on a target page, the system extracts the target accessibility query function included in the accessibility processing request; uses the target accessibility query function to perform accessibility processing on the first query instruction; after processing, accesses the backend database according to the first query instruction and obtains the database feedback data returned by the backend database in response to the first query instruction; and sends the database feedback data to the target page for front-end display of the database feedback data.

[0152] Optionally, the accessibility processing module is further configured to perform at least one of the following processes:

[0153] The system calls the caching component integrated in the target middleware to cache the first query command locally; calls the authentication component integrated in the target middleware to authenticate the first query command; and calls the monitoring component integrated in the target middleware to monitor and record the user behavior information in the first query command.

[0154] Optionally, the auxiliary function processing module is further configured to: upon receiving a cross-domain forwarding request matching the first query instruction on the target page, invoke the cross-domain access component integrated in the target middleware to send the first query instruction to a backend database belonging to a different domain than the frontend page; obtain the database feedback data returned by the backend database in response to the first query instruction; and send the database feedback data to the target page to display the database feedback data on the frontend of the page.

[0155] The database access device described above can execute the database access method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method. Technical details not described in detail in this embodiment can be found in the database access method provided in any embodiment of the present invention.

[0156] Since the database access device described above is an apparatus capable of executing the database access method in the embodiments of the present invention, those skilled in the art can understand the specific implementation methods and various variations of the database access device in this embodiment based on the database access method described in the embodiments of the present invention. Therefore, how the database access device implements the database access method in the embodiments of the present invention will not be described in detail here. Any apparatus used by those skilled in the art to implement the database access method in the embodiments of the present invention falls within the scope of protection of this application.

[0157] Figure 6A structural diagram of an electronic device 10 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application described and / or claimed in this document.

[0158] As shown, Figure 6 The electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., communicatively connected to the at least one processor 11, where the memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer programs stored in the read-only memory (ROM) 12 or loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0159] Various components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc., an output unit 17, such as various types of displays, speakers, etc., a storage unit 18, such as a magnetic disk, an optical disk, etc., and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0160] The processor 11 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as the database access method.

[0161] In some embodiments, the database access method can be implemented as a computer program tangibly embodied in a computer readable storage medium, e.g., storage unit 18. In some embodiments, parts or all of the computer program can be loaded and / or installed onto electronic device 10 via, e.g., ROM 12 and / or communication unit 19. When the computer program is loaded onto RAM 13 and executed by processor 11, one or more steps of the above-described database access method can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the database access method by way of other means, e.g., by way of firmware.

[0162] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, specially designed application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0163] Computer programs used to implement the methods of the application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed by the processor of the machine, implements the functions / acts specified in the flowcharts and / or block diagrams. The computer program can be executed entirely on a machine, partially on a machine and partially on a remote machine or entirely on a remote machine or server.

[0164] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0165] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0166] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0167] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, and solves the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.

[0168] The application also provides a computer storage medium storing a computer program, which, when executed by a computer processor, is used to execute the database access method according to any one of the above-mentioned embodiments of the application: in the loading and displaying process of a target page, a first query instruction built in the target page is extracted; it is verified whether the first query instruction can be recognized by a backend database; if it is determined that the first query instruction cannot be recognized by the backend database, an instruction conversion request matched with the first query instruction is constructed, and the instruction conversion request is sent to a target middleware; wherein the target middleware is used to convert the first query instruction in the instruction conversion request into a second query instruction that can be recognized by the backend database, and obtain database feedback data matched with the second query instruction from the backend database; the database feedback data sent by the target middleware is received, and the database feedback data is front-end displayed.

[0169] Or used to execute the database access method according to any one of the above-mentioned embodiments of the application: when receiving an instruction conversion request matched with a first query instruction in a target page, the first query instruction is converted into a second query instruction that can be recognized by a backend database; according to the second query instruction, the backend database is accessed, and database feedback data returned by the backend database for the second query instruction is obtained; the database feedback data is sent to the target page, so that the database feedback data is front-end displayed on the page.

[0170] The computer storage medium of the embodiments of the present application can adopt any combination of one or more computer readable media. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples (non-exhaustive list) of the computer readable storage medium include: an electrical connection having one or more wires, a portable computer diskette, 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. In this document, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, device or apparatus.

[0171] The computer readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which computer readable program code is carried. Such propagated data signal can take many forms, including but not limited to electro-magnetic signal, optical signal or any suitable combination thereof. The computer readable signal medium can also be any computer readable medium that is not a computer readable storage medium and that can transmit, propagate or transport program for use by or in connection with an instruction execution system, apparatus or device.

[0172] The program code contained on the computer readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire, cable, radio frequency (RF), or the like, or any suitable combination thereof.

[0173] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0174] It should be understood that various forms of flow shown above can be used, with steps reordered, added, or removed. For example, steps recited in the present application can be performed in parallel, in series, or in a different order, without limitation herein, so long as the desired results of the technical solutions of the present application are achieved.

[0175] It should be understood that the above-mentioned are only the preferred embodiments of the present application and the technical principles applied. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and those skilled in the art can make various obvious changes, readjustments and substitutions without departing from the scope of the present application. Therefore, although the present application has been described in more detail through the above embodiments, the present application is not limited to the above embodiments, and can include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims

1. A database access method, characterized in that, include: During the loading and display of the target page, the first query command built into the target page is extracted; Verify whether the first query command can be recognized by the backend database; If it is determined that the first query instruction cannot be recognized by the backend database, an instruction conversion request matching the first query instruction is constructed and the instruction conversion request is sent to the target middleware; The target middleware is located between the front-end page and the back-end database. It is used to convert the first query instruction in the instruction conversion request into a second query instruction that can be recognized by the back-end database, and to obtain database feedback data that matches the second query instruction from the back-end database. Receive the database feedback data sent by the target middleware, and display the database feedback data on the front end.

2. The method according to claim 1, characterized in that, After verifying whether the first query command can be recognized by the backend database, the process also includes: If it is determined that the first query instruction can be recognized by the backend database, then the target auxiliary query function that matches the first query instruction is identified based on the mapping relationship between the query instruction and the auxiliary query function. Verify whether the target auxiliary query function belongs to the cropping function of the target page; wherein, the cropping function is the function to be removed from the target page; If it is determined that the target auxiliary query function belongs to the cropping function of the target page, then an auxiliary function processing request matching the target auxiliary query function of the first query instruction is constructed, and the auxiliary function processing request is sent to the target middleware; The target middleware is used to perform auxiliary processing on the first query instruction using the target auxiliary query function, and to obtain database feedback data matching the first query instruction from the backend database. Receive the database feedback data sent by the target middleware, and display the database feedback data on the front end.

3. The method according to claim 2, characterized in that, After verifying whether the target auxiliary query function belongs to the cropping function of the target page, the following steps are also included: If it is determined that the target auxiliary query function does not belong to the cropping function of the target page, then verify whether the first query instruction needs to be forwarded across domains to the backend database; If it is determined that the first query instruction needs to be forwarded across domains to the backend database, then verify whether the cross-domain forwarding function belongs to the pruning function of the target page; If it is determined that the cross-domain forwarding function belongs to the pruning function of the target page, then a cross-domain forwarding request matching the first query instruction is constructed, and the cross-domain forwarding request is sent to the target middleware; The target middleware is used to forward the first query instruction to the backend database using the cross-domain forwarding function, and to obtain database feedback data matching the first query instruction from the backend database. Receive the database feedback data sent by the target middleware, and display the database feedback data on the front end.

4. The method according to claim 3, characterized in that, After verifying whether the first query instruction needs to be forwarded across domains to the backend database, the process further includes: If it is determined that the first query instruction does not need to be forwarded across domains to the backend database, or, If the cross-domain forwarding function is not part of the target page's clipping function, then the database feedback data matching the first query command is obtained from the backend database, and the database feedback data is displayed on the front end.

5. The method according to any one of claims 1-4, characterized in that, The target middleware is a pluggable middleware; The method further includes: Upon receiving the backend adaptation and modification completion instruction from the backend database, the target middleware is removed to establish direct communication with the backend database.

6. A database access method, characterized in that, include: When the target middleware receives an instruction conversion request that matches the first query instruction in the target page, it converts the first query instruction into a second query instruction that can be recognized by the backend database; wherein, the target middleware is located between the frontend page and the backend database. The target middleware accesses the backend database according to the second query instruction and obtains the database feedback data returned by the backend database in response to the second query instruction. The target middleware sends the database feedback data to the target page to display the database feedback data on the front end of the page.

7. The method according to claim 6, characterized in that, The method further includes: Upon receiving an accessibility processing request that matches the first query instruction on the target page, the target accessibility query function included in the accessibility processing request is extracted; The target-assisted query function is used to assist in processing the first query command; After processing is completed, according to the first query instruction, the backend database is accessed, and the database feedback data returned by the backend database in response to the first query instruction is obtained; The database feedback data is sent to the target page for front-end display.

8. The method according to claim 7, characterized in that, Specifically, the target-assisted query function is used to assist in processing the first query instruction, including at least one of the following: Call the caching component integrated in the target middleware to cache the first query command locally; The authentication component integrated in the target middleware is invoked to authenticate the first query command. as well as The monitoring component integrated in the target middleware is invoked to monitor and record the user behavior information in the first query command.

9. The method according to claim 6, characterized in that, The method further includes: When a cross-domain forwarding request matching the first query instruction in the target page is received, the cross-domain access component integrated in the target middleware is invoked to send the first query instruction to the backend database that belongs to a different domain from the frontend page. Obtain the database feedback data returned by the backend database in response to the first query command; The database feedback data is sent to the target page for front-end display.

10. A database access device, characterized in that, include: The query instruction extraction module is used to extract the first query instruction built into the target page during the loading and display process of the target page; The identification and verification module is used to verify whether the first query instruction can be recognized by the backend database; The instruction conversion module is used to construct an instruction conversion request that matches the first query instruction if it is determined that the first query instruction cannot be recognized by the backend database, and send the instruction conversion request to the target middleware; The target middleware is located between the front-end page and the back-end database. It is used to convert the first query instruction in the instruction conversion request into a second query instruction that can be recognized by the back-end database, and to obtain database feedback data that matches the second query instruction from the back-end database. The front-end display module is used to receive the database feedback data sent by the target middleware and display the database feedback data on the front end.

11. An electronic device, characterized in that, The electronic device includes: One or more processors; Storage device for storing one or more computer programs; When the one or more computer programs are executed by the one or more processors, the one or more processors execute the computer programs to implement the database access method as described in any one of claims 1-5, or to implement the database access method as described in any one of claims 6-9.

12. A computer storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the database access method as described in any one of claims 1-5, or the database access method as described in any one of claims 6-9.

Citation Information

Patent Citations

  • Database access method, device and equipment

    CN108959315A