CN115481932B - ERP system database trigger generation method, storage medium and electronic device - Google Patents

ERP system database trigger generation method, storage medium and electronic device Download PDF

Info

Publication number
CN115481932B
CN115481932B CN202211289646.7A CN202211289646A CN115481932B CN 115481932 B CN115481932 B CN 115481932B CN 202211289646 A CN202211289646 A CN 202211289646A CN 115481932 B CN115481932 B CN 115481932B
Authority
CN
China
Prior art keywords
trigger
database
template
variable
database trigger
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211289646.7A
Other languages
Chinese (zh)
Other versions
CN115481932A (en
Inventor
凌远龙
凌辉英
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Yanghai Digital Technology Co ltd
Original Assignee
Guangzhou Yanghai Digital Technology Co ltd
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 Guangzhou Yanghai Digital Technology Co ltd filed Critical Guangzhou Yanghai Digital Technology Co ltd
Priority to CN202211289646.7A priority Critical patent/CN115481932B/en
Publication of CN115481932A publication Critical patent/CN115481932A/en
Application granted granted Critical
Publication of CN115481932B publication Critical patent/CN115481932B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06311Scheduling, planning or task assignment for a person or group
    • 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/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06316Sequencing of tasks or work
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/103Workflow collaboration or project management

Abstract

The invention discloses a method for generating a database trigger of an ERP system, a storage medium and an electronic device, wherein the method comprises the following steps: creating a database trigger template according to the database trigger class; analyzing a database trigger template to construct a trigger variable rule M; acquiring a trigger type, a trigger condition table and a trigger type of a target database; acquiring a corresponding trigger variable rule M according to the trigger category of the target database; creating a target database trigger variable set M according to the acquired trigger variable rule M; and sequentially transforming the variables in the target database trigger variable set m into a database trigger template, and operating the database trigger template to generate the target database trigger. The invention can effectively improve the efficiency of generating the data trigger and reduce the trigger development cost.

Description

ERP system database trigger generation method, storage medium and electronic device
Technical Field
The invention relates to the field of computers, in particular to a method for generating a database trigger of an ERP system, a storage medium and an electronic device.
Background
At present, in the time background of the rapid development of modern information, the management of enterprises is particularly important. More and more enterprises use ERP systems, and the enterprises are outstanding in the informatization industry by utilizing digital informatization products and combining with human management.
In products such as application software systems, there are numerous forms of ERP software, for example, ERP in-stock software, from drainage to on-line measurement, and links of in-store billing, purchasing, ex-warehouse, installation and maintenance, each link has at least one bill, and each link needs to be business-related, for example, in-store billing links, total amount of commodity in detail=commodity price discount, and also needs to be automatically calculated by a trigger. For example, the store is opened, the stock is insufficient, purchasing is carried out, then part of commodities are delivered, when delivered, the delivered quantity is updated by a trigger to the delivered quantity of the ordered commodities, and when the rest of commodities are delivered, the delivered quantity is calculated by the order quantity-delivered quantity. It can be seen that the trigger is an essential important role. In products such as ERP software systems, the add/modify/delete triggers are typically added/modified/deleted in the database. The existing development mode has at least the following problems: 1. trigger code non-standardization easily occurs, logic consideration is incomplete, and standardization is not achieved. 2. The same business relationship definition requires a large portion of the repetitive effort. 3. The triggers of all the tables of the ERP software system are inconvenient to uniformly manage. In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
In order to solve the problems in the prior art, the invention provides a method for generating a database trigger of an ERP system, a storage medium and an electronic device.
The embodiment of the invention provides a method for generating a database trigger of an ERP system, which comprises the following steps:
s1, creating a database trigger template according to the category of the database trigger, wherein the database trigger template is a code file for realizing the function of the category of the trigger, and comprises the following steps:
s11, analyzing business relations in an ERP system, and determining a plurality of database trigger categories which need to be defined for the business relations in the ERP system;
s12, analyzing the service relation associated with each database trigger type and a source data table in an ERP system according to each database trigger type, and creating a database trigger template corresponding to the database trigger type;
s13, fixing the association of the database trigger type and the database trigger through program logic for calling;
the program logic is to create a trigger association table of the database trigger category and the corresponding database trigger template variable rule M, wherein the created trigger association table at least comprises two fields, one is the database trigger category and the other is the database trigger template variable rule;
s2, analyzing the database trigger template, and constructing a trigger variable rule M= { M 1 ,M 2 ,M 3 ,…,M n N is a positive integer, M 1 、M 2 、M 3 、M n Core variables for constructing trigger variable rule M, including but not limited to table names or field names;
the trigger variable rule is a set of defined core variables extracted by analysis in the code file;
s3, acquiring a trigger type, a trigger condition table and a trigger type of the target database;
s4, acquiring a corresponding trigger variable rule M according to the trigger category of the target database;
s5, creating a target database trigger variable set m= { M according to the acquired trigger variable rule M 1 ,m 2 ,m 3 ,…,m n N is a positive integer, m 1 、m 2 、m 3 、m n Variables of a target database trigger created according to core variables in the trigger variable rule M, wherein the variables include, but are not limited to, table names or field names, and the target database trigger variable set is a variable set of the target database trigger created according to the core variable set in the acquired trigger variable rule M;
s6, sequentially converting variables in the target database trigger variable set m into the database trigger templates, and operating the database trigger templates to generate target database triggers, wherein the method specifically comprises the following steps:
s61, acquiring the target database trigger variable set m= { m 1 ,m 2 ,m 3 ,…,m n The variable values in the sequence are stored in the objects 1 to n;
s62, reading the template file of the database trigger through program logic in the step S13, and storing the content of the template file into an object A;
s63, in the template file content object A, the objects 1 to n are replaced to the corresponding positions of the objects 1 to n in the program code in sequence, and a target database trigger is generated.
As an optional implementation manner, the database trigger categories in the step S1 at least include a transaction record trigger, a retention record trigger, a voucher transaction record trigger, a business transaction record trigger, a receipt change setting trigger, a receipt association relationship trigger, a receipt aggregation trigger, a current table calculation trigger, an accumulated relationship table trigger, a flow relationship definition table trigger, and a user-defined trigger;
the triggering condition table in the step S13 is the table name of the target database for adding and deleting;
the trigger type in step S13 includes a data update trigger, a data deletion trigger, and an unconditional trigger.
As an alternative embodiment, the suffix of the code file in step S1 is. INC.
As an optional embodiment, the step S2 further includes the steps of:
and creating a trigger association table of the database trigger categories and the corresponding database trigger template variable rules for calling.
As an optional embodiment, the step S4 specifically includes:
and calling the trigger association table, and acquiring the corresponding trigger variable rule M according to the trigger category of the target database.
The invention has the beneficial effects that:
1. by creating the trigger template, the user can call the trigger template when creating the trigger, thereby avoiding directly writing database codes to generate the trigger by completely relying on the user to enter the database, and reducing the difficulty of generating the trigger, so that the trigger is generated with operability;
2. the invention defines the fixed variable rule of the trigger content based on the trigger category corresponding to different templates, is beneficial to unification of service data and updating of data, and ensures that the maintenance work of the trigger data can be automatically completed.
Drawings
FIG. 1 is a flow chart of a method for generating a database trigger of an ERP system according to the invention;
FIG. 2 is a schematic diagram of a user actual use interface of an alternative ERP system database trigger generation method according to an embodiment of the invention;
FIG. 3 is a schematic diagram of an alternative ERP system database trigger generation apparatus according to an embodiment of the invention;
fig. 4 is a schematic structural view of an alternative electronic device according to an embodiment of the present invention.
In the figure:
a creation unit 101, an acquisition unit 102, a generation unit 103, a memory 202, a processor 204, a transmission device 206, a display 208, a connection bus 210.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It is noted that the terms "comprises" and "comprising," and any variations thereof, in the description and claims of the present invention and in the foregoing figures, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus.
As shown in fig. 1, an embodiment of the present invention provides a method for generating a database trigger of an ERP system, which includes the following steps:
s1, creating a database trigger template according to the category of the database trigger, comprising:
s11, analyzing business relations in the ERP system, and determining a plurality of database trigger categories which need to be defined for the business relations in the ERP system;
as an optional implementation manner, the database trigger categories for defining the business relationship in the ERP system in step S1 at least include a transaction record trigger, a leave record trigger, a voucher transaction record trigger, a business transaction record trigger, a receipt change setting trigger, a receipt association relationship trigger, a receipt aggregation trigger, a current table calculation trigger, an accumulated relationship table trigger, a flow relationship definition table trigger and a user-defined trigger.
The trigger category corresponds to the trigger content, and different categories correspond to different trigger templates.
S12, analyzing the service relation associated with each database trigger type and a source data table in an ERP system according to each database trigger type, and creating a database trigger template corresponding to the database trigger type;
as an alternative embodiment, the database trigger template in step S1 is a code file with a suffix of. INC for implementing the trigger class function.
S13, fixing the association of the database trigger type and the database trigger through program logic for calling.
In step S1, the trigger condition table is a target table name for adding and deleting, and when adding and deleting occur, trigger operation is required to trigger content.
Triggering when the data of the triggering type (UPDATE, INSERT) is updated in the step S1; (DELETE) data DELETE trigger; (UPDATE, INSERT, DELETE) unconditional triggering.
S2, analyzing a database trigger template to construct a trigger variable rule M= { M 1 ,M 2 ,M 3 ,…,M n -wherein n is a positive integer;
as an alternative embodiment, the trigger variable rule M in step S2 is defined for the parsed core variable set in the code file, such as what table is specified and what field is specified, respectively.
The trigger variable rules M for 3 trigger categories in an ERP system are detailed below by way of example:
the trigger class is to generate a transaction record: analyzing the database trigger template for generating transaction records, wherein the constructed trigger variable rule is M= { (the table name for generating the target table transaction table), (the field name for generating the target table transaction table), (the table name of the source data table), (the field name of the source data table) }, namely M 1 Table name of target table transaction table, M 2 Field name of target table transaction table, M 3 Table name of =source data table, M 4 The field name of the source data table, where n is equal to 4.
The trigger class is to generate a credential transaction record: analyzing the database trigger template for generating the credential transaction record, wherein the constructed trigger variable rule is M= { (table name of source data table), (field name of source data table) }, namely M 1 Table name of =source data table, M 2 The field name of the source data table, where n is equal to 2.
The trigger class is document aggregation: analyzing the database trigger templates of the bill aggregate, wherein the constructed trigger variable rule is M= { (trigger table field list), (target table field list) }, namely M 1 List of trigger table fields, M 2 Target table, M 3 Target table field list, where n equals 3.
The source data table may include, but is not limited to, physical tables, views and functions, for example, and may also be a stored procedure, according to actual situations.
Physical table: the table actually occupies the disk space of the server, namely, the user table. For example, the database trigger template for document aggregation can only be a physical table.
View: a virtual table defined by a query based on one or more tables holds the specific definition of the query, and the view does not contain any data.
Function: functions such as table value functions and scalar value functions. The Table value function is a function for returning the Table as a value, and returns a Table type equivalent to a virtual Table stored in a memory; a scalar value function is a function that returns only one field value as a return result.
The storage process comprises the following steps: is a set of SQL statements compiled for performing a specific function and stored in a database, and is executed by a user by specifying the name of the stored procedure and giving the parameters. The storage process may include logic control statements and data manipulation statements (add-delete-modify-check) that may accept parameters, output parameters, return single or multiple result sets, and return values.
The step S1 further includes the steps of:
and creating a trigger association table of the database trigger categories and the corresponding database trigger template variable rules for calling.
The created trigger association table at least comprises two fields, one is a database trigger category and the other is a database trigger template variable rule.
S3, acquiring a trigger type, a trigger condition table and a trigger type of the target database;
s4, acquiring a corresponding trigger variable rule according to the trigger category of the target database;
as an alternative embodiment, step S4 is specifically:
and calling a trigger association table, and acquiring a corresponding trigger variable rule according to the trigger category of the target database.
S5, creating a target database trigger variable set m= { m according to the acquired trigger variable rule 1 ,m 2 ,m 3 ,…,m n };
S6, gathering target database trigger variables m= { m 1 ,m 2 ,m 3 ,…,m n Sequentially transforming the internal variables into a database trigger template, operating the database trigger template, and generating a target database trigger.
As an alternative embodiment, step S6 is specifically:
s61, taking a target database trigger variable set m= { m 1 ,m 2 ,m 3 ,…,m n The variable values in the sequence are stored in the objects 1 to n;
s62, reading a database trigger template file through program logic in the step S14, and storing the template file content into an object A;
s63, in the template file content object A, the objects 1 to n are replaced to the corresponding positions of the objects 1 to n in the program code in sequence, and a target database trigger is generated.
In addition, the generated target database Trigger is named by a system_id field value of trigger+trigger, and in the database, whether the Trigger is named as Trigger ID of Trigger is judged first. If the database table exists, deleting the trigger, and if the database table does not exist, executing operation to create the trigger of the database table.
Because the trigger may be modified by the user just before the trigger is executed, or by the user previously saving the trigger. The system firstly judges whether the trigger of the trigger name exists in the database or not, if so, the system firstly deletes the name trigger in the database, and then recreates the trigger of the current content. If not, directly creating a current content trigger.
In the technical scheme, except for the trigger types described in detail above for generating transaction records, the rest trigger types can be customized to be the template file with the suffix of INC, and the trigger types can be customized according to actual services. For example, a table may be generated, or some custom field of a table may be updated.
When the ERP system is actually used by a user, an operation interface is arranged in the ERP system, as shown in fig. 2. The operation interface is internally provided with trigger types, trigger condition tables, trigger types, trigger contents (trigger variable rules), newly added, stored, generated triggers (application reconstruction triggers) and other contents. The user only needs to generate a plurality of target database triggers in batches according to the following simple steps:
s1: firstly, a user selects a trigger type, a trigger condition table and a trigger type in an operation interface;
the trigger categories in the operation interface are the category list of all established triggers in the ERP system, and a user can select the category to fill in according to the trigger categories generated by the operation interface; the trigger condition table and the trigger type can be selected and filled in the user interface according to the requirement;
s2: after the user selects to fill in the trigger category, the trigger content position of the user interface automatically displays trigger content (trigger variable rule) according to the trigger category selected by the user;
s3: the user fills in all trigger variables according to the trigger variable rules as required;
s4: clicking on the new addition or saving, the system establishes a setting table in the ERP system, which at least comprises: trigger category, trigger condition table, trigger type, trigger content field;
and if a plurality of triggers are required to be generated at one time, repeating the steps S1-S3 after the new trigger is clicked to generate a plurality of records.
S5: clicking the generation trigger submits an instruction to generate the database trigger.
And when trigger setting table information sent by a user in service relation definition is received, the trigger information is sent to a background server for receiving. The background server converts the trigger setting list information into a database trigger code:
taking the generation of a transaction record as an example:
the trigger content, namely the trigger variable rule, is: (Table name of production target Table transaction Table) (field name of production target Table transaction Table) (Table name of Source data Table) (field name of Source data Table)
The values in the 4 brackets are taken out and stored in the object 1, the object 2, the object 3 and the object 4, respectively. Reading a template file with a suffix of INC to produce a transaction record, examples: sys_mb_trigger_jyb.inc. The template file content is stored in the object a, in which the object 1 is replaced with [ # object 1, the object 2 is replaced with [ # object 2, the object 3 is replaced with [ # object 3, and the object 4 is replaced with [ # object 4]. Thus, the final production transaction record trigger content is produced. A plurality of records of a setup table generate a plurality of corresponding database triggers.
According to another aspect of the embodiment of the invention, a trigger generating device for implementing the trigger generating method of the ERP system database is also provided.
As shown in fig. 3, the apparatus includes:
a creating unit 101, configured to create a database trigger template according to the database trigger category, and parse the database trigger template to construct a trigger variable rule M;
the acquiring unit 102 is configured to acquire a target database trigger category, a trigger condition table, and a trigger type, and acquire a corresponding trigger variable rule according to the target database trigger category and a target database trigger variable set m created by a user according to the trigger variable rule;
and the generating unit 103 is used for transforming the variable in the target database trigger variable set m into a database trigger template, running the database trigger template and generating the target database trigger.
According to a further aspect of the embodiments of the present invention, there is also provided an electronic device for implementing the above-mentioned method for generating a database trigger of an ERP system, as shown in fig. 4, the electronic device comprising a memory 202 and a processor 204, the memory 202 having stored therein a computer program, the processor 204 being arranged to perform the steps of any of the method embodiments described above by means of the computer program.
Alternatively, in this embodiment, the electronic apparatus may be located in at least one network device of a plurality of network devices of the computer network.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, creating a database trigger template according to the category of the database trigger;
s2, analyzing a database trigger template to construct a trigger variable rule M= { M 1 ,M 2 ,M 3 ,…,M n -wherein n is a positive integer;
s3, acquiring a trigger type, a trigger condition table and a trigger type of the target database;
s4, acquiring a corresponding trigger variable rule according to the trigger category of the target database;
s5, creating a target database trigger variable set m= { m according to the acquired trigger variable rule 1 ,m 2 ,m 3 ,…,m n };
S6, transforming the target database trigger variable set into a database trigger template, operating the database trigger template and generating the target database trigger. Alternatively, it will be understood by those skilled in the art that the structure shown in fig. 4 is only schematic, and the electronic device may also be a terminal device such as a smart phone (e.g. an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and a mobile internet device (Mobile Internet Devices, MID), a PAD, etc. Fig. 4 is not limited to the structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, etc.) than shown in FIG. 4, or have a different configuration than shown in FIG. 4.
The memory 202 may be used to store software programs and modules, such as program instructions/modules corresponding to the method and apparatus for generating an ERP system database trigger in the embodiment of the present invention, and the processor 204 executes the software programs and modules stored in the memory 202, thereby executing various functional applications and data processing, that is, implementing the method for generating an ERP system database trigger. Memory 202 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 202 may further include memory remotely located relative to the processor 204, which may be connected to the terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The memory 202 may be used to store information such as operation instructions, but is not limited to. As an example, as shown in fig. 4, the above memory 202 may include, but is not limited to, the creation unit 101, the acquisition unit 102, and the generation unit 103 in the above trigger generation apparatus. In addition, other module units in the trigger generating apparatus may be included, but are not limited to, and are not described in detail in this example.
Optionally, the transmission device 206 is used to receive or transmit data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 206 includes a network adapter (Network Interface Controller, NIC) that may be connected to other network devices and routers via a network cable to communicate with the internet or a local area network. In one example, the transmission device 206 is a Radio Frequency (RF) module that is configured to communicate wirelessly with the internet.
In addition, the electronic device further includes: a display 208 for displaying the trigger generation demand information, the metadata model, and the like; and a connection bus 210 for connecting the respective module parts in the above-described electronic device.
According to a further aspect of embodiments of the present invention there is also provided a storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store a computer program for performing the steps of:
s1, creating a database trigger template according to the category of the database trigger;
s2, analyzing a database trigger template to construct a trigger variable rule M= { M 1 ,M 2 ,M 3 ,…,M n -wherein n is a positive integer;
s3, acquiring a trigger type, a trigger condition table and a trigger type of the target database;
s4, acquiring a corresponding trigger variable rule according to the trigger category of the target database;
s5, rootCreating a target database trigger variable set m= { m according to the acquired trigger variable rule 1 ,m 2 ,m 3 ,…,m n };
S6, transforming the target database trigger variable set into a database trigger template, operating the database trigger template and generating the target database trigger. Alternatively, in this embodiment, it will be understood by those skilled in the art that all or part of the steps in the methods of the above embodiments may be performed by a program for instructing a terminal device to execute the steps, where the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), magnetic or optical disk, and the like.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
The integrated units in the above embodiments may be stored in the above-described computer-readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present invention may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing one or more computer devices (which may be personal computers, servers or network devices, etc.) to perform all or part of the steps of the method of the various embodiments of the present invention.
In the foregoing embodiments of the present invention, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and are merely a logical functional division, and there may be other manners of dividing the apparatus in actual implementation, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.

Claims (7)

1. The ERP system database trigger generation method is characterized by comprising the following steps of:
s1, creating a database trigger template according to the category of the database trigger, wherein the database trigger template is a code file for realizing the function of the category of the trigger, and comprises the following steps:
s11, analyzing business relations in an ERP system, and determining a plurality of database trigger categories which need to be defined for the business relations in the ERP system;
s12, analyzing the service relation associated with each database trigger type and a source data table in an ERP system according to each database trigger type, and creating a database trigger template corresponding to the database trigger type;
s13, fixing the association of the database trigger type and the database trigger through program logic for calling;
the program logic is to create a trigger association table of the database trigger category and the corresponding database trigger template variable rule M, wherein the created trigger association table at least comprises two fields, one is the database trigger category and the other is the database trigger template variable rule;
s2, analyzing the database trigger template, and constructing a trigger variable rule M= { M 1 ,M 2 ,M 3 ,...,M n N is a positive integer, M 1 、M 2 、M 3 、M n Core variables for constructing trigger variable rule M, including but not limited to table names or field names;
the trigger variable rule is a set of defined core variables extracted by analysis in the code file;
s3, acquiring a trigger type, a trigger condition table and a trigger type of the target database;
s4, acquiring a corresponding trigger variable rule M according to the trigger category of the target database;
s5, creating a target database trigger variable set m= { M according to the acquired trigger variable rule M 1 ,m 2 ,m 3 ,…,m n N is a positive integer, m 1 、m 2 、m 3 、m n Variables of a target database trigger created according to core variables in the trigger variable rule M, wherein the variables include, but are not limited to, table names or field names, and the target database trigger variable set is a variable set of the target database trigger created according to the core variable set in the acquired trigger variable rule M;
s6, sequentially converting variables in the target database trigger variable set m into the database trigger templates, and operating the database trigger templates to generate target database triggers, wherein the method specifically comprises the following steps:
S61. acquiring the target database trigger variable set m= { m 1 ,m 2 ,m 3 , ... ,m n The variable values in the sequence are stored in the objects 1 to n;
s62, reading the template file of the database trigger through program logic in the step S13, and storing the content of the template file into an object A;
s63, in the template file content object A, the objects 1 to n are replaced to the corresponding positions of the objects 1 to n in the program code in sequence, and a target database trigger is generated.
2. The method for generating the database triggers of the ERP system according to claim 1, wherein the database trigger categories in step S1 at least include a create transaction record trigger, a create stay record trigger, a create voucher transaction record trigger, a create business transaction record trigger, a document change setting trigger, a document association relationship trigger, a document aggregation trigger, a current table calculation trigger, an accumulated relationship table trigger, a flow relationship definition table trigger, and a user-defined trigger;
the triggering condition table in the step S13 is the table name of the target database for adding and deleting;
the trigger type in step S13 includes a data update trigger, a data deletion trigger, and an unconditional trigger.
3. The method for generating a trigger of an ERP system database according to claim 1, wherein the suffix of the code file in the step S1 is. INC.
4. The ERP system database trigger generation method of claim 2, wherein the step S2 further comprises the steps of:
and creating a trigger association table of the database trigger categories and the corresponding database trigger template variable rules for calling.
5. The method for generating the ERP system database trigger according to claim 4, wherein the step S4 specifically comprises:
and calling the trigger association table, and acquiring the corresponding trigger variable rule M according to the trigger category of the target database.
6. A computer readable storage medium comprising a stored program, wherein the program when run performs the method of any one of claims 1 to 5.
7. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of the claims 1 to 5 by means of the computer program.
CN202211289646.7A 2022-10-20 2022-10-20 ERP system database trigger generation method, storage medium and electronic device Active CN115481932B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211289646.7A CN115481932B (en) 2022-10-20 2022-10-20 ERP system database trigger generation method, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211289646.7A CN115481932B (en) 2022-10-20 2022-10-20 ERP system database trigger generation method, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN115481932A CN115481932A (en) 2022-12-16
CN115481932B true CN115481932B (en) 2023-06-02

Family

ID=84395295

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211289646.7A Active CN115481932B (en) 2022-10-20 2022-10-20 ERP system database trigger generation method, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN115481932B (en)

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5855014A (en) * 1995-11-03 1998-12-29 Application Partners, Inc. Getfield function for a relational workgroup platform using keyword and workflow databases
US8898124B2 (en) * 2010-12-16 2014-11-25 International Business Machines Corporation Controlling database trigger execution with trigger return data
US8856246B2 (en) * 2011-08-10 2014-10-07 Clarizen Ltd. System and method for project management system operation using electronic messaging
CN109885581B (en) * 2019-03-14 2021-09-17 苏州达家迎信息技术有限公司 Database synchronization method, device, equipment and storage medium
US20210390485A1 (en) * 2020-06-16 2021-12-16 Dinvy, LLC Professional services tracking, reminder and data gathering method and apparatus
CN112051991B (en) * 2020-08-03 2022-11-11 国电南瑞科技股份有限公司 General data triggering method based on trigger rule description file
CN114816437A (en) * 2022-04-28 2022-07-29 重庆锐云科技有限公司 Method, system and equipment for reversely generating Java entity class
CN115168352A (en) * 2022-07-07 2022-10-11 深圳市布博卡科技有限公司 Data association method, terminal and storage medium

Also Published As

Publication number Publication date
CN115481932A (en) 2022-12-16

Similar Documents

Publication Publication Date Title
CN104954410A (en) Message pushing method, device thereof and server
CN108259553A (en) The sending method and terminal device of business mail
CN110969001B (en) Feedback information generation method and device, storage medium, processor and terminal
CN112148679A (en) Data interaction method, system, device and storage medium based on multiple data platforms
CN109814856B (en) Data entry method, device, terminal and computer readable storage medium
CN110472207A (en) List generation method and device
CN107241372A (en) Configuration information generation, sending method and resource loading method and apparatus and system
TW200532480A (en) Dynamic late binding of third party on demand services in an on-demand infrastructure
CN107506383B (en) Audit data processing method and computer equipment
CN103383687A (en) Page processing method and device
CN109783426A (en) Acquire method, apparatus, computer equipment and the storage medium of data
CN110795697A (en) Logic expression obtaining method and device, storage medium and electronic device
CN111429241A (en) Accounting processing method and device
CN107330717A (en) Advertisement placement method and system
CN112422450A (en) Computer equipment, and flow control method and device for service request
CN109389428A (en) Configuration method, device, computer equipment and the storage medium of wechat marketing
CN115481932B (en) ERP system database trigger generation method, storage medium and electronic device
CN111045928A (en) Interface data testing method, device, terminal and storage medium
CN109241401A (en) State information searching method, client, server and computer-readable medium
CN114218914A (en) Service matching method and related device
CN110347654A (en) A kind of method and apparatus of online cluster features
JP6581395B2 (en) Format conversion management apparatus and format conversion management method
CN112559646A (en) Report downloading method and device
CN113434742A (en) Account screening method and device, storage medium and electronic device
CN112905178A (en) Method, device, equipment and medium for generating business function page

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant