Method and device for determining production script

By generating pre-generated operation and maintenance rules in the operation and maintenance rules set, the required production data is directly obtained and the production scripts are automatically generated, which solves the problem of limited access to production data for operation and maintenance personnel during the production process, and improves the production efficiency and Security.

CN119474128APending Publication Date: 2025-02-18CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411532460.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In enterprise-level systems with high security levels, operation and maintenance personnel have strict restrictions on their permission to obtain production data, which makes the production process complex and difficult, and requires manual writing of a large number of SQL scripts, which is time-consuming and labor-intensive and has the risk of introducing errors.

Method used

By obtaining the pre-generated operation and maintenance rules in the operation and maintenance rules set, production scripts are generated based on context information, main operation information, query operation information, SQL operation information, etc., and the required production data is directly obtained without extracting all data in the production environment. , realizes the automatic generation of production scripts.

Benefits of technology

It improves production efficiency, reduces production difficulty, avoids the error risk caused by manual script writing, saves database resource overhead, and achieves the improvement of operation and maintenance efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474128A_ABST
    Figure CN119474128A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a device for determining a production script, which relate to the field of big data and can also be used in the financial field, and the method comprises the following steps: in response to receiving script request information sent by an operation and maintenance server, obtaining a pre-generated operation and maintenance rule in an operation and maintenance rule set, the operation and maintenance rule being composed of a plurality of rows of rule instructions, the multi-row rule instruction is generated according to context information, main operation information, query operation information, SQL operation information, first-row data information and operators of all rows, and the context information comprises production data identification; sending the production data identifier to an operation and maintenance server, so that the operation and maintenance server obtains corresponding production data based on the production data identifier; receiving production data sent by the operation and maintenance server, and performing query comparison processing on the production data based on the query operation information to generate a query comparison result; and generating a temporary result set based on the query comparison result, and generating a production script based on the SQL operation information and the temporary result set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of big data and can also be used in the financial field, and in particular to a method and device for determining a production script. Background Art

[0002] Production refers to the process of transitioning a project or system from the development and testing phase to the formal operation phase. In enterprise-level systems with a high security level, in order to minimize the production risks caused by human operational errors, strict restrictions are usually imposed on the operation permissions of operation and maintenance personnel. This includes not only access control to the production environment database, but also direct operation permissions to production data. In this environment, operation and maintenance personnel are prohibited from directly contacting and operating production data to ensure data integrity and security.

[0003] In order to maintain production data, enterprise-level systems rely on automated operation and maintenance tools to perform necessary data updates and maintenance. These tools usually automate data processing by executing predefined SQL scripts. However, this automation process also has certain challenges. Developers need to manually write a large number of SQL scripts every time they go into production, which is not only time-consuming and labor-intensive, but also has the risk of introducing errors.

[0004] In addition, since the access to production data is strictly restricted, operation and maintenance personnel often need to refer to production data when performing manual operations. This restriction makes it difficult for operation and maintenance personnel to obtain necessary data information, thereby increasing the complexity and difficulty of production.

[0005] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section. Summary of the invention

[0006] An embodiment of the present invention provides a method for determining a production script, which is used to improve production efficiency and reduce production difficulty. The method includes:

[0007] In response to receiving the script request information sent by the operation and maintenance server, obtaining a pre-generated operation and maintenance rule in the operation and maintenance rule set, the operation and maintenance rule consists of multiple lines of rule instructions, the multiple lines of rule instructions are generated according to context information, main operation information, query operation information, SQL operation information, first line of data information and operators of each line, and the context information includes a production data identifier;

[0008] Sending the production data identifier to the operation and maintenance server so that the operation and maintenance server obtains corresponding production data based on the production data identifier;

[0009] Receive the production data sent by the operation and maintenance server, and perform query and comparison processing on the production data based on the query operation information to generate a query and comparison result;

[0010] Generate a temporary result set based on the query comparison results, and generate a production script based on the SQL operation information and the temporary result set.

[0011] Optionally, the steps of generating operation and maintenance rules include:

[0012] Determine a first rule instruction of an operation and maintenance rule according to the context information;

[0013] Multiple second rule instructions of the operation and maintenance rules are determined according to the main operation information, the query operation information, the SQL operation information and the operator of each row; the first rule instruction and the multiple second rule instructions constitute multiple rows of rule instructions.

[0014] Optionally, the context information includes at least one of the following: signal operation information, preprocessing operation information, and result set pointer information; and the first rule instruction for determining the operation and maintenance rule according to the context information includes:

[0015] Determine signal operation information according to the pre-generated first operation and second operation;

[0016] Determine preprocessing operation information according to pre-acquired preprocessing data, a preprocessing table, and a mapping relationship between the preprocessing data and the preprocessing table;

[0017] A first rule instruction of the operation and maintenance rule is determined according to the signal operation information, the preprocessing operation information, the result set pointer information and the first row data information.

[0018] Optionally, multiple second rule instructions of the operation and maintenance rule are determined according to the main operation information, the query operation information, the SQL operation information and the operator of each row, including:

[0019] Determining main operation information according to at least one operation generated in advance;

[0020] Performing a fusion operation on the identification information of the pre-processed data obtained in advance to obtain query operation information;

[0021] Acquire multiple operations involved in SQL operation information and determine SQL statements based on the multiple operations;

[0022] Determine SQL operation information based on SQL statements;

[0023] The main operation information, the query operation information, the SQL operation information and the operator of each row are combined to obtain a plurality of second rule instructions of the operation and maintenance rule.

[0024] Optionally, the SQL operation information includes the SQL operation;

[0025] Generate a temporary result set based on the query comparison results, and generate a production script based on the SQL operation information and the temporary result set, including:

[0026] Perform script conversion on temporary result sets based on SQL operations to generate production scripts.

[0027] Optionally, the main operation information includes a persistence instruction;

[0028] Based on SQL operations, temporary result sets are converted into scripts to generate production scripts, including:

[0029] Based on the persistence instruction, the temporary result set is persisted to generate a formal result set;

[0030] Based on the SQL operation information, the formal result set is converted into a script to generate a production script.

[0031] Optionally, the script request information includes production version information;

[0032] In response to receiving the script request information sent by the operation and maintenance server, obtaining the operation and maintenance rules in the operation and maintenance rule set, including:

[0033] Receive script request information sent by the operation and maintenance server;

[0034] Based on the production version information, the operation and maintenance rules corresponding to the production version information in the operation and maintenance rule set are obtained.

[0035] The embodiment of the present invention further provides a device for determining a production script, which is used to improve production efficiency and reduce production difficulty. The device includes:

[0036] A rule acquisition module, configured to acquire a pre-generated operation and maintenance rule in an operation and maintenance rule set in response to receiving script request information sent by the operation and maintenance server, wherein the operation and maintenance rule consists of multiple lines of rule instructions, and the multiple lines of rule instructions are generated based on context information, main operation information, query operation information, SQL operation information, first line of data information and operators of each line, and the context information includes a production data identifier;

