WO2020155784A1 - 基于通用数据接口的报文保存方法、装置和计算机设备 - Google Patents

基于通用数据接口的报文保存方法、装置和计算机设备 Download PDF

Info

Publication number
WO2020155784A1
WO2020155784A1 PCT/CN2019/119218 CN2019119218W WO2020155784A1 WO 2020155784 A1 WO2020155784 A1 WO 2020155784A1 CN 2019119218 W CN2019119218 W CN 2019119218W WO 2020155784 A1 WO2020155784 A1 WO 2020155784A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
data interface
message
universal
information segments
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2019/119218
Other languages
English (en)
French (fr)
Inventor
徐凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Publication of WO2020155784A1 publication Critical patent/WO2020155784A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • This application relates to the computer field, in particular to a message storage method, device, computer equipment, and storage medium based on a universal data interface.
  • the data provider uses a message composed of multiple information segments to transmit data information.
  • the interface needs to be used for reception. If the existing table structure of the interface can match the message composed of multiple information segments (that is, all the information segments can be represented by the existing table structure of the interface), then the interface can Generate the data table corresponding to the message directly.
  • the existing table structure of a specific interface cannot be adapted to all messages. At this time, a new table (according to the new table structure) will be generated in real time to accommodate all the information segments of the message. This will require more information. More computing power and more code (used to generate new table structure). Therefore, the prior art has the problem of wasted computing power and code.
  • the main purpose of this application is to provide a message storage method, device, computer equipment, and storage medium based on a universal data interface, which aims to reduce the waste of computing power and avoid code waste.
  • this application proposes a message storage method based on a universal data interface, which includes the following steps:
  • the data table including all the information segments cannot be generated through the existing table structure of the first data interface, it is determined whether there is an existing table structure that can use the data interface among the preset multiple general data interfaces Generating a first universal data interface including a data table of all the information segments;
  • the first universal data interface exists, the first universal data interface is called and the message is saved as a data table.
  • This application provides a message storage device based on a universal data interface, including:
  • a message receiving unit configured to use a preset first data interface to receive a message sent by a data provider, where the message is composed of multiple information segments;
  • a parsing unit configured to parse the message to obtain multiple information segments in the message
  • a data table judging unit configured to judge whether a data table including all the information segments can be generated through the existing table structure of the first data interface
  • the first universal data interface judging unit is configured to, if the data table including all the information segments cannot be generated through the existing table structure of the first data interface, judging whether among the preset multiple universal data interfaces, There is a first universal data interface that can use the existing table structure of the data interface to generate a data table including all the information segments;
  • the message saving unit is configured to, if the first universal data interface exists, call the first universal data interface and save the message as a data table.
  • the present application provides a computer device including a memory and a processor, the memory stores computer-readable instructions, and the processor implements the steps of any one of the foregoing methods when the computer-readable instructions are executed.
  • the present application provides a computer-readable storage medium on which computer-readable instructions are stored, and when the computer-readable instructions are executed by a processor, the steps of any one of the above methods are implemented.
  • the message storage method, device, computer equipment, and storage medium based on the universal data interface of the present application adopts a preset first data interface to receive a message sent by a data provider; parse the message to obtain the message Multiple information segments; determine whether the existing table structure of the first data interface can generate a data table including all the information segments; if not, call from a plurality of preset universal data interfaces to generate a data table including The universal data interface of the data tables of all the information segments, thereby avoiding waste of computing power and reducing repetitive codes.
  • FIG. 1 is a schematic flowchart of a message storage method based on a universal data interface according to an embodiment of this application;
  • FIG. 2 is a schematic block diagram of the structure of a message storage device based on a universal data interface according to an embodiment of the application;
  • FIG. 3 is a schematic block diagram of the structure of a computer device according to an embodiment of the application.
  • an embodiment of the present application provides a message storage method based on a universal data interface, which includes the following steps:
  • a preset first data interface is used to receive a message sent by a data provider, where the message is composed of multiple information segments.
  • the message is the data unit exchanged and transmitted in the network, and the data exchanged between various systems, that is, the data block to be sent by the data provider at one time.
  • the message contains the complete data information to be sent, its length is very inconsistent, the length is unlimited and variable, and it is composed of multiple information segments.
  • a message in XML format it is presented in the form of ⁇ body> ⁇ span>123 ⁇ /span> ⁇ h>abc ⁇ /h> ⁇ /body>, which includes the information segment span (content is 123 ) And the information segment h (content is abc).
  • the message is parsed to obtain multiple information segments in the message.
  • a plurality of information segments are parsed from the message, and the information includes the name of the information segment and the specific content in the information segment.
  • the information includes the name of the information segment and the specific content in the information segment.
  • a message in XML format according to ⁇ first information segment name>first information segment content ⁇ /first information segment name> ⁇ second information segment name>second information segment content ⁇ /second information segment name>...
  • Predetermined format of... parse to obtain the name of the first information segment, the content of the first information segment, the name of the second information segment, the content of the second information segment.
  • multiple information segments can be parsed in the same way.
  • step S3 it is judged whether the data table including all the information segments can be generated through the existing table structure of the first data interface. If the existing table structure of the first data interface can directly map the message into a data table, then there is no need to create a new data table structure, thereby avoiding consuming additional computing power and not requiring excessive codes.
  • the process of judging whether the data table including all the information segments can be generated through the existing table structure of the first data interface includes: judging whether the names of all the information segments are the same as the existing table structure The field names in are all the same. If they are all the same, it indicates that the existing table structure of the first data interface can map the inverse text to a data table. Further, the existing table structure of the first data interface further includes other fields different from the name of the information segment.
  • step S4 if the data table including all the information segments cannot be generated through the existing table structure of the first data interface, it is determined whether there is a data table that can be used among the preset multiple general data interfaces.
  • the existing table structure of the data interface generates the first universal data interface including the data table of all the information segments.
  • the first data interface cannot map the message to a data table without creating a new table structure, so you can find out whether there are other data interfaces that can or create a new table structure.
  • the mapping message is a data table.
  • the specific process includes: judging whether the names of all the information segments are the same as the field names in the same existing table structure of the preset multiple universal data interfaces.
  • the existing table structure of the first universal data interface further includes other fields different from the name of the information segment.
  • the first universal data interface is called and the message is saved as a data table. Since it is determined that the first universal data interface is suitable for processing the message, the message saving operation can be realized by calling the first universal data interface and saving the message as a data table. Further, the data table that the message is mapped into can be saved to a table in the database, or can be stored in a file. Preferably, the xml and json formats are stored in the table of the database, and the yml or other formats are stored in the file.
  • the preset first data interface is used to receive a message sent by a data provider, where before step S1 in which the message is composed of multiple information segments includes:
  • the first data interface is set.
  • the purpose of this embodiment is to find the most frequently used data interface as the first data interface, so as to achieve the purpose of minimizing invocation of other data interfaces. If the first data interface can satisfy the mapping of the message as a data table, there is no need to call another data interface again, and the message saving operation can be realized.
  • the second universal data interface that is called the most times within a predetermined time indicates that the existing table structure of the second universal data interface is the most frequently used, and is suitable as the first data interface, so it is recorded as the first data interface. Data interface.
  • the step S3 of judging whether a data table including all the information segments can be generated through the existing table structure of the first data interface includes:
  • the method for determining whether all the information segments are contained in the data table generated through the existing table structure of the first data interface includes: determining whether the names of the information segments are all present in the current If there is a table structure, if it is, it is determined that all information segments can fit into the existing table structure of the first data interface, that is, it is determined that a data table including all the information segments can be generated.
  • it also includes determining whether the field attributes of the existing table structure can accommodate the information segment. For example, it is determined whether the length of a certain field in the table structure is less than the length of the corresponding information segment, and if it is not less than, it indicates that the information segment can be accommodated.
  • the step S301 of judging whether all the information segments can be accommodated in the data table generated through the existing table structure of the first data interface includes:
  • the matching means that the name of the information segment is the same as the field name in the existing table structure of the first data interface. Further, the matching further includes: matching the attributes of the information segment with the field attributes of the existing table structure of the first data interface, for example, the length of the information segment is less than the length of the field, so that all The field can contain the information segment.
  • the method includes:
  • the message is saved as a data table. If a data table including all the information segments can be generated, it indicates that the requirements of the message saving operation have been met. Therefore, there is no need to call other data interfaces to directly save the message as a data table.
  • the data table that the message is mapped into can be saved to a table in the database, or can be stored in a file.
  • the xml and json formats are stored in the table of the database, and the yml or other formats are stored in the file.
  • the step S4 of generating the first universal data interface of the data table including all the information segments by using the existing table structure of the data interface includes:
  • the first universal data interface for judging whether there is a data table that can generate all the information segments is realized.
  • the first universal data interface is a data interface that can map the message to a data table without loss of information and without creating a new table structure.
  • the preset multiple general data interfaces include multiple data interfaces with different existing table structures, so as to speed up the generation of the message data table and reduce the required computing power.
  • judging whether all the information segments can be accommodated in the data table generated through the existing table structure of multiple preset universal data interfaces specifically includes: judging whether the names of the information segments all exist in the In the existing table structure, if yes, it is determined that all information segments can be nested into the data table generated by the existing table structure of multiple preset universal data interfaces, that is, it is determined that the first universal data interface exists. Further, it also includes determining whether the field attributes of the existing table structure can accommodate the information segment. For example, it is determined whether the length of a certain field in the table structure is less than the length of the corresponding information segment, and if it is not less than, it indicates that the information segment can be accommodated.
  • the step S4 of generating the first universal data interface of the data table including all the information segments by using the existing table structure of the data interface it includes:
  • the first universal data interface does not exist, obtain a second universal data interface capable of generating a data table that includes most of the information segments from a plurality of preset universal data interfaces;
  • the final data table is obtained. If the first universal data interface does not exist, then from a plurality of preset universal data interfaces, find a data interface that can map the message with the least information loss.
  • the specific process includes: comparing the field names of multiple existing table structures with the names of the information segments, finding the existing table structure with the largest number of the same names, and recording the general data interface corresponding to the table structure as the second Universal data interface. Since the second universal data interface cannot perfectly map the message, the message can only be saved as a preliminary data table. Since the preliminary data table cannot save all the information segments of the message, there must be a loss of information segments.
  • the lost information segment is not important (by judging whether the lost information segment name exists in the preset important information segment name list, if it does not exist, it is determined not to be important), then it can be ignored and the preliminary data table is recorded as final The data sheet is fine. Further, if the lost information segment is important (by judging whether the lost information segment name exists in the preset important information segment name list, if it exists, it is determined to be important), then the preliminary data table and the corresponding loss information The segment is sent to the staff, according to the staff's further instructions (such as completing the information segment, etc.) to complete the data table.
  • the message storage method based on the universal data interface of the present application adopts a preset first data interface to receive a message sent by a data provider; analyzes the message to obtain multiple information segments in the message; Whether the existing table structure of the first data interface can generate a data table including all the information segments; if not, it can generate a data table including all the information segments by calling from multiple preset universal data interfaces Universal data interface to avoid waste of computing power and reduce repetitive code.
  • an embodiment of the present application provides a message storage device based on a universal data interface, including:
  • the message receiving unit 10 is configured to use a preset first data interface to receive a message sent by a data provider, where the message is composed of multiple information segments;
  • the parsing unit 20 is configured to parse the message to obtain multiple information segments in the message;
  • the data table judging unit 30 is configured to judge whether a data table including all the information segments can be generated through the existing table structure of the first data interface;
  • the first universal data interface judging unit 40 is configured to, if the data table including all the information segments cannot be generated through the existing table structure of the first data interface, judge that it is in a plurality of preset universal data interfaces, Whether there is a first universal data interface that can use the existing table structure of the data interface to generate a data table including all the information segments;
  • the message saving unit 50 is configured to, if the first universal data interface exists, call the first universal data interface and save the message as a data table.
  • a preset first data interface is used to receive a message sent by a data provider, where the message is composed of multiple information segments.
  • the message is the data unit exchanged and transmitted in the network, and the data exchanged between various systems, that is, the data block to be sent by the data provider at one time.
  • the message contains the complete data information to be sent, its length is very inconsistent, the length is unlimited and variable, and it is composed of multiple information segments.
  • a message in XML format it is presented in the form of ⁇ body> ⁇ span>123 ⁇ /span> ⁇ h>abc ⁇ /h> ⁇ /body>, which includes the information segment span (content is 123 ) And the information segment h (content is abc).
  • the message is parsed to obtain multiple information segments in the message.
  • a plurality of information segments are parsed from the message, and the information includes the name of the information segment and the specific content in the information segment.
  • the information includes the name of the information segment and the specific content in the information segment.
  • a message in XML format according to ⁇ first information segment name>first information segment content ⁇ /first information segment name> ⁇ second information segment name>second information segment content ⁇ /second information segment name>...
  • Predetermined format of... parse to obtain the name of the first information segment, the content of the first information segment, the name of the second information segment, the content of the second information segment.
  • multiple information segments can be parsed in the same way.
  • the process of judging whether the data table including all the information segments can be generated through the existing table structure of the first data interface includes: judging whether the names of all the information segments are the same as the existing table structure The field names in are all the same. If they are all the same, it indicates that the existing table structure of the first data interface can map the inverse text to a data table. Further, the existing table structure of the first data interface further includes other fields different from the name of the information segment.
  • the existing table structure of the first data interface cannot generate a data table including all the information segments, it is determined whether there is a data table that can be used in the preset multiple general data interfaces.
  • the existing table structure of the data interface generates the first universal data interface including the data table of all the information segments.
  • the first data interface cannot map the message to a data table without creating a new table structure, so you can find out whether there are other data interfaces that can or create a new table structure.
  • the mapping message is a data table.
  • the specific process includes: judging whether the names of all the information segments are the same as the field names in the same existing table structure of the preset multiple universal data interfaces.
  • the existing table structure of the first universal data interface further includes other fields different from the name of the information segment.
  • the first universal data interface is called and the message is saved as a data table. Since it is determined that the first universal data interface is suitable for processing the message, the message saving operation can be realized by calling the first universal data interface and saving the message as a data table. Further, the data table that the message is mapped into can be saved to a table in the database, or can be stored in a file. Preferably, the xml and json formats are stored in the table of the database, and the yml or other formats are stored in the file.
  • the device includes:
  • a statistical unit configured to count the second universal data interface that has been called the most times from among the preset multiple universal data interfaces within a predetermined time before the current time;
  • the interface marking unit is used to mark the second universal data interface as the first data interface.
  • the first data interface is set.
  • the purpose of this embodiment is to find the most frequently used data interface as the first data interface, so as to achieve the purpose of minimizing invocation of other data interfaces. If the first data interface can satisfy the mapping of the message as a data table, there is no need to call another data interface again, and the message saving operation can be realized.
  • the second universal data interface that is called the most times within a predetermined time indicates that the existing table structure of the second universal data interface is the most frequently used, and is suitable as the first data interface, so it is recorded as the first Data interface.
  • the data table determining unit 30 includes:
  • the first data interface accommodating and judging subunit is used to judge whether all the information segments can be accommodated in the data table generated by the existing table structure of the first data interface;
  • the data table judging subunit is used for judging that a data table including all the information segments can be generated if it can be accommodated in the data table generated through the existing table structure of the first data interface.
  • the method for determining whether all the information segments are contained in the data table generated through the existing table structure of the first data interface includes: determining whether the names of the information segments are all present in the current If there is a table structure, if it is, it is determined that all information segments can fit into the existing table structure of the first data interface, that is, it is determined that a data table including all the information segments can be generated.
  • it also includes determining whether the field attributes of the existing table structure can accommodate the information segment. For example, it is determined whether the length of a certain field in the table structure is less than the length of the corresponding information segment, and if it is not less than, it indicates that the information segment can be accommodated.
  • the first data interface contains a judgment subunit, including:
  • a field matching judgment module configured to judge whether all the information segments match the fields of the existing table structure of the first data interface
  • the data table judging module is used for judging that it can be accommodated in the data table generated by the existing table structure of the first data interface if all matches.
  • the matching means that the name of the information segment is the same as the field name in the existing table structure of the first data interface. Further, the matching further includes: matching the attributes of the information segment with the field attributes of the existing table structure of the first data interface, for example, the length of the information segment is less than the length of the field, so that all The field can contain the information segment.
  • the device includes:
  • the data table storage unit is configured to, if a data table including all the information segments can be generated, save the message as a data table through the first data interface.
  • the message is saved as a data table. If a data table including all the information segments can be generated, it indicates that the requirements of the message saving operation have been met. Therefore, there is no need to call other data interfaces to directly save the message as a data table.
  • the data table that the message is mapped into can be saved to a table in the database, or can be stored in a file.
  • the xml and json formats are stored in the table of the database, and the yml or other formats are stored in the file.
  • the first universal data interface judgment unit 40 includes:
  • a plurality of general data interface judgment subunits are used for judging whether all the information sections can be accommodated if the data table including all the information segments cannot be generated through the existing table structure of the first data interface In the data table generated by the existing table structure of multiple preset universal data interfaces;
  • the first universal data interface judging subunit is used for judging that there is a data table that can generate all the information segments if it can be accommodated in the data table generated by the existing table structure of multiple preset universal data interfaces The first universal data interface.
  • the first universal data interface for judging whether there is a data table that can generate all the information segments is realized.
  • the first universal data interface is a data interface that can map the message to a data table without loss of information and without creating a new table structure.
  • the preset multiple general data interfaces include multiple data interfaces with different existing table structures, so as to speed up the generation of the message data table and reduce the required computing power.
  • judging whether all the information segments can be accommodated in the data table generated through the existing table structure of multiple preset universal data interfaces specifically includes: judging whether the names of the information segments all exist in the In the existing table structure, if yes, it is determined that all information segments can be nested into the data table generated by the existing table structure of multiple preset universal data interfaces, that is, it is determined that the first universal data interface exists. Further, it also includes determining whether the field attributes of the existing table structure can accommodate the information segment. For example, it is determined whether the length of a certain field in the table structure is less than the length of the corresponding information segment, and if it is not less than, it indicates that the information segment can be accommodated.
  • the device includes:
  • the second universal data interface obtaining unit is configured to, if the first universal data interface does not exist, obtain second universal data capable of generating a data table including the most information segments from a plurality of preset universal data interfaces interface;
  • the second universal data interface calling unit is configured to call the second universal data interface and save the message as a preliminary data table
  • An information segment name judging unit for judging whether the lost information segment name of the preliminary data table relative to the message exists in the preset important information segment name list;
  • the preliminary data table marking unit is configured to record the preliminary data table as the final data table if the preliminary data table is not included in the preset important information section name list relative to the information section name lost by the message .
  • the final data table is obtained. If the first universal data interface does not exist, then from a plurality of preset universal data interfaces, find a data interface that can map the message with the least information loss.
  • the specific process includes: comparing the field names of multiple existing table structures with the names of the information segments, finding the existing table structure with the largest number of the same names, and recording the general data interface corresponding to the table structure as the second Universal data interface. Since the second universal data interface cannot perfectly map the message, the message can only be saved as a preliminary data table. Since the preliminary data table cannot save all the information segments of the message, there must be a loss of information segments.
  • the lost information segment is not important (by judging whether the lost information segment name exists in the preset important information segment name list, if it does not exist, it is determined not to be important), then it can be ignored and the preliminary data table is recorded as final The data sheet is fine. Further, if the lost information segment is important (by judging whether the lost information segment name exists in the preset important information segment name list, if it exists, it is determined to be important), then the preliminary data table and the corresponding loss information The segment is sent to the staff, according to the staff's further instructions (such as completing the information segment, etc.) to complete the data table.
  • the message storage device based on the universal data interface of the present application uses a preset first data interface to receive a message sent by a data provider; analyzes the message to obtain multiple information segments in the message; Whether the existing table structure of the first data interface can generate a data table including all the information segments; if not, it can generate a data table including all the information segments by calling from multiple preset universal data interfaces Universal data interface to avoid waste of computing power and reduce repetitive code.
  • an embodiment of the present application also provides a computer device.
  • the computer device may be a server, and its internal structure may be as shown in the figure.
  • the computer equipment includes a processor, a memory, a network interface and a database connected by a system bus. Among them, the computer designed processor is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, computer readable instructions, and a database.
  • the memory provides an environment for the operation of the operating system and computer readable instructions in the non-volatile storage medium.
  • the database of the computer equipment is used to store data used in the message saving method based on the universal data interface.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer-readable instructions are executed by the processor, a message saving method based on a general data interface is realized.
  • the processor executes the method for saving messages based on the general data interface, including the following steps: using a preset first data interface to receive a message sent by a data provider, where the message is composed of multiple information segments; parsing The message obtains multiple information segments in the message; it is determined whether the data table including all the information segments can be generated through the existing table structure of the first data interface; The existing table structure of the data interface cannot generate a data table that includes all the information segments, then it is determined whether there is an existing table structure that can use the data interface to generate a data table that includes all the information among the preset multiple general data interfaces.
  • the first universal data interface of the data table of the segment if the first universal data interface exists, the first universal data interface is called, and the message is saved as a data table.
  • the preset first data interface is used to receive a message sent by a data provider, wherein, before the step that the message is composed of multiple information segments, includes: a predetermined time before the current time Within, from the plurality of preset universal data interfaces, count the second universal data interface that is called the most times; record the second universal data interface as the first data interface.
  • the step of judging whether a data table including all the information segments can be generated through the existing table structure of the first data interface includes: judging whether all the information segments can be accommodated Into the data table generated through the existing table structure of the first data interface; if it can be accommodated in the data table generated through the existing table structure of the first data interface, it is determined that the The data table of the information segment.
  • the step of judging whether all the information segments can be accommodated in the data table generated by the existing table structure of the first data interface includes: judging whether all the information segments are They all match the fields of the existing table structure of the first data interface; if they all match, it is determined that they can be accommodated in the data table generated by the existing table structure of the first data interface.
  • the step of judging whether a data table including all the information segments can be generated through the existing table structure of the first data interface it includes: if it can generate a data table including all the information segments Data table, through the first data interface, save the message as a data table.
  • the step of using the existing table structure of the data interface to generate the first universal data interface including the data table of all the information segments includes: if the existing table structure of the first data interface cannot be generated and includes all the information Segment data table, it is judged whether all the information segments can be accommodated in the data table generated through the existing table structure of multiple preset universal data interfaces; if it can be accommodated through preset multiple universal data tables In the data table generated by the existing table structure of the data interface, it is determined that there is a first universal data interface capable of generating a data table including all the information segments.
  • the step of using the existing table structure of the data interface to generate the first universal data interface of the data table including all the information segments it includes: if the first universal data interface does not exist, then from a plurality of preset universal data In the interface, obtain a second universal data interface capable of generating a data table including at most the information segments; call the second universal data interface to save the message as a preliminary data table; determine that the preliminary data table is relative to Whether the name of the information segment lost by the message exists in the preset list of important information segment names; if the preliminary data table does not have a preset list of important information segment names relative to the information segment name lost by the message , The preliminary data table is recorded as the final data table.
  • the computer device of the present application uses a preset first data interface to receive a message sent by a data provider; parses the message to obtain multiple information segments in the message; judges the status of the first data interface Is there a table structure that can generate a data table that includes all the information segments; if not, call a common data interface that can generate a data table that includes all the information segments from the preset multiple universal data interfaces, thereby avoiding The computing power is wasted and the repetitive code is reduced.
  • An embodiment of the present application also provides a computer-readable storage medium on which computer-readable instructions are stored.
  • a method for saving messages based on a general data interface is implemented. The method includes the following steps: A first data interface is assumed to receive a message sent by a data provider, where the message is composed of multiple information segments; parse the message to obtain multiple information segments in the message; Whether the existing table structure of the first data interface can generate a data table including all the information segments; if the existing table structure of the first data interface cannot generate a data table including all the information segments, then Determine whether there is a first universal data interface that can use the existing table structure of the data interface to generate a data table including all the information segments among the preset multiple universal data interfaces; if the first universal data interface exists, Then the first universal data interface is called and the message is saved as a data table.
  • the preset first data interface is used to receive a message sent by a data provider, wherein, before the step that the message is composed of multiple information segments, includes: a predetermined time before the current time Within, from the plurality of preset universal data interfaces, count the second universal data interface that is called the most times; record the second universal data interface as the first data interface.
  • the step of judging whether a data table including all the information segments can be generated through the existing table structure of the first data interface includes: judging whether all the information segments can be accommodated Into the data table generated through the existing table structure of the first data interface; if it can be accommodated in the data table generated through the existing table structure of the first data interface, it is determined that the The data table of the information segment.
  • the step of judging whether all the information segments can be accommodated in the data table generated by the existing table structure of the first data interface includes: judging whether all the information segments are They all match the fields of the existing table structure of the first data interface; if they all match, it is determined that they can be accommodated in the data table generated by the existing table structure of the first data interface.
  • the step of judging whether a data table including all the information segments can be generated through the existing table structure of the first data interface it includes: if it can generate a data table including all the information segments Data table, through the first data interface, save the message as a data table.
  • the step of using the existing table structure of the data interface to generate the first universal data interface including the data table of all the information segments includes: if the existing table structure of the first data interface cannot be generated and includes all the information Segment data table, it is judged whether all the information segments can be accommodated in the data table generated through the existing table structure of multiple preset universal data interfaces; if it can be accommodated through preset multiple universal data tables In the data table generated by the existing table structure of the data interface, it is determined that there is a first universal data interface capable of generating a data table including all the information segments.
  • the step of using the existing table structure of the data interface to generate the first universal data interface of the data table including all the information segments it includes: if the first universal data interface does not exist, then from a plurality of preset universal data In the interface, obtain a second universal data interface capable of generating a data table including at most the information segments; call the second universal data interface to save the message as a preliminary data table; determine that the preliminary data table is relative to Whether the name of the information segment lost by the message exists in the preset list of important information segment names; if the preliminary data table does not have a preset list of important information segment names relative to the information segment name lost by the message , The preliminary data table is recorded as the final data table.
  • the computer-readable storage medium of the present application adopts a preset first data interface to receive a message sent by a data provider; parses the message to obtain multiple information segments in the message; judges the first data Whether the existing table structure of the interface can generate a data table including all the information segments; if not, call a universal data interface that can generate a data table including all the information segments from a plurality of preset universal data interfaces , Thereby avoiding waste of computing power and reducing repetitive code.
  • Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-rate data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种基于通用数据接口的报文保存方法、装置、计算机设备和存储介质,所述方法包括:采用预设的第一数据接口接收数据提供方发送的报文;解析所述报文,获得所述报文中的多个信息段;判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表;若不能够生成包括所有所述信息段的数据表,判断在预设的多个通用数据接口中,是否存在能够利用数据接口的现有表格结构生成包括所有所述信息段的数据表的第一通用数据接口;若存在所述第一通用数据接口,则调用所述第一通用数据接口,将所述报文保存成数据表。从而避免算力浪费、减少了重复的代码。

