Dynamic configuration field conversion method, system and device, medium and product

Through dynamic configuration of field conversion method, Java dynamic bytecode technology is used to generate rule unit chains, which realizes dynamic mapping and conversion of fields between applications, solves the problems of repeated labor and rapid iteration in the existing technology, and reduces the system complexity and fault tolerance.

CN118939715APending Publication Date: 2024-11-12SHANGHAI OUYE FINANCIAL INFORMATION SERVICE CO LTD

Patent Information

Application Number
CN202411046140.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-01
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The prior art has problems such as repeated labor and unfavorable to rapid iteration when maintaining field mapping relationships between applications, especially when external application fields are changed, internal application code needs to be frequently updated.

Method used

The dynamic configuration field conversion method is adopted to obtain the input data of the external application system and the interface number of the internal application system, determine and preprocess the field conversion rules, and use Java dynamic bytecode technology to generate rule unit files to form rule unit chains, and perform Flattening and recursive conversion implement dynamic mapping and conversion of fields.

Benefits of technology

It reduces the complexity and fault tolerance of the application system, reduces the development workload, improves docking efficiency and fault tolerance. When the external system field changes, it only needs to modify the database mapping relationship to adapt, without modifying the code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939715A_ABST
    Figure CN118939715A_ABST
Patent Text Reader

Abstract

The invention discloses a dynamic configuration field conversion method, system and device, a medium and a product, and relates to the field conversion field. Input data of an external application system and an interface number of an internal application system are obtained; determining a plurality of field conversion rules according to the input data and the interface number; preprocessing the field conversion rule to obtain an object model of the field conversion rule; based on the object model of the field conversion rule and the input data, generating a plurality of rule unit class files by utilizing a Java dynamic byte code technology, and forming a rule unit chain; flattening the input data to obtain flattened data; and based on a rule unit chain, converting the flattened data in a recursive manner to obtain converted input data, and inputting the converted input data into the internal application system. According to the invention, the complexity and the error-tolerant rate of an application system are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of field conversion, and in particular to a method, system, device, medium and product for dynamically configuring field conversion. Background Art

[0002] Currently, the mainstream technical approach to field conversion is to maintain the mapping relationship between the internal fields of the application and the external fields of the application in static code. However, this approach has the following problems. On the one hand, when connecting to a new external application, it is usually necessary to develop new code to establish the field mapping relationship. From the perspective of business attributes, most of these codes are similar or exactly the same, resulting in a large amount of code development being duplication of work. On the other hand, when the external application field changes, the internal application code will also change accordingly, which is very unfavorable for rapid system iteration and business testing. Summary of the invention

[0003] The purpose of this application is to provide a method, system, device, medium and product for dynamically configuring field conversion to reduce the complexity and fault tolerance of the application system.

[0004] To achieve the above objectives, this application provides the following solutions:

[0005] In a first aspect, the present application provides a method for dynamically configuring field conversion, comprising:

[0006] Obtain input data from external application systems and interface numbers from internal application systems;

[0007] Determine a plurality of field conversion rules according to the input data and the interface number; the field conversion rules include a source field name, a target field name, a conversion precondition, a conversion priority, and whether the rule is enabled;

[0008] Preprocessing the field conversion rule to obtain an object model of the field conversion rule;

[0009] Based on the object model of the field conversion rule and the input data, multiple rule unit class files are generated using Java dynamic bytecode technology to form a rule unit chain; the rule unit class file includes field attributes and executable methods; the field attributes include source field name, target field name and conversion preconditions; the executable method includes field conversion method and precondition judgment method;

[0010] Flattening the input data to obtain flattened data;

[0011] Based on the rule unit chain, the flattened data is converted in a recursive manner to obtain converted input data, which is then input into the internal application system.

[0012] Optionally, preprocessing the field conversion rule to obtain an object model of the field conversion rule specifically includes:

[0013] Based on the conversion priority, all the field conversion rules are prioritized to obtain sorted field conversion rules;

[0014] Filter and delete the unactivated rules in the sorted field conversion rules to obtain processed field conversion rules;

[0015] The processed field conversion rules are subjected to structured data parsing to obtain an object model of the field conversion rules.