[0037] A data acquisition module, used to send a production data identifier to an operation and maintenance server, so that the operation and maintenance server acquires corresponding production data based on the production data identifier;

[0038] The query comparison module is used to receive the production data sent by the operation and maintenance server, and perform query comparison processing on the production data based on the query operation information to generate a query comparison result;

[0039] The script determination module is used to generate a temporary result set based on the query comparison result, and to generate a production script based on the SQL operation information and the temporary result set.

[0040] Optionally, the steps of generating operation and maintenance rules include:

[0041] Determine a first rule instruction of an operation and maintenance rule according to the context information;

[0042] Multiple second rule instructions of the operation and maintenance rules are determined according to the main operation information, the query operation information, the SQL operation information and the operator of each row; the first rule instruction and the multiple second rule instructions constitute multiple rows of rule instructions.

[0043] Optionally, the context information includes at least one of the following: signal operation information, preprocessing operation information, and result set pointer information; and the first rule instruction for determining the operation and maintenance rule according to the context information includes:

[0044] Determine signal operation information according to the pre-generated first operation and second operation;

[0045] Determine preprocessing operation information according to pre-acquired preprocessing data, a preprocessing table, and a mapping relationship between the preprocessing data and the preprocessing table;

[0046] A first rule instruction of the operation and maintenance rule is determined according to the signal operation information, the preprocessing operation information, the result set pointer information and the first row data information.

[0047] Optionally, multiple second rule instructions of the operation and maintenance rule are determined according to the main operation information, the query operation information, the SQL operation information and the operator of each row, including:

[0048] Determining main operation information according to at least one operation generated in advance;

[0049] Performing a fusion operation on the identification information of the pre-processed data obtained in advance to obtain query operation information;

[0050] Acquire multiple operations involved in SQL operation information and determine SQL statements based on the multiple operations;

[0051] Determine SQL operation information based on SQL statements;

[0052] The main operation information, the query operation information, the SQL operation information and the operator of each row are combined to obtain a plurality of second rule instructions of the operation and maintenance rule.

[0053] Optionally, the SQL operation information includes the SQL operation;

[0054] The script determination module is specifically used for:

[0055] Perform script conversion on temporary result sets based on SQL operations to generate production scripts.

[0056] Optionally, the main operation information includes a persistence instruction;

[0057] The script determination module includes:

[0058] The persistence unit is used to perform persistence processing on the temporary result set based on the persistence instruction to generate a formal result set;

[0059] The conversion processing unit is used to perform script conversion processing on the formal result set based on the SQL operation information to generate a production script.

[0060] Optionally, the script request information includes production version information;

[0061] The rule acquisition module includes:

[0062] A request receiving unit, used to receive script request information sent by the operation and maintenance server;

[0063] The rule determination unit is used to obtain the operation and maintenance rules corresponding to the production version information in the operation and maintenance rule set based on the production version information.

[0064] An embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for determining the production script when executing the computer program.

[0065] An embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the method for determining the production script is implemented.

[0066] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the method for determining the production script is implemented.

[0067] The method and device for determining the production script provided by the embodiment of the present invention can obtain the operation and maintenance rules when receiving the script request information, and directly obtain the required production data according to the relevant instructions in the operation and maintenance rules, without extracting all the data in the production environment, without the need for additional database storage, and complete the extraction of production data at one time, thereby avoiding the waste of storage resources and improving the production efficiency. Furthermore, the production data is processed according to the relevant instructions in the operation and maintenance rules, and the production script corresponding to the production data is automatically generated, without the need for manual script writing, thus realizing the automatic generation of the production script, avoiding the risks caused by manual writing, further improving the production efficiency, and reducing the difficulty of production. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0069] Figure 1 A schematic diagram of the architecture of a production system provided by an embodiment of the present invention;

[0070] Figure 2 A schematic diagram of a flow chart of a method for determining a production script provided by an embodiment of the present invention;

[0071] Figure 3 A schematic flow chart of a method for determining a production script provided by another embodiment of the present invention;

[0072] Figure 4 A schematic flow chart of a method for determining a production script provided by another embodiment of the present invention;

[0073] Figure 5 A schematic flow chart of a method for determining a production script provided by another embodiment of the present invention;

[0074] Figure 6 A schematic flow chart of a method for determining a production script provided by another embodiment of the present invention;

[0075] Figure 7 A schematic diagram of operation and maintenance rules provided by an embodiment of the present invention;

[0076] Figure 8 A schematic diagram of an operation and maintenance rule provided by another embodiment of the present invention;

[0077] Fig. 9 A schematic diagram of an operation and maintenance rule provided by another embodiment of the present invention;

[0078] Fig.10 A schematic flow chart of a method for determining a production script provided by another embodiment of the present invention;

[0079] Fig.11 A schematic diagram of the structure of a device for determining a production script provided by an embodiment of the present invention;

[0080] Fig.12 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0081] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0082] The information collected in the technical solution of this application is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data comply with the relevant laws, regulations and standards of relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0083] The acquisition, transmission, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0084] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0085] As described in the background technology, in the traditional production process, it is necessary to use the operation and maintenance tools to fully extract the production data (also known as the production environment data) and store it in the test / development database. Further, manually write SQL scripts to query the target data. Then, manually write a large number of SQLs to complete the production script, and then hand it over to the operation and maintenance tool to execute the script to complete the production.

[0086] As can be seen from the above content, in the traditional production process, the operation and maintenance tools are required to extract all the data involved in the change in the production environment. In order to avoid affecting the production environment, the above data needs to be processed in a non-production environment. Therefore, the extracted data needs to be stored in the database of the test environment or the development environment. Further, in this database, the operation and maintenance personnel query the data required for production by writing SQL scripts. This data query method not only requires an additional database to store data, but also in the process of transferring data from the production environment to the test environment or the development environment, there may be data changes, resulting in the data in the development environment or the test environment not being the latest. If the script written based on the old data is further put into production, it may cause certain risks to the production environment. In addition, the current production process is too cumbersome, and there are many links that require manual participation. For example, the relevant processes for writing SQL scripts all need to be manually written, which is inefficient. Moreover, in the process of writing SQL scripts, not only a large amount of production data needs to be extracted and compared, but also SQL scripts need to be written field by field, which is a large workload and prone to errors. In enterprise systems with higher security levels, since the authority to obtain production data is strictly restricted, operation and maintenance personnel often need to operate against production data when performing manual operations. This limitation makes it difficult for operation and maintenance personnel to obtain necessary data information, thereby increasing the complexity and difficulty of production.

[0087] Based on this, the embodiment of the present invention provides a method and device for determining a production script, which can obtain operation and maintenance rules when receiving script request information, and directly obtain the required production data according to the relevant instructions in the operation and maintenance rules, without extracting all the data in the production environment, without the need for additional database storage, and complete the extraction of production data at one time, avoiding the waste of storage resources and improving production efficiency. Furthermore, the production data is processed according to the relevant instructions in the operation and maintenance rules, and the production script corresponding to the production data is automatically generated, without the need for manual script writing, thus realizing the automatic generation of the production script, avoiding the risks caused by manual writing, further improving the production efficiency, and reducing the difficulty of production.

