Charge modification method and device, equipment and medium
By obtaining the target fee encoding and template in the fee modification system, and automatically parsing and generating SQL statements, the problem of high difficulty in writing SQL statements in the prior art is solved, and the efficiency and accuracy of fee modification are improved.
Patent Information
- Application Number
- CN202311247066.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-25
- Publication Date
- 2025-03-25
AI Technical Summary
In the prior art, business personnel need to manually write SQL statements to change the tariff, which is a problem of high difficulty in getting started.
By obtaining the target fee code and the target template, determine its matching. If it matches, the target template and the target fee code will be parsed, the target SQL statement will be generated, and the tariff modification will be automatically performed.
It reduces the difficulty of manually writing SQL statements, improves the efficiency and accuracy of tariff modifications, and reduces the possibility of manual errors.
Smart Images

Figure CN119690507A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a method, device, equipment and medium for modifying tariffs. Background Art
[0002] At present, mobile operators use various package products to occupy the market and attract users. In order to cater to market needs and policy changes, package parameters often need to be changed. The underlying logic of the package is based on the tariff parameters, which are the core logic of the call fee calculation and are directly related to the user's expenses, traffic, voice, etc.
[0003] In the prior art, business personnel mainly change rates by manually writing SQL (Structured Query Language) statements. After receiving a request, the business personnel first analyze the request content, consult the previously accumulated business knowledge or consult old employees for advice, and formulate a specific modification strategy. After expert review, they query the rates, locate the specific tables and records that need to be modified, and manually write SQL statements to make the modifications.
[0004] However, manually writing SQL statements requires relatively advanced business knowledge and is difficult to get started with. Summary of the invention
[0005] The present application provides a rate modification method, device, equipment and medium to solve the problems in the prior art.
[0006] In a first aspect, the present application provides a tariff modification method, which is applied to a tariff modification system, including:
[0007] Obtain a target tariff code and a target template, wherein the target tariff code is the code of the tariff to be modified, the target template is a template selected by the user from the preset templates of the tariff modification system, the preset template is a template for generating a corresponding SQL statement according to the tariff code, and the target template is a template for generating an SQL statement for modifying the tariff to be modified according to the target tariff code;
[0008] Determine whether the target tariff code matches the target template;
[0009] If the target tariff code matches the target template, the target template and the target tariff code are parsed to obtain the target SQL statement;
[0010] According to the target SQL statement, the tariff to be modified is modified to obtain the modified tariff information.
[0011] In this application, determining whether the target tariff code matches the target template includes:
[0012] Determine matching characters of a target template from a tariff modification system;
[0013] The matching characters are matched with the content of the tariff to be modified to determine whether the target tariff code matches the target template.
[0014] In this application, if the target tariff code matches the target template, the target template and the target tariff code are parsed to obtain a target SQL statement, including:
[0015] If the target tariff code matches the target template, the target parsing strategy and target parameters corresponding to the target template are determined from the tariff system according to the target template. The target parsing strategy is used to generate a target SQL statement according to the target template and the target parameters. The target parameters are parameters used to modify the tariff to be modified.
[0016] According to the target parsing strategy, target parameters, and target tariff code, data information of the record to be modified in the tariff to be modified is obtained;
[0017] Generate the target SQL statement based on the target parsing strategy and the data information of the record to be modified.
[0018] In this application, the tariff to be modified is modified according to the target SQL statement to obtain the modified tariff information, including:
[0019] Determine, according to the target SQL statement, the affected tariff and the event type of the affected tariff, wherein the affected tariff is a tariff having a modification association relationship with the target SQL statement;
[0020] If the affected tariff is the tariff to be modified, the tariff to be modified is simulated and modified according to the target SQL statement to obtain the modified tariff;
[0021] In response to a modification confirmation operation of the user on the modified tariff, determining the modified tariff to be a tariff that meets the modification requirement;
[0022] In response to the user's verification operation on the event type of the modified tariff and the affected tariff, obtaining a verification result;
[0023] According to the verification result and the target SQL statement, the tariff to be modified is modified to obtain the modified tariff information.
[0024] In this application, the affected tariff and the event type of the affected tariff are determined according to the target SQL statement, including:
[0025] According to the target SQL statement, determine the operation type of the target SQL statement, the name of the changed table of the target SQL statement, and the changed primary key name and the changed primary key value of the changed table name, wherein the operation type of the target SQL statement is any one of an insert statement type, a change statement type, and a delete statement type;
[0026] According to the changed table name, determine the impact analysis statement corresponding to the changed table name from the tariff modification system. The impact analysis statement is a SQL statement preset in the tariff modification system and is used to find the affected tariff and the event type of the affected tariff;
[0027] According to the impact analysis statement, the changed primary key name, and the changed primary key value, the affected tariff and the event type of the affected tariff are obtained.
[0028] In the present application, according to the target SQL statement, determining the operation type of the target SQL statement, the changed table name of the target SQL statement, and the changed primary key name and changed primary key value of the changed table name includes:
[0029] According to the target SQL statement, determine the operation type of the target SQL statement;
[0030] When the operation type of the target SQL statement is an insert statement type, the target SQL statement is parsed to obtain the change table name, the insert field name, and the insert field value in the target SQL statement;
[0031] According to the changed table name, inserted field name and inserted field value, the changed primary key name and changed primary key value are obtained;
[0032] When the operation type of the change SQL statement is a delete statement type or a change statement type, the target SQL statement is parsed to obtain the change table name and WHERE condition of the target SQL statement;
[0033] Query according to the changed table name and WHERE condition to obtain the changed records in the changed table name;
[0034] According to the change record and the change table name, the change primary key name and the change primary key value are obtained.
[0035] In this application, in response to the user's verification operation on the event type of the modified tariff and the affected tariff, a verification result is obtained, including:
[0036] In response to the user's verification operation on the event type of the modified tariff and the affected tariff, a verification scenario is determined according to the event type of the affected tariff, and the verification scenario is used to simulate the user's package subscription and the user's actual usage;
[0037] According to the verification scenario, the modified tariff is verified to obtain the verification result.
[0038] In the present application, if the target tariff code matches the target template, the target template and the target tariff code are parsed to obtain the target SQL statement, and then the tariff to be modified is modified according to the target SQL statement, and before the modified tariff information is obtained, it also includes:
[0039] According to the target SQL statement, determine the operation type of the target SQL statement, the name of the changed table in the target SQL statement, and the name of the changed primary key of the changed table name, wherein the operation type of the target SQL statement is any one of an insert statement type, a change statement type, and a delete statement type;
[0040] A rollback statement is generated according to the target SQL statement, the operation type of the target SQL statement, and the name of the changed table. The rollback statement is used to respond to the user's rollback operation and undo the modification of the tariff to be modified.
[0041] In this application, a rollback statement is generated according to the target SQL statement, the operation type of the target SQL statement, and the name of the changed table, including:
[0042] When the operation type of the target SQL statement is an insert statement type, the target SQL statement is parsed to obtain the change table name, insert field name, and insert field value of the target SQL statement;
[0043] According to the changed primary key name, inserted field name and inserted field value, the changed primary key value is obtained;
[0044] A rollback statement is generated based on the change of table name, primary key name, and primary key value. The operation type of the rollback statement is a delete statement type.
[0045] In this application, a rollback statement is generated according to the target SQL statement, the operation type of the target SQL statement, and the name of the changed table, including:
[0046] When the operation type of the target SQL statement is a change statement type, the target SQL statement is parsed to obtain the change table name and WHERE condition of the target SQL statement;
[0047] Query according to the changed table name and WHERE condition to obtain the changed records in the changed table name;
[0048] According to the changed primary key name and the changed record, the changed primary key value is obtained;
[0049] Generate a first rollback statement according to the changed table name, changed primary key name, and changed primary key value, where the operation type of the first rollback statement is a delete statement type;
[0050] A second rollback statement is generated according to the changed table name and the changed record, and the operation type of the second rollback statement is an insert statement type.
[0051] In this application, a rollback statement is generated according to the target SQL statement, the operation type of the target SQL statement, and the name of the changed table, including:
[0052] When the operation type of the target SQL statement is a delete statement type, the target SQL statement is parsed to obtain the change table name and WHERE condition of the target SQL statement;
[0053] Query according to the changed table name and WHERE condition to obtain the changed records in the changed table name;
[0054] A rollback statement is generated based on the change record and the change table name. The operation type of the rollback statement is the insert statement type.
[0055] In a second aspect, the present application provides a tariff modification device, which is applied to a tariff modification system, including:
[0056] An acquisition module, used to acquire a target tariff code and a target template, wherein the target tariff code is a code of the tariff to be modified, the target template is a template selected by a user from templates preset in the tariff modification system, the preset template is a template for generating a corresponding SQL statement according to the tariff code, and the target template is a template for generating an SQL statement for modifying the tariff to be modified according to the target tariff code;
[0057] A determination module, used to determine whether the target tariff code matches the target template;
[0058] A parsing module, for parsing the target template and the target tariff code to obtain a target SQL statement if the target tariff code matches the target template;
[0059] The modification module is used to modify the tariff to be modified according to the target SQL statement to obtain the modified tariff information.
[0060] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0061] Memory stores computer-executable instructions;
[0062] The processor executes the computer execution instructions stored in the memory to implement the tariff modification method of the present application.
[0063] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the rate modification method of the present application.
[0064] The present application provides a method, apparatus, device and medium for modifying a tariff, which are applied to a tariff modification system. The method obtains a target tariff code and a target template to determine whether the target tariff code matches the target template. If the target tariff code matches the target template, the target template and the target tariff code are parsed to obtain a target SQL statement. According to the target SQL statement, the tariff to be modified is modified to obtain modified tariff information. In the above method, by matching the target tariff code with the target template, it is confirmed that the target template is applicable to the tariff to be modified, and by parsing the target template and the target tariff code, the target SQL statement is obtained, so that manual handwriting of the SQL statement is avoided, the difficulty of work is reduced, and the generation efficiency of the target SQL statement is improved. By determining the initial affected tariff and the event type of the initial affected tariff, it is convenient for the user to preliminarily understand and confirm the information of other tariffs that will be affected before modifying the tariff to be modified. The event type of the target affected tariff and the initial affected tariff is verified through the verification scenario to confirm the impact scope of the tariff modification, avoid omissions in manual comparison, and improve the accuracy of the tariff modification. After generating the target SQL statement, a rollback statement is generated, so that when the modification needs to be withdrawn after the modification of the tariff to be modified through the target SQL statement, it is convenient to roll back to the initial state of the tariff to be modified, thereby improving the work efficiency of the user and the fault tolerance of the tariff modification system. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0066] Figure 1 A schematic diagram of a method for modifying charges provided in this application;
[0067] Figure 2 A flowchart of a method for modifying charges provided in this application;
[0068] Figure 3 A flowchart of another method for modifying charges provided for this application;
[0069] Figure 4 A schematic diagram of the structure of a tariff modification device provided in this application;
[0070] Figure 5 A schematic diagram of the structure of the electronic device provided in this application.
[0071] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0072] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0073] At present, mobile operators use various package products to occupy the market and attract users. In order to cater to market needs and policy changes, package parameters often need to be changed. The underlying logic of the package is based on the tariff parameters, which are the core logic of the call fee calculation and are directly related to the user's expenses, traffic, voice, etc.
[0074] In the prior art, business personnel mainly change rates by manually writing SQL statements. After receiving a request, the business personnel first analyze the demand content, consult the previously accumulated business knowledge or consult old employees for advice, and formulate a specific modification strategy. After expert review, they query the rates, locate the specific tables and records that need to be modified, and manually write SQL statements to make the modifications.
[0075] However, manually writing SQL statements requires relatively advanced business knowledge and is difficult to get started with.
[0076] In order to solve the defects of the prior art, the present application provides a tariff modification method, which generates a target SQL statement for modifying the tariff to be modified through a target template preset in the tariff modification system, avoids manual writing of SQL statements, reduces work difficulty and improves work efficiency.
[0077] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0078] Figure 1 A scenario diagram of a rate modification method provided for this application, such as Figure 1As shown, the execution subject of the tariff modification method provided in the embodiment of the present application can be a tariff modification system. The tariff modification system is displayed on a display terminal, and the tariff modification system can obtain a target tariff code and a target template, determine whether the target tariff code matches the target template, and if the target tariff code matches the target template, parse the target template and the target tariff code to obtain a target SQL statement, and modify the tariff to be modified according to the target SQL statement to obtain modified tariff information.
[0079] The display terminal may be integrated in an electronic device, and the electronic device may be a terminal or the like. The terminal may be a mobile phone, a tablet computer, a smart Bluetooth device, a notebook computer, or a personal computer (PC).
[0080] Figure 2 This is a flow chart of a method for modifying a rate provided by the present application. The method may be executed by a rate modification system. This embodiment is not particularly limited here. Figure 2 As shown, the method may include:
[0081] S201, obtaining a target tariff code and a target template, wherein the target tariff code is a code of the tariff to be modified, the target template is a template selected by a user from pre-set templates of a tariff modification system, the pre-set template is a template for generating a corresponding SQL statement according to the tariff code, and the target template is a template for generating an SQL statement for modifying the tariff to be modified according to the target tariff code.
[0082] The tariff modification system may refer to a web page, software, application program, etc. used to modify the tariff.
[0083] The tariff may include tariff code, tariff name, tariff structure, etc.
[0084] The tariff code may refer to the code or number of the tariff. Each tariff corresponds to a tariff code, which is used to distinguish different tariffs.
[0085] The tariff name may refer to the naming of the tariff.
[0086] The tariff composition may refer to the tariff events included in the tariff. A tariff includes at least one tariff event. The types of tariff events may include: monthly rental events, traffic events, voice events, SMS events, broadband events, etc., among which the monthly rental event may refer to the monthly rental fee service, which may specifically refer to the corresponding fees paid by telecommunications users to the telecommunications department every month due to the occupation of the telecommunications department's call resources. Traffic events may refer to mobile data traffic services, which can be used to provide wireless Internet access functions. Customers can access the Internet, browse web pages, download information, read online, watch online videos, play online games, etc. anytime and anywhere through mobile devices. Voice events may refer to voice services, which are used to make calls through mobile terminals. SMS events may refer to text or digital information directly sent or received by users through mobile phones or other telecommunications terminals. Broadband events may refer to high-speed Internet access services provided by telecommunications companies to users. Users can access broadband networks through ADSL (Asymmetric Digital Subscriber Line) or optical fiber to achieve high-speed Internet surfing. Tariff events may include hierarchical conditions and billing items at the end of hierarchical conditions, wherein the condition settings are used to distinguish different tariff event situations. For example, the structure of tariff A is as follows:
[0087] Table 1 Structure of tariff A
[0088]
[0089] Each record in the tariff structure is a node, and each node is associated with the data information in the table of the background database of the tariff modification system. For example, in the structure of tariff A in Table 1, the node: traffic event-free traffic-free traffic for non-first month is associated with table B of the database, and the data information of the corresponding records in table B may include: primary key name, primary key value, judgment object, judgment method, etc. The node: traffic event-free traffic-free traffic for non-first month-free billing is associated with table C of the database, and the data information of the corresponding records in table C may include: primary key name, primary key value, calculation reference object, calculation method, base unit, unit rate, etc.
[0090] The tariffs can be displayed in a tree structure in the tariff modification system to facilitate hierarchical viewing by users. Selecting a node will display the associated tables and data information.
[0091] The template may include: template group, template introduction, risk reminder, parameters, background matching characters, background parsing strategy, etc.
[0092] Template groups are categories of templates used to manage templates and facilitate finding required templates.
[0093] The template introduction may refer to an introduction to the situations in which the template is applicable and inapplicable, so as to facilitate users to make preliminary judgments.
[0094] Risk reminders may refer to content that identifies existing risk points in the use of templates to alert users.
[0095] Parameters may refer to content related to the template that needs to be input by the user and are used when generating SQL statements through the template, for example, a specific modified monthly rent value for modifying the monthly rent.
[0096] The matching characters in the background can refer to the key characters corresponding to the template. For example, the template is: modify the monthly rent of non-first month, and the key characters can be non-first month or monthly rent. By matching the characters to see whether there are non-first month monthly rent conditions in the tariff to be modified, it is determined whether the selected template is applicable to the tariff to be modified. In an embodiment of the present application, the matching method can be matched through regular expressions.
[0097] The background parsing strategy is used to generate an SQL statement for modifying the tariff to be modified according to the parameters and the tariff to be modified. The parsing strategy can be a code written in a programming language, and the corresponding parsing steps are executed according to the functions of the template.
[0098] The method for obtaining the target tariff code may include: the tariff modification system responds to the user's input operation in the tariff code input area, thereby obtaining the target tariff code for modifying the target tariff. The target tariff code can be obtained by querying the tariff name that needs to be modified.
[0099] The method for obtaining a target template may include: when a user uses a tariff modification system to modify a tariff, the tariff modification system selects a corresponding target template from a pre-set template list in response to a selection operation of the user in a template selection area, wherein, in some embodiments, if the target template is not included in the pre-set template list, a template may be created in a template creation area so that the tariff modification system determines the target template.
[0100] S202, determining whether the target tariff code matches the target template.
[0101] In this embodiment of the present application, determining whether the target tariff code matches the target template includes:
[0102] Determine matching characters of a target template from a tariff modification system;
[0103] The matching characters are matched with the content of the tariff to be modified to determine whether the target tariff code matches the target template.
[0104] S203: If the target tariff code matches the target template, the target template and the target tariff code are parsed to obtain a target SQL statement.
[0105] Among them, in the embodiment of the present application, if the target tariff code matches the target template, the target template and the target tariff code are parsed to obtain a target SQL statement, including:
[0106] If the target tariff code matches the target template, the target parsing strategy and target parameters corresponding to the target template are determined from the tariff system according to the target template. The target parsing strategy is used to generate a target SQL statement according to the target template and the target parameters. The target parameters are parameters used to modify the tariff to be modified.
[0107] According to the target parsing strategy, target parameters, and target tariff code, data information of the record to be modified in the tariff to be modified is obtained;
[0108] Generate the target SQL statement based on the target parsing strategy and the data information of the record to be modified.
[0109] Among them, the parsing strategy can be a code written in a programming language, and the corresponding parsing steps are performed according to the function of the template. For example, the specific modification process can be: if it is necessary to change the non-first month free traffic in tariff A from x to y, first confirm the tariff code of tariff A, then find the template for modifying the non-first month free traffic from the template library of the tariff management system, fill in the target parameter y in the corresponding position below the template, match the template for modifying the non-first month free traffic with the content of tariff A, and match the node: non-first month free traffic in tariff A, which means that the template for modifying the non-first month free traffic is applicable to tariff A, and then call the parsing strategy corresponding to the template for modifying the non-first month free traffic in the background of the tariff modification system in response to the user's parsing operation, the parsing strategy first traverses the content of tariff A to find the node: non-first month free traffic billing, and then obtains the data information in the database table corresponding to the node: non-first month free traffic billing, and generates an update statement according to the data information and the SQL statement writing rules, and replaces the placeholder in the update statement with the target parameter y to obtain the target SQL statement.
[0110] The method for obtaining the target parsing strategy may include: establishing a parsing strategy that matches the template function according to the setting requirements of the template, and the user selects the template from the tariff modification system, and then selects the corresponding parsing strategy. The method for obtaining parameters may include: confirming the specific data value that needs to be modified for the target tariff, and filling in the corresponding data value according to the requirements of the target template.
[0111] S204, modifying the tariff to be modified according to the target SQL statement to obtain modified tariff information.
[0112] Among them, modifying the tariff to be modified can refer to executing the target SQL statement in the tariff modification system, modifying the data information corresponding to the node of the tariff to be modified, and after the modification is completed, the data information corresponding to the node of the tariff changes, and the modified data information is obtained, and the modified data information is displayed in the display unit in the tariff modification system.
[0113] Modifying the tariff information may refer to the modified data information. For example, if you choose to modify the monthly rental fee template for each month, and the value filled in the parameter item is y, then the modified tariff information will display the monthly rental fee for each month as y.
[0114] Among them, in the embodiment of the present application, according to the target SQL statement, the tariff to be modified is modified to obtain the modified tariff information, including:
[0115] Determine, according to the target SQL statement, the affected tariff and the event type of the affected tariff, wherein the affected tariff is a tariff having a modification association relationship with the target SQL statement;
[0116] If the affected tariff is the tariff to be modified, the tariff to be modified is simulated and modified according to the target SQL statement to obtain the modified tariff;
[0117] In response to a modification confirmation operation of the user on the modified tariff, determining the modified tariff to be a tariff that meets the modification requirement;
[0118] In response to the user's verification operation on the event type of the modified tariff and the affected tariff, obtaining a verification result;
[0119] According to the verification result and the target SQL statement, the tariff to be modified is modified to obtain the modified tariff information.
[0120] Among them, the affected tariff may refer to the tariff related to the target SQL statement. For example, due to the huge amount of information in the database table and the mutual correlation and reference between the information, when a certain information in the database table is modified through the target SQL statement, other data information may be affected. Therefore, it is necessary to find out all the data information items modified by the target SQL statement. The tariffs corresponding to all the data information items can be called the affected tariffs. When the affected tariff is the tariff to be modified, it means that the execution of the target SQL statement will not affect other tariffs, and the subsequent steps can be continued; when the affected tariff also includes other tariffs besides the tariff to be modified, it means that the execution of the target SQL statement affects other tariffs, and the subsequent steps need to be stopped.
[0121] The types of events that affect charges may include: monthly rental events, traffic events, voice events, SMS events, broadband events, etc.
[0122] Simulating the modification of the tariff to be modified may refer to modifying the tariff to be modified in the test library.
[0123] The modified tariff may refer to the tariff to be modified after modification.
[0124] The purpose of the verification operation on the event type of the modified tariff and the initially affected tariff is to simulate the user's package subscription and actual user usage to ensure the accuracy of the tariff modification. For example, if the monthly rent of tariff A is modified to y, it is necessary to simulate the user's package monthly rent subscription and usage to verify whether the monthly rent is y.
[0125] The verification result may refer to verification passed or verification failed. If the verification passes, it means that the target modified tariff has been correctly modified and can be actually applied.
[0126] In the embodiment of the present application, determining the affected tariff and the event type of the affected tariff according to the target SQL statement includes:
[0127] According to the target SQL statement, determine the operation type of the target SQL statement, the name of the changed table of the target SQL statement, and the changed primary key name and the changed primary key value of the changed table name, wherein the operation type of the target SQL statement is any one of an insert statement type, a change statement type, and a delete statement type;
[0128] According to the changed table name, determine the impact analysis statement corresponding to the changed table name from the tariff modification system. The impact analysis statement is a SQL statement preset in the tariff modification system and is used to find the affected tariff and the event type of the affected tariff;
[0129] According to the impact analysis statement, the changed primary key name, and the changed primary key value, the affected tariff and the event type of the affected tariff are obtained.
[0130] The changed table name may refer to the name of the table that needs to be modified and is contained in the target SQL statement.
[0131] Changing the primary key name may refer to changing the name of the primary key that needs to be modified in the table corresponding to the table name. In the embodiment of the present application, the primary key may refer to a combination of data columns or attributes in the database table that uniquely and completely identifies the stored data object.
[0132] The change primary key value may refer to a change primary key value corresponding to the change content.
[0133] The insert statement type may refer to an SQL statement for inserting content into a database table. In an embodiment of the present application, the insert statement may be an INSERT statement in an SQL statement.
[0134] The change statement type may refer to an SQL statement that modifies the content in a database table. In an embodiment of the present application, the change statement may be an UPDATE statement in an SQL statement.
[0135] The delete statement type may refer to a statement for deleting content in a database table. In an embodiment of the present application, the delete statement may be a DELETE statement in an SQL statement.
[0136] The impact analysis statement is a preset SQL statement corresponding to the changed table name. In the embodiment of the present application, the impact analysis statement may refer to a SELECT statement in the SQL statement.
[0137] A method for obtaining the affected tariffs and the event types of the affected tariffs according to the impact analysis statement, the changed primary key name, and the changed primary key value may be as follows: replacing the placeholders in the impact analysis statement with the changed primary key name and the changed primary key value; after executing the impact analysis statement, the affected tariffs and the event types of the affected tariffs may be obtained; the structure of the impact analysis statement is as follows: SELECT the affected tariffs and the event types of the affected tariffs FROM the changed table name WHERE the changed primary key name = the changed primary key value.
[0138] Among them, in the embodiment of the present application, according to the target SQL statement, determining the operation type of the target SQL statement, the changed table name of the target SQL statement, and the changed primary key name and changed primary key value of the changed table name include:
[0139] According to the target SQL statement, determine the operation type of the target SQL statement;
[0140] When the operation type of the target SQL statement is an insert statement type, the target SQL statement is parsed to obtain the change table name, the insert field name, and the insert field value in the target SQL statement;
[0141] According to the changed table name, inserted field name and inserted field value, the changed primary key name and changed primary key value are obtained;
[0142] When the operation type of the change SQL statement is a delete statement type or a change statement type, the target SQL statement is parsed to obtain the change table name and WHERE condition of the target SQL statement;
[0143] Query according to the changed table name and WHERE condition to obtain the changed records in the changed table name;
[0144] According to the change record and the change table name, the change primary key name and the change primary key value are obtained.
[0145] Among them, according to the target SQL statement, the method for determining the operation type of the target SQL statement can be: confirming the operation type of the target SQL statement according to the operation keyword of the target SQL statement, for example, the insert statement has the keyword INSERT, the change statement has the keyword UPDATE, and the delete statement has the keyword DELETE.
[0146] When the operation type of the target SQL statement is an insert statement type, the target SQL statement is parsed to obtain the change table name, the insert field name, and the insert field value in the target SQL statement. The method may be: determine the change table name, the insert field name, and the insert field value according to the sentence structure of the insert statement. For example, in the INSERT INTO table name (column name 1, column name 2, column name 3, column name 4) VALUES (value 1, value 2, value 3, value 4) statement, the table name is the change table name, (column name 1, column name 2, column name 3, column name 4) is the field name, and (value 1, value 2, value 3, value 4) is the field value.
[0147] According to the changed table name, inserted field name and inserted field value, the method to obtain the changed primary key name and the changed primary key value can be as follows: the changed primary key name can be obtained according to the changed table name, and the field name of the changed primary key name can be found according to the inserted field name, and the corresponding changed primary key value can be obtained. For example: in the statement INSERT INTO table name (column name 1, column name 2, column name 3, column name 4) VALUES (value 1, value 2, value 3, value 4), if column name 1 is the primary key name, then value 1 is the primary key value.
[0148] When the operation type of the change SQL statement is a delete statement type or a change statement type, the target SQL statement is parsed to obtain the change table name and WHERE condition of the target SQL statement. The method may be: according to the sentence structure of the delete statement or the change statement, the change table name and the WHERE condition content are obtained, for example: UPDATE table name SET column name 1 = value 1 WHERE matching field, DELETE FROM table name WHERE matching field, in these two statements, the table name is the change table name, and the WHERE matching field is the WHERE condition.
[0149] The method of querying according to the change table name and WHERE conditions to obtain the change records in the change table name is: according to the change table name and WHERE conditions, compose a SELECT statement, and execute the SELECT statement to obtain the change records, for example: SELECT change records FROM change table name WHERE conditions.
[0150] According to the change record and the change table name, the method for obtaining the change primary key name and the change primary key value may be: obtaining the change primary key name according to the change table name, and searching the change record for the corresponding change primary key value according to the change primary key name.
[0151] In the embodiment of the present application, in response to the user's verification operation on the event type of the modified tariff and the affected tariff, a verification result is obtained, including:
[0152] In response to the user's verification operation on the event type of the modified tariff and the affected tariff, a verification scenario is determined according to the event type of the affected tariff, and the verification scenario is used to simulate the user's package subscription and the user's actual usage;
[0153] According to the verification scenario, the modified tariff is verified to obtain the verification result.
[0154] Among them, the verification scenario can refer to the tariff verification to generate call bills and the tariff verification to download call bills. Among them, the tariff verification to generate call bills and the tariff verification to download call bills are generated through the tariff verification platform. The tariff verification platform is divided into two major modules, the foreground function and the backend function. The frontend and backend communications use socket technology, the foreground calling the backend script technology, the call of the stored procedure and the fast cube memory database interface. The backend uses C++ and uses shell scripts to realize the automatic generation of call bills.
[0155] In response to the user's verification operation on the event type of modified charges and affected charges, the method for determining the verification scenario according to the event type of affected charges can be: when the front-end device receives the user's charge verification operation, the front-end WEB program calls the back-end program, for example, calling the call bill generation program in the back-end program through a Shell script, and the front-end WEB program generates a charge verification call bill and a charge verification download call bill after calling the call bill generation program in the back-end program.
[0156] According to the verification scenario, the modified charges are verified, and the method for obtaining the verification result may be: when the front-end device receives the user's charge verification operation, the background program automatically simulates the actual user's subscription charge to generate user information according to the charge verification rules, wherein the verification rules may be pre-stored in the background program, and the user information may include the user's identity information, communication service information, package service information, charge information, etc.
[0157] Among them, in the embodiment of the present application, if the target tariff code matches the target template, the target template and the target tariff code are parsed to obtain the target SQL statement, and the tariff to be modified is modified according to the target SQL statement, and before obtaining the modified tariff information, it also includes:
[0158] According to the target SQL statement, determine the operation type of the target SQL statement, the name of the changed table in the target SQL statement, and the name of the changed primary key of the changed table name, wherein the operation type of the target SQL statement is any one of an insert statement type, a change statement type, and a delete statement type;
[0159] A rollback statement is generated according to the target SQL statement, the operation type of the target SQL statement, and the name of the changed table. The rollback statement is used to respond to the user's rollback operation and undo the modification of the tariff to be modified.
[0160] Among them, according to the target SQL statement, the method for determining the operation type of the target SQL statement, the change table name in the target SQL statement, and the change primary key name of the changed table name can be: determining the operation type of the target SQL statement according to the keywords of the structure of the target SQL statement, determining the change table name according to the table name in the structure of the target SQL statement, and determining the primary key name in the table as the change primary key name according to the table name in the structure of the target SQL statement.
[0161] Among them, in the embodiment of the present application, according to the change SQL statement, the change SQL statement operation type, the change table name, and the change primary key name, the rollback statement is generated, including:
[0162] When the operation type of the target SQL statement is an insert statement type, the target SQL statement is parsed to obtain the change table name, insert field name, and insert field value of the target SQL statement;
[0163] According to the changed primary key name, inserted field name and inserted field value, the changed primary key value is obtained;
[0164] A rollback statement is generated based on the change of table name, primary key name, and primary key value. The operation type of the rollback statement is a delete statement type.
[0165] Among them, when the operation type of the target SQL statement is an insert statement type, the target SQL statement is parsed to obtain the change table name, insert field name and insert field value of the target SQL statement. The method may be: determine the change table name, insert field name and insert field value according to the sentence structure of the insert statement, for example: in the INSERT INTO table name (column name 1, column name 2, column name 3, column name 4) VALUES (value 1, value 2, value 3, value 4) statement, the table name is the change table name, (column name 1, column name 2, column name 3, column name 4) is the field name, and (value 1, value 2, value 3, value 4) is the field value.
[0166] According to the changed primary key name, inserted field name and inserted field value, the method to obtain the changed primary key value can be: according to the inserted field name, find the field name that is the changed primary key name, and obtain the corresponding changed primary key value. For example: in the statement INSERT INTO table name (column name 1, column name 2, column name 3, column name 4) VALUES (value 1, value 2, value 3, value 4), if column name 1 is the primary key name, then value 1 is the primary key value.
[0167] According to the changed table name, changed primary key name, and changed primary key value, a method for generating a rollback statement may be as follows: according to the sentence structure of the delete statement, the changed table name, changed primary key name, and changed primary key value are placed in corresponding positions, for example: DELETE FROM changed table name WHERE changed primary key name = changed primary key value.
[0168] When the operation type of the target SQL statement is a change statement type, the target SQL statement is parsed to obtain the change table name and WHERE condition of the target SQL statement;
[0169] Query according to the changed table name and WHERE condition to obtain the changed records in the changed table name;
[0170] According to the changed primary key name and the changed record, the changed primary key value is obtained;
[0171] Generate a first rollback statement according to the changed table name, changed primary key name, and changed primary key value, where the operation type of the first rollback statement is a delete statement type;
[0172] A second rollback statement is generated according to the changed table name and the changed record, and the operation type of the second rollback statement is an insert statement type.
[0173] Among them, when the operation type of the target SQL statement is the change statement type, the target SQL statement is parsed, and the method for obtaining the change table name and WHERE condition of the target SQL statement can be: according to the sentence structure of the change statement, the change table name and WHERE condition content are obtained, for example: UPDATE table name SET column name 1 = value 1 WHERE matching field, the table name is the change table name, and the WHERE matching field is the WHERE condition.
[0174] A method for querying according to the change table name and the WHERE condition to obtain the change record in the change table name may be: forming a SELECT statement according to the change table name and the WHERE condition, and executing the SELECT statement to obtain the change record, for example: SELECT change record FROM change table name WHERE condition.
[0175] According to the changed primary key name and the changed record, a method for obtaining the changed primary key value may be: searching for a corresponding changed primary key value in the changed record according to the changed primary key name.
[0176] According to the changed table name, changed primary key name, and changed primary key value, the method for generating the first rollback statement can be: according to the changed table name, changed primary key name, and changed primary key value, according to the sentence structure of the delete statement, a delete statement is assembled, for example: DELETE FROM changed table name WHERE changed primary key name = changed primary key value.
[0177] According to the change table name and the change record, the method for generating the second rollback statement can be: according to the change table name, the change primary key name, the change primary key value, and the change record, according to the sentence structure of the insert statement, an insert statement is spelled out, for example: INSERT INTO change table name (change record column name) VALUES (change record value).
[0178] When the operation type of the target SQL statement is a delete statement type, the target SQL statement is parsed to obtain the change table name and WHERE condition of the target SQL statement;
[0179] Query according to the changed table name and WHERE condition to obtain the changed records in the changed table name;
[0180] A rollback statement is generated based on the change record and the change table name. The operation type of the rollback statement is the insert statement type.
[0181] Among them, when the operation type of the target SQL statement is a delete statement type, the target SQL statement is parsed to obtain the change table name and WHERE condition of the target SQL statement. The method can be: according to the sentence structure of the delete statement, the change table name and the WHERE condition content are obtained, for example: DELETE FROM table name WHERE matching field, the table name is the change table name, and the WHERE matching field is the WHERE condition.
[0182] A method for querying according to the change table name and the WHERE condition to obtain the change record in the change table name may be: forming a SELECT statement according to the change table name and the WHERE condition, and executing the SELECT statement to obtain the change record, for example: SELECT change record FROM change table name WHERE condition.
[0183] According to the change record and the change table name, the method for generating the rollback statement may be: according to the change record and the change table name, according to the sentence structure of the insert statement, an insert statement is formed, for example: INSERT INTO change table name (change record column name) VALUES (change record value).
[0184] The present application provides a tariff modification method, which is applied to a tariff modification system. By matching a target tariff code with a target template, it is confirmed that the target template is applicable to the tariff to be modified. By parsing the target template and the target tariff code, a target SQL statement is obtained, so that manual handwriting of SQL statements is avoided, the difficulty of work is reduced, and the efficiency of generating the target SQL statement is improved. By determining the initial affected tariff and the event type of the initial affected tariff, it is convenient for a user to preliminarily understand and confirm the information of other tariffs that will be affected before modifying the tariff to be modified. By verifying the target affected tariff and the event type of the initial affected tariff through a verification scenario, the impact scope of the tariff modification is confirmed, omissions in manual comparison are avoided, and the accuracy of the tariff modification is improved. After the target SQL statement is generated, a rollback statement is generated, so that when the modification of the tariff to be modified needs to be withdrawn after the modification is performed through the target SQL statement, it is convenient to roll back to the initial state of the tariff to be modified, thereby improving the work efficiency of the user and the fault tolerance of the tariff modification system.
[0185] Figure 3 This is a flow chart of another method for modifying tariffs provided by the present application. The method may be performed by a tariff modification system. This embodiment is not particularly limited here. Figure 3 As shown, the method may include:
[0186] S301, obtaining a target tariff code and a target template.
[0187] Among them, the target tariff code can be the tariff code of the tariff to be modified input by the user, the target template is a template selected by the user from the pre-set templates of the tariff modification system, the pre-set template is a template used to generate a corresponding SQL statement according to the tariff code, and the target template is a template used to generate an SQL statement to modify the tariff to be modified according to the target tariff code.
[0188] S302, through the tariff matching function of the tariff modification system, verify whether the target tariff code is applicable to the target template selected by the user. If the match is successful, it prompts the user that the save is successful, otherwise it prompts the user that the match fails.
[0189] Among them, the specific process of tariff matching is: when the user clicks on tariff matching or clicks on OK to add a template, the scene matcher corresponding to the target template will be called for matching verification. Each target template corresponds to a custom scene matcher in the background. The tariff code is input into the scene matcher, and the scene matcher outputs whether the tariff meets the target template.
[0190] S303, through the scenario analysis function of the tariff modification system, according to the specific tariff situation, the tariff tree is analyzed to generate a target SQL statement.
[0191] The scene parsing function may refer to a scene parser, which corresponds one-to-one to a target template.
[0192] S304: Generate a rollback statement according to the target SQL statement.
[0193] Among them, in the embodiment of the present application, according to the target SQL statement, a rollback statement is generated, including:
[0194] According to the target SQL statement, use the parser to parse the table name and SQL operation type (INSERT / UPDATE / DELETE) changed in SQL, obtain the primary key name of the table according to the table structure maintained in the database, and then parse it according to the situation:
[0195] INSERT statement: Parse and obtain the field name and field value in the INSERT statement, obtain the primary key value based on the primary key name of the table, and combine it with the table name to form a DELETE statement.
[0196] UPDATE statement: query the data table according to the WHERE condition of the UPDATE statement, obtain the changed record content, and generate DELETE statement and INSERT statement according to the table name and primary key name.
[0197] After the rollback statement is generated, the SQL statement, rollback statement, operation type, table name, primary key name, and primary key value are recorded in the database for use in subsequent processes.
[0198] S305, using the impact analysis function in the tariff modification system, obtain different impact analysis statements according to the name of the changed table, input the primary key value content, query upward along the tariff tree to obtain the affected tariff and the affected tariff event type;
[0199] S306, modifying the tariff to be modified in the test library according to the target SQL statement;
[0200] S307, displaying the detailed modification content of the tariff in a tree format, and marking different operation types on the nodes with different colors.
[0201] Through color differentiation, users can have a more comprehensive understanding of the overall modification. Each node on the tree is equivalent to a record in the table. By comparing the primary key and table name of each node with the target SQL statement, it can be compared to prove that there is a modification or new record. The nodes on the tree are marked according to the type of SQL statement record that matches, with modifications marked in yellow and additions marked in green.
[0202] When the user clicks on the modified node, the record details will be displayed on the right, and the modified fields will be marked in yellow. When the mouse moves to the yellow field, the value before the modification will be displayed.
[0203] S308, obtaining a scenario that the user should verify according to the affected tariff and the event type of the affected tariff;
[0204] S309, after the verification is completed, the target SQL statement is executed in the production library, and the modification of the tariff to be modified is published to the production library.
[0205] A tariff modification method provided by the present application is applied to the tariff modification system, and the target tariff code is matched with the target template through the scene matcher to confirm that the target template is applicable to the tariff to be modified. The target template and the target tariff code are parsed by the scene parser to obtain the target SQL statement, avoiding manual handwriting of SQL statements, reducing the difficulty of work, and improving the efficiency of generating the target SQL statement. The initial affected tariff and the event type of the initial affected tariff are determined by impact analysis, so that the user can preliminarily understand the information of other tariffs that will be affected and confirm it before modifying the tariff to be modified. By displaying the detailed modification content of the tariff in the form of a tree and marking different operation types on the nodes with different colors, the user can have a more comprehensive understanding of the overall modification. By verifying the event type of the target affected tariff and the initial affected tariff through the verification scene, the scope of influence of the tariff modification is confirmed, omissions in manual comparison are avoided, and the accuracy of the tariff modification is improved. After generating the target SQL statement, a rollback statement is generated, so that when the target SQL statement needs to withdraw the modification after modifying the tariff to be modified, it is convenient to roll back to the initial state of the tariff to be modified, thereby improving the user's work efficiency and the fault tolerance of the tariff modification system.
[0206] Figure 4 A schematic diagram of the structure of a tariff modification device provided in this application, such as Figure 4 As shown, the device 40 includes: an acquisition module 401, a determination module 402, a parsing module 403, and a modification module 404, wherein:
[0207] The acquisition module 401 is used to acquire a target tariff code and a target template, wherein the target tariff code is a code of the tariff to be modified, the target template is a template selected by a user from templates preset in the tariff modification system, the preset template is a template for generating a corresponding SQL statement according to the tariff code, and the target template is a template for generating an SQL statement for modifying the tariff to be modified according to the target tariff code;
[0208] The determination module 402 is used to determine whether the target tariff code matches the target template.
[0209] The parsing module 403 is used to parse the target template and the target tariff code to obtain a target SQL statement if the target tariff code matches the target template;
[0210] The modification module 404 is used to modify the tariff to be modified according to the target SQL statement to obtain modified tariff information.
[0211] In the embodiment of the present application, the determination module 402 may also be used to: determine matching characters of the target template from the tariff modification system;
[0212] The matching characters are matched with the content of the tariff to be modified to determine whether the target tariff code matches the target template.
[0213] In the embodiment of the present application, the parsing module 403 may also be used to: if the target tariff code matches the target template, determine the target parsing strategy and target parameters corresponding to the target template from the tariff system according to the target template, the target parsing strategy is used to generate a target SQL statement according to the target template and the target parameters, and the target parameters are parameters used to modify the tariff to be modified;
[0214] According to the target parsing strategy, target parameters, and target tariff code, data information of the record to be modified in the tariff to be modified is obtained;
[0215] Generate the target SQL statement based on the target parsing strategy and the data information of the record to be modified.
[0216] In the embodiment of the present application, the modification module 404 may also be used to: determine the affected tariff and the event type of the affected tariff according to the target SQL statement, where the affected tariff is the tariff having a modification association relationship with the target SQL statement;
[0217] If the affected tariff is the tariff to be modified, the tariff to be modified is simulated and modified according to the target SQL statement to obtain the modified tariff;
[0218] In response to a modification confirmation operation of the user on the modified tariff, determining the modified tariff to be a tariff that meets the modification requirement;
[0219] In response to the user's verification operation on the event type of the modified tariff and the affected tariff, obtaining a verification result;
[0220] According to the verification result and the target SQL statement, the tariff to be modified is modified to obtain the modified tariff information.
[0221] In the embodiment of the present application, the modification module 404 may also be used to: determine, according to the target SQL statement, the operation type of the target SQL statement, the changed table name of the target SQL statement, and the changed primary key name and changed primary key value of the changed table name, wherein the operation type of the target SQL statement is any one of an insert statement type, a change statement type, and a delete statement type;
[0222] According to the changed table name, determine the impact analysis statement corresponding to the changed table name from the tariff modification system. The impact analysis statement is a SQL statement preset in the tariff modification system and is used to find the affected tariff and the event type of the affected tariff;
[0223] According to the impact analysis statement, the changed primary key name, and the changed primary key value, the affected tariff and the event type of the affected tariff are obtained.
[0224] In the embodiment of the present application, the modification module 404 may also be used to: determine the operation type of the target SQL statement according to the target SQL statement;
[0225] When the operation type of the target SQL statement is an insert statement type, the target SQL statement is parsed to obtain the change table name, the insert field name, and the insert field value in the target SQL statement;
[0226] According to the changed table name, inserted field name and inserted field value, the changed primary key name and changed primary key value are obtained;
[0227] When the operation type of the change SQL statement is a delete statement type or a change statement type, the target SQL statement is parsed to obtain the change table name and WHERE condition of the target SQL statement;
[0228] Query according to the changed table name and WHERE condition to obtain the changed records in the changed table name;
[0229] According to the change record and the change table name, the change primary key name and the change primary key value are obtained.
[0230] In the embodiment of the present application, the modification module 404 may also be used to: in response to the user's verification operation on the event type of the modified tariff and the affected tariff, determine a verification scenario according to the event type of the affected tariff, and the verification scenario is used to simulate the user's package subscription and the user's actual usage;
[0231] According to the verification scenario, the modified tariff is verified to obtain the verification result.
[0232] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device 50 includes:
[0233] The electronic device 50 may include a processor 501 with one or more processing cores, a memory 502 with one or more computer-readable storage media, a communication component 503 and other components. The processor 501 , the memory 502 and the communication component 503 are connected via a bus 504 .
[0234] In a specific implementation process, at least one processor 501 executes the computer-executable instructions stored in the memory 502, so that at least one processor 501 executes the above-mentioned tariff modification method.
[0235] The specific implementation process of the processor 501 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0236] In the above Figure 5 In the illustrated embodiment, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0237] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.
[0238] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0239] In some embodiments, a computer program product is also proposed, including a computer program or instructions, which implement the steps in any of the above-mentioned tariff modification methods when executed by a processor.
[0240] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0241] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0242] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple instructions are stored. The instructions can be loaded by a processor to execute the steps in any one of the tariff modification methods provided in the embodiments of the present application.
[0243] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0244] According to one aspect of the present application, a computer program product or a computer program is provided. The computer program product or the computer program comprises computer instructions stored in a computer-readable storage medium.
[0245] Since the instructions stored in the storage medium can execute the steps in any one of the tariff modification methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the tariff modification methods provided in the embodiments of the present application can be achieved. For details, please refer to the previous embodiments and will not be repeated here.
[0246] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0247] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for modifying tariffs, characterized in that: Applied to a tariff modification system, the method comprises: Obtaining a target tariff code and a target template, wherein the target tariff code is a code of the tariff to be modified, the target template is a template selected by a user from templates pre-set in the tariff modification system, the pre-set template is a template for generating a corresponding SQL statement according to the tariff code, and the target template is a template for generating an SQL statement for modifying the tariff to be modified according to the target tariff code; Determining whether the target tariff code matches the target template; If the target tariff code matches the target template, the target template and the target tariff code are parsed to obtain a target SQL statement; The tariff to be modified is modified according to the target SQL statement to obtain modified tariff information.
2. The method according to claim 1, characterized in that The determining whether the target tariff code matches the target template includes: Determining matching characters of the target template from the rate modification system; The matching characters are matched with the content of the tariff to be modified to determine whether the target tariff code matches the target template.
3. The method according to claim 1, characterized in that If the target tariff code matches the target template, the target template and the target tariff code are parsed to obtain a target SQL statement, including: If the target tariff code matches the target template, a target parsing strategy and a target parameter corresponding to the target template are determined from the tariff system according to the target template, wherein the target parsing strategy is used to generate a target SQL statement according to the target template and the target parameter, and the target parameter is a parameter used to modify the tariff to be modified; According to the target parsing strategy, the target parameters, and the target tariff code, data information of the record to be modified in the tariff to be modified is obtained; A target SQL statement is generated according to the target parsing strategy and the data information of the record to be modified.
4. The method according to claim 1, characterized in that: The method of modifying the tariff to be modified according to the target SQL statement to obtain modified tariff information includes: Determine, according to the target SQL statement, an affected fee and an event type of the affected fee, wherein the affected fee is a fee having a modification association relationship with the target SQL statement; If the affected tariff is the tariff to be modified, then according to the target SQL statement, simulate the modification of the tariff to be modified to obtain the modified tariff; In response to a modification confirmation operation of the user on the modified tariff, determining that the modified tariff is a tariff that meets the modification requirement; In response to a user's verification operation on the event type of the modified tariff and the affected tariff, obtaining a verification result; The tariff to be modified is modified according to the verification result and the target SQL statement to obtain modified tariff information.
5. The method according to claim 4, characterized in that The determining, according to the target SQL statement, the affected tariff and the event type of the affected tariff includes: According to a target SQL statement, determining an operation type of the target SQL statement, a changed table name of the target SQL statement, and a changed primary key name and a changed primary key value of the changed table name, wherein the operation type of the target SQL statement is any one of an insert statement type, a change statement type, and a delete statement type; According to the change table name, determining an impact analysis statement corresponding to the change table name from the tariff modification system, wherein the impact analysis statement is a SQL statement preset in the tariff modification system and is used to find the affected tariff and the event type of the affected tariff; The affected tariff and the event type of the affected tariff are obtained according to the impact analysis statement, the change primary key name, and the change primary key value.
6. The method according to claim 5, characterized in that The step of determining, according to the target SQL statement, the operation type of the target SQL statement, the changed table name of the target SQL statement, and the changed primary key name and the changed primary key value of the changed table name includes: Determine the operation type of the target SQL statement according to the target SQL statement; When the operation type of the target SQL statement is an insert statement type, the target SQL statement is parsed to obtain a change table name, an insert field name, and an insert field value in the target SQL statement; Obtaining the changed primary key name and the changed primary key value according to the changed table name, the inserted field name and the inserted field value; When the operation type of the change SQL statement is a delete statement type or a change statement type, the target SQL statement is parsed to obtain a change table name and a WHERE condition of the target SQL statement; Query according to the changed table name and the WHERE condition to obtain the changed records in the changed table name; According to the change record and the change table name, a change primary key name and a change primary key value are obtained.
7. The method according to claim 4, characterized in that The obtaining of the verification result in response to the user's verification operation on the event type of the modified tariff and the affected tariff includes: In response to a user's verification operation on the modified tariff and the event type of the affected tariff, determining a verification scenario according to the event type of the affected tariff, the verification scenario being used to simulate a user package subscription and actual user usage; According to the verification scenario, the modified tariff is verified to obtain a verification result.
8. The method according to claim 1, characterized in that If the target tariff code matches the target template, the target template and the target tariff code are parsed to obtain a target SQL statement, and before the tariff to be modified is modified according to the target SQL statement and the modified tariff information is obtained, the method further includes: According to the target SQL statement, determining an operation type of the target SQL statement, a change table name in the target SQL statement, and a change primary key name of the change table name, wherein the operation type of the target SQL statement is any one of an insert statement type, a change statement type, and a delete statement type; A rollback statement is generated according to the target SQL statement, the operation type of the target SQL statement, and the changed table name, wherein the rollback statement is used to respond to the rollback operation of the user and undo the modification of the tariff to be modified.
9. The method according to claim 8, characterized in that The step of generating a rollback statement according to the target SQL statement, the operation type of the target SQL statement, and the changed table name includes: When the operation type of the target SQL statement is an insert statement type, the target SQL statement is parsed to obtain a change table name, an insert field name, and an insert field value of the target SQL statement; Obtaining a changed primary key value according to the changed primary key name, the inserted field name and the inserted field value; A rollback statement is generated according to the changed table name, the changed primary key name, and the changed primary key value, and the operation type of the rollback statement is a delete statement type.
10. The method according to claim 8, characterized in that The step of generating a rollback statement according to the target SQL statement, the operation type of the target SQL statement, and the changed table name includes: When the operation type of the target SQL statement is a change statement type, the target SQL statement is parsed to obtain a change table name and a WHERE condition of the target SQL statement; Query according to the changed table name and the WHERE condition to obtain the changed records in the changed table name; Obtaining a changed primary key value according to the changed primary key name and the changed record; Generate a first rollback statement according to the changed table name, the changed primary key name, and the changed primary key value, where the operation type of the first rollback statement is a delete statement type; A second rollback statement is generated according to the change table name and the change record, and the operation type of the second rollback statement is an insert statement type.
11. The method according to claim 8, characterized in that The step of generating a rollback statement according to the target SQL statement, the operation type of the target SQL statement, and the changed table name includes: When the operation type of the target SQL statement is a delete statement type, the target SQL statement is parsed to obtain a changed table name and a WHERE condition of the target SQL statement; Query according to the changed table name and the WHERE condition to obtain the changed records in the changed table name; A rollback statement is generated according to the change record and the change table name, and the operation type of the rollback statement is an insert statement type.
12. A tariff modification device, characterized in that: Applied to a tariff modification system, the device comprises: an acquisition module, configured to acquire a target tariff code and a target template, wherein the target tariff code is a code of the tariff to be modified, the target template is a template selected by a user from templates preset by the tariff modification system, the preset template is a template for generating a corresponding SQL statement according to the tariff code, and the target template is a template for generating an SQL statement for modifying the tariff to be modified according to the target tariff code; A determination module, used to determine whether the target tariff code matches the target template; A parsing module, configured to parse the target template and the target tariff code to obtain a target SQL statement if the target tariff code matches the target template; The modification module is used to modify the tariff to be modified according to the target SQL statement to obtain modified tariff information.
13. An electronic device, comprising: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 11.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.