Parameter data transmission method and device, electronic equipment and storage medium
By constructing a tree-structured parameter data through a recursive parameter processing mechanism, the problem of complex parameter processing logic and difficult maintenance in existing technologies is solved, and efficient and flexible parameter data transmission is achieved, adapting to the dynamic changes in the fintech field.
Patent Information
- Application Number
- CN202510949763.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-10
- Publication Date
- 2025-11-21
AI Technical Summary
Existing technologies lead to complex and difficult-to-maintain parameter processing logic when dealing with complex, hierarchical, and structurally uncertain parameter data. This is especially true in the fintech field, where a large amount of code needs to be refactored when the parameter structure changes.
A recursive parameter processing mechanism is adopted to construct tree-structured parameter data, and the relationship between nodes and transmission paths is recorded through recursive parameter mapping. Adapter interfaces are used for data encapsulation and parsing to ensure the efficiency and flexibility of data transmission.
It improves the efficiency, flexibility, and maintainability of parameter data transmission, adapts to dynamically changing parameter structures, simplifies data transmission complexity, and meets the complex parameter data transmission needs of the fintech field.
Smart Images

Figure CN120994726A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data transmission technology, and in particular to a parameter data transmission method, apparatus, electronic device, and storage medium. Background Technology
[0002] Currently, business systems often encounter situations where complex, hierarchical, and structurally uncertain parameter data needs to be transmitted.
[0003] In related technologies, hard-coding is often used to handle parameters with different structures. However, in practical applications, it has been found that this approach makes the parameter processing logic complex and difficult to maintain, especially in the fintech field. The data structure of parameter data in various business scenarios cannot be completely determined in advance and may change over time. Once the parameter structure changes, a large amount of code often needs to be refactored.
[0004] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the Invention
[0005] This application provides a parameter data transmission method, apparatus, electronic device, and storage medium, which can improve the efficiency, flexibility, and maintainability of parameter data transmission. It can not only adapt to dynamically changing parameter data structures, but also simplify the complexity of parameter data transmission.
[0006] On one hand, embodiments of this application provide a parameter data transmission method, the method comprising the following steps:
[0007] Obtain the raw parameter data to be transmitted;
[0008] The recursive parameter processing mechanism is invoked to encapsulate the original parameter data, resulting in tree-structured parameter data, and a recursive parameter mapping is constructed. The recursive parameter mapping is used to record the mapping relationship between each node in the tree-structured parameter data and the transmission path.
[0009] Invoke the adapter interface that matches the data format of the tree structure parameter data, and transmit the tree structure parameter data according to the recursive parameter mapping.
[0010] Optionally, the recursive parameter processing mechanism is invoked to encapsulate the original parameter data, obtain tree-structured parameter data, and construct a recursive parameter mapping, including:
[0011] Construct a root node; the root node is used to refer to the tree structure parameter data corresponding to the original parameter data to be transmitted;
[0012] The recursive parameter processing mechanism is invoked to traverse each data field in the original parameter data to be transmitted layer by layer, and each data field is converted into a child node in the tree structure parameter data.
[0013] Based on the nesting relationship of the data fields in the original parameter data, determine the hierarchical structure relationship of the child nodes in the tree structure parameter data;
[0014] Based on the hierarchical relationship of the child nodes in the tree structure parameter data, the original parameter data is encapsulated to obtain the tree structure parameter data, and the recursive parameter mapping is constructed.
[0015] Optionally, the step of calling an adapter interface that matches the data format of the tree structure parameter data and transmitting the tree structure parameter data according to the recursive parameter mapping includes:
[0016] Determine the data format of the tree structure parameter data;
[0017] Call the adapter interface to determine whether the adapter interface supports the data format of the tree structure parameter data;
[0018] If the adapter interface supports the data format of the tree structure parameter data, the data format of the tree structure parameter data is converted into the target format according to the adapter interface, and the converted tree structure parameter data is transmitted according to the recursive parameter mapping.
[0019] If the adapter interface does not support the data format of the tree structure parameter data, an adapter class is constructed, defining the processing rules for converting the data format of the tree structure parameter data to the target format, and the adapter class is registered to the adapter interface, so that the adapter interface supports the data format of the tree structure parameter data, and the adapter interface is called to convert the data format of the tree structure parameter data to the target format, thereby transmitting the converted tree structure parameter data according to the recursive parameter mapping.
[0020] On the other hand, embodiments of this application provide a parameter data transmission method, the method comprising the following steps:
[0021] Receive tree structure parameter data; wherein, the tree structure parameter data is obtained by calling a recursive parameter processing mechanism to encapsulate the original parameter data;
[0022] The recursive parameter processing mechanism is invoked to recursively parse the tree structure parameter data to obtain the original parameter data corresponding to the tree structure parameter data.
[0023] Optionally, the recursive parameter processing mechanism is invoked to recursively parse the tree structure parameter data to obtain the original parameter data corresponding to the tree structure parameter data, including:
[0024] Determine the root node of the tree structure parameter data;
[0025] Starting from the root node, the recursive parameter processing mechanism is invoked to traverse and parse the child nodes of the tree structure parameter data layer by layer, and to determine the data field corresponding to each child node.
[0026] Based on the hierarchical relationship of the child nodes in the tree structure parameter data, determine the nesting relationship of the data fields in the original parameter data;
[0027] Based on the nesting relationship of the data fields in the original parameter data, the original parameter data corresponding to the tree structure parameter data is restored.
[0028] Optionally, the method further includes:
[0029] In response to a triggered data transmission exception command, execute the parameter data rollback strategy;
[0030] The parameter data rollback strategy includes rolling back the parameter data to a preset value and initiating a parameter data transmission retransmission request.
[0031] On the other hand, embodiments of this application provide a parameter data transmission device, the device comprising:
[0032] The data acquisition module is used to acquire the raw parameter data to be transmitted;
[0033] The data processing module is used to call the recursive parameter processing mechanism to encapsulate the original parameter data, obtain tree-structured parameter data, and construct a recursive parameter mapping; wherein, the recursive parameter mapping is used to record the mapping relationship between each node in the tree-structured parameter data and the transmission path;
[0034] The data transmission module is used to call an adapter interface that matches the data format of the tree structure parameter data, and to transmit the tree structure parameter data according to the recursive parameter mapping.
[0035] On the other hand, embodiments of this application provide a parameter data transmission device, the device comprising:
[0036] The data receiving module is used to receive tree structure parameter data; wherein, the tree structure parameter data is obtained by calling a recursive parameter processing mechanism to encapsulate the original parameter data;
[0037] The data parsing module is used to call the recursive parameter processing mechanism to recursively parse the tree structure parameter data and obtain the original parameter data corresponding to the tree structure parameter data.
[0038] On the other hand, embodiments of this application provide an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-mentioned parameter data transmission method.
[0039] On the other hand, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-described parameter data transmission method.
[0040] This application embodiment parses data through a recursive parameter processing mechanism, encapsulates and constructs tree-structured parameter data, improving the efficiency, flexibility, and maintainability of data transmission. It can not only adapt to dynamically changing parameter data structures but also simplify the complexity of data transmission. It can effectively meet the high-efficiency transmission needs of complex, hierarchical, and structurally uncertain parameter data in the financial technology field. Furthermore, by automatically generating data transmission paths for each node, it ensures that all nodes in the entire tree structure are correctly mapped, facilitating subsequent calls to appropriate adapter interfaces for data transmission. Attached Figure Description
[0041] Figure 1 This is a schematic diagram of the implementation environment of a parameter data transmission method provided in an embodiment of this application;
[0042] Figure 2 This is a flowchart illustrating a parameter data transmission method provided in an embodiment of this application;
[0043] Figure 3 This is a schematic diagram of a recursive parameter processing of raw parameter data provided in an embodiment of this application;
[0044] Figure 4 This is a flowchart illustrating another parameter data transmission method provided in an embodiment of this application;
[0045] Figure 5 This is a schematic diagram of a recursive parsing process for processing tree structure parameter data provided in an embodiment of this application;
[0046] Figure 6 This is a schematic diagram of the structure of a parameter data transmission device provided in an embodiment of this application;
[0047] Figure 7 This is a schematic diagram of another parameter data transmission device provided in an embodiment of this application;
[0048] Figure 8This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0049] 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 of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0050] It is understood that the terms “first,” “second,” etc., used in this application may be used herein to describe various concepts, but unless otherwise stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the words “if,” “when,” or “in response to a determination” as used herein may be interpreted as “when…” or “when…” or “in response to a determination.”
[0051] As used in this application, the terms "at least one", "multiple", "each", "any", etc., "at least one" includes one, two or more, "multiple" includes two or more, "each" refers to each of the corresponding multiples, and "any" refers to any one of the multiples.
[0052] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0053] Currently, business systems often encounter situations where complex, hierarchical, and structurally uncertain parameter data needs to be transmitted.
[0054] In related technologies, hard-coding is often used to handle parameters with different structures. However, in practical applications, it has been found that this approach makes the parameter processing logic complex and difficult to maintain, especially in the fintech field. The data structure of parameter data in various business scenarios cannot be completely determined in advance and may change over time. Once the parameter structure changes, a large amount of code often needs to be refactored.
[0055] In view of this, this application provides a parameter data transmission method, apparatus, electronic device, and storage medium. Through a recursive parameter processing mechanism, data is parsed and encapsulated to construct a tree-structured parameter data, improving the efficiency, flexibility, and maintainability of data transmission. This not only adapts to dynamically changing parameter data structures but also simplifies data transmission complexity. It effectively meets the high-efficiency transmission needs of complex, hierarchical, and structurally uncertain parameter data in the fintech field. Furthermore, by automatically generating data transmission paths for each node, it ensures that all nodes in the entire tree structure are correctly mapped, facilitating subsequent calls to appropriate adapter interfaces for data transmission.
[0056] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirection to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data required for the proper functioning of these embodiments acquired.
[0057] The specific implementation methods of the embodiments of this application will be described in detail below with reference to the accompanying drawings. First, a parameter data transmission method provided in the embodiments of this application will be described with reference to the accompanying drawings.
[0058] Please refer to Figure 1 , Figure 1 This is a schematic diagram illustrating the implementation environment of a parameter data transmission method provided in this application embodiment. In this implementation environment, the main hardware and software components involved include a terminal processor 110 and a server 120.
[0059] Specifically, the terminal processor 110 may be equipped with a control program for a related parameter data transmission method, and the server 120 serves as the backend server for this control program. The terminal processor 110 and the backend server 120 are connected via a communication link. The parameter data transmission method provided in this embodiment can be executed on the terminal processor 110 side.
[0060] Server 120 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0061] In addition, server 120 can also be a node server in a blockchain network.
[0062] The terminal processor 110 and the server 120 can establish a communication connection via a wireless network. This wireless network uses standard communication technologies and / or protocols. The network can be the Internet or any other network, including but not limited to a Local Area Network (LAN), Metropolitan Area Network (MAN), Wide Area Network (WAN), mobile, or any combination of wireless networks, private networks, or virtual private networks. Furthermore, these hardware and software components can use the same or different communication connection methods; this application does not impose specific limitations in this regard.
[0063] Of course, this is understandable. Figure 1 The implementation environment described in this application is only one of the optional application scenarios for the parameter data transmission method provided in this embodiment. The actual application is not fixed. Figure 1 The software and hardware environment shown is not specifically limited in this application.
[0064] like Figure 2 As shown, Figure 2 This is a flowchart illustrating a parameter data transmission method provided in an embodiment of this application, specifically including but not limited to steps 100 to 300.
[0065] Step 100: Obtain the original parameter data to be transmitted.
[0066] In this embodiment of the application, the original parameter data to be transmitted can be complex, hierarchical, and structurally unstable parameter data that needs to be transmitted in the business system.
[0067] For example, a business system needs to transmit complex configuration parameter data, which may include user information, transaction information, and historical records. Each data field contains different data types and hierarchical structures. For instance, the user information data field may contain user uid, user name, and user card binding information, while the user card binding information may further contain bank card number, bank account opening code, and other data types, forming hierarchical raw parameter data.
[0068] Step 200: Invoke the recursive parameter processing mechanism to encapsulate the original parameter data to obtain tree-structured parameter data, and construct a recursive parameter mapping; wherein, the recursive parameter mapping is used to record the mapping relationship between each node in the tree-structured parameter data and the transmission path;
[0069] In this application embodiment, since different business scenarios will have different data structures, for complex and unstable raw parameter data, this application adopts a combination of variable tree structure and recursive parameter processing mechanism. The tree structure is used to transmit complex hierarchical data, which can adapt to raw parameter data of different types, levels and sizes. By introducing a recursive parameter processing mechanism, the raw parameter data is traversed and recursively processed layer by layer to determine the hierarchical relationship between different data fields. This avoids the situation in related technologies where hard coding is used, which requires fixing data, configuration or logic in the source code, which greatly affects the flexibility and maintainability of the code. Whenever business requirements change and the parameter structure changes, a large amount of code needs to be refactored.
[0070] Among them, the Flexible Tree Structure is a structure used to represent and transmit hierarchical, complex parameter data. A tree structure consists of nodes and edges, where each node can contain different data types and child nodes (child parameters). In the embodiments of this application, the tree structure not only supports multi-level complex data but also dynamically adapts to changes in business needs, flexibly expanding different parameter types and levels.
[0071] Furthermore, through a supporting front-end interface, when operators input configuration parameters, they can add child fields to generate child nodes in the tree structure. Mapping relationships are then constructed by inputting specific key values for relevant data fields. Each node in the variable tree structure can dynamically add or delete child nodes according to changes in business needs, flexibly adapting to different types of data. By utilizing the tree structure, data fields are organized hierarchically, clearly expressing the relationships between data fields. This is suitable for complex hierarchical data structures, such as user information, transaction information, and historical records. Moreover, it can store not only basic data types (such as strings and numbers) but also more complex object types or array types, providing greater flexibility when handling diverse data.
[0072] Furthermore, the recursive parameter handling mechanism refers to a method that processes multi-level raw parameter data structures recursively, transforming raw data (such as user information) into a tree structure with different levels. The core of this transformation process is to recursively process each data item and construct a hierarchical tree structure based on the nesting level of the data. Building recursive parameter mappings involves traversing the tree structure and automatically generating a corresponding data transmission path (e.g., JSONPath, paramMappings) for each node. In other words, the system generates recursive parameter mappings for subsequent data transmission and processing. Each child node is mapped to a specific jsonPath or paramMappings. The recursive algorithm ensures that all nodes in the entire tree are correctly mapped, facilitating the unified and automatic transmission of this data to the target system. Understandably, by constructing a recursive parameter mapping, as the configuration increases and the tree becomes deeper, it is not necessary to manually write the mapping rules one by one. The recursive algorithm can automatically generate and record the mapping relationships of different child nodes. At the same time, the mapping paths of all nodes are uniformly generated according to the tree structure, which can avoid problems such as human operation errors or omissions, and ensure data consistency and transmission stability.
[0073] For example, when the original parameter data to be transmitted is obtained, such as user information, the format may be JSON, database record or other types of data structure, containing multiple fields (such as user Uid, card binding information, etc.), some of which (such as card binding information) may contain nested sub-data. Through a recursive mechanism, the original data is traversed layer by layer, a child node is built for each data field, and its corresponding key value is assigned.
[0074] Step 300: Call the adapter interface that matches the data format of the tree structure parameter data, and transmit the tree structure parameter data according to the recursive parameter mapping.
[0075] In this embodiment, by calling an adapter interface that matches the data format of the tree structure parameter data, the data format of the tree structure parameter data can be quickly converted into the target format using the adapter interface. Furthermore, by using a recursive parameter processing mechanism to encapsulate the original parameter data and obtain the tree structure parameter data, the tree structure parameter data can be transmitted to the target terminal, thereby efficiently completing the parameter data transmission process.
[0076] In practical applications, different nodes in the tree structure parameter data can be assigned to corresponding data transmission paths based on the constructed recursive parameter mapping, thereby improving the data transmission stability of the tree structure parameter data.
[0077] Therefore, this application uses a recursive parameter processing mechanism to parse data, encapsulate and construct tree-structured parameter data, thereby improving the efficiency, flexibility, and maintainability of data transmission. It can not only adapt to dynamically changing parameter data structures but also simplify the complexity of data transmission. It can effectively meet the high-efficiency transmission needs of complex, hierarchical, and structurally uncertain parameter data in the financial technology field. Furthermore, by automatically generating data transmission paths for each node, it ensures that all nodes in the entire tree structure are correctly mapped, facilitating subsequent calls to appropriate adapter interfaces for data transmission.
[0078] Specifically, as an optional implementation method, please refer to Figure 3 , Figure 3 This is a flowchart illustrating a recursive parameter processing procedure for raw parameter data provided in an embodiment of this application. The procedure involves invoking a recursive parameter processing mechanism to encapsulate the raw parameter data, obtaining tree-structured parameter data, and constructing a recursive parameter mapping, including:
[0079] Construct a root node; the root node is used to refer to the tree structure parameter data corresponding to the original parameter data to be transmitted;
[0080] The recursive parameter processing mechanism is invoked to traverse each data field in the original parameter data to be transmitted layer by layer, and each data field is converted into a child node in the tree structure parameter data.
[0081] Based on the nesting relationship of the data fields in the original parameter data, determine the hierarchical structure relationship of the child nodes in the tree structure parameter data;
[0082] Based on the hierarchical relationship of the child nodes in the tree structure parameter data, the original parameter data is encapsulated to obtain the tree structure parameter data, and the recursive parameter mapping is constructed.
[0083] In this embodiment of the application, the original parameter data is encapsulated by calling the recursive parameter processing mechanism. When constructing the tree structure parameter data, the root node of the tree structure can be constructed first, and the root node is used to refer to the tree structure parameter data corresponding to the original parameter data that is prepared for transmission.
[0084] Furthermore, the recursive parameter processing mechanism is invoked, and each data field in the original parameter data is traversed layer by layer through recursion, and each data field is converted into a child node in the tree structure parameter data.
[0085] For example, the data fields in the original parameter data can include data fields of object type and data fields of basic data type (such as strings, numbers, etc.). For data fields of object type, a new child node can be created and its internal data fields can be recursively traversed. For data fields of basic data type, a new child node can be created and its corresponding value can be assigned.
[0086] Furthermore, since the child nodes in the tree structure correspond one-to-one with the data fields in the original parameter data, the hierarchical relationship between different child nodes in the tree structure parameter data can be determined based on the nesting relationship between different data fields in the original parameter data.
[0087] Finally, based on the hierarchical relationship of child nodes in the tree-structured parameter data, the original parameter data is encapsulated and further processed. A recursive parameter mapping can then be constructed; that is, the system generates recursive parameter mappings for subsequent data transmission and processing. Each child node is mapped to a specific jsonPath or paramMappings to facilitate its transmission to the target system. This ultimately yields the tree-structured parameter data, enabling subsequent parameter data transmission.
[0088] Specifically, as an optional implementation, the step of calling an adapter interface that matches the data format of the tree structure parameter data and transmitting the tree structure parameter data according to the recursive parameter mapping includes:
[0089] Determine the data format of the tree structure parameter data;
[0090] Call the adapter interface to determine whether the adapter interface supports the data format of the tree structure parameter data;
[0091] If the adapter interface supports the data format of the tree structure parameter data, the data format of the tree structure parameter data is converted into the target format according to the adapter interface, and the converted tree structure parameter data is transmitted according to the recursive parameter mapping.
[0092] If the adapter interface does not support the data format of the tree structure parameter data, an adapter class is constructed, defining the processing rules for converting the data format of the tree structure parameter data to the target format, and the adapter class is registered to the adapter interface, so that the adapter interface supports the data format of the tree structure parameter data, and the adapter interface is called to convert the data format of the tree structure parameter data to the target format, thereby transmitting the converted tree structure parameter data according to the recursive parameter mapping.
[0093] In this embodiment, after the tree structure parameter data and its recursive parameter mapping are generated, the system uses an adapter interface to convert this tree data into a suitable format (such as JSON, XML, message queue, etc.) and transmits it through a specified interface or protocol. Each nested object and data field is transmitted in a recursive mapping manner to ensure that the data is not lost during transmission and can be correctly parsed by the target system.
[0094] Among them, the adapter interface is a structural design pattern whose main goal is to convert originally incompatible interfaces into a unified interface that the system can recognize and use. This is mainly achieved by creating an adapter class to convert the data structures of different interfaces into a unified format, so that the system can use these different data structures or business rules transparently without modifying existing code.
[0095] For example, firstly, the data format of the tree structure parameter data is determined, and then the adapter interface is called to determine whether the current adapter interface supports the data format of the tree structure parameter data.
[0096] Furthermore, if the adapter interface supports the data format of the tree structure parameter data, the data format of the tree structure parameter data is converted to the target format through the invoked adapter interface. Then, through the specified interface and protocol, according to the constructed recursive parameter mapping and the preset data transmission path, the converted tree structure parameter data is transmitted to the target terminal or target system. If the adapter interface does not support the data format of the tree structure parameter data, a new adapter class can be constructed. The processing rules for converting the data format of the tree structure parameter data to the target format are defined in this adapter class. This adapter class is then registered with the adapter interface, enabling the adapter interface to support the data format of the tree structure parameter data. The data format of the tree structure parameter data is then converted to the target format through the adapter interface. Finally, through the specified interface and protocol, according to the constructed recursive parameter mapping and the preset data transmission path, the converted tree structure parameter data is transmitted to the target terminal or target system.
[0097] In other words, when business requirements change and the data format of parameter data changes, this application embodiment updates and adjusts the adapter class in the adapter interface without modifying the business logic of the calling data. It converts the data structure of different interfaces into a unified data format, which can effectively adapt to changes in business requirements and dynamically changing parameter structures, improve the scalability of the parameter transmission system, effectively support new types of data structures or rules, and quickly access them through the adapter interface, reducing the system's dependence on external changes and improving scalability.
[0098] In practical applications, abstraction layer design can also be introduced. Abstraction layer design is a software architecture design concept that separates business logic from implementation details by introducing abstraction layers, providing clear interfaces and reducing direct dependence on the underlying implementation. Abstraction layers are typically used to abstract the functions and interfaces of different modules, making the system easier to extend, maintain, and replace.
[0099] For example, by introducing an abstraction layer, when the system needs to be expanded or adjusted, adjustments only need to be made at the abstraction layer without affecting other parts of the system. The abstraction layer defines a unified interface, making the dependencies between modules clear and the interactions between modules more standardized, thereby improving the maintainability of the system and enabling the introduction of new functions or changes in implementation without affecting other modules.
[0100] like Figure 4 As shown, Figure 4 This is a flowchart illustrating another parameter data transmission method provided in this application embodiment, specifically including but not limited to steps 400 to 500.
[0101] Step 400: Receive tree structure parameter data; wherein, the tree structure parameter data is obtained by calling the recursive parameter processing mechanism to encapsulate the original parameter data.
[0102] Step 500: Invoke the recursive parameter processing mechanism to recursively parse the tree structure parameter data to obtain the original parameter data corresponding to the tree structure parameter data.
[0103] In this embodiment of the application, after the target system or target terminal receives the tree structure parameter data transmitted by the system, it can further perform recursive parsing processing on the tree structure parameter data to obtain the original parameter data corresponding to the tree structure parameter data, thereby ensuring that the tree structure parameter data can be correctly parsed and utilized at the receiving end.
[0104] In practical applications, as an optional implementation method, please refer to... Figure 5 , Figure 5This is a flowchart illustrating a recursive parsing process for tree structure parameter data provided in an embodiment of this application. The recursive parameter processing mechanism is invoked to recursively parse the tree structure parameter data to obtain the original parameter data corresponding to the tree structure parameter data, including:
[0105] Determine the root node of the tree structure parameter data;
[0106] Starting from the root node, the recursive parameter processing mechanism is invoked to traverse and parse the child nodes of the tree structure parameter data layer by layer, and to determine the data field corresponding to each child node.
[0107] Based on the hierarchical relationship of the child nodes in the tree structure parameter data, determine the nesting relationship of the data fields in the original parameter data;
[0108] Based on the nesting relationship of the data fields in the original parameter data, the original parameter data corresponding to the tree structure parameter data is restored.
[0109] In this embodiment of the application, after receiving the tree structure parameter data, the recursive parameter processing mechanism can be invoked to recursively parse the tree structure parameter data.
[0110] Specifically, first determine the root node of the tree structure parameter data. In the tree structure parameter data, different values can be used to represent different types of data fields. For example, 0 can be used to represent string type data fields, 1 to represent object type data fields, 2 to represent array type data fields, 3 to represent numeric type data fields, and 4 to represent boolean type data fields.
[0111] Furthermore, taking the tree structure parameter data in JSON format as an example, starting from the root node, each child node in the tree structure is traversed layer by layer, and the data field corresponding to each child node is determined. The child nodes of the tree structure parameter data correspond one-to-one with the data fields in the original parameter data.
[0112] Specifically, by determining the data field of each property, for each child node, its data type can be determined. If it is an object type, it can be further processed recursively. If it is a basic data type, it can be directly converted and added to paramMappings.
[0113] Furthermore, based on the hierarchical relationship of the child nodes in the tree structure parameter data, the nesting relationship of the data fields in the original parameter data is restored and determined, and the recursive parameter mapping relationship of the tree structure parameter data is read. In the recursive parameter mapping relationship, each data field can correspond to a mapping object, which includes the field name and the pointing path.
[0114] Finally, after completing the recursive traversal processing of the tree structure parameter data, the data fields corresponding to each child node and the nesting relationships between the data fields can be determined, and the original parameter data corresponding to the tree structure parameter data can be restored.
[0115] Specifically, as an optional implementation, the method further includes:
[0116] In response to a triggered data transmission exception command, execute the parameter data rollback strategy;
[0117] The parameter data rollback strategy includes rolling back the parameter data to a preset value and initiating a parameter data transmission retransmission request.
[0118] In this embodiment of the application, when the sending end transmits tree structure parameter data to the receiving end, data type and data format verification can be performed in real time to ensure data legality, reduce the risk of system errors, and improve security.
[0119] For example, after receiving the tree structure parameter data, the receiving end can check the data type through type conversion and the instanceof keyword, or it can verify the data type and format through regular expressions and other methods.
[0120] Furthermore, when data type or data format verification fails, or when abnormal situations such as network drop occur during transmission, the receiving end will generate and respond to the triggered data transmission abnormality command and begin to execute the parameter data rollback strategy.
[0121] The parameter data rollback strategy includes rolling back parameter data to preset values and initiating a parameter data transmission retransmission request, thereby effectively ensuring the security of the system at the receiving end.
[0122] In practical applications, when parameter data transmission errors or parameter data parsing failures occur, the system can automatically restore the parameter data at the receiving end to the preset value and re-initiate a parameter data transmission retransmission request to the sending end, ensuring that the system does not interrupt service when encountering errors.
[0123] Therefore, by configuring data type verification, data format verification, and fault tolerance mechanisms in case of data transmission anomalies, the embodiments of this application can reduce the risk of illegal data transmission and improve the stability and availability of the system.
[0124] The parameter data transmission method provided in this invention will be explained and described in detail below, with reference to a specific application implementation process:
[0125] In this embodiment of the application, a parameter data transmission method is provided. This method can be applied to scenarios where business systems transmit parameter data. By utilizing a recursive parameter processing mechanism, the original parameter data is parsed layer by layer, and the data is encapsulated to construct a tree-structured parameter data, thereby improving the efficiency, flexibility, and maintainability of parameter data transmission. By utilizing the child nodes of different levels of the tree structure, it can not only adapt to dynamically changing parameter data structures, but also simplify the complexity of parameter data transmission.
[0126] Specifically, the original parameter data to be transmitted is first obtained, and the original parameter data is encapsulated by calling the recursive parameter processing mechanism to construct a tree-structured parameter data.
[0127] Furthermore, the recursive parameter processing mechanism is invoked, and each data field in the original parameter data is traversed layer by layer through recursion, and each data field is converted into a child node in the tree structure parameter data.
[0128] Furthermore, since the child nodes in the tree structure correspond one-to-one with the data fields in the original parameter data, the hierarchical relationship between different child nodes in the tree structure parameter data can be determined based on the nesting relationship between different data fields in the original parameter data.
[0129] Finally, based on the hierarchical relationship of child nodes in the tree-structured parameter data, the original parameter data is encapsulated and further processed. A recursive parameter mapping can then be constructed; that is, the system generates recursive parameter mappings for subsequent data transmission and processing. Each child node is mapped to a specific jsonPath or paramMappings to facilitate its transmission to the target system. This ultimately yields the tree-structured parameter data, enabling subsequent parameter data transmission.
[0130] Furthermore, once the tree-structured parameter data and its recursive parameter mappings are generated, the system will use an adapter interface to convert this tree-structured data into a suitable format (such as JSON, XML, message queues, etc.) and transmit it through a specified interface or protocol. Each nested object and data field will be transmitted in a recursive mapping manner to ensure that no data is lost during transmission and that it can be correctly parsed by the target system.
[0131] If the adapter interface supports the data format of the tree structure parameter data, the data format of the tree structure parameter data is converted to the target format by calling the adapter interface, and the converted tree structure parameter data is transmitted to the target terminal or target system through the specified interface and protocol. If the adapter interface does not support the data format of the tree structure parameter data, a new adapter class can be constructed, and the processing rules for converting the data format of the tree structure parameter data to the target format can be defined in the adapter class. The adapter class can then be registered with the adapter interface, so that the adapter interface can support the data format of the tree structure parameter data.
[0132] Furthermore, after the target system or target terminal receives the tree structure parameter data transmitted by the system, it can further perform recursive parsing processing on the tree structure parameter data to obtain the original parameter data corresponding to the tree structure parameter data, thereby ensuring that the tree structure parameter data can be correctly parsed and utilized at the receiving end.
[0133] In practical applications, after receiving the tree structure parameter data, the recursive parameter processing mechanism can be invoked to recursively parse and process the tree structure parameter data.
[0134] Specifically, first, the root node of the tree structure parameter data is determined. Starting from the root node, each child node in the tree structure is traversed layer by layer, and the data field corresponding to each child node is determined. The child nodes of the tree structure parameter data correspond one-to-one with the data fields in the original parameter data.
[0135] Furthermore, based on the hierarchical relationship of the child nodes in the tree structure parameter data, the nesting relationship of the data fields in the original parameter data is restored and determined, and the recursive parameter mapping relationship of the tree structure parameter data is read. In the recursive parameter mapping relationship, each data field can correspond to a mapping object, which includes the field name and the pointing path.
[0136] Finally, after completing the recursive traversal processing of the tree structure parameter data, the data fields corresponding to each child node and the nesting relationships between the data fields can be determined, and the original parameter data corresponding to the tree structure parameter data can be restored.
[0137] When the sending end transmits tree structure parameter data to the receiving end, data type and data format verification can be performed in real time to ensure data legality, reduce the risk of system errors, and improve security.
[0138] For example, after receiving the tree structure parameter data, the receiving end can check the data type through type conversion and the instanceof keyword, or it can verify the data type and format through regular expressions and other methods.
[0139] Furthermore, when data type or data format verification fails, or when abnormal situations such as network drop occur during transmission, the receiving end will generate and respond to the triggered data transmission abnormality command and begin to execute the parameter data rollback strategy.
[0140] The parameter data rollback strategy includes rolling back parameter data to preset values and initiating a parameter data transmission retransmission request, thereby effectively ensuring the security of the system at the receiving end.
[0141] In practical applications, when parameter data transmission errors or parameter data parsing failures occur, the system can automatically restore the parameter data at the receiving end to the preset value and re-initiate a parameter data transmission retransmission request to the sending end, ensuring that the system does not interrupt service when encountering errors.
[0142] Please see Figure 6 , Figure 6 This is a schematic diagram of a parameter data transmission device provided in an embodiment of this application. This application also provides a parameter data transmission device that can implement the above-described parameter data transmission method. The device includes:
[0143] The data acquisition module 610 is used to acquire the raw parameter data to be transmitted;
[0144] The data processing module 620 is used to call the recursive parameter processing mechanism to encapsulate the original parameter data, obtain tree-structured parameter data, and construct a recursive parameter mapping; wherein, the recursive parameter mapping is used to record the mapping relationship between each node in the tree-structured parameter data and the transmission path;
[0145] The data transmission module 630 is used to call an adapter interface that matches the data format of the tree structure parameter data, and to transmit the tree structure parameter data according to the recursive parameter mapping.
[0146] Please see Figure 7 , Figure 7 This is a schematic diagram of another parameter data transmission device provided in an embodiment of this application. This application also provides another parameter data transmission device that can implement the above-described parameter data transmission method. The device includes:
[0147] The data receiving module 710 is used to receive tree structure parameter data; wherein, the tree structure parameter data is obtained by calling a recursive parameter processing mechanism to encapsulate the original parameter data;
[0148] The data parsing module is used to call the recursive parameter processing mechanism to perform recursive parsing processing 720 on the tree structure parameter data to obtain the original parameter data corresponding to the tree structure parameter data.
[0149] It is understood that the content of the above method embodiments is applicable to the present device embodiments. The specific functions implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0150] Please see Figure 8 , Figure 8 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. The electronic device includes:
[0151] The processor 801 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.
[0152] The memory 802 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 802 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 802 and is called and executed by the processor 801 using the parameter data transmission method of the embodiments of this application.
[0153] The 803 input / output interface is used to implement information input and output.
[0154] The communication interface 804 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0155] Bus 805 transmits information between various components of the device (e.g., processor 801, memory 802, input / output interface 803, and communication interface 804);
[0156] The processor 801, memory 802, input / output interface 803, and communication interface 804 are connected to each other within the device via bus 805.
[0157] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described parameter data transmission method.
[0158] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0159] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0160] This application provides a parameter data transmission method, apparatus, electronic device, and storage medium. It parses data through a recursive parameter processing mechanism, encapsulates and constructs a tree-structured parameter data, improving the efficiency, flexibility, and maintainability of data transmission. It can not only adapt to dynamically changing parameter data structures but also simplify data transmission complexity. It effectively meets the high-efficiency transmission needs of complex, hierarchical, and structurally uncertain parameter data in the fintech field. Furthermore, by automatically generating a data transmission path for each node, it ensures that all nodes in the entire tree structure are correctly mapped, facilitating subsequent calls to appropriate adapter interfaces for data transmission.
[0161] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0162] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0163] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0164] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0165] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application 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 application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0166] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0167] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0168] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0169] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0170] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0171] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A parameter data transmission method, characterized in that, The method includes the following steps: Obtain the raw parameter data to be transmitted; The recursive parameter processing mechanism is invoked to encapsulate the original parameter data, resulting in tree-structured parameter data, and a recursive parameter mapping is constructed. The recursive parameter mapping is used to record the mapping relationship between each node in the tree-structured parameter data and the transmission path. Invoke the adapter interface that matches the data format of the tree structure parameter data, and transmit the tree structure parameter data according to the recursive parameter mapping.
2. The parameter data transmission method according to claim 1, characterized in that, The recursive parameter processing mechanism encapsulates the original parameter data to obtain tree-structured parameter data and constructs a recursive parameter mapping, including: Construct a root node; the root node is used to refer to the tree structure parameter data corresponding to the original parameter data to be transmitted; The recursive parameter processing mechanism is invoked to traverse each data field in the original parameter data to be transmitted layer by layer, and each data field is converted into a child node in the tree structure parameter data. Based on the nesting relationship of the data fields in the original parameter data, determine the hierarchical structure relationship of the child nodes in the tree structure parameter data; Based on the hierarchical relationship of the child nodes in the tree structure parameter data, the original parameter data is encapsulated to obtain the tree structure parameter data, and the recursive parameter mapping is constructed.
3. The parameter data transmission method according to claim 1, characterized in that, The step of calling an adapter interface that matches the data format of the tree structure parameter data and transmitting the tree structure parameter data according to the recursive parameter mapping includes: Determine the data format of the tree structure parameter data; Call the adapter interface to determine whether the adapter interface supports the data format of the tree structure parameter data; If the adapter interface supports the data format of the tree structure parameter data, the data format of the tree structure parameter data is converted into the target format according to the adapter interface, and the converted tree structure parameter data is transmitted according to the recursive parameter mapping. If the adapter interface does not support the data format of the tree structure parameter data, an adapter class is constructed, defining the processing rules for converting the data format of the tree structure parameter data to the target format, and the adapter class is registered to the adapter interface, so that the adapter interface supports the data format of the tree structure parameter data, and the adapter interface is called to convert the data format of the tree structure parameter data to the target format, thereby transmitting the converted tree structure parameter data according to the recursive parameter mapping.
4. A parameter data transmission method, characterized in that, The method includes the following steps: Receive tree structure parameter data; wherein, the tree structure parameter data is obtained by calling a recursive parameter processing mechanism to encapsulate the original parameter data; The recursive parameter processing mechanism is invoked to recursively parse the tree structure parameter data to obtain the original parameter data corresponding to the tree structure parameter data.
5. The parameter data transmission method according to claim 4, characterized in that, The recursive parameter processing mechanism recursively parses the tree structure parameter data to obtain the original parameter data corresponding to the tree structure parameter data, including: Determine the root node of the tree structure parameter data; Starting from the root node, the recursive parameter processing mechanism is invoked to traverse and parse the child nodes of the tree structure parameter data layer by layer, and to determine the data field corresponding to each child node. Based on the hierarchical relationship of the child nodes in the tree structure parameter data, determine the nesting relationship of the data fields in the original parameter data; Based on the nesting relationship of the data fields in the original parameter data, the original parameter data corresponding to the tree structure parameter data is restored.
6. The parameter data transmission method according to claim 4, characterized in that, The method further includes: In response to a triggered data transmission exception command, execute the parameter data rollback strategy; The parameter data rollback strategy includes rolling back the parameter data to a preset value and initiating a parameter data transmission retransmission request.
7. A parameter data transmission device, characterized in that, The device includes: The data acquisition module is used to acquire the raw parameter data to be transmitted; The data processing module is used to call the recursive parameter processing mechanism to encapsulate the original parameter data, obtain tree-structured parameter data, and construct a recursive parameter mapping; wherein, the recursive parameter mapping is used to record the mapping relationship between each node in the tree-structured parameter data and the transmission path; The data transmission module is used to call an adapter interface that matches the data format of the tree structure parameter data, and to transmit the tree structure parameter data according to the recursive parameter mapping.
8. A parameter data transmission device, characterized in that, The device includes: The data receiving module is used to receive tree structure parameter data; wherein, the tree structure parameter data is obtained by calling a recursive parameter processing mechanism to encapsulate the original parameter data; The data parsing module is used to call the recursive parameter processing mechanism to recursively parse the tree structure parameter data and obtain the original parameter data corresponding to the tree structure parameter data.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the parameter data transmission method according to any one of claims 1 to 6.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the parameter data transmission method according to any one of claims 1 to 6.
Citation Information
Patent Citations
JSON (JavaScript Object Notation) data conversion method and device, computer equipment and storage medium
CN112882974A
Method and device for realizing self-adaptive display of service data and electronic equipment
CN113553330A
Parameter transmission method and device based on tree structure, equipment and medium
CN113590348A
Data processing method and device, electronic equipment and storage medium
CN119248288A