Method, device, electronic device and storage medium for data generation
By automating the data verification and transformation process, the problem of increased development tasks caused by frequent changes in data interaction between enterprise systems is solved, and efficient, stable, and resource-saving data interaction between systems is achieved.
Patent Information
- Application Number
- CN202211177604.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-23
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2042-09-23
AI Technical Summary
Frequent changes in data interaction between enterprise systems lead to a significant increase in development tasks, resulting in long development time, high costs, and low efficiency for developers, as well as unstable interactions between systems.
By obtaining data requests from the source system, determining the business interface, verification rules, and transformation rules based on the interface identifier, automatically performing data verification and transformation, generating target data, and transmitting it to the target system, thus avoiding manual development and code defects.
It improves the efficiency and stability of system data interaction, saves human resources, and reduces the generation of erroneous data.
Smart Images

Figure CN115525707B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and more particularly to a method, apparatus, electronic device and storage medium for data generation. Background Technology
[0002] Currently, as enterprises grow and expand, the number of application systems within them increases, and data interaction between these systems becomes more frequent. Due to rapid business changes, the number of interfaces between systems, field logic, and other aspects are also changing more and more. Therefore, developers need to recode to adapt to these changes.
[0003] Numerous business changes lead to a large number of development tasks, requiring a large number of developers. Developers need to spend a lot of time on requirements communication, and defects in the development process also lead to instability in the interaction between systems. The development cycle is too long, and the development speed cannot keep up with the changes in business, resulting in high labor costs, low efficiency, and uncontrollable quality. Therefore, improving the efficiency and stability of the interaction between the system's data interfaces has become an urgent technical problem to be solved. Summary of the Invention
[0004] This application provides a data generation method, apparatus, electronic device, and storage medium to solve all or part of the problems in the prior art.
[0005] In a first aspect, this application provides a method for generating data, the method comprising:
[0006] Obtain the data request sent by the source system. The data request includes the interface identifier of the target system.
[0007] The business interface, verification rules, and conversion rules corresponding to the interface identifier are determined based on the interface identifier.
[0008] Obtain the source data to be converted from the source system through the business interface. The source data includes at least one field.
[0009] According to the validation rules, the field value of each field in at least one field is validated, and the validation result of each field value is obtained.
[0010] Once it is confirmed that all validation results are successful, the field values of all fields are transformed according to the transformation rules to generate the target data.
[0011] Transmit the target data to the target system.
[0012] This method obtains data requests from the source system, retrieves the corresponding verification and conversion rules through the interface identifier in the data request, and performs corresponding data verification and conversion. It can automatically convert the source system data required by the target system without the need for development work due to system data interaction, saving human resources and improving the efficiency of system data interaction. Moreover, automatic conversion can also avoid code defects caused by manual development and improve the stability of data interaction between systems.
[0013] In conjunction with the first aspect, in the first embodiment of the first aspect of the present invention, after verifying the field value of each field in at least one field according to the verification rules and obtaining the verification result of each field value, the method further includes:
[0014] When the validation result of any field value is determined to be unsuccessful, the field with the unsuccessful validation result is sent to the source system so that the source system can correct the field with the unsuccessful validation result.
[0015] By sending fields that fail validation to the source system in this way, the source system can correct them based on the reason for the validation failure and then perform the conversion again, thereby reducing the generation of erroneous data.
[0016] In conjunction with the first aspect or the first embodiment of the first aspect, in the second embodiment of the first aspect of the present invention, when it is determined that all verification results are valid, the field values of all fields are converted according to the conversion rules to generate target data, including:
[0017] Based on the conversion rules, determine the conversion action corresponding to each field;
[0018] Based on the transformation action, the field values of all fields are transformed according to the transformation rules to generate the target data.
[0019] This method determines the conversion action based on the conversion rules and converts the data accordingly, thus meeting the different data format requirements between systems.
[0020] In conjunction with the second embodiment of the first aspect, in the third embodiment of the first aspect of the present invention, after transmitting the target data to the target system, the method further includes:
[0021] Based on the interface identifier, determine the control instructions for the target task corresponding to the interface identifier from multiple pre-configured task lists;
[0022] Run control commands to control the target system to perform the target task.
[0023] In this way, once the data conversion is complete, if there are related tasks that need to be run in the target system, the tasks can be started through the interface identifier without manual intervention, thus improving the system's efficiency.
[0024] In conjunction with the first aspect or the first embodiment of the first aspect, in the fourth embodiment of the first aspect of the present invention, after verifying the field value of each field in at least one field according to the verification rules and obtaining the verification result of each field value, the method further includes:
[0025] Get the field name of the first field;
[0026] Select the storage location corresponding to the first field from the target database based on the interface identifier and field name;
[0027] Store the first field in the storage location, where the first field is any field in the data request.
[0028] This method stores the fields used for data exchange between systems, making it easier to query and trace data.
[0029] Secondly, this application provides a data generation apparatus, the apparatus comprising:
[0030] The acquisition module is used to acquire data requests sent by the source system. The data requests include the interface identifier of the target system.
[0031] The determination module is used to determine the business interface, verification rules, and conversion rules corresponding to the interface identifier based on the interface identifier.
[0032] The processing module is used to obtain the source data to be transformed from the source system through the business interface. The source data includes at least one field.
[0033] The validation module is used to validate the field value of each field in at least one field according to the validation rules, and obtain the validation result of each field value.
[0034] The conversion module is used to convert the field values of all fields according to the conversion rules and generate the target data when it is determined that all validation results are valid.
[0035] The transmission module is used to transmit target data to the target system.
[0036] Optionally, the device may further include: a transmitting module;
[0037] The sending module is used to send the field whose validation result is failed to the source system when it is determined that the validation result of any field value is failed, so that the source system can correct the field whose validation result is failed.
[0038] Optionally, the device includes:
[0039] The determination module is also used to determine the conversion action corresponding to each field based on the conversion rules;
[0040] The transformation module is specifically used to transform the field values of all fields according to the transformation rules based on the transformation action, and generate the target data.
[0041] Optionally, the device may also include: an operating module;
[0042] The determination module is also used to determine the control instructions for the target task corresponding to the interface identifier from multiple pre-configured task lists based on the interface identifier;
[0043] The execution module is used to run control commands and control the target system to perform target tasks.
[0044] Optionally, the device may also include: a selection module and a storage module;
[0045] The module is also used to retrieve the field name of the first field;
[0046] The selection module is used to select the storage location corresponding to the first field from the target database based on the interface identifier and field name;
[0047] The storage module is used to store the first field in a storage location, where the first field is any field in the data request.
[0048] Thirdly, an electronic device is provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0049] Memory, used to store computer programs;
[0050] A processor, when executing a program stored in memory, implements the steps of a data generation method according to any embodiment of the first aspect.
[0051] Fourthly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of a data generation method as described in any embodiment of the first aspect. Attached Figure Description
[0052] Figure 1 This is a schematic flowchart of a data generation method provided in an embodiment of the present invention;
[0053] Figure 2 A flowchart of a data generation method provided by the present invention;
[0054] Figure 3 This is a schematic flowchart of a data conversion method provided in an embodiment of the present invention;
[0055] Figure 4 This is a schematic diagram of a data generation device provided in an embodiment of the present invention;
[0056] Figure 5 This is a schematic diagram of an electronic device structure provided in an embodiment of the present invention. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0058] To facilitate understanding of the embodiments of the present invention, further explanations and descriptions will be provided below with reference to the accompanying drawings and specific embodiments. These embodiments do not constitute a limitation on the embodiments of the present invention.
[0059] To address the technical problems mentioned in the background section, this application provides a data generation method, as detailed below. Figure 1 As shown, Figure 1 This is a schematic flowchart of a data generation method provided by an embodiment of the present invention. The method includes the following steps:
[0060] Step 110: Obtain the data request sent by the source system.
[0061] Specifically, the data request includes the interface identifier of the target system. A general interface platform can be developed, providing a common interface. When the source system and the target system need to interact with each other, the source system calls this interface. The interface platform then obtains the data request sent by the source system through the call request, and this data request includes the interface identifier of the target system.
[0062] In an optional example, for example Figure 2The general interface platform shown can adopt a Hypertext Transfer Protocol (HTTP) interface platform to develop a unified gateway interface based on HTTP. There is only one such interface, and all data interactions between the source system and the target system are conducted through this unified gateway interface. When a source system (e.g., an order system) needs to interface with a target system (e.g., a reconciliation system), i.e., when the target system needs data from the source system, the source system calls the unified gateway interface to request data. The HTTP interface platform then obtains the data request from the source system, and this request contains the interface identifier of the target system. Systems within an enterprise can act as both source and target systems, for example... Figure 2 The order system and payment system in the example can be the source system and the target system for each other. The order system and payment system are only used as examples, and the specific system should be determined according to the actual application of the enterprise.
[0063] Step 120: Determine the business interface, verification rules, and conversion rules corresponding to the interface identifier based on the interface identifier.
[0064] Specifically, when the source system and the target system interact with each other, the required business interfaces, verification rules, and transformation rules can be identified by the interface identifier. When the source system calls the general HTTP interface, it passes the interface identifier to the general interface platform. The general interface platform can determine the business interface, verification rules, and transformation rules corresponding to the interface identifier based on the interface identifier.
[0065] In an optional example, for example in Figure 2 In the HTTP general interface platform shown, the general interface platform can also set an interface definition module, a verification rule module, and a generation rule module. The interface definition module is responsible for defining the association information between each source system and each business interface of the general interface platform. The verification rule module is responsible for setting the verification rules for each business interface. The generation rule module can set the conversion rules for each interface. The business interface module, verification rule module, and generation rule module are identified by interface identifiers. Therefore, the business interface, verification rules, and conversion rules corresponding to the interface identifier can be determined by the interface identifier.
[0066] Step 130: Obtain the source data to be converted from the source system through the business interface.
[0067] Specifically, the source data includes at least one field. Once the business interface is determined based on the interface identifier, the source system can call the business interface to transfer the source data to be converted from the source system to the general interface platform.
[0068] In an optional example, for example in Figure 2In the HTTP generic interface platform shown, the interface definition module is used to define the association information between each source system and each business interface of the generic interface platform. The interface definition can be divided into interface header definition and interface line definition. The interface header definition describes the interface name, data type, start time, end time, interface description, interface status, etc. The interface line definition describes the detailed field information of the source system, specifically: title, generic field type, generic field, sequence number, value type, label, and field length, etc. The generic interface platform can obtain the source data to be converted from the source system through the interface line definition information.
[0069] Step 140: According to the verification rules, verify the field value of each field in at least one field and obtain the verification result of each field value.
[0070] Specifically, after determining the validation rules based on the interface identifier, the field values of each field in the source data are validated according to the validation rules.
[0071] In an optional example, for example in Figure 2 In the HTTP general interface platform shown, the conversion rule module is responsible for data validation. For example, based on the interface identifier, it determines that the validation rule for the TIME field in interface A is that it cannot be empty. Then, it checks whether the TIME field value in interface A is empty. If it is empty, the validation result is that the validation fails; if it is not empty, the validation result is that the validation passes. Based on the validation rule, it determines that the validation rule for the PAY field value in interface A is to retain two decimal places. Then, it checks the data format of the PAY field value. If it retains two decimal places, the validation result is that the validation passes; other formats fail. And so on, obtaining the validation result for each field.
[0072] Step 150: When all validation results are confirmed to be valid, the field values of all fields are converted according to the conversion rules to generate the target data.
[0073] Specifically, when all fields pass the validation, meaning the source data passes the validation, data transformation can be performed. The transformation is carried out according to the transformation rules for each field, which include, but are not limited to, data merging and data splitting. After the transformation is completed, the target data is generated based on the transformed fields.
[0074] In an optional example, for example in Figure 2In the HTTP general interface platform shown, the generation rule module is used to set the conversion rules corresponding to each interface identifier and generate target data after the conversion is completed. For example, the conversion rule of the TIME field in interface A is to convert the “YYYY-MM-DD” format to “YYYY-MM-DD HH:mm:ss”. The field value of the TIME field is “2019-01-01”, so the converted field value is “2019-01-01 00:00:00”. Other fields are also converted according to the corresponding conversion rules, and the converted fields constitute the target data.
[0075] Step 160: Transmit the target data to the target system.
[0076] Specifically, after the conversion is complete and the target data is generated, the target data is transmitted to the target system so that the target system can store and use the target data.
[0077] This method obtains data requests from the source system, retrieves the corresponding verification and conversion rules through the interface identifier in the data request, and performs corresponding data verification and conversion. It can automatically convert the source system data required by the target system without the need for development work due to system data interaction, saving human resources and improving the efficiency of system data interaction. Moreover, automatic conversion can also avoid code defects caused by manual development and improve the stability of data interaction between systems.
[0078] To enable data that fails verification to be corrected and retransmitted to the target system, the source system can be notified when data verification fails so that the source system can make corrections.
[0079] Optionally, after validating the field value of each field in at least one field according to the validation rules and obtaining the validation result of each field value, the method further includes:
[0080] When the validation result of any field value is determined to be unsuccessful, the field with the unsuccessful validation result is sent to the source system so that the source system can correct the field with the unsuccessful validation result.
[0081] Specifically, when the validation result of any field value fails, the field with the failed validation result is returned to the source system along with the reason for the failure. The source system can then correct the error based on the reason. Alternatively, all fields can be returned, along with the validation result of each field and the reason for the failed validation. The specific approach depends on the actual situation.
[0082] In an optional example, for example in Figure 2In the HTTP general interface platform shown, the source system may be the order system and the target system may be the payment system. When the interface data of the order system fails the validation by the validation rules module, the fields that fail the validation or all fields are returned to the order system along with the reason for the failure. The order system can then correct the data based on the reason for the failure and initiate the call request again.
[0083] By sending fields that fail validation to the source system in this way, the source system can correct them based on the reason for the validation failure and then perform the conversion again, thereby reducing the generation of erroneous data.
[0084] If the verification passes, the data format needs to be converted according to requirements to adapt to the target system's data format.
[0085] Optionally, when all validation results are confirmed to be successful, the field values of all fields are transformed according to the transformation rules to generate the target data, including, for example... Figure 3 The method steps shown are as follows:
[0086] Step 310: Determine the conversion action corresponding to each field according to the conversion rules.
[0087] Specifically, the conversion rules are determined based on the interface identifier. The conversion rules may include conversion actions for each field, including but not limited to splitting, merging, and converting data types of field values.
[0088] In an optional example, for example in Figure 2 In the HTTP general interface platform shown, the generation rule module is the transformation rule module. Data transformation operations are performed according to the transformation rules. After determining the transformation rules according to the interface identifier, the transformation action of each field is determined according to the transformation rules. For example, the transformation action of field 1 is splitting, and the transformation action of field 2 is merging. The transformation action of each field can be set in the transformation rules according to the field name.
[0089] Step 320: Based on the transformation action, transform the field values of all fields according to the transformation rules to generate the target data.
[0090] Specifically, by determining the transformation action for each field, the field values can be transformed accordingly based on the transformation action. The transformed data forms the target data, which is then sent to the target system for storage and application.
[0091] In an optional example, for example in Figure 2 In the HTTP general interface platform shown, after the generation rule module completes the data transformation, it can generate the target data from the transformed data.
[0092] This method determines the conversion action based on the conversion rules and converts the data accordingly, thus meeting the different data format requirements between systems.
[0093] After the data conversion is complete and the data is sent to the target system, if the target system has any tasks that need to be run, those tasks need to be started.
[0094] Optionally, after transmitting the target data to the target system, the method further includes:
[0095] Based on the interface identifier, determine the control instructions for the target task corresponding to the interface identifier from multiple pre-configured task lists;
[0096] Run control commands to control the target system to perform the target task.
[0097] Specifically, if the target system has tasks that need to be run, the tasks can be pre-configured on the general interface platform. For example, they can be in the form of scheduled tasks. After the data transmission is completed, the corresponding task can be triggered from the pre-configured task list through the interface identifier.
[0098] In an optional example, for example in Figure 2 In the HTTP general interface platform shown, the tasks to be run can be configured in the task management module. After the data transmission is completed, the interface identifier can be used to find whether there is a task that needs to be triggered. If there is, it can be triggered directly after the transmission is completed, or a scheduled task can be set to be triggered at regular intervals.
[0099] In this way, once the data conversion is complete, if there are related tasks that need to be run in the target system, the tasks can be started through the interface identifier without manual intervention, thus improving the system's efficiency.
[0100] After receiving data from the source system, the general interface platform can store the data on the platform for subsequent querying and tracing.
[0101] Optionally, after validating the field value of each field in at least one field according to the validation rules and obtaining the validation result of each field value, the method further includes:
[0102] Get the field name of the first field;
[0103] Select the storage location corresponding to the first field from the target database based on the interface identifier and field name;
[0104] Store the first field in the storage location, where the first field is any field in the data request.
[0105] Specifically, the storage location corresponding to the source data is obtained based on the interface identifier, such as the database table of the general interface platform. Based on the correspondence between the field names of the source data and the fields of the database table, the storage location corresponding to each field value is obtained, and the field values are stored.
[0106] In an optional example, for example in Figure 2 In the HTTP general interface platform shown, the data center module can set the correspondence between the source system fields and the database table fields of the general interface platform. Then, based on the interface identifier and field name, the storage location of the field value of each field can be determined, and the field value of each field can be stored in the corresponding location.
[0107] This method stores the fields used for data exchange between systems, making it easier to query and trace data.
[0108] The above are embodiments of the data generation method provided in this application. Other embodiments of data generation provided in this application will be described below. Please refer to the following for details.
[0109] Figure 4 An apparatus for generating data is provided in an embodiment of the present invention. The apparatus includes:
[0110] The acquisition module 401 is used to acquire data requests sent by the source system, and the data requests include the interface identifier of the target system.
[0111] The determination module 402 is used to determine the business interface, verification rules, and conversion rules corresponding to the interface identifier based on the interface identifier.
[0112] Processing module 403 is used to obtain source data to be converted from the source system through a business interface. The source data includes at least one field.
[0113] The verification module 404 is used to verify the field value of each field in at least one field according to the verification rules, and obtain the verification result of each field value.
[0114] The conversion module 405 is used to convert the field values of all fields according to the conversion rules and generate the target data when it is determined that all the verification results are valid.
[0115] The transmission module 406 is used to transmit the target data to the target system.
[0116] Optionally, the device may also include: a transmitting module 407;
[0117] The sending module 407 is used to send the field whose verification result is unsuccessful to the source system when it is determined that the verification result of any field value is unsuccessful, so that the source system can correct the field whose verification result is unsuccessful.
[0118] Optionally, the device includes:
[0119] The determination module 402 is also used to determine the conversion action corresponding to each field according to the conversion rules;
[0120] The conversion module 405 is specifically used to convert the field values of all fields according to the conversion rules based on the conversion action, and generate the target data.
[0121] Optionally, the device may also include: an operation module 408;
[0122] The determining module 402 is also used to determine the control instructions of the target task corresponding to the interface identifier from multiple pre-configured task lists based on the interface identifier;
[0123] The execution module 408 is used to execute control commands and control the target system to perform the target task.
[0124] Optionally, the device may further include: a selection module 409 and a storage module 410;
[0125] The acquisition module 401 is also used to acquire the field name of the first field;
[0126] Module 409 is used to select the storage location corresponding to the first field from the target database based on the interface identifier and field name;
[0127] Storage module 410 is used to store the first field in a storage location, wherein the first field is any field in the data request.
[0128] The functions performed by each component in the data generation apparatus provided in the embodiments of the present invention have been described in detail in any of the above method embodiments, and therefore will not be repeated here.
[0129] This invention provides a data generation apparatus that acquires a data request sent by a source system, the data request including an interface identifier of a target system; determines a business interface, verification rules, and conversion rules corresponding to the interface identifier; acquires source data to be converted from the source system through the business interface, the source data including at least one field; verifies the field value of each field according to the verification rules, and obtains the verification result of each field value; when all verification results are found to be passed, converts all field values according to the conversion rules to generate target data; and transmits the target data to the target system. This method acquires the data request from the source system, obtains the corresponding verification rules and conversion rules through the interface identifier in the data request, and performs corresponding data verification and conversion. It can automatically convert the source system data required by the target system, eliminating the need for development work related to system data interaction, saving human resources, improving the efficiency of system data interaction, and avoiding code defects caused by manual development, thus improving the stability of data interaction between systems.
[0130] like Figure 5 As shown, this application provides an electronic device including a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0131] Memory 113 is used to store computer programs;
[0132] In one embodiment of this application, when the processor 111 executes a program stored in the memory 113, it implements the data generation method provided in any of the foregoing method embodiments, including:
[0133] Obtain the data request sent by the source system. The data request includes the interface identifier of the target system.
[0134] The business interface, verification rules, and conversion rules corresponding to the interface identifier are determined based on the interface identifier.
[0135] Obtain the source data to be converted from the source system through the business interface. The source data includes at least one field.
[0136] According to the validation rules, the field value of each field in at least one field is validated, and the validation result of each field value is obtained.
[0137] Once it is confirmed that all validation results are successful, the field values of all fields are transformed according to the transformation rules to generate the target data.
[0138] Transmit the target data to the target system.
[0139] Optionally, after validating the field value of each field in at least one field according to the validation rules and obtaining the validation result of each field value, the method further includes:
[0140] When the validation result of any field value is determined to be unsuccessful, the field with the unsuccessful validation result is sent to the source system so that the source system can correct the field with the unsuccessful validation result.
[0141] Optionally, when all validation results are confirmed to be successful, the field values of all fields are transformed according to the transformation rules to generate the target data, including:
[0142] Based on the conversion rules, determine the conversion action corresponding to each field;
[0143] Based on the transformation action, the field values of all fields are transformed according to the transformation rules to generate the target data.
[0144] Optionally, after transmitting the target data to the target system, the method further includes:
[0145] Based on the interface identifier, determine the control instructions for the target task corresponding to the interface identifier from multiple pre-configured task lists;
[0146] Run control commands to control the target system to perform the target task.
[0147] Optionally, after validating the field value of each field in at least one field according to the validation rules and obtaining the validation result of each field value, the method further includes:
[0148] Get the field name of the first field;
[0149] Select the storage location corresponding to the first field from the target database based on the interface identifier and field name;
[0150] Store the first field in the storage location, where the first field is any field in the data request.
[0151] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the data generation method provided in any of the foregoing method embodiments.
[0152] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0153] The above are merely specific embodiments of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for generating data, characterized in that, The method includes: Obtain the data request sent by the source system, wherein the data request includes the interface identifier of the target system; The business interface, verification rules, and conversion rules corresponding to the interface identifier are determined based on the interface identifier. The source data to be converted in the source system is obtained through the business interface, and the source data includes at least one field; According to the verification rules, the field value of each field in at least one field is verified, and the verification result of each field value is obtained. When all the verification results are confirmed to be valid, the field values of all the fields are transformed according to the transformation rules to generate the target data. The target data is transmitted to the target system; Based on the interface identifier, the control instructions for the target task corresponding to the interface identifier are determined from a list of multiple pre-configured tasks. The control command is executed to control the target system to perform the target task.
2. The method according to claim 1, characterized in that, After verifying the field value of each field in at least one field according to the verification rules and obtaining the verification result of each field value, the method further includes: When the verification result of any of the field values is determined to be unsuccessful, the field with the unsuccessful verification result is sent to the source system so that the source system can correct the field with the unsuccessful verification result.
3. The method according to claim 1 or 2, characterized in that, When all the verification results are determined to be successful, the field values of all the fields are transformed according to the transformation rules to generate target data, including: Based on the conversion rules, determine the conversion action corresponding to each field; According to the transformation action, the field values of all the fields are transformed according to the transformation rules to generate the target data.
4. The method according to claim 1 or 2, characterized in that, After verifying the field value of each field in at least one field according to the verification rules and obtaining the verification result of each field value, the method further includes: Get the field name of the first field; Select the storage location corresponding to the first field from the target database based on the interface identifier and field name; The first field is stored in the storage location, wherein the first field is any field in the data request.
5. A data generation apparatus, characterized in that, The device includes: The acquisition module is used to acquire data requests sent by the source system, wherein the data requests include the interface identifier of the target system; The determination module is used to determine the business interface, verification rules, and conversion rules corresponding to the interface identifier based on the interface identifier; The processing module is used to obtain the source data to be converted in the source system through the business interface, wherein the source data includes at least one field; The verification module is used to verify the field value of each field in at least one field according to the verification rules, and obtain the verification result of each field value. The conversion module is used to convert the field values of all the fields according to the conversion rules and generate the target data when it is determined that all the verification results are valid. A transmission module is used to transmit the target data to the target system; The confirmation module is used to determine the control instruction of the target task corresponding to the interface identifier from multiple pre-configured task lists based on the interface identifier; The control module is used to execute the control commands and control the target system to perform the target task.
6. The apparatus according to claim 5, characterized in that, The device further includes: The sending module is used to send the field whose verification result is failed to the source system when it is determined that the verification result of any of the field values is failed, so that the source system can correct the field whose verification result is failed.
7. The apparatus according to claim 5 or 6, characterized in that, The device includes: The determining module is also configured to determine the conversion action corresponding to each of the fields based on the conversion rules; The conversion module is specifically used to convert the field values of all the fields according to the conversion rules based on the conversion action, and generate the target data.
8. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes a program stored in the memory, it implements the steps of the data generation method according to any one of claims 1-4.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the data generation method as described in any one of claims 1-4.
Citation Information
Patent Citations
Universal interface platform and data conversion method
CN111240862A