Method and device for displaying database statements on browser side page and storage medium

By automatically detecting and storing SQL statements on the browser side and using the RESTful API to display them on the browser side, the problem that the browser side cannot display database statements on the new retail software system is solved, and technical support efficiency and user experience are improved.

CN119807508AInactive Publication Date: 2025-04-11BEIJING ZHONGQI ZHIYUAN DIGITAL INFORMATION TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510300292.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-04-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In Xinhua Bookstore Group's new retail software system, information administrators and manufacturer project technical support personnel need to apply and coordinate frequently, resulting in the browser being unable to display database statements, which are inefficient, delayed response speed, poor user experience, and consume a lot of work costs.

Method used

By automatically detecting and storing executed SQL statements on the browser side, using the RESTful API provided by the server side, the browser side can directly display SQL statements and ensure that only authorized users can view them through permission control.

Benefits of technology

It realizes cross-end tracking of database SQL statements on the browser and server side, improves the efficiency of technical support, reduces labor and time costs, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807508A_ABST
    Figure CN119807508A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a device for displaying database statements on a browser side page and a storage medium. The method comprises the following steps: acquiring a unique identifier of user login of a software system; obtaining a software service function unique identifier; detecting a database type accessed by the function; detecting an SQL command and a query parameter of the function access database; then, according to the detected database type, SQL commands and parameters are analyzed, and final executable SQL statements are formed; storing the obtained SQL statement in a session memory; a server side provides a Restful API, a user can access the API in an http request mode at a browser side, and an SQL statement command in a memory is obtained and directly displayed on a web page of the browser side; only the user or the role granted with the corresponding authority can use the functions of the invention. According to the invention, cross-end tracking of database SQL statements at the browser end and the server end is realized, and great convenience is provided for daily technical support work.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a method, a device and a storage medium for displaying database statements on a browser page. Background Art

[0002] BS architecture software system is divided into browser side and server side. Xinhua Bookstore Group's new retail software system, all data display business functions or data retrieval functions, the program flow is generally that the browser side initiates an http request to the application server side, the application server side, through the SQL (English full name: Structured Query Language, structured query language) statement to the database to initiate a query request to obtain data, and then respond to the browser side, and present the data on the browser side web page. The generation and execution of SQL statement commands are all on the server side of the computer room, which is invisible to the user's browser side.

[0003] In addition, Xinhua Bookstore Group has strict information security and authority regulations. According to the security regulations, there are strict authority divisions and security controls for relevant work roles. Different roles are granted different security permissions. For example, the DBA has management permissions for production database query, operation and maintenance, data security, etc. The information center administrator and manufacturer project implementation technical support personnel only have the right to use the functions of the new retail system, and do not have access to the production database. All database permissions are closed to personnel other than the DBA.

[0004] Information center administrators and vendor project technical support personnel need to undertake technical support work for billions of data in the entire group on a daily basis. Therefore, based on the strict information management system of the Xinhua Bookstore system, information administrators or vendor technical support personnel often need to apply for and coordinate with multiple parties on a daily basis, which is time-consuming and labor-intensive, inefficient, and has a delayed response speed. The user experience is very poor, and at the same time, a large amount of daily information work costs are consumed. Inefficient technical support may even cause usage barriers to the software system or cause property losses to the group. Summary of the invention

[0005] To this end, the present invention provides a method, device and storage medium for displaying database statements on a browser-side page based on the Xinhua Bookstore new retail information management system, so as to solve the problem in the prior art that the browser-side page cannot display database statements.

[0006] In order to achieve the above object, the present invention provides the following technical solutions:

[0007] A method for displaying database statements on a browser page. It can follow the business function http request, automatically detect the executed SQL statement, store the SQL statement in the server-side session memory, and directly display the SQL statement on the browser web page through the RESTful API (representational state transfer application programming interface) provided by the server.

[0008] Further: comprising the following steps:

[0009] (1) Obtain the unique identification of the software system user login;

[0010] (2) Obtain the unique identifier of the software business function;

[0011] (3) Detect the type of database accessed by the software business function; detect the SQL commands and query parameters used by the software business function to access the database;

[0012] (4) Then, based on the detected database type, parse the SQL commands and parameters to form the final executable SQL statement;

[0013] (5) Store the obtained SQL statement in the session memory;

[0014] (6) The server provides a RESTful API. Users can access the API through http requests on the browser side, and the SQL statement commands in the session memory are directly displayed on the browser web page.

[0015] Furthermore: only users or roles that are granted corresponding permissions can display database statements on the browser side.

[0016] Further: extracting keyword information in the SQL statement information; the keyword information includes at least one of the function serial number menuid, semantic keywords, operation table information, target table information, field information, condition information and session identifier sessionid.