[0088] like Figure 1 The figure is a schematic diagram of the architecture of a production system provided by an embodiment of the present invention. The production system includes at least one of the following: an operation and maintenance server, a rule engine, and a rule information management and control server. The method for determining the production script provided by the present inventor in the embodiment is applied to the rule engine.

[0089] In some embodiments, the operation and maintenance server is provided with an enterprise-level automated operation and maintenance tool for processing self-service scripts at the time of production, such as SQL scripts, so as to perform operations on production data and complete production. Specifically, when production is required, the operation and maintenance server sends a request message to the rule engine so that the rule engine enters the production process of the production script. In addition, in the production process of the production script, the rule engine sends corresponding instructions to the operation and maintenance server so that the operation and maintenance server obtains production data according to the instructions and sends it to the rule engine. Finally, the operation and maintenance server receives the production script generated by the rule engine and performs production according to the production script.

[0090] In some embodiments, after obtaining the request information sent by the operation and maintenance server, the rule engine sends the request information to the rule information control server to obtain the operation and maintenance rules, and completes the subsequent production script generation process based on the operation and maintenance rules. After generating the production script, the production script is sent to the operation and maintenance server so that the operation and maintenance server performs production according to the production script.

[0091] In some embodiments, the rule information management server is used to store an operation and maintenance rule set, which includes multiple operation and maintenance rules. Upon receiving a request from a rule engine, the rule engine sends the corresponding operation and maintenance rules to the rule engine, so that the rule engine generates a production script based on the operation and maintenance rules.

[0092] like Figure 2 As shown, it is a flow chart of a method for determining a production script provided by an embodiment of the present invention, which is applied to a rule engine and specifically includes the following steps:

[0093] S101. In response to receiving script request information sent by an operation and maintenance server, obtain a pre-generated operation and maintenance rule in an operation and maintenance rule set.

[0094] The operation and maintenance rules are composed of multiple lines of rule instructions, which are generated based on context information, main operation information, query operation information, SQL operation information, first line data information and operators of each line. The context information includes production data identifiers.

[0095] S102: Send the production data identifier to the operation and maintenance server, so that the operation and maintenance server obtains corresponding production data based on the production data identifier.

[0096] S103: Receive the production data sent by the operation and maintenance server, and perform query and comparison processing on the production data based on the query operation information to generate a query and comparison result.

[0097] S104: Generate a temporary result set based on the query comparison result, and generate a production script based on the SQL operation information and the temporary result set.

[0098] The method for determining the production script provided by the embodiment of the present invention can obtain the operation and maintenance rules when receiving the script request information, and directly obtain the required production data according to the relevant instructions in the operation and maintenance rules, without extracting all the data in the production environment, without the need for additional database storage, and complete the extraction of production data at one time, thereby avoiding the waste of storage resources and improving the production efficiency. Furthermore, the production data is processed according to the relevant instructions in the operation and maintenance rules, and the production script corresponding to the production data is automatically generated, without the need for manual script writing, thus realizing the automatic generation of the production script, avoiding the risks caused by manual writing, further improving the production efficiency, and reducing the difficulty of production.

[0099] The following is an explanation of each of the above steps:

[0100] S101. In response to receiving script request information sent by an operation and maintenance server, obtain a pre-generated operation and maintenance rule in an operation and maintenance rule set.

[0101] The operation and maintenance rules are composed of multiple lines of rule instructions, which are generated based on context information, main operation information, query operation information, SQL operation information, first line data information and operators of each line. The context information includes production data identifiers.

[0102] In some embodiments, the first line of data information is used to indicate a specific rule instruction of the first line of rule instructions among multiple lines of rule instructions.

[0103] Exemplarily, in actual application, the first line of data information indicates that the rule instruction corresponding to the context information is the first line of rule instructions.

[0104] In some embodiments, after the rule engine obtains the operation and maintenance rules, it first parses the operation and maintenance rules to obtain relevant information in the operation and maintenance rules, such as context information, main operation information, query operation information, SQL operation information, etc.

[0105] S102: Send the production data identifier to the operation and maintenance server, so that the operation and maintenance server obtains corresponding production data based on the production data identifier.

[0106] In some embodiments, the operation and maintenance rules include a production data identifier, which is specifically located in the pre-processing operation information in the context information.

[0107] Exemplarily, when the context information in the operation and maintenance rule carries preprocessing operation information, the preprocessing operation information includes a production data identifier. For example, PREPARE T1 FROM'SELECT*FROM table1WHERE id=? 'This rule instruction represents a preprocessing operation information. When the rule engine obtains the operation and maintenance rule carrying the above preprocessing operation information, the rule engine initiates a query request to the operation and maintenance server and sends the production data identifier (i.e., the id field of the above preprocessing operation information) to the operation and maintenance server, so that the operation and maintenance server queries the production data corresponding to the production data identifier from table1 based on the production data identifier.

[0108] It should be noted that if the operation and maintenance rules include preprocessing operation information, it indicates that production data needs to be extracted from the production environment. The rule engine can initiate a pre-query request to the operation and maintenance server based on the relevant content in the preprocessing operation information and / or the main operation information. Among them, the purpose of the pre-query request is to obtain the database table data involved in this production to the minimum extent, so when defining the query SQL of the PREPARE operation, you should try to use fields and values ​​with high discrimination to ensure that the extracted data is both accurate and efficient.

[0109] When the operation and maintenance server receives the production data identifier sent by the rule engine, the operation and maintenance server queries table 1 for production data corresponding to the production data identifier based on the production data identifier, and sends the queried production data to the rule engine.

[0110] As a possible implementation method, when the rule engine receives production data sent by the operation and maintenance server, the production data is formatted and persistently stored according to the preprocessing indication carried in the preprocessing operation information. The production data after persistent storage is also called preprocessing information or preprocessing copy.

[0111] In other embodiments, when the operation and maintenance rules obtained by the rule engine do not include pre-processing operation information, the rule engine obtains production data used in the previous production cycle.

[0112] It is understandable that, when the operation and maintenance rules obtained by the rule engine do not include preprocessing operation information, the rule engine cannot determine the production data identifier of the production data to be obtained. Therefore, the rule engine cannot send the production data identifier to the operation and maintenance server to obtain the corresponding production data. In the above case, the rule engine obtains the production data used in the previous production cycle for the subsequent production process.

[0113] S103, receiving the production data sent by the operation and maintenance server, and performing query and comparison processing on the production data based on the query operation information to generate a query and comparison result;

