Resource configuration method and device, computer device and storage medium
Patent Information
- Application Number
- CN202311557904.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-21
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2043-11-21
AI Technical Summary
该方式对于全行众多业务线的场景对接不满足便捷性,而且在此过程中也可能因为人工操作失误导致生产问题,因此相关技术中存在着对决策引擎进行配置时可靠性低的问题
[0036]上述资源配置方法、装置、计算机设备、存储介质和计算机程序产品,通过响应于满足导入针对目标决策引擎的配置资源的触发条件,针对配置资源进行资源导入条件验证;在验证配置资源满足资源导入条件的情况下,解析配置资源的资源类型;调用与资源类型匹配的导入功能模块接口,将配置资源导入目标决策引擎的数据库中;数据库中的配置资源用于配置目标决策引擎的接入服务的规则策略。如此,在验证针对目标决策引擎的配置资源满足资源导入条件后,便可以调用与配置资源的资源类型匹配的导入功能模块接口,高可靠地自动将配置资源导入目标决策引擎的数据库中,以配置目标决策引擎的接入服务的规则策略,实现将满足导入条件的配置资源发送至引擎生产环境并生效。从而,改善了决策场景科技参数由业务代理配置的现状、减少业务配置负担、提升接入应用对于决策场景管控的主导地位。不仅让业务人员从大量、重复的规则配置、策略配置中解放出来,而且也提高了规则策略导入的正确性和可靠性。同时,规则策略的全自动化流程,保证了数据来源的正确性以及合法性,因此,上述资源配置方法、装置、计算机设备、存储介质和计算机程序产品,有效提高了对决策引擎进行配置时的可靠性。
Smart Images

