WO2020015151A1 - Parameter insertion method and apparatus for database table, terminal device, and storage medium - Google Patents

Parameter insertion method and apparatus for database table, terminal device, and storage medium Download PDF

Info

Publication number
WO2020015151A1
WO2020015151A1 PCT/CN2018/106265 CN2018106265W WO2020015151A1 WO 2020015151 A1 WO2020015151 A1 WO 2020015151A1 CN 2018106265 W CN2018106265 W CN 2018106265W WO 2020015151 A1 WO2020015151 A1 WO 2020015151A1
Authority
WO
WIPO (PCT)
Prior art keywords
parameter
insert
database table
custom object
instruction
Prior art date
Application number
PCT/CN2018/106265
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 WO2020015151A1 publication Critical patent/WO2020015151A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases

Definitions

  • the present application relates to the field of data processing, and in particular, to a method, a device, a terminal device, and a storage medium for inserting parameters of a database table.
  • the parameters need to be stored in the database table, if the same interface is used for storage, a large number of duplicate codes will be generated during the storage process; for example, when multiple parameters are inserted into the database table, multiple parameters need to be transmitted; at the same time Each time the storage process requires a write insert method, multiple storage requires multiple write insert methods and cannot be reused; and, the same parameter may need to be inserted multiple times, at which time the transmission and write insert methods need to be repeated.
  • the stored procedure is very cumbersome and violates the design principles of high cohesion and low coupling in software design.
  • the embodiments of the present application provide a method, a device, a terminal device, and a storage medium for inserting parameters of a database table, which can implement design principles of high cohesion and low coupling in software design, make the code in the storage process simple and readable, and improve development efficiency. Reduce maintenance costs.
  • the case of this application provides a method for inserting a parameter into a database table, including:
  • the parameter to be inserted encapsulated in the custom object is stored to a corresponding insertion position in a database table.
  • an example of the present application provides a parameter insertion device for a database table, including:
  • a packaging module for receiving an insertion instruction and packaging a parameter to be inserted into the custom object
  • a calling module configured to receive a general package calling instruction, call an insert method in the general package, and pass the custom object into the insert method;
  • An inserting module is configured to store, based on the inserting method, a parameter to be inserted encapsulated in the custom object to a corresponding inserting position in a database table.
  • an example of the present application provides a terminal device including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, and the processor executes the computer-readable Implement the following steps when instructing:
  • the parameter to be inserted encapsulated in the custom object is stored to a corresponding insertion position in a database table.
  • an example of the present application provides one or more non-volatile readable storage media storing computer-readable instructions.
  • the computer-readable instructions are executed by one or more processors, the one Or multiple processors perform the following steps:
  • the parameter to be inserted encapsulated in the custom object is stored to a corresponding insertion position in a database table.
  • FIG. 1 is a schematic diagram of an application environment of a parameter insertion method of a database table according to an embodiment of the present application
  • FIG. 2 is a flowchart of a method for inserting parameters of a database table in an embodiment of the present application
  • step S10 of a parameter insertion method of a database table in an embodiment of the present application
  • step S10 is a flowchart of step S10 of a parameter insertion method of a database table in another embodiment of the present application.
  • FIG. 5 is a flowchart of a method for inserting a parameter of a database table in another embodiment of the present application.
  • FIG. 6 is a flowchart of a method for inserting a parameter of a database table in another embodiment of the present application.
  • step S30 of a parameter insertion method of a database table in another embodiment of the present application is a flowchart of step S30 of a parameter insertion method of a database table in another embodiment of the present application.
  • FIG. 8 is a block diagram of a parameter insertion device for a database table in an embodiment of the present application.
  • FIG. 9 is a block diagram of a packaging module of a parameter insertion device of a database table in an embodiment of the present application.
  • FIG. 10 is a block diagram of a packaging module of a parameter insertion device of a database table in another embodiment of the present application.
  • FIG. 11 is a schematic diagram of a terminal device in an embodiment of the present application.
  • the parameter insertion method of the database table provided in this application can be applied in the application environment as shown in FIG. 1, in which a client (terminal device) communicates with a server through a network.
  • the clients include, but are not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices.
  • the server can be implemented by an independent server or a server cluster composed of multiple servers.
  • a method for inserting parameters of a database table is provided.
  • the method is applied to the server in FIG. 1 as an example, and includes the following steps:
  • encapsulating the parameter to be inserted into the custom object refers to mapping all fields of the parameter to be inserted into the custom object according to a custom method. That is, all fields of the parameter to be inserted are mapped into a custom object, so that the parameter to be inserted corresponds to a corresponding insertion position in the database table, and in this embodiment, a custom object corresponds to A database table. Understandably, the custom method can be set according to requirements. In one embodiment, a custom method Type [Custom Object Name] is record (a custom method type) is used to map all fields of the parameter to be inserted to In a custom object.
  • the custom object Since a custom object corresponds to a database table, the custom object stores the table name of the database table in the database table corresponding to it, and the mapping relationship defined in the custom method is as follows:
  • the variable in the custom object is mapped to a table field at a position (a corresponding insertion position in the database table) corresponding to both a table name and a field name in a database table. That is, the above-mentioned mapping of all fields of the parameter to be inserted into the custom object using the custom method refers to: using the fields in the parameter to be inserted as variables in the custom object, and in the custom method
  • An association relationship is established between the variable and the insertion position in the database table.
  • S20. Receive a general package (a concept of a package provided in the Java program development) call instruction, and call the insert method in the general package to pass the custom object into the insert method.
  • the insert method is written when the universal package is created, and is used to store the parameters to be inserted encapsulated in the custom object into a database table; the insert method is used to define the following stored procedure:
  • the custom object is passed into the insert method, and in the process, the variables written in the custom object correspond to the insertion position in the database table (the table name and field name in the database table both correspond The corresponding relationship between the positions), and finally the variables in the custom object are stored as the values of the table fields of the corresponding insertion positions in the database.
  • the server receives a general package call instruction, and the general package call instruction is provided by a service
  • the package is issued, and the business package calls the insert method in the universal package, and finally achieves the purpose of storing the parameters to be inserted encapsulated in the custom object to the corresponding location in the database table.
  • the server can obtain the parameters to be inserted encapsulated in the custom object through the insert method.
  • multiple universal service execution methods can be written in a universal package, such as the insert method, the log recording method, and the deduplication log method (to ensure the uniqueness of the log).
  • the business package writes business logic (such as calling the general package's business logic).
  • the corresponding services in the general package can be called through different service packages (different from the general package).
  • Execution method executes instructions.
  • the parameters to be inserted encapsulated in the custom object are stored to the corresponding insertion positions in the database table.
  • the parameter to be inserted is encapsulated into a custom object
  • the parameter to be inserted has been inserted into the custom object and stored in the custom object.
  • the subsequent process if the parameters encapsulated in the custom object are stored in the database table, there is no need to repeatedly insert the parameters into the custom object, but directly call the insert method in the universal package to pass in the custom object. Just fine.
  • the parameter insertion method of the database table in the above embodiment uses a Package as a general package, and the insert method is written into the general package in advance.
  • all the parameters to be inserted need only be customized
  • the field is encapsulated into a custom object, and then the pre-written insert method in the universal package is called to complete the action of storing the parameters to be inserted encapsulated in the custom object to the corresponding insert position in the database table.
  • This application realizes the design principles of high cohesion and low coupling in software design, and makes the code in the stored process concise and readable, which improves development efficiency and reduces maintenance costs.
  • the step S10 that is, receiving an insert instruction, and packaging the parameters to be inserted into the custom object includes the following steps:
  • S101 Receive an insertion instruction, and detect whether a parameter to be inserted included in the insertion instruction meets an insertion condition of a corresponding insertion position in a database table.
  • the server first receives an insert instruction, that is, a certain parameter to be inserted needs to be first inserted into the custom object for encapsulation, because when the custom object is encapsulated, the to-be-inserted parameter needs to be inserted at the same time.
  • the parameter corresponds to the position where it needs to be inserted. Therefore, it is first necessary to detect whether the parameter to be inserted included in the insert instruction meets the insertion condition of the corresponding insertion position in the database table.
  • the database is an Oracle database; the insertion condition is set according to specific requirements in a database table. For example, when the insertion condition includes a parameter type, it is necessary to detect whether the parameter type of the parameter to be inserted is Whether the parameter type matches the corresponding insertion position in the database table. When the two do not match, the current parameter to be inserted is not encapsulated into a custom object.
  • an abnormal prompt is issued. That is, when the parameter to be inserted does not meet the insertion conditions of the corresponding insertion position in the database table, an abnormal prompt needs to be issued to prompt the user to modify or other subsequent operations; for example, the parameter type and database of the parameter to be inserted are prompted When the parameter type corresponding to the insertion position in the table does not match, the user needs to modify the parameter type or replace the parameter to be inserted.
  • step S101 that is, receiving an insert instruction, and detecting whether a parameter to be inserted included in the insert instruction meets an insert condition of a corresponding insert position in a database table
  • steps are included: :
  • S104 Detect whether the current parameter to be inserted is encapsulated in the custom object. In this step, it is determined whether the current parameter to be inserted is encapsulated in the custom object to determine whether it is necessary to continue inserting it into the custom object. In a custom object.
  • step S106 When the current parameter to be inserted is not encapsulated in the custom object, an insert instruction is sent. That is, when it is confirmed that the current parameter to be inserted is not encapsulated in the custom object, the current parameter to be inserted needs to be inserted into the custom object.
  • the server receives the insertion instruction, and detects whether the parameter to be inserted included in the insertion instruction meets the insertion condition of the corresponding insertion position in the database table.
  • step S10 before step S10, that is, before receiving an inserting instruction and packaging the parameters to be inserted into the custom object, the method includes the following steps:
  • step S40 Receive a custom object creation instruction to create a custom object. That is, in this embodiment, before step S10 is performed, it is preferred to create a custom object to encapsulate the parameters to be inserted.
  • step S20 that is, before receiving a general package call instruction, before calling the insert method in the general package to pass the custom object into the insert method.
  • the insertion method is written when the universal package is created, and is used to store a parameter to be inserted encapsulated in a custom object into a database table. Understandably, in this application, multiple universal service execution methods (such as the insert method) can be written into a universal package.
  • the universal service execution methods also include a log recording method and a deduplication log method (guaranteed Uniqueness of logs) and so on. When executing different services, corresponding service execution methods in the general package can be called to execute instructions through different service packages.
  • the step S30 that is, based on the insertion method, stores the parameters to be inserted encapsulated in the custom object to a corresponding insertion position in a database table, including the following steps: :
  • a parameter insertion device for a database table is provided, and the parameter insertion device for the database table corresponds to the parameter insertion method for the database table in the above-mentioned embodiment.
  • the device includes:
  • the encapsulation module 110 is configured to receive an insertion instruction and encapsulate a parameter to be inserted into the custom object;
  • An invoking module 120 configured to receive a general package call instruction, call an insert method in the general package, and pass the custom object into the insert method;
  • the inserting module 130 is configured to store, based on the inserting method, a parameter to be inserted encapsulated in the custom object to a corresponding inserting position in a database table.
  • the parameter insertion device of the database table in the above embodiment uses a Package as a general package, and writes the insert method into the general package in advance.
  • a custom method When data needs to be stored in the database table, as long as a custom method is used, all The field is encapsulated into a custom object, and then the pre-written insert method in the universal package is called to complete the action of storing the parameters to be inserted encapsulated in the custom object to the corresponding insert position in the database table.
  • This application realizes the design principles of high cohesion and low coupling in software design, and makes the code in the stored process concise and readable, which improves development efficiency and reduces maintenance costs.
  • the packaging module 110 includes:
  • a first detection sub-module 111 configured to receive an insertion instruction and detect whether a parameter to be inserted included in the insertion instruction meets an insertion condition of a corresponding insertion position in a database table;
  • Prompt submodule 112 which is used to issue an abnormal prompt when the insert condition of the corresponding insert position in the database table is not met;
  • a mapping sub-module 113 configured to map all fields of the parameter to be inserted into a custom object according to a custom method when the insertion conditions of the corresponding insertion position in the database table are met, and associate them with the corresponding insertion position in the database table .
  • the packaging module 110 further includes:
  • a second detection sub-module 114 configured to detect whether a parameter to be inserted is currently encapsulated in the custom object
  • a first instruction sending sub-module 115 is configured to send a general package calling instruction when a parameter to be inserted is currently encapsulated in the custom object; the first instruction sending sub-module 115 is communicatively connected to the calling module 120;
  • the second instruction sending submodule 116 is configured to send an insertion instruction when a parameter to be inserted is not encapsulated in the custom object.
  • the second instruction sending sub-module 116 is communicatively connected to the first detecting sub-module 111.
  • the device is further configured to receive a custom object creation instruction and create a custom object before receiving an insert instruction and encapsulating a parameter to be inserted into the custom object; and also used to receive a universal package
  • the calling instruction calls the insert method in the universal package before the custom object is passed into the insert method, and the insert method is written in the universal package in advance.
  • the inserting module is further configured to interpret the custom object through the inserting method, and obtain parameter information of a parameter to be inserted encapsulated in the custom object, where the parameter information includes a parameter to be inserted.
  • Each module in the parameter insertion device of the database table may be implemented in whole or in part by software, hardware, and a combination thereof.
  • Each of the above modules may be embedded in the processor in the form of hardware or independent of the processor in the terminal device, or may be stored in the memory of the terminal device in the form of software to facilitate the processor to call and execute the operations corresponding to the above modules.
  • a terminal device is provided.
  • the terminal device may be a server, and its internal structure diagram may be as shown in FIG. 11.
  • the terminal device includes a processor, a memory, a network interface, and a database connected through a system bus.
  • the processor of the terminal device is used to provide computing and control capabilities.
  • the memory of the terminal device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, computer-readable instructions, and a database.
  • the internal memory provides an environment for operating the operating system and computer-readable instructions in a non-volatile storage medium.
  • the network interface of the terminal device is used to communicate with external terminals through a network connection.
  • the computer-readable instructions are executed by a processor to implement a method for inserting parameters into a database table.
  • a terminal device ie, a computer device
  • a memory ie, a processor
  • computer-readable instructions stored on the memory and executable on the processor, and the processor executes the computer-readable instructions.
  • the terminal device of the above embodiment uses a Package as a universal package, and writes an insert method into the universal package in advance.
  • a Package as a universal package
  • the pre-written insert method in the universal package is called, and then the action of storing the parameters to be inserted encapsulated in the custom object to the corresponding insert position in the database table can be completed.
  • one or more non-volatile readable storage media storing computer readable instructions are provided, and the non readable storage medium stores computer readable instructions, the computer readable instructions When executed by one or more processors, causes the one or more processors to perform the following steps:
  • the computer-readable storage medium of the above embodiment uses a package as a universal package, and writes an insert method into the universal package in advance.
  • a package When data needs to be stored in a database table, as long as all fields of the parameters to be inserted are used by a custom method
  • the package is encapsulated into a custom object, and then the insert method written in the general package is called to complete the action of storing the parameters to be inserted encapsulated in the custom object to the corresponding insert position in the database table.
  • This application realizes the design principles of high cohesion and low coupling in software design, and makes the code in the stored process concise and readable, which improves development efficiency and reduces maintenance costs.
  • Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM random access memory
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM dual data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous chain Synchlink DRAM
  • RDRAM direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

A parameter insertion method and apparatus for a database table, a terminal device, and a storage medium. The method comprises: receiving an insertion instruction, and encapsulating a parameter to be inserted into a user-defined object (S10); receiving a universal Package call instruction, and calling an insertion method in the universal Package to transmit the user-defined object into the insertion method (S20); and based on the insertion method, storing the parameter to be inserted that is encapsulated in the user-defined object to a corresponding insertion position of a database table (S30). By means of the method, a Package is used as the universal Package, the insertion method is pre-written into the universal Package, and when data needs to be stored into the database table, it is only needed to call the pre-written insertion method in the universal Package, and the parameter to inserted that is encapsulated in the user-defined object can be stored into the database table. By means of the method, the present invention achieves the design principle of high cohesion and low coupling in software design, and enables the codes to be concise and readable in the process of storage, improves development efficiency, and reduces the maintenance costs.

Description

数据库表的参数插入方法、装置、终端设备及存储介质Parameter insertion method, device, terminal device and storage medium of database table
本申请以2018年7月18日提交的申请号为201810788208.2,名称为“数据库表的参数插入方法、装置、终端设备及存储介质”的中国发明专利申请为基础,并要求其优先权。This application is based on a Chinese invention patent application filed on July 18, 2018 with the application number 201810788208.2, entitled "Parameter Insertion Method, Device, Terminal Equipment and Storage Medium of Database Table", and claims its priority.
技术领域Technical field
本申请涉及数据处理领域,尤其涉及一种数据库表的参数插入方法、装置、终端设备及存储介质。The present application relates to the field of data processing, and in particular, to a method, a device, a terminal device, and a storage medium for inserting parameters of a database table.
背景技术Background technique
目前,在需要将参数存储至数据库表时,若使用同一个接口进行存储,在存储过程中会产生大量重复的代码;比如,在将多个参数插入数据库表时,需要传输多个参数;同时,每次存储过程均需要写入插入方法,多次存储需要多次写入插入方法而不可重复利用;并且,相同的参数可能需要插入多次,此时需要重复进行传输与写入插入方法,存储过程十分累赘,违背了软件设计的高内聚低耦合的设计原则。At present, when the parameters need to be stored in the database table, if the same interface is used for storage, a large number of duplicate codes will be generated during the storage process; for example, when multiple parameters are inserted into the database table, multiple parameters need to be transmitted; at the same time Each time the storage process requires a write insert method, multiple storage requires multiple write insert methods and cannot be reused; and, the same parameter may need to be inserted multiple times, at which time the transmission and write insert methods need to be repeated. The stored procedure is very cumbersome and violates the design principles of high cohesion and low coupling in software design.
发明内容Summary of the invention
本申请实施例提供了一种数据库表的参数插入方法、装置、终端设备及存储介质,可以实现软件设计高内聚低耦合的设计原则,使得存储过程中的代码简洁可读,提升开发效率,降低维护成本。The embodiments of the present application provide a method, a device, a terminal device, and a storage medium for inserting parameters of a database table, which can implement design principles of high cohesion and low coupling in software design, make the code in the storage process simple and readable, and improve development efficiency. Reduce maintenance costs.
第一方面,本申请案例提供一种数据库表的参数插入方法,包括:In a first aspect, the case of this application provides a method for inserting a parameter into a database table, including:
接收插入指令,将待插入参数封装至所述自定义对象中;Receive an insert instruction, and encapsulate the parameter to be inserted into the custom object;
接收通用Package调用指令,调用所述通用Package中的插入方法将所述自定义对象传入所述插入方法中;Receiving a general package call instruction, calling the insert method in the universal package to pass the custom object into the insert method;
基于所述插入方法,将所述自定义对象中封装的待插入参数存储至数据库表中相应的插入位置。Based on the insertion method, the parameter to be inserted encapsulated in the custom object is stored to a corresponding insertion position in a database table.
第二方面,本申请实例提供一种数据库表的参数插入装置,包括:In a second aspect, an example of the present application provides a parameter insertion device for a database table, including:
封装模块,用于接收插入指令,将待插入参数封装至所述自定义对象中;A packaging module for receiving an insertion instruction and packaging a parameter to be inserted into the custom object;
调用模块,用于接收通用Package调用指令,调用所述通用Package中的插入方法将所述自定义对象传入所述插入方法中;A calling module, configured to receive a general package calling instruction, call an insert method in the general package, and pass the custom object into the insert method;
插入模块,用于基于所述插入方法,将所述自定义对象中封装的待插入参数存储至数据库表中相应的插入位置。An inserting module is configured to store, based on the inserting method, a parameter to be inserted encapsulated in the custom object to a corresponding inserting position in a database table.
第三方面,本申请实例提供一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:According to a third aspect, an example of the present application provides a terminal device including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, and the processor executes the computer-readable Implement the following steps when instructing:
接收插入指令,将待插入参数封装至所述自定义对象中;Receive an insert instruction, and encapsulate the parameter to be inserted into the custom object;
接收通用Package调用指令,调用所述通用Package中的插入方法将所述自定义对象传入所述插入方法中;Receiving a general package call instruction, calling the insert method in the universal package to pass the custom object into the insert method;
基于所述插入方法,将所述自定义对象中封装的待插入参数存储至数据库表中相应的插入位置。Based on the insertion method, the parameter to be inserted encapsulated in the custom object is stored to a corresponding insertion position in a database table.
第四方面,本申请实例提供一种一个或多个存储有计算机可读指令的非易失性可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:According to a fourth aspect, an example of the present application provides one or more non-volatile readable storage media storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one Or multiple processors perform the following steps:
接收插入指令,将待插入参数封装至所述自定义对象中;Receive an insert instruction, and encapsulate the parameter to be inserted into the custom object;
接收通用Package调用指令,调用所述通用Package中的插入方法将所述自定义对象传入所述插入方法中;Receiving a general package call instruction, calling the insert method in the universal package to pass the custom object into the insert method;
基于所述插入方法,将所述自定义对象中封装的待插入参数存储至数据库表中相应的插入位置。Based on the insertion method, the parameter to be inserted encapsulated in the custom object is stored to a corresponding insertion position in a database table.
本申请的一个或多个实施例的细节在下面的附图和描述中提出,本申请的其他特征和优点将从说明书、附图以及权利要求变得明显。Details of one or more embodiments of the present application are set forth in the accompanying drawings and description below, and other features and advantages of the present application will become apparent from the description, the drawings, and the claims.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solution of the embodiments of the present application more clearly, the drawings used in the description of the embodiments of the application will be briefly introduced below. Obviously, the drawings in the following description are just some embodiments of the application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without paying creative labor.
图1是本申请一实施例中数据库表的参数插入方法的应用环境示意图;FIG. 1 is a schematic diagram of an application environment of a parameter insertion method of a database table according to an embodiment of the present application; FIG.
图2是本申请一实施例中数据库表的参数插入方法的流程图;2 is a flowchart of a method for inserting parameters of a database table in an embodiment of the present application;
图3是本申请一实施例中数据库表的参数插入方法的步骤S10的流程图;3 is a flowchart of step S10 of a parameter insertion method of a database table in an embodiment of the present application;
图4是本申请另一实施例中数据库表的参数插入方法的步骤S10的流程图;4 is a flowchart of step S10 of a parameter insertion method of a database table in another embodiment of the present application;
图5是本申请另一实施例中的数据库表的参数插入方法的流程图;5 is a flowchart of a method for inserting a parameter of a database table in another embodiment of the present application;
图6是本申请又一实施例中的数据库表的参数插入方法的流程图;6 is a flowchart of a method for inserting a parameter of a database table in another embodiment of the present application;
图7是本申请另一实施例中数据库表的参数插入方法的步骤S30的流程图;7 is a flowchart of step S30 of a parameter insertion method of a database table in another embodiment of the present application;
图8是本申请一实施例中的数据库表的参数插入装置的框图;8 is a block diagram of a parameter insertion device for a database table in an embodiment of the present application;
图9是本申请一实施例中的数据库表的参数插入装置的封装模块的框图;9 is a block diagram of a packaging module of a parameter insertion device of a database table in an embodiment of the present application;
图10是本申请另一实施例中的数据库表的参数插入装置的封装模块的框图;10 is a block diagram of a packaging module of a parameter insertion device of a database table in another embodiment of the present application;
图11是本申请一实施例中终端设备的示意图。FIG. 11 is a schematic diagram of a terminal device in an embodiment of the present application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In the following, the technical solutions in the embodiments of the present application will be clearly and completely described with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
本申请提供的数据库表的参数插入方法,可应用在如图1的应用环境中,其中,客户端(终端设备)通过网络与服务器进行通信。其中,客户端包括但不限于为各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备。服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。The parameter insertion method of the database table provided in this application can be applied in the application environment as shown in FIG. 1, in which a client (terminal device) communicates with a server through a network. The clients include, but are not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. The server can be implemented by an independent server or a server cluster composed of multiple servers.
在一实施例中,如图2所示,提供一种数据库表的参数插入方法,以该方法应用在图1中的服务器为例进行说明,包括如下步骤:In an embodiment, as shown in FIG. 2, a method for inserting parameters of a database table is provided. The method is applied to the server in FIG. 1 as an example, and includes the following steps:
S10,接收插入指令,将待插入参数封装至所述自定义对象中。S10. Receive an insert instruction, and encapsulate a parameter to be inserted into the custom object.
具体地,将待插入参数封装至所述自定义对象中是指根据自定义方法将待插入参数的所有字段映射至自定义对象中。也即,将待插入参数的所有字段映射至自定义对象中,从而将所述待插入参数与数据库表中的对应的插入位置一一对应,且在本实施例中,一个自定义对象对应于一个数据库表。可理解地,自定义方法可以根据需求进行设定,在一实施例中,使用自定义方法Type[自定义对象名]is record(一种自定义方法类型)将待插入参数的所有字段映射至自定义对象中。由于一个自定义对象对应于一个数据库表,因此,所述自定义对象中存储有与其唯一对应的所述数据库表中的数据库表的表名,所述自定义方 法中定义的映射关系如下:将所述自定义对象中的变量映射为与数据库表中的表名和字段名均对应的位置(所述数据库表中相应的插入位置)的表字段。也即,上述使用自定义方法将待插入参数的所有字段映射至自定义对象中是指:将所述待插入参数中的字段作为所述自定义对象中的变量,并在所述自定义方法中建立该变量与所述数据库表中的插入位置之间的关联关系。S20,接收通用Package(java程序开发中提供的一个包的概念)调用指令,调用所述通用Package中的插入方法将所述自定义对象传入所述插入方法中。Specifically, encapsulating the parameter to be inserted into the custom object refers to mapping all fields of the parameter to be inserted into the custom object according to a custom method. That is, all fields of the parameter to be inserted are mapped into a custom object, so that the parameter to be inserted corresponds to a corresponding insertion position in the database table, and in this embodiment, a custom object corresponds to A database table. Understandably, the custom method can be set according to requirements. In one embodiment, a custom method Type [Custom Object Name] is record (a custom method type) is used to map all fields of the parameter to be inserted to In a custom object. Since a custom object corresponds to a database table, the custom object stores the table name of the database table in the database table corresponding to it, and the mapping relationship defined in the custom method is as follows: The variable in the custom object is mapped to a table field at a position (a corresponding insertion position in the database table) corresponding to both a table name and a field name in a database table. That is, the above-mentioned mapping of all fields of the parameter to be inserted into the custom object using the custom method refers to: using the fields in the parameter to be inserted as variables in the custom object, and in the custom method An association relationship is established between the variable and the insertion position in the database table. S20. Receive a general package (a concept of a package provided in the Java program development) call instruction, and call the insert method in the general package to pass the custom object into the insert method.
可理解地,所述插入方法在创建所述通用Package时即被写入,用于将自定义对象中封装的待插入参数存储至数据库表中;所述插入方法用于定义以下存储过程:将所述自定义对象传入所述插入方法中,并在该过程中写入所述自定义对象中的变量与所述数据库表中的插入位置(所述数据库表中的表名和字段名均对应的位置)之间的对应关系,最终将所述自定义对象中的变量存储为所述数据库中相应插入位置的表字段的值。Understandably, the insert method is written when the universal package is created, and is used to store the parameters to be inserted encapsulated in the custom object into a database table; the insert method is used to define the following stored procedure: The custom object is passed into the insert method, and in the process, the variables written in the custom object correspond to the insertion position in the database table (the table name and field name in the database table both correspond The corresponding relationship between the positions), and finally the variables in the custom object are stored as the values of the table fields of the corresponding insertion positions in the database.
也即,在将当前待插入参数封装至自定义对象中(或确认当前待插入参数已封装在所述自定义对象中)之后,服务器接收通用Package调用指令,所述通用Package调用指令由一个业务Package发出,且该业务Package调用所述通用Package中的插入方法,最终实现将所述自定义对象中封装的待插入参数存储至所述数据库表中的相应位置的目的。在将自定义对象传入所述插入方法之后,服务器即可通过所述插入方法获取所述自定义对象中封装的待插入参数。That is, after the current to-be-inserted parameter is encapsulated into a custom object (or it is confirmed that the current to-be-inserted parameter is encapsulated in the custom object), the server receives a general package call instruction, and the general package call instruction is provided by a service The package is issued, and the business package calls the insert method in the universal package, and finally achieves the purpose of storing the parameters to be inserted encapsulated in the custom object to the corresponding location in the database table. After the custom object is passed into the insert method, the server can obtain the parameters to be inserted encapsulated in the custom object through the insert method.
在本实施例中,一个通用Package中可以写入多个通用的业务执行方法,比如所述插入方法、记录日志方法、删除重复日志方法(保证日志的唯一性)等。而业务Package中写入的是业务逻辑(比如调用通用Package的业务逻辑),在执行不同业务时,可以通过不同的业务Package(区别于所述通用Package)调用所述通用Package中的对应的业务执行方法执行指令。In this embodiment, multiple universal service execution methods can be written in a universal package, such as the insert method, the log recording method, and the deduplication log method (to ensure the uniqueness of the log). The business package writes business logic (such as calling the general package's business logic). When different services are executed, the corresponding services in the general package can be called through different service packages (different from the general package). Execution method executes instructions.
S30,基于所述插入方法,将所述自定义对象中封装的待插入参数存储至数据库表中相应的插入位置。S30. Based on the insertion method, the parameters to be inserted encapsulated in the custom object are stored to the corresponding insertion positions in the database table.
可理解地,在将待插入参数封装至自定义对象中之后,所述待插入参数已插入至所述自定义对象中并存储在所述自定义对象中,在后续过程中,若还需要在数据库表中存储已封装至所述自定义对象中的参数时,无需再次重复将该参数插入至所述自定义对象中,而是直接调用通用Package中的插入方法将所述自定义对象传入即可。若某次插入的参数有多个,则仅需要将未封装至所述自定义对象中的参数插入至所述自定义对象中,而之前已封装至所述自定义对象中的参数无需再次插入;如此,对于需要重复插入的参数,可以直 接仅传递已封装该参数的自定义对象即可,无需反复插入和传输,程序简洁,提升了开发效率,降低了维护成本。Understandably, after the parameter to be inserted is encapsulated into a custom object, the parameter to be inserted has been inserted into the custom object and stored in the custom object. In the subsequent process, if the When the parameters encapsulated in the custom object are stored in the database table, there is no need to repeatedly insert the parameters into the custom object, but directly call the insert method in the universal package to pass in the custom object. Just fine. If there are multiple parameters inserted at a time, only the parameters that are not encapsulated in the custom object need to be inserted into the custom object, and the parameters that have been previously encapsulated in the custom object do not need to be inserted again In this way, for the parameters that need to be repeatedly inserted, you can directly pass only the custom object that has encapsulated the parameters, without repeated insertion and transmission. The program is concise, improves development efficiency, and reduces maintenance costs.
上述实施例的数据库表的参数插入方法利用一个Package作为通用Package,把插入方法预先写入该通用Package中,在需要往数据库表里存储数据时,只要使用自定义的方法将待插入参数的所有字段封装至自定义的对象中,再调用通用Package中预先写入的插入方法,就可以完成将所述自定义对象中封装的待插入参数存储至数据库表中相应的插入位置的动作。本申请实现了软件设计高内聚低耦合的设计原则,且使得存储过程中的代码简洁可读,提升了开发效率,降低了维护成本。The parameter insertion method of the database table in the above embodiment uses a Package as a general package, and the insert method is written into the general package in advance. When data needs to be stored in the database table, all the parameters to be inserted need only be customized The field is encapsulated into a custom object, and then the pre-written insert method in the universal package is called to complete the action of storing the parameters to be inserted encapsulated in the custom object to the corresponding insert position in the database table. This application realizes the design principles of high cohesion and low coupling in software design, and makes the code in the stored process concise and readable, which improves development efficiency and reduces maintenance costs.
在一实施例中,如图3所示,所述步骤S10,也即接收插入指令,将待插入参数封装至所述自定义对象中,包括以下步骤:In an embodiment, as shown in FIG. 3, the step S10, that is, receiving an insert instruction, and packaging the parameters to be inserted into the custom object includes the following steps:
S101,接收插入指令,检测所述插入指令中包含的待插入参数是否符合数据库表中对应插入位置的插入条件。S101. Receive an insertion instruction, and detect whether a parameter to be inserted included in the insertion instruction meets an insertion condition of a corresponding insertion position in a database table.
在该步骤中,服务器首先接收到插入指令,也即,需要将某个待插入参数首先插入所述自定义对象中进行封装,由于在对自定义对象进行封装时,同时需要将所述待插入参数对应至其需要插入的位置,因此,首先需要检测所述插入指令中包含的待插入参数是否符合数据库表中对应插入位置的插入条件。In this step, the server first receives an insert instruction, that is, a certain parameter to be inserted needs to be first inserted into the custom object for encapsulation, because when the custom object is encapsulated, the to-be-inserted parameter needs to be inserted at the same time. The parameter corresponds to the position where it needs to be inserted. Therefore, it is first necessary to detect whether the parameter to be inserted included in the insert instruction meets the insertion condition of the corresponding insertion position in the database table.
在一实施例中,所述数据库为Oracle数据库;所述插入条件根据数据库表中的具体需求进行设置,比如,在所述插入条件包括参数类型时,需要检测所述待插入参数的参数类型是否与数据库表中对应插入位置的参数类型是否匹配,在两者不匹配时,则不会对当前待插入参数封装至自定义对象中。In an embodiment, the database is an Oracle database; the insertion condition is set according to specific requirements in a database table. For example, when the insertion condition includes a parameter type, it is necessary to detect whether the parameter type of the parameter to be inserted is Whether the parameter type matches the corresponding insertion position in the database table. When the two do not match, the current parameter to be inserted is not encapsulated into a custom object.
S102,在不符合数据库表中对应插入位置的插入条件时,发出异常提示。也即,在待插入参数并不符合数据库表中的对应插入位置的插入条件时,需要对其发出异常提示,提示用户进行修改或其他后续操作;比如,在提示待插入参数的参数类型与数据库表中对应插入位置的参数类型并不匹配时,需要用户对参数类型进行修改或更换待插入参数。S102. When the insertion condition of the corresponding insertion position in the database table is not met, an abnormal prompt is issued. That is, when the parameter to be inserted does not meet the insertion conditions of the corresponding insertion position in the database table, an abnormal prompt needs to be issued to prompt the user to modify or other subsequent operations; for example, the parameter type and database of the parameter to be inserted are prompted When the parameter type corresponding to the insertion position in the table does not match, the user needs to modify the parameter type or replace the parameter to be inserted.
S103,在符合数据库表中对应插入位置的插入条件时,根据自定义方法将待插入参数的所有字段映射至自定义对象中,并将其与数据库表中对应的插入位置关联。也即,在待插入参数符合数据库表中的对应插入位置的插入条件时,将待插入参数封装至自定义对象中,并将其对应至所述数据库表中的相应位置。S103. When the insertion conditions of the corresponding insertion position in the database table are met, all fields of the parameter to be inserted are mapped into the custom object according to a custom method, and are associated with the corresponding insertion position in the database table. That is, when the parameter to be inserted meets the insertion condition of the corresponding insertion position in the database table, the parameter to be inserted is encapsulated into a custom object, and it corresponds to a corresponding position in the database table.
在一实施例中,如图4所示,所述步骤S101,也即接收插入指令,检测所述插入指令中包含的待插入参数是否符合数据库表中对应插入位置的插入条件之前,包括以下步 骤:In an embodiment, as shown in FIG. 4, before step S101, that is, receiving an insert instruction, and detecting whether a parameter to be inserted included in the insert instruction meets an insert condition of a corresponding insert position in a database table, the following steps are included: :
S104,检测当前待插入参数是否已封装在所述自定义对象中;在该步骤中,明确当前待插入参数是否已封装在所述自定义对象中,以确定是否需要继续将其插入至所述自定义对象中。S104. Detect whether the current parameter to be inserted is encapsulated in the custom object. In this step, it is determined whether the current parameter to be inserted is encapsulated in the custom object to determine whether it is necessary to continue inserting it into the custom object. In a custom object.
S105,在当前待插入参数已封装在所述自定义对象中时,发送通用Package调用指令;也即,在当前待插入参数已封装在所述自定义对象中时,无需再次将其插入至所述自定义对象中,仅需要发送通用Package调用指令,直接调用通用Package中的插入方法将所述自定义对象传入。此时,转入上述步骤S20中,也即,服务器接收到通用Package调用指令,并调用所述通用Package中的插入方法将所述自定义对象传入所述插入方法中。S105. When the current parameter to be inserted is encapsulated in the custom object, send a general Package call instruction; that is, when the current parameter to be inserted is encapsulated in the custom object, it is not necessary to insert it into the custom object again. In the custom object, it is only necessary to send a general package call instruction, and directly call the insert method in the general package to pass in the custom object. At this time, it proceeds to the above step S20, that is, the server receives the general package call instruction, and calls the insert method in the general package to pass the custom object into the insert method.
S106,在当前待插入参数未封装在所述自定义对象中时,发送插入指令。也即,在确认当前待插入参数未封装在所述自定义对象中时,需要将当前待插入参数插入至所述自定义对象中。此时,转入所述步骤S101中,服务器接收所述插入指令,检测所述插入指令中包含的待插入参数是否符合数据库表中对应插入位置的插入条件。S106. When the current parameter to be inserted is not encapsulated in the custom object, an insert instruction is sent. That is, when it is confirmed that the current parameter to be inserted is not encapsulated in the custom object, the current parameter to be inserted needs to be inserted into the custom object. At this time, turning to step S101, the server receives the insertion instruction, and detects whether the parameter to be inserted included in the insertion instruction meets the insertion condition of the corresponding insertion position in the database table.
在一实施例中,如图5所示,所述步骤S10之前,也即接收插入指令,将待插入参数封装至所述自定义对象中之前,包括以下步骤:In an embodiment, as shown in FIG. 5, before step S10, that is, before receiving an inserting instruction and packaging the parameters to be inserted into the custom object, the method includes the following steps:
S40,接收自定义对象创建指令,创建自定义对象;也即,在本实施例中,所述步骤S10执行之前,首选要创建一个自定义对象来封装待插入参数。S40. Receive a custom object creation instruction to create a custom object. That is, in this embodiment, before step S10 is performed, it is preferred to create a custom object to encapsulate the parameters to be inserted.
在一实施例中,如图6所示,所述步骤S20之前,也即接收通用Package调用指令,调用所述通用Package中的插入方法将所述自定义对象传入所述插入方法中之前,还包括以下步骤:In an embodiment, as shown in FIG. 6, before step S20, that is, before receiving a general package call instruction, before calling the insert method in the general package to pass the custom object into the insert method, The following steps are also included:
S50,在通用Package中预先写入所述插入方法。在本实施例中,所述插入方法在创建所述通用Package时即被写入,用于将自定义对象中封装的待插入参数存储至数据库表中。可理解地,在本申请中,一个通用Package中可以写入多个通用的业务执行方法(比如所述插入方法),通用的所述业务执行方法还包括记录日志方法,删除重复日志方法(保证日志的唯一性)等。在执行不同业务时,可以通过不同的业务Package调用通用Package中的对应的业务执行方法执行指令。S50. Write the insertion method in a universal package in advance. In this embodiment, the insertion method is written when the universal package is created, and is used to store a parameter to be inserted encapsulated in a custom object into a database table. Understandably, in this application, multiple universal service execution methods (such as the insert method) can be written into a universal package. The universal service execution methods also include a log recording method and a deduplication log method (guaranteed Uniqueness of logs) and so on. When executing different services, corresponding service execution methods in the general package can be called to execute instructions through different service packages.
在一实施例中,如图7所示,所述步骤S30,也即基于所述插入方法,将所述自定义对象中封装的待插入参数存储至数据库表中相应的插入位置,包括以下步骤:In an embodiment, as shown in FIG. 7, the step S30, that is, based on the insertion method, stores the parameters to be inserted encapsulated in the custom object to a corresponding insertion position in a database table, including the following steps: :
S301,通过所述插入方法解读所述自定义对象,获取所述自定义对象中封装的待插入参数的参数信息,所述参数信息包括待插入参数的值和待插入参数在所述数据库表中相 应的插入位置;可理解地,所述参数信息可以根据需求进行设定,并不限定于本实施例中所述;所述插入方法可以解读并获取自定义对象中被封装的待插入参数的参数信息。S301. Interpret the custom object by the insert method, and obtain parameter information of a parameter to be inserted encapsulated in the custom object, where the parameter information includes a value of the parameter to be inserted and a parameter to be inserted in the database table. The corresponding insertion position; understandably, the parameter information can be set according to requirements, and is not limited to that described in this embodiment; the insertion method can interpret and obtain the parameters of the to-be-inserted parameters encapsulated in the custom object Parameter information.
S302,根据所述参数信息,生成将所述待插入参数存储至所述数据库表中相应的插入位置的存储指令;也即,在通过所述插入方法获取所述参数信息之后,即可生成将所述待插入参数存储至所述数据库表中相应的插入位置的存储指令。S302. Generate a storage instruction for storing the parameter to be inserted into a corresponding insertion position in the database table according to the parameter information; that is, after obtaining the parameter information through the insertion method, a A storage instruction for storing the parameter to be inserted into a corresponding insertion position in the database table.
S303,根据所述存储指令,将所述待插入参数存储至所述数据库表中相应的插入位置。S303. Store the parameter to be inserted into a corresponding insertion position in the database table according to the storage instruction.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
在一实施例中,如图8所示,提供一种数据库表的参数插入装置,该数据库表的参数插入装置与上述实施例中数据库表的参数插入方法一一对应。所述装置包括:In an embodiment, as shown in FIG. 8, a parameter insertion device for a database table is provided, and the parameter insertion device for the database table corresponds to the parameter insertion method for the database table in the above-mentioned embodiment. The device includes:
封装模块110,用于接收插入指令,将待插入参数封装至所述自定义对象中;The encapsulation module 110 is configured to receive an insertion instruction and encapsulate a parameter to be inserted into the custom object;
调用模块120,用于接收通用Package调用指令,调用所述通用Package中的插入方法将所述自定义对象传入所述插入方法中;An invoking module 120, configured to receive a general package call instruction, call an insert method in the general package, and pass the custom object into the insert method;
插入模块130,用于基于所述插入方法,将所述自定义对象中封装的待插入参数存储至数据库表中相应的插入位置。The inserting module 130 is configured to store, based on the inserting method, a parameter to be inserted encapsulated in the custom object to a corresponding inserting position in a database table.
上述实施例的数据库表的参数插入装置利用一个Package作为通用Package,把插入方法预先写入该通用Package中,在需要往数据库表里存储数据时,只要使用自定义的方法将待插入参数的所有字段封装至自定义的对象中,再调用通用Package中预先写入的插入方法,就可以完成将所述自定义对象中封装的待插入参数存储至数据库表中相应的插入位置的动作。本申请实现了软件设计高内聚低耦合的设计原则,且使得存储过程中的代码简洁可读,提升了开发效率,降低了维护成本。The parameter insertion device of the database table in the above embodiment uses a Package as a general package, and writes the insert method into the general package in advance. When data needs to be stored in the database table, as long as a custom method is used, all The field is encapsulated into a custom object, and then the pre-written insert method in the universal package is called to complete the action of storing the parameters to be inserted encapsulated in the custom object to the corresponding insert position in the database table. This application realizes the design principles of high cohesion and low coupling in software design, and makes the code in the stored process concise and readable, which improves development efficiency and reduces maintenance costs.
在一实施例中,如图9所示,所述封装模块110包括:In an embodiment, as shown in FIG. 9, the packaging module 110 includes:
第一检测子模块111,用于接收插入指令,检测所述插入指令中包含的待插入参数是否符合数据库表中对应插入位置的插入条件;A first detection sub-module 111, configured to receive an insertion instruction and detect whether a parameter to be inserted included in the insertion instruction meets an insertion condition of a corresponding insertion position in a database table;
提示子模块112,用于在不符合数据库表中对应插入位置的插入条件时,发出异常提示;Prompt submodule 112, which is used to issue an abnormal prompt when the insert condition of the corresponding insert position in the database table is not met;
映射子模块113,用于在符合数据库表中对应插入位置的插入条件时,根据自定义方法将待插入参数的所有字段映射至自定义对象中,并将其与数据库表中对应的插入位置关联。A mapping sub-module 113, configured to map all fields of the parameter to be inserted into a custom object according to a custom method when the insertion conditions of the corresponding insertion position in the database table are met, and associate them with the corresponding insertion position in the database table .
在一实施例中,如图10所示,所述封装模块110还包括:In an embodiment, as shown in FIG. 10, the packaging module 110 further includes:
第二检测子模块114,用于检测当前待插入参数是否已封装在所述自定义对象中;A second detection sub-module 114, configured to detect whether a parameter to be inserted is currently encapsulated in the custom object;
第一指令发送子模块115,用于在当前待插入参数已封装在所述自定义对象中时,发送通用Package调用指令;所述第一指令发送子模块115通信连接于所述调用模块120;A first instruction sending sub-module 115 is configured to send a general package calling instruction when a parameter to be inserted is currently encapsulated in the custom object; the first instruction sending sub-module 115 is communicatively connected to the calling module 120;
第二指令发送子模块116,用于在当前待插入参数未封装在所述自定义对象中时,发送插入指令。所述第二指令发送子模块116通信连接于所述第一检测子模块111。The second instruction sending submodule 116 is configured to send an insertion instruction when a parameter to be inserted is not encapsulated in the custom object. The second instruction sending sub-module 116 is communicatively connected to the first detecting sub-module 111.
在一实施例中,所述装置还用于在接收插入指令,将待插入参数封装至所述自定义对象中之前,接收自定义对象创建指令,创建自定义对象;还用于在接收通用Package调用指令,调用所述通用Package中的插入方法将所述自定义对象传入所述插入方法中之前,在通用Package中预先写入所述插入方法。In an embodiment, the device is further configured to receive a custom object creation instruction and create a custom object before receiving an insert instruction and encapsulating a parameter to be inserted into the custom object; and also used to receive a universal package The calling instruction calls the insert method in the universal package before the custom object is passed into the insert method, and the insert method is written in the universal package in advance.
在一实施例中,所述插入模块还用于通过所述插入方法解读所述自定义对象,获取所述自定义对象中封装的待插入参数的参数信息,所述参数信息包括待插入参数的值和待插入参数在所述数据库表中相应的插入位置;根据所述参数信息,生成将所述待插入参数存储至所述数据库表中相应的插入位置的存储指令;根据所述存储指令,将所述待插入参数存储至所述数据库表中相应的插入位置。In an embodiment, the inserting module is further configured to interpret the custom object through the inserting method, and obtain parameter information of a parameter to be inserted encapsulated in the custom object, where the parameter information includes a parameter to be inserted. A corresponding insertion position of the value and the parameter to be inserted in the database table; and a storage instruction for storing the parameter to be inserted into the corresponding insertion position in the database table according to the parameter information; according to the storage instruction, Storing the parameter to be inserted into a corresponding insertion position in the database table.
关于数据库表的参数插入装置的具体限定可以参见上文中对于数据库表的参数插入方法的限定,在此不再赘述。上述数据库表的参数插入装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于终端设备中的处理器中,也可以以软件形式存储于终端设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific limitation of the parameter insertion device of the database table, refer to the foregoing limitation on the method of parameter insertion of the database table, which will not be repeated here. Each module in the parameter insertion device of the database table may be implemented in whole or in part by software, hardware, and a combination thereof. Each of the above modules may be embedded in the processor in the form of hardware or independent of the processor in the terminal device, or may be stored in the memory of the terminal device in the form of software to facilitate the processor to call and execute the operations corresponding to the above modules.
在一个实施例中,提供了一种终端设备,该终端设备可以是服务器,其内部结构图可以如图11所示。该终端设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该终端设备的处理器用于提供计算和控制能力。该终端设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机可读指令和数据库。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该终端设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种数据库表的参数插入方法。In one embodiment, a terminal device is provided. The terminal device may be a server, and its internal structure diagram may be as shown in FIG. 11. The terminal device includes a processor, a memory, a network interface, and a database connected through a system bus. The processor of the terminal device is used to provide computing and control capabilities. The memory of the terminal device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer-readable instructions, and a database. The internal memory provides an environment for operating the operating system and computer-readable instructions in a non-volatile storage medium. The network interface of the terminal device is used to communicate with external terminals through a network connection. The computer-readable instructions are executed by a processor to implement a method for inserting parameters into a database table.
在一个实施例中,提供了一种终端设备(也即,计算机设备),包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,处理器执行计算机可读指令时实现以下步骤:In one embodiment, a terminal device (ie, a computer device) is provided, which includes a memory, a processor, and computer-readable instructions stored on the memory and executable on the processor, and the processor executes the computer-readable instructions. To achieve the following steps:
接收插入指令,将待插入参数封装至所述自定义对象中;接收通用Package调用指令,调用所述通用Package中的插入方法将所述自定义对象传入所述插入方法中;基于所述插入方法,将所述自定义对象中封装的待插入参数存储至数据库表中相应的插入位置。Receiving an insert instruction, and packaging a parameter to be inserted into the custom object; receiving a general package call instruction, calling an insert method in the general package to pass the custom object into the insert method; based on the insert Method: Store the parameter to be inserted encapsulated in the custom object to a corresponding insertion position in a database table.
上述实施例的终端设备利用一个Package作为通用Package,把插入方法预先写入该通用Package中,在需要往数据库表里存储数据时,只要使用自定义的方法将待插入参数的所有字段封装至自定义的对象中,再调用通用Package中预先写入的插入方法,就可以完成将所述自定义对象中封装的待插入参数存储至数据库表中相应的插入位置的动作。本申请实现了软件设计高内聚低耦合的设计原则,且使得存储过程中的代码简洁可读,提升了开发效率,降低了维护成本。The terminal device of the above embodiment uses a Package as a universal package, and writes an insert method into the universal package in advance. When data needs to be stored in a database table, as long as a custom method is used to encapsulate all fields of the parameters to be inserted into the package In the defined object, the pre-written insert method in the universal package is called, and then the action of storing the parameters to be inserted encapsulated in the custom object to the corresponding insert position in the database table can be completed. This application realizes the design principles of high cohesion and low coupling in software design, and makes the code in the stored process concise and readable, which improves development efficiency and reduces maintenance costs.
在一个实施例中,提供了一个或多个存储有计算机可读指令的非易失性可读存储介质,该非易失性可读存储介质上存储有计算机可读指令,该计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器实现以下步骤:In one embodiment, one or more non-volatile readable storage media storing computer readable instructions are provided, and the non readable storage medium stores computer readable instructions, the computer readable instructions When executed by one or more processors, causes the one or more processors to perform the following steps:
接收插入指令,将待插入参数封装至所述自定义对象中;接收通用Package调用指令,调用所述通用Package中的插入方法将所述自定义对象传入所述插入方法中;基于所述插入方法,将所述自定义对象中封装的待插入参数存储至数据库表中相应的插入位置。Receiving an insert instruction, and packaging a parameter to be inserted into the custom object; receiving a general package call instruction, calling an insert method in the general package to pass the custom object into the insert method; based on the insert Method: Store the parameter to be inserted encapsulated in the custom object to a corresponding insertion position in a database table.
上述实施例的计算机可读存储介质利用一个Package作为通用Package,把插入方法预先写入该通用Package中,在需要往数据库表里存储数据时,只要使用自定义的方法将待插入参数的所有字段封装至自定义的对象中,再调用通用Package中预先写入的插入方法,就可以完成将所述自定义对象中封装的待插入参数存储至数据库表中相应的插入位置的动作。本申请实现了软件设计高内聚低耦合的设计原则,且使得存储过程中的代码简洁可读,提升了开发效率,降低了维护成本。The computer-readable storage medium of the above embodiment uses a package as a universal package, and writes an insert method into the universal package in advance. When data needs to be stored in a database table, as long as all fields of the parameters to be inserted are used by a custom method The package is encapsulated into a custom object, and then the insert method written in the general package is called to complete the action of storing the parameters to be inserted encapsulated in the custom object to the corresponding insert position in the database table. This application realizes the design principles of high cohesion and low coupling in software design, and makes the code in the stored process concise and readable, which improves development efficiency and reduces maintenance costs.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM (ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by computer-readable instructions to instruct related hardware. The computer-readable instructions can be stored in a non-volatile computer. In the readable storage medium, the computer-readable instructions, when executed, may include the processes of the embodiments of the methods described above. Wherein, any reference to the memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。Those skilled in the art can clearly understand that, for the convenience and brevity of the description, only the above-mentioned division of functional units and modules is used as an example. In practical applications, the above functions can be allocated by different functional units according to needs. Module completion, that is, dividing the internal structure of the device into different functional units or modules to complete all or part of the functions described above.
以上所述实施例仅说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments only describe the technical solutions of the present application, rather than limiting the present invention. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still apply the foregoing embodiments. The recorded technical solutions are modified, or some of the technical features are equivalently replaced; and these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the application, and should be included in the application. Within the scope of protection.

Claims (20)

  1. 一种数据库表的参数插入方法,其特征在于,包括:A method for inserting parameters into a database table, which includes:
    接收插入指令,将待插入参数封装至所述自定义对象中;Receive an insert instruction, and encapsulate the parameter to be inserted into the custom object;
    接收通用Package调用指令,调用所述通用Package中的插入方法将所述自定义对象传入所述插入方法中;Receiving a general package call instruction, calling the insert method in the universal package to pass the custom object into the insert method;
    基于所述插入方法,将所述自定义对象中封装的待插入参数存储至数据库表中相应的插入位置。Based on the insertion method, the parameter to be inserted encapsulated in the custom object is stored to a corresponding insertion position in a database table.
  2. 如权利要求1所述的数据库表的参数插入方法,其特征在于,所述接收插入指令,将待插入参数封装至所述自定义对象中,包括:The method for parameter insertion of a database table according to claim 1, wherein the receiving an insert instruction and encapsulating the parameter to be inserted into the custom object comprises:
    接收插入指令,检测所述插入指令中包含的待插入参数是否符合数据库表中对应插入位置的插入条件;Receiving an insert instruction, and detecting whether the parameter to be inserted contained in the insert instruction meets an insert condition of a corresponding insert position in a database table;
    在不符合数据库表中对应插入位置的插入条件时,发出异常提示;When the insert condition of the corresponding insert position in the database table is not met, an exception prompt is issued;
    在符合数据库表中对应插入位置的插入条件时,根据自定义方法将待插入参数的所有字段映射至自定义对象中,并将其与数据库表中对应的插入位置关联。When the insertion conditions of the corresponding insertion position in the database table are met, all fields of the parameter to be inserted are mapped into the custom object according to a custom method, and are associated with the corresponding insertion position in the database table.
  3. 如权利要求2所述的数据库表的参数插入方法,其特征在于,所述接收插入指令,检测所述插入指令中包含的待插入参数是否符合数据库表中对应插入位置的插入条件之前,包括:The method for parameter insertion of a database table according to claim 2, wherein before receiving the insert instruction, detecting whether the parameter to be inserted contained in the insert instruction meets an insert condition of a corresponding insert position in the database table, comprises:
    检测当前待插入参数是否已封装在所述自定义对象中;Detecting whether the current parameter to be inserted is encapsulated in the custom object;
    在当前待插入参数已封装在所述自定义对象中时,发送通用Package调用指令;Sending a general Package call instruction when the currently to-be-inserted parameters have been encapsulated in the custom object;
    在当前待插入参数未封装在所述自定义对象中时,发送插入指令。When the current parameter to be inserted is not encapsulated in the custom object, an insert instruction is sent.
  4. 如权利要求1所述的数据库表的参数插入方法,其特征在于,所述接收插入指令,将待插入参数封装至所述自定义对象中之前,包括:The method for parameter insertion of a database table according to claim 1, wherein before the receiving an insert instruction and encapsulating a parameter to be inserted into the custom object, comprises:
    接收自定义对象创建指令,创建自定义对象;Receive custom object creation instructions to create custom objects;
    所述接收通用Package调用指令,调用所述通用Package中的插入方法将所述自定义对象传入所述插入方法中之前,还包括:Before the receiving a general package calling instruction, calling the insert method in the universal package, and before passing the custom object into the insert method, the method further includes:
    在通用Package中预先写入所述插入方法。The insertion method is written in a universal package in advance.
  5. 如权利要求1所述的数据库表的参数插入方法,其特征在于,所述基于所述插入方法,所述将所述自定义对象中封装的待插入参数存储至数据库表中相应的插入位置,包括:The method for inserting a parameter of a database table according to claim 1, wherein, based on the method for inserting, storing the parameter to be inserted encapsulated in the custom object to a corresponding insertion position in the database table, include:
    通过所述插入方法解读所述自定义对象,获取所述自定义对象中封装的待插入参数的参数信息,所述参数信息包括待插入参数的值和待插入参数在所述数据库表中相应的插入位置;Interpret the custom object by the insert method, and obtain parameter information of the parameter to be inserted encapsulated in the custom object, where the parameter information includes a value of the parameter to be inserted and a corresponding parameter in the database table. Insertion position
    根据所述参数信息,生成将所述待插入参数存储至所述数据库表中相应的插入位置的存储指令;Generating a storage instruction for storing the parameter to be inserted into a corresponding insertion position in the database table according to the parameter information;
    根据所述存储指令,将所述待插入参数存储至所述数据库表中相应的插入位置。Storing the parameter to be inserted into a corresponding insertion position in the database table according to the storage instruction.
  6. 一种数据库表的参数插入装置,其特征在于,包括:A parameter insertion device for a database table, comprising:
    封装模块,用于接收插入指令,将待插入参数封装至所述自定义对象中;A packaging module for receiving an insertion instruction and packaging a parameter to be inserted into the custom object;
    调用模块,用于接收通用Package调用指令,调用所述通用Package中的插入方法将所述自定义对象传入所述插入方法中;A calling module, configured to receive a general package calling instruction, call an insert method in the general package, and pass the custom object into the insert method;
    插入模块,用于基于所述插入方法,将所述自定义对象中封装的待插入参数存储至数据库表中相应的插入位置。An inserting module is configured to store, based on the inserting method, a parameter to be inserted encapsulated in the custom object to a corresponding inserting position in a database table.
  7. 如权利6所述的数据库表的参数插入装置,其特征在于,所述封装模块包括:The parameter insertion device for a database table according to claim 6, wherein the encapsulation module comprises:
    第一检测子模块,用于接收插入指令,检测所述插入指令中包含的待插入参数是否符合数据库表中对应插入位置的插入条件;A first detection submodule, configured to receive an insertion instruction and detect whether a parameter to be inserted included in the insertion instruction meets an insertion condition of a corresponding insertion position in a database table;
    提示子模块,用于在不符合数据库表中对应插入位置的插入条件时,发出异常提示;Prompt submodule, which is used to issue an exception prompt when the insert condition of the corresponding insert position in the database table is not met;
    映射子模块,用于在符合数据库表中对应插入位置的插入条件时,根据自定义方法将待插入参数的所有字段映射至自定义对象中,并将其与数据库表中对应的插入位置关联。A mapping sub-module is used to map all fields of the parameter to be inserted into a custom object according to a custom method when the insert condition of the corresponding insert position in the database table is met, and associate it with the corresponding insert position in the database table.
  8. 如权利7所述的数据库表的参数插入装置,其特征在于,所述封装模块还包括:The parameter insertion device for a database table according to claim 7, wherein the encapsulation module further comprises:
    第二检测子模块,用于检测当前待插入参数是否已封装在所述自定义对象中;A second detection submodule, configured to detect whether a parameter to be inserted is currently encapsulated in the custom object;
    第一指令发送子模块,用于在当前待插入参数已封装在所述自定义对象中时,发送通用Package调用指令;A first instruction sending submodule, configured to send a general package call instruction when a parameter to be inserted is currently encapsulated in the custom object;
    第二指令发送子模块,用于在当前待插入参数未封装在所述自定义对象中时,发送插入指令。The second instruction sending submodule is configured to send an insertion instruction when a parameter to be inserted is not encapsulated in the custom object.
  9. 如权利6所述的数据库表的参数插入装置,其特征在于,所述装置还用于在接收插入指令,将待插入参数封装至所述自定义对象中之前,接收自定义对象创建指令,创建自定义对象;还用于在接收通用Package调用指令,调用所述通用Package中的插入方法将所述自定义对象传入所述插入方法中之前,在通用Package中预先写入所述插入方法。The parameter insertion device for a database table according to claim 6, wherein the device is further configured to receive a custom object creation instruction before receiving an insert instruction and encapsulate the parameter to be inserted into the custom object, and create A custom object; it is also used to write the insert method in the universal package before receiving the universal package call instruction and calling the insert method in the universal package to pass the custom object into the insert method.
  10. 如权利要求6所述的数据库表的参数插入方法,其特征在于,所述插入模块还用于通过所述插入方法解读所述自定义对象,获取所述自定义对象中封装的待插入参数的参 数信息,所述参数信息包括待插入参数的值和待插入参数在所述数据库表中相应的插入位置;根据所述参数信息,生成将所述待插入参数存储至所述数据库表中相应的插入位置的存储指令;根据所述存储指令,将所述待插入参数存储至所述数据库表中相应的插入位置。The method for inserting a parameter of a database table according to claim 6, wherein the inserting module is further configured to interpret the custom object through the inserting method, and obtain a parameter to be inserted encapsulated in the custom object. Parameter information, the parameter information including the value of the parameter to be inserted and the corresponding insertion position of the parameter to be inserted in the database table; according to the parameter information, generating the corresponding parameter to be stored in the database table A storage instruction for an insertion position; and storing the parameter to be inserted into a corresponding insertion position in the database table according to the storage instruction.
  11. 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现如下步骤:A terminal device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, and is characterized in that the processor implements the computer-readable instructions as follows: step:
    接收插入指令,将待插入参数封装至所述自定义对象中;Receive an insert instruction, and encapsulate the parameter to be inserted into the custom object;
    接收通用Package调用指令,调用所述通用Package中的插入方法将所述自定义对象传入所述插入方法中;Receiving a general package call instruction, calling the insert method in the universal package to pass the custom object into the insert method;
    基于所述插入方法,将所述自定义对象中封装的待插入参数存储至数据库表中相应的插入位置。Based on the insertion method, the parameter to be inserted encapsulated in the custom object is stored to a corresponding insertion position in a database table.
  12. 如权利要求11所述的终端设备,其特征在于,所述接收插入指令,将待插入参数封装至所述自定义对象中,包括:The terminal device according to claim 11, wherein the receiving an insert instruction and encapsulating a parameter to be inserted into the custom object comprises:
    接收插入指令,检测所述插入指令中包含的待插入参数是否符合数据库表中对应插入位置的插入条件;Receiving an insert instruction, and detecting whether the parameter to be inserted contained in the insert instruction meets an insert condition of a corresponding insert position in a database table;
    在不符合数据库表中对应插入位置的插入条件时,发出异常提示;When the insert condition of the corresponding insert position in the database table is not met, an exception prompt is issued;
    在符合数据库表中对应插入位置的插入条件时,根据自定义方法将待插入参数的所有字段映射至自定义对象中,并将其与数据库表中对应的插入位置关联。When the insertion conditions of the corresponding insertion position in the database table are met, all fields of the parameter to be inserted are mapped into the custom object according to a custom method, and are associated with the corresponding insertion position in the database table.
  13. 如权利要求12所述的终端设备,其特征在于,所述接收插入指令,检测所述插入指令中包含的待插入参数是否符合数据库表中对应插入位置的插入条件之前,包括:The terminal device according to claim 12, wherein before receiving the insertion instruction and detecting whether the parameter to be inserted included in the insertion instruction meets an insertion condition of a corresponding insertion position in a database table, comprises:
    检测当前待插入参数是否已封装在所述自定义对象中;Detecting whether the current parameter to be inserted is encapsulated in the custom object;
    在当前待插入参数已封装在所述自定义对象中时,发送通用Package调用指令;Sending a general Package call instruction when the currently to-be-inserted parameters have been encapsulated in the custom object;
    在当前待插入参数未封装在所述自定义对象中时,发送插入指令。When the current parameter to be inserted is not encapsulated in the custom object, an insert instruction is sent.
  14. 如权利要求11所述的终端设备,其特征在于,所述处理器执行所述计算机可读指令时实现如下步骤:The terminal device according to claim 11, wherein when the processor executes the computer-readable instructions, the following steps are implemented:
    接收自定义对象创建指令,创建自定义对象;Receive custom object creation instructions to create custom objects;
    在通用Package中预先写入所述插入方法。The insertion method is written in a universal package in advance.
  15. 如权利要求11所述的终端设备,其特征在于,所述基于所述插入方法,所述将所述自定义对象中封装的待插入参数存储至数据库表中相应的插入位置,包括:The terminal device according to claim 11, wherein the storing the parameters to be inserted encapsulated in the custom object to a corresponding insertion position in a database table based on the insertion method comprises:
    通过所述插入方法解读所述自定义对象,获取所述自定义对象中封装的待插入参数的 参数信息,所述参数信息包括待插入参数的值和待插入参数在所述数据库表中相应的插入位置;Interpret the custom object by the insert method, and obtain parameter information of the parameter to be inserted encapsulated in the custom object, where the parameter information includes a value of the parameter to be inserted and a corresponding parameter in the database table. Insertion position
    根据所述参数信息,生成将所述待插入参数存储至所述数据库表中相应的插入位置的存储指令;Generating a storage instruction for storing the parameter to be inserted into a corresponding insertion position in the database table according to the parameter information;
    根据所述存储指令,将所述待插入参数存储至所述数据库表中相应的插入位置。Storing the parameter to be inserted into a corresponding insertion position in the database table according to the storage instruction.
  16. 一个或多个存储有计算机可读指令的非易失性可读存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:One or more non-volatile readable storage media storing computer-readable instructions, wherein when the computer-readable instructions are executed by one or more processors, the one or more processors execute The following steps:
    接收插入指令,将待插入参数封装至所述自定义对象中;Receive an insert instruction, and encapsulate the parameter to be inserted into the custom object;
    接收通用Package调用指令,调用所述通用Package中的插入方法将所述自定义对象传入所述插入方法中;Receiving a general package call instruction, calling the insert method in the universal package to pass the custom object into the insert method;
    基于所述插入方法,将所述自定义对象中封装的待插入参数存储至数据库表中相应的插入位置。Based on the insertion method, the parameter to be inserted encapsulated in the custom object is stored to a corresponding insertion position in a database table.
  17. 如权利要求16所述的非易失性可读存储介质,其特征在于,将待插入参数封装至所述自定义对象中,包括:The non-volatile readable storage medium of claim 16, wherein packaging the parameters to be inserted into the custom object comprises:
    接收插入指令,检测所述插入指令中包含的待插入参数是否符合数据库表中对应插入位置的插入条件;Receiving an insert instruction, and detecting whether the parameter to be inserted contained in the insert instruction meets an insert condition of a corresponding insert position in a database table;
    在不符合数据库表中对应插入位置的插入条件时,发出异常提示;When the insert condition of the corresponding insert position in the database table is not met, an exception prompt is issued;
    在符合数据库表中对应插入位置的插入条件时,根据自定义方法将待插入参数的所有字段映射至自定义对象中,并将其与数据库表中对应的插入位置关联。When the insertion conditions of the corresponding insertion position in the database table are met, all fields of the parameter to be inserted are mapped into the custom object according to a custom method, and are associated with the corresponding insertion position in the database table.
  18. 如权利要求17所述的非易失性可读存储介质,其特征在于,所述接收插入指令,检测所述插入指令中包含的待插入参数是否符合数据库表中对应插入位置的插入条件之前,包括:The non-volatile readable storage medium according to claim 17, wherein before receiving the insert instruction, detecting whether a parameter to be inserted contained in the insert instruction meets an insert condition of a corresponding insert position in a database table, include:
    检测当前待插入参数是否已封装在所述自定义对象中;Detecting whether the current parameter to be inserted is encapsulated in the custom object;
    在当前待插入参数已封装在所述自定义对象中时,发送通用Package调用指令;Sending a general Package call instruction when the currently to-be-inserted parameters have been encapsulated in the custom object;
    在当前待插入参数未封装在所述自定义对象中时,发送插入指令。When the current parameter to be inserted is not encapsulated in the custom object, an insert instruction is sent.
  19. 如权利要求16所述的非易失性可读存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行如下步骤:The non-volatile readable storage medium of claim 16, wherein when the computer-readable instructions are executed by one or more processors, the one or more processors further perform the following steps:
    接收自定义对象创建指令,创建自定义对象;Receive custom object creation instructions to create custom objects;
    在通用Package中预先写入所述插入方法。The insertion method is written in a universal package in advance.
  20. 如权利要求16所述的非易失性可读存储介质,其特征在于,所述基于所述插入 方法,所述将所述自定义对象中封装的待插入参数存储至数据库表中相应的插入位置,包括:The non-volatile readable storage medium according to claim 16, wherein, based on the inserting method, the storing the parameters to be inserted encapsulated in the custom object to a corresponding insert in a database table Location, including:
    通过所述插入方法解读所述自定义对象,获取所述自定义对象中封装的待插入参数的参数信息,所述参数信息包括待插入参数的值和待插入参数在所述数据库表中相应的插入位置;Interpret the custom object by the insert method, and obtain parameter information of the parameter to be inserted encapsulated in the custom object, where the parameter information includes a value of the parameter to be inserted and a corresponding parameter in the database table. Insertion position
    根据所述参数信息,生成将所述待插入参数存储至所述数据库表中相应的插入位置的存储指令;Generating a storage instruction for storing the parameter to be inserted into a corresponding insertion position in the database table according to the parameter information;
    根据所述存储指令,将所述待插入参数存储至所述数据库表中相应的插入位置。Storing the parameter to be inserted into a corresponding insertion position in the database table according to the storage instruction.
PCT/CN2018/106265 2018-07-18 2018-09-18 Parameter insertion method and apparatus for database table, terminal device, and storage medium WO2020015151A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810788208.2A CN109063044B (en) 2018-07-18 2018-07-18 Parameter insertion method and device for database table, terminal equipment and storage medium
CN201810788208.2 2018-07-18

Publications (1)

Publication Number Publication Date
WO2020015151A1 true WO2020015151A1 (en) 2020-01-23

Family

ID=64816956

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/106265 WO2020015151A1 (en) 2018-07-18 2018-09-18 Parameter insertion method and apparatus for database table, terminal device, and storage medium

Country Status (2)

Country Link
CN (1) CN109063044B (en)
WO (1) WO2020015151A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110814517B (en) * 2019-10-28 2022-05-24 大族激光科技产业集团股份有限公司 Method, device, equipment and storage medium for controlling laser galvanometer welding

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101706803A (en) * 2009-11-27 2010-05-12 天津工业大学 Method for migrating production data of weaving workshop
CN102411598A (en) * 2011-07-29 2012-04-11 株洲南车时代电气股份有限公司 Method and system for realizing data consistency
CN106547835A (en) * 2016-08-04 2017-03-29 贵阳朗玛信息技术股份有限公司 Call the method and device of database store process

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9396218B2 (en) * 2013-09-16 2016-07-19 International Business Machines Corporation Database insert with deferred materialization
CN106933828B (en) * 2015-12-29 2019-11-12 北京国双科技有限公司 Data insertion method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101706803A (en) * 2009-11-27 2010-05-12 天津工业大学 Method for migrating production data of weaving workshop
CN102411598A (en) * 2011-07-29 2012-04-11 株洲南车时代电气股份有限公司 Method and system for realizing data consistency
CN106547835A (en) * 2016-08-04 2017-03-29 贵阳朗玛信息技术股份有限公司 Call the method and device of database store process

Also Published As

Publication number Publication date
CN109063044B (en) 2023-04-18
CN109063044A (en) 2018-12-21

Similar Documents

Publication Publication Date Title
CN109344642B (en) Interface rule checking method, device, computer equipment and storage medium
CN109460527B (en) Product data configuration method, device, computer equipment and storage medium
CN109474662B (en) Product data publishing method and device, computer equipment and storage medium
CN109814943B (en) Service construction method, loading method and device, electronic equipment and storage medium
CN107526598B (en) Network page jump control method and system
CN108881111B (en) Method and device for realizing multi-tenant system
US10305962B1 (en) Unit testing clients of web services
CN109857404B (en) SDK interface packaging method and device, storage medium and electronic equipment
CN110955448A (en) Intelligent contract separation method, contract processing method, apparatus, device and medium
WO2020199594A1 (en) Service component loading method and apparatus, and computer device and storage medium
WO2021121407A1 (en) Capacity changing method and apparatus for virtual machine
WO2021164462A1 (en) Data encryption method, data decryption method, computer device, and medium
WO2023010814A1 (en) Method and apparatus for monitoring dio network request
CN109254765B (en) Timing task management method, device, computer equipment and storage medium
CN113687858A (en) Configuration file checking method and device, electronic equipment and storage medium
CN114237960A (en) Prompting method and device for abnormal information, electronic equipment and storage medium
CN107273226B (en) Method and device for integrating components in android system and calling integrated components
WO2020015151A1 (en) Parameter insertion method and apparatus for database table, terminal device, and storage medium
WO2022116428A1 (en) End-to-end active-active method, apparatus and device, and storage medium
CN109614188B (en) Page online help method and device, computer equipment and storage medium
WO2023232052A1 (en) Method for processing remote certification report, and database server and database client
CN116244682A (en) Database access method, device, equipment and storage medium
CN111241588B (en) Method and device for realizing auxiliary function in application
CN110633146B (en) Method, equipment and readable medium for multithread operation of IPMI command
CN109783156B (en) Application starting control method and device

Legal Events

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

Ref document number: 18926504

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18926504

Country of ref document: EP

Kind code of ref document: A1