[0114] Exemplarily, the query operation information includes corresponding rule instructions, such as T1.col(column name x).in(T2.col(column name y)), T1.col(column name x).notin(T2.col(column name y)), etc. The rule engine performs query and comparison processing on the production data through the corresponding rule instructions. For example, T1.col(column name x).in(T2.col(column name y)) indicates whether the value of column name x in the T1 table exists in the value of column name y in the T2 table, and T1.col(column name x).notin(T2.col(column name y)) indicates whether the value of column name x in the T1 table is not in the value of column name y in the T2 table. After the rule engine executes the above instructions, the data result obtained is the query comparison result.

[0115] S104: Generate a temporary result set based on the query comparison result, and generate a production script based on the SQL operation information and the temporary result set.

[0116] The temporary result set can be a preprocessing information subset / copy or a string set. The life cycle of the temporary result set is the execution cycle of the row rule. The query operation definition rule of each row rule is based on object-oriented and function expressions. Each execution of the function expression will return a temporary (non-persistent) copy of the preprocessing information / copy.

[0117] Exemplarily, the query comparison results are processed to generate a corresponding temporary result set. For example, the rule engine converts the query comparison results into a string set and uses the string set as the temporary result set. For another example, the rule engine aggregates the query comparison results to generate summary information as the temporary result set. For another example, the rule engine can cross-reference the query comparison results with other data sources to generate a composite temporary result set.

[0118] In some embodiments, the temporary result set is converted based on the SQL operation information to generate a corresponding production script.

[0119] In some embodiments, the script request information includes production version information. Figure 3 As shown, in response to receiving the script request information, obtaining the operation and maintenance rules in the operation and maintenance rule set can be specifically implemented as the following steps:

[0120] S201. Receive script request information sent by an operation and maintenance server.

[0121] In some embodiments, when specific conditions are met, the operation and maintenance server sends script request information to the rule engine; accordingly, the rule engine receives the script request information sent by the operation and maintenance server.

[0122] Exemplarily, the specific conditions include at least one of the following:

[0123] A new production cycle begins: When a new version or update is ready to be deployed to the production environment, it indicates the beginning of a production cycle. In this case, the operation and maintenance server will send script request information to the rule engine.

[0124] Manually trigger production: Operation and maintenance personnel or developers may decide to start a production process based on project progress or business needs, and manually trigger it through an interactive interface or command to enable the operation and maintenance server to send script request information to the rule engine.

[0125] Scheduled production tasks: Production may be automatically triggered based on a time schedule. For example, at a specific time every week or month, the system will automatically start the production process according to the preset schedule, and the operation and maintenance server will also send script request information to the rule engine according to the preset schedule.

[0126] Compatibility test: When a new production version needs to be applied, the compatibility of the new production version with the existing production environment needs to be tested. If the compatibility test passes, the system starts the production process, and the operation and maintenance server also sends script request information to the rule engine.

[0127] S202: Based on the production version information, obtain the operation and maintenance rules corresponding to the production version information in the operation and maintenance rule set.

[0128] The production version information is used to represent the production environment version, and different production version information corresponds to different operation and maintenance rules. For example, the operation and maintenance rule set includes: operation and maintenance rule A, operation and maintenance rule B and operation and maintenance rule C. Operation and maintenance rule A corresponds to production environment version 1, operation and maintenance rule B corresponds to production environment version 2, and operation and maintenance rule C corresponds to production environment version 3.

[0129] Exemplarily, the rule engine sends the production version information to the rule information management server. Accordingly, the rule information management server receives the production version information sent by the rule engine, determines the operation and maintenance rules in the operation and maintenance rule set based on the production version information, and sends the operation and maintenance rules corresponding to the production version information to the rule engine.

[0130] In this way, the operation and maintenance server sends script request information to the rule engine to start the automated production process, reduce manual intervention, improve production efficiency, and avoid the risk of manual errors. In addition, different versions correspond to different production rules to ensure that the correct operation and maintenance rules are applied to the corresponding production version information to improve the accuracy and reliability of the production process. Different versions correspond to different rules, which avoids confusion between rules of different versions and reduces the risk caused by the wrong application of rules. Automatically matching production version information with operation and maintenance rules reduces the time for manual query and matching and improves production efficiency.

[0131] In other embodiments, in response to receiving the script request information, obtaining the operation and maintenance rules in the operation and maintenance rule set may be specifically implemented as follows: obtaining the operation and maintenance rules in the operation and maintenance rule set according to the order in which the rules are used.

[0132] The operation and maintenance rules in the operation and maintenance rule set are used in sequence. For example, the operation and maintenance rule set includes: operation and maintenance rule A, operation and maintenance rule B, and operation and maintenance rule C. Operation and maintenance rule A is used in the first production process, operation and maintenance rule B is used in the second production process, and operation and maintenance rule C is used in the third production process.

[0133] Exemplarily, when the rule engine receives the script request information sent by the operation and maintenance server, it sends the rule request information to the rule information control server. Correspondingly, the rule information control server receives the script request information sent by the rule engine, obtains the operation and maintenance rules in the operation and maintenance rule set according to the order of the production process, and sends the obtained operation and maintenance rules to the rule engine.

[0134] In this way, since the order of using operation and maintenance rules is fixed, it can effectively reduce the time required for selecting and matching rules and improve production efficiency.

[0135] In some embodiments, the operation and maintenance rules are composed of multiple lines of rule instructions. The first line in the operation and maintenance rules defines the context information, and each line of rule instructions thereafter begins with the definition of an operator to represent any of the above-mentioned main operation information, query operation information, and SQL operation information. The execution of each line of rule instructions is completed by an independent thread, and the synchronization and mutual exclusion between rules are controlled by the signal operation of the context information. Multiple lines of rule instructions in one operation and maintenance rule share one context information.

[0136] In this way, by dividing the operation and maintenance rules into context information, main operation information, query operation information and SQL operation information, a clear and structured rule design framework is provided, making the writing and understanding of rules more intuitive. Each line of rule instructions is completed by an independent thread, which improves the parallel processing capability, reduces blocking during execution, and improves the overall data processing efficiency.

[0137] In some embodiments, Figure 4 As shown in the figure, the steps for generating operation and maintenance rules specifically include the following:

[0138] S301. Determine a first rule instruction of an operation and maintenance rule according to context information.

[0139] The first rule instruction is the first line of rule instructions among multiple lines of rule instructions in the operation and maintenance rule.

[0140] In some embodiments, the context information includes at least one of the following: signal operation information, pre-processing operation information, and result set pointer information.

[0141] As a possible implementation, Figure 5 As shown, determining the first rule instruction of the operation and maintenance rule according to the context information specifically includes the following steps:

[0142] S3011. Determine signal operation information according to a pre-generated first operation and a second operation.

[0143] The signal operation information consists of the first operation and the second operation, and the signal operation information determines the logical order of rule execution. A semaphore (Major Opt Sinal) can be defined for the signal operation information, for example, S1, S2...Sn. If the first operation exists in the signal operation information, the corresponding semaphore issued by the second operation must be received before it can be executed. If the first operation does not exist, the signal operation information is directly executed.

