Index processing method and device, electronic equipment and computer readable medium
By receiving index processing requests and calling the rules of the engine identification symbol, determine the parameters and target files to be expanded, and update the index formula to determine the target index, solve the problem of poor maintenance code maintenance code in the existing technology, and realize it. High scalability and flexibility.
Patent Information
- Application Number
- CN202411372999.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-24
Smart Images

Figure CN119356680A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an indicator processing method, device, electronic device and computer-readable medium. Background Art
[0002] At present, the derivative indicators of product pricing models are usually completed by four arithmetic operations based on the parameters passed in by the pricing model request interface, the system supplementary parameters, the parameters obtained by the outbound call external system interface, and the constant parameters. The calculation formula is directly solidified in the code, and the parsing process is solidified according to the preset formula, which is not conducive to rapid response to the market and rapid innovation of products. The autonomy of business personnel is low. If the formula changes, the corresponding developers need to be notified to modify the code, which is time-consuming and labor-intensive. Provide a formula configuration interface, configure the interface and parse the formula through the summarized parameter type acquisition mode, which cannot flexibly respond to changes in parameter types and adjust the parsing support for the formula. There is a certain update cost. If business personnel want to expand the acquisition method of new formula parameters, they still need to communicate and discuss with the development and summarize the parameter acquisition method. The maintainability of complex logic code is poor, and the development and maintenance costs are high, resulting in slow response, poor scalability, and poor flexibility when processing related product pricing indicators. Summary of the invention
[0003] In view of this, the embodiments of the present application provide an indicator processing method, device, electronic device and computer-readable medium, which can solve the problems of poor maintainability of existing codes for complex logic, high development and maintenance costs, resulting in slow response speed, poor scalability and poor flexibility when processing related product pricing indicators.
[0004] To achieve the above object, according to one aspect of an embodiment of the present application, an indicator processing method is provided, including:
[0005] Receive indicator processing requests and obtain corresponding indicator formulas;
[0006] Call the rule engine to identify the symbols in the indicator formula and return result data based on the symbols;
[0007] Based on the returned result data, determine the parameters of the indicator formula to be expanded;
[0008] Determine the parameter acquisition type logic corresponding to the indicator formula parameter to be extended, execute the parameter acquisition type logic to obtain the indicator formula parameter to be extended, and then determine the target file corresponding to the indicator formula parameter to be extended;
[0009] Obtain the target file, and then update the indicator formula based on the target file and the indicator formula parameters to be expanded, and determine the target indicator according to the updated indicator formula.
[0010] Optionally, the returned result data is determined according to the symbol, including:
[0011] In response to the symbol containing four arithmetic operation symbols and comparison symbols, when a logical judgment abnormality is detected based on the four arithmetic operation symbols and the comparison symbols, the four arithmetic operation symbols at the end of the indicator formula are directly deleted and the indicator formula is updated, and the return result data is obtained based on the updated indicator formula.
[0012] Optionally, the returned result data is determined according to the symbol, including:
[0013] In response to the symbol being a plus sign, character strings on both sides of the plus sign are concatenated to obtain return result data.
[0014] Optionally, based on the returned result data, the parameters of the indicator formula to be expanded are determined, including:
[0015] The returned result data is matched with each extensible indicator formula parameter in the extensible indicator formula parameter pool for similarity, and the matched extensible indicator formula parameters are determined as the indicator formula parameters to be expanded.
[0016] Optionally, determining a target file corresponding to the indicator formula parameter to be extended includes:
[0017] Based on the parameters of the indicator formula to be expanded, determine the variables, functions, classes or rules required to parse the expanded indicator formula;
[0018] Determine the corresponding target file based on variables, functions, classes or rules.
[0019] Optionally, updating the indicator formula based on the target file and the indicator formula parameters to be extended includes:
[0020] Expanding the indicator formula based on the indicator formula parameter to be expanded to obtain an expanded indicator formula;
[0021] Utilize the target file to parse the expanded indicator formula to obtain formula parsing data;
[0022] Parse data based on formulas, generate annotations, and add annotations to the expanded indicator formulas.
[0023] Optionally, identify symbols in the indicator formula, including:
[0024] Identify the four arithmetic operators and comparison symbols in indicator formulas.
[0025] In addition, the present application also provides an indicator processing device, including:
[0026] A receiving unit is configured to receive an indicator processing request and obtain a corresponding indicator formula;
[0027] The recognition unit is configured to call the rule engine to recognize the symbols in the indicator formula and determine the return result data according to the symbols;
[0028] A parameter determination unit, configured to determine the parameters of the indicator formula to be expanded based on the returned result data;
[0029] A target file determination unit is configured to determine a parameter acquisition type logic corresponding to the to-be-extended indicator formula parameter, execute the parameter acquisition type logic to acquire the to-be-extended indicator formula parameter, and then determine a target file corresponding to the to-be-extended indicator formula parameter;
[0030] The target indicator determination unit is configured to obtain a target file, and then update the indicator formula based on the target file and the indicator formula parameters to be extended, and determine the target indicator according to the updated indicator formula.
[0031] Optionally, the identification unit is further configured to:
[0032] In response to the symbol containing four arithmetic operation symbols and comparison symbols, when a logical judgment abnormality is detected based on the four arithmetic operation symbols and the comparison symbols, the four arithmetic operation symbols at the end of the indicator formula are directly deleted and the indicator formula is updated, and the return result data is obtained based on the updated indicator formula.
[0033] Optionally, the identification unit is further configured to:
[0034] In response to the symbol being a plus sign, character strings on both sides of the plus sign are concatenated to obtain return result data.
[0035] Optionally, the parameter determination unit is further configured to:
[0036] The returned result data is matched with each extensible indicator formula parameter in the extensible indicator formula parameter pool for similarity, and the matched extensible indicator formula parameters are determined as the indicator formula parameters to be expanded.
[0037] Optionally, the target file determination unit is further configured to:
[0038] Based on the parameters of the indicator formula to be expanded, determine the variables, functions, classes or rules required to parse the expanded indicator formula;
[0039] Determine the corresponding target file based on variables, functions, classes or rules.
[0040] Optionally, the target indicator determination unit is further configured to:
[0041] Expanding the indicator formula based on the indicator formula parameter to be expanded to obtain an expanded indicator formula;
[0042] Utilize the target file to parse the expanded indicator formula to obtain formula parsing data;
[0043] Parse data based on formulas, generate annotations, and add annotations to the expanded indicator formulas.
[0044] Optionally, the identification unit is further configured to:
[0045] Identify the four arithmetic operators and comparison symbols in indicator formulas.
[0046] In addition, the present application also provides an indicator processing electronic device, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the one or more processors implement the indicator processing method as described above.
[0047] In addition, the present application also provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the indicator processing method as described above is implemented.
[0048] To achieve the above objective, according to another aspect of the embodiments of the present application, a computer program product is provided.
[0049] A computer program product according to an embodiment of the present application includes a computer program, and when the program is executed by a processor, the indicator processing method provided by the embodiment of the present application is implemented.
[0050] One embodiment of the above invention has the following advantages or beneficial effects: the application receives an indicator processing request to obtain the corresponding indicator formula; calls a rule engine to identify the symbol in the indicator formula, and determines the return result data according to the symbol; determines the indicator formula parameters to be extended based on the return result data; determines the parameter acquisition type logic corresponding to the indicator formula parameters to be extended, executes the parameter acquisition type logic to obtain the indicator formula parameters to be extended, and then determines the target file corresponding to the indicator formula parameters to be extended; obtains the target file, and then updates the indicator formula based on the target file and the indicator formula parameters to be extended, and determines the target indicator according to the updated indicator formula. Improve the scalability of the code corresponding to the pricing-related indicators, reduce the indicator processing development and maintenance costs, and improve the efficiency and flexibility of indicator processing.
[0051] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The accompanying drawings are used to better understand the present application and do not constitute an improper limitation on the present application.
[0053] Figure 1 is a schematic diagram of the main process of an indicator processing method according to an embodiment of the present application;
[0054] Figure 2 is a schematic diagram of the main process of an indicator processing method according to an embodiment of the present application;
[0055] Figure 3 It is a schematic diagram of the main flow of an indicator processing method according to an embodiment of the present application;
[0056] Figure 4 is a schematic diagram of the main units of the indicator processing device according to an embodiment of the present application;
[0057] Figure 5 is an exemplary system architecture diagram to which the embodiments of the present application can be applied;
[0058] Figure 6 It is a structural diagram of a computer system of a terminal device or server suitable for implementing an embodiment of the present application. DETAILED DESCRIPTION
[0059] The following is a description of the exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, and they should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of known functions and structures is omitted in the following description. It should be noted that the acquisition, transmission, storage, use, and processing of data in the technical solution of the present application are in compliance with the relevant provisions of national laws and regulations. It should be noted that in the embodiments of the present application, certain software, components, models, and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or must have used the solution. In the technical solution of the present application, the collection, analysis, use, transmission, storage, and other aspects of the user's personal information involved are in compliance with the provisions of relevant laws and regulations, and are used for legal and reasonable purposes, and are not shared, leaked, or sold outside of these legal uses, and are subject to supervision and management by regulatory authorities. Take necessary measures to prevent illegal access to such personal information, ensure that persons with access to personal information comply with relevant laws and regulations, and ensure the security of personal information. Once such personal information is no longer needed, risks should be minimized by limiting or even prohibiting data collection and / or deleting data.
[0060] When used, including in certain related applications, user privacy is protected by de-identifying data, such as by removing specific identifiers when used, controlling the amount or specificity of data stored, controlling how data is stored, and / or other methods of de-identification.
[0061] Figure 1 is a schematic diagram of the main process of the indicator processing method according to an embodiment of the present application, such as Figure 1 As shown, the indicator processing method mainly includes the following steps S101 to S105.
[0062] Step S101, receiving an indicator processing request and obtaining a corresponding indicator formula.
[0063] In this embodiment, the execution entity of the indicator processing method (for example, it can be a server) can receive the indicator processing request through a wired connection or a wireless connection. The indicator can be a derivative indicator of the product pricing model, which is used for market-based pricing. After receiving the indicator processing request, the execution entity can obtain the indicator formula carried in the request. The indicator formula can be a formula obtained by performing four arithmetic operations on the parameters passed in by the request interface, the system supplementary recording parameters, the parameters obtained by the outbound external system interface, and the constant parameters. The embodiment of the present application does not specifically limit the types of parameters involved in the indicator formula.
[0064] Step S102, calling the rule engine to identify the symbols in the indicator formula, and determining the return result data according to the symbols.
[0065] Specifically, identifying symbols in the indicator formula includes: identifying four arithmetic operators and comparison symbols in the indicator formula.
[0066] In the four arithmetic operations, it refers to the four basic mathematical operations of addition, subtraction, multiplication and division. Comparison symbols refer to some symbols used in formulas to compare the size or equality of two values, such as equal to (==), not equal to (!=), less than (<), greater than (>), etc. These comparison symbols are used to compare the size or equality of two values, which helps conditional judgment and loop control in the calculation process of indicator formulas.
[0067] Specifically, the return result data is determined according to the symbol, including: in response to the symbol containing four arithmetic operation symbols and comparison symbols, when a logical judgment abnormality is detected based on the four arithmetic operation symbols and the comparison symbols, the four arithmetic operation symbols at the end of the indicator formula are directly deleted and the indicator formula is updated, and the return result data is obtained based on the updated indicator formula.
[0068] When a logical judgment anomaly is detected based on the four arithmetic operation symbols and the comparison symbols, the four arithmetic operation symbols at the end of the indicator formula (i.e., the end of the queue) can be deleted, and then the indicator formula can be updated to adjust the accuracy of the indicator formula, so as to quickly and accurately eliminate the anomaly and improve the accuracy of the indicator processing. Return result data is obtained based on the updated indicator formula, for example, the formula operation result data obtained based on the updated indicator formula (such as the union of parameters, the intersection of parameters, the product of parameters, or the ratio of parameters, etc.) can be used as the return result data.
[0069] Step S103, based on the returned result data, determine the parameters of the indicator formula to be expanded.
[0070] Specifically, based on the returned result data, the indicator formula parameters to be expanded are determined, including: performing similarity matching between the returned result data and each extensible indicator formula parameter in the extensible indicator formula parameter pool, and determining the matched extensible indicator formula parameters as the indicator formula parameters to be expanded.
[0071] After the four arithmetic operations, each parameter in the indicator formula can obtain a new parameter, and the returned result data can be the new parameter. After obtaining the returned result data, the execution subject can calculate the cosine similarity between the returned result data and each extensible indicator formula parameter in the extensible indicator formula parameter pool, and use the extensible indicator formula parameter corresponding to the cosine similarity greater than the preset threshold as the indicator formula parameter to be expanded. This improves the efficiency and accuracy of determining the indicator formula parameters to be expanded.
[0072] Step S104, determining the parameter acquisition type logic corresponding to the indicator formula parameters to be extended, executing the parameter acquisition type logic to acquire the indicator formula parameters to be extended, and then determining the target file corresponding to the indicator formula parameters to be extended.
[0073] The execution subject may determine the parameter acquisition type logic corresponding to the indicator formula parameters to be extended according to the user configuration data corresponding to the indicator processing request, and execute the logic to obtain the corresponding indicator formula parameters to be extended.
[0074] For example, the type of the indicator formula parameter to be expanded can be a parameter that has been used historically, or it can be a newly added parameter. The execution subject can determine the corresponding target file according to the type of the indicator formula parameter to be expanded. Among them, the target file may include a library file and a parent rule file. A library file is a type of file on a computer that provides users with some out-of-the-box variables, functions or classes. A rule set inherits from another rule set. This inheritance relationship can be regarded as the relationship between a parent rule file and a child rule file, where the parent rule file defines some basic rules, and the child rule file expands or specifies them based on these basic rules. Through the parent rule file, it is possible to customize and expand the parameters in the indicator formula according to specific needs while keeping the core logic of the indicator processing unchanged, thereby improving the efficiency and flexibility of indicator processing.
[0075] Step S105, obtaining the target file, and then updating the indicator formula based on the target file and the indicator formula parameters to be extended, and determining the target indicator according to the updated indicator formula.
[0076] The parameters of the indicator formula to be expanded are parsed through the target file to improve the accuracy of the updated indicator formula and the accuracy of the target indicator calculated by the updated indicator formula.
[0077] This embodiment receives an indicator processing request and obtains the corresponding indicator formula; calls a rule engine to identify symbols in the indicator formula and determines the return result data according to the symbols; determines the indicator formula parameters to be extended based on the return result data; determines the parameter acquisition type logic corresponding to the indicator formula parameters to be extended, executes the parameter acquisition type logic to obtain the indicator formula parameters to be extended, and then determines the target file corresponding to the indicator formula parameters to be extended; obtains the target file, and then updates the indicator formula based on the target file and the indicator formula parameters to be extended, and determines the target indicator according to the updated indicator formula. The scalability of the code corresponding to the pricing-related indicators is improved, the development and maintenance costs of indicator processing are reduced, and the efficiency and flexibility of indicator processing are improved.
[0078] Figure 2 is a schematic diagram of the main flow of an indicator processing method according to an embodiment of the present application, such as Figure 2 As shown, the indicator processing method mainly includes the following steps S201 to S207.
[0079] Step S201, receiving an indicator processing request and obtaining a corresponding indicator formula.
[0080] Step S202, calling the rule engine to identify the symbols in the indicator formula, and determining the return result data according to the symbols.
[0081] Specifically, determining the return result data according to the symbol includes: in response to the symbol being a plus sign, piecing together character strings on both sides of the plus sign to obtain the return result data.
[0082] If the symbol in the indicator formula is a plus sign, such as "+", and the symbol is not a numeric value, the string data on both sides of the symbol is directly returned as the return result data, thereby improving the speed and accuracy of indicator formula calculation.
[0083] Step S203, based on the returned result data, determine the parameters of the indicator formula to be expanded.
[0084] If the returned result data does not match any of the extensible indicator formula parameters in the extensible indicator formula parameter pool, that is, the similarities are all less than the preset threshold, the parameter generation model is called to generate corresponding indicator formula parameters to be expanded based on the returned result data, wherein the parameter generation model is used to characterize the correspondence between the input data and the indicator formula parameters, thereby improving the accuracy of determining the indicator formula parameters to be expanded.
[0085] Step S204, determining the parameter acquisition type logic corresponding to the indicator formula parameter to be expanded, and executing the parameter acquisition type logic to acquire the indicator formula parameter to be expanded.
[0086] Step S205, based on the parameters of the indicator formula to be expanded, determine the variables, functions, classes or rules required for parsing the expanded indicator formula.
[0087] Step S206, determining the corresponding target file based on the variable, function, class or rule.
[0088] If the calculation of the parsed extended indicator formula requires a variable, function or class, the corresponding target file is determined to be a library file. If the calculation of the parsed extended indicator formula requires a rule, the corresponding target file is determined to be a parent rule file. By determining the target file by parsing the type of data required by the extended indicator formula, the speed and accuracy of determining the target file can be improved.
[0089] Step S207, obtaining the target file, and then updating the indicator formula based on the target file and the indicator formula parameters to be extended, and determining the target indicator according to the updated indicator formula.
[0090] The embodiments of the present application can improve the scalability of the codes corresponding to pricing-related indicators, reduce the development and maintenance costs of indicator processing, and improve the efficiency and flexibility of indicator processing.
[0091] Figure 3 is a schematic diagram of the main flow of an indicator processing method according to an embodiment of the present application, such as Figure 3As shown, the indicator processing method mainly includes the following steps S301 to S308.
[0092] Step S301, receiving an indicator processing request and obtaining a corresponding indicator formula.
[0093] This indicator can be a derivative indicator of the product pricing model, used for market-based pricing. The indicator formula can be obtained by combining parameters with four arithmetic operations.
[0094] Step S302, calling the rule engine to identify the symbols in the indicator formula, and determining the return result data according to the symbols.
[0095] The execution subject can call the rule engine to exclude text, pictures and other data in the indicator formula, and obtain the symbols in the indicator formula, so as to improve the efficiency and accuracy of identifying the symbols in the indicator formula. The indicator formula is updated by the symbols in the identified indicator formula, and the return result data corresponding to the latest indicator formula is obtained. The return result data can be a combination of parameters.
[0096] Step S303, based on the returned result data, determine the parameters of the indicator formula to be expanded.
[0097] Step S304, determining the parameter acquisition type logic corresponding to the indicator formula parameters to be extended, executing the parameter acquisition type logic to acquire the indicator formula parameters to be extended, and then determining the target file corresponding to the indicator formula parameters to be extended.
[0098] Step S305, obtaining the target file, and expanding the indicator formula based on the indicator formula parameters to be expanded to obtain the expanded indicator formula.
[0099] The execution subject can determine the position identifier carried by the parameter of the indicator formula to be expanded, and insert the parameter of the indicator formula to be expanded into the corresponding position of the indicator formula according to the position identifier to obtain the expanded indicator formula, thereby accurately obtaining the expanded indicator formula.
[0100] Step S306, using the target file to parse the expanded indicator formula to obtain formula parsing data.
[0101] The target file can be the data required for parsing the extended indicator formula. By using the target file to parse the extended indicator formula, the formula parsing data can be accurately obtained for the convenience of subsequent personnel to use, so as to accurately parse the extended indicator formula, reduce the difficulty and cost of indicator processing development and maintenance, and improve the accuracy of indicator processing.
[0102] Step S307, parsing the data based on the formula, generating annotations, and adding annotations to the expanded indicator formula.
[0103] By adding the annotations generated by formula parsing data to the extended indicator formula, it can be more convenient for users to use, thereby improving the indicator processing efficiency and development and dimension difficulty. After adding annotations to the extended indicator formula, the indicator formula is updated to obtain the updated indicator formula, that is, the updated indicator formula carries the annotations.
[0104] Step S308, determining the target indicator according to the updated indicator formula.
[0105] The execution subject can execute the calculation logic according to the annotations carried by the updated indicator formula to obtain the calculation result data, i.e., the target indicator, thereby improving the efficiency and accuracy of determining the target indicator.
[0106] In the embodiment of the present application, in order to meet the needs of product innovation and price management under the conditions of interest rate marketization, realize rapid response to the market, high scalability and flexibility of interest rate pricing, and improve IT's support for price realization, when realizing the processing and calculation of derivative indicators of the product pricing model, the configuration calculation of pricing derivative indicators is quickly realized based on the rule engine, which can better support the rapid innovation of products and improve the market response speed. The derivative indicators of the product pricing model are obtained by performing four arithmetic operations based on the parameters passed in by the pricing model request interface, the system supplementary parameters, the parameters obtained by the external system interface for outbound calls, and the constant parameters. Combined with the product advantages of the rule engine, it can flexibly support business expansion and support the parameter acquisition type logic of indicator formulas that cannot be identified at this stage; by reducing the complexity of components that implement complex business logic, it reduces the maintenance and scalability costs of applications, effectively improves the maintainability of complex logic codes, and meets the agile development of indicator formula configuration calculations; operation and maintenance deployment optimization supports the repair of code defects during development or after deployment. For pricing, the main indicator configuration is based on the four arithmetic operations. In terms of code integration, mathematical expressions for parsing are integrated. In terms of specific code implementation, the four arithmetic operations and the preceding comparison symbols are judged and processed. If the symbols contained in the indicator formula are four arithmetic operations and comparison symbols, in abnormal cases, the four arithmetic operators at the end of the queue are directly removed to ensure the accuracy of the indicator formula. If the symbol contained in the indicator formula is a plus sign and is not a numeric value, the result data of two strings is directly returned. In terms of dynamic expansion, combined with the configuration content of the rule engine, the rules and execution library files are defined and configured. The rules of the rule engine can be used to flexibly expand the indicator formula parameters that cannot be recognized at this stage, and the library files and parent rule files can be flexibly and dynamically introduced. For example, when configuring, you can configure rules, types, predefined values, and you can configure the output of debugging information, operation mode, default mode, sequential mode, introduction of library files, and introduction of parent files. Among them, when configuring rules, you can configure the conditions of the rules and whether to loop, etc. When obtaining the parameters of the indicator formula that cannot be identified at this stage, obtain the file to be executed, the currently executed rule, the currently executed file ID (that is, the currently executed file identifier), the currently executed rule prefix name, the return object information, and the expected value, and then execute the judgment process to obtain the filtered field content data that can be output, determine the corresponding type of the field content data to determine the debugging mode information, and then pre-compile the content and store it in the cache of the service class to determine whether to enable logging. If so, provide a log query function for users to perform log queries related to indicator processing.
[0107] The rule engine separates business rules from application logic to reduce operation and maintenance costs. During the troubleshooting process, the business correlation is lower, the reliance on business background knowledge is less, and the code is more versatile and maintainable, which makes it easier for developers to follow up and troubleshoot problems. Technology does not need to worry about business changes, making it more flexible and controllable. By leveraging the flexibility and variability of rules, it is easier to expand the parameter acquisition type logic that supports indicator formulas that are not currently recognized, thereby improving agile R&D efficiency. The introduction of the rule engine effectively improves the maintainability of complex logic code, supports fixing code defects during development or after deployment, and flexibly and dynamically introduces library files and parent rule files to improve development convenience and reduce development costs.
[0108] Figure 4 Schematic diagram of the main units of the indicator processing device according to the embodiment of the present application. Figure 4 As shown, the indicator processing device 400 includes a receiving unit 401, an identification unit 402, a parameter determination unit 403, a target file determination unit 404 and a target indicator determination unit 405.
[0109] The receiving unit 401 is configured to receive an indicator processing request and obtain a corresponding indicator formula.
[0110] The identification unit 402 is configured to call the rule engine to identify the symbols in the indicator formula and determine the return result data according to the symbols.
[0111] The parameter determination unit 403 is configured to determine the parameters of the indicator formula to be expanded based on the returned result data.
[0112] The target file determination unit 404 is configured to determine the parameter acquisition type logic corresponding to the indicator formula parameters to be extended, execute the parameter acquisition type logic to obtain the indicator formula parameters to be extended, and then determine the target file corresponding to the indicator formula parameters to be extended.
[0113] The target indicator determination unit 405 is configured to obtain a target file, and then update the indicator formula based on the target file and the indicator formula parameters to be extended, and determine the target indicator according to the updated indicator formula.
[0114] In some embodiments, the identification unit 402 is further configured to: in response to a symbol containing four arithmetic operations and comparison symbols, when a logical judgment anomaly is detected based on the four arithmetic operations and the comparison symbols, directly delete the four arithmetic operations at the end of the indicator formula and update the indicator formula, and obtain the return result data based on the updated indicator formula.
[0115] In some embodiments, the recognition unit 402 is further configured to: in response to the symbol being a plus sign, piece together the character strings on both sides of the plus sign to obtain the returned result data.
[0116] In some embodiments, the parameter determination unit 403 is further configured to: perform similarity matching between the returned result data and each extensible indicator formula parameter in the extensible indicator formula parameter pool, and determine the matched extensible indicator formula parameters as the indicator formula parameters to be expanded.
[0117] In some embodiments, the target file determination unit 404 is further configured to: determine the variables, functions, classes or rules required to parse the expanded indicator formula based on the parameters of the indicator formula to be expanded; and determine the corresponding target file based on the variables, functions, classes or rules.
[0118] In some embodiments, the target indicator determination unit 404 is further configured to: expand the indicator formula based on the indicator formula parameters to be expanded to obtain the expanded indicator formula; parse the expanded indicator formula using the target file to obtain formula parsing data; generate annotations based on the formula parsing data, and add annotations to the expanded indicator formula.
[0119] In some embodiments, the recognition unit 402 is further configured to: recognize four arithmetic operators and comparison symbols in the indicator formula.
[0120] It should be noted that the indicator processing method and the indicator processing device of the present application have a corresponding relationship in terms of specific implementation contents, so the repeated contents will not be described again.
[0121] Figure 5 An exemplary system architecture 500 to which the indicator processing method or indicator processing device according to the embodiment of the present application can be applied is shown.
[0122] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505. Network 504 is used to provide a medium for communication links between terminal devices 501, 502, 503 and server 505. Network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0123] Users can use terminal devices 501, 502, 503 to interact with server 505 through network 504 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 501, 502, 503, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0124] The terminal devices 501, 502, 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0125] Server 505 can be a server that provides various services, such as a background management server that provides support for the indicator processing request submitted by the user using the terminal devices 501, 502, and 503 (only as an example). The background management server can receive the indicator processing request and obtain the corresponding indicator formula; call the rule engine to identify the symbol in the indicator formula, and determine the return result data according to the symbol; determine the indicator formula parameters to be extended based on the return result data; determine the parameter acquisition type logic corresponding to the indicator formula parameters to be extended, execute the parameter acquisition type logic to obtain the indicator formula parameters to be extended, and then determine the target file corresponding to the indicator formula parameters to be extended; obtain the target file, and then update the indicator formula based on the target file and the indicator formula parameters to be extended, and determine the target indicator according to the updated indicator formula. Improve the scalability of the code corresponding to the pricing-related indicators, reduce the development and maintenance costs of indicator processing, and improve the efficiency and flexibility of indicator processing.
[0126] It should be noted that the indicator processing method provided in the embodiment of the present application is generally executed by the server 505 , and accordingly, the indicator processing device is generally set in the server 505 .
[0127] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0128] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 of a terminal device suitable for implementing an embodiment of the present application. Figure 6 The terminal device 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.
[0129] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the computer system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0130] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
[0131] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present application are executed.
[0132] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. Computer-readable storage media may include, for example, but are not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer 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 of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0133] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0134] The units involved in the embodiments described in the present application may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes a receiving unit, an identification unit, a parameter determination unit, a target file determination unit, and a target indicator determination unit. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0135] As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device receives an indicator processing request and obtains a corresponding indicator formula; calls a rule engine to identify symbols in the indicator formula, and determines the return result data according to the symbols; based on the return result data, determines the indicator formula parameters to be extended; determines the parameter acquisition type logic corresponding to the indicator formula parameters to be extended, executes the parameter acquisition type logic to obtain the indicator formula parameters to be extended, and then determines the target file corresponding to the indicator formula parameters to be extended; obtains the target file, and then updates the indicator formula based on the target file and the indicator formula parameters to be extended, and determines the target indicator according to the updated indicator formula.
[0136] The computer program product of the present application includes a computer program, and when the computer program is executed by a processor, the indicator processing method in the embodiment of the present application is implemented.
[0137] According to the technical solution of the embodiment of the present application, the scalability of the code corresponding to the pricing-related indicators can be improved, the development and maintenance costs of indicator processing can be reduced, and the efficiency and flexibility of indicator processing can be improved.
[0138] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. An indicator processing method, characterized in that: include: Receive indicator processing requests and obtain corresponding indicator formulas; Calling a rule engine to identify symbols in the indicator formula and determining return result data according to the symbols; Based on the returned result data, determine the parameters of the indicator formula to be expanded; Determine the parameter acquisition type logic corresponding to the to-be-extended indicator formula parameter, execute the parameter acquisition type logic to acquire the to-be-extended indicator formula parameter, and then determine the target file corresponding to the to-be-extended indicator formula parameter; The target file is obtained, and then the indicator formula is updated based on the target file and the indicator formula parameters to be extended, and the target indicator is determined according to the updated indicator formula.
2. The method according to claim 1, characterized in that The step of determining the returned result data according to the symbol comprises: In response to the symbol containing four arithmetic operation symbols and comparison symbols, when a logical judgment abnormality is detected based on the four arithmetic operation symbols and the comparison symbols, the four arithmetic operation symbols at the end of the indicator formula are directly deleted and the indicator formula is updated, and the return result data is obtained based on the updated indicator formula.
3. The method according to claim 1, characterized in that The step of determining the returned result data according to the symbol comprises: In response to the symbol being a plus sign, character strings on both sides of the plus sign are pieced together to obtain return result data.
4. The method according to claim 1, characterized in that The step of determining the indicator formula parameters to be expanded based on the returned result data includes: The returned result data is matched with each extensible indicator formula parameter in the extensible indicator formula parameter pool for similarity, and the matched extensible indicator formula parameters are determined as the indicator formula parameters to be expanded.
5. The method according to claim 1, characterized in that The step of determining the target file corresponding to the parameter of the indicator formula to be expanded includes: Based on the parameters of the indicator formula to be expanded, determining the variables, functions, classes or rules required to parse the expanded indicator formula; Based on the variable, function, class or rule, a corresponding target file is determined.
6. The method according to claim 1, characterized in that The updating of the indicator formula based on the target file and the indicator formula parameter to be extended includes: Expanding the indicator formula based on the indicator formula parameters to be expanded to obtain an expanded indicator formula; Parsing the expanded indicator formula using the target file to obtain formula parsing data; Parsing data based on the formula, generating annotations, and adding the annotations to the expanded indicator formula.
7. The method according to claim 1, characterized in that The identifying of symbols in the indicator formula includes: Identify the four arithmetic operators and comparison symbols in the indicator formula.
8. An indicator processing device, characterized in that: include: A receiving unit is configured to receive an indicator processing request and obtain a corresponding indicator formula; an identification unit configured to call a rule engine to identify symbols in the indicator formula and determine return result data according to the symbols; A parameter determination unit, configured to determine the parameters of the indicator formula to be expanded based on the returned result data; A target file determination unit is configured to determine a parameter acquisition type logic corresponding to the to-be-extended indicator formula parameter, execute the parameter acquisition type logic to acquire the to-be-extended indicator formula parameter, and further determine a target file corresponding to the to-be-extended indicator formula parameter; The target indicator determination unit is configured to obtain the target file, update the indicator formula based on the target file and the indicator formula parameters to be extended, and determine the target indicator according to the updated indicator formula.
9. The device according to claim 8, characterized in that The identification unit is further configured to: In response to the symbol containing four arithmetic operation symbols and comparison symbols, when a logical judgment abnormality is detected based on the four arithmetic operation symbols and the comparison symbols, the four arithmetic operation symbols at the end of the indicator formula are directly deleted and the indicator formula is updated, and the return result data is obtained based on the updated indicator formula.
10. The device according to claim 8, characterized in that The identification unit is further configured to: In response to the symbol being a plus sign, character strings on both sides of the plus sign are pieced together to obtain return result data.
11. The device according to claim 8, characterized in that The parameter determination unit is further configured to: The returned result data is matched with each extensible indicator formula parameter in the extensible indicator formula parameter pool for similarity, and the matched extensible indicator formula parameters are determined as the indicator formula parameters to be expanded.
12. The device according to claim 8, characterized in that The target file determination unit is further configured to: Based on the parameters of the indicator formula to be expanded, determining the variables, functions, classes or rules required to parse the expanded indicator formula; Based on the variable, function, class or rule, a corresponding target file is determined.
13. The device according to claim 8, characterized in that The target indicator determination unit is further configured to: Expanding the indicator formula based on the indicator formula parameters to be expanded to obtain an expanded indicator formula; Parsing the expanded indicator formula using the target file to obtain formula parsing data; Parsing data based on the formula, generating annotations, and adding the annotations to the expanded indicator formula.
14. An electronic device for index processing, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
15. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.