Message processing method and device

By obtaining the standard format documents of financial messages, parsing out the general object processor and tree data structure, and generating modular text-like code templates, solving the problems of complexity and maintenance costs of financial messages processing code writing, achieving high efficiency The packet processing logic implementation and code maintenance.

CN119025087APending Publication Date: 2024-11-26CLP JINXIN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411108951.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

In the prior art, the financial message processing code needs to be written separately for each message format and business rules, resulting in large workload, complex maintenance and high cost, and there is a risk of logical inconsistency when modifying the code.

Method used

By obtaining standard format documents for financial classification messages, parsing out general object processors and tree data structures, writing text-type code templates, and generating target language codes for special object processors based on data object settings to realize the modularization of the code and reusability, reducing manual writing and error rates.

Benefits of technology

Improve the efficiency of packet processing logic implementation, shorten the development cycle, reduce workload, improve the maintainability and reusability of code, simplify the processing process, optimize resource utilization, and enhance the scalability and ability of the system. Maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025087A_ABST
    Figure CN119025087A_ABST
Patent Text Reader

Abstract

The invention provides a message processing method and device, and the method comprises the steps: carrying out the analysis of a standard-format message document corresponding to a plurality of obtained financial classification messages, so as to obtain a universal object processor and a tree-shaped data structure, which are related to each data object; writing a text type code template of multiple target languages of each general object processor; and according to the setting corresponding to each data object, generating a logic source code, a text type code template and tree structure data, and generating a processing logic target source code of a plurality of target languages of a special object processor associated with each data object, so that the complete processing logic target source code can be quickly generated, and the processing efficiency is improved. The message processing logic implementation efficiency is improved, in addition, when the function needs to be modified or expanded, a large number of processing codes do not need to be written, and the problems of large workload, complex maintenance, high cost and the like caused by writing the processing codes for each financial message are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of data processing, and in particular to a message processing method and device. Background Art

[0002] Financial messages usually refer to electronic messages used in financial transactions or information exchanges between financial institutions. Timely processing of financial messages can ensure accurate and efficient transmission of transaction information.

[0003] Currently, financial messages are mainly processed by writing codes. However, since each message is processed in a different way, it is necessary to write processing codes for each financial message, which is a lot of work. When the financial message format or business rules change, the corresponding code needs to be modified separately, which increases the complexity and cost of code maintenance. Summary of the invention

[0004] The present disclosure provides a message processing method and device to solve one of the technical problems in the related art at least to a certain extent. The technical solution of the present disclosure is as follows:

[0005] According to a first aspect of an embodiment of the present disclosure, a message processing method is provided, comprising: obtaining message documents in a standard format corresponding to a plurality of financial classification messages; parsing the plurality of message documents to obtain a general object processor and a tree data structure associated with each data object in the plurality of message documents; writing text class code templates in a plurality of target languages ​​for each of the general object processors, wherein the text class code templates include a common processing logic source code corresponding to the general object processor; generating a logic source code, a text class code template and the tree structure data according to settings corresponding to each of the data objects, and generating a processing logic target source code in the plurality of target languages ​​for a special object processor associated with each of the data objects; wherein the processing logic target source code is used to process the corresponding financial classification messages.

[0006] According to a second aspect of an embodiment of the present disclosure, a message processing device is provided, comprising: an acquisition module for acquiring message documents in a standard format corresponding to a plurality of financial classification messages; a parsing module for parsing the plurality of message documents to obtain a general object processor and a tree data structure associated with each data object in the plurality of message documents; a writing module for writing text class code templates in a plurality of target languages ​​for each of the general object processors, wherein the text class code templates include a common processing logic source code corresponding to the general object processor; a generation module for generating a logic source code, a text class code template and the tree structure data according to settings corresponding to each of the data objects, and generating a processing logic target source code in the plurality of target languages ​​for a special object processor associated with each of the data objects; wherein the processing logic target source code is used to process the corresponding financial classification messages.

[0007] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the message processing method as described in the embodiment of the first aspect of the present disclosure.

[0008] According to the fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute the message processing method as described in the embodiment of the first aspect of the present disclosure.

[0009] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including: a computer program, which, when executed by a processor, implements the message processing method as described in the embodiment of the first aspect of the present disclosure.

[0010] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0011] In the technical scheme, by obtaining standard format message documents corresponding to various financial classification messages, parsing them to extract general object processors and tree data structures, and then compiling text class code templates in various target languages ​​associated with various data objects, wherein the text class code templates include the common processing logic source code of the corresponding general object processor, making the code more modular and reusable, and then, based on the setting generation logic source code corresponding to each data object, the text class code template and the tree structure data, the processing logic target source code of various target languages ​​of the special object processor associated with each data object is automatically generated, reducing the time and error rate of manual code writing. Since the text class code template contains the public processing logic, when generating the processing logic target source code, there is no need to repeatedly write the same processing logic. It is only necessary to fill in or modify a small number of specific parts in the template according to the specific data objects and business requirements, so as to quickly generate a complete processing logic target source code, shortening the development cycle and improving the efficiency of message processing logic implementation. Moreover, when it is necessary to modify or expand the function, there is no need to write a large amount of processing code, reducing the workload of financial message processing, improving the maintainability and reusability of the code, thereby solving the problem of each data object being processed. The invention solves the problems of heavy workload, complex maintenance and high cost caused by writing and processing codes for financial messages. Among them, when generating logic source code, text code template and tree structure data according to the settings corresponding to each data object, and generating processing logic target source code in multiple target languages ​​of the special object processor associated with each data object, the logic source code and the corresponding text code template are generated based on the settings corresponding to the data object indicated by each node in the tree data structure, and the processing logic target source code in multiple target languages ​​of the special object processor associated with each data object is automatically generated, thereby improving the efficiency and accuracy of generating the processing logic target source code of the special object processor; in addition, when determining the general object processor and the tree data structure associated with each data object in multiple message documents, the data structure of each data object and the hierarchical relationship between them, as well as the corresponding general object processor determined by these objects are determined by parsing the multiple message documents, and then the tree data structure is formed by merging the structure of the data object, thereby improving the standardization and structuring level of data processing. At the same time, the tree data structure enables the system to traverse and access data objects in a more efficient manner, simplifies the processing flow, optimizes resource utilization, and enhances the scalability and maintainability of the system.