[0144] The first operation and the second operation are specifically defined as follows:

[0145] The first operation (Sn): wait for receiving the Sn signal operation, and start executing the rule instruction after receiving the Sn signal.

[0146] The second operation (Sn): sending the Sn signal operation, sending the Sn signal after executing the rule instruction.

[0147] It should be noted that the first operation is also called a P operation, and the second operation is also called a V operation.

[0148] Based on the above content, when the pre-generated or pre-set first operation and second operation are obtained, the corresponding signal operation information can be generated according to the first operation and the second operation. For example, the signal operation information V(S1): indicates sending the signal S1, which is usually used to control the execution order of the rule execution. For another example, the signal operation information V(S2): indicates sending the signal S1, P(S1): indicates waiting to receive the signal S1 before starting to execute the rule.

[0149] S3012: Determine preprocessing operation information according to pre-acquired preprocessing data, a preprocessing table, and a mapping relationship between the preprocessing data and the preprocessing table.

[0150] The preprocessing operation information is used to define the preprocessing table name (Prepare Table Name), such as T1, T2...Tn, which is used to indicate the object name of the preprocessing table where the preprocessing data obtained by prequery loading is stored after persistence. If not defined, the preprocessing operation information and the PREPARE and EXECUTE operations corresponding to the preprocessing table name will not take effect.

[0151] Specifically, when the pre-acquired pre-processed data, the object name of the pre-processed table for persistently storing the pre-processed data, and the mapping relationship between the pre-processed data and the pre-processed table are determined, the pre-processing operation information can be directly generated. For example, the pre-processing operation information: T1, T2 is used to represent the names of two pre-processed tables T1 and T2. Tables T1 and T2 are used to store the results of the pre-query (i.e., the pre-processed data).

[0152] S3013. Determine the first rule instruction of the operation and maintenance rule according to the signal operation information, the preprocessing operation information, the result set pointer information and the first row data information.

[0153] Among them, the result set pointer information (Results Pointer) represents the data set pointer of the result set, such as R1, R2...Rn, which is used to indicate the result set. If the rule instruction is not defined, the C operation corresponding to the pointer in the rule instruction will not take effect. For example, the result set pointer information: R1, R2, defines two result set pointers R1 and R2 for representing the result set. The R1 result set and the R2 result set are used to store the data processed from the preprocessing table T1 and the preprocessing table T2 (such as the temporary result set or the formal result set mentioned below).

[0154] Specifically, when determining the above-mentioned signal operation information, preprocessing operation information and result set pointer information, the first line of rule instructions in multiple lines of rule instructions are indicated in combination with the first line of data information (for example, the rule instructions corresponding to the context information are placed in the first line), and the first rule instruction in the operation and maintenance rules is generated.

[0155] S302: Determine multiple second rule instructions of the operation and maintenance rule according to the main operation information, the query operation information, the SQL operation information and the operator of each row.

[0156] The first rule instruction and the plurality of second rule instructions constitute a multi-line rule instruction. The first rule instruction is the first line of the multi-line rule instruction in the operation and maintenance rules, and the plurality of second rule instructions are the non-first line of the multi-line rule instructions in the operation and maintenance rules, that is, the rule instructions other than the first line of the multi-line rule instructions.

[0157] In some embodiments, Figure 6 As shown, multiple second rule instructions of the operation and maintenance rules are determined according to the main operation information, the query operation information, the SQL operation information and the operator of each row, which can be specifically implemented as the following steps:

[0158] S3021. Determine main operation information according to at least one pre-generated operation.

[0159] In some embodiments, the major operation (major opt, MO) information may involve multiple operations. For example, SET: sets an attribute for the context information of the specified rule instruction. Among them, the attribute key is modified with @, the value can be a single value or a discrete value set, or it can be an external input parameter (including scripts and files) modified by &, which can be used for the passing of dynamic parameters. For another example, PREPARE: sets the pre-query data template operation, EXECUTE: executes the pre-query data operation and persists the pre-processing information, C(Rn): persists the result set of the executed rule, and points Rn to the result set.

[0160] Specifically, when determining the operation involved in the pre-generated or pre-set main operation information, the main operation information may be determined according to the corresponding operation, such as the above-mentioned SET, PREPARE, etc.

[0161] S3022: Perform a fusion operation on the identification information of the pre-processed data acquired in advance to obtain query operation information.

[0162] The query operation information is used to indicate the pre-processed data to be queried. After the identification information of the pre-acquired pre-processed data to be queried is determined, the identification information is fused to generate the query operation information.

[0163] Take Tn as preprocessing information / copy and R as a result set as an example, and make the following example:

[0164] T1.s(column name x = value): returns a subset copy of the preprocessing information T1 that meets the condition x column value = value. Where T1 is the name of the preprocessing information to which the preprocessing data belongs, value is the column value to which the preprocessing data belongs, and s is the query condition for the preprocessing data. The identification information (T1, value, s) of the preprocessing data obtained in advance is fused to obtain the query operation information.

[0165] T1.col(column name x): Returns a copy of the preprocessed information T1 with the marked column name x. col() supports multiple column name parameters. The marked column names are used for joint queries.

[0166] T1.col(column name x).in(T2.col(column name y)): Returns a copy of the subset of T1 where the set of column x values ​​of T1 exists in the set of column y values ​​of T2. It can be understood as given t1(1,3,3,5,5,7), t2(3,7), t1 in t2, then t1(3,3,7) is returned.

[0167] T1.col(column name x).in(R): returns a copy of the subset of T1 that exists in the result set R. This means that given t1(1,3,3,5,5,7), R(3,7), and t1 in R, t1(3,3,7) is returned.

[0168] T1.col(column name x).notin(T2.col(column name y)): Returns a copy of the subset of T1 where the set of column x values ​​of T1 exists in the set of column y values ​​of T2. It can be understood as given t1(1,3,3,5,5,7), t2(3,7), t1 in t2, then t1(1,5,5) is returned.

[0169] S3023. Obtain multiple operations involved in the SQL operation information and determine SQL statements based on the multiple operations.

[0170] Exemplarily, the multiple operations involved in the SQL operation information may be an insert operation and a delete operation. The SQL statement corresponding to the insert operation is INSERT, and the SQL statement corresponding to the delete operation is DELETE. Different SQL statements may be determined according to different SQL operations. The multiple operations involved in the SQL operation information may be pre-set or pre-generated.

[0171] S3024. Determine SQL operation information according to the SQL statement.

[0172] For example, the SQL operation information corresponding to the SQL statement INSERT may be T.INS(), T.INS(column name x, R1, column name y, R2). T.INS() is used to indicate that the INSERT SQL statement is directly generated based on the preprocessing information / copy, and the persistence operation is performed to prepare for sending to the operation and maintenance server.

[0173] T.INS(column name x, R1, column name y, R2) is used to indicate that according to the preprocessing information / replica, the x column value is set to R1 and the y column value is set to R2, and an INSERT SQL statement is generated to insert data, and a persistence operation is performed to prepare for sending to the operation and maintenance server.