Figure CN117453661B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data technology, and in particular to a resource allocation method, apparatus, computer equipment, storage medium, and computer program product. Background Technology
[0002] With the advancement of artificial intelligence technology, a new generation of intelligent decision-making engines is gradually being widely applied. These engines utilize AI technologies such as deep learning, natural language processing, and image recognition to process and analyze large-scale data, providing real-time intelligent decision-making and recommendation services.
[0003] The intelligent decision engine mainly consists of two parts: the engine management end and the runtime end. The maintenance functions of various engine configurations are primarily provided by the engine management end, i.e., the strategy center. The technology configuration is a non-business configuration used to assist the business model in the normal operation of the intelligent decision engine, for example, to access services.
[0004] When the intelligent decision engine is first integrated into a scenario, resource configuration needs to be manually imported and applied by business personnel. This method is not convenient for scenario integration across numerous business lines across the bank, and human error may cause production problems during the process. Therefore, the relevant technology suffers from low reliability when configuring the decision engine. Summary of the Invention
[0005] Therefore, it is necessary to provide a resource allocation method, apparatus, computer device, computer-readable storage medium, and computer program product that can improve the reliability of configuring a decision engine, in order to address the above-mentioned technical problems.
[0006] Firstly, this application provides a resource allocation method, including:
[0007] In response to the fulfillment of the triggering condition for importing configuration resources for the target decision engine, resource import condition verification is performed on the configuration resources;
[0008] If the configuration resource meets the resource import conditions, the resource type of the configuration resource is parsed.
[0009] The import function module interface matching the resource type is invoked to import the configuration resource into the database of the target decision engine; the configuration resource in the database is used to configure the rule policy of the access service of the target decision engine.
[0010] In one embodiment, when the resource type is a binary spreadsheet resource, the step of calling the import function module interface matching the resource type to import the configuration resource into the database of the target decision engine includes:
[0011] The resource fields of the configured resources are concatenated to generate database operation statements;
[0012] Execute the database operation corresponding to the database operation statement to import the configuration resources into the database of the target decision engine.
[0013] In one embodiment, executing the database operation corresponding to the database operation statement to import the configuration resources into the database of the target decision engine includes:
[0014] Obtain all service names corresponding to the access service of the target decision engine to obtain a service name set;
[0015] Each of the database operation statements is compared with the service name set, and the database operation corresponding to the unmatched database operation statement is executed to import the configuration resource into the database of the target decision engine; the service name in the unmatched database operation statement has not appeared in the service name set.
[0016] In one embodiment, comparing each of the database operation statements with the service name set and executing the database operation corresponding to the unmatched database operation statement includes:
[0017] If the service name in the currently compared database operation statement appears in the service name set, then skip the currently compared database operation statement and compare the service name in the next database operation statement with the service name set.
[0018] If the service name in the currently compared database operation statement does not appear in the service name set, then the database operation corresponding to the currently compared database operation statement is executed until the currently compared database operation statement is the last database operation statement.
[0019] In one embodiment, concatenating the resource fields of the configuration resources to generate database operation statements includes:
[0020] Obtain all system field names for the target decision engine; each system field name corresponds to field rule information.
[0021] Based on the field rule information corresponding to each system field name, the validity of the resource fields of the configuration resource is verified to obtain the valid resource fields of the configuration resource;
[0022] The valid resource fields are concatenated to generate the database operation statement.
[0023] In one embodiment, the step of verifying the resource import conditions for the configuration resources in response to satisfying the triggering condition for importing configuration resources for the target decision engine includes:
[0024] Obtain resource path information for the target decision engine; if it is verified that there is a configuration resource corresponding to the resource path information, obtain the configuration resource corresponding to the resource path information.
[0025] Verify the read requirements of the configuration resource. If the configuration resource meets the read requirements, determine that the configuration resource satisfies the resource import conditions.
[0026] In one embodiment, the method further includes:
[0027] If the configuration resource import fails, an import failure message will be generated based on the reason for the import failure.
[0028] The import failure message is displayed on the terminal.
[0029] Secondly, this application also provides a resource allocation device, comprising:
[0030] The verification module is used to verify the resource import conditions for the configuration resources in response to the triggering conditions for importing configuration resources for the target decision engine.
[0031] The parsing module is used to parse the resource type of the configuration resource after verifying that the configuration resource meets the resource import conditions;
[0032] The import module is used to call the import function module interface that matches the resource type to import the configuration resource into the database of the target decision engine; the configuration resource in the database is used to configure the rules and policies of the access service of the target decision engine.
[0033] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program that, when executed by the processor, implements the steps of the method described above.
[0034] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the above-described method.
[0035] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the above-described method.
[0036] The aforementioned resource configuration method, apparatus, computer equipment, storage medium, and computer program product, in response to the triggering conditions for importing configuration resources for the target decision engine, verify the resource import conditions for the configuration resources; if the configuration resources meet the resource import conditions, parse the resource type of the configuration resources; call the import function module interface matching the resource type to import the configuration resources into the database of the target decision engine; the configuration resources in the database are used to configure the rules and policies of the target decision engine's access services. Thus, after verifying that the configuration resources for the target decision engine meet the resource import conditions, the import function module interface matching the resource type can be called to reliably and automatically import the configuration resources into the database of the target decision engine to configure the rules and policies of the target decision engine's access services, thereby enabling the configuration resources that meet the import conditions to be sent to the engine's production environment and take effect. This improves the current situation where decision-making scenario technical parameters are configured by business agents, reduces the business configuration burden, and enhances the dominant position of access applications in the management of decision-making scenarios. It not only frees business personnel from a large amount of repetitive rule and policy configuration but also improves the correctness and reliability of rule and policy import. Meanwhile, the fully automated process of the rules and strategies ensures the correctness and legality of the data sources. Therefore, the above-mentioned resource allocation methods, devices, computer equipment, storage media and computer program products effectively improve the reliability of configuring the decision engine. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 This is a flowchart illustrating a resource allocation method in one embodiment;
[0039] Figure 2 This is a flowchart illustrating a resource allocation method in another embodiment;
[0040] Figure 3 This is a schematic diagram of a process for importing a configuration file in one embodiment;
[0041] Figure 4 This is a flowchart illustrating the process of converting a configuration file stream into database operation statements in one embodiment.
[0042] Figure 5 This is a flowchart illustrating another resource configuration method in one embodiment;
[0043] Figure 6 This is a structural block diagram of a resource allocation device in one embodiment;
[0044] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0046] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0047] In one embodiment, such as Figure 1 As shown, a resource allocation method is provided. This embodiment illustrates the application of this method to a terminal. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and IoT devices. The server can be a standalone server or a server cluster composed of multiple servers. In this embodiment, the method includes the following steps:
[0048] Step S110: In response to the fulfillment of the triggering condition for importing configuration resources for the target decision engine, perform resource import condition verification for the configuration resources.
[0049] In one application scenario, the target decision engine can be configured with rules and strategies when it is first connected to a certain scenario.
[0050] The target decision engine is the decision engine for configuring rules and strategies. In practical applications, the decision engine can be the TianCe engine.
[0051] The configuration resource refers to the resource to be imported into the target decision engine, used for configuring rules and strategies for the target decision engine. In practical applications, the configuration resource can be a file resource, that is, a configuration file used to configure rules and strategies for the target decision engine.
[0052] The resource import conditions are used to determine whether there are any import exceptions. Import exceptions may include, but are not limited to, exceptions such as the configuration resource not existing, the configuration resource type being incorrect, or the configuration resource size exceeding the limit.
[0053] In practice, users can perform the import operation of configuration resources for the target decision engine on the terminal to meet the triggering conditions for importing configuration resources for the target decision engine. The terminal can then respond to the above triggering conditions to verify the resource import conditions and determine whether there are any import anomalies.
[0054] In practical applications, users can input the resource path information of the configuration resources of the target decision engine to be imported into the terminal as a trigger condition for importing the configuration resources of the target decision engine, and the terminal can respond to the above trigger condition.
[0055] Step S120: If the configuration resources meet the resource import conditions, parse the resource type of the configuration resources.
[0056] The resource type of a configuration resource can be determined based on its format. For example, if the configuration resource is a configuration file, it can be categorized into different resource types according to its file format.
[0057] In practice, the terminal can parse the format of the configuration resource and obtain the resource type to which the configuration resource belongs, provided that the configuration resource meets the resource import conditions, i.e., there are no import exceptions.
[0058] Step S130: Call the import function module interface that matches the resource type to import the configuration resource into the database of the target decision engine.
[0059] The configuration resources in the database are used to configure the rules and strategies for accessing the target decision engine's services.
[0060] Among them, the import function module interface can be a function interface.
[0061] In practice, the terminal can call the import function module interface that matches the resource type to import the configuration resources into the target decision engine's database. The configuration resources in the database are used to configure the rules and strategies for the target decision engine's access services.
[0062] In the above resource configuration method, in response to the triggering condition of importing configuration resources for the target decision engine, the resource import condition is verified for the configuration resources. If the configuration resources meet the import condition, the resource type is parsed; the import function module interface matching the resource type is called to import the configuration resources into the target decision engine's database; the configuration resources in the database are used to configure the rules and policies of the target decision engine's access services. Thus, after verifying that the configuration resources for the target decision engine meet the import condition, the import function module interface matching the resource type can be called to reliably and automatically import the configuration resources into the target decision engine's database to configure the rules and policies of the target decision engine's access services, enabling the configuration resources that meet the import condition to be sent to the engine's production environment and take effect. This improves the current situation where decision scenario technical parameters are configured by business agents, reduces the business configuration burden, and enhances the dominant position of access applications in the management of decision scenarios. It not only frees business personnel from a large amount of repetitive rule and policy configuration but also improves the correctness and reliability of rule and policy import. Meanwhile, the fully automated process of the rules and strategies ensures the correctness and legality of the data sources. Therefore, the above-mentioned resource allocation methods, devices, computer equipment, storage media and computer program products effectively improve the reliability of configuring the decision engine.
[0063] In one embodiment, when the resource type is a binary spreadsheet resource, the import function module interface matching the resource type is invoked to import the configuration resource into the database of the target decision engine. This includes: concatenating the resource fields of the configuration resource to generate a database operation statement; and executing the database operation corresponding to the database operation statement to import the configuration resource into the database of the target decision engine.
[0064] Taking configuration resources as an example, when the parsed configuration file is in .xls (a binary spreadsheet file format), the corresponding resource type is a binary spreadsheet resource.
[0065] The database operation statements can be SQL (Structured Query Language) statements.
[0066] In practical implementation, when the resource type is a binary spreadsheet, during the process of importing the configuration resource into the target decision engine's database by calling the import function module interface matching the resource type, the terminal can generate database operation statements based on the resource content of the configuration resource. Specifically, the terminal can concatenate the resource fields of the configuration resource to generate database operation statements. Then, the terminal can execute the database operations corresponding to the database operation statements to import the configuration resource into the target decision engine's database. Thus, when the resource type is a binary spreadsheet, by concatenating the resource fields of the configuration resource to generate database operation statements and executing the corresponding database operations, the configuration resource of the binary spreadsheet resource can be imported efficiently and accurately.
[0067] In some embodiments, during the process of executing database operations corresponding to database operation statements to import configuration resources into the database of the target decision engine, the terminal can obtain all service names corresponding to the access services of the target decision engine, thus obtaining a service name set. Specifically, the terminal can obtain all service names from the database of the target decision engine. In this way, the terminal can execute database operations corresponding to database operation statements based on the service name set to import configuration resources into the database of the target decision engine.
[0068] To facilitate understanding by those skilled in the art, an example is provided using a configuration file in .xls format. The terminal first obtains the contents of the .xls configuration file, concatenates the file fields, and generates an SQL statement string. This SQL statement string represents the SQL statement as a string. After successful generation, the terminal parses the SQL statement string, queries and retrieves all service names from the database, obtains a set of service names, and then executes the database operations corresponding to the SQL statement based on this set of service names to import the .xls configuration file into the target decision engine's database.
[0069] In one embodiment, based on the service name set, database operations corresponding to database operation statements are executed to import configuration resources into the database of the target decision engine. This includes: comparing each database operation statement with the service name set, and executing the database operations corresponding to the unmatched database operation statements to import configuration resources into the database of the target decision engine; the service names in the unmatched database operation statements have not appeared in the service name set.
[0070] In the specific implementation, after the terminal obtains all service names corresponding to the access service of the target decision engine and obtains the service name set, the terminal executes the database operation corresponding to the database operation statement according to the service name set to import the configuration resources into the database of the target decision engine. In order to verify the uniqueness of the service name of the access service, the terminal can compare each database operation statement with the service name set. The database operation statement whose service name does not appear in the service name set is regarded as an unmatched database operation statement. By executing the database operation corresponding to the unmatched database operation statement, the configuration resources are imported into the database of the target decision engine.
[0071] Furthermore, the terminal can use regular expression matching to compare the service names in each database operation statement with the set of service names to determine the database operation statements that do not match.
[0072] The technical solution of this embodiment obtains a service name set by acquiring all service names corresponding to the access services of the target decision engine; compares each database operation statement with the service name set, and executes the database operations corresponding to the unmatched database operation statements to import configuration resources into the database of the target decision engine to obtain the unmatched database operation statements; wherein, the service names in the unmatched database operation statements have not appeared in the service name set. In this way, by comparing each database operation statement with the service name set, obtaining the unmatched database operation statements whose service names have not appeared in the service name set, and executing the database operations corresponding to the unmatched database operation statements, the uniqueness of the service names of the access services is accurately verified, avoiding conflicting and confusing operations, and ensuring that the decision engine can correctly identify and process different services.
[0073] In one embodiment, each database operation statement is compared with a set of service names, and the database operation corresponding to the unmatched database operation statement is executed. This includes: if the service name in the currently compared database operation statement appears in the set of service names, the currently compared database operation statement is skipped, and the service name in the next database operation statement of the currently compared database operation statement is compared with the set of service names; if the service name in the currently compared database operation statement does not appear in the set of service names, the database operation corresponding to the currently compared database operation statement is executed, until the currently compared database operation statement is the last database operation statement.
[0074] In the specific implementation, when the terminal compares the service names in each database operation statement with the service name set through regular expression matching to determine the unmatched database operation statement, if the service name in the currently compared database operation statement appears in the service name set, then the currently compared database operation statement is skipped, and the next database operation statement is taken as the current comparison database operation statement, and its service name is compared with the service name set.
[0075] If the service name in the currently compared database operation statement does not appear in the service name set, the database operation corresponding to the currently compared database operation statement is executed until the currently compared database operation statement is the last database operation statement. That is, if the service name in the currently compared database operation statement does not appear in the service name set, the currently compared database operation statement can be considered an unmatched database operation statement, and the terminal can execute the database operation corresponding to the currently compared database operation statement.
[0076] For example, continuing from the previous example, the terminal compares the service names in each database operation statement with the service name set, and executes the database operation corresponding to the unmatched database operation statement. During this process, the terminal will uniquely compare the service name in the SQL statement with the service name in the service name set. If the service name in the currently compared SQL statement exists in the service name set, the SQL statement is skipped; otherwise, the SQL statement is executed until the last SQL statement is compared.
[0077] The technical solution of this embodiment involves skipping the current database operation statement if the service name in the currently compared database operation statement appears in the service name set, and comparing the service name in the next database operation statement with the service name set; if the service name in the currently compared database operation statement does not appear in the service name set, the database operation corresponding to the currently compared database operation statement is executed, until the currently compared database operation statement is the last database operation statement. In this way, through regular expression matching, database operation statements that fail to match the service name with the service name set can be quickly and accurately identified, ensuring the uniqueness of the service names of the services accessed by the decision engine.
[0078] In one embodiment, the resource fields of the configuration resource are concatenated to generate a database operation statement, including: obtaining all system field names for the target decision engine; each system field name corresponds to field rule information; verifying the legality of the resource fields of the configuration resource based on the field rule information corresponding to each system field name to obtain the legal resource fields of the configuration resource; concatenating the legal resource fields to generate the database operation statement.
[0079] Among them, the system field name is the target decision engine system field name.
[0080] In the specific implementation, during the process of concatenating the resource fields of the configuration resources to generate database operation statements, the terminal can obtain all system field names for the target decision engine; each system field name corresponds to field rule information. The terminal can verify the validity of the resource fields of the configuration resources based on the field rule information corresponding to each system field name, and obtain the valid resource fields of the configuration resources; by concatenating the valid resource fields, the database operation statements are generated.
[0081] In some embodiments, taking a configuration resource as an .xls file as an example, each line in the .xls file undergoes validity verification. The terminal can use the field rule information corresponding to the system field names to determine the validity of the title name and whether the input and output parameters conform to the system's defined style, thereby obtaining the valid file fields in the .xls file.
[0082] The technical solution of this embodiment obtains all system field names for the target decision engine; each system field name corresponds to field rule information; based on the field rule information corresponding to each system field name, the legality of the resource fields of the configuration resources is verified to obtain the legal resource fields of the configuration resources; the resource fields of the method are concatenated to generate database operation statements. Thus, through the field rule information corresponding to the system field names of the target decision engine, the legal resource fields of the configuration resources are obtained, and database operation statements are generated based on the legal resource fields. Therefore, it can be ensured that the input resource fields conform to the specifications and requirements defined by the target decision engine system. By validating the system fields, the correctness, completeness, and validity of the input resource fields can be verified, thereby ensuring that the target decision engine can correctly process and use these resource fields.
[0083] In one embodiment, in response to the triggering condition of importing configuration resources for the target decision engine, resource import condition verification is performed on the configuration resources, including: obtaining resource path information for the target decision engine; if the configuration resources corresponding to the resource path information are verified to exist, obtaining the configuration resources corresponding to the resource path information; verifying the reading requirements of the configuration resources; if the configuration resources meet the reading requirements, determining that the configuration resources meet the resource import conditions.
[0084] The resource path information may include the absolute path information of the configuration resources to be imported into the target decision engine.
[0085] The reading requirements may include resource type requirements and resource size requirements.
[0086] In specific implementation, when the terminal responds to the trigger condition of importing configuration resources for the target decision engine, and verifies the resource import conditions for the configuration resources, the terminal can obtain the resource path information for the target decision engine. It then verifies whether a corresponding configuration resource exists for this resource path. If a configuration resource corresponding to the resource path exists, the terminal can obtain that configuration resource as the configuration resource to be imported into the target decision engine. Next, the terminal can verify the read requirements of the configuration resource. If the configuration resource meets the read requirements, it is determined that the configuration resource meets the resource import conditions. That is, if a configuration resource corresponding to the resource path exists and meets the read requirements, the configuration resource is determined to meet the resource import conditions.
[0087] In this process, when verifying the read requirements of configuration resources, and determining whether the configuration resources meet the resource import conditions if they do, the terminal determines that the configuration resources meet both the size and type requirements. In some embodiments, the terminal can determine the size of the configuration resources and compare it with the required size. If the size meets the requirement, the terminal parses the resource type and determines whether it meets the type requirement. It is understandable that the terminal can first determine whether the resource type meets the type requirement, and only if that's the case, then determine whether the size meets the size requirement. The specific execution order of the resource type and size requirement checks is not specified here.
[0088] The technical solution of this embodiment obtains resource path information for the target decision engine. If the existence of configuration resources corresponding to the resource path information is verified, the configuration resources corresponding to the resource path information are obtained. The read requirements of the configuration resources are verified, and if the configuration resources meet the read requirements, it is determined that the configuration resources meet the resource import conditions. In this way, configuration resources that meet the resource import conditions can be imported into the database of the target decision engine, effectively improving the reliability and security of importing configuration resources into the target decision engine.
[0089] In one embodiment, the method further includes: generating an import failure message based on the reason for the import failure when the configuration resource import fails; and displaying the import failure message on a display terminal.
[0090] The reasons for import failure may include, but are not limited to, an error that the configuration resource does not exist, an error that the configuration resource type is abnormal, an error that the configuration resource size exceeds the limit, an invalid configuration resource, a failure to generate database operation statements, and a failure to execute database operation statements.
[0091] In practice, if the configuration resource import fails, the terminal can generate an import failure message based on the reason for the failure and display the import failure message on the display terminal for the user's reference.
[0092] The technical solution of this embodiment generates an import failure prompt message based on the reason for the import failure when the configuration resource import fails; and displays the import failure prompt message on the display terminal. In this way, the reason for the import failure can be provided to the user so that the user can take appropriate measures to solve the problem, which effectively improves the intelligence of human-computer interaction in the process of configuring the decision engine.
[0093] In another embodiment, such as Figure 2 As shown, a resource configuration method is provided. Taking the application of this method to a terminal as an example, the method includes the following steps:
[0094] Step S202: In response to the fulfillment of the triggering condition for importing configuration resources for the target decision engine, obtain the resource path information for the target decision engine. If it is verified that there is a configuration resource corresponding to the resource path information, obtain the configuration resource corresponding to the resource path information.
[0095] Step S204: Verify the read requirements of the configuration resources. If the configuration resources meet the read requirements, determine that the configuration resources meet the resource import conditions.
[0096] Step S206: If the configuration resources meet the resource import conditions, parse the resource type of the configuration resources.
[0097] Step S208: In the case of a spreadsheet resource of binary type, obtain all system field names for the target decision engine; each system field name corresponds to field rule information.
[0098] Step S210: Based on the field rule information corresponding to each system field name, verify the validity of the resource fields of the configuration resources to obtain the valid resource fields of the configuration resources.
[0099] Step S212: Combine the resource fields of the method to generate database operation statements.
[0100] Step S214: Obtain all service names corresponding to the access service of the target decision engine, and obtain the service name set.
[0101] Step S216: Compare each database operation statement with the service name set. If the service name in the currently compared database operation statement appears in the service name set, skip the currently compared database operation statement and compare the service name in the next database operation statement with the service name set.
[0102] Step S218: If the service name in the currently compared database operation statement does not appear in the service name set, then execute the database operation corresponding to the currently compared database operation statement until the currently compared database operation statement is the last database operation statement, so as to import the configuration resources into the database of the target decision engine.
[0103] It should be noted that the specific limitations of the above steps can be found in the specific limitations of a resource allocation method described above.
[0104] In some embodiments, taking configuration resources as configuration files as an example, when the parsed configuration file is in .csv (a plain text tabular data file format), its corresponding resource type is plain text tabular data resource. During the process of the terminal calling the import function module interface matching the resource type to import the configuration resource into the target decision engine's database, the terminal can call the import function module interface matching the .csv format to directly import the .csv format configuration file. Specifically, the ImportServiceConfig interface can be used to complete the import operation of the configuration file.
[0105] In some embodiments, the terminal may be equipped with an engine configuration release tool, which executes the steps of the resource configuration method described above. The engine configuration release tool is primarily used in the access service function of the decision engine. Importable file formats include .csv and .xls. To reduce operational complexity, the engine configuration release tool abstracts the import function, eliminating the need for users to distinguish between file formats. Users only need to provide the file path and file name that conforms to the access service configuration file format to achieve automatic import of the configuration file.
[0106] The decision engine requires importing six parts of rules: calculation formulas, decision trees, decision flows, scorecards, policy sets, and access services. To reduce operational complexity, the engine configuration and release tool abstracts all rule and policy import functions. Users no longer need to subdivide each module; they only need to provide the rules and policies to be imported and the corresponding import parameter files, and the engine configuration and release tool will handle the import of various types of rules and policies.
[0107] The specific functions of the engine configuration and release tool are implemented by a Java program. Its core function is to call different function interfaces based on the content of the recognized file to directly import .csv files and convert .xls files into SQL statement strings before importing them into the database.
[0108] The entire implementation process consists of three steps: preparation and verification before import, format identification and import, and generation of log information and result feedback.
[0109] 1. Step 1: Preparation and Verification Before Import: The .csv format is the original file template format used in the access service function, while the .xls format is the new file template format. By parsing the file path, file size, file content, and filename, the system obtains the specific content of the configuration file. The system will then determine any exceptions encountered during the user's import process, categorized as file not found, file type error, or file size exceeding the limit.
[0110] 2. Step 2: Identify the format and import the work: After verifying that the configuration file meets the import conditions, different import function module interfaces are executed according to the different file formats parsed (.csv / .xls) to realize their respective import work.
[0111] 3. Step 3: Generate log information and result feedback: Regardless of whether the configuration file import is successful or not, corresponding log information will be generated. If the import is successful, a corresponding prompt message will be returned to the console.
[0112] The engine configuration release tool provides access service configuration templates: a spreadsheet template that logically breaks down configuration items, making it easy for users to fill in access service-related configuration information and generate access service configuration information files (i.e., configuration files). It also provides the function of automatically generating configuration SQL statements from the information entered in the file.
[0113] For ease of understanding by those skilled in the art, the configuration file format is .csv, as an example. Figure 3 A flowchart illustrating the process of importing configuration files using an engine configuration release tool is provided. For example... Figure 3 As shown, the input configuration file is obtained and processed using the `importByCsv` method, with the absolute path of the configuration file to be imported as the parameter. The main function of the `importByCsv` method is to import the configuration file and call the existing file import interface `importServiceConfig` (an interface for importing functional modules) to perform some judgments and processing on the imported configuration file, while also logging.
[0114] The terminal can sequentially check if the .csv format configuration file exists, if the file size meets the reading requirements, and if the file type meets the reading requirements. If all are true, it calls the existing importServiceConfig interface to import the configuration file. The importServiceConfig interface imports the configuration file; the method has two parameters: file and type. file is a file, and type is a string, requiring the string "system" as input. This interface can perform relevant checks on the configuration file, including its fields and whether it has been modified. If the file does not exist, it prompts an error message indicating that the file exists and logs the error. Different error messages are displayed using corresponding error throwing methods. For example, if the file does not exist, it throws a "file not found" error. Finally, it generates an import result message, indicating successful or failed import, and ends the process.
[0115] For ease of understanding by those skilled in the art, we will use a configuration file in .xls format as an example. Figure 4 This document provides a flowchart illustrating the process of converting a .xls format configuration file stream into SQL statements. For example... Figure 4 As shown, the user imports a .xls format configuration file filled out according to the template. The uploaded file stream is converted into an HSSFworkbook (a Java class used to manipulate Excel files (.xls format)). The system checks if the converted HSSFworkbook is empty. If it is, a BizException (indicating an exception) is thrown, and the corresponding information is logged, indicating whether the SQL statement generation was successful. If not, the system begins reading field information line by line, retrieving the corresponding rule information from the system, and storing it in a map to verify the validity of input and output parameters. Specifically, during the process of retrieving the corresponding rule information from the system and storing it in the map to verify the validity of input and output parameters, the methods systemFieldService.selectVOAll() and scriptFieldService.selectVOAll() are used to query all system field names and script field names, looping back to return a list. All system field names and script field names are placed into the map's key, with each key having a value of 1. By checking map.get(input field name) == 1, the system confirms whether the input field name is a system field name or script field name that exists in the system, thus verifying the validity of subsequent input and output parameters.
[0116] The system can check the validity of the title name and whether the input and output parameters conform to the system's defined style line by line. If they do, the valid file fields are encapsulated in the `ServiceConfigDo` class, and the SQL statement for insertion is constructed based on this class. The `do` class can query and retrieve all service names and perform uniqueness checks. Then, it checks if the passed `type` is `system`; if so, it checks if the key attributes of the `ServiceConfigDo` class are empty. During the process of checking if the key attributes of the `ServiceConfigDo` class are empty, the `AssertUtil.isNotNull` method can be used to check the service identifier, service name, and service type, and the `AssertUtil.stringLength` method can be used to check the length of the service identifier and service name. If the attributes are not empty, the SQL string is constructed based on the various attributes set earlier in the `ServiceConfigDo` Java class, and the response information is logged, indicating whether the SQL statement generation was successful.
[0117] In another embodiment, such as Figure 5 The diagram illustrates another resource allocation method. The overall process is as follows:
[0118] 1. When the job starts importing configuration files in .csv / .xls format, it is necessary to check whether the configuration file exists, whether the configuration file size is less than 50M (or other numerical thresholds), and whether the content of the configuration file meets the reading requirements.
[0119] 2. If the above requirements are not met, the system will prompt for error information regarding the existing configuration file and log the error. The job will end after indicating that the import has failed.
[0120] 3. If the above requirements are met, the system will determine whether the configuration file is in .csv or .xls format based on the result of judging the configuration file content, and then execute the corresponding import function.
[0121] 4. If the file is in .csv format, call the ImportServiceConfig interface to complete the import configuration file operation, log the relevant information, indicate successful import, and end the job.
[0122] 5. If the file is in .xls format, first obtain the contents of the .xls configuration file, concatenate the file fields, and generate an SQL statement string. If the generation fails, display an error message, log the error, and terminate the job.
[0123] 6. After the SQL statement string is successfully generated, the system will parse the SQL statement string, query and retrieve all service names in the database, and after obtaining the service name set, the system will uniquely compare the service name in the SQL statement with the service name set. If it exists, the statement will be skipped; otherwise, the SQL statement will be executed, and the decision engine database will be modified accordingly. If the execution is successful, the service name in the SQL statement will be saved to the service name set obtained from the query, until the last SQL statement.
[0124] 7. Once the last SQL statement is executed successfully, a log will be created displaying the information, indicating successful import, and the job will end.
[0125] In this way, the technology configuration of the decision engine is implemented through application releases and engine production use, improving the current situation where technology parameters for decision-making scenarios are configured by business agents, reducing the configuration burden on businesses, and enhancing the dominant role of access applications in managing decision-making scenarios. With the goal of achieving platform-based release of access services, a prototype program for the release service was developed. A common configuration release toolkit is provided to enable sending configurations in a specified format to the engine production environment and making them effective. The specific effects are as follows:
[0126] 1. The decision engine's access service configuration publishing formats include: SQL statements that can be changed, and access service configuration files exported from the engine.
[0127] 2. Access Service Configuration Template: Provides a spreadsheet template with logically broken down configuration items, making it easy for users to fill in access service-related configuration information and generate an access service configuration information file. It also offers a function to automatically generate configuration SQL statements from the information entered in the file.
[0128] 3. Configure release to achieve caller isolation: During and after tool execution, callers are isolated from each other, cannot see each other, and do not interfere with each other, thus achieving risk isolation.
[0129] This application improves the speed and security of converting file streams into SQL parameters by combining file stream parsing technology and regular expression matching to prevent SQL injection. By integrating application-level import, it saves the labor required for manually importing individual system fields and risk control rules. The implementation of batch automatic import not only frees business personnel from large amounts of repetitive rule and strategy configuration but also improves the accuracy and reliability of rule import. The fully automated process of policy rules ensures the correctness and legality of data sources and improves the efficiency of risk management department in deploying control rules.
[0130] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0131] Based on the same inventive concept, this application also provides a resource allocation apparatus for implementing the resource allocation method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more resource allocation apparatus embodiments provided below can be found in the limitations of the resource allocation method described above, and will not be repeated here.
[0132] In one exemplary embodiment, such as Figure 6 As shown, a resource configuration device is provided, including: a verification module 610, a parsing module 620, and an import module 630, wherein:
[0133] The verification module 610 is used to verify the resource import conditions for the configuration resources in response to the triggering conditions for importing configuration resources for the target decision engine.
[0134] The parsing module 620 is used to parse the resource type of the configuration resource after verifying that the configuration resource meets the resource import conditions.
[0135] Import module 630 is used to call the import function module interface that matches the resource type to import the configuration resource into the database of the target decision engine; the configuration resource in the database is used to configure the rule strategy of the access service of the target decision engine.
[0136] In one embodiment, when the resource type is a binary spreadsheet resource, the import module 630 is specifically used to concatenate the resource fields of the configuration resource to generate a database operation statement; and execute the database operation corresponding to the database operation statement to import the configuration resource into the database of the target decision engine.
[0137] In one embodiment, the import module 630 is specifically used to obtain all service names corresponding to the access service of the target decision engine, thereby obtaining a service name set; compare each database operation statement with the service name set, and execute the database operation corresponding to the unmatched database operation statement to import the configuration resource into the database of the target decision engine; the service name in the unmatched database operation statement has not appeared in the service name set.
[0138] In one embodiment, the import module 630 is specifically configured to: if the service name in the currently compared database operation statement appears in the service name set, skip the currently compared database operation statement and compare the service name in the next database operation statement with the service name set; if the service name in the currently compared database operation statement does not appear in the service name set, execute the database operation corresponding to the currently compared database operation statement until the currently compared database operation statement is the last database operation statement.
[0139] In one embodiment, the import module 630 is specifically used to obtain all system field names for the target decision engine; each system field name corresponds to field rule information; based on the field rule information corresponding to each system field name, the legality of the resource fields of the configuration resource is checked to obtain the legal resource fields of the configuration resource; the legal resource fields are concatenated to generate the database operation statement.
[0140] In one embodiment, the verification module 610 is specifically used to obtain resource path information for the target decision engine; if it verifies that there is a configuration resource corresponding to the resource path information, it obtains the configuration resource corresponding to the resource path information; it verifies the reading requirements of the configuration resource; if the configuration resource meets the reading requirements, it determines that the configuration resource meets the resource import conditions.
[0141] In one embodiment, the device further includes: a prompting module, configured to generate an import failure prompt message based on the reason for the import failure when the configuration resource import fails; and to display the import failure prompt message on a display terminal.
[0142] Each module in the aforementioned resource allocation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0143] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores configuration resource data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a resource configuration method.
[0144] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0145] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0146] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0147] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0148] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0149] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0150] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0151] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A resource allocation method, characterized in that, The method includes: In response to the fulfillment of the triggering condition for importing configuration resources for the target decision engine, resource import condition verification is performed on the configuration resources; If the configuration resource meets the resource import conditions, the resource type of the configuration resource is parsed. The import function module interface matching the resource type is invoked to import the configuration resource into the database of the target decision engine; the configuration resource in the database is used to configure the rule strategy for the access service of the target decision engine. In the case of a binary spreadsheet resource, the step of calling the import function module interface matching the resource type to import the configuration resource into the database of the target decision engine includes: The resource fields of the configured resources are concatenated to generate database operation statements; Execute the database operation corresponding to the database operation statement to import the configuration resources into the database of the target decision engine; The step of executing the database operation corresponding to the database operation statement to import the configuration resources into the database of the target decision engine includes: Obtain all service names corresponding to the access service of the target decision engine to obtain a service name set; Each of the database operation statements is compared with the service name set, and the database operation corresponding to the unmatched database operation statement is executed to import the configuration resource into the database of the target decision engine; the service name in the unmatched database operation statement has not appeared in the service name set.
2. The method according to claim 1, characterized in that, The step of comparing each of the database operation statements with the service name set and executing the database operation corresponding to the unmatched database operation statement includes: If the service name in the currently compared database operation statement appears in the service name set, then skip the currently compared database operation statement and compare the service name in the next database operation statement with the service name set. If the service name in the currently compared database operation statement does not appear in the service name set, then the database operation corresponding to the currently compared database operation statement is executed until the currently compared database operation statement is the last database operation statement.
3. The method according to claim 1, characterized in that, The step of concatenating the resource fields of the configured resources to generate database operation statements includes: Obtain all system field names for the target decision engine; each system field name corresponds to field rule information. Based on the field rule information corresponding to each system field name, the validity of the resource fields of the configuration resource is verified to obtain the valid resource fields of the configuration resource; The valid resource fields are concatenated to generate the database operation statement.
4. The method according to claim 1, characterized in that, The step of responding to the fulfillment of the triggering condition for importing configuration resources for the target decision engine, and performing resource import condition verification for the configuration resources, includes: Obtain resource path information for the target decision engine; if it is verified that there is a configuration resource corresponding to the resource path information, obtain the configuration resource corresponding to the resource path information. Verify the read requirements of the configuration resource. If the configuration resource meets the read requirements, determine that the configuration resource satisfies the resource import conditions.
5. The method according to claim 1, characterized in that, The method further includes: If the configuration resource import fails, an import failure message will be generated based on the reason for the import failure. The import failure message is displayed on the terminal.
6. A resource allocation device, characterized in that, The device includes: The verification module is used to verify the resource import conditions for the configuration resources in response to the triggering conditions for importing configuration resources for the target decision engine. The parsing module is used to parse the resource type of the configuration resource after verifying that the configuration resource meets the resource import conditions; The import module is used to call the import function module interface that matches the resource type to import the configuration resource into the database of the target decision engine; the configuration resource in the database is used to configure the rules and strategies for the access service of the target decision engine. In the case of a binary spreadsheet resource, the import module is used to concatenate the resource fields of the configuration resource to generate a database operation statement; and execute the database operation corresponding to the database operation statement to import the configuration resource into the database of the target decision engine. The import module is used to obtain all service names corresponding to the access service of the target decision engine, and obtain a service name set; compare each database operation statement with the service name set, and execute the database operation corresponding to the unmatched database operation statement to import the configuration resource into the database of the target decision engine; the service name in the unmatched database operation statement has not appeared in the service name set.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Business rule updating method and device, equipment and storage medium
CN115202707A