WO2024130795A1 - Optimization method for calling data execution on basis of distributed storage, and apparatus - Google Patents

Optimization method for calling data execution on basis of distributed storage, and apparatus Download PDF

Info

Publication number
WO2024130795A1
WO2024130795A1 PCT/CN2023/070708 CN2023070708W WO2024130795A1 WO 2024130795 A1 WO2024130795 A1 WO 2024130795A1 CN 2023070708 W CN2023070708 W CN 2023070708W WO 2024130795 A1 WO2024130795 A1 WO 2024130795A1
Authority
WO
WIPO (PCT)
Prior art keywords
service node
code
target service
execution
machine code
Prior art date
Application number
PCT/CN2023/070708
Other languages
French (fr)
Chinese (zh)
Inventor
王海峰
化明虎
Original Assignee
深圳计算科学研究院
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 深圳计算科学研究院 filed Critical 深圳计算科学研究院
Publication of WO2024130795A1 publication Critical patent/WO2024130795A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present invention mainly relates to the field of data processing, and in particular to an optimization method and device for executing distributed storage-based data calls.
  • PL/SQL stored procedure
  • Procedural Language/SQL which is developed from Ada language.
  • PL/SQL is an extension of SQL statements by relational databases. It adds programming language features to ordinary SQL statements, organizes data operations and query statements in PL/SQL procedural codes, and implements complex functions through logical judgments, loops and other operations.
  • PL/SQL can be used to write programs with many advanced functions, which can encapsulate business logic inside the database, provide better abstraction and security, reduce network interactions, and make calls faster, thereby improving overall performance.
  • Stored procedures are widely used in the database field because of their low RT (Response Time), low resource consumption, high throughput, high stability and reliability.
  • stored procedures also contain many logical judgments, loops and other operations.
  • the stored procedure scripts written by users are permanently valid after pre-compilation.
  • stored procedure code is only executed on one service node. Usually, the amount of stored procedure code is large, but the code execution tasks cannot be shared on different data nodes to improve system performance and throughput efficiency.
  • SQL interaction is involved, SQL itself will be distributed queried. If the stored procedure script code written by the user is large in scale, then only executing a large number of logical judgments and loops in sequence on a single node will greatly reduce the query efficiency.
  • the parsing, compilation, and execution of PL are all performed on a certain service node, and distributed execution is performed only when interacting with SQL.
  • the traditional solution selects the node where the first table accessed in the stored procedure is located to compile and execute PL.
  • the node where the accessed data is located cannot be determined, several nodes are randomly selected for execution. Because the entire code is executed on one node, only some data can be accessed locally, and other data can only be obtained through distributed calls, which increases network consumption and distributed calls.
  • the PL function may be compiled on multiple service nodes, but the logic code of the PL function itself is only executed on one service node. If these functions are all executed on one node, the server load of the execution node is high due to uneven distribution, while other nodes are relatively idle, and the resources of the distributed cluster cannot be fully utilized. The performance of a single node is reduced, and the performance of the entire cluster is reduced.
  • the present application is proposed to provide an optimization method and device for executing distributed storage-based invocation data to overcome the above problems or at least partially solve the above problems, including:
  • An optimization method for executing distributed storage-based call data includes:
  • the target service node parses the PL code and obtains feature information of the PL code
  • the target service node determines the auxiliary service node according to the feature information and the node information and maintains the mapping relationship between the PL code and the auxiliary service node;
  • the target service node compiles the PL code to obtain machine code and synchronizes the machine code to the auxiliary service node;
  • the target service node obtains the execution result of the auxiliary service node according to the characteristic information.
  • the target service node parses the PL code and obtains the characteristic information of the PL code, including:
  • the target service node loads the PL code
  • the target service node parses the PL code to obtain a parsing result, and acquires feature information of the PL code;
  • the target service node verifies the parsing result.
  • the step of the target service node compiling the PL code to obtain machine code and synchronizing the machine code to the auxiliary service node includes:
  • a machine code segment executed by the auxiliary service node is determined according to the characteristic information.
  • the step of determining the machine code segment executed by the auxiliary service node according to the characteristic information includes:
  • the target service node determines the machine code segment that the target service node needs to execute according to the feature information
  • the target service node determines the machine code segment that the auxiliary service node needs to execute according to the feature information.
  • the step in which the target service node obtains the execution result of the auxiliary service node according to the characteristic information includes:
  • the target service node sequentially selects a service node for executing the machine code segment according to the feature information to execute the machine code segment;
  • the target service node obtains the execution result of the auxiliary service node.
  • the target service node sequentially selects a service node that executes the machine code segment according to the feature information to execute the machine code segment, including:
  • the target service node selects a service node to execute the starting machine code segment according to the feature information to execute the starting machine code segment;
  • the target service node selects a service node to execute the next machine code segment according to the feature information to execute the next machine code segment;
  • the target service node determines whether the machine code has been executed. If not, the target service node continues to select a service node to execute the next machine code segment to continue execution.
  • execution granularity of the machine code is code line level.
  • a device for executing based on distributed storage call data wherein the device for optimizing distributed storage process execution implements the steps of any of the above-mentioned methods for optimizing distributed storage process execution, including:
  • a service node determination module configured for the target service node to determine an auxiliary service node according to the feature information and the node information and to maintain a mapping relationship between the PL code and the auxiliary service node;
  • a compiling module used for the target service node to compile the PL code to obtain machine code and synchronize it to the auxiliary service node;
  • An electronic device comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of any one of the above-mentioned optimization methods for executing distributed storage-based call data are implemented.
  • a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned optimization methods for executing distributed storage-based call data are implemented.
  • the present application provides an optimization method based on distributed storage call data execution, specifically: when the user inputs the PL code to the target service node, the target service node parses the PL code and obtains the characteristic information of the PL code; the target service node determines the auxiliary service node based on the characteristic information and node information and maintains the mapping relationship between the PL code and the auxiliary service node; the target service node compiles the PL code to obtain the machine code and synchronizes it to the auxiliary service node; when the user calls the stored data, the target service node obtains the execution result of the auxiliary service node based on the characteristic information.
  • the target service node By extracting the characteristic information when parsing the PL code, the PL code is divided into several code execution subtasks according to the characteristic information, and assigned to different service nodes for execution, the execution performance of the overall cluster is improved.
  • FIG1 is a flowchart of a method for optimizing data execution based on distributed storage calls provided in an embodiment of the present application
  • FIG2 is a schematic diagram of a module structure of a device for executing distributed storage-based invocation data provided by an embodiment of the present application
  • FIG. 3 is a schematic diagram of the structure of a computer device provided by an embodiment of the present invention.
  • the inventors have found through analysis of the prior art that by optimizing the code at the compile stage and assigning corresponding execution nodes to specific code segments, the code can be executed on multiple service nodes, thereby improving the efficiency of stored procedure execution.
  • the method comprises:
  • the target service node parses the PL code and obtains feature information of the PL code
  • the target service node determines an auxiliary service node according to the feature information and the node information and maintains a mapping relationship between the PL code and the auxiliary service node;
  • the target service node compiles the PL code to obtain a machine code and synchronizes the machine code to the auxiliary service node;
  • the target service node obtains the execution result of the auxiliary service node according to the characteristic information.
  • the present application provides an optimization method based on distributed storage call data execution, specifically: when the user inputs the PL code to the target service node, the target service node parses the PL code and obtains the characteristic information of the PL code; the target service node determines the auxiliary service node based on the characteristic information and node information and maintains the mapping relationship between the PL code and the auxiliary service node; the target service node compiles the PL code to obtain the machine code and synchronizes it to the auxiliary service node; when the user calls the stored data, the target service node obtains the execution result of the auxiliary service node based on the characteristic information.
  • the target service node By extracting the characteristic information when parsing the PL code, the PL code is divided into several code execution subtasks based on the characteristic information, and assigned to different service nodes for execution, the execution performance of the overall cluster is improved.
  • the target service node parses the PL code and obtains feature information of the PL code.
  • step S110 the specific process of "when a user inputs a PL code to a target service node, the target service node parses the PL code and obtains feature information of the PL code" in step S110 may be further explained in combination with the following description.
  • the target service node is a service node randomly selected in the server cluster, which parses the PL code and determines the auxiliary service node, and distributes the PL code to different service nodes for execution.
  • the target service node loads the PL code.
  • the target service node parses the PL code to obtain a parsing result, and acquires feature information of the PL code.
  • parsing the PL code is to convert the PL code into a temporary data structure in a distributed database, and the characteristic information is the data dictionary, partition information, data statistics information, etc. extracted by the SQL engine when parsing the stored procedure script.
  • the target service node verifies the parsing result.
  • the verification operation includes analyzing whether the syntax is correct, whether the permissions are complete, whether the data table exists, etc.
  • the target service node determines the auxiliary service node according to the feature information and the node information and maintains the mapping relationship between the PL code and the auxiliary service node.
  • the specific process of "the target service node determines the auxiliary service node based on the feature information and the node information and maintains the mapping relationship between the PL code and the auxiliary service node" in step S120 can be further explained in combination with the following description.
  • the node information is the target service node loading the statistical information, partition information and data dictionary information of all nodes to determine whether the node is idle and the node where the PL code can be executed.
  • the target service node compiles the PL code to obtain a machine code and synchronizes it to the auxiliary service node.
  • the specific process of "the target service node compiles the PL code to obtain the machine code and synchronizes it to the auxiliary service node" in step S130 can be further explained in combination with the following description.
  • the PL code is compiled to obtain a machine code that can be executed by the server.
  • the machine code is synchronized to the auxiliary service node. It is ensured that all service nodes, including the target service node and the auxiliary service node have the same copy.
  • the machine code segment executed by the auxiliary service node is determined based on the feature information.
  • the SQL engine parses the stored procedure script, it will determine whether a certain line or a certain section of code will be executed on a specific service node based on the data dictionary, partition information, data statistics, etc. After the parsing is completed, the compilation result will be sent to the specific service node.
  • the stored procedure When executing a stored procedure, the stored procedure will be divided into several code execution subtasks and executed on different service nodes to improve the execution performance of the entire cluster.
  • the target service node determines the machine code segment that the target service node needs to execute according to the feature information.
  • the target service node determines the machine code segment that the auxiliary service node needs to execute according to the feature information.
  • the code is distributed to different service nodes for execution, and the data relevance of each service node is greatly increased, ensuring that PL's access to data is local, reducing network consumption and distributed calls.
  • the target service node obtains the execution result of the auxiliary service node according to the characteristic information.
  • step S140 the specific process of "when the user calls the stored data, the target service node obtains the execution result of the auxiliary service node according to the characteristic information" in step S140 can be further explained in combination with the following description.
  • execution granularity of the PL code is code line level, one or more lines of code, including but not limited to function level or package level.
  • the target service node sequentially selects a service node that executes a machine code segment according to the feature information to execute the machine code segment.
  • the target service node sequentially selects a service node that executes the machine code segment according to the feature information to execute the machine code segment
  • the target service node selects a service node to execute the initial machine code segment according to the feature information, and transfers the execution to the next execution service node after the execution is completed.
  • the target service node selects a service node to execute the next machine code segment according to the feature information, and after the execution is completed, the service node is handed over to the next service node.
  • the target service node determines whether the machine code has been executed. If not, it continues to select a service node to execute the next machine code segment and transfers it to the next service node after the execution is completed. Repeat this operation until all the machine codes are completely executed and the execution results are transferred to the target service node.
  • the target service node obtains the execution result of the auxiliary service node.
  • a user created a stored procedure package with 1 million lines of code, which contained 10,000 functions, and the entire distributed cluster had 10 service nodes.
  • the 1 million lines of code were distributed to 10 different service nodes, and each node executed a different 100,000 lines of code.
  • each PL accessed data locally, reducing network consumption and distributed calls; at the same time, it reduced the responsibility of a single service node and improved overall performance.
  • the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
  • the PL code parsing module S210 is used for, when a user inputs a PL code to a target service node, the target service node parses the PL code and obtains feature information of the PL code;
  • a service node determination module S220 configured for the target service node to determine an auxiliary service node according to the feature information and the node information and to maintain a mapping relationship between the PL code and the auxiliary service node;
  • Compilation module S230 used for the target service node to compile the PL code to obtain machine code and synchronize it to the auxiliary service node;
  • the execution module S240 is used for, when the user calls the stored data, the target service node to obtain the execution result of the auxiliary service node according to the characteristic information.
  • the PL code parsing module S210 includes:
  • a loading submodule configured to cause the target service node to load the PL code when a user inputs the PL code to the target service node
  • a parsing submodule configured for the target service node to parse the PL code to obtain a parsing result and acquire feature information of the PL code;
  • the verification submodule is used for the target service node to verify the parsing result.
  • the compiling module S230 includes:
  • a compiling submodule used to compile the PL code to obtain a machine code that can be executed by the server;
  • a synchronization submodule used for synchronizing the machine code to the auxiliary service node
  • the machine code segment determination execution submodule is used to determine the machine code segment executed by the auxiliary service node according to the characteristic information.
  • the machine code segment determines the execution submodule, including:
  • the target service node determines the execution submodule, which is used for the target service node to determine the machine code segment that the target service node needs to execute according to the feature information;
  • the auxiliary service node determines the execution submodule, which is used for the target service node to determine the machine code segment that the auxiliary service node needs to execute according to the feature information.
  • the execution module S240 includes:
  • a selection and execution submodule configured to, when a user calls stored data, cause the target service node to sequentially select a service node for executing a machine code segment according to the feature information to execute the machine code segment;
  • the execution result acquisition submodule is used for the target service node to acquire the execution result of the auxiliary service node.
  • the selection execution submodule includes:
  • a starting code segment execution submodule used for the target service node to select a service node to execute the starting machine code segment according to the feature information to execute the starting machine code segment;
  • An intermediate code segment execution submodule is used for the target service node to select a service node to execute the next machine code segment according to the feature information to execute the next machine code segment;
  • the code segment continuation execution judgment submodule is used for the target service node to judge whether the machine code has been executed. If not, continue to select a service node to execute the next machine code segment to continue execution.
  • a computer device of an optimization method for executing distributed storage call data according to the present invention is shown, which may specifically include the following:
  • the computer device 12 is in the form of a general-purpose computing device, and the components of the computer device 12 may include but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16).
  • the bus 18 represents one or more of several types of bus 18 structures, including a memory bus 18 or memory controller, a peripheral bus 18, an accelerated graphics port, a processor or a local bus 18 using any of a variety of bus 18 structures.
  • These architectures include, by way of example, but are not limited to, an Industry Standard Architecture (ISA) bus 18, a Micro Channel Architecture (MAC) bus 18, an Enhanced ISA bus 18, an Audio Video Electronics Standards Association (VESA) local bus 18, and a Peripheral Component Interconnect (PCI) bus 18.
  • ISA Industry Standard Architecture
  • MAC Micro Channel Architecture
  • VESA Audio Video Electronics Standards Association
  • PCI Peripheral Component Interconnect
  • the computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
  • the system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and/or cache memory 32.
  • the computer device 12 may further include other removable/non-removable, volatile/non-volatile computer system storage media.
  • the storage system 34 may be used to read and write non-removable, non-volatile magnetic media (commonly referred to as "hard drives").
  • a disk drive for reading and writing removable non-volatile disks such as "floppy disks”
  • an optical disk drive for reading and writing removable non-volatile optical disks (such as CD-ROMs, DVD-ROMs or other optical media) may be provided.
  • each drive may be connected to the bus 18 via one or more data medium interfaces.
  • the memory may include at least one program product having a set (e.g., at least one) of program modules 42 that are configured to perform the functions of various embodiments of the present invention.
  • a program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, a memory, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules 42, and program data, each of which or some combination may include an implementation of a network environment.
  • the program modules 42 generally perform the functions and/or methods of the embodiments described herein.
  • the computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, cameras, etc.), may communicate with one or more devices that enable medical personnel to interact with the computer device 12, and/or may communicate with any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input/output (I/O) interface 22.
  • the computer device 12 may also communicate with one or more networks (e.g., local area networks (LANs)), wide area networks (WANs), and/or public networks (e.g., the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the computer device 12 via a bus 18.
  • LANs local area networks
  • WANs wide area networks
  • public networks e.g., the Internet
  • the processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, for example, implementing an optimization method for executing distributed storage-based data calls provided in an embodiment of the present invention.
  • the processing unit 16 executes the program, it implements: an optimization method based on distributed storage calling data execution: when a user inputs PL code to a target service node, the target service node parses the PL code and obtains feature information of the PL code; the target service node determines an auxiliary service node based on the feature information and node information and maintains a mapping relationship between the PL code and the auxiliary service node; the target service node compiles the PL code to obtain machine code and synchronizes it to the auxiliary service node; when a user calls storage data, the target service node obtains the execution result of the auxiliary service node based on the feature information.
  • the present invention further provides a computer-readable storage medium on which a computer program is stored.
  • a computer program is stored.
  • an optimization method based on distributed storage call data execution as provided in all embodiments of the present application is implemented:
  • an optimization method based on distributed storage calling data execution when the user inputs the PL code to the target service node, the target service node parses the PL code and obtains the characteristic information of the PL code; the target service node determines the auxiliary service node based on the characteristic information and the node information and maintains the mapping relationship between the PL code and the auxiliary service node; the target service node compiles the PL code to obtain the machine code and synchronizes it to the auxiliary service node; when the user calls the stored data, the target service node obtains the execution result of the auxiliary service node based on the characteristic information.
  • Computer-readable media can be computer readable signal media or computer-readable storage media.
  • Computer-readable storage media can be, for example, - but not limited to - electrical, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or devices, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPOM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices or any suitable combination of the above.
  • computer-readable storage media can be any tangible medium containing or storing programs, which can be used by instruction execution systems, devices or devices or used in combination with them.
  • Computer-readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • the computer program code for performing the operation of the present invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages.
  • the program code can be executed entirely on the medical staff computer, partially on the medical staff computer, as an independent software package, partially on the medical staff computer, partially on the remote computer, or entirely on the remote computer or server.
  • the remote computer can be connected to the medical staff computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
  • LAN local area network
  • WAN wide area network
  • Internet service provider for example, using an Internet service provider to connect through the Internet.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Provided in the present invention is an optimization method for calling data execution on the basis of distributed storage. The method specifically comprises: when a user inputs a PL code into a target service node, the target service node parsing the PL code, and acquiring feature information of the PL code; the target service node determining an auxiliary service node according to the feature information and node information, and maintaining a mapping relationship between the PL code and the auxiliary service node; the target service node compiling the PL code to obtain a machine code, and synchronizing the machine code with the auxiliary service node; and when the user calls storage data, the target service node acquiring an execution result of the auxiliary service node according to the feature information. When the PL code is parsed, the feature information is extracted, the PL code is divided into several code execution sub-tasks according to the feature information, and the code execution sub-tasks are allocated to different service nodes for execution, such that the execution performance of a whole cluster is improved.

Description

一种基于分布式存储调用数据执行的优化方法及装置A method and device for optimizing data execution based on distributed storage 技术领域Technical Field
本发明主要涉及数据处理领域,尤其涉及一种基于分布式存储调用数据执行的优化方法及装置。The present invention mainly relates to the field of data processing, and in particular to an optimization method and device for executing distributed storage-based data calls.
背景技术Background technique
PL/SQL(存储过程)是一种程序语言,叫做过程化SQL语言(Procedural Language/SQL),从Ada语言发展而来。PL/SQL是关系数据库对SQL语句的扩展,在普通SQL语句的基础上增加了编程语言的特点,把数据操作和查询语句组织在PL/SQL的过程化代码中,通过逻辑判断、循环等操作实现复杂的功能。使用PL/SQL可以编写具有很多高级功能的程序,能够把业务逻辑封装在数据库内部,提供更好的抽象和安全性,同时减少了网络的交互,并且调用更快,从而提升整体性能。PL/SQL (stored procedure) is a programming language called Procedural Language/SQL, which is developed from Ada language. PL/SQL is an extension of SQL statements by relational databases. It adds programming language features to ordinary SQL statements, organizes data operations and query statements in PL/SQL procedural codes, and implements complex functions through logical judgments, loops and other operations. PL/SQL can be used to write programs with many advanced functions, which can encapsulate business logic inside the database, provide better abstraction and security, reduce network interactions, and make calls faster, thereby improving overall performance.
存储过程因其低RT(Response Time,***响应时间)、低资源消耗、高吞吐率、高稳定性和可靠性,在数据库领域得到广泛引用。存储过程除包含SQL语句外,还包含很多逻辑判断、循环等操作。用户编写的存储过程脚本,经过预编译后,永久有效。对于传统分布式数据库,存储过程代码只在一个服务节点执行,通常存储过程代码量较大,却无法在不同的数据节点上分担代码执行任务,使***性能和吞吐效率提升,当涉及到SQL交互时,才会对SQL本身进行分布式查询。如果用户编写的存储过程脚本代码规模庞大,那么只在单节点顺序执行大量的逻辑判断和循环等操作,将会极大降低查询效率Stored procedures are widely used in the database field because of their low RT (Response Time), low resource consumption, high throughput, high stability and reliability. In addition to SQL statements, stored procedures also contain many logical judgments, loops and other operations. The stored procedure scripts written by users are permanently valid after pre-compilation. For traditional distributed databases, stored procedure code is only executed on one service node. Usually, the amount of stored procedure code is large, but the code execution tasks cannot be shared on different data nodes to improve system performance and throughput efficiency. When SQL interaction is involved, SQL itself will be distributed queried. If the stored procedure script code written by the user is large in scale, then only executing a large number of logical judgments and loops in sequence on a single node will greatly reduce the query efficiency.
现有技术中PL的解析、编译和执行都在某一个服务节点执行,当与SQL交互时,才进行分布式执行。传统方案会选择存储过程里访问的第一张表所在的节点编译和执行PL,当无法确定所访问数据所在的节点,会随机选择几个节点执行。因为是整体代码在一个节点执行,只能确保部分数据是本地访问,其它数据则只能通过分布式调用来获取,增加了网络消耗和分布式调用。In the prior art, the parsing, compilation, and execution of PL are all performed on a certain service node, and distributed execution is performed only when interacting with SQL. The traditional solution selects the node where the first table accessed in the stored procedure is located to compile and execute PL. When the node where the accessed data is located cannot be determined, several nodes are randomly selected for execution. Because the entire code is executed on one node, only some data can be accessed locally, and other data can only be obtained through distributed calls, which increases network consumption and distributed calls.
当分布式执行的SQL调用了PL函数时,PL函数可能在多个服务节点上编译,但是PL函数本身的逻辑代码只在一个服务节点执行。如果这些函数都在一个节点执行,那么由于分配不均衡,导致执行节点的服务器负载较高,而其他节点较为空闲,没能最大程度利用分布式集群的资源,由单节点的性能下降一起整个集群性能的降低。When distributed SQL calls a PL function, the PL function may be compiled on multiple service nodes, but the logic code of the PL function itself is only executed on one service node. If these functions are all executed on one node, the server load of the execution node is high due to uneven distribution, while other nodes are relatively idle, and the resources of the distributed cluster cannot be fully utilized. The performance of a single node is reduced, and the performance of the entire cluster is reduced.
发明内容Summary of the invention
鉴于所述问题,提出了本申请以便提供克服所述问题或者至少部分地解决所述问题的一种基于分布式存储调用数据执行的优化方法及装置,包括:In view of the above problems, the present application is proposed to provide an optimization method and device for executing distributed storage-based invocation data to overcome the above problems or at least partially solve the above problems, including:
一种基于分布式存储调用数据执行的优化方法,包括:An optimization method for executing distributed storage-based call data includes:
当用户输入PL代码到目标服务节点时,所述目标服务节点解析所述PL代码并获取所述PL代码的特征信息;When a user inputs a PL code into a target service node, the target service node parses the PL code and obtains feature information of the PL code;
所述目标服务节点依据所述特征信息与节点信息确定辅助服务节点并维护所述PL代码与所述辅助服务节点的映射关系;The target service node determines the auxiliary service node according to the feature information and the node information and maintains the mapping relationship between the PL code and the auxiliary service node;
所述目标服务节点对所述PL代码进行编译得到机器码并同步到所述辅助服务节点;The target service node compiles the PL code to obtain machine code and synchronizes the machine code to the auxiliary service node;
当用户调用存储数据时,所述目标服务节点依据所述特征信息获取辅助服务节点的执行结果。When the user calls the stored data, the target service node obtains the execution result of the auxiliary service node according to the characteristic information.
进一步地,所述当用户输入PL代码到目标服务节点时,所述目标服务节点解析所述PL代码并获取所述PL代码的特征信息的步骤,包括:Furthermore, when the user inputs the PL code to the target service node, the target service node parses the PL code and obtains the characteristic information of the PL code, including:
当用户输入PL代码到目标服务节点时,所述目标服务节点加载所述PL代码;When the user inputs the PL code to the target service node, the target service node loads the PL code;
所述目标服务节点解析所述PL代码得到解析结果,并获取所述PL代码的特征信息;The target service node parses the PL code to obtain a parsing result, and acquires feature information of the PL code;
所述目标服务节点对所述解析结果进行校验。The target service node verifies the parsing result.
进一步地,所述目标服务节点对所述PL代码进行编译得到机器码并同步到所述辅助服务节点的步骤,包括:Furthermore, the step of the target service node compiling the PL code to obtain machine code and synchronizing the machine code to the auxiliary service node includes:
对所述PL代码进行编译得到可被服务器执行的机器码;Compiling the PL code to obtain machine code that can be executed by the server;
将所述机器码同步到所述辅助服务节点;Synchronizing the machine code to the auxiliary service node;
依据所述特征信息确定所述辅助服务节点执行的机器码代码段。A machine code segment executed by the auxiliary service node is determined according to the characteristic information.
进一步地,所述依据所述特征信息确定所述辅助服务节点执行的机器码代码段的步骤,包括:Furthermore, the step of determining the machine code segment executed by the auxiliary service node according to the characteristic information includes:
所述目标服务节点依据所述特征信息确定所述目标服务节点需要执行的所述机器码代码段;The target service node determines the machine code segment that the target service node needs to execute according to the feature information;
所述目标服务节点依据所述特征信息确定所述辅助服务节点需要执行的所述机器码代码段。The target service node determines the machine code segment that the auxiliary service node needs to execute according to the feature information.
进一步地,所述当用户调用存储数据时,所述目标服务节点依据所述特征信息获取辅助服务节点的执行结果的步骤,包括:Furthermore, when the user calls the stored data, the step in which the target service node obtains the execution result of the auxiliary service node according to the characteristic information includes:
当用户调用存储数据时,所述目标服务节点依据所述特征信息依次选择执行机器码代码段的服务节点执行所述机器码代码段;When the user calls the stored data, the target service node sequentially selects a service node for executing the machine code segment according to the feature information to execute the machine code segment;
所述目标服务节点获取所述辅助服务节点的执行结果。The target service node obtains the execution result of the auxiliary service node.
进一步地,所述当用户调用存储数据时,所述目标服务节点依据所述特征信息依次选择执行机器码代码段的服务节点执行所述机器码代码段的步骤,包括:Furthermore, when the user calls the stored data, the target service node sequentially selects a service node that executes the machine code segment according to the feature information to execute the machine code segment, including:
所述目标服务节点依据所述特征信息选择执行起始所述机器码代码段的服务节点执行起始所述机器码代码段;The target service node selects a service node to execute the starting machine code segment according to the feature information to execute the starting machine code segment;
所述目标服务节点依据所述特征信息选择执行下一段所述机器码代码段的服务节点执行下一段所述机器码代码段;The target service node selects a service node to execute the next machine code segment according to the feature information to execute the next machine code segment;
所述目标服务节点判断所述机器码是否执行完毕,若未执行完毕,继续选择执行下一段所述机器码代码段的服务节点继续执行。The target service node determines whether the machine code has been executed. If not, the target service node continues to select a service node to execute the next machine code segment to continue execution.
进一步地,所述机器码的执行粒度是代码行级。Furthermore, the execution granularity of the machine code is code line level.
一种基于分布式存储调用数据执行的装置,所述分布式存储过程执行优化的装置实现上述任一项所述的分布式存储过程执行优化的方法的步骤,包括:A device for executing based on distributed storage call data, wherein the device for optimizing distributed storage process execution implements the steps of any of the above-mentioned methods for optimizing distributed storage process execution, including:
PL代码解析模块,用于当用户输入PL代码到目标服务节点时,所述目标服务节点解析所述PL代码并获取所述PL代码的特征信息;A PL code parsing module, configured to, when a user inputs a PL code to a target service node, cause the target service node to parse the PL code and obtain feature information of the PL code;
服务节点确定模块,用于所述目标服务节点依据所述特征信息与节点信 息确定辅助服务节点并维护所述PL代码与所述辅助服务节点的映射关系;a service node determination module, configured for the target service node to determine an auxiliary service node according to the feature information and the node information and to maintain a mapping relationship between the PL code and the auxiliary service node;
编译模块,用于所述目标服务节点对所述PL代码进行编译得到机器码并同步到所述辅助服务节点;A compiling module, used for the target service node to compile the PL code to obtain machine code and synchronize it to the auxiliary service node;
执行模块,用于当用户调用存储数据时,所述目标服务节点依据所述特征信息获取辅助服务节点的执行结果。The execution module is used for, when a user calls the stored data, the target service node to obtain the execution result of the auxiliary service node according to the characteristic information.
一种电子设备,包括处理器、存储器及存储在所述存储器上并能够在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现上述任一项所述的基于分布式存储调用数据执行的优化方法的步骤。An electronic device comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of any one of the above-mentioned optimization methods for executing distributed storage-based call data are implemented.
一种计算机可读存储介质,所述计算机可读存储介质上存储计算机程序,所述计算机程序被处理器执行时实现上述任一项所述的基于分布式存储调用数据执行的优化方法的步骤。A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned optimization methods for executing distributed storage-based call data are implemented.
本申请具有以下优点:This application has the following advantages:
在本申请的实施例中,针对于现有技术中存储过程脚本代码至在一个服务节点进行执行的缺点,本申请提供了一种基于分布式存储调用数据执行的优化方法,具体为:当用户输入PL代码到目标服务节点时,所述目标服务节点解析所述PL代码并获取所述PL代码的特征信息;所述目标服务节点依据所述特征信息与节点信息确定辅助服务节点并维护所述PL代码与所述辅助服务节点的映射关系;所述目标服务节点对所述PL代码进行编译得到机器码并同步到所述辅助服务节点;当用户调用存储数据时,所述目标服务节点依据所述特征信息获取辅助服务节点的执行结果。通过对PL代码进行解析时提取特征信息,依据特征信息将PL代码分成若干个代码执行子任务,分配给不同的服务节点进行执行,提升整体集群的执行性能。In the embodiments of the present application, in view of the shortcomings of the prior art that the stored procedure script code is only executed on one service node, the present application provides an optimization method based on distributed storage call data execution, specifically: when the user inputs the PL code to the target service node, the target service node parses the PL code and obtains the characteristic information of the PL code; the target service node determines the auxiliary service node based on the characteristic information and node information and maintains the mapping relationship between the PL code and the auxiliary service node; the target service node compiles the PL code to obtain the machine code and synchronizes it to the auxiliary service node; when the user calls the stored data, the target service node obtains the execution result of the auxiliary service node based on the characteristic information. By extracting the characteristic information when parsing the PL code, the PL code is divided into several code execution subtasks according to the characteristic information, and assigned to different service nodes for execution, the execution performance of the overall cluster is improved.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请的技术方案,下面将对本申请的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
图1是本申请一实施例提供的一种基于分布式存储调用数据执行的优化 方法的步骤流程图;FIG1 is a flowchart of a method for optimizing data execution based on distributed storage calls provided in an embodiment of the present application;
图2是本申请一实施例提供的一种基于分布式存储调用数据执行的装置的模块结构示意图;FIG2 is a schematic diagram of a module structure of a device for executing distributed storage-based invocation data provided by an embodiment of the present application;
图3是本发明一实施例提供的一种计算机设备的结构示意图。FIG. 3 is a schematic diagram of the structure of a computer device provided by an embodiment of the present invention.
具体实施方式Detailed ways
为使本申请的所述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本申请作进一步详细的说明。显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the objects, features and advantages of the present application more obvious and understandable, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
发明人通过分析现有技术发现:通过在编译阶段对代码进行优化,将特定的代码段分配相应的执行节点,从而使代码在多个服务节点上进行执行,提高存储过程执行的效率。The inventors have found through analysis of the prior art that by optimizing the code at the compile stage and assigning corresponding execution nodes to specific code segments, the code can be executed on multiple service nodes, thereby improving the efficiency of stored procedure execution.
参照图1,示出了本申请一实施例提供的一种基于分布式存储调用数据执行的优化方法;1 , an optimization method based on distributed storage call data execution provided by an embodiment of the present application is shown;
所述方法包括:The method comprises:
S110、当用户输入PL代码到目标服务节点时,所述目标服务节点解析所述PL代码并获取所述PL代码的特征信息;S110, when a user inputs a PL code to a target service node, the target service node parses the PL code and obtains feature information of the PL code;
S120、所述目标服务节点依据所述特征信息与节点信息确定辅助服务节点并维护所述PL代码与所述辅助服务节点的映射关系;S120, the target service node determines an auxiliary service node according to the feature information and the node information and maintains a mapping relationship between the PL code and the auxiliary service node;
S130、所述目标服务节点对所述PL代码进行编译得到机器码并同步到所述辅助服务节点;S130, the target service node compiles the PL code to obtain a machine code and synchronizes the machine code to the auxiliary service node;
S140、当用户调用存储数据时,所述目标服务节点依据所述特征信息获取辅助服务节点的执行结果。S140: When the user calls the stored data, the target service node obtains the execution result of the auxiliary service node according to the characteristic information.
在本申请的实施例中,针对于现有技术中存储过程脚本代码至在一个服务节点进行执行的缺点,本申请提供了一种基于分布式存储调用数据执行的优化方法,具体为:当用户输入PL代码到目标服务节点时,所述目标服务节点解析所述PL代码并获取所述PL代码的特征信息;所述目标服务节点 依据所述特征信息与节点信息确定辅助服务节点并维护所述PL代码与所述辅助服务节点的映射关系;所述目标服务节点对所述PL代码进行编译得到机器码并同步到所述辅助服务节点;当用户调用存储数据时,所述目标服务节点依据所述特征信息获取辅助服务节点的执行结果。通过对PL代码进行解析时提取特征信息,依据特征信息将PL代码分成若干个代码执行子任务,分配给不同的服务节点进行执行,提升整体集群的执行性能。In the embodiments of the present application, in view of the shortcomings of the prior art that the stored procedure script code is only executed on one service node, the present application provides an optimization method based on distributed storage call data execution, specifically: when the user inputs the PL code to the target service node, the target service node parses the PL code and obtains the characteristic information of the PL code; the target service node determines the auxiliary service node based on the characteristic information and node information and maintains the mapping relationship between the PL code and the auxiliary service node; the target service node compiles the PL code to obtain the machine code and synchronizes it to the auxiliary service node; when the user calls the stored data, the target service node obtains the execution result of the auxiliary service node based on the characteristic information. By extracting the characteristic information when parsing the PL code, the PL code is divided into several code execution subtasks based on the characteristic information, and assigned to different service nodes for execution, the execution performance of the overall cluster is improved.
下面,将对本示例性实施例中一种基于分布式存储调用数据执行的优化方法作进一步地说明。Next, an optimization method based on distributed storage call data execution in this exemplary embodiment will be further described.
如上述步骤S110所述,当用户输入PL代码到目标服务节点时,所述目标服务节点解析所述PL代码并获取所述PL代码的特征信息。As described in the above step S110, when the user inputs the PL code to the target service node, the target service node parses the PL code and obtains feature information of the PL code.
在本发明一实施例中,可以结合下列描述进一步说明步骤S110所述“当用户输入PL代码到目标服务节点时,所述目标服务节点解析所述PL代码并获取所述PL代码的特征信息”的具体过程。In an embodiment of the present invention, the specific process of "when a user inputs a PL code to a target service node, the target service node parses the PL code and obtains feature information of the PL code" in step S110 may be further explained in combination with the following description.
需要说明的是,所述目标服务节点为在服务器集群中随机选择的服务节点,由该服务节点对PL代码进行解析并确定辅助服务节点,将PL代码分配给不同的服务节点进行执行。It should be noted that the target service node is a service node randomly selected in the server cluster, which parses the PL code and determines the auxiliary service node, and distributes the PL code to different service nodes for execution.
如下列步骤所述,当用户输入PL代码到目标服务节点时,所述目标服务节点加载所述PL代码。As described in the following steps, when a user inputs PL code to a target service node, the target service node loads the PL code.
如下列步骤所述,所述目标服务节点解析所述PL代码得到解析结果,并获取所述PL代码的特征信息。As described in the following steps, the target service node parses the PL code to obtain a parsing result, and acquires feature information of the PL code.
需要说明的是,解析所述PL代码是将所述PL代码转化为分布式数据库内的临时性数据结构,所述特征信息为SQL引擎在解析存储过程脚本时提取的数据字典、分区信息、数据统计信息等。It should be noted that parsing the PL code is to convert the PL code into a temporary data structure in a distributed database, and the characteristic information is the data dictionary, partition information, data statistics information, etc. extracted by the SQL engine when parsing the stored procedure script.
如下列步骤所述,所述目标服务节点对所述解析结果进行校验。进行校验的操作为分析语法是否正确、权限是否完整、数据表是否存在等。As described in the following steps, the target service node verifies the parsing result. The verification operation includes analyzing whether the syntax is correct, whether the permissions are complete, whether the data table exists, etc.
如上述步骤S120所述,所述目标服务节点依据所述特征信息与节点信息确定辅助服务节点并维护所述PL代码与所述辅助服务节点的映射关系。As described in the above step S120, the target service node determines the auxiliary service node according to the feature information and the node information and maintains the mapping relationship between the PL code and the auxiliary service node.
在本发明一实施例中,可以结合下列描述进一步说明步骤S120所述“所 述目标服务节点依据所述特征信息与节点信息确定辅助服务节点并维护所述PL代码与所述辅助服务节点的映射关系”的具体过程。In one embodiment of the present invention, the specific process of "the target service node determines the auxiliary service node based on the feature information and the node information and maintains the mapping relationship between the PL code and the auxiliary service node" in step S120 can be further explained in combination with the following description.
需要说明的是,所述节点信息为目标服务节点加载所有节点的统计信息、分区信息和数据字典信息,确定节点是否空闲以及PL代码可执行的节点。It should be noted that the node information is the target service node loading the statistical information, partition information and data dictionary information of all nodes to determine whether the node is idle and the node where the PL code can be executed.
如上述步骤S130所述,所述目标服务节点对所述PL代码进行编译得到机器码并同步到所述辅助服务节点。As described in the above step S130, the target service node compiles the PL code to obtain a machine code and synchronizes it to the auxiliary service node.
在本发明一实施例中,可以结合下列描述进一步说明步骤S130所述“所述目标服务节点对所述PL代码进行编译得到机器码并同步到所述辅助服务节点”的具体过程。In an embodiment of the present invention, the specific process of "the target service node compiles the PL code to obtain the machine code and synchronizes it to the auxiliary service node" in step S130 can be further explained in combination with the following description.
如下列步骤所述,对所述PL代码进行编译得到可被服务器执行的机器码。As described in the following steps, the PL code is compiled to obtain a machine code that can be executed by the server.
如下列步骤所述,将所述机器码同步到所述辅助服务节点。确保所有服务节点,包括目标服务节点与辅助服务节点拥有相同的副本。As described in the following steps, the machine code is synchronized to the auxiliary service node. It is ensured that all service nodes, including the target service node and the auxiliary service node have the same copy.
如下列步骤所述,依据所述特征信息确定所述辅助服务节点执行的机器码代码段。SQL引擎在解析存储过程脚本时,会将根据数据字典、分区信息、数据统计信息等,判断某一行或某一段代码会在具体特定的某个服务节点执行,解析完成后将编译结果下发到具体的服务节点。当执行存储过程时,该存储过程会被切分成若干个代码执行子任务,在不同的服务节点执行,提升整个集群的执行性能。As described in the following steps, the machine code segment executed by the auxiliary service node is determined based on the feature information. When the SQL engine parses the stored procedure script, it will determine whether a certain line or a certain section of code will be executed on a specific service node based on the data dictionary, partition information, data statistics, etc. After the parsing is completed, the compilation result will be sent to the specific service node. When executing a stored procedure, the stored procedure will be divided into several code execution subtasks and executed on different service nodes to improve the execution performance of the entire cluster.
在本发明一实施例中,可以结合下列描述进一步说明所述“依据所述特征信息确定所述辅助服务节点执行的机器码代码段”的具体过程。In an embodiment of the present invention, the specific process of "determining the machine code segment executed by the auxiliary service node according to the feature information" may be further explained in combination with the following description.
如下列步骤所述,所述目标服务节点依据所述特征信息确定所述目标服务节点需要执行的所述机器码代码段。As described in the following steps, the target service node determines the machine code segment that the target service node needs to execute according to the feature information.
如下列步骤所述,所述目标服务节点依据所述特征信息确定所述辅助服务节点需要执行的所述机器码代码段。As described in the following steps, the target service node determines the machine code segment that the auxiliary service node needs to execute according to the feature information.
对所述机器码代码段执行的服务节点确定之后,使代码分散在不同的服务节点进行执行,每个服务节点的数据相关性大大增加,确保了PL对数据的访问都是本地的,降低了网络消耗和分布式调用。After the service node for executing the machine code segment is determined, the code is distributed to different service nodes for execution, and the data relevance of each service node is greatly increased, ensuring that PL's access to data is local, reducing network consumption and distributed calls.
如上述步骤S140所述,当用户调用存储数据时,所述目标服务节点依据所述特征信息获取辅助服务节点的执行结果。As described in the above step S140, when the user calls the stored data, the target service node obtains the execution result of the auxiliary service node according to the characteristic information.
在本发明一实施例中,可以结合下列描述进一步说明步骤S140所述“当用户调用存储数据时,所述目标服务节点依据所述特征信息获取辅助服务节点的执行结果”的具体过程。In an embodiment of the present invention, the specific process of "when the user calls the stored data, the target service node obtains the execution result of the auxiliary service node according to the characteristic information" in step S140 can be further explained in combination with the following description.
需要说明的是,所述PL代码的执行粒度是代码行级,一行或多行代码,包括但不限于函数级或package级。It should be noted that the execution granularity of the PL code is code line level, one or more lines of code, including but not limited to function level or package level.
如下列步骤所述,当用户调用存储数据时,所述目标服务节点依据所述特征信息依次选择执行机器码代码段的服务节点执行所述机器码代码段。As described in the following steps, when a user calls storage data, the target service node sequentially selects a service node that executes a machine code segment according to the feature information to execute the machine code segment.
在本发明一实施例中,可以结合下列描述进一步说明所述“当用户调用存储数据时,所述目标服务节点依据所述特征信息依次选择执行机器码代码段的服务节点执行所述机器码代码段”的具体过程。In an embodiment of the present invention, the specific process of "when a user calls storage data, the target service node sequentially selects a service node that executes the machine code segment according to the feature information to execute the machine code segment" can be further explained in combination with the following description.
如下列步骤所述,所述目标服务节点依据所述特征信息选择执行起始所述机器码代码段的服务节点执行起始所述机器码代码段。执行完毕后移交到下一个执行的服务节点。As described in the following steps, the target service node selects a service node to execute the initial machine code segment according to the feature information, and transfers the execution to the next execution service node after the execution is completed.
如下列步骤所述,所述目标服务节点依据所述特征信息选择执行下一段所述机器码代码段的服务节点执行下一段所述机器码代码段。执行完毕后移交到下一个服务节点。As described in the following steps, the target service node selects a service node to execute the next machine code segment according to the feature information, and after the execution is completed, the service node is handed over to the next service node.
如下列步骤所述,所述目标服务节点判断所述机器码是否执行完毕,若未执行完毕,继续选择执行下一段所述机器码代码段的服务节点继续执行,执行完毕后移交到下一个服务节点。重复此操作直到所有所述机器码完全执行完毕,将执行结果移交到所述目标服务节点。As described in the following steps, the target service node determines whether the machine code has been executed. If not, it continues to select a service node to execute the next machine code segment and transfers it to the next service node after the execution is completed. Repeat this operation until all the machine codes are completely executed and the execution results are transferred to the target service node.
如下列步骤所述,所述目标服务节点获取所述辅助服务节点的执行结果。As described in the following steps, the target service node obtains the execution result of the auxiliary service node.
在一具体实现中,用户创建了一个100万行代码的存储过程package,里面有1万个函数,整个分布式集群有10个服务节点。将这100万行代码分配到10个不同的服务节点,每个节点执行其中不同的10万行代码,同时确保每个PL对数据的访问都是本地的,降低了网络消耗和分布式调用;同时降低了单个服务节点的负责,整体提升了性能。In a specific implementation, a user created a stored procedure package with 1 million lines of code, which contained 10,000 functions, and the entire distributed cluster had 10 service nodes. The 1 million lines of code were distributed to 10 different service nodes, and each node executed a different 100,000 lines of code. At the same time, it ensured that each PL accessed data locally, reducing network consumption and distributed calls; at the same time, it reduced the responsibility of a single service node and improved overall performance.
相较于传统分布式数据库,100万行代码只会在一个服务节点执行,即便是这100万行代码访问的表数据分散其他9个节点上面。因为要从不同的节点获取数据,在分布式内部就多了很多分布式调用,增加了网络消耗和额外流程处理;同时,如果同时有多个连接同时执行这100万行代码,也会对当前节点的硬件资源造成较大损耗,从而降低整个分布式的性能。Compared with traditional distributed databases, 1 million lines of code will only be executed on one service node, even if the table data accessed by these 1 million lines of code is scattered on the other 9 nodes. Because data needs to be obtained from different nodes, there are many more distributed calls within the distribution, which increases network consumption and additional process processing; at the same time, if there are multiple connections executing these 1 million lines of code at the same time, it will also cause a large loss of hardware resources on the current node, thereby reducing the performance of the entire distribution.
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
参照图2,示出了本申请一实施例提供的一种基于分布式存储调用数据执行的装置;2, a device for executing data based on distributed storage invocation is shown in an embodiment of the present application;
具体包括:Specifically include:
PL代码解析模块S210,用于当用户输入PL代码到目标服务节点时,所述目标服务节点解析所述PL代码并获取所述PL代码的特征信息;The PL code parsing module S210 is used for, when a user inputs a PL code to a target service node, the target service node parses the PL code and obtains feature information of the PL code;
服务节点确定模块S220,用于所述目标服务节点依据所述特征信息与节点信息确定辅助服务节点并维护所述PL代码与所述辅助服务节点的映射关系;A service node determination module S220, configured for the target service node to determine an auxiliary service node according to the feature information and the node information and to maintain a mapping relationship between the PL code and the auxiliary service node;
编译模块S230,用于所述目标服务节点对所述PL代码进行编译得到机器码并同步到所述辅助服务节点;Compilation module S230, used for the target service node to compile the PL code to obtain machine code and synchronize it to the auxiliary service node;
执行模块S240,用于当用户调用存储数据时,所述目标服务节点依据所述特征信息获取辅助服务节点的执行结果。The execution module S240 is used for, when the user calls the stored data, the target service node to obtain the execution result of the auxiliary service node according to the characteristic information.
在本发明一实施例中,所述PL代码解析模块S210,包括:In one embodiment of the present invention, the PL code parsing module S210 includes:
加载子模块,用于当用户输入PL代码到目标服务节点时,所述目标服务节点加载所述PL代码;A loading submodule, configured to cause the target service node to load the PL code when a user inputs the PL code to the target service node;
解析子模块,用于所述目标服务节点解析所述PL代码得到解析结果,并获取所述PL代码的特征信息;A parsing submodule, configured for the target service node to parse the PL code to obtain a parsing result and acquire feature information of the PL code;
校验子模块,用于所述目标服务节点对所述解析结果进行校验。The verification submodule is used for the target service node to verify the parsing result.
在本发明一实施例中,所述编译模块S230,包括:In one embodiment of the present invention, the compiling module S230 includes:
编译子模块,用于对所述PL代码进行编译得到可被服务器执行的机器码;A compiling submodule, used to compile the PL code to obtain a machine code that can be executed by the server;
同步子模块,用于将所述机器码同步到所述辅助服务节点;A synchronization submodule, used for synchronizing the machine code to the auxiliary service node;
机器码代码段确定执行子模块,用于依据所述特征信息确定所述辅助服务节点执行的机器码代码段。The machine code segment determination execution submodule is used to determine the machine code segment executed by the auxiliary service node according to the characteristic information.
在本发明一实施例中,所述机器码代码段确定执行子模块,包括:In one embodiment of the present invention, the machine code segment determines the execution submodule, including:
目标服务节点确定执行子模块,用于所述目标服务节点依据所述特征信息确定所述目标服务节点需要执行的所述机器码代码段;The target service node determines the execution submodule, which is used for the target service node to determine the machine code segment that the target service node needs to execute according to the feature information;
辅助服务节点确定执行子模块,用于所述目标服务节点依据所述特征信息确定所述辅助服务节点需要执行的所述机器码代码段。The auxiliary service node determines the execution submodule, which is used for the target service node to determine the machine code segment that the auxiliary service node needs to execute according to the feature information.
在本发明一实施例中,所述执行模块S240,包括:In one embodiment of the present invention, the execution module S240 includes:
选择执行子模块,用于当用户调用存储数据时,所述目标服务节点依据所述特征信息依次选择执行机器码代码段的服务节点执行所述机器码代码段;A selection and execution submodule, configured to, when a user calls stored data, cause the target service node to sequentially select a service node for executing a machine code segment according to the feature information to execute the machine code segment;
执行结果获取子模块,用于所述目标服务节点获取所述辅助服务节点的执行结果。The execution result acquisition submodule is used for the target service node to acquire the execution result of the auxiliary service node.
在本发明一实施例中,所述选择执行子模块,包括:In one embodiment of the present invention, the selection execution submodule includes:
起始代码段执行子模块,用于所述目标服务节点依据所述特征信息选择执行起始所述机器码代码段的服务节点执行起始所述机器码代码段;A starting code segment execution submodule, used for the target service node to select a service node to execute the starting machine code segment according to the feature information to execute the starting machine code segment;
中间代码段执行子模块,用于所述目标服务节点依据所述特征信息选择执行下一段所述机器码代码段的服务节点执行下一段所述机器码代码段;An intermediate code segment execution submodule is used for the target service node to select a service node to execute the next machine code segment according to the feature information to execute the next machine code segment;
代码段继续执行判断子模块,用于所述目标服务节点判断所述机器码是否执行完毕,若未执行完毕,继续选择执行下一段所述机器码代码段的服务节点继续执行。The code segment continuation execution judgment submodule is used for the target service node to judge whether the machine code has been executed. If not, continue to select a service node to execute the next machine code segment to continue execution.
参照图3,示出了本发明的一种基于分布式存储调用数据执行的优化方法的计算机设备,具体可以包括如下:3, a computer device of an optimization method for executing distributed storage call data according to the present invention is shown, which may specifically include the following:
上述计算机设备12以通用计算设备的形式表现,计算机设备12的组件可以包括但不限于:一个或者多个处理器或者处理单元16,***存储器28,连接不同***组件(包括***存储器28和处理单元16)的总线18。The computer device 12 is in the form of a general-purpose computing device, and the components of the computer device 12 may include but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16).
总线18表示几类总线18结构中的一种或多种,包括存储器总线18或 者存储器控制器,***总线18,图形加速端口,处理器或者使用多种总线18结构中的任意总线18结构的局域总线18。举例来说,这些体系结构包括但不限于工业标准体系结构(ISA)总线18,微通道体系结构(MAC)总线18,增强型ISA总线18、音视频电子标准协会(VESA)局域总线18以及***组件互连(PCI)总线18。The bus 18 represents one or more of several types of bus 18 structures, including a memory bus 18 or memory controller, a peripheral bus 18, an accelerated graphics port, a processor or a local bus 18 using any of a variety of bus 18 structures. These architectures include, by way of example, but are not limited to, an Industry Standard Architecture (ISA) bus 18, a Micro Channel Architecture (MAC) bus 18, an Enhanced ISA bus 18, an Audio Video Electronics Standards Association (VESA) local bus 18, and a Peripheral Component Interconnect (PCI) bus 18.
计算机设备12典型地包括多种计算机***可读介质。这些介质可以是任何能够被计算机设备12访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
***存储器28可以包括易失性存储器形式的计算机***可读介质,例如随机存取存储器(RAM)30和/或高速缓存存储器32。计算机设备12可以进一步包括其他移动/不可移动的、易失性/非易失性计算机体统存储介质。仅作为举例,存储***34可以用于读写不可移动的、非易失性磁介质(通常称为“硬盘驱动器”)。尽管图3中未示出,可以提供用于对可移动非易失性磁盘(如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如CD-ROM,DVD-ROM或者其他光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质界面与总线18相连。存储器可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块42,这些程序模块42被配置以执行本发明各实施例的功能。The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and/or cache memory 32. The computer device 12 may further include other removable/non-removable, volatile/non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media (commonly referred to as "hard drives"). Although not shown in Figure 3, a disk drive for reading and writing removable non-volatile disks (such as "floppy disks"), and an optical disk drive for reading and writing removable non-volatile optical disks (such as CD-ROMs, DVD-ROMs or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory may include at least one program product having a set (e.g., at least one) of program modules 42 that are configured to perform the functions of various embodiments of the present invention.
具有一组(至少一个)程序模块42的程序/实用工具40,可以存储在例如存储器中,这样的程序模块42包括——但不限于——操作***、一个或者多个应用程序、其他程序模块42以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块42通常执行本发明所描述的实施例中的功能和/或方法。A program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, a memory, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules 42, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and/or methods of the embodiments described herein.
计算机设备12也可以与一个或多个外部设备14(例如键盘、指向设备、显示器24、摄像头等)通信,还可与一个或者多个使得医护人员能与该计算机设备12交互的设备通信,和/或与使得该计算机设备12能与一个或多个其他计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过输入/输出(I/O)界面22进行。并且,计算机设备12还可以 通过网络适配器20与一个或者多个网络(例如局域网(LAN)),广域网(WAN)和/或公共网络(例如因特网)通信。如图所示,网络适配器20通过总线18与计算机设备12的其他模块通信。应当明白,尽管图3中未示出,可以结合计算机设备12使用其他硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元16、外部磁盘驱动阵列、RAID***、磁带驱动器以及数据备份存储***34等。The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, cameras, etc.), may communicate with one or more devices that enable medical personnel to interact with the computer device 12, and/or may communicate with any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input/output (I/O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., local area networks (LANs)), wide area networks (WANs), and/or public networks (e.g., the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the computer device 12 via a bus 18. It should be understood that, although not shown in FIG. 3 , other hardware and/or software modules may be used in conjunction with the computer device 12, including, but not limited to, microcode, device drivers, redundant processing units 16, external disk drive arrays, RAID systems, tape drives, and data backup storage systems 34, etc.
处理单元16通过运行存储在***存储器28中的程序,从而执行各种功能应用以及数据处理,例如实现本发明实施例所提供的一种基于分布式存储调用数据执行的优化方法。The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, for example, implementing an optimization method for executing distributed storage-based data calls provided in an embodiment of the present invention.
也即,上述处理单元16执行上述程序时实现:一种基于分布式存储调用数据执行的优化方法:当用户输入PL代码到目标服务节点时,所述目标服务节点解析所述PL代码并获取所述PL代码的特征信息;所述目标服务节点依据所述特征信息与节点信息确定辅助服务节点并维护所述PL代码与所述辅助服务节点的映射关系;所述目标服务节点对所述PL代码进行编译得到机器码并同步到所述辅助服务节点;当用户调用存储数据时,所述目标服务节点依据所述特征信息获取辅助服务节点的执行结果。That is, when the processing unit 16 executes the program, it implements: an optimization method based on distributed storage calling data execution: when a user inputs PL code to a target service node, the target service node parses the PL code and obtains feature information of the PL code; the target service node determines an auxiliary service node based on the feature information and node information and maintains a mapping relationship between the PL code and the auxiliary service node; the target service node compiles the PL code to obtain machine code and synchronizes it to the auxiliary service node; when a user calls storage data, the target service node obtains the execution result of the auxiliary service node based on the feature information.
在本发明实施例中,本发明还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本申请所有实施例提供的一种基于分布式存储调用数据执行的优化方法:In an embodiment of the present invention, the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, an optimization method based on distributed storage call data execution as provided in all embodiments of the present application is implemented:
也即,给程序被处理器执行时实现:一种基于分布式存储调用数据执行的优化方法:当用户输入PL代码到目标服务节点时,所述目标服务节点解析所述PL代码并获取所述PL代码的特征信息;所述目标服务节点依据所述特征信息与节点信息确定辅助服务节点并维护所述PL代码与所述辅助服务节点的映射关系;所述目标服务节点对所述PL代码进行编译得到机器码并同步到所述辅助服务节点;当用户调用存储数据时,所述目标服务节点依据所述特征信息获取辅助服务节点的执行结果。That is, when the program is executed by the processor, it is implemented: an optimization method based on distributed storage calling data execution: when the user inputs the PL code to the target service node, the target service node parses the PL code and obtains the characteristic information of the PL code; the target service node determines the auxiliary service node based on the characteristic information and the node information and maintains the mapping relationship between the PL code and the auxiliary service node; the target service node compiles the PL code to obtain the machine code and synchronizes it to the auxiliary service node; when the user calls the stored data, the target service node obtains the execution result of the auxiliary service node based on the characteristic information.
可以采用一个或多个计算机可读的介质的任意组合。计算机可读介质可以是计算机克顿信号介质或者计算机可读存储介质。计算机可读存储介质例 如可以是——但不限于——电、磁、光、电磁、红外线或半导体的***、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦可编程只读存储器(EPOM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件或者上述的任意合适的组合。在本文件中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行***、装置或者器件使用或者与其结合使用。Any combination of one or more computer-readable media can be used. Computer-readable media can be computer readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, - but not limited to - electrical, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or devices, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPOM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices or any suitable combination of the above. In this document, computer-readable storage media can be any tangible medium containing or storing programs, which can be used by instruction execution systems, devices or devices or used in combination with them.
计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括——但不限于——电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行***、装置或者器件使用或者与其结合使用的程序。Computer-readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
可以以一种或多种程序设计语言或其组合来编写用于执行本发明操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言——诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言——诸如“C”语言或类似的程序设计语言。程序代码可以完全地在医护人员计算机上执行、部分地在医护人员计算机上执行、作为一个独立的软件包执行、部分在医护人员计算机上部分在远程计算机上执行或者完全在远程计算机或者服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)——连接到医护人员计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。The computer program code for performing the operation of the present invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the medical staff computer, partially on the medical staff computer, as an independent software package, partially on the medical staff computer, partially on the remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the medical staff computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet). The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other.
尽管已描述了本申请实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以, 所附权利要求意欲解释为包括优选实施例以及落入本申请实施例范围的所有变更和修改。Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they are aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
以上对本申请所提供的一种基于分布式存储调用数据执行的优化方法及装置,进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The above is a detailed introduction to an optimization method and device for distributed storage-based data call execution provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims (10)

  1. 一种基于分布式存储调用数据执行的优化方法,其特征在于,包括:An optimization method based on distributed storage call data execution, characterized by comprising:
    当用户输入PL代码到目标服务节点时,所述目标服务节点解析所述PL代码并获取所述PL代码的特征信息;When a user inputs a PL code into a target service node, the target service node parses the PL code and obtains feature information of the PL code;
    所述目标服务节点依据所述特征信息与节点信息确定辅助服务节点并维护所述PL代码与所述辅助服务节点的映射关系;The target service node determines the auxiliary service node according to the feature information and the node information and maintains the mapping relationship between the PL code and the auxiliary service node;
    所述目标服务节点对所述PL代码进行编译得到机器码并同步到所述辅助服务节点;The target service node compiles the PL code to obtain machine code and synchronizes the machine code to the auxiliary service node;
    当用户调用存储数据时,所述目标服务节点依据所述特征信息获取辅助服务节点的执行结果。When the user calls the stored data, the target service node obtains the execution result of the auxiliary service node according to the characteristic information.
  2. 根据权利要求1所述的方法,其特征在于,所述当用户输入PL代码到目标服务节点时,所述目标服务节点解析所述PL代码并获取所述PL代码的特征信息的步骤,包括:The method according to claim 1, characterized in that when the user inputs the PL code to the target service node, the step of the target service node parsing the PL code and acquiring the characteristic information of the PL code comprises:
    当用户输入PL代码到目标服务节点时,所述目标服务节点加载所述PL代码;When the user inputs the PL code to the target service node, the target service node loads the PL code;
    所述目标服务节点解析所述PL代码得到解析结果,并获取所述PL代码的特征信息;The target service node parses the PL code to obtain a parsing result, and acquires feature information of the PL code;
    所述目标服务节点对所述解析结果进行校验。The target service node verifies the parsing result.
  3. 根据权利要求1所述的方法,其特征在于,所述目标服务节点对所述PL代码进行编译得到机器码并同步到所述辅助服务节点的步骤,包括:The method according to claim 1, characterized in that the step of the target service node compiling the PL code to obtain machine code and synchronizing it to the auxiliary service node comprises:
    对所述PL代码进行编译得到可被服务器执行的机器码;Compiling the PL code to obtain machine code that can be executed by the server;
    将所述机器码同步到所述辅助服务节点;Synchronizing the machine code to the auxiliary service node;
    依据所述特征信息确定所述辅助服务节点执行的机器码代码段。A machine code segment executed by the auxiliary service node is determined according to the characteristic information.
  4. 根据权利要求3所述的方法,其特征在于,所述依据所述特征信息确定所述辅助服务节点执行的机器码代码段的步骤,包括:The method according to claim 3, characterized in that the step of determining the machine code segment executed by the auxiliary service node according to the characteristic information comprises:
    所述目标服务节点依据所述特征信息确定所述目标服务节点需要执行的所述机器码代码段;The target service node determines the machine code segment that the target service node needs to execute according to the feature information;
    所述目标服务节点依据所述特征信息确定所述辅助服务节点需要执行的所述机器码代码段。The target service node determines the machine code segment that the auxiliary service node needs to execute according to the feature information.
  5. 根据权利要求1所述的方法,其特征在于,所述当用户调用存储数据时,所述目标服务节点依据所述特征信息获取辅助服务节点的执行结果的步骤,包括:The method according to claim 1, characterized in that when the user calls the stored data, the step of the target service node obtaining the execution result of the auxiliary service node according to the characteristic information comprises:
    当用户调用存储数据时,所述目标服务节点依据所述特征信息依次选择执行机器码代码段的服务节点执行所述机器码代码段;When the user calls the stored data, the target service node sequentially selects a service node for executing the machine code segment according to the feature information to execute the machine code segment;
    所述目标服务节点获取所述辅助服务节点的执行结果。The target service node obtains the execution result of the auxiliary service node.
  6. 根据权利要求5所述的方法,其特征在于,所述当用户调用存储数据时,所述目标服务节点依据所述特征信息依次选择执行机器码代码段的服务节点执行所述机器码代码段的步骤,包括:The method according to claim 5, characterized in that when the user calls the stored data, the target service node sequentially selects a service node that executes the machine code segment according to the characteristic information to execute the machine code segment, comprising:
    所述目标服务节点依据所述特征信息选择执行起始所述机器码代码段的服务节点执行起始所述机器码代码段;The target service node selects a service node to execute the starting machine code segment according to the feature information to execute the starting machine code segment;
    所述目标服务节点依据所述特征信息选择执行下一段所述机器码代码段的服务节点执行下一段所述机器码代码段;The target service node selects a service node to execute the next machine code segment according to the feature information to execute the next machine code segment;
    所述目标服务节点判断所述机器码是否执行完毕,若未执行完毕,继续选择执行下一段所述机器码代码段的服务节点继续执行。The target service node determines whether the machine code has been executed. If not, the target service node continues to select a service node to execute the next machine code segment to continue execution.
  7. 根据权利要求1所述的方法,其特征在于,所述机器码的执行粒度是代码行级。The method according to claim 1 is characterized in that the execution granularity of the machine code is code line level.
  8. 一种基于分布式存储调用数据执行的装置,其特征在于,所述分布式存储过程执行优化的装置实现如权利要求1至7中任一项所述的分布式存储过程执行优化的方法的步骤,包括:A device for executing based on distributed storage call data, characterized in that the device for optimizing the execution of a distributed storage process implements the steps of the method for optimizing the execution of a distributed storage process as described in any one of claims 1 to 7, including:
    PL代码解析模块,用于当用户输入PL代码到目标服务节点时,所述目标服务节点解析所述PL代码并获取所述PL代码的特征信息;A PL code parsing module, configured to, when a user inputs a PL code to a target service node, cause the target service node to parse the PL code and obtain feature information of the PL code;
    服务节点确定模块,用于所述目标服务节点依据所述特征信息与节点信息确定辅助服务节点并维护所述PL代码与所述辅助服务节点的映射关系;A service node determination module, used for the target service node to determine an auxiliary service node according to the feature information and the node information and to maintain a mapping relationship between the PL code and the auxiliary service node;
    编译模块,用于所述目标服务节点对所述PL代码进行编译得到机器码并同步到所述辅助服务节点;A compiling module, used for the target service node to compile the PL code to obtain machine code and synchronize it to the auxiliary service node;
    执行模块,用于当用户调用存储数据时,所述目标服务节点依据所述特 征信息获取辅助服务节点的执行结果。An execution module is used for, when a user calls the stored data, the target service node obtains the execution result of the auxiliary service node according to the characteristic information.
  9. 一种电子设备,其特征在于,包括处理器、存储器及存储在所述存储器上并能够在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如权利要求1-7中任一项所述的基于分布式存储调用数据执行的优化方法的步骤。An electronic device, characterized in that it includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, and when the computer program is executed by the processor, it implements the steps of the optimization method based on distributed storage call data execution as described in any one of claims 1-7.
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储计算机程序,所述计算机程序被处理器执行时实现如权利要求1至7中任一项所述的基于分布式存储调用数据执行的优化方法的步骤。A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the optimization method based on distributed storage call data execution as described in any one of claims 1 to 7 are implemented.
PCT/CN2023/070708 2022-12-19 2023-01-05 Optimization method for calling data execution on basis of distributed storage, and apparatus WO2024130795A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211638410.X 2022-12-19
CN202211638410.XA CN116069464B (en) 2022-12-19 2022-12-19 Optimization method and device based on distributed storage call data execution

Publications (1)

Publication Number Publication Date
WO2024130795A1 true WO2024130795A1 (en) 2024-06-27

Family

ID=86179465

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/070708 WO2024130795A1 (en) 2022-12-19 2023-01-05 Optimization method for calling data execution on basis of distributed storage, and apparatus

Country Status (2)

Country Link
CN (1) CN116069464B (en)
WO (1) WO2024130795A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107766378A (en) * 2016-08-22 2018-03-06 南京中兴新软件有限责任公司 Sending method and device, the distributed data base system of solicited message
US20190121669A1 (en) * 2017-10-20 2019-04-25 American Express Travel Related Services Company, Inc. Executing tasks using modular and intelligent code and data containers
CN109885585A (en) * 2019-02-18 2019-06-14 星环信息科技(上海)有限公司 Support the distributed data base system and method for storing process, trigger and view
CN111694846A (en) * 2020-06-04 2020-09-22 贵州易鲸捷信息技术有限公司 Separate mode distributed storage process implementation method based on Type2 JDBC drive

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2716770C (en) * 2010-10-06 2012-03-13 Ibm Canada Limited - Ibm Canada Limitee Application services source refactoring
CN111367630A (en) * 2019-07-12 2020-07-03 北京关键科技股份有限公司 Multi-user multi-priority distributed cooperative processing method based on cloud computing
CN111343262B (en) * 2020-02-20 2022-04-29 中国建设银行股份有限公司 Distributed cluster login method, device, equipment and storage medium
CN114356555A (en) * 2021-12-14 2022-04-15 南京欧珀软件科技有限公司 Programming method and related device
CN114791856B (en) * 2022-06-27 2022-08-26 北京瑞莱智慧科技有限公司 K8 s-based distributed training task processing method, related equipment and medium
CN115202876A (en) * 2022-07-11 2022-10-18 医利捷(上海)信息科技有限公司 Task processing method and system based on ETL server and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107766378A (en) * 2016-08-22 2018-03-06 南京中兴新软件有限责任公司 Sending method and device, the distributed data base system of solicited message
US20190121669A1 (en) * 2017-10-20 2019-04-25 American Express Travel Related Services Company, Inc. Executing tasks using modular and intelligent code and data containers
CN109885585A (en) * 2019-02-18 2019-06-14 星环信息科技(上海)有限公司 Support the distributed data base system and method for storing process, trigger and view
CN111694846A (en) * 2020-06-04 2020-09-22 贵州易鲸捷信息技术有限公司 Separate mode distributed storage process implementation method based on Type2 JDBC drive

Also Published As

Publication number Publication date
CN116069464A (en) 2023-05-05
CN116069464B (en) 2024-01-16

Similar Documents

Publication Publication Date Title
CN110442560B (en) Log replay method, device, server and storage medium
CN107038222B (en) Database cache implementation method and system
CN110990420B (en) Data query method and device
WO2021218144A1 (en) Data processing method and apparatus, computer device, and storage medium
US10452655B2 (en) In-memory cursor duration temp tables
CN111949650A (en) Multi-language fusion query method and multi-mode database system
CN109947804B (en) Data set query optimization method and device, server and storage medium
CN112104709A (en) Intelligent contract processing method, device, medium and electronic equipment
WO2024041022A1 (en) Database table alteration method and apparatus, device and storage medium
CN114528044B (en) Interface calling method, device, equipment and medium
WO2021031583A1 (en) Method and apparatus for executing statements, server and storage medium
CN108874837B (en) Database partitioning method and device, middleware, storage medium and electronic equipment
CN114356964A (en) Data blood margin construction method and device, storage medium and electronic equipment
WO2024130795A1 (en) Optimization method for calling data execution on basis of distributed storage, and apparatus
CN112883088B (en) Data processing method, device, equipment and storage medium
CN110633162B (en) Remote call implementation method and device, computer equipment and storage medium
CN116204550A (en) Database query statement optimization method, storage medium and device
US20230072930A1 (en) Database query splitting
CN115705294B (en) Method, device, electronic equipment and medium for acquiring function call information
CN110851452B (en) Data table connection processing method and device, electronic equipment and storage medium
CN110019113B (en) Database service processing method and database server
CN114817311B (en) Parallel computing method applied to GaussDB database storage process
CN118170388A (en) Association method, device, equipment and storage medium supporting multiple equipment
CN113326268A (en) Data writing and reading method and device
CN114371833A (en) Method for dynamically analyzing API, readable storage medium and computing device