[0012] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0014] Figure 1 is a flowchart of a message processing method shown in the first embodiment of the present disclosure;

[0015] Figure 2 is a flow chart of a message processing method shown in the second embodiment of the present disclosure;

[0016] Figure 3 is a flowchart of a message processing method shown in the third embodiment of the present disclosure;

[0017] Figure 4 is a flowchart of a message processing method shown in the fourth embodiment of the present disclosure;

[0018] Figure 5 is a schematic diagram of a general object processor in a message document shown in an embodiment of the present disclosure;

[0019] Figure 6 is a schematic diagram of a code generation process shown in an embodiment of the present disclosure;

[0020] Figure 7 is a structural schematic diagram of a message processing device shown in the fifth embodiment of the present disclosure;

[0021] Figure 8 It is a schematic diagram of the structure of an electronic device shown in an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0022] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0024] It should be noted that in the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information are all carried out with the user's consent, and are in compliance with relevant laws and regulations and do not violate public order and good morals.

[0025] Since each financial message has a corresponding processing code, each time the message standard is upgraded, the coding logic needs to be modified for each message, which requires a large amount of coding and testing work. In addition, when the general logic of each message type is modified, the scope of modification is large, which increases the risk of logical inconsistency.

[0026] In view of the above problems, the present invention proposes a

[0027] The message processing method and device according to the embodiments of the present disclosure are described below with reference to the accompanying drawings.

[0028] Figure 1 It is a flowchart of the message processing method shown in the first embodiment of the present disclosure.

[0029] like Figure 1 As shown, the message processing method includes the following steps:

[0030] Step 101: Obtain message documents in standard formats corresponding to multiple financial classification messages.

[0031] It is important to understand that financial messages can be classified according to their purpose, transmission method, type of financial institution involved, etc. For example, messages used for inter-bank transfers, messages used for securities trading, messages used for communication between customers and banks, etc. Each financial message follows specific standards and formats to ensure that the information can be correctly parsed and identified when it is sent and received. The formats of message documents include: xsd, excel, word, etc.

[0032] In order to effectively obtain message documents in standard formats corresponding to various financial classification messages, as an example, message documents in standard formats corresponding to various financial classification messages are obtained from relevant financial institutions, industry associations, standard setting organizations or official websites.

[0033] Step 102: parse the multiple message documents to obtain a general object processor and a tree data structure associated with each data object in the multiple message documents.

[0034] In order to improve the efficiency of message processing logic implementation, as an example, multiple message documents are parsed to obtain a general object processor closely associated with each data object in the document. It should be noted that the general processor provides a flexible and extensible framework for message processing, so that corresponding processing logic can be written and integrated for financial messages of different formats based on the general processor. In this way, there is no need to repeatedly write the basic processing flow for each message, and only the specific business logic of the financial message needs to be focused on, thereby improving the efficiency of message processing logic implementation and the maintainability of the processing code.

[0035] In order to clearly show the hierarchy and association between data objects, as an example, multiple message documents are parsed to obtain a tree data structure associated with each data object in the multiple message documents.

[0036] Step 104, compile text class code templates in multiple target languages ​​for each general object processor.

[0037] The text class code template includes the public processing logic source code corresponding to the general object processor.

[0038] In order to quickly build a message processor without repeatedly writing the same processing logic, so as to improve the efficiency of the message processing logic implementation, as an example, a corresponding text class code template is written for each target language, wherein each text class code template contains the public processing logic source code of the general object processor, that is, the basic logic and structural code required to process each data object. The text class code template also includes the fields and attribute information of the general object processor so that it can be used and expanded when inheriting or implementing the text class code template.

[0039] Step 105, generating logic source code, text code template and tree structure data according to the settings corresponding to each data object, and generating processing logic target source code in multiple target languages ​​for the dedicated object processor associated with each data object.

[0040] Among them, the processing logic target source code is used to process the corresponding financial classification message.

[0041] In order to quickly create special object processors associated with different data objects, as an example, based on the setting generation logic source code, text class code template and tree structure data corresponding to each data object, the processing logic target source code in multiple target languages ​​of the special object processor associated with each data object is automatically generated, wherein the setting generation logic source code corresponding to each data object is written according to the specific needs and characteristics of the data object, including the functions and business logic required for the processing of each data object, that is, including the proprietary processing logic of each data object.