[0174] As another example, the SQL operation information corresponding to the SQL statement DELETE may be T.DEL (column name x, column name y), which is used to represent that a DELETE SQL statement is generated based on the preprocessing information / replica with column x, column y and their corresponding values ​​as conditions, and a persistence operation is performed to prepare for sending to the operation and maintenance server.

[0175] As another example, the SQL operation information corresponding to the SQL statement UPDATE may be T.UPD(column name x, R1, column name y, column name z), T.UPD(column name x, column name y). Among them, T.UPD(column name x, R1, column name y, column name z) is used to represent that the value of column x is set to R1 according to the preprocessing information / replica, and the y column, z column and their corresponding values ​​are used as conditions to generate an UPDATE SQL statement to update data, and perform a persistence operation, and prepare to send it to the operation and maintenance server. T.UPD(column name x, column name y) is used to represent that the value of column x is set to the value of column y according to the preprocessing information / replica, and an UPDATE SQL statement to update data is generated, and a persistence operation is performed, and prepare to send it to the operation and maintenance server.

[0176] S3025. Combine the main operation information, the query operation information, the SQL operation information, and the operator of each row to obtain a plurality of second rule instructions of the operation and maintenance rule.

[0177] Specifically, when the main operation information, query operation information, and SQL operation information are determined, the main operation information, query operation information, SQL operation information, and the operator of each row are combined according to the operator of each row to obtain multiple second rule instructions, and the combination order is not limited.

[0178] It should be noted that the order of the main operation information, query operation information, and SQL operation information in the multiple second rule instructions can be arranged arbitrarily, but the execution priority of the rule instructions in the multiple rule instructions is as follows: the priority of the main operation information is higher than the query operation information and higher than the SQL operation information. Among them, the execution priority of the rule instructions in the multiple rule instructions can be set according to actual conditions, and this application does not limit this.

[0179] For example, Figure 7 FIG. 1 is a schematic diagram of an operation and maintenance rule provided by an embodiment of the present invention. The operation and maintenance rule is explained below:

[0180] V(S1): represents a signal operation, indicating sending signal S1, which is usually used to control the execution order of rule execution.

[0181] T1, T2: Two pre-processing tables named T1 and T2 are defined. Tables T1 and T2 are used to store the results of the pre-query, that is, to store the production data obtained subsequently.

[0182] R1, R2: Two result set pointers R1 and R2 are defined. These result sets are used to store the data processed from T1 and T2.

[0183] “SET T1@id=100” sets the attribute id of T1 to 100.

[0184] "PREPARE T1 FROM'SELECT*FROM table1 WHERE id=?'" is to prepare to query the data with id 100 from table1 and store it persistently as preprocessing information.

[0185] "SET T2@type=100" sets the attribute type of T2 to 100, which can be used to provide parameters for another pre-query operation.

[0186] "PREPARE T1 FROM'SELECT*FROM table1 WHERE id=?'" is to prepare to query data of type 100 from table2 and store it persistently as preprocessing information.

[0187] “SET R1=&File1” sets the result set R1 to point to the external file File1, indicating that the processing results are output to File1.

[0188] “SET R2=&File2” is to set the result set R2 to point to the external file File2, indicating that the processing results are output to File2.

[0189] As can be seen from the above, the operation and maintenance rule first sends a signal V(S1), then defines two pre-processing tables T1 and T2, which are used to load the data queried from table1 and table2 respectively. Then, it sets two external files File1 and File2 as the values ​​of the result set pointers R1 and R2.

[0190] Another exemplary example is Figure 8 FIG. 1 is a schematic diagram of another operation and maintenance rule provided by an embodiment of the present invention. The operation and maintenance rule is explained below:

[0191] V(S2): sends signal S2.

[0192] P(S1): Wait for receiving signal S1 before starting to execute the rules.

[0193] EXECUTE T1 USING@id: Use the attribute id to execute the pre-query data operation of T1.

[0194] EXECUTE T2 USING@type: Use the attribute type to execute the pre-query data operation of T2.

[0195] C(R3)T1.col(column name x).notin(T2.col(column name y)): persists the rows whose values ​​of column x in T1 are not in the set of values ​​of column y in T2 to the result set R3.

[0196] C(R4)T1.col(column name x).in(T2.col(column name z)).in(R2): stores the value of column x in T1 that exists in both the value set of column z in T2 and the rows in result set R2 in result set R4.

[0197] As can be seen from the above content, the operation and maintenance rule first sends a signal V(S2), waits for a signal from S1, and then executes the previously defined preprocessing operations T1 and T2, using the previously set parameters @id and @type. After that, two result sets R3 and R4 are created, R3 contains the records in T1 that are not in T2, and R4 contains the records in T1 that appear in T2 and are also in another result set R2.

[0198] Another exemplary example is Fig. 9 FIG. 1 is a schematic diagram of another operation and maintenance rule provided by an embodiment of the present invention. The operation and maintenance rule is explained below:

[0199] P(S1), P(S2): Wait for receiving signals S1 and S2 before starting to execute the rules.

[0200] R3.INS(column name x, R1): Generates an INSERT statement to insert the data in the R1 result set into column x.

[0201] R4.DEL(column name y): Generates a DELETE statement to delete the data specified by column y.

[0202] From the above content, we can see that this operation and maintenance rule waits for receiving two signals S1 and S2, and then executes the insertion operation R3.INS and the deletion operation R4.DEL. Specifically, it inserts the value of R1 into a column of R3 and deletes the record in R4 according to a certain condition.

[0203] In some embodiments, the SQL operation information includes the SQL operation, generating a temporary result set based on the query comparison result, and generating a production script based on the SQL operation information and the temporary result set, which can be specifically implemented as the following steps:

[0204] Perform script conversion on temporary result sets based on SQL operations to generate production scripts.

[0205] It is understandable that the production script includes at least one SQL statement for executing a corresponding SQL operation to modify production data. When the temporary result set is converted into a script, the corresponding SQL statement is generated by the relevant instructions of the SQL operation in the SQL operation information, and multiple SQL statements are combined to obtain a complete SQL script, which is the production script.

[0206] For example, Fig. 9 The operation and maintenance rules shown include instructions related to SQL operations, specifically R3.INS(column name x, R1) and R4.DEL(column name y). Among them, the SQL operation corresponding to R3.INS(column name x, R1) is to insert the value in R1 into the temporary result set R3, and the SQL statement generated according to this SQL operation is INSERT INTO table name (column name x) SELECT column name x FROM R1. Similarly, the SQL operation corresponding to R4.DEL(column name y) is to delete the record of column name y in the temporary result set R4, and the SQL statement generated according to this SQL operation is DELETE FROM table name WHERE column name y IN (SELECT column y FROM R4).