[0016] Optionally, performing structured data parsing on the processed field conversion rule to obtain an object model of the field conversion rule specifically includes:

[0017] Use the concept of class in Java language to define structured data object model;

[0018] Using JSON serialization technology, convert the processed field conversion rules into JSON structure data containing key-value pairs;

[0019] The attributes required by each field conversion rule in the JSON structure data are extracted and filled into the structured data object model to obtain an object model of the field conversion rule.

[0020] Optionally, based on the object model of the field conversion rule and the input data, Java dynamic bytecode technology is used to generate multiple rule unit class files and form a rule unit chain, specifically including:

[0021] Based on the object model of the field conversion rule and the input data, a plurality of rule unit class files are generated using Java dynamic bytecode technology;

[0022] The plurality of rule unit class files form a rule unit chain according to a pre-configured priority order.

[0023] Optionally, based on the rule unit chain, the flattened data is converted in a recursive manner to obtain converted input data, specifically including:

[0024] Determine whether the conversion preconditions are met;

[0025] If so, the rule unit class files in the rule unit chain are triggered in sequence to convert the flattened data to obtain processed input data; wherein, during the conversion process, the next rule unit class file converts the flattened data converted based on the previous rule unit class file.

[0026] In a second aspect, the present application provides a dynamic configuration field conversion system, which is used to execute the above-mentioned dynamic configuration field conversion method, and the dynamic configuration field conversion system includes: a database rule configuration parsing module, a field conversion rule engine module and a field conversion rule module; the field conversion rule module includes multiple field conversion rule units;

[0027] The database rule configuration parsing module is used for:

[0028] Obtain input data from external application systems and interface numbers from internal application systems;

[0029] Determine a plurality of field conversion rules according to the input data and the interface number; the field conversion rules include a source field name, a target field name, a conversion precondition, a conversion priority, and whether the rule is enabled;

[0030] Preprocessing the field conversion rule to obtain an object model of the field conversion rule;

[0031] The field conversion rule engine module is used to generate multiple rule unit class files based on the object model of the field conversion rule and the input data, using Java dynamic bytecode technology, and form a rule unit chain; the rule unit class file includes field attributes and executable methods; the field attributes include source field name, target field name and conversion preconditions; the executable method includes field conversion method and precondition judgment method;

[0032] The field conversion rule module is used for:

[0033] Flattening the input data to obtain flattened data;

[0034] Based on the rule unit chain, the flattened data is converted in a recursive manner to obtain converted input data, which is then input into the internal application system.

[0035] In a third aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any one of the dynamic configuration field conversion methods described above.

[0036] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any one of the above-described dynamic configuration field conversion methods.

[0037] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements any one of the above-mentioned dynamic configuration field conversion methods.

[0038] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0039] The present application provides a method, system, device, medium and product for dynamically configuring field conversion, which obtains input data of an external application system and an interface number of an internal application system; determines multiple field conversion rules according to the input data and the interface number; preprocesses the field conversion rules to obtain an object model of the field conversion rules; generates multiple rule unit class files based on the object model and input data of the field conversion rules using Java dynamic bytecode technology, and forms a rule unit chain; flattens the input data to obtain flattened data; recursively converts the flattened data based on the rule unit chain to obtain the converted input data, and inputs it into the internal application system. The present application reduces the complexity and fault tolerance of the application system. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0041] Figure 1 A flowchart of a method for dynamically configuring field conversion provided in one embodiment of the present application;

[0042] Figure 2 A schematic diagram of a dynamic configuration field conversion system structure provided in one embodiment of the present application;

[0043] Figure 3 This is a schematic diagram of the processing flow of the dynamic configuration field conversion system of this application;