[0042] Among them, it should be noted that the processing logic target source code is used to process the corresponding financial classification message. As an example, a code packaging method matching any target language is obtained; the code packaging method of any target language is adopted to package the processing logic target source code of any target language to obtain a logic processing code package of any target language; wherein, the logic processing code package of any target language is used for reference when the business product line performs message processing.

[0043] That is to say, the processing logic target source code of the target language is packaged according to the packaging method of the corresponding target language (for example, JAVA is packaged in jar mode) to obtain the logic processing code package of the target language, wherein the logic processing code package of the target language is used for reference when the business product line performs message processing.

[0044] In order to further improve the efficiency of message processing logic implementation, as an example, in response to an update of any financial classification message, each data object and tree data structure are updated according to the updated financial classification message; based on the updated tree data structure and the updated data object, the processing logic target source code of the dedicated object processor associated with the updated data object is generated.

[0045] That is to say, when any financial classification message is updated, for example, the financial classification message is manually updated, any updated financial classification message is parsed to obtain an updated tree data structure and an updated data object, and then, based on the updated tree data structure and the updated data object, a processing logic target source code of a dedicated object processor associated with the updated data object is generated. Therefore, when the financial classification message is updated, the corresponding processing logic is automatically regenerated according to the updated financial classification message without manually modifying the code, thereby improving the flexibility of the system and reducing the maintenance cost of the system.

[0046] In summary, by obtaining standard format message documents corresponding to various financial classification messages, parsing them to extract general object processors and tree data structures, and then writing text class code templates in multiple target languages ​​closely associated with various data objects, wherein the text class code templates include the public processing logic source code of the corresponding general object processor, making the code more modular and reusable, and then, based on the setting generation logic source code, text class code template and tree structure data corresponding to each data object, the processing logic target source code in multiple target languages ​​of the special object processor associated with each data object is automatically generated, reducing the time and effort of manual code writing. Error rate. Since the text code template contains public processing logic, there is no need to repeatedly write the same processing logic when generating the processing logic target source code. You only need to fill in or modify a small number of specific parts in the template according to the specific data objects and business needs to quickly generate the complete processing logic target source code, shortening the development cycle and improving the efficiency of message processing logic implementation. Moreover, when it is necessary to modify or expand the function, there is no need to modify a large amount of processing code, which reduces the workload of financial message processing and improves the maintainability and reusability of the code, thereby solving the problems of large workload, complex maintenance and high cost caused by writing processing code for each financial message.

[0047] In order to clearly illustrate how the above embodiments generate logic source code, text-like code templates and tree structure data according to the settings corresponding to each data object, and generate processing logic target source code in multiple target languages ​​for a dedicated object processor associated with each data object, the present disclosure proposes another message processing method.

[0048] Figure 2 It is a flowchart of the message processing method shown in the second embodiment of the present disclosure.

[0049] like Figure 2 As shown, the message processing method includes the following steps:

[0050] Step 201: Obtain message documents in standard formats corresponding to multiple financial classification messages.

[0051] Step 202: parse the multiple message documents to obtain a general object handler and a tree data structure associated with each data object in the multiple message documents.

[0052] Step 203: compile text class code templates in multiple target languages ​​for each general object processor.

[0053] The text class code template includes the public processing logic source code corresponding to the general object processor.

[0054] Step 204, generating logic source code and text-like code templates according to the settings corresponding to each data object, and generating processing logic target source code in multiple target languages ​​for a dedicated object processor associated with the data object indicated by each node in the tree data structure.

[0055] In order to accurately and completely generate the processing logic target source code corresponding to each data object, as an example, the logic source code and text class code template are generated according to the settings corresponding to each data object, and the corresponding dedicated object processor is automatically created for the data object represented by each node in the data structure (such as the data object indicated by the root node and the data object indicated by the non-root node), and each dedicated object processor is adaptable to multiple target languages, that is, the processing logic target source code of multiple target languages. The processing logic target source code meets the processing requirements of the data objects in the corresponding financial classification, and improves the pertinence and maintainability of the code.

[0056] Step 205, determining the processing logic target source codes in multiple target languages ​​of the dedicated object processor associated with each data object according to the processing logic target source codes in multiple target languages ​​of the dedicated object processor associated with the data object indicated by each node.

[0057] It should be understood that since the data structure between data objects in multiple message documents is a tree data structure, the processing logic target source code in multiple target languages ​​of the special object processor associated with each data object can be determined based on the processing logic target source code in multiple target languages ​​of the special object processor associated with each data object indicated by each node in the tree data structure.

[0058] As an example, the processing logic target source codes in multiple target languages ​​of the dedicated object processor associated with the data object indicated by each node are used as the processing logic target source codes in multiple target languages ​​of the dedicated object processor associated with each data object.

[0059] In summary, by generating logic source code and text-like code templates according to the settings corresponding to each data object, the processing logic target source code in multiple target languages ​​of the special object processor associated with the data object indicated by each node in the tree data structure is automatically generated; then, according to the processing logic target source code in multiple target languages ​​of the special object processor associated with the data object indicated by each node, the processing logic target source code in multiple target languages ​​of the special object processor associated with each data object is determined, thereby accurately and completely creating customized object processors for different data objects, and these processors can directly adapt to multiple target languages, thereby improving the development efficiency of the processor, reducing the error rate, and enhancing the flexibility and maintainability of the code.