[0207] It should be noted that the above production script is generated based on a temporary result set, which has a short life cycle and does not require persistent storage, reducing the demand for storage resources. In addition, the temporary data set directly reflects the data status of the current production data, reducing the consistency issues that may occur during the transmission and storage of production data. In addition, since the temporary result set does not require long-term maintenance, the cost and complexity of long-term maintenance are reduced.

[0208] In some embodiments, when there are high requirements for the life cycle of the production script, for example, when the changes in production data need to be maintained for a long time and need to be persistently stored in the system, the temporary result set can be processed through the persistence instruction in the main operation information to obtain the formal result set, and the production script with a longer life cycle can be generated based on the formal result set. Specifically, the main operation information includes a persistence instruction, such as Fig.10 As shown, based on SQL operations, script conversion is performed on temporary result sets to generate production scripts, which can be specifically implemented as follows:

[0209] S401: Perform persistence processing on the temporary result set based on the persistence instruction to generate a formal result set.

[0210] Specifically, when the main operation information in the operation and maintenance rules carries a persistence instruction, the rule engine can schedule the persistent storage to persist the temporary result set so that the temporary result set is converted into a formal result set for context information reference in the operation and maintenance rules. Compared with the temporary result set, the formal result set has a longer life cycle and will be persistently stored once created and can be reused.

[0211] Exemplarily, the persistence instruction may be C(Rn), which is used to indicate that the temporary result set Rn is persisted to generate a formal result set.

[0212] S402: Perform script conversion processing on the formal result set based on the SQL operation information to generate a production script.

[0213] For example, Fig. 9 The operation and maintenance rules shown include instructions related to SQL operations, specifically R3.INS(column name x, R1) and R4.DEL(column name y). Among them, the SQL operation corresponding to R3.INS(column name x, R1) is to insert the value in R1 into the formal result set R3, and the SQL statement generated according to this SQL operation is INSERT INTO table name (column name x) SELECT column name x FROM R1. Similarly, the SQL operation corresponding to R4.DEL(column name y) is to delete the record of column name y in the formal result set R4, and the SQL statement generated according to this SQL operation is DELETE FROM table name WHERE column name y IN (SELECT column y FROM R4).

[0214] It is understandable that the production script generated based on the formal result set has the advantages of persistence and stability, has a long life cycle, can be reused in multiple rule instructions without regeneration, and improves production efficiency.

[0215] It should be noted that the production script may be a SQL script, or other types of scripts or instruction sets, such as a Shell script, a Python script, an API request, and a configuration file, etc., which is not limited in the present invention.

[0216] In some embodiments, the rule engine sends the generated commissioning script to the operation and maintenance server, so that the operation and maintenance server performs commissioning processing based on the commissioning script.

[0217] Exemplarily, after receiving the production script sent by the rule engine, the operation and maintenance server first verifies the script to check whether there are syntax errors or other potential problems, so as to ensure the safety and correctness of the script. Furthermore, before executing the production script, the operation and maintenance server creates a backup of the current production environment data to prevent the state before the change from happening when an unexpected situation occurs. Finally, the operation and maintenance server executes the production script to complete the corresponding instructions, such as insert, update, delete, etc.

[0218] In some embodiments, after the rule engine sends the production script to the operation and maintenance server, the rule engine cleans up the result set of the context to ensure the consistency and accuracy of the data. After the rule instructions are executed, clearing the data that is no longer needed can prevent data pollution and provide a clean environment for the next round of rule execution or data processing. And by cleaning and releasing the result set, storage space can be cleaned up to avoid excessive resources being occupied by intermediate data accumulated over a long period of time. This is especially important for long-running tasks and can ensure the effective use of system resources. In addition, it also helps to protect the security of production data and reduce the risk of leakage of production data.

[0219] The method for determining the production script provided by the embodiment of the present invention can obtain the operation and maintenance rules when receiving the script request information, and directly obtain the required production data according to the relevant instructions in the operation and maintenance rules, without extracting all the data in the production environment, without the need for additional database storage, and complete the extraction of production data at one time, thereby avoiding the waste of storage resources and improving the production efficiency. Furthermore, the production data is processed according to the relevant instructions in the operation and maintenance rules, and the production script corresponding to the production data is automatically generated, without the need for manual script writing, thus realizing the automatic generation of the production script, avoiding the risks caused by manual writing, further improving the production efficiency, and reducing the difficulty of production.

[0220] In addition, the method for determining a production script provided by an embodiment of the present invention also has the following technical effects:

[0221] First, it provides a lightweight solution that saves database resource overhead.

[0222] Second, programmable and parameterized dynamic rules are more flexible in data processing and help improve operation and maintenance efficiency.

[0223] Third, the formatted script makes the rules more readable, and the control tools provided make process management more standardized.

[0224] Fourthly, there is no need to manually write SQL scripts, and even the entire operation and maintenance process does not require human intervention. According to the rules, the operation and maintenance of production data can be completed immediately at the production point based on the current stock production data.

[0225] The present invention also provides a device for determining a production script, as described in the following embodiments. Since the principle of solving the problem by the device is similar to the method for determining a production script, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0226] Fig.11 A schematic diagram of a structure of a device for determining a production script provided in an embodiment of the present application. Fig.11 As shown, the device for determining the production script includes:

[0227] The rule acquisition module 1101 is used to obtain a pre-generated operation and maintenance rule in the operation and maintenance rule set in response to receiving the script request information sent by the operation and maintenance server, where the operation and maintenance rule consists of multiple lines of rule instructions, which are generated based on context information, main operation information, query operation information, SQL operation information, first line of data information and operators of each line, and the context information includes a production data identifier;

[0228] The data acquisition module 1102 is used to send the production data identifier to the operation and maintenance server, so that the operation and maintenance server acquires the corresponding production data based on the production data identifier;

[0229] The query comparison module 1103 is used to receive the production data sent by the operation and maintenance server, and perform query comparison processing on the production data based on the query operation information to generate a query comparison result;

[0230] The script determination module 1104 is used to generate a temporary result set based on the query comparison result, and to generate a production script based on the SQL operation information and the temporary result set.

[0231] Optionally, the steps of generating operation and maintenance rules include:

[0232] Determine a first rule instruction of an operation and maintenance rule according to the context information;

[0233] Multiple second rule instructions of the operation and maintenance rules are determined according to the main operation information, the query operation information, the SQL operation information and the operator of each row; the first rule instruction and the multiple second rule instructions constitute multiple rows of rule instructions.

[0234] Optionally, the context information includes at least one of the following: signal operation information, preprocessing operation information, and result set pointer information; and the first rule instruction for determining the operation and maintenance rule according to the context information includes:

[0235] Determine signal operation information according to the pre-generated first operation and second operation;

[0236] Determine preprocessing operation information according to pre-acquired preprocessing data, a preprocessing table, and a mapping relationship between the preprocessing data and the preprocessing table;

[0237] A first rule instruction of the operation and maintenance rule is determined according to the signal operation information, the preprocessing operation information, the result set pointer information and the first row data information.

