A method, device and storage medium for generating a derivative index
By analyzing the indicator demand information and combining the preset indicator types and database fields, the derived indicators are generated, which solves the problem of the cumbersome indicator generation process in the existing technology and achieves fast and convenient indicator generation.
Patent Information
- Application Number
- CN202210553344.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-19
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2042-05-19
AI Technical Summary
In the existing technology, the acquisition of derived indicators requires customized development by technical personnel, and it is impossible to flexibly and quickly generate derived indicators according to the user's immediate needs.
By parsing the indicator demand information sent by the client terminal, we find the mapping relationship between the preset indicator type and the derived indicator generation method. Combined with the target data table fields in the database, we determine the conversion fields and indicator values, and generate derivatives based on the combined syntax and indicator generation method. index.
It realizes the flexible and rapid generation of derived indicators according to the immediate needs of users, locks the fields in the target data table, and improves the convenience and efficiency of indicator generation.
Smart Images

Figure CN114879937B_ABST
Abstract
Description
Background Art
[0002] In the field of data analysis, end users of data analysis applications can use data analysis tools to obtain various data reports. However, the data stored in the data reports are usually indicator parameters commonly used and referenced in the industry. In some specific data analysis scenarios, a single indicator parameter is generally not enough for meaningful analysis, and it is necessary to increase or decrease the indicator dimension, that is, it is necessary to use the indicator parameters in the existing data report to further calculate the derived indicators, so as to dig out deeper business value based on the derived indicators.
[0003] The existing method of obtaining derived indicators requires customized development by technical personnel, that is, technical personnel convert the preset demand analysis into several commonly used fixed contents and formats during the development stage, pre-develop modules using the indicator parameters in the existing data reports, and use the modules to calculate the derived indicators corresponding to the demand analysis with fixed contents and formats, and finally present the calculated derived indicators to the end users. Summary of the invention
[0004] The embodiments of the present disclosure provide a method, device and storage medium for generating a derived indicator, which are used to flexibly and quickly generate a derived indicator.
[0005] The specific technical solutions provided by this disclosure are as follows:
[0006] In a first aspect, an embodiment of the present disclosure provides a method for generating a derivative indicator, comprising:
[0007] Parsing the indicator requirement information sent by the client terminal to obtain an indicator type, a combination syntax and at least one indicator keyword, wherein the indicator type carries original date information;
[0008] In the mapping relationship between the preset indicator type and the derived indicator generation method, searching for the derived indicator generation method corresponding to the indicator type;
[0009] In the correspondence between the preset indicator keyword set and the conversion field set, searching for at least one conversion field corresponding to the indicator keyword, wherein the conversion field set includes each field in the target data table in the database;
[0010] Based on the combination syntax and the found conversion field, determine the indicator value corresponding to the conversion field;
[0011] Determine the derived indicators based on the indicator values and the derived indicator generation method.
[0012] In some possible embodiments, the indicator requirement information sent by the client terminal is parsed to obtain the indicator type, the combination syntax and at least one indicator keyword, including:
[0013] Searching for at least one target grammar keyword that matches the grammar keywords included in the preset grammar keyword set in the indicator requirement information sent by the client terminal, and sorting the at least one target grammar keyword based on the sequence of the at least one target grammar keyword in the indicator requirement information to obtain a combined grammar;
[0014] Using at least one target grammatical keyword as a truncation point to truncate the indicator requirement information, and obtaining each sub-requirement information based on the truncation indicator requirement information;
[0015] Extracting sub-demand information that matches the indicator type identifier included in the preset indicator type identifier set from each sub-demand information, and using the indicator type identifier corresponding to the extracted sub-demand information as the indicator type, and using the date information corresponding to the extracted sub-demand information as the original date information;
[0016] Sub-demand information matching the indicator keyword included in the preset indicator keyword set is extracted from each sub-demand information, and the indicator keyword corresponding to the extracted sub-demand information is used as at least one indicator keyword.
[0017] In some possible embodiments, the correspondence between the preset indicator keyword set and the conversion field set is established in the following manner:
[0018] Extract each field in the target data table in the database, determine the field data type corresponding to each field, and determine the conversion field set based on each field;
[0019] Determine a keyword data type corresponding to any preset indicator keyword in the preset indicator keyword set;
[0020] If the field data type and the keyword data type belong to the same data type, a correspondence is established between the indicator keyword corresponding to the keyword data type and the field corresponding to the field data type.
[0021] In some possible embodiments, determining the indicator value corresponding to the conversion field based on the combined grammar and the found conversion field includes:
[0022] Determine a positional relationship between the found conversion field and at least one target grammar keyword in the combined grammar;
[0023] Based on the position relationship, the found conversion field is combined with at least one target grammar keyword in the combined grammar to obtain a combined keyword;
[0024] Find the indicator value corresponding to the conversion field that matches the combined keyword in the target data table.
[0025] In some possible embodiments, the derivative indicator generation method is determined by:
[0026] Based on the preset indicator type, determine the indicator calculation formula and the first date information;
[0027] Determine the second date information based on the first date information and the indicator calculation formula;
[0028] Determine a method for generating a derivative indicator based on the indicator value corresponding to the first date information, the indicator value corresponding to the second date information, and an indicator calculation formula;
[0029] The first date information represents the time information that matches the indicator requirement information, and the second date information represents the time information that matches the indicator type.
[0030] In some possible embodiments, determining the derived indicator based on the indicator value and the derived indicator generation method includes:
[0031] The indicator value is used as the indicator value corresponding to the first date information;
[0032] Determine the target date information based on the original date information and the derived indicator generation method;
[0033] Search the target data table for the index value corresponding to the conversion field that matches the target date information and the combined keyword, and use the index value corresponding to the target date information as the index value corresponding to the second date information;
[0034] A derived indicator is determined based on the indicator value corresponding to the first date information, the indicator value corresponding to the second date information, and a derived indicator generation method.
[0035] In some possible embodiments, the method further includes:
[0036] If a new field is detected in the target data table, the new field data type of the new field is obtained;
[0037] If there is a keyword data type that is the same data type as the newly added field data type in the preset indicator keyword set, a corresponding relationship is established between the indicator keyword corresponding to the keyword data type and the newly added field corresponding to the newly added field data type;
[0038] If the keyword data type that is the same data type as the newly added field data type does not exist in the preset indicator keyword set, an indicator keyword corresponding to the keyword data type that is the same data type as the newly added field data type is added to the preset indicator keyword set.
[0039] In a second aspect, the embodiment of the present disclosure further provides a device for generating a derived indicator, including:
[0040] A parsing module, used to parse the indicator requirement information sent by the client terminal to obtain an indicator type, a combination syntax and at least one indicator keyword, wherein the indicator type carries original date information;
[0041] A method search module, used to search for a derived indicator generation method corresponding to an indicator type in a preset mapping relationship between an indicator type and a derived indicator generation method;
[0042] A field search module, used to search for at least one conversion field corresponding to an indicator keyword in a correspondence relationship between a preset indicator keyword set and a conversion field set, wherein the conversion field set includes each field in a target data table in a database;
[0043] A value determination module, used to determine the indicator value corresponding to the conversion field based on the combination grammar and the found conversion field;
[0044] The indicator determination module is used to determine the derived indicator based on the indicator value and the derived indicator generation method.
[0045] In some possible embodiments, the indicator requirement information sent by the client terminal is parsed to obtain the indicator type, the combination syntax and at least one indicator keyword, and the parsing module is used to:
[0046] Searching for at least one target grammar keyword that matches the grammar keywords included in the preset grammar keyword set in the indicator requirement information sent by the client terminal, and sorting the at least one target grammar keyword based on the sequence of the at least one target grammar keyword in the indicator requirement information to obtain a combined grammar;
[0047] Using at least one target grammatical keyword as a truncation point to truncate the indicator requirement information, and obtaining each sub-requirement information based on the truncation indicator requirement information;
[0048] Extracting sub-demand information that matches the indicator type identifier included in the preset indicator type identifier set from each sub-demand information, and using the indicator type identifier corresponding to the extracted sub-demand information as the indicator type, and using the date information corresponding to the extracted sub-demand information as the original date information;
[0049] Sub-demand information matching the indicator keyword included in the preset indicator keyword set is extracted from each sub-demand information, and the indicator keyword corresponding to the extracted sub-demand information is used as at least one indicator keyword.
[0050] In some possible embodiments, the correspondence between the preset indicator keyword set and the conversion field set is established in the following manner:
[0051] Extract each field in the target data table in the database, determine the field data type corresponding to each field, and determine the conversion field set based on each field;
[0052] Determine a keyword data type corresponding to any preset indicator keyword in the preset indicator keyword set;
[0053] If the field data type and the keyword data type belong to the same data type, a correspondence is established between the indicator keyword corresponding to the keyword data type and the field corresponding to the field data type.
[0054] In some possible embodiments, based on the combined grammar and the found conversion field, the indicator value corresponding to the conversion field is determined, and the field search module is used to:
[0055] Determine a positional relationship between the found conversion field and at least one target grammar keyword in the combined grammar;
[0056] Based on the position relationship, the found conversion field is combined with at least one target grammar keyword in the combined grammar to obtain a combined keyword;
[0057] Find the indicator value corresponding to the conversion field that matches the combined keyword in the target data table.
[0058] In some possible embodiments, the derivative indicator generation method is determined by:
[0059] Based on the preset indicator type, determine the indicator calculation formula and the first date information;
[0060] Determine the second date information based on the first date information and the indicator calculation formula;
[0061] Determine a method for generating a derivative indicator based on the indicator value corresponding to the first date information, the indicator value corresponding to the second date information, and an indicator calculation formula;
[0062] The first date information represents the time information that matches the indicator requirement information, and the second date information represents the time information that matches the indicator type.
[0063] In some possible embodiments, based on the indicator value and the derived indicator generation method, the derived indicator is determined, and the indicator determination module is used to:
[0064] The indicator value is used as the indicator value corresponding to the first date information;
[0065] Determine the target date information based on the original date information and the derived indicator generation method;
[0066] Search the target data table for the index value corresponding to the conversion field that matches the target date information and the combined keyword, and use the index value corresponding to the target date information as the index value corresponding to the second date information;
[0067] A derived indicator is determined based on the indicator value corresponding to the first date information, the indicator value corresponding to the second date information, and a derived indicator generation method.
[0068] In some possible embodiments, a new module is further included, and the new module is used to:
[0069] If a new field is detected in the target data table, the new field data type of the new field is obtained;
[0070] If there is a keyword data type that is the same data type as the newly added field data type in the preset indicator keyword set, a corresponding relationship is established between the indicator keyword corresponding to the keyword data type and the newly added field corresponding to the newly added field data type;
[0071] If the keyword data type that is the same data type as the newly added field data type does not exist in the preset indicator keyword set, an indicator keyword corresponding to the keyword data type that is the same data type as the newly added field data type is added to the preset indicator keyword set.
[0072] In a third aspect, an embodiment of the present application provides an electronic device comprising at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a method such as any one of the methods in the first aspect.
[0073] In a fourth aspect, an embodiment of the present application provides a computer program product, comprising computer program instructions, which implement any method of the first aspect when executed by a processor.
[0074] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, which, when instructions in the storage medium are executed by a processor, enables the processor to execute any method as described in the first aspect.
[0075] The beneficial effects of the present disclosure are as follows:
[0076] In summary, in an embodiment of the present disclosure, a method, device and storage medium for generating a derived indicator are provided, the method comprising: parsing indicator demand information issued by a client terminal to obtain an indicator type, a combination syntax and at least one indicator keyword, searching for a derived indicator generation method corresponding to the indicator type in a mapping relationship between a preset indicator type and a derived indicator generation method, searching for at least one conversion field corresponding to the indicator keyword in a correspondence relationship between a preset indicator keyword set and a conversion field set, the conversion field set comprising each field in a target data table in a database, determining an indicator value corresponding to the conversion field based on the combination syntax and the found conversion field, determining a derived indicator based on the indicator value and the derived indicator generation method, thereby being able to flexibly and quickly lock the fields in the target data table according to the user's immediate needs, and quickly and conveniently generate a derived indicator according to the corresponding derived indicator generation method.
[0077] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or be understood by practicing the present disclosure. The purpose and other advantages of the present disclosure can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure. In the drawings:
[0079] Figure 1 A schematic diagram of a system architecture for generating derived indicators in an embodiment of the present disclosure;
[0080] Figure 2 A schematic diagram of a process for generating a derivative indicator in an embodiment of the present disclosure;
[0081] Figure 3 A schematic diagram of a process for parsing indicator requirement information in an embodiment of the present disclosure;
[0082] Figure 4 A schematic diagram of a process for determining an indicator value corresponding to a conversion field in an embodiment of the present disclosure;
[0083] Figure 5 A schematic diagram of a process for determining a derived indicator according to an indicator value and a derived indicator generation method in an embodiment of the present disclosure;
[0084] Figure 6 A schematic diagram of the logical architecture of a device for generating a derived indicator in an embodiment of the present disclosure;
[0085] Figure 7Schematic diagram of the physical structure of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0086] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the technical solution of the present disclosure, rather than all the embodiments. Based on the embodiments recorded in the present disclosure document, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present disclosure.
[0087] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented using sequences other than those illustrated or described herein.
[0088] The preferred embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0089] See also Figure 1 As shown, in the embodiment of the present disclosure, the system includes at least one client terminal and a server. Figure 1 In the process, the client inputs the indicator requirement information through the client terminal, and the client terminal sends the indicator requirement information to the server, so that the server can adopt the corresponding derivative indicator generation method according to the specific type of the indicator requirement information to generate the corresponding derivative indicator, and feed back the derivative indicator to the client terminal.
[0090] In the disclosed embodiment, the implementation of the method for generating the derivative indicator is mainly performed on the server side, which is described in detail below.
[0091] First, let’s introduce the calculation methods of common derivative indicators:
[0092] Growth over the same period = current period number - same period number
[0093] Cycle growth = current period number - previous period number
[0094] Year-on-year growth rate = (current period number - same period number) / same period number * 100%
[0095] Month-on-month growth rate = (current period number - previous period number) / previous period number * 100%
[0096] Growth from the beginning of the year = current period number - beginning of the year number
[0097] Growth rate compared to the beginning of the year = (current period number - beginning of the year number) / beginning of the year number * 100%
[0098] See also Figure 2 As shown, in the embodiment of the present disclosure, the specific process of generating the derivative index is as follows:
[0099] Step 201: Parse the indicator requirement information sent by the client terminal to obtain the indicator type, combination syntax and at least one indicator keyword, wherein the indicator type carries the original date information.
[0100] Considering that there are a large number of fields stored in the target data table in the database, the above fields are usually customized by customers, and there are various types of derived indicators. Based on this, the content of the indicator demand information allowed to be queried by the customer terminal is also uncertain, that is, the indicator demand information issued by the customer terminal is flexible and changeable, and the derived indicators corresponding to the indicator demand information are also ever-changing.
[0101] Assume that the target data table stored in the database is the sales data of employees in various regions of Company A. The fields stored in the target data table include age, date, city, and money. The age field has four indicator values 20-30, 30-40, 40-50, and 50-60. The date field has sixteen indicator values including January 2021, February 2021...December 2021...January 2022...April 2022. The city field has five indicator values including Beijing, Tianjin, Shanghai, Guangzhou, and Shenzhen. The money field has 320 corresponding indicator values.
[0102] Based on the target data table of sales of employees of Company A in various regions, the indicator demand information that can be issued by the client terminal includes indicator demand information 1 for the year-on-year growth in sales of employees aged 20-30 and April 2022 and Beijing, indicator demand information 2 for the year-on-year growth in sales of employees aged 30-40 and April 2022 and (Beijing and Tianjin)... Indicator demand information N for the year-on-year growth in sales of employees aged 30-40 and January 2022 and Tianjin, and so on.
[0103] It should be noted that when the target data table stored in the database changes, the corresponding indicator requirement information can also be flexibly changed. In the embodiment of the present application, in order to calculate the derived indicator corresponding to each indicator requirement information, the indicator requirement information is divided into smaller units.
[0104] Specifically, the indicator requirement information sent by the client terminal is parsed to obtain the indicator type, combination syntax and at least one indicator keyword, see Figure 3 As shown, including:
[0105] Step 2011: Search for at least one target grammar keyword that matches the grammar keywords included in the preset grammar keyword set in the indicator requirement information sent by the client terminal, and sort the at least one target grammar keyword based on the order of the at least one target grammar keyword in the indicator requirement information to obtain a combined grammar.
[0106] Taking into account that the indicator requirement information is composed of at least one grammatical keyword, in an embodiment of the present application, a grammatical keyword set will be pre-set, and the above-mentioned grammatical keyword set includes "and", "or", "not", "and not", "or not", "and", "or" and so on.
[0107] During the implementation process, when the client terminal sends out indicator requirement information, the target grammatical keywords included in the indicator requirement information will be determined one by one first, that is, whether there are grammatical keywords that match the grammatical keywords included in the preset grammatical keyword set in the indicator requirement information will be searched one by one. If, in the indicator requirement information, grammatical keywords that are consistent with the grammatical keywords included in the grammatical keyword set or have the same meaning are found, then the grammatical keywords in the indicator requirement information will be used as the target grammatical keywords.
[0108] For example, if the "and" included in the indicator requirement information is consistent with the grammatical keyword set including "and", and the "and" included in the indicator requirement and the grammatical keyword set including "and" have the same meaning, then the "and" and "and" included in the indicator requirement will be used as target grammatical keywords.
[0109] Through the above steps, all target grammatical keywords in the indicator requirement information sent by the client terminal are determined, that is, at least one target grammatical keyword mentioned above. Considering that the combination order of the target grammatical keywords will affect the actual meaning of the indicator requirement information, in the embodiment of the present application, after all the target grammatical keywords are determined, the order of each target grammatical keyword in the indicator requirement information is also determined, and the combined grammar is obtained on this basis.
[0110] Taking the above indicator requirement information 1, which is the year-on-year growth in sales of employees aged 20-30 and in April 2022 and Beijing, as an example, after obtaining the two target grammar keywords and included in the indicator requirement information 1, the order of two consecutive ands is used as the above order, and the sorted XX and XX and XX is used as the combined grammar.
[0111] Assuming that indicator requirement information 3 is (20-30 years old or 30-40 years old) and April 2022 and the same period growth of sales of employees in Beijing, then the target grammatical keywords included in the obtained indicator requirement information 3 are or and two ands, with the order of or and then two consecutive ands as the above order, and the sorted (XX or XX) and XXand XX as the combined grammar.
[0112] Step 2012: truncate the indicator requirement information using at least one target grammatical keyword as a truncation point, and obtain each sub-requirement information based on the truncated indicator requirement information.
[0113] During the implementation process, after determining at least one target grammatical keyword included in the indicator requirement information, the indicator requirement information is truncated using each target grammatical keyword as a truncation point, that is, the indicator requirement information is broken up using the target grammatical keyword as a reference point. In this way, the truncated indicator requirement information between any two target grammatical keywords is the sub-requirement information.
[0114] Still taking the above indicator demand information 3: (20-30 years old or 30-40 years old) and April 2022 and the same period growth in sales of employees in Beijing as an example for explanation, taking the target grammatical keywords or, and and and as truncation points, after truncating the indicator demand information 3, the obtained sub-demand information is 20-30 years old, 30-40 years old, April 2022, and the same period growth in sales of employees in Beijing.
[0115] Step 2013: extract the sub-demand information that matches the indicator type identifier included in the preset indicator type identifier set from each sub-demand information, and use the indicator type identifier corresponding to the extracted sub-demand information as the indicator type, and use the date information corresponding to the extracted sub-demand information as the original date information.
[0116] Taking into account the large number of types of derived indicators, after obtaining each sub-demand information from the indicator demand information, it is necessary to further determine which derived indicator the indicator demand information wants to obtain. To this end, in an embodiment of the present application, an indicator type identification set is pre-set. In theory, the indicator type identification set includes all types of derived indicators. Specifically, the indicator type identification included in the indicator type identification set is a common identification in the industry. Assuming that the same period growth is commonly used in the industry as the same period, then the indicator type identification set includes the same period, and the same period means the same period growth; assuming that the cycle growth is commonly used in the industry as the cycle period, then the indicator type identification set includes the cycle period, and the cycle period means the cycle growth.
[0117] During the implementation process, each sub-demand information is compared with each of the above indicator type identifiers. If the sub-demand information is consistent with the indicator type identifier, the indicator type identifier corresponding to the extracted sub-demand information is used as the indicator type of the indicator demand information. For example, if the sub-demand information includes descriptions such as growth over the same period and growth over the same period, then the indicator type of the corresponding indicator demand information is growth over the same period.
[0118] Furthermore, since derived indicators are usually time-sensitive, after determining the indicator type of the derived indicator corresponding to the indicator requirement information, it is also necessary to further determine the original date information carried by the indicator type, that is, continue to extract the corresponding date information as the original date information in the above-mentioned each sub-requirement information.
[0119] Still taking the above indicator demand information 3: (20-30 years old or 30-40 years old) and April 2022 and the same period growth of sales of employees in Beijing as an example, the corresponding date information is April 2022 in the sub-demand information of 20-30 years old, 30-40 years old, April 2022, and the same period growth of sales of employees in Beijing. Then April 2022 is used as the original date information for calculating the same period growth in indicator demand information 3, that is, the customer wants to obtain the derivative indicator of the same period growth in April 2022.
[0120] Step 2014: extracting sub-demand information that matches the indicator keyword included in the preset indicator keyword set from each sub-demand information, and taking the indicator keyword corresponding to the extracted sub-demand information as at least one indicator keyword.
[0121] It should be noted that, in addition to the target grammatical keywords and indicator types, the indicator requirement information also includes indicator keywords. Common indicator keywords are nouns or adjectives. The setting of specific indicator keywords needs to be flexibly set according to the situation.
[0122] Still taking the above indicator demand information 3: (20-30 years old or 30-40 years old) and April 2022 and the same period growth in sales of employees in Beijing as an example for explanation, after extracting the target grammatical keywords or, and and, and the indicator type is the same period growth, there are still remaining sub-demand information, 20-30 years old, 30-40 years old, April 2022, the same period growth in sales of employees in Beijing. During the implementation process, the above 20-30 years old, 30-40 years old, April 2022, the same period growth in sales of employees in Beijing can be used as indicator keywords.
[0123] In the embodiment of the present application, on the one hand, in order to obtain more accurate indicator keywords, an indicator keyword set is pre-established, and on the other hand, in order to include all requirements input by the client terminal as much as possible, the range of the indicator keyword set is set to be larger, and the range of the indicator keyword set is set to be larger. For example, the indicator keyword set can be preset as: "20-30 years old", "30-40 years old", "40-50 years old", "50-60 years old", "Beijing", "Tianjin", "Shanghai", "Guangzhou", "Shenzhen", etc.
[0124] Step 202: In the preset mapping relationship between the indicator type and the derived indicator generation method, search for the derived indicator generation method corresponding to the indicator type.
[0125] In an embodiment of the present application, in order to conveniently and effectively find the derivative indicator generation method corresponding to the indicator requirement information input by the client terminal, that is, the derivative indicator generation method referred to by the above-mentioned indicator type, a mapping relationship between the preset indicator type and the derivative indicator generation method will be established in advance.
[0126] For example, the derivative indicator generation method corresponding to the indicator type of same period growth is set as derivative indicator generation method 1, and the specific execution steps included in derivative indicator generation method 1 are current period number minus same period number.
[0127] Taking into account that different client terminals will write slightly different indicator types when inputting different indicator demand information, the client terminals are allowed to input indicator types using industry abbreviations and set corresponding derivative indicator generation methods for them.
[0128] For example, the derivative indicator generation method corresponding to the indicator type of the same period is set as derivative indicator generation method 1, and the specific execution steps included in the derivative indicator generation method 1 are the current period number minus the same period number.
[0129] In addition, it should be noted that, since the derived indicators are obtained based on the data corresponding to a certain date, the data corresponding to another date is obtained, and the derived indicators are calculated based on the data of the above two dates, the derived indicator generation method is specifically introduced below.
[0130] The derived indicator generation method is determined by:
[0131] (1) Based on the preset indicator type, determine the indicator calculation formula and the first date information.
[0132] Since different derivative indicators are generated in different ways, but each derivative indicator is generated in a fixed way, during the implementation process, the corresponding indicator calculation formula will be determined for each preset indicator type.
[0133] For example, when the indicator type is same period growth or same period, the indicator calculation formula determined is same period growth = current period number - same period number. When the indicator type is cycle growth or cycle period, the indicator calculation formula determined is cycle growth = current period number - previous period number. When the indicator type is growth compared to the beginning of the year or compared to the beginning of the year, the indicator calculation formula determined is growth compared to the beginning of the year = current period number - beginning of the year number. When the indicator type is year-on-year growth rate, the indicator calculation formula determined is year-on-year growth rate = (current period number - same period number) / same period number * 100%. When the indicator type is month-on-month growth rate, the indicator calculation formula determined is month-on-month growth rate = (current period number - previous period number) / previous period number * 100%. When the indicator type is growth rate compared to the beginning of the year, the indicator calculation formula determined is growth rate compared to the beginning of the year = (current period number - beginning of the year number) / beginning of the year number * 100%.
[0134] In addition, during the implementation process, the first date information will also be obtained from the indicator demand information sent by the client terminal. It should be noted that the first date information represents the time information that matches the indicator demand information, that is, the date of the derivative indicator that is desired to be obtained as stated in the indicator demand information of the client terminal.
[0135] Still taking the above indicator requirement information 3: (20-30 years old or 30-40 years old) and April 2022 and the same period growth of sales of employees in Beijing as an example, the first date information determined from the indicator requirement information 3 is April 2022, that is, the same period growth that the client terminal wants to determine is the same period growth in April 2022.
[0136] (2) Based on the first date information and the indicator calculation formula, determine the second date information.
[0137] During implementation, after determining the first date information indicated by the indicator requirement information of the client terminal and the indicator calculation formula corresponding to the indicator requirement information, the second date information is automatically obtained according to the first date information and the indicator calculation formula.
[0138] It should be noted that the second date information here represents the time information matching the indicator type. That is, the time information corresponding to the indicator type is usually two, one of which comes from the indicator demand information sent by the client terminal, and the other is calculated from the corresponding indicator type and the above first date information.
[0139] Still taking the above indicator requirement information 3: (20-30 years old or 30-40 years old) and April 2022 and the same period growth of sales of employees in Beijing as an example for explanation, the first date information determined from the indicator requirement information 3 is April 2022, and the indicator calculation formula corresponding to the indicator requirement information 3 is the same period growth = the current period number - the same period number. Based on this, the second date information can be determined to be April 2021.
[0140] (3) Determine a method for generating a derivative indicator based on the indicator value corresponding to the first date information, the indicator value corresponding to the second date information, and the indicator calculation formula.
[0141] In the embodiment of the present application, after determining the first date information and the second date information, the index requirement information sent by the client terminal is specifically split into two pieces of information. Further, according to the index requirement information corresponding to the first date information, the target data table in the database is queried for the corresponding index value, and according to the index requirement information corresponding to the second date information, the target data table in the database is queried for the corresponding index value. After obtaining the above two index values, the derivative index generation method is determined according to the index calculation formula corresponding to the index requirement information.
[0142] It should be noted that in order to make the derived indicator generation method in the embodiment of the present application universal, the indicator demand information corresponding to the first date information is queried from the target data table in the database and the corresponding indicator value is represented by X, and the indicator demand information corresponding to the second date information is queried from the target data table in the database and the corresponding indicator value is represented by Y. The corresponding indicator generation method is expressed by the formula as follows:
[0143] Growth over the same period = XY
[0144] Cycle growth = XY
[0145] Year-on-year growth rate = (XY) / Y*100%
[0146] Month-on-month growth rate = (XY) / Y*100%
[0147] Growth from the beginning of the year = XY
[0148] Growth rate compared to the beginning of the year = (XY) / Y*100%
[0149] It should be noted that, since the second date information is determined based on the first date information and the indicator calculation formula, when the first date information is the same, that is, X in the above formulas is the same indicator value, the second date information will also be different, that is, Y in the above formulas will also be different indicator values.
[0150] Step 203: searching for at least one conversion field corresponding to the indicator keyword in the correspondence between the preset indicator keyword set and the conversion field set, wherein the conversion field set includes each field in the target data table in the database.
[0151] During the implementation process, considering that the number of fields in the target data table in the database is uncertain and the specific meaning of each field is also uncertain, it is necessary to further determine the conversion field set, that is, to form a conversion field set according to the various fields in the target data table in the database.
[0152] Still taking the target data table stored in the database as the sales of employees in various regions of Company A as an example, the fields stored in the target data table include age, date, city, and money. The age field has four indicator values 20-30, 30-40, 40-50, and 50-60. The date field has sixteen indicator values including January 2021, February 2021...December 2021...January 2022...April 2022. The city field has five indicator values including Beijing, Tianjin, Shanghai, Guangzhou, and Shenzhen. When money has 320 indicator values, the conversion field set is determined based on age, date, city, and money in the target data table.
[0153] It should be noted that, in order to fully cover the indicator requirement information sent by the client terminal, the above conversion field set may also include other fields.
[0154] After obtaining the indicator keyword set and the conversion field set, a corresponding relationship between the indicator keyword set and the conversion field set is further established, which is specifically introduced below.
[0155] The correspondence between the preset indicator keyword set and the conversion field set is established in the following way:
[0156] 1) Extract each field in the target data table in the database, determine the field data type corresponding to each field, and determine the conversion field set based on each field.
[0157] First of all, it should be explained that although there may be multiple data tables stored in the database, during the implementation process, one of the data tables is usually selected according to the indicator requirement information of the client terminal, and the selected data table is used as the target data table.
[0158] During the implementation process, after the target data table is determined, each field in the target data table will be extracted for the target data table. The target data table stored in the database is still taken as an example of the sales of employees in various regions of Company A. The fields stored in the target data table include age, date, city, and money. The extracted fields include age, date, city, and money.
[0159] Furthermore, in order to establish a correspondence between the indicator keyword set and the conversion field set and make the correspondence between the indicator keyword set and the conversion field set clearer, during the implementation process, it is necessary to determine the field data type corresponding to each of the above fields respectively. The field data type here can be a general type or a custom type.
[0160] For example, the field data type corresponding to the age field is integer, and the field data type can also be customized to integer, with the unit being years; the field data type corresponding to the date field is date, and the field data type can also be customized to date, with the unit being year, month, and day; the field data type corresponding to the city field is character, and the field data type can also be customized to character, with the unit being longitude and latitude; the field data type corresponding to the money field is floating point, and the field data type can also be customized to floating point, with the unit being ten thousand yuan.
[0161] 2) Determine the keyword data type corresponding to any preset indicator keyword in the preset indicator keyword set.
[0162] In order to establish a correspondence between the indicator keyword set and the conversion field set, in an embodiment of the present application, after determining the field data type corresponding to each field, it is necessary to further determine the keyword data type corresponding to each preset indicator keyword in the preset indicator keyword set.
[0163] Assume that the preset indicator keyword set includes: 20-30 years old, April 2022, Beijing, then the keyword data type corresponding to each preset indicator keyword is: the keyword data type corresponding to 20-30 years old is integer type, the keyword data type corresponding to April 2022 is date type, and the keyword data type corresponding to Beijing is character type.
[0164] It should be noted that if the data type consistent with the field data type is customized in advance, then the keyword data type corresponding to each preset indicator keyword in the above assumptions is: the keyword data type corresponding to 20-30 years old is integer type, and the unit is years; the keyword data type corresponding to April 2022 is date type, and the unit is year, month, and day; the keyword data type corresponding to Beijing is character type, and the unit is longitude and latitude.
[0165] 3) If the field data type and the keyword data type belong to the same data type, a correspondence is established between the indicator keyword corresponding to the keyword data type and the field corresponding to the field data type.
[0166] During the implementation process, the above field data types and keyword data types are compared one by one to see if they belong to the same data type. If the field data type and keyword data type belong to the same data type, then a correspondence is established between the indicator keyword corresponding to the keyword data type and the field corresponding to the field data type.
[0167] Taking the examples in 2) and 3) above as an example, a corresponding relationship is established between the indicator keyword 20-30 years old and the age in the conversion field set, a corresponding relationship is established between the indicator keyword April 2022 and the date in the conversion field set, and a corresponding relationship is established between the indicator keyword Beijing and the city in the conversion field set.
[0168] Step 204: Based on the combined grammar and the found conversion field, determine the indicator value corresponding to the conversion field.
[0169] During the implementation process, after finding the conversion fields in the target data table according to the indicator keywords, the conversion fields obtained are independent of each other, that is, there is no logical relationship between the conversion fields. Based on this, it is necessary to combine the combination syntax with the above conversion fields to determine the indicator value corresponding to the conversion field.
[0170] Specifically, based on the combination syntax and the found conversion field, determine the indicator value corresponding to the conversion field, see Figure 4 As shown, including:
[0171] Step 2041: Determine the positional relationship between the found conversion field and at least one target grammar keyword in the combined grammar.
[0172] Since the target grammar keyword is used to connect two conversion fields, in the implementation process, after determining each conversion field corresponding to the indicator requirement information, the positional relationship between each conversion field and each target grammar keyword in the combined grammar is determined.
[0173] For example, when the found combination syntax is (XX or XX)and XX and XX, and the found conversion field is 20-30 years old 30-40 years old April 2022 Beijing, then it is necessary to further determine that the positional relationship between 20-30 years old and or and and in (XX or XX)and XX andXX is that 20-30 years old is before or, and so on, and we get: the positional relationship between 30-40 years old and or and and in (XX orXX)and XX and XX is that 30-40 years old is after or and before the first and; the positional relationship between April 2022 and or and and in (XX or XX)and XX and XX is that April 2022 is after the first and; the positional relationship between Beijing and or and and in (XX or XX)and XX and XX is that Beijing is after the second and.
[0174] It should be noted that the order of determining the above conversion fields and the order of determining the target grammar keywords are not specifically limited.
[0175] Step 2042: Based on the position relationship, the found conversion field is combined with at least one target grammar keyword in the combined grammar to obtain a combined keyword.
[0176] During the implementation process, after determining the above-mentioned positional relationship, the found conversion field is combined with at least one target grammar keyword in the combined grammar according to the above-mentioned positional relationship. Taking the example in step 2041 as an example, each found conversion field is placed in the combined grammar (XX or XX) and XX and XX, and the obtained combined keywords are (20-30 years old or 30-40 years old) and April 2022 and Beijing.
[0177] Step 2043: Search the target data table for the indicator value corresponding to the conversion field that matches the combined keyword.
[0178] During the implementation process, after the combination keyword is obtained, the indicator value corresponding to the conversion field matching the combination keyword is searched in the target data table, that is, the target data table is screened according to the conditions of the combination keyword to obtain the corresponding indicator value.
[0179] For example, in the target data table of sales of employees in various regions of Company A, the sales that matches the combination of keywords (20-30 years old or 30-40 years old) and April 2022 and Beijing is 100,000 yuan, so 100,000 yuan is used as the indicator value.
[0180] Step 205: Determine the derived indicator based on the indicator value and the derived indicator generation method.
[0181] During the implementation process, after the above-mentioned indicator values and the corresponding derivative indicator generation method are determined, the above-mentioned indicator values can be substituted into the derivative indicator generation method to calculate the derivative indicator.
[0182] Specifically, based on the indicator value and the method for generating the derived indicator, the derived indicator is determined, see Figure 5 As shown, including:
[0183] Step 2051: Use the indicator value as the indicator value corresponding to the first date information.
[0184] Still taking the above indicator requirement information 3: (20-30 years old or 30-40 years old) and April 2022 and the same period growth of sales of employees in Beijing as an example, after determining that the first date information is April 2022, in the target data table of sales of employees in various regions of Company A, the sales that matches the conditions of (20-30 years old or 30-40 years old) and April 2022 and Beijing is 100,000 yuan, then 100,000 yuan will be used as the indicator value.
[0185] Step 2052: Determine the target date information based on the original date information and the derived indicator generation method.
[0186] After determining the indicator value corresponding to the original date information, ie, the first date information, the target date information, ie, the second date information, is determined according to the original date information and the derived indicator generation method.
[0187] For example, the indicator demand information issued by the client terminal corresponds to the same period growth, and the original date information is April 2022. Then, based on the derivative indicator generation method corresponding to the same period growth and the original date information, the target date information is determined to be April 2021.
[0188] Step 2053: Search the target data table for the index value corresponding to the conversion field that matches the target date information and the combined keyword, and use the index value corresponding to the target date information as the index value corresponding to the second date information.
[0189] During the implementation process, it is necessary to further obtain the corresponding indicator value based on the target date information. Except for the target date information, other information is the same as the indicator demand information issued by the client terminal. That is, according to the target date information and the above-mentioned combined keywords, the indicator value corresponding to the matching conversion field is searched in the target data table, and the indicator value corresponding to the target date information is used as the indicator value corresponding to the second date information.
[0190] Still taking the above indicator requirement information 3: (20-30 years old or 30-40 years old) and April 2022 and the same period growth of sales of employees in Beijing as an example, after determining the target date information as April 2021, in the target data table of sales of employees in various regions of Company A, the sales matching the conditions of (20-30 years old or 30-40 years old) and April 2021 and Beijing is 50,000 yuan, then 50,000 yuan will be used as the indicator value.
[0191] Step 2054: Determine the derived indicator based on the indicator value corresponding to the first date information, the indicator value corresponding to the second date information, and the derived indicator generation method.
[0192] After determining the index value corresponding to the first date information and the index value corresponding to the second date information, the derived index generation method can be used to calculate the derived index.
[0193] Still taking the above indicator demand information 3: (20-30 years old or 30-40 years old) and April 2022 and the same period growth of sales of employees in Beijing as an example for explanation, after obtaining the indicator value corresponding to the first date information as 100,000 yuan and the indicator value corresponding to the second date information as 50,000 yuan, according to the indicator calculation formula corresponding to the same period growth in indicator demand information 3, the same period growth = current period number - same period number, the same period growth of sales of (20-30 years old or 30-40 years old) and April 2022 and employees in Beijing is calculated to be 10-5 = 50,000 yuan.
[0194] It should be noted that when calculating the period-on-period growth, year-on-year growth rate, month-on-month growth rate, growth compared to the beginning of the year, growth rate compared to the beginning of the year and other derivative indicators, the processing steps used are similar to those for the same period growth, and they will not be repeated here.
[0195] In addition, since the target data table in the database will be updated, the indicator demand information issued by the client terminal will also change in real time. In order to meet the immediate needs of the client terminal as much as possible, the method also includes:
[0196] [1] If a new field is detected in the target data table, the new field data type is obtained.
[0197] During the implementation process, if there is a new field in the target data table in the database, for example, xingbie, then in this case, it is necessary to further obtain the new field data type of the above new field. Assume that the new field data type corresponding to the new field xingbie is a string type.
[0198] [2] If there is a keyword data type in the preset indicator keyword set that belongs to the same data type as the newly added field data type, a correspondence is established between the indicator keyword corresponding to the keyword data type and the newly added field corresponding to the newly added field data type.
[0199] It should be noted that in order to match the newly added field, after detecting that there is a newly added field in the target data table, the indicator keyword matching the newly added field will be searched in the preset indicator keyword set. For example, after detecting that the newly added field is xingbie, the corresponding indicator keyword (male or female) will be searched accordingly to respond to the query of indicator demand information issued by the client terminal.
[0200] Then, in order to find the corresponding newly added field in the target data table for the male or female in the indicator demand information sent by the client terminal, so as to increase the query condition to determine the final indicator value, during the implementation process, a correspondence between the indicator keyword corresponding to the keyword data type and the newly added field corresponding to the newly added field data type will be established in advance. Specifically, there is a keyword data type that belongs to the same data type as the newly added field data type in the preset indicator keyword set. Assuming that there happens to be an indicator keyword of a string type such as male or female in the preset indicator keyword set, a correspondence between the indicator keyword corresponding to the keyword data type that belongs to the same data type as the newly added field data type and the newly added field corresponding to the newly added field data type will be established, that is, a correspondence between male or female and xingbie will be established.
[0201] In this way, in the subsequent processing process, the male or female information in the indicator requirement information sent by the client terminal can be converted into a newly added field xingbie in the target data table.
[0202] Still taking the above indicator requirement information 3: the same period growth of sales of employees (20-30 years old or 30-40 years old) and April 2022 and male and Beijing as an example, the corresponding screening condition in the target data table A is further changed to the sales that matches the conditions of (20-30 years old or 30-40 years old) and April 2022 and male and Beijing in the target data table of sales of employees in various regions of Company A.
[0203] [3] If the keyword data type that is the same data type as the newly added field data type does not exist in the preset indicator keyword set, then an indicator keyword corresponding to the keyword data type that is the same data type as the newly added field data type is added to the preset indicator keyword set.
[0204] During the implementation process, if there is no keyword data type belonging to the same data type as the newly added field data type in the preset indicator keyword set, for example, after detecting that the newly added field is xingbie and determining that the data type of the newly added field xingbie is a string, the corresponding indicator keyword of the string type cannot be found in the preset indicator keyword set.
[0205] In the above case, corresponding indicator keywords can be added to the preset indicator keyword set. It should be noted that the principle of adding is that the keyword data type corresponding to the indicator keyword and the newly added field data type belong to the same data type.
[0206] For example, after detecting that the newly added field is xingbie and determining that the newly added field data type is character type, the corresponding indicator keyword male or female can be added to the indicator keyword set, and the keyword data type corresponding to male or female can also be set to character type. In addition, the data types of the newly added field xingbie and the corresponding indicator keyword can also be customized.
[0207] Based on the same inventive concept, refer to Figure 6 As shown, in an embodiment of the present disclosure, a device for generating a derivative index is provided, comprising:
[0208] The parsing module 601 is used to parse the indicator requirement information sent by the client terminal to obtain the indicator type, the combination syntax and at least one indicator keyword, wherein the indicator type carries the original date information;
[0209] A method search module 602 is used to search for a derived indicator generation method corresponding to an indicator type in a preset mapping relationship between an indicator type and a derived indicator generation method;
[0210] A field search module 603 is used to search for at least one conversion field corresponding to the indicator keyword in the correspondence between the preset indicator keyword set and the conversion field set, wherein the conversion field set includes each field in the target data table in the database;
[0211] A value determination module 604, configured to determine an indicator value corresponding to a conversion field based on the combination grammar and the found conversion field;
[0212] The indicator determination module 605 is used to determine the derived indicator based on the indicator value and the derived indicator generation method.
[0213] In some possible embodiments, the indicator requirement information sent by the client terminal is parsed to obtain the indicator type, the combination syntax and at least one indicator keyword, and the parsing module 601 is used to:
[0214] Searching for at least one target grammar keyword that matches the grammar keywords included in the preset grammar keyword set in the indicator requirement information sent by the client terminal, and sorting the at least one target grammar keyword based on the sequence of the at least one target grammar keyword in the indicator requirement information to obtain a combined grammar;
[0215] Using at least one target grammatical keyword as a truncation point to truncate the indicator requirement information, and obtaining each sub-requirement information based on the truncation indicator requirement information;
[0216] Extracting sub-demand information that matches the indicator type identifier included in the preset indicator type identifier set from each sub-demand information, and using the indicator type identifier corresponding to the extracted sub-demand information as the indicator type, and using the date information corresponding to the extracted sub-demand information as the original date information;
[0217] Sub-demand information matching the indicator keyword included in the preset indicator keyword set is extracted from each sub-demand information, and the indicator keyword corresponding to the extracted sub-demand information is used as at least one indicator keyword.
[0218] In some possible embodiments, the correspondence between the preset indicator keyword set and the conversion field set is established in the following manner:
[0219] Extract each field in the target data table in the database, determine the field data type corresponding to each field, and determine the conversion field set based on each field;
[0220] Determine a keyword data type corresponding to any preset indicator keyword in the preset indicator keyword set;
[0221] If the field data type and the keyword data type belong to the same data type, a correspondence is established between the indicator keyword corresponding to the keyword data type and the field corresponding to the field data type.
[0222] In some possible embodiments, based on the combined syntax and the found conversion field, the indicator value corresponding to the conversion field is determined, and the field search module 603 is used to:
[0223] Determine a positional relationship between the found conversion field and at least one target grammar keyword in the combined grammar;
[0224] Based on the position relationship, the found conversion field is combined with at least one target grammar keyword in the combined grammar to obtain a combined keyword;
[0225] Find the indicator value corresponding to the conversion field that matches the combined keyword in the target data table.
[0226] In some possible embodiments, the derivative indicator generation method is determined by:
[0227] Based on the preset indicator type, determine the indicator calculation formula and the first date information;
[0228] Determine the second date information based on the first date information and the indicator calculation formula;
[0229] Determine a method for generating a derivative indicator based on the indicator value corresponding to the first date information, the indicator value corresponding to the second date information, and an indicator calculation formula;
[0230] The first date information represents the time information that matches the indicator requirement information, and the second date information represents the time information that matches the indicator type.
[0231] In some possible embodiments, based on the indicator value and the derived indicator generation method, the derived indicator is determined, and the indicator determination module 605 is used to:
[0232] The indicator value is used as the indicator value corresponding to the first date information;
[0233] Determine the target date information based on the original date information and the derived indicator generation method;
[0234] Search the target data table for the index value corresponding to the conversion field that matches the target date information and the combined keyword, and use the index value corresponding to the target date information as the index value corresponding to the second date information;
[0235] A derived indicator is determined based on the indicator value corresponding to the first date information, the indicator value corresponding to the second date information, and a derived indicator generation method.
[0236] In some possible embodiments, a new module is further included, and the new module is used to:
[0237] If a new field is detected in the target data table, the new field data type of the new field is obtained;
[0238] If there is a keyword data type that is the same data type as the newly added field data type in the preset indicator keyword set, a corresponding relationship is established between the indicator keyword corresponding to the keyword data type and the newly added field corresponding to the newly added field data type;
[0239] If the keyword data type that is the same data type as the newly added field data type does not exist in the preset indicator keyword set, an indicator keyword corresponding to the keyword data type that is the same data type as the newly added field data type is added to the preset indicator keyword set.
[0240] Based on the same inventive concept, see Figure 7 As shown, an embodiment of the present disclosure provides an electronic device, comprising at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a method as described in any one of the first aspects.
[0241] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.
[0242] In some possible implementations, the electronic device according to the present application may include at least one processor and at least one memory. The memory stores program code, and when the program code is executed by the processor, the processor executes the steps of the payment service processing method according to various exemplary implementations of the present application described above in this specification.
[0243] Refer to the following Figure 7 To describe the electronic device 130 according to this embodiment of the present application, that is, the above-mentioned payment service processing device. Figure 7 The electronic device 130 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0244] like Figure 7 As shown, the electronic device 130 is in the form of a general electronic device. The components of the electronic device 130 may include but are not limited to: the at least one processor 131, the at least one memory 132, and a bus 133 connecting different system components (including the memory 132 and the processor 131).
[0245] Bus 133 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.
[0246] The memory 132 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 1321 and / or a cache memory 1322 , and may further include a read-only memory (ROM) 1323 .
[0247] The memory 132 may also include a program / utility 1325 having a set (at least one) of program modules 1324, such program modules 1324 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0248] The electronic device 130 may also communicate with one or more external devices 134 (e.g., keyboards, pointing devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 130, and / or communicate with any device that enables the electronic device 130 to communicate with one or more other electronic devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 135. Furthermore, the electronic device 130 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 136. As shown, the network adapter 136 communicates with other modules for the electronic device 130 via a bus 133. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 130, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0249] In some possible implementations, various aspects of a payment service processing method provided by the present application may also be implemented in the form of a program product, including computer program instructions, which are executed by a processor to perform the steps of a payment service processing method according to various exemplary embodiments of the present application described above in this specification.
[0250] The program product may employ any combination of one or more readable media. The readable medium may be a computer-readable storage medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0251] The program product for monitoring of the embodiment of the present application can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on an electronic device. However, the program product of the present application is not limited to this. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, an apparatus or a device or used in combination with it.
[0252] Computer readable storage media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable storage media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0253] The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0254] The program code for performing the operations of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also conventional procedural programming languages such as "C" language or similar programming languages. The program code can be executed entirely on the user electronic device, partially on the user device, as an independent software package, partially on the user electronic device and partially on the remote electronic device, or entirely on the remote electronic device or server. In the case of a remote electronic device, the remote electronic device can be connected to the user electronic device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external electronic device (for example, using an Internet service provider to connect through the Internet).
[0255] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.
[0256] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0257] In summary, in an embodiment of the present disclosure, a method, device and storage medium for generating a derived indicator are provided, the method comprising: parsing indicator demand information issued by a client terminal to obtain an indicator type, a combination syntax and at least one indicator keyword, searching for a derived indicator generation method corresponding to the indicator type in a mapping relationship between a preset indicator type and a derived indicator generation method, searching for at least one conversion field corresponding to the indicator keyword in a correspondence relationship between a preset indicator keyword set and a conversion field set, the conversion field set comprising each field in a target data table in a database, determining an indicator value corresponding to the conversion field based on the combination syntax and the found conversion field, determining a derived indicator based on the indicator value and the derived indicator generation method, thereby being able to flexibly and quickly lock the fields in the target data table according to the user's immediate needs, and quickly and conveniently generate a derived indicator according to the corresponding derived indicator generation method.
[0258] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0259] The present application is described with reference to the flowcharts and block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and block diagram, as well as the combination of the processes and boxes in the flowchart and 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 generate 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 block diagram. Figure 1 Process or multiple processes and boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0260] 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 Process or multiple processes and boxes Figure 1 A function specified in one or more boxes.
[0261] 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 Process or multiple processes and boxes Figure 1 The steps for the functions specified in one or more boxes.
[0262] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0263] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for generating a derivative index, characterized in that: The method comprises: Parsing the indicator requirement information sent by the client terminal to obtain an indicator type, a combination syntax and at least one indicator keyword, wherein the indicator type carries original date information; In the mapping relationship between the preset indicator type and the derived indicator generation method, searching for the derived indicator generation method corresponding to the indicator type; In the correspondence between the preset indicator keyword set and the conversion field set, searching for at least one conversion field corresponding to the indicator keyword, wherein the conversion field set includes each field in the target data table in the database; Determine the positional relationship between the found conversion field and at least one target grammar keyword in the combined grammar, combine the found conversion field with at least one target grammar keyword in the combined grammar based on the positional relationship to obtain a combined keyword, and search the target data table for an indicator value corresponding to the conversion field that matches the combined keyword; Based on the indicator value and the derived indicator generation method, a derived indicator is determined.
2. The method according to claim 1, characterized in that The step of parsing the indicator requirement information sent by the client terminal to obtain an indicator type, a combination syntax and at least one indicator keyword includes: Searching for at least one target grammar keyword that matches the grammar keywords included in the preset grammar keyword set in the indicator requirement information sent by the client terminal, and sorting at least one target grammar keyword based on the sequence of at least one target grammar keyword in the indicator requirement information to obtain the combined grammar; Using at least one of the target grammatical keywords as a truncation point to truncate the indicator requirement information, and obtaining each sub-requirement information based on the truncation indicator requirement information; Extracting sub-demand information that matches the indicator type identifier included in the preset indicator type identifier set from each of the sub-demand information, and using the indicator type identifier corresponding to the extracted sub-demand information as the indicator type, and using the date information corresponding to the extracted sub-demand information as the original date information; Sub-demand information matching the indicator keyword included in the preset indicator keyword set is extracted from each of the sub-demand information, and the indicator keyword corresponding to the extracted sub-demand information is used as at least one of the indicator keywords.
3. The method according to claim 1, characterized in that The correspondence between the preset indicator keyword set and the conversion field set is established in the following manner: Extracting each field in the target data table in the database, determining the field data type corresponding to each field respectively, and determining the conversion field set based on each field; Determine a keyword data type corresponding to any preset indicator keyword in the preset indicator keyword set; If the field data type and the keyword data type belong to the same data type, a corresponding relationship between the indicator keyword corresponding to the keyword data type and the field corresponding to the field data type is established.
4. The method according to claim 1, characterized in that The derivative index generation method is determined by the following method: Based on the preset indicator type, determine the indicator calculation formula and the first date information; Determine second date information based on the first date information and the indicator calculation formula; Determining the derived indicator generation method based on the indicator value corresponding to the first date information, the indicator value corresponding to the second date information and the indicator calculation formula; The first date information represents the time information that matches the indicator requirement information, and the second date information represents the time information that matches the indicator type.
5. The method according to claim 4, characterized in that The determining of the derived indicator based on the indicator value and the derived indicator generation method includes: Using the index value as the index value corresponding to the first date information; Determining target date information based on the original date information and the derivative indicator generation method; Searching the target data table for an index value corresponding to the conversion field that matches the target date information and the combined keyword, and using the index value corresponding to the target date information as the index value corresponding to the second date information; The derived indicator is determined based on the indicator value corresponding to the first date information, the indicator value corresponding to the second date information, and the derived indicator generation method.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: If it is detected that there is a new field in the target data table, the new field data type of the new field is obtained; If there is a keyword data type that is the same data type as the newly added field data type in the preset indicator keyword set, a corresponding relationship between the indicator keyword corresponding to the keyword data type and the newly added field corresponding to the newly added field data type is established; If the preset indicator keyword set does not contain a keyword data type that has the same data type as the newly added field data type, an indicator keyword corresponding to the keyword data type that has the same data type as the newly added field data type is added to the preset indicator keyword set.
7. A device for generating a derivative index, characterized in that: include: A parsing module, used to parse the indicator requirement information sent by the client terminal to obtain an indicator type, a combination syntax and at least one indicator keyword, wherein the indicator type carries original date information; A method search module, used to search for a derived indicator generation method corresponding to the indicator type in a preset mapping relationship between the indicator type and the derived indicator generation method; A field search module, used to search for at least one conversion field corresponding to the indicator keyword in the correspondence between the preset indicator keyword set and the conversion field set, wherein the conversion field set includes each field in the target data table in the database; A value determination module is used to determine the positional relationship between the found conversion field and at least one target grammar keyword in the combined grammar, and based on the positional relationship, combine the found conversion field with at least one target grammar keyword in the combined grammar to obtain a combined keyword, and search the target data table for an indicator value corresponding to the conversion field that matches the combined keyword; The indicator determination module is used to determine the derived indicator based on the indicator value and the derived indicator generation method.
8. An electronic device, characterized in that: It comprises at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described in any one of claims 1-6.
9. A computer program product, characterized in that The method comprises computer program instructions, which implement the method according to any one of claims 1 to 6 when executed by a processor.
10. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor, the processor is enabled to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Report generation method and device based on big data, electronic device and storage medium
CN109344374A
Natural language processing method and device and electronic equipment
CN112800201A
Index system construction method and device based on syntactic analysis tree and computer equipment
CN112862334A
NL2SQL generation method based on knowledge graph
CN113672699A
Traffic data processing method and device, equipment and storage medium
CN113990068A