[0060] In order to clearly illustrate how the above-mentioned embodiment generates logic source code and text-like code templates according to the settings corresponding to each data object, and generates processing logic target source code in multiple target languages ​​of a dedicated object processor associated with the data object indicated by each node in the tree data structure, the present disclosure proposes another message processing method.

[0061] Figure 3 It is a flowchart of the message processing method shown in the third embodiment of the present disclosure.

[0062] like Figure 3 As shown, the message processing method includes the following steps:

[0063] Step 301: Obtain message documents in standard formats corresponding to multiple financial classification messages.

[0064] Step 302: parse the multiple message documents to obtain a general object processor and a tree data structure associated with each data object in the multiple message documents.

[0065] Step 303: compile text class code templates in multiple target languages ​​for each general object processor.

[0066] The text class code template includes the public processing logic source code corresponding to the general object processor.

[0067] Step 304 , obtaining, from the setting generation logic source codes corresponding to each data object, the setting generation logic source code corresponding to the data object indicated by the root node in the tree data structure and the setting generation logic source codes corresponding to the data objects indicated by other nodes except the root node.

[0068] In order to accurately and completely generate the processing logic target source code of the dedicated object processor associated with the data object indicated by each node in the tree data structure, as an example, the setting generation logic source code of the data object indicated by each node in the tree data structure is obtained in sequence. The setting generation logic source code includes the proprietary configuration information of the corresponding data object (such as data field, data type, etc.).

[0069] Step 305, generating logic source code according to the setting corresponding to the root node, filling in the text class code template corresponding to the data object indicated by the root node, so as to obtain the processing logic target source code in multiple target languages ​​of the dedicated object processor associated with the data object indicated by the root node.

[0070] In order to improve the efficiency of code generation, as a possible implementation method, logical source code and corresponding text class code templates are generated according to the settings corresponding to the root node, and processing logic target source code in multiple target languages ​​of the dedicated object processor associated with the data object indicated by the root node is automatically generated.

[0071] As an example, the setting corresponding to the root node generates a logic source code, which is filled in the text class code template corresponding to the data object indicated by the root node, thereby obtaining the processing logic target source code in multiple target languages ​​of the dedicated object processor associated with the data object indicated by the root node.

[0072] Step 306, generate logic source code according to the settings corresponding to other nodes, fill in the text class code template corresponding to the data objects indicated by other nodes, so as to obtain the processing logic target source code in multiple target languages ​​of the dedicated object processor associated with the data objects indicated by other nodes.

[0073] In order to completely generate the processing logic target source code in multiple target languages ​​of the dedicated object processor associated with the data object, as an example, traverse other nodes in turn, and obtain the setting generation logic source code corresponding to the data object indicated by the current traversal node from the setting generation logic source code corresponding to each data object; use the setting generation logic source code corresponding to the current traversal node to fill in the text class code template corresponding to the data object indicated by the current traversal node, so as to obtain the processing logic target source code in multiple target languages ​​of the dedicated object processor associated with the data object indicated by the current traversal node.

[0074] That is to say, after the processing logic target source code in multiple target languages ​​of the special object processor associated with the data object indicated by the root node in the tree data structure, the other nodes except the root node in the tree data structure are traversed in turn, and for each traversed node, the logic source code is generated according to the settings corresponding to the data object indicated by the current traversed node, and the text class code template corresponding to the data object indicated by the current traversed node is filled in, so as to obtain the processing logic target source code in multiple target languages ​​of the special object processor associated with the data object indicated by the current traversed node. Therefore, the processing logic target source code not only includes the public processing logic source code in the general object processor, but also includes the proprietary processing logic of the corresponding data object.

[0075] Step 307, determining the processing logic target source code in multiple target languages ​​of the dedicated object processor associated with each data object according to the processing logic target source code in multiple target languages ​​of the dedicated object processor associated with the data object indicated by each node.

[0076] It should be noted that the execution process of steps 301 to 303 and step 307 can be implemented in any way in the embodiments of the present disclosure, and the embodiments of the present disclosure do not limit this and will not be described in detail.

[0077] In summary, by obtaining the setting generation logic source code corresponding to the data object indicated by the root node in the tree data structure and the setting generation logic source code indicated by the data objects other than the root node from the setting generation logic source code corresponding to each data object; filling in the text class code template corresponding to the data object indicated by the root node according to the setting generation logic source code corresponding to the root node to obtain the processing logic target source code in multiple target languages ​​of the special object processor associated with the data object indicated by the root node; filling in the text class code template corresponding to the data objects indicated by the other nodes according to the setting generation logic source code corresponding to the other nodes to obtain the processing logic target source code in multiple target languages ​​of the special object processor associated with the data objects indicated by the other nodes, thereby, based on the setting generation logic source code corresponding to the data objects indicated by each node in the tree data structure and the corresponding text class code template, the processing logic target source code in multiple target languages ​​of the special object processor associated with each data object is automatically generated, thereby improving the efficiency and accuracy of generating the processing logic target source code of the special object processor.

[0078] In order to clearly explain how to parse various message documents in the above embodiment to obtain a general object processor and a tree data structure associated with each data object in the various message documents, the present disclosure proposes another message processing method.

[0079] Figure 4 It is a flowchart of the message processing method shown in the fourth embodiment of the present disclosure.

[0080] like Figure 4 As shown, the message processing method includes the following steps:

[0081] Step 401: Obtain message documents in standard formats corresponding to multiple financial classification messages.