[0238] Optionally, multiple second rule instructions of the operation and maintenance rule are determined according to the main operation information, the query operation information, the SQL operation information and the operator of each row, including:

[0239] Determining main operation information according to at least one operation generated in advance;

[0240] Performing a fusion operation on the identification information of the pre-processed data obtained in advance to obtain query operation information;

[0241] Acquire multiple operations involved in SQL operation information and determine SQL statements based on the multiple operations;

[0242] Determine SQL operation information based on SQL statements;

[0243] The main operation information, the query operation information, the SQL operation information and the operator of each row are combined to obtain a plurality of second rule instructions of the operation and maintenance rule.

[0244] Optionally, the SQL operation information includes the SQL operation;

[0245] The script determination module is specifically used for:

[0246] Perform script conversion on temporary result sets based on SQL operations to generate production scripts.

[0247] Optionally, the main operation information includes a persistence instruction;

[0248] Script generation unit, including:

[0249] The persistence unit is used to perform persistence processing on the temporary result set based on the persistence instruction to generate a formal result set;

[0250] The conversion processing unit is used to perform script conversion processing on the formal result set based on the SQL operation information to generate a production script.

[0251] Optionally, the script request information includes production version information;

[0252] The rule acquisition module includes:

[0253] A request receiving unit, used to receive script request information sent by the operation and maintenance server;

[0254] The rule determination unit is used to obtain the operation and maintenance rules corresponding to the production version information in the operation and maintenance rule set based on the production version information.

[0255] The device for determining the production script provided by the embodiment of the present invention can obtain the operation and maintenance rules when receiving the script request information, and directly obtain the required production data according to the relevant instructions in the operation and maintenance rules, without extracting all the data in the production environment, without the need for additional database storage, and complete the extraction of production data at one time, thereby avoiding the waste of storage resources and improving the production efficiency. Furthermore, the production data is processed according to the relevant instructions in the operation and maintenance rules, and the production script corresponding to the production data is automatically generated, without the need for manual script writing, thus realizing the automatic generation of the production script, avoiding the risks caused by manual writing, further improving the production efficiency, and reducing the difficulty of production.

[0256] It should be noted that the method for determining the production script provided in the embodiment of the present invention can be used in the field of big data, the field of finance, and any technical field other than the field of big data and the field of finance. The embodiment of the present invention does not limit the application field of the determination method and device based on the production script.

[0257] Fig.12 A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as Fig.12 As shown, the electronic device includes: a processor (processor) 1201, a memory (memory) 1202 and a bus 1203.

[0258] The processor 1201 and the memory 1202 communicate with each other via a bus 1203 .

[0259] The processor 1201 is used to call the program instructions in the memory 1202 to execute the methods provided by the above-mentioned method embodiments.

[0260] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for determining the production script is implemented.

[0261] An embodiment of the present invention further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the method for determining the production script is implemented.

[0262] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0263] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0264] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0265] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0266] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for determining a production script, characterized in that: include: In response to receiving script request information sent by the operation and maintenance server, obtaining a pre-generated operation and maintenance rule in an operation and maintenance rule set, wherein the operation and maintenance rule consists of multiple lines of rule instructions, and the multiple lines of rule instructions are generated according to context information, main operation information, query operation information, SQL operation information, first line of data information and operators of each line, and the context information includes a production data identifier; Sending the production data identifier to the operation and maintenance server, so that the operation and maintenance server obtains corresponding production data based on the production data identifier; receiving the production data sent by the operation and maintenance server, and performing query and comparison processing on the production data based on the query operation information to generate a query and comparison result; A temporary result set is generated based on the query comparison result, and a production script is generated based on the SQL operation information and the temporary result set.

2. The method according to claim 1, characterized in that The steps of generating the operation and maintenance rules include: Determine a first rule instruction of the operation and maintenance rule according to the context information; A plurality of second rule instructions of the operation and maintenance rule are determined according to the main operation information, the query operation information, the SQL operation information and the operator of each row; the first rule instruction and the plurality of second rule instructions constitute the plurality of rows of rule instructions.

3. The method according to claim 2, characterized in that The context information includes at least one of the following: signal operation information, preprocessing operation information, and result set pointer information; the first rule instruction for determining the operation and maintenance rule according to the context information includes: Determine the signal operation information according to the pre-generated first operation and second operation; Determine the preprocessing operation information according to pre-acquired preprocessing data, a preprocessing table, and a mapping relationship between the preprocessing data and the preprocessing table; A first rule instruction of the operation and maintenance rule is determined according to the signal operation information, the preprocessing operation information, the result set pointer information and the first row of data information.

4. The method according to claim 2, characterized in that: Determining multiple second rule instructions of the operation and maintenance rule according to the main operation information, the query operation information, the SQL operation information and the operator of each row includes: Determining the main operation information according to at least one pre-generated operation; Performing a fusion operation on the identification information of the pre-processed data obtained in advance to obtain the query operation information; Acquire multiple operations involved in the SQL operation information and determine SQL statements based on the multiple operations; Determine the SQL operation information according to the SQL statement; The main operation information, the query operation information, the SQL operation information and the operator of each row are combined to obtain a plurality of second rule instructions of the operation and maintenance rule.

5. The method according to claim 1, characterized in that The SQL operation information includes SQL operations; The generating a temporary result set based on the query comparison result, and generating a production script based on the SQL operation information and the temporary result set, includes: The temporary result set is subjected to script conversion processing based on the SQL operation to generate the production script.

6. The method according to claim 5, characterized in that The main operation information includes a persistence instruction; The step of performing script conversion processing on the temporary result set based on the SQL operation to generate the production script includes: Performing persistence processing on the temporary result set based on the persistence instruction to generate a formal result set; The formal result set is subjected to script conversion processing based on the SQL operation information to generate the production script.

7. The method according to claim 1, characterized in that The script request information includes production version information; The step of obtaining the operation and maintenance rules in the operation and maintenance rule set in response to receiving the script request information sent by the operation and maintenance server includes: Receiving script request information sent by the operation and maintenance server; Based on the production version information, the operation and maintenance rules corresponding to the production version information in the operation and maintenance rule set are obtained.

8. A device for determining a production script, characterized in that: include: A rule acquisition module, configured to acquire a pre-generated operation and maintenance rule in an operation and maintenance rule set in response to receiving script request information sent by the operation and maintenance server, wherein the operation and maintenance rule consists of a plurality of lines of rule instructions, and the plurality of lines of rule instructions are generated according to context information, main operation information, query operation information, SQL operation information, first line of data information and operators of each line, and the context information includes a production data identifier; A data acquisition module, used to send the production data identifier to the operation and maintenance server, so that the operation and maintenance server acquires corresponding production data based on the production data identifier; A query comparison module, configured to receive the production data sent by the operation and maintenance server, and perform query comparison processing on the production data based on the query operation information to generate a query comparison result; The script determination module is used to generate a temporary result set based on the query comparison result, and to generate a production script based on the SQL operation information and the temporary result set.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

11. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.