[go: up one dir, main page]

WO2021078176A1 - 存储过程的运行方法、装置、数据库系统及存储介质 - Google Patents

存储过程的运行方法、装置、数据库系统及存储介质 Download PDF

Info

Publication number
WO2021078176A1
WO2021078176A1 PCT/CN2020/122640 CN2020122640W WO2021078176A1 WO 2021078176 A1 WO2021078176 A1 WO 2021078176A1 CN 2020122640 W CN2020122640 W CN 2020122640W WO 2021078176 A1 WO2021078176 A1 WO 2021078176A1
Authority
WO
WIPO (PCT)
Prior art keywords
sql
stored procedure
engine
processing engine
request message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2020/122640
Other languages
English (en)
French (fr)
Inventor
李金虎
陆平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to EP20878988.3A priority Critical patent/EP4044043A4/en
Priority to JP2022521107A priority patent/JP7427775B2/ja
Priority to US17/765,947 priority patent/US20220374423A1/en
Publication of WO2021078176A1 publication Critical patent/WO2021078176A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/211Schema design and management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • G06F16/2443Stored procedures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/256Integrating or interfacing systems involving database management systems in federated or virtual databases

Definitions

  • This application relates to the field of databases, for example, to a method, device, database system, and storage medium for operating a stored procedure.
  • Stored Procedure is a set of Structured Query Language (SQL) statements that can complete specific functions stored in a database system, including SQL statements and process control statements.
  • SQL Structured Query Language
  • different engines need to be accessed separately, which will lead to restrictions on the application, that is, the execution of SQL in the application and the execution of the stored procedure require access to the distributed database Different parts.
  • the SQL processing engine is tightly coupled with the execution of the stored procedure, which will cause one of the SQL processing engine and the stored procedure engine to malfunction and cause the entire function to malfunction.
  • the SQL processing engine needs to be highly reliable and highly available, and the instability of the SQL processing engine cannot be caused by adding the distributed stored procedure function.
  • the present application provides an operating method, device, database system and storage medium of a stored procedure, which can realize the operation of a distributed stored procedure in a distributed database while ensuring the stability of the SQL processing engine.
  • a method for running a stored procedure including:
  • the structured query language SQL processing engine sends a stored procedure execution request message to the stored procedure engine
  • the SQL processing engine repeatedly executes multiple SQL execution request messages sent by the stored procedure engine, where each step executed corresponds to a SQL execution request message;
  • the SQL processing engine receives the stored procedure execution response message sent by the stored procedure engine.
  • the embodiment of the present application provides a method for operating a stored procedure, including:
  • the stored procedure engine receives the stored procedure execution request message sent by the structured query language SQL processing engine;
  • the stored procedure engine constructs and sends multiple SQL execution request messages to the SQL processing engine multiple times, where each step of constructing and sending corresponds to a SQL execution request message;
  • the stored procedure engine sends a stored procedure execution response message to the SQL processing engine.
  • a SQL processing engine including a processor, and the processor is configured to implement the method on the SQL processing engine side when the computer program is executed.
  • a stored procedure engine which includes a processor, and the processor is configured to implement the above-mentioned method on the stored procedure engine side when the computer program is executed.
  • the database system includes: the above-mentioned stored procedure engine and the above-mentioned structured query language SQL processing engine.
  • a computer-readable storage medium which stores a computer program, and when the computer program is executed by a processor, the operation method of the above-mentioned storage process is realized.
  • FIG. 1 is a schematic structural diagram of a database system provided by an embodiment
  • FIG. 2 is a schematic flowchart of a method for operating a stored procedure according to an embodiment
  • FIG. 3 is a schematic flowchart of another method for operating a stored procedure according to an embodiment
  • FIG. 4 is a schematic diagram of interaction of a method for running a stored procedure provided by an embodiment
  • FIG. 5 is an interactive schematic diagram of another method for running a stored procedure provided by an embodiment
  • FIG. 6 is an interactive schematic diagram of yet another method for running a stored procedure provided by an embodiment
  • FIG. 7 is a schematic structural diagram of a device for running a stored procedure according to an embodiment
  • FIG. 8 is a schematic structural diagram of another storage process running device provided by an embodiment
  • FIG. 9 is a schematic structural diagram of a SQL processing engine provided by an embodiment
  • FIG. 10 is a schematic structural diagram of a stored procedure engine provided by an embodiment.
  • a stored procedure is a set of SQL statements that can complete a specific function stored in the database system.
  • the stored procedure can include SQL statements (a SQL statement is usually an expression, which can include at least one sub-expression) and a flow control statement (A flow control statement can constitute a flow control statement block, and the flow control statement block can include multiple SQL statements).
  • the SQL processing engine which will lead to restrictions on the application, that is, the execution of SQL in the application and the execution of stored procedures require access to different components in the distributed database.
  • the SQL processing engine is tightly coupled with the execution of the stored procedure, which will cause one of the SQL processing engine and the stored procedure engine to malfunction and cause the entire function to malfunction.
  • the SQL processing engine needs to be highly reliable and highly available, and the instability of the SQL processing engine cannot be caused by adding the distributed stored procedure function.
  • Fig. 1 is a schematic structural diagram of a database system provided by an embodiment.
  • the database system includes a stored procedure engine and a SQL processing engine.
  • the stored procedure engine is used to run stored procedures, has the function of controlling the flow of the stored procedures, and belongs to the stored procedure execution engine module of the distributed database; and
  • the SQL processing engine is used to execute SQL statements in stored procedures, has the ability to execute SQL, and belongs to the SQL execution module of the distributed database.
  • the SQL processing engine provides users with an access point, receives user requests, and implements a single access point mode (that is, the application program accesses this access point to execute the SQL and stored procedures requested by the user without customizing the application program).
  • the SQL processing engine is also connected to n data storage nodes (Database, DB).
  • a method for running a stored procedure that can be run in the aforementioned database system is provided, which can realize the running of a distributed stored procedure in a distributed database while ensuring the stability of the SQL processing engine.
  • system and "network” in this application are often used interchangeably in this application.
  • Each of the following embodiments of the present application can be executed separately, and multiple embodiments can also be combined with each other for execution, and the embodiments of the present application do not specifically limit this.
  • Fig. 2 is a schematic flowchart of a method for running a stored procedure provided by an embodiment. As shown in Fig. 2, the method provided in this embodiment is applicable to a SQL processing engine, and the method includes the following steps:
  • the SQL processing engine sends a stored procedure execution request message to the stored procedure engine.
  • the SQL processing engine receives the request message input by the user.
  • the request message input by the user may include at least one of an SQL execution request message and a stored procedure execution request message. If the request message input by the user is a SQL execution request message, the SQL processing engine directly executes the SQL execution request message; if the request message input by the user is a stored procedure execution request message, the SQL processing engine continues to perform step S110.
  • the SQL processing engine can identify whether the request message input by the user is an SQL execution request message or a stored procedure execution request message by parsing the request message input by the user.
  • the SQL processing engine executes multiple SQL execution request messages sent by the stored procedure engine multiple times, and each executed step corresponds to one SQL execution request message.
  • step S120 may include the following steps:
  • Step 1a) The SQL processing engine receives the SQL execution request message sent by the stored procedure engine.
  • Step 1b The SQL processing engine processes the SQL execution request message.
  • Step 1c) The SQL processing engine sends a SQL execution response message to the stored procedure engine.
  • Step 1d The SQL processing engine receives the SQL result set request message sent by the stored procedure engine.
  • Step 1e) The SQL processing engine sends an SQL result set response message to the stored procedure engine according to the SQL result set request message, and the SQL result set response message carries the SQL execution result.
  • Step 1f The SQL processing engine receives the SQL result release instruction message sent by the stored procedure engine.
  • Step 1g The SQL processing engine releases the SQL result set according to the SQL result release instruction message.
  • the SQL processing engine returns to perform step 1a) until the stored procedure engine no longer sends SQL execution request messages.
  • the SQL processing engine if an error occurs when the SQL processing engine executes the SQL execution request message sent by the stored procedure engine, the SQL processing engine sends an error prompt message to the stored procedure engine.
  • the SQL processing engine receives a stored procedure execution response message sent by the stored procedure engine.
  • the SQL processing engine after the SQL processing engine receives the stored procedure execution response message sent by the stored procedure engine, the SQL processing engine feeds back the final stored procedure execution result to the user.
  • FIG. 3 is a schematic flowchart of another method for running a stored procedure provided by an embodiment. As shown in FIG. 3, the method provided by this embodiment is applicable to a stored procedure engine, and the method includes the following steps.
  • the stored procedure engine receives the stored procedure execution request message sent by the SQL processing engine.
  • the stored procedure engine constructs and sends multiple SQL execution request messages to the SQL processing engine multiple times, and each step of constructing and sending corresponds to one SQL execution request message.
  • step S220 may include the following steps:
  • Step 2a The stored procedure engine constructs the SQL execution request message according to the stored procedure execution request message.
  • Step 2b) The stored procedure engine sends a SQL execution request message to the SQL processing engine.
  • Step 2c The stored procedure engine receives the SQL execution response message sent by the SQL processing engine.
  • Step 2d The stored procedure engine sends the SQL result set request message to the SQL processing engine.
  • Step 2e) The stored procedure engine receives the SQL result set response message sent by the SQL processing engine, and the SQL result set response message carries the SQL execution result.
  • Step 2f) The stored procedure engine sends a SQL result release instruction message to the SQL processing engine.
  • the stored procedure engine returns to perform step 2a) until the stored procedure engine no longer constructs the SQL execution request message.
  • the stored procedure engine sends a stored procedure execution response message to the SQL processing engine.
  • the stored procedure engine if the stored procedure engine makes an error while executing the stored procedure, the stored procedure engine writes the error information into the stored procedure execution response message.
  • FIG. 4 is an interactive schematic diagram of a method for running a stored procedure provided by an embodiment. As shown in FIG. 4, the method includes the following steps:
  • the SQL processing engine sends a stored procedure execution request message to the stored procedure engine.
  • the SQL processing engine receives the request message input by the user.
  • the request message input by the user may include at least one of an SQL execution request message and a stored procedure execution request message. If the request message input by the user is an SQL execution request message, the SQL processing engine directly executes the SQL execution request message; if the request message input by the user is a stored procedure execution request message, the SQL processing engine continues to perform step S310.
  • the SQL processing engine can identify whether the request message input by the user is an SQL execution request message or a stored procedure execution request message by parsing the request message input by the user.
  • the stored procedure execution request message includes a CALL statement and parameter information.
  • the parameter information includes at least one of parameter output information, parameter input information, and parameter input information.
  • the stored procedure engine receives the stored procedure execution request message sent by the SQL processing engine.
  • the stored procedure engine constructs an SQL execution request message according to the stored procedure execution request message.
  • the stored procedure engine After the stored procedure engine receives the stored procedure execution request message, it calls the internal processing procedure to execute the stored procedure requested in the stored procedure execution request message.
  • the stored procedure engine When the SQL instruction is encountered during the execution of the stored procedure, the stored procedure engine will be based on The SQL instruction constructs a complete SQL statement (that is, the SQL execution request message), and then sends it to the SQL processing engine for execution, and waits for the SQL processing engine to return the SQL execution response message.
  • the stored procedure engine sends an SQL execution request message to the SQL processing engine.
  • the SQL processing engine receives the SQL execution request message sent by the stored procedure engine.
  • the SQL processing engine processes the SQL execution request message.
  • the SQL processing engine sends an SQL execution response message to the stored procedure engine.
  • the stored procedure engine receives the SQL execution response message sent by the SQL processing engine.
  • the stored procedure engine After the stored procedure engine receives the SQL execution response message returned by the SQL processing engine, it continues to execute the stored procedure from the waiting point until it encounters the next SQL instruction. When the next SQL instruction is encountered, the execution of steps S312-S317 is returned until the execution of the stored procedure is completed.
  • the stored procedure engine when the stored procedure engine needs the execution result of SQL, it may further include the following steps S318-S324.
  • S318 The stored procedure engine sends the SQL result set request message to the SQL processing engine.
  • the SQL processing engine receives the SQL result set request message sent by the stored procedure engine.
  • the SQL processing engine sends an SQL result set response message to the stored procedure engine according to the SQL result set request message, and the SQL result set response message carries the SQL execution result.
  • the stored procedure engine receives the SQL result set response message sent by the SQL processing engine.
  • S322 The stored procedure engine sends a SQL result release instruction message to the SQL processing engine.
  • the SQL processing engine receives the SQL result release instruction message sent by the stored procedure engine.
  • the SQL processing engine releases the SQL result set according to the SQL result release instruction message.
  • the stored procedure engine sends a stored procedure execution response message to the SQL processing engine.
  • the stored procedure engine After the stored procedure engine executes a complete stored procedure, the stored procedure engine sends a stored procedure execution response message to the SQL processing engine.
  • the stored procedure execution response message includes the output parameter information.
  • the SQL processing engine receives a stored procedure execution response message sent by the stored procedure engine.
  • the SQL processing engine after the SQL processing engine receives the stored procedure execution response message sent by the stored procedure engine, the SQL processing engine feeds back the final stored procedure execution result to the user.
  • the SQL processing engine executes each SQL statement dynamically generated by the stored procedure engine to realize the distributed execution of the entire stored procedure.
  • Figure 5 is an interactive schematic diagram of another stored procedure running method provided by an embodiment.
  • the difference from the running method of the stored procedure shown in Figure 4 is that the SQL processing engine shown in Figure 5 executes the SQL execution request message. If an error occurs, the SQL processing engine can send an error message to the stored procedure engine instead of directly prompting the user that an error has occurred. Whether the stored procedure can continue to be executed needs to be determined by the processing procedure in the stored procedure engine, because the definition of the stored procedure may include the definition of error handling.
  • FIG. 6 is an interactive schematic diagram of another method for running a stored procedure provided by an embodiment.
  • the difference from the method for running a stored procedure shown in FIG. 4 is that the stored procedure engine shown in FIG. 6 makes an error when executing the stored procedure.
  • the stored procedure engine can write error information into the stored procedure execution response message.
  • the SQL processing engine and the stored procedure engine can be isolated from each other.
  • one of the SQL processing engine and the stored procedure engine fails, it will not cause the other to fail, and it will not affect the SQL processing engine to process other services of the user. Ensure the stability of the SQL processing engine.
  • FIG. 7 is a schematic structural diagram of a device for running a stored procedure provided by an embodiment.
  • the device for running a stored procedure can be configured in a SQL processing engine. As shown in FIG. 7, it includes a sending module 10, a processing module 11, and a receiving module. 12.
  • the sending module 10 is configured to send a stored procedure execution request message to the stored procedure engine.
  • the processing module 11 is configured to execute multiple SQL execution request messages sent by the stored procedure engine multiple times, and each executed step corresponds to one SQL execution request message.
  • the receiving module 12 is configured to receive a stored procedure execution response message sent by the stored procedure engine.
  • the operating device of the stored procedure provided in this embodiment is configured to implement the operating method of the stored procedure of the foregoing embodiment, and the implementation principle and technical effect of the operating device of the stored procedure provided in this embodiment are similar to the implementation principle and technical effect of the operating method of the foregoing stored procedure. No longer.
  • the receiving module 12 is also set to receive SQL execution request messages sent by the stored procedure engine; the processing module 11 is set to process SQL execution request messages received by the receiving module 12; the sending module 10 is also set to send the stored procedure engine Send SQL execution response message; until the stored procedure engine no longer sends SQL execution request message.
  • the receiving module 12 is further configured to receive the SQL result set request message sent by the stored procedure engine; the sending module 10 is further configured to send the SQL result set response message to the stored procedure engine according to the SQL result set request message,
  • the SQL result set response message carries the execution result of the SQL.
  • the receiving module 12 is further configured to receive the SQL result release instruction message sent by the stored procedure engine; the processing module 11 is also configured to release the SQL result set according to the SQL result release instruction message.
  • the sending module 10 is further configured to send an error prompt message to the stored procedure engine when the processing module 11 executes the SQL execution request message sent by the stored procedure engine and an error occurs.
  • the receiving module 12 is further configured to obtain the stored procedure execution request message before the sending module 10 sends the stored procedure execution request message to the stored procedure engine.
  • FIG. 8 is a schematic structural diagram of another storage process running device provided by an embodiment.
  • the storage process running device can be configured in the storage process engine. As shown in FIG. 8, it includes a receiving module 20, a processing module 21, and a sending module. Module 22.
  • the receiving module 20 is configured to receive a stored procedure execution request message sent by the structured query language SQL processing engine.
  • the processing module 21 is configured to construct the SQL execution request message multiple times.
  • the sending module 22 is configured to send a SQL execution request message to the SQL processing engine; and send a stored procedure execution response message to the SQL processing engine.
  • the operating device of the stored procedure provided in this embodiment is configured to implement the operating method of the stored procedure of the foregoing embodiment, and the implementation principle and technical effect of the operating device of the stored procedure provided in this embodiment are similar to the implementation principle and technical effect of the operating method of the foregoing stored procedure. No longer.
  • the processing module 21 is configured to construct an SQL execution request message according to the stored procedure execution request message; the sending module 22 is configured to send the SQL execution request message constructed by the processing module 21 to the SQL processing engine; the receiving module 20 also It is set to receive the SQL execution response message sent by the SQL processing engine; until the processing module 21 no longer constructs the SQL execution request message.
  • the sending module 22 is further configured to send a SQL result set request message to the SQL processing engine; the receiving module 20 is further configured to receive a SQL result set response message sent by the SQL processing engine, and the SQL result set response message carries SQL.
  • the results of the implementation are further configured to send a SQL result set request message to the SQL processing engine; the receiving module 20 is further configured to receive a SQL result set response message sent by the SQL processing engine, and the SQL result set response message carries SQL.
  • the sending module 22 is further configured to send a SQL result release instruction message to the SQL processing engine.
  • the processing module 21 is further configured to write error information into the stored procedure execution response message when the processing module 21 executes the stored procedure and an error occurs.
  • FIG. 9 is a schematic structural diagram of a SQL processing engine provided by an embodiment.
  • the SQL processing engine includes a processor 30, a memory 31, and a communication interface 32; the number of processors 30 in the SQL processing engine may be One or more, one processor 30 is taken as an example in FIG. 9; the processor 30, the memory 31, and the communication interface 32 in the SQL processing engine may be connected by a bus or other methods.
  • a bus connection is taken as an example.
  • the bus represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any bus structure among multiple bus structures.
  • the memory 31 can be configured to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the methods in the embodiments of the present application.
  • the processor 30 executes at least one functional application and data processing of the SQL processing engine by running the software programs, instructions, and modules stored in the memory 31, that is, realizes the operation method of the above-mentioned stored procedure.
  • the memory 31 may include a program storage area and a data storage area.
  • the program storage area may store an operating system and an application program required by at least one function; the data storage area may store data created according to the use of the SQL processing engine and the like.
  • the memory 31 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
  • the memory 31 may include a memory remotely provided with respect to the processor 30, and these remote memories may be connected to the SQL processing engine through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
  • the communication interface 32 can be configured to receive and send data.
  • FIG. 10 is a schematic structural diagram of a stored procedure engine provided by an embodiment.
  • the stored procedure engine includes a processor 40, a memory 41, and a communication interface 42; the number of processors 40 in the stored procedure engine may be One or more, one processor 40 is taken as an example in FIG. 10; the processor 40, the memory 41, and the communication interface 42 in the storage process engine may be connected by a bus or other methods.
  • a bus connection is taken as an example.
  • the bus represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any bus structure among multiple bus structures.
  • the memory 41 can be configured to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the methods in the embodiments of the present application.
  • the processor 40 executes at least one functional application and data processing of the stored procedure engine by running the software programs, instructions, and modules stored in the memory 41, that is, realizes the above-mentioned operating method of the stored procedure.
  • the memory 41 may include a storage program area and a storage data area.
  • the storage program area may store an operating system and an application program required by at least one function; the storage data area may store data created according to the use of a stored process engine, and the like.
  • the memory 41 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
  • the memory 41 may include a memory remotely provided with respect to the processor 40, and these remote memories may be connected to the stored process engine through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
  • the communication interface 42 can be configured to receive and send data.
  • the embodiments of the present application also provide a computer-readable storage medium, and the computer-readable storage medium stores a computer program, and the computer program implements the method provided in any embodiment of the present application when the computer program is executed by a processor.
  • the computer storage media in the embodiments of the present application may adopt any combination of one or more computer-readable media.
  • the computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above.
  • Computer-readable storage media include (non-exhaustive list): electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (Read-Only Memory) , ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), flash memory, optical fiber, portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical storage Components, magnetic storage devices, or any suitable combination of the above.
  • the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
  • the computer-readable signal medium may include a data signal propagated in baseband or as a part of a carrier wave, and the computer-readable program code is carried in the data signal. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium.
  • the computer-readable medium may send, propagate, or transmit the program for use by or in combination with the instruction execution system, apparatus, or device .
  • the program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.
  • suitable medium including but not limited to wireless, wire, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.
  • the computer program code used to perform the operations of the present disclosure can be written in one or more programming languages or a combination of multiple programming languages.
  • the programming languages include object-oriented programming languages-such as Java, Smalltalk, C++, Ruby, Go also includes conventional procedural programming languages-such as "C" language or similar programming languages.
  • the program code can be executed entirely on the user's computer, partly on the user's computer, executed as an independent software package, partly on the user's computer and partly executed on a remote computer, or entirely executed on the remote computer or server.
  • the remote computer can be connected to the user's computer through any kind of network-including Local Area Network (LAN) or Wide Area Network (WAN)-or it can be connected to an external computer (for example, use an Internet service provider to connect via the Internet).
  • LAN Local Area Network
  • WAN Wide Area Network
  • the various embodiments of the present application may be implemented in hardware or dedicated circuits, software, logic or any combination thereof.
  • some aspects may be implemented in hardware, while other aspects may be implemented in firmware or software that may be executed by a controller, microprocessor, or other computing device, although the present application is not limited thereto.
  • Computer program instructions can be assembly instructions, Instruction Set Architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or written in any combination of one or more programming languages Source code or object code.
  • ISA Instruction Set Architecture
  • the block diagram of any logic flow in the drawings of the present application may represent program steps, or may represent interconnected logic circuits, modules, and functions, or may represent a combination of program steps and logic circuits, modules, and functions.
  • the computer program can be stored on the memory.
  • the memory can be of any type suitable for the local technical environment and can be implemented using any suitable data storage technology, such as but not limited to read only memory (ROM), random access memory (RAM), optical storage devices and systems (digital multi-function optical discs) (Digital Video Disc, DVD) or compact disc (Compact Disc, CD), etc.
  • Computer-readable media may include non-transitory storage media.
  • the data processor can be of any type suitable for the local technical environment, such as but not limited to general-purpose computers, special-purpose computers, microprocessors, digital signal processors (DSP), application specific integrated circuits (ASICs) ), programmable logic devices (Field-Programmable Gate Array, FPGA), and processors based on multi-core processor architecture.
  • DSP digital signal processors
  • ASICs application specific integrated circuits
  • FPGA programmable logic devices

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种存储过程的运行方法、装置、数据库系统及存储介质。该方法包括:结构化查询语言SQL处理引擎向存储过程引擎发送存储过程执行请求消息(S110);SQL处理引擎多次执行存储过程引擎发送的SQL执行请求消息(S120);SQL处理引擎接收存储过程引擎发送的存储过程执行响应消息(S130)。