[0082] Step 402: parse the multiple message documents to obtain the data structure of each data object in the multiple message documents and the hierarchical relationship between the data objects.

[0083] As an example, multiple message documents are parsed to obtain data structures of message objects that match each sub-message type in the multiple message documents; for the message objects, the data structure of the message objects is parsed to obtain the data structure of data objects at the next level of the level where the message objects are located; the data structure of the data objects at the next level is parsed to obtain the data structure of message elements contained in the data objects at the next level; the data structure of the message objects, the data structure of the data objects at the next level, and the data structure of the message elements are used as the data structure of each data object.

[0084] It should be understood that in financial services, various transactions, requests, responses, etc. need to be transmitted and processed through message documents. A message document includes at least one sub-message type. One or more sub-message types correspond to a financial service, and the sub-message type is used to distinguish different financial services or transaction types; for example, a transfer message type may correspond to a bank's transfer service, and a query message type may correspond to a query of the service status, etc. In addition, since the same type of financial service (such as transfer, query, payment, etc.) may generate multiple similar transactions or requests, each such transaction or request requires a specific message object to carry its detailed information, such as information of both parties to the transaction, transaction amount, transaction time, etc.; since the above transactions or requests are similar in structure (that is, they all follow the same sub-message type definition), the same sub-message type is used to represent the above transactions or requests, that is, one sub-message type corresponds to multiple message objects, and each sub-message type has its specific data structure and field definition to describe the specific content and requirements of the financial service.

[0085] Therefore, in the disclosed embodiment, when processing multiple message documents, a parsing operation is first performed to extract data structures of message objects that match each sub-message type from each message document. These data structures define the basic properties and format of the message objects. Next, for each message object, its data structure is further parsed to obtain the data structure of the data object of the next level of the level where the message object is located. Then, the data objects of the next level are continued to be parsed until the message elements of the bottom level are reached. These message elements are the basic units that constitute the message objects. Finally, the data structure of the message object, the data structure of the data object of the next level, and the data structure of the message elements are all saved and processed as the data structures of their respective data objects.

[0086] Step 403: Determine, according to each data object, a general object processor associated with each data object.

[0087] As an example, according to the type of each data object, a universal object processor matching each data object type is determined, and the universal object processor matching each data object type is used as the universal object processor associated with the corresponding data object.

[0088] For example, for a message object, the general object processor associated with the message object is a message object processor, for a loop object, the general object processor associated with the loop object is a loop object processor, and for a block domain object, the general object processor associated with the block domain object is a block domain object processor.

[0089] Step 404: merge the data structures of the data objects according to the hierarchical relationship between the data objects to obtain a tree data structure.

[0090] It is important to understand that each data object has a hierarchical relationship. The message object, as the highest-level data object, may contain multiple data objects at the next level (such as loop objects, block domain objects, option domain objects, etc.), and these next-level data objects may contain data objects at an even lower level, until the bottom-level message element is reached. It should be noted that when the data object is a field object, the field object can only be used as the bottom-level message element and cannot contain data objects at the next level.

[0091] Therefore, according to the hierarchical relationship between the data objects, their data structures are merged to construct a tree data structure. It should be noted that this tree data structure has the message object as the root node and the data objects of the next level as child nodes, and each child node can contain child nodes of a lower level until the bottom-level message element is reached.

[0092] Step 405: compile text class code templates in multiple target languages ​​for each general object processor.

[0093] The text class code template includes the public processing logic source code corresponding to the general object processor.

[0094] Step 406, generating logic source code, text code templates and tree structure data according to the settings corresponding to each data object, and generating processing logic target source code in multiple target languages ​​for the dedicated object processor associated with each data object.

[0095] Among them, the processing logic target source code is used to process the corresponding financial classification message.

[0096] It should be noted that after generating the processing logic target source code in multiple target languages ​​of the dedicated object processor associated with each data object, if it is necessary to generate front-end code, the tree data structure will be sent to the front-end page generation processor so that the tree data structure can be parsed and processed by the front-end page generation processor to generate front-end code, wherein the front-end code is used for the display and operation of the front-end page.

[0097] It should be noted that the execution process of step 401 and step 405 to step 406 can be implemented in any way in the embodiments of the present disclosure, and the embodiments of the present disclosure do not limit this and will not be described in detail.

[0098] In summary, by parsing multiple message documents, the data structures of each data object in the multiple message documents and the hierarchical relationship between each data object are obtained; according to each data object, the general object processor associated with each data object is determined; according to the hierarchical relationship between each data object, the data structure of each data object is merged to obtain a tree data structure. Therefore, by parsing multiple message documents, not only the data structure of each data object and the hierarchical relationship between them can be clearly determined, but also the corresponding general object processor can be determined according to these objects, and then the tree data structure is formed by merging the structures of the data objects, which improves the standardization and structuring level of data processing. At the same time, the tree data structure allows the system to traverse and access data objects in a more efficient manner, simplifies the processing flow, optimizes resource utilization, and enhances the scalability and maintainability of the system.

[0099] On the basis of any embodiment of the present disclosure, the message processing method of the embodiment of the present disclosure can also be implemented based on the following steps:

[0100] 1. Parsing of message standard documents

[0101] (1) Analyze the general processor (general object processor) through the message standard document, such as Figure 5 As shown, the general processors include: message object processor, loop object processor, block domain object processor, option domain object processor, field object processor, special object processor, among which the field object processor includes: Boolean field processor, character field processor, date field processor and currency amount field processor, etc.