[0044] Figure 4 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0046] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0047] First of all, there is a hard prerequisite before the implementation of this application, that is, it is necessary to map and organize the field names and structures of each interface according to the preliminary agreement when connecting the internal application system (the application system that runs within the enterprise and mainly provides services within the enterprise) and various external application systems (external application systems that need to interact with the internal enterprise, such as banks, suppliers, partners, etc.). The purpose is to uniformly map the field names and structures of various forms in the external interface to the standard field names and structures of the internal application system. Finally, this organized mapping relationship is maintained in the database. It should be noted that the external application system can be a bank trust channel or other external organization, and this application does not impose any special restrictions on this. For example, the external banking systems of Industrial and Commercial Bank of China, China Merchants Bank, China Construction Bank, etc. provide fund loan interfaces. The interface fields and formats provided by each bank are different, while the fund loan process of the enterprise's internal application system is consistent and will not be customized according to the differences of each bank. Such business scenarios will use this application. For the fund loan interfaces provided by different banks, the field names and structures of various forms will be uniformly mapped to the standard field names and structures of the internal system, thereby shielding the differences between the interfaces of various external bank systems and reducing the complexity of the research and development of the internal application system.

[0048] In an exemplary embodiment, Figure 1 As shown, a method for dynamically configuring field conversion is provided, including:

[0049] S1: Obtain input data of the external application system and the interface number of the internal application system.

[0050] In actual applications, the external application system calls the internal application system interface. According to the previous docking agreement, the system involved in this application can know the unique number of this interface and upload the input data and unique number of the interface.

[0051] S2: Determine multiple field conversion rules according to the input data and the interface number; the field conversion rules include source field name, target field name, conversion precondition, conversion priority and whether the rule is enabled. The conversion precondition is a prerequisite that must be met before executing the field conversion. If the condition requirement is not met, the field conversion rule will not be executed.

[0052] In actual applications, according to the early document conventions of the interface, the unique number of the interface can be obtained from the interface input data according to the specific field name (such as apiCode), and all matching field conversion rule configuration data information can be retrieved from the database. For each retrieved field conversion rule, these important attributes will be included: source field name, target field name, conversion preconditions, conversion priority, and whether the rule is enabled.

[0053] S3: Preprocess the field conversion rule to obtain an object model of the field conversion rule.

[0054] As an optional implementation, S3 specifically includes:

[0055] S31: Based on the conversion priority, all the field conversion rules are prioritized to obtain sorted field conversion rules.

[0056] In actual applications, all field conversion rules are prioritized according to the conversion priority to ensure that they are in order when the conversion is executed.

[0057] S32: Filter and delete the unactivated rules in the sorted field conversion rules to obtain processed field conversion rules.

[0058] S33: Perform structured data parsing on the processed field conversion rules to obtain an object model of the field conversion rules.

[0059] As an optional implementation, S33 specifically includes:

[0060] S331: Using the concept of class in Java language, define a structured data object model. In practical applications, using the concept of class in Java language, define a structured data object model, and this object model includes the following attribute information: source field name, target field name, conversion precondition, and conversion priority.

[0061] S332: Using JSON serialization technology, convert the processed field conversion rules into JSON structure data containing key-value pairs.

[0062] In practical applications, JSON serialization technology is used to convert preprocessed data (processed field conversion rules) into JSON structured data containing key-value pairs (JSON is a mature, lightweight, easy-to-read, and easy-to-parse data exchange format). The key name can be used to obtain the corresponding value from the JSON structured data. For example, the corresponding value can be found from the JSON structured data according to originName (the key name of the source field), that is, the source field name to be processed.

[0063] S333: extracting the attributes required by each field conversion rule in the JSON structure data, filling them into the structured data object model, and obtaining the object model of the field conversion rule.

[0064] In actual applications, the important attributes required for each field conversion rule are extracted one by one from the above JSON structure data, and then filled into the object model defined in S331, for example:

[0065] Look up the source field name value from the JSON structure data according to the key name originName and bind it to the source field name property in the object model.

[0066] Look up the target field name value from the JSON structure data according to the key name targetName and bind it to the target field name attribute in the object model.

[0067] Look up the conversion precondition value from the JSON structure data according to the key name preCondition and bind it to the precondition property in the object model.

[0068] Look up the transformation priority value from the JSON structure according to the key name priority and bind it to the transformation priority property in the object model.

[0069] Through the above parsing steps, a complete object model can be obtained. The object model can be understood as the objectification of field conversion rule data. It also includes important attributes such as source field name, target field name, conversion preconditions, etc.

[0070] S4: Based on the object model of the field conversion rule and the input data, multiple rule unit class files are generated using Java dynamic bytecode technology to form a rule unit chain; the rule unit class file includes field attributes and executable methods; the field attributes include source field name, target field name and conversion preconditions; the executable method includes field conversion method and precondition judgment method.