Description

存储过程的运行方法、装置、数据库系统及存储介质
本申请要求在2019年10月25日提交中国专利局、申请号为201911025993.7的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据库领域,例如涉及一种存储过程的运行方法、装置、数据库系统及存储介质。
背景技术
存储过程(Stored Procedure)是存储于数据库系统中的一组能够完成特定功能的结构化查询语言(Structured Query Language,SQL)语句集,包括SQL语句及流程控制语句。在分布式数据库中,对于存储过程的执行和SQL的执行,需要分别访问不同的引擎,因此会导致对应用存在限定,即对应用中SQL的执行与存储过程的执行需要访问分布式数据库中的不同部件。另外,在部分分布式数据库中,SQL处理引擎与存储过程的执行紧密耦合,会导致SQL处理引擎和存储过程引擎中一个发生故障而引起整个功能故障。在很多在线业务场景中,SQL处理引擎需要保证具有高可靠、高可用性,不能因为加入分布式存储过程功能而引起SQL处理引擎的不稳定。
发明内容
本申请提供一种存储过程的运行方法、装置、数据库系统及存储介质,能够在分布式数据库中实现分布式存储过程的运行,同时保证了SQL处理引擎的稳定性。
提供一种存储过程的运行方法,包括:
结构化查询语言SQL处理引擎向存储过程引擎发送存储过程执行请求消息;
SQL处理引擎多次执行存储过程引擎发送的多个SQL执行请求消息,其中,每次执行的步骤对应一个SQL执行请求消息;
SQL处理引擎接收存储过程引擎发送的存储过程执行响应消息。
本申请实施例提供一种存储过程的运行方法,包括:
存储过程引擎接收结构化查询语言SQL处理引擎发送的存储过程执行请求 消息;
存储过程引擎多次构造并向SQL处理引擎发送多个SQL执行请求消息,其中,每次构造并发送的步骤对应一个SQL执行请求消息;
存储过程引擎向SQL处理引擎发送存储过程执行响应消息。
还提供一种SQL处理引擎,包括:处理器,处理器设置为在执行计算机程序时实现上述SQL处理引擎侧的方法。
还提供一种存储过程引擎,包括:处理器,处理器设置为在执行计算机程序时实现上述存储过程引擎侧的方法。
还提供一种数据库系统,数据库系统包括:上述存储过程引擎和上述结构化查询语言SQL处理引擎。
还提供了一种计算机可读存储介质,存储有计算机程序,计算机程序被处理器执行时实现上述存储过程的运行方法。
关于本申请的以上实施例和其他方面以及其实现方式,在附图说明、具体实施方式和权利要求中提供更多说明。
附图说明
图1为一实施例提供的一种数据库系统的结构示意图;
图2为一实施例提供的一种存储过程的运行方法的流程示意图;
图3为一实施例提供的另一种存储过程的运行方法的流程示意图;
图4为一实施例提供的一种存储过程的运行方法的交互示意图;
图5为一实施例提供的另一种存储过程的运行方法的交互示意图;
图6为一实施例提供的又一种存储过程的运行方法的交互示意图;
图7为一实施例提供的一种存储过程的运行装置的结构示意图;
图8为一实施例提供的另一种存储过程的运行装置的结构示意图;
图9为一实施例提供的一种SQL处理引擎的结构示意图;
图10为一实施例提供的一种存储过程引擎的结构示意图。
具体实施方式
下文中将结合附图对本申请的实施例进行说明。
存储过程是存储于数据库系统中的一组能够完成特定功能的SQL语句集, 存储过程可以包括SQL语句(SQL语句通常为一个表达式,该表达式可以包括至少一个子表达式)和流程控制语句(一个流程控制语句可以构成一个流程控制语句块,该流程控制语句块可以包括多个SQL语句)。
在传统关系型数据库中,只有一个数据存储结点,存储过程存储在这个结点上。SQL与存储过程在执行时,访问、修改等操作处理的都是此存储结点中的数据。而在分布式数据库中,存在多个数据存储结点,存储过程的执行需要协调所有的数据存储结点来完成,而不能是简单地把存储过程放到每个数据存储结点上独立执行。在分布式数据库中,对于存储过程的执行和SQL的执行,需要分别访问不同的引擎(例如:对于存储过程的执行需要访问过程语言(Procedural Language,PL)引擎,对于SQL的执行需要访问SQL处理引擎),因此会导致对应用的限定,即对应用中SQL的执行与存储过程的执行需要访问分布式数据库中的不同部件。另外,在部分分布式数据库中,SQL处理引擎与存储过程的执行紧密耦合,会导致SQL处理引擎和存储过程引擎中的一个发生故障而引起整个功能故障。在很多在线业务场景中,SQL处理引擎需要保证具有高可靠、高可用性,不能因为加入分布式存储过程功能而引起SQL处理引擎的不稳定。
图1为一实施例提供的一种数据库系统的结构示意图。如图1所示,该数据库系统包括存储过程引擎和SQL处理引擎,存储过程引擎用于运行存储过程,具有对存储过程的流程进行控制的功能,属于分布式数据库的存储过程执行引擎模块;而SQL处理引擎用于执行存储过程中的SQL语句,具有对SQL的执行能力,属于分布式数据库的SQL执行模块。SQL处理引擎向用户提供接入点,接收用户请求,实现单一接入点方式(即应用程序访问这个接入点来执行用户请求的SQL与存储过程,不需要对应用程序进行定制化)。SQL处理引擎还与n个数据存储结点(Database,DB)连接。在本申请实施例中,提供一种可运行于上述数据库系统的存储过程的运行方法,能够在分布式数据库中实现分布式存储过程的运行,同时保证了SQL处理引擎的稳定性。
本申请中术语“系统”和“网络”在本申请中常被可互换使用。本申请下述每个实施例可以单独执行,多个实施例之间也可以相互结合执行,本申请实施例对此不作具体限制。
下面,对存储过程的运行方法、装置、数据库系统及其技术效果进行描述。
图2为一实施例提供的一种存储过程的运行方法的流程示意图,如图2所示,本实施例提供的方法适用于SQL处理引擎,该方法包括如下步骤:
S110、SQL处理引擎向存储过程引擎发送存储过程执行请求消息。
在一实施例中,在步骤S110执行前,SQL处理引擎接收用户输入的请求消息。用户输入的请求消息可以包括SQL执行请求消息和存储过程执行请求消息中的至少一个。若用户输入的请求消息为SQL执行请求消息,则SQL处理引擎直接执行SQL执行请求消息;若用户输入的请求消息为存储过程执行请求消息,则SQL处理引擎继续执行步骤S110。
SQL处理引擎可以通过解析用户输入的请求消息来识别用户输入的请求消息是SQL执行请求消息还是存储过程执行请求消息。
S120、SQL处理引擎多次执行存储过程引擎发送的多个SQL执行请求消息,每次执行的步骤对应一个SQL执行请求消息。
在一实施例中,步骤S120可以包括如下步骤:
步骤1a)SQL处理引擎接收存储过程引擎发送的SQL执行请求消息。
步骤1b)SQL处理引擎处理SQL执行请求消息。
步骤1c)SQL处理引擎向存储过程引擎发送SQL执行响应消息。
步骤1d)SQL处理引擎接收存储过程引擎发送的SQL结果集请求消息。
步骤1e)SQL处理引擎根据SQL结果集请求消息,向存储过程引擎发送SQL结果集响应消息,SQL结果集响应消息携带SQL的执行结果。
步骤1f)SQL处理引擎接收存储过程引擎发送的SQL结果释放指示消息。
步骤1g)SQL处理引擎根据SQL结果释放指示消息,释放SQL结果集。
SQL处理引擎返回执行步骤1a),直至存储过程引擎不再发送SQL执行请求消息。
在一实施例中,若SQL处理引擎在执行存储过程引擎发送的SQL执行请求消息时出错,则SQL处理引擎向存储过程引擎发送错误提示消息。
S130、SQL处理引擎接收存储过程引擎发送的存储过程执行响应消息。
在一实施例中,当SQL处理引擎接收到存储过程引擎发送的存储过程执行响应消息后,SQL处理引擎将最终的存储过程执行结果反馈给用户。
图3为一实施例提供的另一种存储过程的运行方法的流程示意图,如图3所示,本实施例提供的方法适用于存储过程引擎,该方法包括如下步骤。
S210、存储过程引擎接收SQL处理引擎发送的存储过程执行请求消息。
S220、存储过程引擎多次构造并向SQL处理引擎发送多个SQL执行请求消息,每次构造并发送的步骤对应一个SQL执行请求消息。
在一实施例中,步骤S220可以包括如下步骤:
步骤2a)存储过程引擎根据存储过程执行请求消息,构造SQL执行请求消息。
步骤2b)存储过程引擎向SQL处理引擎发送SQL执行请求消息。
步骤2c)存储过程引擎接收SQL处理引擎发送的SQL执行响应消息。
步骤2d)存储过程引擎向SQL处理引擎发送SQL结果集请求消息。
步骤2e)存储过程引擎接收SQL处理引擎发送的SQL结果集响应消息,SQL结果集响应消息携带SQL的执行结果。
步骤2f)存储过程引擎向SQL处理引擎发送SQL结果释放指示消息。
存储过程引擎返回执行步骤2a),直至存储过程引擎不再构造SQL执行请求消息。
S230、存储过程引擎向SQL处理引擎发送存储过程执行响应消息。
在一实施例中,若存储过程引擎在执行存储过程时出错,则存储过程引擎将错误信息写入存储过程执行响应消息中。
下面罗列一些交互实施方式,用于说明图2和图3描述的存储过程的运行方法。
图4为一实施例提供的一种存储过程的运行方法的交互示意图,如图4所示,该方法包括如下步骤:
S310、SQL处理引擎向存储过程引擎发送存储过程执行请求消息。
在一实施例中,在步骤S310执行前,SQL处理引擎接收用户输入的请求消息。用户输入的请求消息可以包括SQL执行请求消息和存储过程执行请求消息中的至少一个。若用户输入的请求消息为SQL执行请求消息,则SQL处理引擎直接执行SQL执行请求消息;若用户输入的请求消息为存储过程执行请求消息,则SQL处理引擎继续执行步骤S310。
SQL处理引擎可以通过解析用户输入的请求消息来识别用户输入的请求消息是SQL执行请求消息还是存储过程执行请求消息。
在一实施例中,存储过程执行请求消息包括CALL语句和参数信息。参数信息包括出参信息、入参信息和出入参信息中的至少一项。
S311、存储过程引擎接收SQL处理引擎发送的存储过程执行请求消息。
S312、存储过程引擎根据存储过程执行请求消息,构造SQL执行请求消息。
存储过程引擎在接收到存储过程执行请求消息后,调用内部处理过程来执行该存储过程执行请求消息中请求执行的存储过程,当在执行该存储过程中遇到SQL指令时,存储过程引擎会基于该SQL指令构造出完整的SQL语句(即SQL执行请求消息),然后发送给SQL处理引擎执行,并等待SQL处理引擎返回SQL执行响应消息。
S313、存储过程引擎向SQL处理引擎发送SQL执行请求消息。
S314、SQL处理引擎接收存储过程引擎发送的SQL执行请求消息。
S315、SQL处理引擎处理SQL执行请求消息。
S316、SQL处理引擎向存储过程引擎发送SQL执行响应消息。
S317、存储过程引擎接收SQL处理引擎发送的SQL执行响应消息。
存储过程引擎在接收到SQL处理引擎返回的SQL执行响应消息后,从等待点开始继续执行该存储过程,直至遇到下一个SQL指令。当遇到下一个SQL指令时,则返回执行步骤S312-S317,直至该存储过程执行完毕。
在一实施例中,当存储过程引擎需要SQL的执行结果时,还可以包括如下步骤S318-S324。
S318、存储过程引擎向SQL处理引擎发送SQL结果集请求消息。
S319、SQL处理引擎接收存储过程引擎发送的SQL结果集请求消息。
S320、SQL处理引擎根据SQL结果集请求消息,向存储过程引擎发送SQL结果集响应消息,SQL结果集响应消息携带SQL的执行结果。
S321、存储过程引擎接收SQL处理引擎发送的SQL结果集响应消息。
S322、存储过程引擎向SQL处理引擎发送SQL结果释放指示消息。
S323、SQL处理引擎接收存储过程引擎发送的SQL结果释放指示消息。
S324、SQL处理引擎根据SQL结果释放指示消息,释放SQL结果集。
S325、存储过程引擎向SQL处理引擎发送存储过程执行响应消息。
当存储过程引擎执行完整个存储过程后,存储过程引擎向SQL处理引擎发送存储过程执行响应消息。存储过程执行响应消息包括出参信息。
S326、SQL处理引擎接收存储过程引擎发送的存储过程执行响应消息。
在一实施例中,当SQL处理引擎接收到存储过程引擎发送的存储过程执行 响应消息后,SQL处理引擎将最终的存储过程执行结果反馈给用户。
如此,能够实现分布式存储过程的存储过程引擎和SQL处理引擎解耦。通过SQL处理引擎来执行存储过程引擎动态生成的每条SQL语句,来实现整个存储过程的分布式执行。
图5为一实施例提供的另一种存储过程的运行方法的交互示意图,与图4所示的存储过程的运行方法不同的是,图5所示的SQL处理引擎在执行SQL执行请求消息时出错,SQL处理引擎可以向存储过程引擎发送错误提示消息,而不是直接给用户提示出现错误。存储过程是否能继续执行,需要由存储过程引擎中的处理过程来决定,因为存储过程的定义中可能有错误处理的定义。
图6为一实施例提供的又一种存储过程的运行方法的交互示意图,与图4所示的存储过程的运行方法不同的是,图6所示的存储过程引擎在执行存储过程时出错,存储过程引擎可以将错误信息写入存储过程执行响应消息中。
如此,可以使SQL处理引擎和存储过程引擎相互隔离,当SQL处理引擎和存储过程引擎中一个发生故障时,不会使另一个也发生故障,也不会影响SQL处理引擎处理用户的其它业务,保证了SQL处理引擎的稳定性。
图7为一实施例提供的一种存储过程的运行装置的结构示意图,该存储过程的运行装置可以配置于SQL处理引擎中,如图7所示,包括发送模块10,处理模块11和接收模块12。
发送模块10,设置为向存储过程引擎发送存储过程执行请求消息。
处理模块11,设置为多次执行存储过程引擎发送的多个SQL执行请求消息,每次执行的步骤对应一个SQL执行请求消息。
接收模块12,设置为接收存储过程引擎发送的存储过程执行响应消息。
本实施例提供的存储过程的运行装置设置为实现上述实施例的存储过程的运行方法,本实施例提供的存储过程的运行装置与上述存储过程的运行方法的实现原理和技术效果类似,此处不再赘述。
在一实施例中,接收模块12还设置为接收存储过程引擎发送的SQL执行请求消息;处理模块11是设置为处理接收模块12接收的SQL执行请求消息;发送模块10还设置为向存储过程引擎发送SQL执行响应消息;直至存储过程引擎不再发送SQL执行请求消息。
在一实施例中,接收模块12,还设置为接收存储过程引擎发送的SQL结果集请求消息;发送模块10,还设置为根据SQL结果集请求消息,向存储过程引 擎发送SQL结果集响应消息,SQL结果集响应消息携带SQL的执行结果。
在一实施例中,接收模块12,还设置为接收存储过程引擎发送的SQL结果释放指示消息;处理模块11,还设置为根据SQL结果释放指示消息,释放SQL结果集。
在一实施例中,发送模块10,还设置为在处理模块11执行存储过程引擎发送的SQL执行请求消息并出错的情况下,向存储过程引擎发送错误提示消息。
在一实施例中,接收模块12,还设置为在发送模块10向存储过程引擎发送存储过程执行请求消息前,获取存储过程执行请求消息。
图8为一实施例提供的另一种存储过程的运行装置的结构示意图,该存储过程的运行装置可以配置于存储过程引擎中,如图8所示,包括接收模块20,处理模块21和发送模块22。
接收模块20,设置为接收结构化查询语言SQL处理引擎发送的存储过程执行请求消息。
处理模块21,设置为多次构造SQL执行请求消息。
发送模块22,设置为向SQL处理引擎发送SQL执行请求消息;以及向SQL处理引擎发送存储过程执行响应消息。
本实施例提供的存储过程的运行装置设置为实现上述实施例的存储过程的运行方法,本实施例提供的存储过程的运行装置与上述存储过程的运行方法的实现原理和技术效果类似,此处不再赘述。
在一实施例中,:处理模块21是设置为根据存储过程执行请求消息构造SQL执行请求消息;发送模块22是设置为向SQL处理引擎发送处理模块21构造的SQL执行请求消息;接收模块20还设置为接收SQL处理引擎发送的SQL执行响应消息;直至处理模块21不再构造SQL执行请求消息。
在一实施例中,发送模块22,还设置为向SQL处理引擎发送SQL结果集请求消息;接收模块20,还设置为接收SQL处理引擎发送的SQL结果集响应消息,SQL结果集响应消息携带SQL的执行结果。
在一实施例中,发送模块22,还设置为向SQL处理引擎发送SQL结果释放指示消息。
在一实施例中,处理模块21,还设置为在处理模块21执行存储过程并出错的情况下,将错误信息写入存储过程执行响应消息中。
本申请实施例提供一种SQL处理引擎,包括:处理器,处理器设置为在执行计算机程序时实现上述任一实施例的方法。图9为一实施例提供的一种SQL处理引擎的结构示意图,如图9所示,该SQL处理引擎包括处理器30、存储器31和通信接口32;SQL处理引擎中处理器30的数量可以是一个或多个,图9中以一个处理器30为例;SQL处理引擎中的处理器30、存储器31、通信接口32可以通过总线或其他方式连接,图9中以通过总线连接为例。总线表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。
存储器31作为一种计算机可读存储介质,可设置为存储软件程序、计算机可执行程序以及模块,如本申请实施例中的方法对应的程序指令/模块。处理器30通过运行存储在存储器31中的软件程序、指令以及模块,从而执行SQL处理引擎的至少一种功能应用以及数据处理,即实现上述存储过程的运行方法。
存储器31可包括存储程序区和存储数据区,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据SQL处理引擎的使用所创建的数据等。存储器31可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实例中,存储器31可包括相对于处理器30远程设置的存储器,这些远程存储器可以通过网络连接至SQL处理引擎。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
通信接口32可设置为数据的接收与发送。
本申请实施例提供一种存储过程引擎,包括:处理器,处理器设置为在执行计算机程序时实现上述任一实施例的方法。图10为一实施例提供的一种存储过程引擎的结构示意图,如图10所示,该存储过程引擎包括处理器40、存储器41和通信接口42;存储过程引擎中处理器40的数量可以是一个或多个,图10中以一个处理器40为例;存储过程引擎中的处理器40、存储器41、通信接口42可以通过总线或其他方式连接,图10中以通过总线连接为例。总线表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。
存储器41作为一种计算机可读存储介质,可设置为存储软件程序、计算机可执行程序以及模块,如本申请实施例中的方法对应的程序指令/模块。处理器40通过运行存储在存储器41中的软件程序、指令以及模块,从而执行存储过程引擎的至少一种功能应用以及数据处理,即实现上述存储过程的运行方法。
存储器41可包括存储程序区和存储数据区,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据存储过程引擎的使用所创建的数据等。存储器41可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实例中,存储器41可包括相对于处理器40远程设置的存储器,这些远程存储器可以通过网络连接至存储过程引擎。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
通信接口42可设置为数据的接收与发送。
本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现如本申请任意实施例所提供的方法。
本申请实施例的计算机存储介质,可以采用一个或多个计算机可读的介质的任意组合。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质包括(非穷举的列表):具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(Random Access Memory,RAM)、只读存储器(Read-Only Memory,ROM)、电可擦式可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、闪存、光纤、便携式紧凑磁盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。
计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,数据信号中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。
计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括——但不限于无线、电线、光缆、射频(Radio Frequency,RF)等等,或者上述的任意合适的组合。
可以以一种或多种程序设计语言或多种程序设计语言组合来编写用于执行本公开操作的计算机程序代码,程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++、Ruby、Go,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(Local Area Network,LAN)或广域网(Wide Area Network,WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
本申请的多种实施例可以在硬件或专用电路、软件、逻辑或其任何组合中实现。例如,一些方面可以被实现在硬件中,而其它方面可以被实现在可以被控制器、微处理器或其它计算装置执行的固件或软件中,尽管本申请不限于此。
本申请的实施例可以通过移动装置的数据处理器执行计算机程序指令来实现,例如在处理器实体中,或者通过硬件,或者通过软件和硬件的组合。计算机程序指令可以是汇编指令、指令集架构(Instruction Set Architecture,ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码。
本申请附图中的任何逻辑流程的框图可以表示程序步骤,或者可以表示相互连接的逻辑电路、模块和功能,或者可以表示程序步骤与逻辑电路、模块和功能的组合。计算机程序可以存储在存储器上。存储器可以具有任何适合于本地技术环境的类型并且可以使用任何适合的数据存储技术实现,例如但不限于只读存储器(ROM)、随机访问存储器(RAM)、光存储器装置和系统(数码多功能光碟(Digital Video Disc,DVD)或光盘(Compact Disc,CD))等。计算机可读介质可以包括非瞬时性存储介质。数据处理器可以是任何适合于本地技术环境的类型,例如但不限于通用计算机、专用计算机、微处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑器件((Field-Programmable Gate Array,FPGA)以及基于多核处理器架构的处理器。

Claims (15)

  1. 一种存储过程的运行方法,包括:
    结构化查询语言SQL处理引擎向存储过程引擎发送存储过程执行请求消息;
    所述SQL处理引擎多次执行所述存储过程引擎发送的多个SQL执行请求消息,其中,每次执行的步骤对应一个SQL执行请求消息;
    所述SQL处理引擎接收所述存储过程引擎发送的存储过程执行响应消息。
  2. 根据权利要求1所述的方法,其中,所述SQL处理引擎每次执行所述存储过程引擎发送的SQL执行请求消息,包括:
    所述SQL处理引擎接收所述存储过程引擎发送的SQL执行请求消息;
    所述SQL处理引擎处理所述存储过程引擎发送的SQL执行请求消息;
    所述SQL处理引擎向所述存储过程引擎发送SQL执行响应消息。
  3. 根据权利要求2所述的方法,在所述SQL处理引擎返回接收所述存储过程引擎发送的下一个SQL执行请求消息前,还包括:
    所述SQL处理引擎接收所述存储过程引擎发送的SQL结果集请求消息;
    所述SQL处理引擎根据所述SQL结果集请求消息,向所述存储过程引擎发送SQL结果集响应消息,所述SQL结果集响应消息携带SQL的执行结果。
  4. 根据权利要求3所述的方法,在所述SQL处理引擎根据所述SQL结果集请求消息,向所述存储过程引擎发送SQL结果集响应消息后,还包括:
    所述SQL处理引擎接收所述存储过程引擎发送的SQL结果释放指示消息;
    所述SQL处理引擎根据所述SQL结果释放指示消息,释放SQL结果集。
  5. 根据权利要求1所述的方法,还包括:
    在所述SQL处理引擎执行所述存储过程引擎发送的SQL执行请求消息并出错的情况下,所述SQL处理引擎向所述存储过程引擎发送错误提示消息。
  6. 根据权利要求1所述的方法,在所述SQL处理引擎向存储过程引擎发送存储过程执行请求消息前,还包括:
    所述SQL处理引擎获取所述存储过程执行请求消息。
  7. 一种存储过程的运行方法,包括:
    存储过程引擎接收结构化查询语言SQL处理引擎发送的存储过程执行请求消息;
    所述存储过程引擎多次构造并向所述SQL处理引擎发送多个SQL执行请求 消息,其中,每次构造并发送的步骤对应一个SQL执行请求消息;
    所述存储过程引擎向所述SQL处理引擎发送存储过程执行响应消息。
  8. 根据权利要求7所述的方法,其中,所述存储过程引擎每次构造并向所述SQL处理引擎发送SQL执行请求消息,包括:
    所述存储过程引擎根据所述存储过程执行请求消息构造SQL执行请求消息;
    所述存储过程引擎向所述SQL处理引擎发送所述存储过程引擎构造的SQL执行请求消息;
    所述存储过程引擎接收所述SQL处理引擎发送的SQL执行响应消息。
  9. 根据权利要求8所述的方法,在所述存储过程引擎返回根据所述存储过程执行请求消息构造下一个SQL执行请求消息前,还包括:
    所述存储过程引擎向所述SQL处理引擎发送SQL结果集请求消息;
    所述存储过程引擎接收所述SQL处理引擎发送的SQL结果集响应消息,所述SQL结果集响应消息携带SQL的执行结果。
  10. 根据权利要求9所述的方法,其特征在于,在所述存储过程引擎接收所述SQL处理引擎发送的SQL结果集响应消息后,还包括:
    所述存储过程引擎向所述SQL处理引擎发送SQL结果释放指示消息。
  11. 根据权利要求7所述的方法,还包括:
    在所述存储过程引擎执行存储过程并出错的情况下,所述存储过程引擎将错误信息写入所述存储过程执行响应消息中。
  12. 一种结构化查询语言SQL处理引擎,包括:处理器,所述处理器设置为在执行计算机程序时实现如权利要求1-6中任一所述的存储过程的运行方法。
  13. 一种存储过程引擎,包括:处理器,所述处理器设置为在执行计算机程序时实现如权利要求7-11中任一所述的存储过程的运行方法。
  14. 一种数据库系统,包括:如权利要求13所述的存储过程引擎和如权利要求12所述的结构化查询语言SQL处理引擎。
  15. 一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1-11中任一所述的存储过程的运行方法。
PCT/CN2020/122640 2019-10-25 2020-10-22 存储过程的运行方法、装置、数据库系统及存储介质 Ceased WO2021078176A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP20878988.3A EP4044043A4 (en) 2019-10-25 2020-10-22 Storage process running method and apparatus, database system, and storage medium
JP2022521107A JP7427775B2 (ja) 2019-10-25 2020-10-22 ストアドプロシージャの実行方法、装置、データベースシステム及び記憶媒体
US17/765,947 US20220374423A1 (en) 2019-10-25 2020-10-22 Running method and device for stored procedure, database system and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911025993.7 2019-10-25
CN201911025993.7A CN112711602B (zh) 2019-10-25 2019-10-25 一种存储过程的运行方法、装置,数据库系统及存储介质

Publications (1)

Publication Number Publication Date
WO2021078176A1 true WO2021078176A1 (zh) 2021-04-29

Family

ID=75540980

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/122640 Ceased WO2021078176A1 (zh) 2019-10-25 2020-10-22 存储过程的运行方法、装置、数据库系统及存储介质

Country Status (5)

Country Link
US (1) US20220374423A1 (zh)
EP (1) EP4044043A4 (zh)
JP (1) JP7427775B2 (zh)
CN (1) CN112711602B (zh)
WO (1) WO2021078176A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7392040B1 (ja) 2022-05-30 2023-12-05 三菱電機Itソリューションズ株式会社 中継装置、中継方法、中継プログラム及びデータベースシステム
CN116150269A (zh) * 2022-12-30 2023-05-23 金篆信科有限责任公司 一种分布式数据库中自定义函数的实现系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020116376A1 (en) * 1997-02-26 2002-08-22 Hitachi, Ltd. Routine executing method in database system
US20070294234A1 (en) * 2004-05-05 2007-12-20 International Business Machines Corporation Dynamic database access via standard query language and abstraction technology
CN103064875A (zh) * 2012-10-30 2013-04-24 中国标准化研究院 一种服务化空间数据分布式查询方法
CN103092970A (zh) * 2013-01-24 2013-05-08 华为技术有限公司 一种数据库操作方法及设备
CN108874837A (zh) * 2017-05-16 2018-11-23 北京京东尚科信息技术有限公司 数据库分库方法、装置、中间件及存储介质和电子设备

Family Cites Families (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07244601A (ja) * 1994-03-04 1995-09-19 Nippon Telegr & Teleph Corp <Ntt> 関係データベースのアクセス方法および装置
JP3808941B2 (ja) * 1996-07-22 2006-08-16 株式会社日立製作所 並列データベースシステム通信回数削減方法
JP2002032247A (ja) * 2000-05-11 2002-01-31 Keiichi Kogure 処理設定テーブルにより入出力装置とデータベースのデータ処理を一元的に制御する方法ならび装置
JP2004062566A (ja) * 2002-07-30 2004-02-26 Jmnet Inc データベースシステム及びそれを構成するマスターノード装置及びプログラム
EP1546930B1 (en) * 2002-09-18 2015-10-21 IBM International Group BV Programmable streaming data processor for database appliance having multiple processing unit groups
JP2004287926A (ja) * 2003-03-24 2004-10-14 Ricoh Co Ltd データベース検索方法、データベース管理サーバ装置、及び汎用ストアドプロシージャ
US7225202B2 (en) * 2004-03-18 2007-05-29 International Business Machines Corporation Method and apparatus for generating query and response statements at runtime from generic requests
US7266561B2 (en) * 2004-03-18 2007-09-04 International Business Machines Corporation Method and apparatus for splitting and merging request and response data at runtime
US7908286B2 (en) * 2004-12-08 2011-03-15 Oracle International Corporation Techniques for providing XQuery access using web services
US8056141B2 (en) * 2006-09-13 2011-11-08 Imperva, Inc. Method for monitoring stored procedures
US8260761B2 (en) * 2006-10-20 2012-09-04 Ianywhere Solutions, Inc. Detecting performance degrading design and algorithm issues in database applications
JP2010097285A (ja) * 2008-10-14 2010-04-30 Fujitsu Ltd システム分析支援プログラム、システム分析支援装置、およびシステム分析支援方法
US10255152B2 (en) * 2011-02-18 2019-04-09 Entit Software Llc Generating test data
US20140095508A1 (en) * 2012-10-01 2014-04-03 International Business Machines Efficient selection of queries matching a record using a cache
US9128990B2 (en) * 2013-03-15 2015-09-08 Microsoft Technology Licensing, Llc Executing stored procedures at parallel databases
US10019297B2 (en) * 2013-04-03 2018-07-10 Salesforce.Com, Inc. Systems and methods for implementing bulk handling in asynchronous processing
US9823995B2 (en) * 2014-08-28 2017-11-21 Sap Se Structured query language debugger
GB201517416D0 (en) * 2015-10-02 2015-11-18 Ibm Task-execution in a DBMS using stored procedures
CN107798025B (zh) * 2016-09-05 2020-06-02 华为技术有限公司 存储过程的运行、编译方法、装置和数据库系统
CN110121704B (zh) * 2016-12-30 2021-09-21 华为技术有限公司 一种用于存储过程的执行方法、设备以及系统
US10685019B2 (en) * 2017-04-14 2020-06-16 Salesforce.Com, Inc. Secure query interface
KR102511927B1 (ko) * 2018-01-18 2023-03-21 한국전자통신연구원 Jit 컴파일 기반 데이터베이스 시스템, 이의 질의 처리 방법 및 이의 저장 프로시저 최적화 방법

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020116376A1 (en) * 1997-02-26 2002-08-22 Hitachi, Ltd. Routine executing method in database system
US20070294234A1 (en) * 2004-05-05 2007-12-20 International Business Machines Corporation Dynamic database access via standard query language and abstraction technology
CN103064875A (zh) * 2012-10-30 2013-04-24 中国标准化研究院 一种服务化空间数据分布式查询方法
CN103092970A (zh) * 2013-01-24 2013-05-08 华为技术有限公司 一种数据库操作方法及设备
CN108874837A (zh) * 2017-05-16 2018-11-23 北京京东尚科信息技术有限公司 数据库分库方法、装置、中间件及存储介质和电子设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4044043A4 *

Also Published As

Publication number Publication date
JP7427775B2 (ja) 2024-02-05
JP2022551454A (ja) 2022-12-09
CN112711602A (zh) 2021-04-27
US20220374423A1 (en) 2022-11-24
EP4044043A4 (en) 2023-11-15
CN112711602B (zh) 2023-04-28
EP4044043A1 (en) 2022-08-17

Similar Documents

Publication Publication Date Title
US10552348B2 (en) USB device access method, apparatus and system, a terminal, and a server
CN108845863B (zh) 用于虚拟机与宿主机的通信方法、装置和系统
US10983815B1 (en) System and method for implementing a generic parser module
WO2019001074A1 (zh) 一种远程过程调用的方法、装置及计算机设备
CN111984849A (zh) 一种信息查询方法、装置、设备及介质
CN114826749A (zh) 一种接口访问控制方法、装置、介质
CN116028455A (zh) 一种数据处理方法、装置、存储介质及电子设备
WO2021013247A1 (zh) 一种运行小程序的方法、设备和计算机存储介质
CN109729121A (zh) 一种云存储系统及用于云存储系统中实现自定义数据处理的方法
WO2021078176A1 (zh) 存储过程的运行方法、装置、数据库系统及存储介质
CN113791792B (zh) 应用调用信息的获取方法、设备以及存储介质
CN111694620A (zh) 第三方业务的交互方法、装置、设备及计算机存储介质
CN111770236B (zh) 一种对话处理方法、装置、系统、服务器和存储介质
CN111596864A (zh) 一种数据延时删除的方法、装置、服务器及存储介质
CN114637969A (zh) 目标对象的鉴权方法及装置
CN116561013B (zh) 基于目标服务框架的测试方法、装置、电子设备和介质
WO2020220272A1 (zh) 更改资源状态的方法、系统、终端及存储介质
CN109068170B (zh) 一种弹幕消息的存储方法、装置、终端和存储介质
CN118612272A (zh) 一种车载图像传输方法、装置、电子设备和存储介质
CN110096543A (zh) 应用程序的数据操作方法、装置、服务器和介质
CN114490104B (zh) Android系统模块中的信息转发方法、装置、设备及介质
WO2025039250A1 (zh) 一种轻量级的pl/sql语言调试器实现方法
CN113703989B (zh) 基于Android系统的消息处理方法、装置、设备和存储介质
CN116366724A (zh) 业务流程的处理方法、装置、计算机设备、存储介质
US20250383845A1 (en) Method and system for construction of application programming interfaces

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20878988

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022521107

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2020878988

Country of ref document: EP

Effective date: 20220510

WWW Wipo information: withdrawn in national office

Ref document number: 2020878988

Country of ref document: EP