A method, device and system for business data transmission based on direct connection interface
By integrating multiple direct connection interfaces in the data processing system for multi-threaded communication and using interface batch tools for business data processing, the problems of low data transmission efficiency and poor stability in the existing technology are solved, and efficient and stable data transmission and processing are achieved.
Patent Information
- Application Number
- CN202311280278.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2043-09-28
AI Technical Summary
In the prior art, asynchronous communication between a data processing system and an external system results in poor timeliness, long delays, low transmission stability, and easy data loss, which affects data transmission and processing efficiency.
A business data transmission method based on a direct connection interface is adopted. By integrating multiple direct connection interfaces to perform multi-threaded communication with external systems, interface batch tools are used to process business data, and business data is called back to the corresponding external system when the callback status of the direct connection interface is not called back.
It shortens communication delay, improves data transmission efficiency and stability, reduces data loss, and improves the overall efficiency of the data processing system.
Smart Images

Figure CN117312433B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of business data transmission, and in particular to a business data transmission method, device and system based on a direct connection interface. Background Art
[0002] With the development of technology, more and more companies are setting up or building corresponding data processing systems (such as SAP ECC systems). Through data processing systems, various basic data and business data are transmitted with the systems of various companies or enterprises to realize the interaction of online business and information.
[0003] To enable data exchange across multiple systems, data processing systems currently communicate with each other through asynchronous middleware such as kettle, sterling, and FTP. However, these common methods present several technical challenges: Because the data processing system communicates asynchronously with each external system, each data transmission is subject to poor timeliness and long latency. Furthermore, the data transmission interfaces between the data processing system and each external system vary, resulting in low data transmission stability, high failure rates, and a high risk of data loss, which often requires retransmission, further reducing the efficiency of data transmission and processing. Summary of the Invention
[0004] The present invention proposes a business data transmission method, device and system based on direct connection interface. The data processing system of the method integrates multiple direct connection interfaces connected to external systems. By running multiple integrated direct connection interfaces to perform multi-threaded communication connections with multiple external systems, it can not only shorten the communication delay and improve the transmission efficiency, but also improve the stability of data transmission.
[0005] A first aspect of an embodiment of the present invention provides a method for service data transmission based on a direct-connect interface, the method being applicable to a data processing system integrating multiple direct-connect interfaces, the method comprising:
[0006] Respectively acquiring interface data collected by each direct connection interface, wherein the interface data is data input by an external system connected to the direct connection interface;
[0007] After the interface data is saved, the interface data is processed using an interface batch tool according to the business logic of the external system corresponding to each interface data to obtain business data;
[0008] When the callback state of the direct connection interface is not called back, the business data is called back to the corresponding external system for the external system to call.
[0009] In a possible implementation of the first aspect, the data processing system comprises: a data interface header object, a data interface processor, a superclass data interface processor, and a data interface factory;
[0010] The data interface factory, the superclass data interface processor, the data interface processor and the data interface header object are connected in sequence, the data interface factory is connected to the direct connection interface or the enhancement point, the direct connection interface is connected to the external system, and the enhancement point is connected to the process node of the data processing system.
[0011] In a possible implementation of the first aspect, respectively acquiring interface data collected by each direct connection interface includes:
[0012] When the data interface factory receives a first instance acquisition request of a direct connection interface, the data interface factory is controlled to return first superclass instance data of the superclass data interface processor to the direct connection interface, so that the direct connection interface sends interface data to the superclass data interface processor, wherein the first instance acquisition request is a request generated when an external system calls each direct connection interface to transmit data or a request triggered by the enhancement point;
[0013] The data interface handler is used to transfer the interface data received by the superclass data interface handler to the data interface header object.
[0014] In a possible implementation of the first aspect, the saving the interface data includes:
[0015] Calling the superclass data interface processor through the data interface processor to obtain the next data interface number of the data interface header object;
[0016] Creating an object instance in the data interface header object according to the data interface number, so that the data interface header object uses the object instance to store data of the next transmission object;
[0017] The interface data is saved in the data table of the data interface object using the data interface number.
[0018] In a possible implementation of the first aspect, the using an interface batch tool to perform business processing on the interface data according to the business logic of the external system corresponding to each piece of interface data to obtain the business data includes:
[0019] When it is determined that there are multiple interface data that meet the processing conditions, a batch processing instance is created using an interface batch tool according to the business logic of the external system, and the interface data is split according to the number of threads of the processing instance;
[0020] After the splitting is completed, the interface batch tool is controlled to send a first instance acquisition request to the data interface factory, so that the interface batch tool acquires the second superclass instance data of the superclass data interface processor;
[0021] The interface batch tool sends the processing instance and the split interface data to the superclass data interface processor, so that the superclass data interface processor performs batch processing on the split interface data to obtain business data.
[0022] In a possible implementation of the first aspect, the superclass data interface processor batch processes the split interface data to obtain service data, including:
[0023] Filtering the split interface data according to the state of the data interface processor using the multi-threaded processing method of the superclass data interface processor to obtain filtered data;
[0024] The data interface processor is called to perform business processing on the filtered data in batches according to the business logic corresponding to the data interface object to obtain business data.
[0025] In a possible implementation of the first aspect, calling back the business data to the corresponding external system includes:
[0026] After the data interface processor receives a callback request from the callback interface of the external system, the data interface processor is controlled to receive business data from the data interface object and transmit the business data to the callback interface of the external system.
[0027] In a possible implementation of the first aspect, the data processing system further includes a data interface monitoring station, and the method further includes:
[0028] Utilizing the data interface monitoring station to search and display data interface header data that meets the query conditions input by the user;
[0029] When a user's query request is obtained, a corresponding interface data report is searched and displayed from the data interface object according to the query request, wherein the query request is a request input by the user after viewing the data interface header data.
[0030] A second aspect of an embodiment of the present invention provides a service data transmission device based on a direct-connect interface, the device being applicable to a data processing system integrating multiple direct-connect interfaces, the device comprising:
[0031] A data acquisition module is used to respectively acquire interface data collected by each direct connection interface, wherein the interface data is data input by the external system connected to the direct connection interface;
[0032] A business processing module is used to, after saving the interface data, use an interface batch tool to perform business processing on the interface data according to the business logic of the external system corresponding to each interface data to obtain business data;
[0033] The callback processing module is used to call back the business data to the corresponding external system when the callback status of the direct connection interface is not called back, so as to be called by the external system.
[0034] In a possible implementation of the second aspect, the data processing system comprises: a data interface header object, a data interface processor, a superclass data interface processor, and a data interface factory;
[0035] The data interface factory, the superclass data interface processor, the data interface processor and the data interface header object are connected in sequence, the data interface factory is connected to the direct connection interface or the enhancement point, the direct connection interface is connected to the external system, and the enhancement point is connected to the process node of the data processing system.
[0036] In a possible implementation of the second aspect, respectively acquiring interface data collected by each direct connection interface includes:
[0037] When the data interface factory receives a first instance acquisition request of a direct connection interface, the data interface factory is controlled to return first superclass instance data of the superclass data interface processor to the direct connection interface, so that the direct connection interface sends interface data to the superclass data interface processor, wherein the first instance acquisition request is a request generated when an external system calls each direct connection interface to transmit data or a request triggered by the enhancement point;
[0038] The data interface handler is used to transfer the interface data received by the superclass data interface handler to the data interface header object.
[0039] In a possible implementation of the second aspect, the saving the interface data includes:
[0040] Calling the superclass data interface processor through the data interface processor to obtain the next data interface number of the data interface header object;
[0041] Creating an object instance in the data interface header object according to the data interface number, so that the data interface header object uses the object instance to store data of the next transmission object;
[0042] The interface data is saved in the data table of the data interface object using the data interface number.
[0043] In a possible implementation of the second aspect, the using an interface batch tool to perform business processing on the interface data according to the business logic of the external system corresponding to each piece of interface data to obtain the business data includes:
[0044] When it is determined that there are multiple interface data that meet the processing conditions, a batch processing instance is created using an interface batch tool according to the business logic of the external system, and the interface data is split according to the number of threads of the processing instance;
[0045] After the splitting is completed, the interface batch tool is controlled to send a first instance acquisition request to the data interface factory, so that the interface batch tool acquires the second superclass instance data of the superclass data interface processor;
[0046] The interface batch tool sends the processing instance and the split interface data to the superclass data interface processor, so that the superclass data interface processor performs batch processing on the split interface data to obtain business data.
[0047] In a possible implementation of the second aspect, the superclass data interface processor batch processes the split interface data to obtain service data, including:
[0048] Filtering the split interface data according to the state of the data interface processor using the multi-threaded processing method of the superclass data interface processor to obtain filtered data;
[0049] The data interface processor is called to perform business processing on the filtered data in batches according to the business logic corresponding to the data interface object to obtain business data.
[0050] In a possible implementation of the second aspect, calling back the business data to the corresponding external system includes:
[0051] After the data interface processor receives a callback request from the callback interface of the external system, the data interface processor is controlled to receive business data from the data interface object and transmit the business data to the callback interface of the external system.
[0052] In a possible implementation of the second aspect, the data processing system further includes a data interface monitoring station, and the device further includes:
[0053] A query module, configured to use the data interface monitoring station to search and display data interface header data that meets the query conditions input by the user;
[0054] The display module is used to search and display the corresponding interface data report from the data interface object according to the query request when obtaining the user's query request, and the query request is a request input by the user after viewing the data interface header data.
[0055] A third aspect of an embodiment of the present invention provides a business data transmission system based on a direct connection interface, the system comprising: a unified interface framework module, a master data management module, a sales management module, a financial management module, and a procurement management module;
[0056] The unified interface framework module is connected to the master data management module, the sales management module, the financial management module and the procurement management module respectively.
[0057] Compared with the prior art, the embodiments of the present invention provide a business data transmission method and device based on a direct connection interface, which has the following beneficial effects: the present invention can integrate multiple direct connection interfaces connected to external systems, and by running multiple integrated direct connection interfaces to perform multi-threaded communication connections with multiple external systems, it can not only shorten the communication delay and improve the transmission efficiency, but also improve the stability of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 This is a flow chart of a service data transmission method based on a direct connection interface provided by one embodiment of the present invention;
[0059] Figure 2 This is a class diagram of a data interface framework provided by an embodiment of the present invention;
[0060] Figure 3 This is a diagram of the Header data structure of a data interface header object provided by one embodiment of the present invention;
[0061] Figure 4 This is an Object data structure diagram provided by an embodiment of the present invention;
[0062] Figure 5 This is a flowchart of an operation for saving inbound interface data provided by one embodiment of the present invention;
[0063] Figure 6 This is a flowchart of the operation of saving outbound interface data provided by one embodiment of the present invention;
[0064] Figure 7 This is an operational flow chart of a business process provided by an embodiment of the present invention;
[0065] Figure 8 This is an operational flow chart of callback processing provided by one embodiment of the present invention;
[0066] Figure 9is an operational flow chart of a monitoring process provided by one embodiment of the present invention;
[0067] Figure 10 This is a schematic structural diagram of a service data transmission device based on a direct connection interface provided by one embodiment of the present invention;
[0068] Figure 11 The present invention provides a schematic structural diagram of a service data transmission system based on a direct connection interface according to an embodiment of the present invention. DETAILED DESCRIPTION
[0069] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0070] In order to solve the above problems, a service data transmission method based on a direct connection interface provided by an embodiment of the present application will be introduced and explained in detail through the following specific embodiments.
[0071] Reference Figure 1 , shows a flow chart of a service data transmission method based on a direct connection interface provided by an embodiment of the present invention.
[0072] In one embodiment, the method is applicable to a data processing system, which may be provided with a unified framework for data interfaces, and manage all data interfaces between the data processing system and peripheral systems or external systems in a unified framework.
[0073] The data interface framework implements common functions of the data interface between the data processing system and the peripheral system, such as process management and status control of interface data, display and problem monitoring of interface data, and task management and scheduling of interface data processing.
[0074] These common functions no longer need to be implemented separately in various data interfaces, so that developers of various data interfaces can focus on the business and system logic of their respective interface data.
[0075] In one embodiment, the various objects included in the data interface framework can be abstracted into the following classes.
[0076]
[0077]
[0078] Reference Figure 2, which shows a class diagram of a data interface framework provided by an embodiment of the present invention.
[0079] In an optional embodiment, the data processing system may be provided with: a data interface header object, a data interface processor, a superclass data interface processor and a data interface factory.
[0080] Among them, the data interface factory, the superclass data interface processor, the data interface processor and the data interface header object are connected in sequence, the data interface factory is connected to the direct connection interface or the enhancement point, the direct connection interface is connected to the external system, and the enhancement point is connected to the process node of the data processing system.
[0081] In one implementation, the data interface processor is a processor (ZCL_DI_PROC) that includes the core logic of interface data storage, processing, and callback. The processor may also include special logic that each data interface object should inherit from this class and implement.
[0082] In one implementation, the superclass data interface handler may correspond to a superclass of the data interface handlers listed above, and may be a handler (ZCL_DI_PROC_xxx) used to redefine and implement its own specialized logic. This logic requires each data interface object to inherit a subclass of the data interface handler (ZCL_DI_PROC), such as ZCL_DI_PROC_MAT (material master data) and ZCL_DI_PROC_SO (sales order data).
[0083] In one implementation, the data interface factory may be the data interface factory class (ZCL_DI_FACTORY) in the above list, specifically producing data interface Header objects and processors.
[0084] In one implementation, the data interface header object may be an object of a single data interface header in the above list (ZCL_DI_HEADER), or may be an object of multiple data interface headers in the above list (ZCL_DI_HEADERS).
[0085] Reference Figure 3 , shows a Header data structure diagram of a data interface header object provided by an embodiment of the present invention.
[0086] In one embodiment, the present invention constructs a header data structure according to the header data of the data interface header object. Figure 3 shown.
[0087] The data interface header object can be used to store interface data for data transmitted by the interface of the external system, such as number, object, keyword, status, time, message and other general information. To this end, a Header data table can be constructed as the common master table for all interface data. The storage tables of various interface data are all linked to the Header data table by foreign keys. Taking the material master data Material and sales order data Order as an example, Figure 3 It shows the relationship between their tables and the common Header data table.
[0088] Specifically, the Header data table can be as follows:
[0089]
[0090]
[0091] In order to distinguish the above data interface processing status, in one embodiment, the value of the data interface processing status field can be as shown in the following table:
[0092] domain describe ZDISTS Data interface processing status value describe 00 Pending 01 Processing 02 Processing failure 03 Processing Success 09 Abandoned
[0093] Similarly, in order to distinguish the above data interface callback status, in one embodiment, the value of the data interface callback status field can be as shown in the following table:
[0094] domain describe ZDIRTS Data interface callback status value describe 00 No callback required 01 Pending callback 02 Callback failed 03 Callback success 09 Abandoned
[0095] Reference Figure 4 , shows an Object data structure diagram provided by an embodiment of the present invention.
[0096] Since the abstraction and unified management of data interface objects are the basis of the entire data interface framework, the present invention sets two setting tables of Object, namely ZDIOBJSET setting table and ZDIOBJTAB setting table.
[0097] In one embodiment, the ZDIOBJSET settings table may be as follows:
[0098]
[0099] The ZDIOBJTAB setup table can look like this:
[0100]
[0101] In the basic settings, the number segment of the data interface object is used to generate the number of the interface data. Each data interface object can have a different number segment for easy distinction. The processing class of the data interface object is the core of the data interface framework. The settings here make it easier for the data interface factory to find the processing class corresponding to each data interface object.
[0102] Each data interface object can have multiple data storage tables. One table must be designated as the master table. This master data table must be linked to the data interface header table by a foreign key, and other data tables must also be linked to this master data table by foreign keys. This data interface object storage setting helps the data interface framework find the data storage table for each data interface object and display the data.
[0103] As an example, the service data transmission method based on the direct connection interface may include:
[0104] S11 . Acquire interface data collected by each direct connection interface respectively, where the interface data is data input by an external system connected to the direct connection interface.
[0105] For data input into the data processing system, the data processing system can define the direct port coordinates connected to the external system to receive data according to the agreement with the external system, or define the SAP end as the interface for receiving data. Generally, data can be received in RFC format.
[0106] When the port receives data input from the external system, the data can be directly obtained from the port, thereby obtaining interface data.
[0107] As an example, step S11 may include the following sub-steps:
[0108] S111. When the data interface factory receives the first instance acquisition request of the direct connection interface, the data interface factory is controlled to return the first superclass instance data of the superclass data interface processor to the direct connection interface, so that the direct connection interface sends interface data to the superclass data interface processor, wherein the first instance acquisition request is a request generated when the external system calls each direct connection interface to transmit data or a request generated by the enhancement point trigger.
[0109] S112: Utilize the data interface processor to transmit the interface data received by the superclass data interface processor to the data interface header object.
[0110] In one implementation, the SAP data interface may be used as the direct connection interface. Specifically, the operation of receiving data may be as follows:
[0111] The external system can call the SAP data interface and send a first instance acquisition request to the interface, so that the interface can obtain the first instance acquisition request. The SAP data interface can then request the data interface factory (ZCL_DI_FACTORY) based on the first instance acquisition request. The data interface factory returns the first superclass instance data of the superclass data interface processor to the interface, thereby obtaining the instance of the data interface processor (ZCL_DI_PROC_XXX) corresponding to the data interface object.
[0112] Subsequently, the SAP data interface can directly transfer the interface data to the superclass data interface processor, which in turn directly transfers the data to the data interface processor. Finally, the data interface processor can transfer the data to the data interface header object for calling, saving, analyzing, and other processing to achieve fast direct data transmission.
[0113] S12: After the interface data are saved, a batch interface tool is used to perform business processing on the interface data according to the business logic of the external system corresponding to each interface data to obtain business data.
[0114] In one embodiment, after the data interface header object receives data, it can save the data first, and then perform subsequent business processing on the data after the saving is completed, so as to avoid data loss.
[0115] Since there are multiple external systems connected and multiple data may be received, in order to uniformly process multiple data, you can first determine the business logic of the external system connected to each interface, and then use the interface batch tool to perform corresponding business processing on the data according to the business logic corresponding to each interface, so as to achieve batch processing and improve data processing efficiency.
[0116] In an optional embodiment, the operation of saving the interface data may include the following sub-steps:
[0117] S121. Call the superclass data interface processor through the data interface processor to obtain the next data interface number of the data interface header object.
[0118] S122: Create an object instance in the data interface header object according to the data interface number, so that the data interface header object uses the object instance to store data of the next transmission object.
[0119] S123: Use the data interface number to save the interface data into the data table of the data interface object.
[0120] In combination with the above example, using the SAP data interface as the direct connection interface, the operation of using the SAP data interface to call the NEW_DATA method of the processor to save the received interface data can be as follows:
[0121] First, the data interface processor can call the NEW_HEADER method of the parent class ZCL_DI_PROC to obtain the next data interface number of the current data interface object, and then the data interface header object creates an instance of the data interface HeaderZCL_DI_HEADER and saves the Header data.
[0122] The data interface header object then uses this data interface number to save the received interface data into the main data table and other data tables of the current data interface object.
[0123] It should be noted that the NEW_HEADER method can be called when the interface data is saved, calling GET_NEXT_NUM to obtain the new data interface number and save the data interface header. In this embodiment, other unfinished interface data with the same data interface keyword can be set to be discarded at the same time, thereby ensuring that only the latest interface data will be processed.
[0124] Some steps of the data interface processor need to be centrally managed by the interface framework. This part of the logic is directly implemented by the superclass ZCL_DI_PROC itself. Other steps should be implemented separately by each data interface object. This part of the logic requires each data interface object to inherit the subclass of the superclass ZCL_DI_PROC, such as ZCL_DI_PROC_MAT (material master data) and ZCL_DI_PROC_SO (sales order data), to redefine and implement their own special logic. Specifically, the logic of the data interface processor is shown in the following table:
[0125]
[0126]
[0127] For further explanation, the state in which an external system inputs data into a data processing system for the data processing system to process the data can be regarded as an “inbound” state.
[0128] Reference Figure 5 , shows a flowchart of the saving operation of inbound interface data provided by an embodiment of the present invention.
[0129] Specifically, the data saving operation may include the following steps:
[0130] In the first step, the external system calls the SAP data interface.
[0131] In the second step, the SAP data interface requests the data interface factory ZCL_DI_FACTORY to obtain the instance of the data interface processor ZCL_DI_PROC_XXX corresponding to the data interface object.
[0132] In the third step, the SAP data interface calls the NEW_DATA method of the data interface processor to save the received interface data. The data interface processor can save the data in the same way as the operations in the above steps S121-S123.
[0133] In another application scenario, an external system may simply transmit data to a data processing system, which then acts as a relay station to forward the data to another external system. In this scenario, data may be output via a direct interface. To prevent data loss, data output from the direct interface also needs to be saved.
[0134] For ease of understanding, the state in which an external system inputs data into a data processing system and the data processing system outputs data to other external systems can be considered an "outbound" state.
[0135] Reference Figure 6 , shows a flowchart of the storage operation of outbound interface data provided by an embodiment of the present invention.
[0136] For outbound interface data, the interface data is usually saved directly into the data interface framework at the corresponding system process node, such as some enhancement points or enhancement nodes.
[0137] Reference Figure 6 The process of saving outbound interface data is the same as that of saving inbound interface data, and the operation may include the following steps:
[0138] In the first step, the external system calls the enhancement point or enhancement node.
[0139] In the second step, the enhancement point or enhancement node requests the data interface factory ZCL_DI_FACTORY to obtain the instance of the data interface processor ZCL_DI_PROC_XXX corresponding to the data interface object.
[0140] In the third step, the enhancement point or enhancement node calls the NEW_DATA method of the data interface processor to save the received interface data. The data interface processor can also save data in the same way as the operations in the above steps S121-S123.
[0141] In one embodiment, when there are multiple data received, background batch execution is required, and since some data interface objects need to process a very large amount of data on a daily basis, the background tasks of the data interface need to support multi-threading and parallel processing.
[0142] In order to cope with multiple large-capacity data, in this embodiment, a data interface batch tool (ZCL_DI_BATCH) is designed in the data interface framework of the data processing system. The data interface batch tool meets the needs of background batch and multi-threading.
[0143] The description of the data interface batch tool (ZCL_DI_BATCH) can be shown in the following table:
[0144]
[0145] In one implementation, performing business processing on the interface data using an interface batch tool according to the business logic of the external system corresponding to each of the interface data to obtain the business data may include the following sub-steps:
[0146] S124. When it is determined that there are multiple interface data that meet the processing conditions, a batch processing instance is created using an interface batch tool according to the business logic of the external system, and the interface data is split according to the number of threads of the processing instance.
[0147] S125. After the splitting is completed, the interface batch tool is controlled to send a first instance acquisition request to the data interface factory, so that the interface batch tool acquires the second superclass instance data of the superclass data interface processor.
[0148] S126. The interface batch tool sends the processing instance and the split interface data to the superclass data interface processor, so that the superclass data interface processor performs batch processing on the split interface data to obtain business data.
[0149] In a specific implementation, the business logic of the external system to which each interface is connected can be determined first, and then the corresponding business processing can be performed on the data based on the business logic corresponding to each interface. It can be determined whether the business logic is the preset business logic. If the business logic cannot be executed by the data processing system, it means that the processing conditions are not met; conversely, if the business logic can be executed by the data processing system, it means that the processing conditions are met. At this point, the amount of interface data currently received can be determined. If there are multiple interface data, the interface batch tool can be directly used to create a batch processing instance based on the business logic of the external system and split the multiple interface data according to the number of threads of the processing instance. If the interface data is small, the split method can be to correspond one interface data to one processing instance. If the interface data is large, the interface data can be split according to the amount of data that the processing instance can run. For example, if the processing instance can process 1 megabyte of data and the interface data is 3.5 megabytes, the interface data can be split into 4 processing instances.
[0150] After the splitting is completed, the interface batch tool can be controlled to send a first instance acquisition request to the data interface factory, so that the interface batch tool can obtain the second superclass instance data of the superclass data interface processor.
[0151] Next, the interface batch tool may directly send the processing instance and the split interface data to the superclass data interface processor, so that the superclass data interface processor performs batch processing on the split interface data to obtain business data.
[0152] In a specific embodiment, the superclass data interface processor performs batch processing on the split interface data to obtain service data, which may include the following sub-steps:
[0153] S1261: Filter the split interface data according to the state of the data interface processor using the multi-threaded processing method of the superclass data interface processor to obtain filtered data.
[0154] S1262: Call the data interface processor to perform business processing on the filtered data in batches according to the business logic corresponding to the data interface object to obtain business data.
[0155] Specifically, the multi-threaded processing method of the superclass data interface processor is utilized, and the split interface data is filtered according to the state of the data interface processor, thereby obtaining filtered data.
[0156] Then, the data interface processor is called to perform business processing on the filtered data in batches according to the business logic corresponding to the data interface object to obtain business data.
[0157] Data filtering can effectively reduce the amount of data processed to improve data processing efficiency.
[0158] In one optional embodiment, the business processing of data and the saving of data may be performed asynchronously, and the data may be saved first and then the business processing, or the business processing may be performed first and then the saving.
[0159] Reference Figure 7 , shows an operational flow chart of business processing provided by an embodiment of the present invention.
[0160] Specifically, the steps of performing business processing on the interface data in the background may include the following steps:
[0161] The first step is to read all interface data that meets the conditions and needs to be processed according to the preset conditions.
[0162] The second step is to create an instance of the data interface batch tool ZCL_DI_BATCH.
[0163] If multi-threading is enabled, the data interface batch tool will first split the interface data to be processed by the number of threads, and then schedule a new background task for each data. Each new background task is single-threaded and will be triggered immediately, starting from the first step.
[0164] In the third step, the data interface batch tool requests the data interface factory ZCL_DI_FACTORY to obtain the instance of the data interface processor ZCL_DI_PROC_XXX corresponding to the data interface object.
[0165] In the fourth step, the data interface batch tool calls the PROCESS_MULTI method of the data interface processor to start batch processing of the interface data.
[0166] First, call the PROCESS_MULTI method of the superclass ZCL_DI_PROC to filter the interface data based on the data interface processing status and update the processing status to "unprocessed." Then, call your own PROCESS_DATA_MULTI method to batch process the interface data according to the corresponding logic of the data interface object. Finally, based on the processing results, update the interface data processing status to "successful" or "failed" and record the corresponding information.
[0167] S13: When the callback status of the direct connection interface is not called back, the business data is called back to the corresponding external system for the external system to call.
[0168] In one embodiment, after the external system transmits data to the data processing system for business processing, the data processing system needs to return the processing results of the data to the external system for further processing or application by the external system.
[0169] In one implementation, the value of the data interface callback status field has been preset, and whether the callback is completed can be determined by querying its value.
[0170] It should be noted that, according to the above description, the data processing system in the "outbound" state does not perform business processing on the data and does not need to perform callback processing.
[0171] If the interface data in the "outbound" state also needs to be called back, the callback can be triggered by the external system. This process is initiated by the external system and does not need to be managed in the SAP data interface framework.
[0172] In one embodiment, step S13 may include the following sub-steps:
[0173] S131. After receiving a callback request from a callback interface of an external system using the data interface processor, control the data interface processor to receive business data from the data interface object and transmit the business data to the callback interface of the external system.
[0174] When it is determined that data that has completed business processing has not been called back to the external system, the external system can make a callback request to the data interface processor through its callback interface. After the data interface processor receives the callback request, it can collect the business data that has completed business processing from the data interface object. The data interface processor then transmits the business data to the callback interface of the external system, which is returned to the external system by the callback interface.
[0175] Since callback data does not involve internal system data processing, the callback interface of the external system can be called directly without using the direct connection interface to avoid occupying the bandwidth of the direct connection interface. Since callbacks are often relatively simple, after the callback is completed, the data status can be directly changed from pending callback to callback success or callback failure, without the callback status.
[0176] Reference Figure 8 , shows an operational flow chart of callback processing provided by an embodiment of the present invention. In one operation mode, the callback process of interface data is generally similar to the processing process of interface data. Specifically, the callback process may include the following steps:
[0177] The first step is to filter all data that has not been called back after receiving the callback request.
[0178] In the second step, you can call the interface batch tool to extract multiple uncalled-back data, and then transfer the uncalled-back data to the callback interface of the external system.
[0179] It should be noted that the data interface framework can save, process, and call back interface data asynchronously. That is, the data received by the interface can be saved first, then processed separately, and then called back separately. Each data interface object can decide whether to process synchronously or asynchronously. Since the storage of interface data is often relatively simple, processing may be more time-consuming. For data interface objects with large daily data volumes, an asynchronous method can be selected to prioritize the successful storage of interface data and then perform background processing afterwards. This can avoid high concurrency and timeouts of the interface.
[0180] In another optional embodiment, during the process of data transmission, data processing and data callback, data transmission and processing errors may occur. If there is a lack of monitoring, serious consequences may occur, and it will be difficult to adjust the system and troubleshoot and solve the problems, making it inconvenient to modify and adjust.
[0181] To this end, it is necessary to monitor each of the above processes. It should be noted that monitoring can be performed after obtaining the interface data, after saving the interface data, during business processing, or during callback, and can be adjusted according to actual needs.
[0182] When monitoring data, it's not just about checking the status and error messages of data interfaces; in many cases, it's also necessary to view specific interface data for further troubleshooting and analysis. However, different data interface objects have completely different data structures. To view data in the frontend, it's usually necessary to write a separate data viewer for each data interface object.
[0183] Correspondingly, a dynamic data interface monitoring platform can be designed in the data interface framework, which can include an interface data monitor and an interface data viewer (ZCL_DI_DATA_TABLE). The interface data monitor is used to monitor each data in each process, and the interface data viewer is used to view the monitored data.
[0184] In one operation mode, all data tables of each data interface object can be configured in advance and the master table can be specified. The interface data viewer can drill down from the data interface header to the master data of the corresponding data interface object and then drill down to other related data based entirely on this configuration.
[0185] Specifically, the key properties of the interface data viewer are described in the following table:
[0186]
[0187]
[0188] In conjunction with the above-mentioned interface data viewer, in one embodiment, the method may further include the following steps:
[0189] S21 , using the data interface monitoring station to search and display data interface header data that meets the query conditions input by the user.
[0190] S22. When a query request from a user is obtained, a corresponding interface data report is searched and displayed from the data interface object according to the query request, wherein the query request is a request input by the user after viewing the data interface header data.
[0191] The data interface monitoring console can be used to search for data interface header data that meets the query conditions according to the query conditions input by the user, and then display the data interface header data that meets the query conditions.
[0192] Specifically, the interface data monitor can be used to find the data interface header data that meets the query conditions, and the interface data viewer can be used to read the data interface header data that meets the query conditions and then display it.
[0193] Users can view the data interface header data that meets the query conditions. If the user needs to view the data in detail, they can enter a query request. After receiving the user's query request, the corresponding interface data report can be found from the data interface object according to the query request, and then the interface data report can be displayed for the user to view in detail.
[0194] Reference Figure 9 , shows an operational flow chart of monitoring processing provided by an embodiment of the present invention.
[0195] Specifically, the operation of monitoring and viewing interface data may include the following steps:
[0196] In the first step, the data interface monitoring station reads the data interface Header data that meets the query conditions entered by the user.
[0197] In the second step, the data interface monitoring station creates an instance of the data interface monitor ZCL_DI_MONITOR.
[0198] In the third step, the data interface monitoring station calls the DISPLAY method of the data interface monitor to display the header data, as well as buttons such as processing, callback, and viewing data.
[0199] In the fourth step, when the user clicks the View Data button and wants to view the specific data of the data interface object, the data interface monitoring station will call the DISPLAY_DATA method of the data interface monitor.
[0200] In the fifth step, the data interface monitor will submit an interface data report.
[0201] In the sixth step, the interface data report will first read the data of the corresponding data interface object main table, and then create an instance of the interface data viewer ZCL_DI_DATA_TABLE.
[0202] In the seventh step, the interface data report calls the DISPLAY of the interface data viewer to display the main table data and buttons for viewing the data of each other table.
[0203] In the eighth step, when the user clicks the button to view data from another table, the interface data viewer will submit a new data interface report to read and display the corresponding data from other tables.
[0204] The present invention can support multiple data interface objects and manage multiple data interface objects through a data interface framework, which greatly improves the efficiency and stability of the data interface between SAP and external systems, solves many long-standing problems, and greatly increases functionality, flexibility and ease of use.
[0205] In this embodiment, an embodiment of the present invention provides a business data transmission method based on a direct connection interface, and its beneficial effect is that: the present invention can integrate multiple direct connection interfaces connected to external systems, and by running multiple integrated direct connection interfaces to perform multi-threaded communication connections with multiple external systems, it can not only shorten the communication delay and improve the transmission efficiency, but also improve the stability of data transmission.
[0206] The embodiment of the present invention also provides a service data transmission device based on a direct connection interface, see Figure 10 , shows a structural diagram of a service data transmission device based on a direct connection interface provided by an embodiment of the present invention.
[0207] The device is applicable to a data processing system integrating multiple direct-connect interfaces. As an example, the service data transmission device based on the direct-connect interface may include:
[0208] A data acquisition module 101 is configured to acquire interface data collected by each direct connection interface, wherein the interface data is data input by an external system connected to the direct connection interface;
[0209] The business processing module 102 is used to, after saving the interface data, use an interface batch tool to perform business processing on the interface data according to the business logic of the external system corresponding to each interface data to obtain business data;
[0210] The callback processing module 103 is configured to, when the callback status of the direct connection interface is not called back, call back the business data to the corresponding external system for the external system to call.
[0211] Optionally, the data processing system comprises: a data interface header object, a data interface processor, a superclass data interface processor, and a data interface factory;
[0212] The data interface factory, the superclass data interface processor, the data interface processor and the data interface header object are connected in sequence, the data interface factory is connected to the direct connection interface or the enhancement point, the direct connection interface is connected to the external system, and the enhancement point is connected to the process node of the data processing system.
[0213] Optionally, respectively acquiring the interface data collected by each direct connection interface includes:
[0214] When the data interface factory receives a first instance acquisition request of a direct connection interface, the data interface factory is controlled to return first superclass instance data of the superclass data interface processor to the direct connection interface, so that the direct connection interface sends interface data to the superclass data interface processor, wherein the first instance acquisition request is a request generated when an external system calls each direct connection interface to transmit data or a request triggered by the enhancement point;
[0215] The data interface handler is used to transfer the interface data received by the superclass data interface handler to the data interface header object.
[0216] Optionally, the saving of the interface data includes:
[0217] Calling the superclass data interface processor through the data interface processor to obtain the next data interface number of the data interface header object;
[0218] Creating an object instance in the data interface header object according to the data interface number, so that the data interface header object uses the object instance to store data of the next transmission object;
[0219] The interface data is saved in the data table of the data interface object using the data interface number.
[0220] Optionally, the using of an interface batch tool to perform business processing on the interface data according to the business logic of the external system corresponding to each of the interface data to obtain the business data includes:
[0221] When it is determined that there are multiple interface data that meet the processing conditions, a batch processing instance is created using an interface batch tool according to the business logic of the external system, and the interface data is split according to the number of threads of the processing instance;
[0222] After the splitting is completed, the interface batch tool is controlled to send a first instance acquisition request to the data interface factory, so that the interface batch tool acquires the second superclass instance data of the superclass data interface processor;
[0223] The interface batch tool sends the processing instance and the split interface data to the superclass data interface processor, so that the superclass data interface processor performs batch processing on the split interface data to obtain business data.
[0224] Optionally, the superclass data interface processor performs batch processing on the split interface data to obtain service data, including:
[0225] Filtering the split interface data according to the state of the data interface processor using the multi-threaded processing method of the superclass data interface processor to obtain filtered data;
[0226] The data interface processor is called to perform business processing on the filtered data in batches according to the business logic corresponding to the data interface object to obtain business data.
[0227] Optionally, calling back the business data to a corresponding external system includes:
[0228] After the data interface processor receives a callback request from the callback interface of the external system, the data interface processor is controlled to receive business data from the data interface object and transmit the business data to the callback interface of the external system.
[0229] Optionally, the data processing system is further provided with a data interface monitoring station, and the device further comprises:
[0230] A query module, configured to use the data interface monitoring station to search and display data interface header data that meets the query conditions input by the user;
[0231] The display module is used to search and display the corresponding interface data report from the data interface object according to the query request when obtaining the user's query request, and the query request is a request input by the user after viewing the data interface header data.
[0232] The embodiment of the present invention also provides a service data transmission system based on a direct connection interface, see Figure 11 , shows a structural diagram of a business data transmission system based on a direct connection interface provided by an embodiment of the present invention.
[0233] Wherein, as an example, the business data transmission system based on the direct connection interface may include: a unified interface framework module, a master data management module, a sales management module, a financial management module and a procurement management module;
[0234] The unified interface framework module is connected to the master data management module, the sales management module, the financial management module and the procurement management module respectively.
[0235] Among them, the unified interface framework module is used to uniformly manage various directly connected interfaces.
[0236] The master data management module is used to manage system data and related data processing.
[0237] The sales management module is used to manage sales-related data.
[0238] The financial management module is used to manage financial-related data.
[0239] The procurement management module is used to manage the relevant data of procurement projects.
[0240] Those skilled in the art can clearly understand that, for the sake of convenience and brevity, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0241] Furthermore, an embodiment of the present application also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein when the processor executes the program, the service data transmission method based on the direct connection interface as described in the above embodiment is implemented.
[0242] Furthermore, an embodiment of the present application also provides a computer-readable storage medium, which stores a computer-executable program, and the computer-executable program is used to enable a computer to execute the service data transmission method based on the direct connection interface as described in the above embodiment.
[0243] Those skilled in the art will appreciate that the embodiments of the present application may also provide computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0244] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), apparatuses and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0245] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0246] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0247] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A service data transmission method based on a direct connection interface, characterized in that: The method is applicable to a data processing system integrating multiple direct-connect interfaces, wherein the data processing system comprises: a data interface header object, a data interface processor, a superclass data interface processor, and a data interface factory; the data interface factory, the superclass data interface processor, the data interface processor, and the data interface header object are connected in sequence, the data interface factory is connected to a direct-connect interface or an enhancement point, the direct-connect interface is connected to an external system, and the enhancement point is connected to a process node of the data processing system; the method comprises: Respectively acquiring interface data collected by each direct connection interface, wherein the interface data is data input by an external system connected to the direct connection interface; After the interface data is saved, the interface data is processed using an interface batch tool according to the business logic of the external system corresponding to each interface data to obtain business data; When the callback state of the direct connection interface is not called back, the business data is called back to the corresponding external system for the external system to call.
2. The service data transmission method based on the direct connection interface according to claim 1, characterized in that: The step of respectively acquiring the interface data collected by each direct connection interface includes: When the data interface factory receives a first instance acquisition request of a direct connection interface, the data interface factory is controlled to return first superclass instance data of the superclass data interface processor to the direct connection interface, so that the direct connection interface sends interface data to the superclass data interface processor, wherein the first instance acquisition request is a request generated when an external system calls each direct connection interface to transmit data or a request triggered by the enhancement point; The data interface handler is used to transfer the interface data received by the superclass data interface handler to the data interface header object.
3. The service data transmission method based on the direct connection interface according to claim 1, characterized in that: The storing of the interface data includes: Calling the superclass data interface processor through the data interface processor to obtain the next data interface number of the data interface header object; Creating an object instance in the data interface header object according to the data interface number, so that the data interface header object uses the object instance to store data of the next transmission object; The interface data is saved in a data table of a data interface object using the data interface number.
4. The service data transmission method based on the direct connection interface according to claim 1, characterized in that: The interface batch tool is used to perform business processing on the interface data according to the business logic of the external system corresponding to each of the interface data to obtain business data, including: When it is determined that there are multiple interface data that meet the processing conditions, a batch processing instance is created using an interface batch tool according to the business logic of the external system, and the interface data is split according to the number of threads of the processing instance; After the splitting is completed, the interface batch tool is controlled to send a first instance acquisition request to the data interface factory, so that the interface batch tool acquires the second superclass instance data of the superclass data interface processor; The interface batch tool sends the processing instance and the split interface data to the superclass data interface processor, so that the superclass data interface processor performs batch processing on the split interface data to obtain business data.
5. The service data transmission method based on the direct connection interface according to claim 4, characterized in that: The superclass data interface processor performs batch processing on the split interface data to obtain business data, including: Filtering the split interface data according to the state of the data interface processor using the multi-threaded processing method of the superclass data interface processor to obtain filtered data; The data interface processor is called to perform business processing on the filtered data in batches according to the business logic corresponding to the data interface object to obtain business data.
6. The service data transmission method based on the direct connection interface according to claim 1, characterized in that: The calling back of the business data to the corresponding external system includes: After the data interface processor receives a callback request from the callback interface of the external system, the data interface processor is controlled to receive business data from the data interface object and transmit the business data to the callback interface of the external system.
7. The service data transmission method based on a direct connection interface according to any one of claims 1 to 6, characterized in that: The data processing system is further provided with a data interface monitoring station, and the method further comprises: Utilizing the data interface monitoring station to search and display data interface header data that meets the query conditions input by the user; When a user's query request is obtained, the corresponding interface data report is searched and displayed from the data interface object according to the query request. The query request is a request input by the user after viewing the data interface header data.
8. A service data transmission device based on a direct connection interface, characterized in that: The device is applicable to a data processing system integrating multiple direct-connect interfaces. The data processing system is provided with: a data interface header object, a data interface processor, a superclass data interface processor, and a data interface factory; the data interface factory, the superclass data interface processor, the data interface processor, and the data interface header object are connected in sequence, the data interface factory is connected to a direct-connect interface or an enhancement point, the direct-connect interface is connected to an external system, and the enhancement point is connected to a process node of the data processing system; the device includes: A data acquisition module is used to respectively acquire interface data collected by each direct connection interface, wherein the interface data is data input by the external system connected to the direct connection interface; A business processing module is used to, after saving the interface data, use an interface batch tool to perform business processing on the interface data according to the business logic of the external system corresponding to each interface data to obtain business data; The callback processing module is used to call back the business data to the corresponding external system when the callback status of the direct connection interface is not called back, so as to be called by the external system.
9. A business data transmission system based on a direct connection interface, characterized in that: The system is applicable to the business data transmission method based on direct connection interface according to any one of claims 1 to 7, and the system includes: a unified interface framework module, a master data management module, a sales management module, a financial management module and a procurement management module; The unified interface framework module is connected to the master data management module, the sales management module, the financial management module and the procurement management module respectively.
Citation Information
Patent Citations
Multi-thread-based automatic task decomposition scheduling system and implementation method
CN114003376A