An interface data transfer method and data transfer system
Through the collaborative cooperation of components such as parameter assemblers, efficient and flexible processing of interface data flow is achieved, which solves the problem of low efficiency of interface data flow in the existing technology, provides flexible data processing and secure transmission mechanisms, and adapts to agile development. need.
Patent Information
- Application Number
- CN202210280484.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-22
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2042-03-22
AI Technical Summary
The existing technology has a single function when transferring interface data, cannot effectively support complex business processing, is inefficient, and is not suitable for agile development. In particular, frequent modifications are required when querying interface input and output parameters, resulting in cumbersome processing and inefficiency. Low.
Through the collaborative cooperation of parameter assembler, parameter parser, parameter converter, object parser, object converter, data processor, data permission processor and preset processing templates, flexible authorization of incoming and outgoing parameter data is realized. Conversion and processing support serial processing of multiple data processors, and add encryption, decryption, logging and monitoring processing to data transmission.
It achieves high efficiency and flexibility in interface data flow, reduces dependence on business logic, improves data processing efficiency and security, and supports flexible configuration and monitoring notifications.
Smart Images

Figure CN114879963B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer communications, and in particular to an interface data transfer method and a data transfer system. Background Art
[0002] During the development process, the data requested by the front-end needs to be processed before being passed to the back-end, and the data returned by the back-end also needs to be processed before being returned to the front-end. Therefore, it is necessary to establish data processing logic and different data objects to perform data conversion processing; the existing technology has a single function when transferring interface data, and cannot effectively support complex business processing. When querying interface data input parameters, parameters can only be transferred according to the fields set by the query interface. When the business logic changes, the interface input parameter fields can only be modified. If the query conditions are changed frequently, the interface can only be modified passively. When querying interface data output parameters, the data object can only be simply thrown out. If data processing is performed, it can only be performed at the business level, which is inefficient and cumbersome to handle. In the face of agile development, it is not a good way. Therefore, it is urgent to develop an efficient data flow method to overcome the drawbacks of the current interface data flow. Summary of the invention
[0003] The purpose of the present invention is to provide an interface data transfer method and a data transfer system. The present invention implements efficient interface data transfer by flexibly authorizing, converting and processing input and output parameter data.
[0004] In one aspect of the present invention, a method for transferring interface data is provided, wherein the transfer of interface data is realized by the coordinated cooperation of a parameter assembler, a parameter parser, a parameter converter, an object parser, an object converter, a data processor, a data authority processor and a preset processing template; the preset processing template is configured with input parameter rules and output parameter rules;
[0005] The data flow specifically includes the following steps:
[0006] S1. Assemble the input parameter data at the front end through the parameter assembler, and pass it to the back end interface after assembly;
[0007] S2. parse the input parameter data assembled in step S1 through the parameter parser and parse it into a data object that can be processed by the backend;
[0008] S3. Use the parameter converter to convert the input parameter data parsed in step S2 into structured data that can be processed by the backend interface according to the input parameter rules configured in the preset processing template;
[0009] S4, calling the data processor to process the input parameter data converted in step S3;
[0010] S5. After the input parameter data is processed by steps S1 to S4, a backend interface call is performed. The backend interface returns an output parameter data, and the output parameter data is parsed into a processable data object through the object parser;
[0011] S6. Using the object converter, the parameter output data parsed in step S5 is further converted into the structured data required for parameter output according to the parameter output rules configured in the preset processing template;
[0012] S7, calling the data processor to process the output parameter data converted in step S6;
[0013] S8. Call the data permission processor to obtain the output parameter data returned to the front end according to the output parameter rules configured in the preset processing template.
[0014] In the aforementioned interface data flow method, in step S4, the part of the input parameter data that needs to be processed by the corresponding processor is first determined, and one input parameter data can be processed by multiple data processors in sequence.
[0015] In the aforementioned interface data flow method, in step S7, the part of the parameter data that needs to be processed by the corresponding processor is first determined, and one output parameter data can be processed by multiple data processors in sequence.
[0016] Another aspect of the present invention provides a data flow system for implementing the aforementioned interface data flow method, including a parameter assembler, a parameter parser, a parameter converter, an object parser, an object converter, a data processor, a data permission processor, a preset processing template, an encryption and decryption processor, a log processor and a monitoring processor.
[0017] In the aforementioned interface data flow system, the encryption and decryption processor is used for decrypting input parameter data and encrypting output parameter data;
[0018] Before parsing the input data in step S2, the encryption and decryption processor first determines whether the input data is encrypted. If the input data is encrypted, a data decryption operation is first performed on it.
[0019] After the final output parameter data is obtained in step S8, the encryption and decryption processor determines whether the output parameter data needs to be encrypted. If the output parameter data needs to be encrypted, an encryption operation is performed on it.
[0020] In the aforementioned interface data flow system, the log processor is used to record input parameter operations and output parameter operations;
[0021] After step S4 is completed, the log processor is called to log the input operations from step S1 to step S4;
[0022] After step S8 is completed, the log processor is called to log the parameter output operations from step S5 to step S8.
[0023] In the aforementioned interface data flow system, the monitoring processor monitors the entire process of each input and output operation. If an error occurs during the operation, a monitoring notification is issued via email, SMS or DingTalk notification.
[0024] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0025] 1. When passing parameters to the query interface, the query interface no longer relies on the fields set by the query interface. The parameters can be flexibly assembled for passing parameters. The query interface needs to be configured in the corresponding preset processing template. Through the configured parameter entry rules, only the query field needs to be configured and delegated;
[0026] 2. When solving the query interface output, it is no longer necessary to create a data object for each output. You only need to configure it through the corresponding preset processing template, process the output data object through the configured output rule, select the required field for output, and configure the meaning of the field to facilitate understanding of the meaning of the output data field;
[0027] 3. When the query interface outputs parameters, field data needs to be processed. The data can be processed by the data processor and no longer needs to be processed separately in the business. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is a structural schematic diagram of the interface data flow system of the present invention. DETAILED DESCRIPTION
[0029] The present invention is further described below in conjunction with the accompanying drawings and embodiments, but they are not intended to limit the present invention.
[0030] Embodiment: An interface data transfer system, the system structure is as follows Figure 1 As shown, including:
[0031] 1. Parameter Assembler: Since data flow is efficient and flexible, manual assembly of parameter data is prone to errors and cumbersome, so the parameter assembler is introduced. The parameter assembler can be used to assemble the parameter data quickly and safely.
[0032] 2. Parameter parser: After the front-end input parameter data is assembled by the parameter assembler and passed to the back-end interface, it is first necessary to parse the input parameter data into a processable parameter data object;
[0033] 3. Parameter converter: Configure input parameter rules in the preset processing template. The parameter converter will convert the input parameter data. During the conversion process, if the input parameter data is compliant, it will be released, and if it is not compliant, it will be rejected. According to the preset rules, the input parameter data will be converted into the data type that can be processed by the backend interface;
[0034] 4. Object parser: After a series of logical processing, the backend interface will return an initial data. Through the object parser, the data can be parsed into a processable data object;
[0035] 5. Object converter: Configure the output parameter rules in the preset processing template. Through the object converter, the data returned by the backend interface can be converted into the structured data required for the output parameter;
[0036] 6. Data processor: During the input parameter parsing or output parameter parsing process, each data can be processed. As long as the corresponding data processor is configured, the input parameter data or output parameter data will be further processed, and each data can be processed by multiple data processors in sequence;
[0037] 7. Data permission processor: generally refers to the back-end parameter data permission, configure data permission, different types of visitors call the same interface, due to different roles or permissions, the returned parameter data fields will also be different, to achieve the purpose of data security;
[0038] 8. Preset processing template: Each data call interface will have a preset processing template. Each template is divided into two parts, one is the input parameter template and the other is the output parameter template;
[0039] The main configuration of the input template: parameter configuration, encryption and decryption configuration, and data processor configuration;
[0040] The main configuration of the parameter output template: object parsing configuration, encryption and decryption configuration, data processor configuration, and data permission configuration;
[0041] 9. Encryption and decryption processor: For data transmission security, the input data is generally encrypted, so the back-end interface decrypts the data before parsing it. The output data is encrypted after parsing, and the front-end will decrypt the data accordingly, thus achieving the purpose of data security circulation;
[0042] 10. Log processor: Each time an interface is called, a log data will be generated, which can be recorded in the database or printed in a log file to facilitate troubleshooting of interface call problems;
[0043] 11. Monitor the processor: monitor the entire process of each input and output parameter processing. If an error is reported during the processing, monitoring notifications can be provided via email, SMS, DingTalk, etc.
[0044] The above interface data transfer system implements data transfer by specifically including the following steps:
[0045] S1. Assemble the input parameter data at the front end through the parameter assembler, and pass it to the back end interface after assembly.
[0046] After step S1 is completed, the encryption and decryption processor first determines whether the input parameter data is encrypted. If the input parameter data is encrypted, a data decryption operation is first performed on it.
[0047] S2. The parameter parser parses the input parameter data assembled in step S1 into a data object that can be processed by the backend.
[0048] S3. Use the parameter converter to convert the input parameter data parsed in step S2 into structured data that can be processed by the backend interface according to the input parameter rules configured in the preset processing template.
[0049] S4. Call the data processor to process the input parameter data converted in step S3. First, determine the part of the input parameter data that needs to be processed by the corresponding processor. One input parameter data can be processed by multiple data processors in sequence.
[0050] After step S4 is completed, the log processor is called to log the input operations from step S1 to step S4.
[0051] S5. After the input parameter data is processed by steps S1 to S4, a backend interface call is made. The backend interface returns an output parameter data, which is parsed into a processable data object through the object parser.
[0052] S6. Use the object converter to further convert the output parameter data parsed in step S5 into the structured data required for output parameter according to the output parameter rules configured in the preset processing template.
[0053] S7. Call the data processor to process the output parameter data converted in step S6. First, determine the part of the output parameter data that needs to be processed by the corresponding processor. One output parameter data can be processed by multiple data processors in sequence.
[0054] S8. Call the data permission processor to obtain the output parameter data returned to the front end according to the output parameter rules configured in the preset processing template.
[0055] After the final output parameter data is obtained in step S8, the encryption and decryption processor determines whether the output parameter data needs to be encrypted. If the output parameter data needs to be encrypted, an encryption operation is performed on it.
[0056] Call the log processor to log the output parameter operation.
[0057] The above are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. An interface data transfer method, characterized in that: The interface data flow is realized through the coordinated cooperation of the parameter assembler, the parameter parser, the parameter converter, the object parser, the object converter, the data processor, the data authority processor and the preset processing template; the preset processing template is configured with input parameter rules and output parameter rules; The data flow specifically includes the following steps: S1. Assemble the input parameter data at the front end through the parameter assembler, and pass it to the back end interface after assembly; S2. parse the input parameter data assembled in step S1 through the parameter parser and parse it into a data object that can be processed by the backend; S3. Use the parameter converter to convert the input parameter data parsed in step S2 into structured data that can be processed by the backend interface according to the input parameter rules configured in the preset processing template; S4, calling the data processor to process the input parameter data converted in step S3; S5. After the input parameter data is processed by steps S1 to S4, a backend interface call is performed. The backend interface returns an output parameter data, and the output parameter data is parsed into a processable data object through the object parser; S6. Using the object converter, the parameter output data parsed in step S5 is further converted into the structured data required for parameter output according to the parameter output rules configured in the preset processing template; S7, calling the data processor to process the output parameter data converted in step S6; S8. Call the data permission processor to obtain the output parameter data returned to the front end according to the output parameter rules configured in the preset processing template.
2. The interface data transfer method according to claim 1, characterized in that: In step S4, the part of the input parameter data that needs to be processed by the corresponding processor is first determined. One input parameter data can be processed by multiple data processors in sequence.
3. The interface data transfer method according to claim 1, characterized in that: In step S7, the part of the parameter data that needs to be processed by the corresponding processor is first determined, and one parameter data can be processed by multiple data processors in sequence.
4. A data transfer system for implementing an interface data transfer method according to claim 1, 2 or 3, characterized in that: It includes parameter assembler, parameter parser, parameter converter, object parser, object converter, data processor, data permission processor, preset processing template, encryption and decryption processor, log processor and monitoring processor.
5. The interface data transfer system according to claim 4, characterized in that: The encryption and decryption processor is used for decrypting input parameter data and encrypting output parameter data; Before parsing the input data in step S2, the encryption and decryption processor first determines whether the input data is encrypted. If the input data is encrypted, a data decryption operation is first performed on it. After the final output parameter data is obtained in step S8, the encryption and decryption processor determines whether the output parameter data needs to be encrypted. If the output parameter data needs to be encrypted, an encryption operation is performed on it.
6. The interface data transfer system according to claim 4, characterized in that: The log processor is used to record input and output operations; After step S4 is completed, the log processor is called to log the input operations from step S1 to step S4; After step S8 is completed, the log processor is called to log the parameter output operations from step S5 to step S8.
7. The interface data transfer system according to claim 4, characterized in that: The monitoring processor monitors the entire process of each input and output operation. If an error occurs during the operation, a monitoring notification is issued via email, SMS or DingTalk notification.