[0017] Furthermore: the semantic keywords include at least one of insert (insert data), delete (delete data), update (update data) and select (query data).

[0018] In order to achieve the above object, the present invention provides the following technical solutions:

[0019] A device for displaying database statements on a browser page, comprising:

[0020] The information acquisition module is used to obtain the user session identifier sessionid and the business function identifier menuid;

[0021] Detection module, used to detect database type, dialect type, SQL command and request parameters;

[0022] The parsing module parses SQL commands and parameters according to the database type and dialect type, and synchronously obtains the SQL statements that are ultimately executed on the database;

[0023] The storage module is used to store the parsing results according to the user session identifier + business identifier, and temporarily write the parsing results into the memory or other high-speed cache;

[0024] The display module is used to provide a RESTful API to display the SQL statements in the storage, which can eventually be directly presented on the user's web page;

[0025] The permission module is used for security control. Only authorized users can request to display SQL statements. Users without permission will not be displayed.

[0026] Going further: each operation flow of the device that displays database statements on the browser page contains 3 nodes, one of which is responsible for obtaining the user session identifier sessionid and the business function identifier menuid; another node is responsible for detecting the database type dialect and tracking and parsing the SQL finally executed; the third node is responsible for storing and retrieving the database SQL in the memory.

[0027] The present invention discloses a computer device, which comprises a processor, and the processor is used for executing a computer program stored in a memory to realize the method for displaying database statements on a browser-side page.

[0028] The present invention also discloses a computer storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for displaying database statements on a browser-side page is realized.

[0029] The present invention has the following advantages: by breaking through the technical barriers between the browser side and the cloud server side of a specific user, the cross-side tracking of database SQL statements between the browser side and the server side is achieved, which provides great convenience for daily technical support work, facilitates the technical support personnel of software manufacturers and the information administrators of Xinhua Bookstore, and enables them to carry out daily technical support work more efficiently, reduces the manpower and time costs of technical support, and improves the user experience of software system technical support.

[0030] Other features and advantages of the present invention will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practicing the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more intuitively illustrate the prior art and the present application, exemplary drawings are given below. It should be understood that the specific shapes and structures shown in the drawings should not generally be regarded as limiting conditions for implementing the present application; for example, those skilled in the art are capable of easily making conventional adjustments or further optimizations to the addition / reduction / attribution division, specific shapes, positional relationships, connection methods, dimensional ratios, etc. of certain units (components) based on the technical concepts and exemplary drawings disclosed in the present application.

[0032] Figure 1 The present invention is a flowchart of a method for displaying database statements on a browser-side page.

[0033] Figure 2 The present invention is a schematic diagram of the structure of a device for displaying database statements on a browser page.

[0034] Figure 3 A schematic diagram of the structure of a storage medium provided by an embodiment of the present invention.

[0035] Figure 4 This is a schematic diagram of an interface in which a user obtains SQL stored in a session memory on a browser-side web page in an embodiment of the present invention.

[0036] Figure 5 This is a schematic diagram of a partial code interface of a database statement displayed on an authorized user browser page in an embodiment of the present invention. DETAILED DESCRIPTION

[0037] The following is an explanation of the implementation of the present invention by specific specific examples. People familiar with this technology can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. It should be understood that these embodiments are only to further illustrate the present invention and cannot be understood as limiting the scope of protection of the present invention. Technical engineers in this field can make some non-essential improvements and adjustments to the present invention based on the contents of the above invention; 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] See also Figure 1 , a method for displaying database statements on a browser page, comprising the following steps:

[0039] (1) Get the user session identifier sessionid. After the user successfully logs in to the system, the system will create a unique session. The session has a unique identifier, namely sessionid.

[0040] (2) Obtaining a service function identifier menuid; after the user operates a specific function, the detection module in the present invention records the specific function identifier menuid.

[0041] (3) Detect database type, database request and parameters; the detection program can accurately obtain the current database type with the help of jdbc\mybatis\jpa (or other persistence layer framework) related interfaces. Database types include Oracle, MySQL, PostgreSQL, SQL Server, DB2, H2, DAMO, Renmin University of China Golden Warehouse and other relational databases. Different types of databases have different subsequent parsing processes due to differences in syntax specifications. At the same time, with the help of Java platform interceptor technology, the database request and parameters of the current operation are detected; database requests and parameters include query, modification, deletion, write and other operations and the related parameters carried.

[0042] (4) Parse and synchronize the SQL statements executed on the database. Through the parsing program, first determine the database type. Different types of databases have different parsing algorithms corresponding to them. The parsing algorithm can parse the request and parameters of the database and restore the complete SQL statement that is finally executed on the database side. The parsing program is roughly as follows:

[0043] (5) Store SQL statements in session memory. The system allocates a block of memory for each session for the current user to store related variables and parameters. When the session expires, the memory is automatically released and recycled. The parsed SQL can be temporarily stored in the session memory. Some of the code is as follows:

[0044] (6) The user requests the SQL statement to appear; on the browser side web page, the user can request the API fetch_fullsql through http post to obtain the SQL stored in the session memory (such as Figure 4 as shown).

[0045] (7) According to the user authority control security policy, decide whether the SQL statement is displayed on the browser page; in actual implementation, there are certain security risks. Consider using user authentication and authority policies to ensure the security and privilege of resource access; only authorized users have the right to operate this operation; eliminate the security risks of network attacks; some codes such as Figure 5 shown.

[0046] See also Figure 2, a device for displaying database statements on a browser page, each operation flow includes 3 nodes, one of which is responsible for obtaining a user session identifier sessionid and a business function identifier menuid; the second node is responsible for detecting the database type dialect and tracking and parsing the SQL finally executed; the third node is responsible for storing and extracting the database SQL in the memory; including:

[0047] The information acquisition module is used to obtain the user session identifier sessionid and the business function identifier menuid;

[0048] Detection module, used to detect database type, dialect type, SQL command and request parameters;

[0049] The parsing module parses SQL commands and parameters according to the database type and dialect type, and synchronously obtains the SQL statements that are ultimately executed on the database;

[0050] The storage module is used to store the parsing results according to the user session ID + business ID, and temporarily write the parsing results into the memory (or other high-speed cache such as redis, etc.);

[0051] The display module is used to provide a RESTful API to display the SQL statements in the storage, which can eventually be directly presented on the user's web page;

[0052] The permission module is used for security control. Only authorized users can request to display SQL. Users without permission will not be displayed.

[0053] See also Figure 3 A storage medium for displaying database statements on a browser page stores a computer program, and when the computer program is executed by a processing unit, the method for displaying database statements on a browser page is implemented.

[0054] The computer device of the present invention is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions. Its hardware includes but is not limited to microprocessors, application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), digital signal processors (DSP), embedded devices, etc. The computer device can be a computing device such as a desktop computer, a notebook, a handheld computer, and a cloud server. The computer device can interact with the user through a keyboard, a mouse, a remote control, a touchpad, or a voice control device.

[0055] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for displaying database statements on a browser page, characterized in that: It can follow the business function http request, detect the executed SQL statement, store the SQL statement in the session memory on the server side, and through the RestfulAPI provided by the server side, the browser web page can directly display the SQL statement.

2. The method for displaying database statements on a browser page according to claim 1, characterized in that: The following steps are involved: (1) Obtain the unique identification of the software system user login; (2) Obtain the unique identifier of the software business function; (3) Detect the type of database accessed by the software business functions; and detect the SQL commands and query parameters used by the software business functions to access the database; (4) Then, based on the detected database type, parse the SQL commands and parameters to form the final executable SQL statement; (5) Store the obtained SQL statement in the session memory; (6) The server provides a RESTful API. Users access the API through http requests on the browser side, and the SQL statements in the session memory are directly displayed on the browser web page.

3. The method for displaying database statements on a browser page according to claim 2, characterized in that: Only users or roles that have been granted permissions can display database statements in the browser.

4. The method for displaying database statements on a browser page according to claim 1, characterized in that: Extract keyword information from the SQL statement; the keyword information includes at least one of the function serial number menuid, semantic keyword, operation table information, target table information, field information, condition information and session identifier sessionid.

5. The method for displaying database statements on a browser page according to claim 4, characterized in that: The semantic keywords include at least one of insert, delete, update and select.

6. A device for displaying database statements on a browser page, characterized in that: include: The information acquisition module is used to obtain the user session identifier sessionid and the business function identifier menuid; Detection module, used to detect database type, dialect type, SQL command and request parameters; The parsing module parses SQL commands and parameters according to the database type and dialect type, and synchronously obtains the SQL statements that are ultimately executed on the database; The storage module is used to store the parsing results according to the user session identifier + business identifier, and temporarily write the parsing results into the memory or cache; The display module is used to provide a RESTful API to display the SQL statements in the storage, which can eventually be directly presented on the user's web page; The permission module is used for security control. Only authorized users can request to display SQL statements. Users without permission will not be displayed.

7. A computer device, characterized in that: The computer device comprises a processor, and the processor is used to execute a computer program stored in a memory to implement the method for displaying database statements on a browser-side page according to any one of claims 1-6.

8. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for displaying database statements on a browser page according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • SQL (Structured Query Language) processing method and device

    CN104572979A

  • SQL data real-time processing method and device based on Flink, computer equipment and medium

    CN111666296A

  • Database operating system and method based on Spingboot

    CN115203232A

  • Data base link web page constructing system

    JP2002014864A