Description

基于通用数据接口的报文保存方法、装置和计算机设备
本申请要求于2019年1月31日提交中国专利局、申请号为2019101004892,发明名称为“基于通用数据接口的报文保存方法、装置和计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及到计算机领域,特别是涉及到一种基于通用数据接口的报文保存方法、装置、计算机设备和存储介质。
背景技术
数据提供方采用由多个信息段构成的报文,来传递数据信息。当接收上述由多个信息段构成的报文时,需要采用接口进行接收。该接口的现有表格结构若能与所述由多个信息段构成的报文相匹配时(即所有的信息段均能由该接口的现有表格结构所表现出来),那么通过该接口可以直接生成与报文对应的数据表。但是,一个特定的接口的现有表格结构不可能适应所有的报文,此时,会实时生成新的表格(依据新的表格结构),以容纳该报文的所有信息段,这样会需要更多的算力与更多的代码(用于生成新的表格结构)。因此,现有技术存在算力浪费、代码浪费的问题。
技术问题
本申请的主要目的为提供一种基于通用数据接口的报文保存方法、装置、计算机设备和存储介质,旨在减少算力浪费,避免代码浪费。
技术解决方案
为了实现上述目的,本申请提出一种基于通用数据接口的报文保存方法,包括以下步骤:
采用预设的第一数据接口接收数据提供方发送的报文,其中,所述报文由多个信息段构成;
解析所述报文,获得所述报文中的多个信息段;
判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表;
若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断在预设的多个通用数据接口中,是否存在能够利用数据接口的现有表格结构生成包括所有所述信息段的数据表的第一通用数据接口;
若存在所述第一通用数据接口,则调用所述第一通用数据接口,将所述报文保存成数据表。
本申请提供一种基于通用数据接口的报文保存装置,包括:
报文接收单元,用于采用预设的第一数据接口接收数据提供方发送的报文,其中,所述报文由多个信息段构成;
解析单元,用于解析所述报文,获得所述报文中的多个信息段;
数据表判断单元,用于判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表;
第一通用数据接口判断单元,用于若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断在预设的多个通用数据接口中,是否存在能够利用数据接口的现有表格结构生成包括所有所述信息段的数据表的第一通用数据接口;
报文保存单元,用于若存在所述第一通用数据接口,则调用所述第一通用数据接口,将所述报文保存成数据表。
本申请提供一种计算机设备,包括存储器和处理器,所述存储器存储有计算机可读指令,所述处理器执行所述计算机可读指令时实现上述任一项所述方法的步骤。
本申请提供一种计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现上述任一项所述的方法的步骤。
有益效果
本申请的基于通用数据接口的报文保存方法、装置、计算机设备和存储介质,采用预设的第一数据接口接收数据提供方发送的报文;解析所述报文,获得所述报文中的多个信息段;判断所述第一数据接口的现有表格结构是否能够生成包括所有所述信息段的数据表;若不能,则从预设的多个通用数据接口中调取能够生成包括所有所述信息段的数据表的通用数据接口,从而避免算力浪费、减少了重复的代码。
附图说明
图1 为本申请一实施例的基于通用数据接口的报文保存方法的流程示意图;
图2 为本申请一实施例的基于通用数据接口的报文保存装置的结构示意框图;
图3 为本申请一实施例的计算机设备的结构示意框图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
本发明的最佳实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
参照图1,本申请实施例提供一种基于通用数据接口的报文保存方法,包括以下步骤:
S1、采用预设的第一数据接口接收数据提供方发送的报文,其中,所述报文由多个信息段构成;
S2、解析所述报文,获得所述报文中的多个信息段;
S3、判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表;
S4、若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断在预设的多个通用数据接口中,是否存在能够利用数据接口的现有表格结构生成包括所有所述信息段的数据表的第一通用数据接口;
S5、若存在所述第一通用数据接口,则调用所述第一通用数据接口,将所述报文保存成数据表。
如上述步骤S1所述,采用预设的第一数据接口接收数据提供方发送的报文,其中,所述报文由多个信息段构成。报文是网络中交换与传输的数据单元,是各个系统之间交互的数据,即是数据提供方一次性要发送的数据块。报文包含了将要发送的完整的数据信息,其长短很不一致,长度不限且可变,由多个信息段构成。例如XML格式的报文中,以<body><span>123</span><h>abc</h></body>这种报文形式呈现,其中,包括了信息段span(内容为123)与信息段h(内容为abc)。当然,上述信息段可能不止两个。
如上述步骤S2所述,解析所述报文,获得所述报文中的多个信息段。从所述报文中解析出多个信息段,获得包括信息段名称,以及信息段内的具体内容。例如对于XML格式的报文,根据<第一信息段名称>第一信息段内容</第一信息段名称><第二信息段名称>第二信息段内容</第二信息段名称>……的预定格式,解析获得第一信息段名称、第一信息段内容、第二信息段名称、第二信息段内容……。对于其他具有预定规则的报文,同理可解析得到多个信息段。
如上述步骤S3所述,判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表。若第一数据接口的现有表格结构,能够将所述报文直接映射为数据表,那么就不需要创建新的数据表格结构,从而避免消耗额外算力,不需要过多的代码。具体判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表的过程包括:判断所有所述信息段的名称,是否与同一个所述现有表格结构中的字段名称均相同,若均相同,表明所述第一数据接口的现有表格结构能够将所述反文映射为数据表。进一步地,所述第一数据接口的现有表格结构还包括与所述信息段名称不同的其他字段。
如上述步骤S4所述,若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断在预设的多个通用数据接口中,是否存在能够利用数据接口的现有表格结构生成包括所有所述信息段的数据表的第一通用数据接口。如上所述,第一数据接口在不创建新的表格结构的基础上,无法将所述报文映射为数据表,那么可以寻找是否有其他数据接口能够要不创建新的表格结构的基础上,映射报文为数据表。具体过程包括:判断所有所述信息段的名称,是否与预设的多个通用数据接口的同一个现有表格结构中的字段名称均相同,若均相同,则判定存在能够生成包括所有所述信息段的数据表的第一通用数据接口。进一步地,所述第一通用数据接口的现有表格结构还包括与所述信息段名称不同的其他字段。
如上述步骤S5所述,若存在所述第一通用数据接口,则调用所述第一通用数据接口,将所述报文保存成数据表。既然判定所述第一通用数据接口适于处理所述报文,那么调用所述第一通用数据接口,将所述报文保存成数据表,即可实现报文保存操作。进一步地,可将报文映射成的数据表保存至数据库的表中,也可以存储在文件中。优选地,xml和json格式存入数据库的表中,yml或其他格式存入文件中。
在一个实施方式中,所述采用预设的第一数据接口接收数据提供方发送的报文,其中,所述报文由多个信息段构成的步骤S1之前,包括:
S001、在当前时间之前的预定时间之内,从所述预设的多个通用数据接口中,统计被调用次数最多的第二通用数据接口;
S002、将所述第二通用数据接口记为所述第一数据接口。
如上所述,实现了设置第一数据接口。本实施方式的目的是找出最常使用的数据接口,作为第一数据接口,以实现尽量减少再次调用其他数据接口的目的。若第一数据接口能够满足映射所述报文为数据表,那么就没有必要再次调用其他数据接口,即可实现报文保存操作。在预定时间内被调用次数最多的第二通用数据接口,表明第二通用数据接口的现有表格结构是使用最频繁的,适于作为第一数据接口,据此将其记为所述第一数据接口。
在一个实施方式中,所述判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表的步骤S3,包括:
S301、判断所有所述信息段,是否能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中;
S302、若能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中,则判定能够生成包括所有所述信息段的数据表。
如上所述,实现了判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表。若所有信息段均能够套入所述第一数据接口的现有表格结构中,以生成数据表,那么表明能够生成包括所有所述信息段的数据表。其中,所有所述信息段,是否所述被容纳入通过所述第一数据接口的现有表格结构生成的数据表中的判断方法包括:判断所述信息段的名称是否均存在于所述现有表格结构中,若是则判定所有信息段均能够套入所述第一数据接口的现有表格结构中,即判定能够生成包括所有所述信息段的数据表。进一步地,还包括判断所述现有表格结构的字段属性,是否能够容纳所述信息段。例如判断所述表格结构中的某字段的长度,是否小于相应的信息段的长度,若不小于,则表明能够容纳所述信息段。
在一个实施方式中,所述判断所有所述信息段,是否能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中的步骤S301,包括:
S3011、判断所有所述信息段,是否均与所述第一数据接口的现有表格结构的字段相匹配;
S3012、若均相匹配,则判定能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中。
如上所述,实现了判断所有所述信息段,是否能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中。其中,所述匹配是指,所述信息段的名称与所述第一数据接口的现有表格结构中的字段名称相同。进一步地,所述匹配还包括:所述信息段的属性与所述第一数据接口的现有表格结构的字段属性相匹配,例如所述信息段的长度小于所述字段的长度,从而使得所述字段能够容纳所述信息段。
在一个实施方式中,所述判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表的步骤S3之后,包括:
S31、若能够生成包括所有所述信息段的数据表,则通过所述第一数据接口,将所述报文保存成数据表。
如上所述,实现了将所述报文保存成数据表。若能够生成包括所有所述信息段的数据表,表明所述报文保存操作的需要已经能够被满足,因此不必调用其他数据接口,便可直接将报文保存成数据表。进一步地,可将报文映射成的数据表保存至数据库的表中,也可以存储在文件中。优选地,xml和json格式存入数据库的表中,yml或其他格式存入文件中。
在一个实施方式中,所述若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断在预设的多个通用数据接口中,是否存在能够利用数据接口的现有表格结构生成包括所有所述信息段的数据表的第一通用数据接口的步骤S4,包括:
S401、若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断所有所述信息段,是否能够被容纳入通过预设的多个通用数据接口的现有表格结构生成的数据表中;
S402、若能够被容纳入通过预设的多个通用数据接口的现有表格结构生成的数据表中,则判定存在能够生成包括所有所述信息段的数据表的第一通用数据接口。
如上所述,实现了判断是否存在能够生成包括所有所述信息段的数据表的第一通用数据接口。其中,所述第一通用数据接口是能够将所述报文无信息损失地,且无需新创建表格结构地映射为数据表的数据接口。预设的多个通用数据接口包括多种不同现有表格结构的数据接口,以便于加快报文数据表的生成速度,也便于减少需要的算力。其中,判断所有所述信息段,是否能够被容纳入通过预设的多个通用数据接口的现有表格结构生成的数据表中,具体包括:判断所述信息段的名称是否均存在于所述现有表格结构中,若是则判定所有信息段均能够套入通过预设的多个通用数据接口的现有表格结构生成的数据表中,即判定存在所述第一通用数据接口。进一步地,还包括判断所述现有表格结构的字段属性,是否能够容纳所述信息段。例如判断所述表格结构中的某字段的长度,是否小于相应的信息段的长度,若不小于,则表明能够容纳所述信息段。
在一个实施方式中,所述若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断在预设的多个通用数据接口中,是否存在能够利用数据接口的现有表格结构生成包括所有所述信息段的数据表的第一通用数据接口的步骤S4之后,包括:
S41、若不存在所述第一通用数据接口,则从预设的多个通用数据接口中,获得能够生成包括最多所述信息段的数据表的第二通用数据接口;
S42、调用所述第二通用数据接口,将所述报文保存成初步数据表;
S43、判断所述初步数据表相对于所述报文所损失的信息段名称是否存在预设的重要信息段名称列表中;
S44、若所述初步数据表相对于所述报文所损失的信息段名称不存在预设的重要信息段名称列表中,则将所述初步数据表记为最终数据表。
如上所述,实现了获得最终数据表。若不存在所述第一通用数据接口,则从预设的多个通用数据接口中,寻找在信息损失最小的情况下,能够映射所述报文的数据接口。具体地过程包括:从多个现有表格结构的字段名称与所述信息段的名称进行对比,找出相同名称数量最多的现有表格结构,将该表结构对应的通用数据接口记为第二通用数据接口。由于第二通用数据接口不能完美地映射报文,因此只能将所述报文保存成初步数据表。由于初步数据表不能将报文的所有信息段全部保存下来,因此必然有信息段损失。若损失的信息段不重要(通过判断损失的信息段名称是否存在预设的重要信息段名称列表中,若不存在,则判定不重要),那么可以将其忽视,将初步数据表记为最终数据表即可。进一步地,若损失的信息段重要(通过判断损失的信息段名称是否存在预设的重要信息段名称列表中,若存在,则判定重要),则将所述初步数据表及相应的损失的信息段发送给工作人员,根据工作人员的进一步指令(例如补全信息段等),以完善数据表。
本申请的基于通用数据接口的报文保存方法,采用预设的第一数据接口接收数据提供方发送的报文;解析所述报文,获得所述报文中的多个信息段;判断所述第一数据接口的现有表格结构是否能够生成包括所有所述信息段的数据表;若不能,则从预设的多个通用数据接口中调取能够生成包括所有所述信息段的数据表的通用数据接口,从而避免算力浪费、减少了重复的代码。
参照图2,本申请实施例提供一种基于通用数据接口的报文保存装置,包括:
报文接收单元10,用于采用预设的第一数据接口接收数据提供方发送的报文,其中,所述报文由多个信息段构成;
解析单元20,用于解析所述报文,获得所述报文中的多个信息段;
数据表判断单元30,用于判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表;
第一通用数据接口判断单元40,用于若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断在预设的多个通用数据接口中,是否存在能够利用数据接口的现有表格结构生成包括所有所述信息段的数据表的第一通用数据接口;
报文保存单元50,用于若存在所述第一通用数据接口,则调用所述第一通用数据接口,将所述报文保存成数据表。
如上述单元10所述,采用预设的第一数据接口接收数据提供方发送的报文,其中,所述报文由多个信息段构成。报文是网络中交换与传输的数据单元,是各个系统之间交互的数据,即是数据提供方一次性要发送的数据块。报文包含了将要发送的完整的数据信息,其长短很不一致,长度不限且可变,由多个信息段构成。例如XML格式的报文中,以<body><span>123</span><h>abc</h></body>这种报文形式呈现,其中,包括了信息段span(内容为123)与信息段h(内容为abc)。当然,上述信息段可能不止两个。
如上述单元20所述,解析所述报文,获得所述报文中的多个信息段。从所述报文中解析出多个信息段,获得包括信息段名称,以及信息段内的具体内容。例如对于XML格式的报文,根据<第一信息段名称>第一信息段内容</第一信息段名称><第二信息段名称>第二信息段内容</第二信息段名称>……的预定格式,解析获得第一信息段名称、第一信息段内容、第二信息段名称、第二信息段内容……。对于其他具有预定规则的报文,同理可解析得到多个信息段。
如上述单元30所述,判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表。若第一数据接口的现有表格结构,能够将所述报文直接映射为数据表,那么就不需要创建新的数据表格结构,从而避免消耗额外算力,不需要过多的代码。具体判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表的过程包括:判断所有所述信息段的名称,是否与同一个所述现有表格结构中的字段名称均相同,若均相同,表明所述第一数据接口的现有表格结构能够将所述反文映射为数据表。进一步地,所述第一数据接口的现有表格结构还包括与所述信息段名称不同的其他字段。
如上述单元40所述,若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断在预设的多个通用数据接口中,是否存在能够利用数据接口的现有表格结构生成包括所有所述信息段的数据表的第一通用数据接口。如上所述,第一数据接口在不创建新的表格结构的基础上,无法将所述报文映射为数据表,那么可以寻找是否有其他数据接口能够要不创建新的表格结构的基础上,映射报文为数据表。具体过程包括:判断所有所述信息段的名称,是否与预设的多个通用数据接口的同一个现有表格结构中的字段名称均相同,若均相同,则判定存在能够生成包括所有所述信息段的数据表的第一通用数据接口。进一步地,所述第一通用数据接口的现有表格结构还包括与所述信息段名称不同的其他字段。
如上述单元50所述,若存在所述第一通用数据接口,则调用所述第一通用数据接口,将所述报文保存成数据表。既然判定所述第一通用数据接口适于处理所述报文,那么调用所述第一通用数据接口,将所述报文保存成数据表,即可实现报文保存操作。进一步地,可将报文映射成的数据表保存至数据库的表中,也可以存储在文件中。优选地,xml和json格式存入数据库的表中,yml或其他格式存入文件中。
在一个实施方式中,所述装置,包括:
统计单元,用于在当前时间之前的预定时间之内,从所述预设的多个通用数据接口中,统计被调用次数最多的第二通用数据接口;
接口标记单元,用于将所述第二通用数据接口记为所述第一数据接口。
如上所述,实现了设置第一数据接口。本实施方式的目的是找出最常使用的数据接口,作为第一数据接口,以实现尽量减少再次调用其他数据接口的目的。若第一数据接口能够满足映射所述报文为数据表,那么就没有必要再次调用其他数据接口,即可实现报文保存操作。在预定时间内被调用次数最多的第二通用数据接口,表明第二通用数据接口的现有表格结构是使用最频繁的,适于作为第一数据接口,据此将其记为所述第一数据接口。
在一个实施方式中,所述数据表判断单元30,包括:
第一数据接口容纳判断子单元,用于判断所有所述信息段,是否能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中;
数据表判定子单元,用于若能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中,则判定能够生成包括所有所述信息段的数据表。
如上所述,实现了判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表。若所有信息段均能够套入所述第一数据接口的现有表格结构中,以生成数据表,那么表明能够生成包括所有所述信息段的数据表。其中,所有所述信息段,是否所述被容纳入通过所述第一数据接口的现有表格结构生成的数据表中的判断方法包括:判断所述信息段的名称是否均存在于所述现有表格结构中,若是则判定所有信息段均能够套入所述第一数据接口的现有表格结构中,即判定能够生成包括所有所述信息段的数据表。进一步地,还包括判断所述现有表格结构的字段属性,是否能够容纳所述信息段。例如判断所述表格结构中的某字段的长度,是否小于相应的信息段的长度,若不小于,则表明能够容纳所述信息段。
在一个实施方式中,所述第一数据接口容纳判断子单元,包括:
字段匹配判断模块,用于判断所有所述信息段,是否均与所述第一数据接口的现有表格结构的字段相匹配;
数据表判定模块,用于若均相匹配,则判定能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中。
如上所述,实现了判断所有所述信息段,是否能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中。其中,所述匹配是指,所述信息段的名称与所述第一数据接口的现有表格结构中的字段名称相同。进一步地,所述匹配还包括:所述信息段的属性与所述第一数据接口的现有表格结构的字段属性相匹配,例如所述信息段的长度小于所述字段的长度,从而使得所述字段能够容纳所述信息段。
在一个实施方式中,所述装置,包括:
数据表保存单元,用于若能够生成包括所有所述信息段的数据表,则通过所述第一数据接口,将所述报文保存成数据表。
如上所述,实现了将所述报文保存成数据表。若能够生成包括所有所述信息段的数据表,表明所述报文保存操作的需要已经能够被满足,因此不必调用其他数据接口,便可直接将报文保存成数据表。进一步地,可将报文映射成的数据表保存至数据库的表中,也可以存储在文件中。优选地,xml和json格式存入数据库的表中,yml或其他格式存入文件中。
在一个实施方式中,所述第一通用数据接口判断单元40,包括:
多个通用数据接口判断子单元,用于若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断所有所述信息段,是否能够被容纳入通过预设的多个通用数据接口的现有表格结构生成的数据表中;
第一通用数据接口判定子单元,用于若能够被容纳入通过预设的多个通用数据接口的现有表格结构生成的数据表中,则判定存在能够生成包括所有所述信息段的数据表的第一通用数据接口。
如上所述,实现了判断是否存在能够生成包括所有所述信息段的数据表的第一通用数据接口。其中,所述第一通用数据接口是能够将所述报文无信息损失地,且无需新创建表格结构地映射为数据表的数据接口。预设的多个通用数据接口包括多种不同现有表格结构的数据接口,以便于加快报文数据表的生成速度,也便于减少需要的算力。其中,判断所有所述信息段,是否能够被容纳入通过预设的多个通用数据接口的现有表格结构生成的数据表中,具体包括:判断所述信息段的名称是否均存在于所述现有表格结构中,若是则判定所有信息段均能够套入通过预设的多个通用数据接口的现有表格结构生成的数据表中,即判定存在所述第一通用数据接口。进一步地,还包括判断所述现有表格结构的字段属性,是否能够容纳所述信息段。例如判断所述表格结构中的某字段的长度,是否小于相应的信息段的长度,若不小于,则表明能够容纳所述信息段。
在一个实施方式中,所述装置,包括:
第二通用数据接口获得单元,用于若不存在所述第一通用数据接口,则从预设的多个通用数据接口中,获得能够生成包括最多所述信息段的数据表的第二通用数据接口;
第二通用数据接口调用单元,用于调用所述第二通用数据接口,将所述报文保存成初步数据表;
信息段名称判断单元,用于判断所述初步数据表相对于所述报文所损失的信息段名称是否存在预设的重要信息段名称列表中;
初步数据表标记单元,用于若所述初步数据表相对于所述报文所损失的信息段名称不存在预设的重要信息段名称列表中,则将所述初步数据表记为最终数据表。
如上所述,实现了获得最终数据表。若不存在所述第一通用数据接口,则从预设的多个通用数据接口中,寻找在信息损失最小的情况下,能够映射所述报文的数据接口。具体地过程包括:从多个现有表格结构的字段名称与所述信息段的名称进行对比,找出相同名称数量最多的现有表格结构,将该表结构对应的通用数据接口记为第二通用数据接口。由于第二通用数据接口不能完美地映射报文,因此只能将所述报文保存成初步数据表。由于初步数据表不能将报文的所有信息段全部保存下来,因此必然有信息段损失。若损失的信息段不重要(通过判断损失的信息段名称是否存在预设的重要信息段名称列表中,若不存在,则判定不重要),那么可以将其忽视,将初步数据表记为最终数据表即可。进一步地,若损失的信息段重要(通过判断损失的信息段名称是否存在预设的重要信息段名称列表中,若存在,则判定重要),则将所述初步数据表及相应的损失的信息段发送给工作人员,根据工作人员的进一步指令(例如补全信息段等),以完善数据表。
本申请的基于通用数据接口的报文保存装置,采用预设的第一数据接口接收数据提供方发送的报文;解析所述报文,获得所述报文中的多个信息段;判断所述第一数据接口的现有表格结构是否能够生成包括所有所述信息段的数据表;若不能,则从预设的多个通用数据接口中调取能够生成包括所有所述信息段的数据表的通用数据接口,从而避免算力浪费、减少了重复的代码。
参照图3,本申请实施例中还提供一种计算机设备,该计算机设备可以是服务器,其内部结构可以如图所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设计的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机可读指令和数据库。该内存器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储基于通用数据接口的报文保存方法所用数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种基于通用数据接口的报文保存方法。
上述处理器执行上述基于通用数据接口的报文保存方法,包括以下步骤:采用预设的第一数据接口接收数据提供方发送的报文,其中,所述报文由多个信息段构成;解析所述报文,获得所述报文中的多个信息段;判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表;若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断在预设的多个通用数据接口中,是否存在能够利用数据接口的现有表格结构生成包括所有所述信息段的数据表的第一通用数据接口;若存在所述第一通用数据接口,则调用所述第一通用数据接口,将所述报文保存成数据表。
在一个实施方式中,所述采用预设的第一数据接口接收数据提供方发送的报文,其中,所述报文由多个信息段构成的步骤之前,包括:在当前时间之前的预定时间之内,从所述预设的多个通用数据接口中,统计被调用次数最多的第二通用数据接口;将所述第二通用数据接口记为所述第一数据接口。
在一个实施方式中,所述判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表的步骤,包括:判断所有所述信息段,是否能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中;若能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中,则判定能够生成包括所有所述信息段的数据表。
在一个实施方式中,所述判断所有所述信息段,是否能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中的步骤,包括:判断所有所述信息段,是否均与所述第一数据接口的现有表格结构的字段相匹配;若均相匹配,则判定能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中。
在一个实施方式中,所述判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表的步骤之后,包括:若能够生成包括所有所述信息段的数据表,则通过所述第一数据接口,将所述报文保存成数据表。
在一个实施方式中,所述若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断在预设的多个通用数据接口中,是否存在能够利用数据接口的现有表格结构生成包括所有所述信息段的数据表的第一通用数据接口的步骤,包括:若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断所有所述信息段,是否能够被容纳入通过预设的多个通用数据接口的现有表格结构生成的数据表中;若能够被容纳入通过预设的多个通用数据接口的现有表格结构生成的数据表中,则判定存在能够生成包括所有所述信息段的数据表的第一通用数据接口。
在一个实施方式中,所述若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断在预设的多个通用数据接口中,是否存在能够利用数据接口的现有表格结构生成包括所有所述信息段的数据表的第一通用数据接口的步骤之后,包括:若不存在所述第一通用数据接口,则从预设的多个通用数据接口中,获得能够生成包括最多所述信息段的数据表的第二通用数据接口;调用所述第二通用数据接口,将所述报文保存成初步数据表;判断所述初步数据表相对于所述报文所损失的信息段名称是否存在预设的重要信息段名称列表中;若所述初步数据表相对于所述报文所损失的信息段名称不存在预设的重要信息段名称列表中,则将所述初步数据表记为最终数据表。
本领域技术人员可以理解,图中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定。
本申请的计算机设备,采用预设的第一数据接口接收数据提供方发送的报文;解析所述报文,获得所述报文中的多个信息段;判断所述第一数据接口的现有表格结构是否能够生成包括所有所述信息段的数据表;若不能,则从预设的多个通用数据接口中调取能够生成包括所有所述信息段的数据表的通用数据接口,从而避免算力浪费、减少了重复的代码。
本申请一实施例还提供一种计算机可读存储介质,其上存储有计算机可读指令,计算机可读指令被处理器执行时实现基于通用数据接口的报文保存方法,包括以下步骤:采用预设的第一数据接口接收数据提供方发送的报文,其中,所述报文由多个信息段构成;解析所述报文,获得所述报文中的多个信息段;判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表;若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断在预设的多个通用数据接口中,是否存在能够利用数据接口的现有表格结构生成包括所有所述信息段的数据表的第一通用数据接口;若存在所述第一通用数据接口,则调用所述第一通用数据接口,将所述报文保存成数据表。
在一个实施方式中,所述采用预设的第一数据接口接收数据提供方发送的报文,其中,所述报文由多个信息段构成的步骤之前,包括:在当前时间之前的预定时间之内,从所述预设的多个通用数据接口中,统计被调用次数最多的第二通用数据接口;将所述第二通用数据接口记为所述第一数据接口。
在一个实施方式中,所述判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表的步骤,包括:判断所有所述信息段,是否能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中;若能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中,则判定能够生成包括所有所述信息段的数据表。
在一个实施方式中,所述判断所有所述信息段,是否能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中的步骤,包括:判断所有所述信息段,是否均与所述第一数据接口的现有表格结构的字段相匹配;若均相匹配,则判定能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中。
在一个实施方式中,所述判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表的步骤之后,包括:若能够生成包括所有所述信息段的数据表,则通过所述第一数据接口,将所述报文保存成数据表。
在一个实施方式中,所述若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断在预设的多个通用数据接口中,是否存在能够利用数据接口的现有表格结构生成包括所有所述信息段的数据表的第一通用数据接口的步骤,包括:若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断所有所述信息段,是否能够被容纳入通过预设的多个通用数据接口的现有表格结构生成的数据表中;若能够被容纳入通过预设的多个通用数据接口的现有表格结构生成的数据表中,则判定存在能够生成包括所有所述信息段的数据表的第一通用数据接口。
在一个实施方式中,所述若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断在预设的多个通用数据接口中,是否存在能够利用数据接口的现有表格结构生成包括所有所述信息段的数据表的第一通用数据接口的步骤之后,包括:若不存在所述第一通用数据接口,则从预设的多个通用数据接口中,获得能够生成包括最多所述信息段的数据表的第二通用数据接口;调用所述第二通用数据接口,将所述报文保存成初步数据表;判断所述初步数据表相对于所述报文所损失的信息段名称是否存在预设的重要信息段名称列表中;若所述初步数据表相对于所述报文所损失的信息段名称不存在预设的重要信息段名称列表中,则将所述初步数据表记为最终数据表。
本申请的计算机可读存储介质,采用预设的第一数据接口接收数据提供方发送的报文;解析所述报文,获得所述报文中的多个信息段;判断所述第一数据接口的现有表格结构是否能够生成包括所有所述信息段的数据表;若不能,则从预设的多个通用数据接口中调取能够生成包括所有所述信息段的数据表的通用数据接口,从而避免算力浪费、减少了重复的代码。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的和实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可以包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双速据率SDRAM(SSRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。
以上所述仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种基于通用数据接口的报文保存方法,其特征在于,包括:
    采用预设的第一数据接口接收数据提供方发送的报文,其中,所述报文由多个信息段构成;
    解析所述报文,获得所述报文中的多个信息段;
    判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表;
    若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断在预设的多个通用数据接口中,是否存在能够利用数据接口的现有表格结构生成包括所有所述信息段的数据表的第一通用数据接口;
    若存在所述第一通用数据接口,则调用所述第一通用数据接口,将所述报文保存成数据表。
  2. 根据权利要求1所述的基于通用数据接口的报文保存方法,其特征在于,所述采用预设的第一数据接口接收数据提供方发送的报文,其中,所述报文由多个信息段构成的步骤之前,包括:
    在当前时间之前的预定时间之内,从所述预设的多个通用数据接口中,统计被调用次数最多的第二通用数据接口;
    将所述第二通用数据接口记为所述第一数据接口。
  3. 根据权利要求1所述的基于通用数据接口的报文保存方法,其特征在于,所述判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表的步骤,包括:
    判断所有所述信息段,是否能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中;
    若能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中,则判定能够生成包括所有所述信息段的数据表。
  4. 根据权利要求3所述的基于通用数据接口的报文保存方法,其特征在于,所述判断所有所述信息段,是否能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中的步骤,包括:
    判断所有所述信息段,是否均与所述第一数据接口的现有表格结构的字段相匹配;
    若均相匹配,则判定能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中。
  5. 根据权利要求1所述的基于通用数据接口的报文保存方法,其特征在于,所述判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表的步骤之后,包括:
    若能够生成包括所有所述信息段的数据表,则通过所述第一数据接口,将所述报文保存成数据表。
  6. 根据权利要求1所述的基于通用数据接口的报文保存方法,其特征在于,所述若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断在预设的多个通用数据接口中,是否存在能够利用数据接口的现有表格结构生成包括所有所述信息段的数据表的第一通用数据接口的步骤,包括:
    若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断所有所述信息段,是否能够被容纳入通过预设的多个通用数据接口的现有表格结构生成的数据表中;
    若能够被容纳入通过预设的多个通用数据接口的现有表格结构生成的数据表中,则判定存在能够生成包括所有所述信息段的数据表的第一通用数据接口。
  7. 根据权利要求1所述的基于通用数据接口的报文保存方法,其特征在于,所述若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断在预设的多个通用数据接口中,是否存在能够利用数据接口的现有表格结构生成包括所有所述信息段的数据表的第一通用数据接口的步骤之后,包括:
    若不存在所述第一通用数据接口,则从预设的多个通用数据接口中,获得能够生成包括最多所述信息段的数据表的第二通用数据接口;
    调用所述第二通用数据接口,将所述报文保存成初步数据表;
    判断所述初步数据表相对于所述报文所损失的信息段名称是否存在预设的重要信息段名称列表中;
    若所述初步数据表相对于所述报文所损失的信息段名称不存在预设的重要信息段名称列表中,则将所述初步数据表记为最终数据表。
  8. 一种基于通用数据接口的报文保存装置,其特征在于,包括:
    报文接收单元,用于采用预设的第一数据接口接收数据提供方发送的报文,其中,所述报文由多个信息段构成;
    解析单元,用于解析所述报文,获得所述报文中的多个信息段;
    数据表判断单元,用于判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表;
    第一通用数据接口判断单元,用于若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断在预设的多个通用数据接口中,是否存在能够利用数据接口的现有表格结构生成包括所有所述信息段的数据表的第一通用数据接口;
    报文保存单元,用于若存在所述第一通用数据接口,则调用所述第一通用数据接口,将所述报文保存成数据表。
  9. 根据权利要求8所述的基于通用数据接口的报文保存装置,其特征在于,所述装置,包括:
    统计单元,用于在当前时间之前的预定时间之内,从所述预设的多个通用数据接口中,统计被调用次数最多的第二通用数据接口;
    接口标记单元,用于将所述第二通用数据接口记为所述第一数据接口。
  10. 根据权利要求8所述的基于通用数据接口的报文保存装置,其特征在于,所述数据表判断单元,包括:
    第一数据接口容纳判断子单元,用于判断所有所述信息段,是否能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中;
    数据表判定子单元,用于若能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中,则判定能够生成包括所有所述信息段的数据表。
  11. 根据权利要求10所述的基于通用数据接口的报文保存装置,其特征在于,所述第一数据接口容纳判断子单元,包括:
    字段匹配判断模块,用于判断所有所述信息段,是否均与所述第一数据接口的现有表格结构的字段相匹配;
    数据表判定模块,用于若均相匹配,则判定能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中。
  12. 根据权利要求8所述的基于通用数据接口的报文保存装置,其特征在于,所述装置,包括:
    数据表保存单元,用于若能够生成包括所有所述信息段的数据表,则通过所述第一数据接口,将所述报文保存成数据表。
  13. 根据权利要求8所述的基于通用数据接口的报文保存装置,其特征在于,所述第一通用数据接口判断单元,包括:
    多个通用数据接口判断子单元,用于若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断所有所述信息段,是否能够被容纳入通过预设的多个通用数据接口的现有表格结构生成的数据表中;
    第一通用数据接口判定子单元,用于若能够被容纳入通过预设的多个通用数据接口的现有表格结构生成的数据表中,则判定存在能够生成包括所有所述信息段的数据表的第一通用数据接口。
  14. 根据权利要求8所述的基于通用数据接口的报文保存装置,其特征在于,所述装置,包括:
    第二通用数据接口获得单元,用于若不存在所述第一通用数据接口,则从预设的多个通用数据接口中,获得能够生成包括最多所述信息段的数据表的第二通用数据接口;
    第二通用数据接口调用单元,用于调用所述第二通用数据接口,将所述报文保存成初步数据表;
    信息段名称判断单元,用于判断所述初步数据表相对于所述报文所损失的信息段名称是否存在预设的重要信息段名称列表中;
    初步数据表标记单元,用于若所述初步数据表相对于所述报文所损失的信息段名称不存在预设的重要信息段名称列表中,则将所述初步数据表记为最终数据表。
  15. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现基于通用数据接口的报文保存方法,所述基于通用数据接口的报文保存方法,包括:
    采用预设的第一数据接口接收数据提供方发送的报文,其中,所述报文由多个信息段构成;
    解析所述报文,获得所述报文中的多个信息段;
    判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表;
    若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断在预设的多个通用数据接口中,是否存在能够利用数据接口的现有表格结构生成包括所有所述信息段的数据表的第一通用数据接口;
    若存在所述第一通用数据接口,则调用所述第一通用数据接口,将所述报文保存成数据表。
  16. 根据权利要求15所述的计算机设备,其特征在于,所述采用预设的第一数据接口接收数据提供方发送的报文,其中,所述报文由多个信息段构成的步骤之前,包括:
    在当前时间之前的预定时间之内,从所述预设的多个通用数据接口中,统计被调用次数最多的第二通用数据接口;
    将所述第二通用数据接口记为所述第一数据接口。
  17. 根据权利要求15所述的计算机设备,其特征在于,所述判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表的步骤,包括:
    判断所有所述信息段,是否能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中;
    若能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中,则判定能够生成包括所有所述信息段的数据表。
  18. 一种非易失性的计算机可读存储介质,其上存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现基于通用数据接口的报文保存方法,所述基于通用数据接口的报文保存方法,包括:
    采用预设的第一数据接口接收数据提供方发送的报文,其中,所述报文由多个信息段构成;
    解析所述报文,获得所述报文中的多个信息段;
    判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表;
    若通过所述第一数据接口的现有表格结构不能够生成包括所有所述信息段的数据表,则判断在预设的多个通用数据接口中,是否存在能够利用数据接口的现有表格结构生成包括所有所述信息段的数据表的第一通用数据接口;
    若存在所述第一通用数据接口,则调用所述第一通用数据接口,将所述报文保存成数据表。
  19. 根据权利要求18所述的非易失性的计算机可读存储介质,其特征在于,所述采用预设的第一数据接口接收数据提供方发送的报文,其中,所述报文由多个信息段构成的步骤之前,包括:
    在当前时间之前的预定时间之内,从所述预设的多个通用数据接口中,统计被调用次数最多的第二通用数据接口;
    将所述第二通用数据接口记为所述第一数据接口。
  20. 根据权利要求18所述的非易失性的计算机可读存储介质,其特征在于,所述判断通过所述第一数据接口的现有表格结构,是否能够生成包括所有所述信息段的数据表的步骤,包括:
    判断所有所述信息段,是否能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中;
    若能够被容纳入通过所述第一数据接口的现有表格结构生成的数据表中,则判定能够生成包括所有所述信息段的数据表。
PCT/CN2019/119218 2019-01-31 2019-11-18 基于通用数据接口的报文保存方法、装置和计算机设备 Ceased WO2020155784A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910100489.2 2019-01-31
CN201910100489.2A CN109918433B (zh) 2019-01-31 2019-01-31 基于通用数据接口的报文保存方法、装置和计算机设备

Publications (1)

Publication Number Publication Date
WO2020155784A1 true WO2020155784A1 (zh) 2020-08-06

Family

ID=66961259

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/119218 Ceased WO2020155784A1 (zh) 2019-01-31 2019-11-18 基于通用数据接口的报文保存方法、装置和计算机设备

Country Status (2)

Country Link
CN (1) CN109918433B (zh)
WO (1) WO2020155784A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109918433B (zh) * 2019-01-31 2024-05-07 平安科技(深圳)有限公司 基于通用数据接口的报文保存方法、装置和计算机设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104216952A (zh) * 2014-08-20 2014-12-17 烽火通信科技股份有限公司 一种基于xml技术的通用报表生成方法及系统
CN105787057A (zh) * 2016-02-29 2016-07-20 浪潮通用软件有限公司 一种异构系统间业务数据自动同步的实现方法
CN106557568A (zh) * 2016-11-14 2017-04-05 中国电子科技集团公司第二十八研究所 模式匹配的xml文件格式与关系数据库转换的处理方法
CN108268253A (zh) * 2017-05-05 2018-07-10 平安科技(深圳)有限公司 接口代码生成方法及终端设备
CN109918433A (zh) * 2019-01-31 2019-06-21 平安科技(深圳)有限公司 基于通用数据接口的报文保存方法、装置和计算机设备

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140278639A1 (en) * 2013-03-15 2014-09-18 Coreworx Inc. System and method for interface management
US9613105B1 (en) * 2013-12-05 2017-04-04 Intuit Inc. Streamlined data entry based on data relationships
CN105335310B (zh) * 2014-06-05 2020-05-08 阿里巴巴集团控股有限公司 一种接口定义方法和数据传输方法及装置
CN108959537B (zh) * 2018-06-29 2021-03-26 新华三大数据技术有限公司 Web服务接口获取方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104216952A (zh) * 2014-08-20 2014-12-17 烽火通信科技股份有限公司 一种基于xml技术的通用报表生成方法及系统
CN105787057A (zh) * 2016-02-29 2016-07-20 浪潮通用软件有限公司 一种异构系统间业务数据自动同步的实现方法
CN106557568A (zh) * 2016-11-14 2017-04-05 中国电子科技集团公司第二十八研究所 模式匹配的xml文件格式与关系数据库转换的处理方法
CN108268253A (zh) * 2017-05-05 2018-07-10 平安科技(深圳)有限公司 接口代码生成方法及终端设备
CN109918433A (zh) * 2019-01-31 2019-06-21 平安科技(深圳)有限公司 基于通用数据接口的报文保存方法、装置和计算机设备

Also Published As

Publication number Publication date
CN109918433B (zh) 2024-05-07
CN109918433A (zh) 2019-06-21

Similar Documents

Publication Publication Date Title
CN111274157B (zh) 测试数据模拟方法、装置、计算机设备和存储介质
WO2021013058A1 (zh) 大数据产品的异常提示方法、装置、系统、设备及介质
JP7538121B2 (ja) ネットワークのデータを処理するための方法、システム及び装置
JP5253396B2 (ja) Xml文書の位置記述を用いてxml文書管理機能を実現するためのxdmシステム及び方法
CN114416075B (zh) 业务处理方法及装置
CN109636317A (zh) 业务控制方法、装置、系统及存储介质
WO2021000416A1 (zh) 基于管理平台的微服务预警方法、装置和计算机设备
WO2019154353A1 (zh) 系统运行参数查询方法、匹配方法、装置及节点设备
CN112201238A (zh) 智能问答中语音数据的处理方法、装置及相关设备
EP2209264A1 (en) Document management method, system and correlated device
US9082409B2 (en) Binary-caching for XML documents with embedded executable code
CN111177182B (zh) 数据查询方法和装置、存储介质和电子设备
CN114490889A (zh) 配置信息处理方法、装置、设备、介质及程序产品
CN112398809B (zh) 协议规则转换方法、装置、计算机设备和存储介质
CN111143532B (zh) 对话单元的访问方法、装置、设备及存储介质
WO2020155784A1 (zh) 基于通用数据接口的报文保存方法、装置和计算机设备
CN111131442B (zh) 网页数据的监听方法、终端设备及可读存储介质
US20110170674A1 (en) Apparatus, a mediating method, a program thereof and a system
JP2007521562A (ja) アクショナブルなメッセージ通信
US9275252B2 (en) Enhanced view compliance tool
CN110134900A (zh) 页面数据分享方法、装置、计算机设备和存储介质
CN111031063B (zh) 一种基于家教机的数据传输方法及设备
CN115145986B (zh) 一种应用于多网管平台运维数据的etl系统及方法
US20250078831A1 (en) Conversational digital assistant
CN108235802A (zh) 通信控制方法与控制装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19913723

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19913723

Country of ref document: EP

Kind code of ref document: A1