[0071] As an optional implementation, S4 specifically includes:

[0072] S41: Based on the object model of the field conversion rule and the input data, a plurality of rule unit class files are generated using Java dynamic bytecode technology.

[0073] S42: The plurality of rule unit class files form a rule unit chain according to a pre-configured priority order.

[0074] In actual applications, after receiving the object model obtained through the above steps, the important attribute information of the field conversion rule can be obtained from the object model: source field name, target field name, conversion precondition, conversion priority, whether the rule is enabled, and using the Java dynamic bytecode operation library, according to the class file encoding specification, a new class file is created and field attributes and executable methods are created in the class file, wherein the field attributes include: source field name, target field name, conversion precondition, and the executable method includes: field conversion method, precondition judgment method, and finally the specific logical rules of field conversion can be executed according to these field attributes and executable methods. Finally, these rule units are formed into a rule unit chain according to the priority order pre-configured in the database.

[0075] S5: Flatten the input data to obtain flattened data.

[0076] In practical applications, the input data is flattened, that is, the multi-layer nested data structure is converted into a one-dimensional data structure. First, each piece of information in the input data is composed of a key and a value, and the value may be a complex multi-dimensional nested structure, that is, it will contain multiple keys and values, and it is nested in multiple layers. Therefore, it is necessary to traverse the value, visit all the nested keys and values ​​step by step, and add each key and value to a new flattened data structure, and finally you can get a flattened data (flattened data).

[0077] S6: Based on the rule unit chain, the flattened data is converted in a recursive manner to obtain converted input data, and input into the internal application system.

[0078] As an optional implementation, S6 specifically includes:

[0079] S61: Determine whether the conversion preconditions are met.

[0080] S62: If so, trigger the rule unit class files in the rule unit chain in sequence to convert the flattened data to obtain processed input data; wherein, during the conversion process, the next rule unit class file converts the flattened data converted based on the previous rule unit class file.

[0081] Use the flattened data as the initial data and trigger the first rule unit class file. Each rule unit class file contains field attributes and executable methods. The field attributes describe the conversion rules, such as the source field name, the target field name, and the conversion preconditions. The executable method contains specific conversion logic: for example, under the premise that the flattened data contains field A (named k1), find the corresponding field value (v1) from the flattened data according to field A (named k1), then add a new field B (named k2) and field value (v1) to the flattened data, and then delete field A (named k1) from the flattened data. With the execution of the current rule unit, the source field name in the flattened data can be rewritten as the target field name, thereby achieving the purpose of converting the source field in the interface data to the expected target field. Then, the next rule unit is executed recursively (each node in the rule unit chain contains the next node information, so when a node is executed, the execution of the next node can be triggered), and the flattened data processed by the current rule unit is used as the initial data. Finally, the interface data after the conversion is completed is obtained and submitted to the internal system for use.

[0082] The internal business system executes business processing according to the interface data in a unified format and returns response data information to the external application.

[0083] In an exemplary embodiment, the present application provides a dynamic configuration field conversion system, wherein the dynamic configuration field conversion system is used to execute the above-mentioned dynamic configuration field conversion method, such as Figure 2 and Figure 3 As shown, the dynamic configuration field conversion system includes: a database rule configuration parsing module, a field conversion rule engine module and a field conversion rule module; the field conversion rule module includes a plurality of field conversion rule units.

[0084] The database rule configuration parsing module is used for:

[0085] Obtain input data from external application systems and interface numbers from internal application systems.

[0086] According to the input data and the interface number, a plurality of field conversion rules are determined; the field conversion rules include a source field name, a target field name, a conversion precondition, a conversion priority, and whether the rule is enabled.

[0087] The field conversion rule is preprocessed to obtain an object model of the field conversion rule.

[0088] In actual applications, the database rule configuration parsing module is responsible for querying all field conversion rule configuration data information associated with this interface from the database according to the request data information input by the external application system interface. Each interface will agree on a unique number, and keyword retrieval can be performed from the database based on this unique number. For each retrieved field conversion rule, data preprocessing will then be performed, and all field conversion rules will be prioritized according to the conversion priority, in order to ensure that they have a sequence when the conversion is executed, and unactivated rules will be filtered and deleted; finally, all preprocessed field conversion rules, such structured data, will be parsed and encapsulated into an object model that the field conversion rule engine module can understand and use. The object model can be understood as the objectification of the field conversion rule data, and it also contains important attributes such as the source field name, the target field name, and the conversion preconditions.

[0089] The field conversion rule engine module is used to generate multiple rule unit class files based on the object model of the field conversion rule and the input data, using Java dynamic bytecode technology, and form a rule unit chain; the rule unit class file includes field attributes and executable methods; the field attributes include source field name, target field name and conversion preconditions; the executable method includes field conversion method and precondition judgment method.

[0090] In actual application, the field conversion rule engine module uses Java dynamic bytecode technology, which is a mature technology that can dynamically generate class files. The class files generated by Java dynamic bytecode technology can be interpreted and executed by JVM. JVM (Java Virtual Machine) is the operating environment of Java language programs, responsible for compiling class files into bytecode instructions and running them. Java dynamic bytecode technology has a mature operation library that can be used directly. It allows class files to be directly generated and modified. For example, field attributes, executable methods, etc. can be created in class files according to the encoding specifications of class files. Using these field attributes and executable methods, the purpose of field conversion can be achieved. Based on the field conversion rule object model provided by the database rule configuration parsing module, a rule unit class file can be created one by one by using the Java dynamic bytecode operation library. Each rule unit class file will contain these field attributes: source field name, target field name, conversion precondition, and these executable methods: field conversion method, precondition judgment method. Finally, the specific logical rules of field conversion can be executed according to these field attributes and executable methods. Here is a simple conversion scenario: first execute the precondition judgment. If the precondition is met, the conversion will be executed, otherwise the conversion will not be executed; search the source field by name from the input data source, and rewrite the name of the source field to the target field name to achieve the purpose of field conversion. Finally, these rule units are formed into an ordered rule unit chain according to the priority order pre-configured in the database.

[0091] The field conversion rule module is used for:

[0092] The input data is flattened to obtain flattened data.

[0093] Based on the rule unit chain, the flattened data is converted in a recursive manner to obtain converted input data, which is then input into the internal application system.

[0094] In actual applications, the field conversion rule unit will form a rule unit chain in the order of priority of the database configuration. When the external system calls the interface and inputs data, the rule engine is responsible for expanding the data contained in the multi-dimensional nested structure in the interface and converting it into one-dimensional data, that is, flattening the data. Data flattening can make it easier to understand and process the rule unit. The rule engine will then trigger the first rule unit and recursively execute each rule unit chain, where each rule unit chain is responsible for converting the source field into the desired target field. When all rule units are executed, the final output is the converted data and submitted to the subsequent internal system for business processing.

[0095] This application can read the field conversion rule configuration from the database, dynamically generate field conversion rules through database configuration and implement field conversion, and flexibly and efficiently implement field conversion according to the field mapping requirements between different data sources, which can reduce the complexity and fault tolerance of the system, as well as the cost of regression testing. This reduces the workload in the development process, reduces system complexity, and improves docking efficiency. At the same time, when the external system field changes, you only need to modify the database mapping relationship to adapt to the changes in the external system, without modifying the code execution. The impact of the modification is small, which improves the fault tolerance of the system and supports business expansion more smoothly.

[0096] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store interface numbers and input data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a dynamic configuration field conversion method is implemented.

[0097] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components. In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above-mentioned dynamic configuration field conversion method when executing the computer program.

[0098] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the above-mentioned dynamic configuration field conversion method is implemented.

[0099] In an exemplary embodiment, a computer program product is provided, including a computer program, which implements the above-mentioned dynamic configuration field conversion method when executed by a processor.

[0100] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present 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 may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0101] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.

[0102] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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.