[0102] (2) Encoding the general processing interface and logic for parsing, assembling and verifying the corresponding units of each general purpose processor, that is, encoding the common processing logic source code of each general purpose object processor;

[0103] 2. Code Generation

[0104] like Figure 6 As shown, the code generation process includes two stages. The first stage is to parse the message standard document. The second stage is to generate the message processing code component package of the corresponding development language through the corresponding template generator according to the internal structure of the message hierarchy. The specific process is detailed as follows:

[0105] (1) Parsing of message standard documents

[0106] 1) According to the standard documents provided by each message standard, separate each sub-message type in the message standard from the document into internal data structures corresponding to the message object type;

[0107] 2) According to the internal data structure of each message object type, the underlying data object type structure is parsed, including loop object type, block domain object type, field object type and other custom object types;

[0108] 3) Continue to infer in this way according to the parsed lower-level object type to parse out the custom object type structure corresponding to each message element;

[0109] 4) Through the above method, the text description of the standard message document can be parsed into a custom tree object type internal structure for subsequent processing;

[0110] (2) The corresponding object template generator generates code

[0111] 1) According to the custom object processor type, the corresponding object type code generation logic is written respectively (i.e., the generation logic source code is set, which may include the generation logic of the unified generator of the front-end page), and the corresponding object type code is generated by using methods such as text class code template replacement corresponding to each language (or code structure assembly generation method of each language);

[0112] 2) Traverse the internal custom object type structure data after parsing the standard document, perform recursive traversal, and generate the corresponding code processing logic (processing logic target source code);

[0113] 3) If front-end code needs to be generated, the customized corresponding type structure data is passed to the front-end page generation processor to generate the corresponding front-end code;

[0114] 4) Package according to the packaging method of the corresponding generated target language, for example, Java uses jar method to send messages. It can be referenced when the parsing, assembly and verification logic of various types of messages are needed in various business product lines;

[0115] 5) When updating and upgrading each subsequent message, you only need to repeat steps 2), 3) and 4) under the code generation steps of the corresponding object template generator.

[0116] Corresponding to the message processing method provided in the above-mentioned embodiment, the present disclosure also provides a message processing device. Since the message processing device provided in the embodiment of the present disclosure corresponds to the message processing method provided in the above-mentioned embodiment, the implementation method of the message processing method is also applicable to the message processing device provided in the embodiment of the present disclosure, and will not be described in detail in the embodiment of the present disclosure.

[0117] Figure 7 It is a structural diagram of a message processing device shown in the fifth embodiment of the present disclosure.

[0118] like Figure 7As shown, the message processing device 700 includes: an acquisition module 710, a parsing module 720, a writing module 730 and a generating module 740.

[0119] Among them, the acquisition module 710 is used to obtain message documents in a standard format corresponding to various financial classification messages; the parsing module 720 is used to parse the various message documents to obtain a general object processor and a tree data structure associated with each data object in the various message documents; the writing module 730 is used to write text class code templates in multiple target languages ​​for each general object processor, wherein the text class code template includes a public processing logic source code corresponding to the general object processor; the generation module 740 is used to generate logic source code, text class code templates and tree structure data according to the settings corresponding to each data object, and generate processing logic target source code in multiple target languages ​​for a special object processor associated with each data object; wherein the processing logic target source code is used to process the corresponding financial classification message.

[0120] As a possible implementation method of the embodiment of the present disclosure, the generation module 740 is used to generate logic source code and text class code templates according to the settings corresponding to each data object, and generate the processing logic target source code in the multiple target languages ​​of the special object processor associated with the data object indicated by each node in the tree data structure; based on the processing logic target source code in the multiple target languages ​​of the special object processor associated with the data object indicated by each node, determine the processing logic target source code in the multiple target languages ​​of the special object processor associated with each data object.

[0121] As a possible implementation method of the embodiment of the present disclosure, the generation module 740 is used to obtain the setting generation logic source code corresponding to the data object indicated by the root node in the tree data structure and the setting generation logic source code indicated by other nodes except the root node from the setting generation logic source code corresponding to each data object; fill in the text class code template corresponding to the data object indicated by the root node according to the setting generation logic source code corresponding to the root node to obtain the processing logic target source code of the multiple target languages ​​of the dedicated object processor associated with the data object indicated by the root node; fill in the text class code template corresponding to the data objects indicated by other nodes according to the setting generation logic source code corresponding to other nodes to obtain the processing logic target source code of the multiple target languages ​​of the dedicated object processor associated with the data objects indicated by other nodes.

[0122] As a possible implementation method of the embodiment of the present disclosure, generation module 740 is used to traverse other nodes in sequence, and obtain the setting generation logic source code corresponding to the data object indicated by the current traversal node from the setting generation logic source code corresponding to each data object; use the setting generation logic source code corresponding to the current traversal node to fill in the text class code template corresponding to the data object indicated by the current traversal node, so as to obtain the processing logic target source code in multiple target languages ​​of the dedicated object processor associated with the data object indicated by the current traversal node.

[0123] As a possible implementation method of the embodiment of the present disclosure, the parsing module 720 is used to parse the multiple message documents to obtain the data structure of each data object in the multiple message documents and the hierarchical relationship between the data objects; determine the general object processor associated with each data object according to each data object; merge the data structure of each data object according to the hierarchical relationship between the data objects to obtain a tree data structure.

[0124] As a possible implementation method of the embodiment of the present disclosure, the parsing module 720 is used to parse multiple message documents to obtain the data structure of the message object that matches each sub-message type in the multiple message documents; for the message object, the data structure of the message object is parsed to obtain the data structure of the data object of the next level of the level where the message object is located; the data structure of the data object of the next level is parsed to obtain the data structure of the message element contained in the data object of the next level; the data structure of the message object, the data structure of the data object of the next level and the data structure of the message element are used as the data structure of each data object.

[0125] As a possible implementation method of the embodiment of the present disclosure, the generation module 740 is also used to send the tree data structure to the front-end page generation processor so that the tree data structure is parsed and processed by the front-end page generation processor to generate a front-end code; wherein the front-end code is used for the display and operation of the front-end page.

[0126] As a possible implementation manner of the embodiment of the present disclosure, the message processing device 700 further includes: an update module.

[0127] Among them, the update module is used to respond to the update of any financial classification message, and update each data object and tree data structure according to the updated financial classification message; based on the updated tree data structure and the updated data object, generate the processing logic target source code of the dedicated object processor associated with the updated data object.

[0128] As a possible implementation of the embodiment of the present disclosure, the message processing device 700 further includes: a packaging module.

[0129] Among them, the packaging module is used to obtain a code packaging method that matches any target language; the code packaging method of any target language is used to package the processing logic target source code of any target language to obtain a logic processing code package of any target language; wherein the logic processing code package of any target language is used for reference when the business product line performs message processing.

[0130] The message processing device of the disclosed embodiment obtains standard format message documents corresponding to various financial classification messages, parses them to extract general object processors and tree data structures, and then writes text class code templates in various target languages ​​closely associated with various data objects, wherein the text class code templates include the public processing logic source code of the corresponding general object processor, making the code more modular and reusable, and then, based on the setting generation logic source code, text class code template and tree structure data corresponding to each data object, automatically generates the processing logic target source code of various target languages ​​of the special object processor associated with each data object, thereby reducing the manual writing of code. Since the text code template contains public processing logic, there is no need to repeatedly write the same processing logic when generating the processing logic target source code. You only need to fill in or modify a small number of specific parts in the template according to the specific data objects and business needs to quickly generate the complete processing logic target source code, which shortens the development cycle and improves the efficiency of message processing logic implementation. In addition, when it is necessary to modify or expand the function, there is no need to write a large amount of processing code, which reduces the workload of financial message processing and improves the maintainability and reusability of the code, thereby solving the problems of large workload, complex maintenance and high cost caused by writing processing code for each financial message.

[0131] In an exemplary embodiment, an electronic device is also provided.

[0132] Among them, electronic equipment includes:

[0133] processor;

[0134] a memory for storing processor-executable instructions;

[0135] The processor is configured to execute instructions to implement the message processing method proposed in any of the aforementioned embodiments.

[0136] As an example, Figure 8 is a schematic diagram of the structure of an electronic device 800 shown in an exemplary embodiment of the present disclosure, such as Figure 8 As shown, the electronic device 800 may further include:

[0137] The memory 810 and the processor 820, a bus 830 connecting different components (including the memory 810 and the processor 820), the memory 810 stores a computer program, and when the processor 820 executes the program, the message processing method described in the embodiment of the present disclosure is implemented.

[0138] Bus 830 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.

[0139] The electronic device 800 typically includes a variety of electronic device readable media. These media can be any available media that can be accessed by the electronic device 800, including volatile and non-volatile media, removable and non-removable media.

[0140] The memory 810 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 840 and / or cache memory 850. The server 800 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 860 may be used to read and write non-removable, non-volatile magnetic media ( Figure 8 not shown, usually called a "hard drive"). Although Figure 8 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 830 via one or more data medium interfaces. The memory 810 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present disclosure.

[0141] A program / utility 880 having a set (at least one) of program modules 870 may be stored, for example, in the memory 810, such program modules 870 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 870 generally perform the functions and / or methods of the embodiments described in the present disclosure.

[0142] The electronic device 800 may also communicate with one or more external devices 890 (e.g., keyboard, pointing device, display 891, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 800, and / or may communicate with any device that enables the electronic device 800 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed via an input / output (I / O) interface 892. Furthermore, the electronic device 800 may also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or public network, such as the Internet) via a network adapter 893. As shown, the network adapter 893 communicates with other modules of the electronic device 800 via a bus 830. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0143] The processor 820 executes various functional applications and data processing by running the programs stored in the memory 810 .

[0144] It should be noted that the implementation process and technical principles of the electronic device of this embodiment refer to the aforementioned explanation of the message processing method of the embodiment of the present disclosure, and will not be repeated here.

[0145] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, and the above instructions can be executed by a processor of an electronic device to complete the message processing method proposed in any of the above embodiments. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0146] In an exemplary embodiment, a computer program product is also provided, including a computer program / instruction, characterized in that when the computer program / instruction is executed by a processor, the message processing method proposed in any of the above embodiments is implemented.

[0147] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0148] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A message processing method, characterized in that: include: Obtain message documents in standard formats corresponding to various financial classification messages; Parsing the multiple message documents to obtain a general object handler and a tree data structure associated with each data object in the multiple message documents; Writing text-like code templates in multiple target languages ​​for each of the universal object processors, wherein the text-like code templates include common processing logic source codes corresponding to the universal object processors; Generate logic source code, text class code template and the tree structure data according to the settings corresponding to each of the data objects, and generate processing logic target source code in the multiple target languages ​​of the dedicated object processor associated with each of the data objects; wherein the processing logic target source code is used to process the corresponding financial classification message.

2. The method according to claim 1, characterized in that The generating logic source code, text code template and tree structure data according to the setting corresponding to each data object, generating processing logic target source code in multiple target languages ​​of the dedicated object processor associated with each data object, includes: Generate logic source code and text code templates according to the settings corresponding to each of the data objects, and generate processing logic target source code in the plurality of target languages ​​for the dedicated object processor associated with the data object indicated by each node in the tree data structure; According to the processing logic target source codes in the multiple target languages ​​of the dedicated object processor associated with the data object indicated by each node, the processing logic target source codes in the multiple target languages ​​of the dedicated object processor associated with each data object are determined.

3. The method according to claim 2, characterized in that The generating logic source code and text code template according to the setting corresponding to each of the data objects, and generating the processing logic target source code in the plurality of target languages ​​of the dedicated object processor associated with the data object indicated by each node in the tree data structure, comprises: Acquire, from the setting generation logic source codes corresponding to the data objects, the setting generation logic source codes corresponding to the data object indicated by the root node in the tree data structure and the setting generation logic source codes of the data objects indicated by other nodes except the root node; Generate logic source code according to the setting corresponding to the root node, fill in the text class code template corresponding to the data object indicated by the root node, so as to obtain the processing logic target source code of the plurality of target languages ​​of the dedicated object processor associated with the data object indicated by the root node; Generate logic source code according to the settings corresponding to the other nodes, fill in the text class code template corresponding to the data object indicated by the other nodes, so as to obtain the processing logic target source code of the multiple target languages ​​of the dedicated object processor associated with the data object indicated by the other nodes.

4. The method according to claim 3, characterized in that The generating logic source code according to the setting corresponding to the other nodes, filling the text class code template corresponding to the data object indicated by the other nodes, so as to obtain the processing logic target source code of the multiple target languages ​​of the dedicated object processor associated with the data object indicated by the other nodes, includes: Traversing the other nodes in sequence, and acquiring the setting generation logic source code corresponding to the data object indicated by the currently traversed node from the setting generation logic source code corresponding to each of the data objects; The setting corresponding to the current traversal node is used to generate logic source code, and the text class code template corresponding to the data object indicated by the current traversal node is filled in to obtain the processing logic target source code in the multiple target languages ​​of the dedicated object processor associated with the data object indicated by the current traversal node.

5. The method according to claim 1, characterized in that The parsing of the multiple message documents to obtain a general object processor and a tree data structure associated with each data object in the multiple message documents includes: Parsing the multiple message documents to obtain the data structure of each data object in the multiple message documents and the hierarchical relationship between the data objects; According to each of the data objects, determining a general object processor associated with each of the data objects; According to the hierarchical relationship between the data objects, the data structures of the data objects are merged to obtain the tree data structure.

6. The method according to claim 5, characterized in that Parsing the multiple message documents to obtain a data structure of each data object in the multiple message documents includes: Parsing the multiple message documents to obtain a data structure of a message object matching each sub-message type in the multiple message documents; For the message object, parsing the data structure of the message object to obtain the data structure of the data object at the next level of the level where the message object is located; Parsing the data structure of the data object at the next level to obtain the data structure of the message element contained in the data object at the next level; The data structure of the message object, the data structure of the data object at the next level, and the data structure of the message element are used as the data structure of each of the data objects.

7. The method according to claim 1, characterized in that After generating the logic source code, the text code template and the tree structure data according to the settings corresponding to each of the data objects, and generating the processing logic target source code of the multiple target languages ​​of the dedicated object processor associated with each of the data objects, the method further includes: The tree data structure is sent to a front-end page generation processor, so that the tree data structure is parsed and processed by the front-end page generation processor to generate a front-end code; wherein the front-end code is used for displaying and operating the front-end page.

8. The method according to claim 1, characterized in that The method further comprises: In response to an update of any of the financial classification messages, updating each of the data objects and the tree data structure according to the updated financial classification message; According to the updated tree data structure and the updated data object, a processing logic target source code of a dedicated object processor associated with the updated data object is generated.

9. The method according to claim 1, characterized in that: The method further comprises: Obtain a code packaging method that matches any of the target languages; The processing logic target source code of any target language is packaged by adopting the code packaging method of any target language to obtain a logic processing code package of any target language; wherein the logic processing code package of any target language is used for reference when the business product line performs message processing.

10. A message processing device, characterized in that: include: An acquisition module is used to acquire message documents in standard formats corresponding to various financial classification messages; A parsing module, used for parsing the multiple message documents to obtain a general object processor and a tree data structure associated with each data object in the multiple message documents; A writing module, used for writing text code templates in multiple target languages ​​for each of the universal object processors, wherein the text code templates include common processing logic source codes corresponding to the universal object processors; A generation module is used to generate logic source code, text class code template and the tree structure data according to the settings corresponding to each of the data objects, and generate processing logic target source code in the multiple target languages ​​of the dedicated object processor associated with each of the data objects; wherein the processing logic target source code is used to process the corresponding financial classification message.