[0103] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A method for dynamically configuring field conversion, It is characterized in that include: Obtain input data from external application systems and interface numbers from internal application systems; Determine a plurality of field conversion rules according to the input data and the interface number; the field conversion rules include a source field name, a target field name, a conversion precondition, a conversion priority, and whether the rule is enabled; Preprocessing the field conversion rule to obtain an object model of the field conversion rule; Based on the object model of the field conversion rule and the input data, multiple rule unit class files are generated using Java dynamic bytecode technology to form a rule unit chain; the rule unit class file includes field attributes and executable methods; the field attributes include source field name, target field name and conversion preconditions; the executable method includes field conversion method and precondition judgment method; Flattening the input data to obtain flattened data; Based on the rule unit chain, the flattened data is converted in a recursive manner to obtain converted input data, which is then input into the internal application system.

2. The method for dynamically configuring field conversion according to claim 1, It is characterized in that The field conversion rule is preprocessed to obtain an object model of the field conversion rule, which specifically includes: Based on the conversion priority, all the field conversion rules are prioritized to obtain sorted field conversion rules; Filter and delete the unactivated rules in the sorted field conversion rules to obtain processed field conversion rules; The processed field conversion rules are subjected to structured data parsing to obtain an object model of the field conversion rules.

3. The method for dynamically configuring field conversion according to claim 2, It is characterized in that The processed field conversion rules are subjected to structured data parsing to obtain an object model of the field conversion rules, which specifically includes: Use the concept of class in Java language to define structured data object model; Using JSON serialization technology, convert the processed field conversion rules into JSON structure data containing key-value pairs; The attributes required by each field conversion rule in the JSON structure data are extracted and filled into the structured data object model to obtain an object model of the field conversion rule.

4. The method for dynamically configuring field conversion according to claim 1, It is characterized in that Based on the object model of the field conversion rule and the input data, multiple rule unit class files are generated using Java dynamic bytecode technology to form a rule unit chain, specifically including: Based on the object model of the field conversion rule and the input data, a plurality of rule unit class files are generated using Java dynamic bytecode technology; The plurality of rule unit class files form a rule unit chain according to a pre-configured priority order.

5. The method for dynamically configuring field conversion according to claim 1, It is characterized in that Based on the rule unit chain, the flattened data is converted in a recursive manner to obtain converted input data, specifically including: Determine whether the conversion preconditions are met; If so, the rule unit class files in the rule unit chain are triggered in sequence to convert the flattened data to obtain processed input data; wherein, during the conversion process, the next rule unit class file converts the flattened data converted based on the previous rule unit class file.

6. A dynamically configured field conversion system, It is characterized in that The dynamic configuration field conversion system is used to execute the dynamic configuration field conversion method described in claims 1-5, and the dynamic configuration field conversion system includes: a database rule configuration parsing module, a field conversion rule engine module and a field conversion rule module; the field conversion rule module includes a plurality of field conversion rule units; The database rule configuration parsing module is used for: Obtain input data from external application systems and interface numbers from internal application systems; Determine a plurality of field conversion rules according to the input data and the interface number; the field conversion rules include a source field name, a target field name, a conversion precondition, a conversion priority, and whether the rule is enabled; Preprocessing the field conversion rule to obtain an object model of the field conversion rule; The field conversion rule engine module is used to generate multiple rule unit class files based on the object model of the field conversion rule and the input data, using Java dynamic bytecode technology, and form a rule unit chain; the rule unit class file includes field attributes and executable methods; the field attributes include source field name, target field name and conversion preconditions; the executable method includes field conversion method and precondition judgment method; The field conversion rule module is used for: Flattening the input data to obtain flattened data; Based on the rule unit chain, the flattened data is converted in a recursive manner to obtain converted input data, which is then input into the internal application system.

7. A computer device, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the dynamic configuration field conversion method according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the dynamic configuration field conversion method described in any one of claims 1 to 5 is implemented.

9. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the dynamic configuration field conversion method described in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Method and system for dynamically converting telecommunications service data

    CN101958987A

  • Interface message conversion method, device and system

    CN112115190A

  • Business object generation method and device

    CN114637761A

  • Field conversion method and device, computer equipment and storage medium

    CN115421700A

  • Object conversion method and system based on runtime bytecode editing, medium and equipment

    CN116719531A

Cited By

  • Method for realizing data transmission structure conversion through rapid code injection

    CN119883220A

  • Dynamic data mapping method and system during Java operation based on Web configuration and bytecode enhancement and computer equipment

    CN122086518A