Heterogeneous message conversion method, device and equipment

By parsing and updating the entity object model file and generating the message format supported by the rule engine, the rule engine lacks the adaptability of heterogeneous packets and dynamic fields in high-time and strong continuous scenarios, and automatic update and efficient adaptation are achieved.

CN119647414AActive Publication Date: 2025-03-18AGRICULTURAL BANK OF CHINA
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411742406.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-18
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

In high-time and strong continuous application scenarios, the rule engine needs to adapt to heterogeneous packets and dynamically changing message fields. The existing technology is difficult to meet these needs, resulting in insufficient adaptability of the rule engine.

Method used

By parsing the fields of the request message, it is compared with the corresponding entity object model file in the cache list. If there is a difference, the entity object model file will be updated. Then, the latest entity object model file is called to generate the view object, and the request message is assigned to the view object, and finally the message format supported by the rule engine is generated.

Benefits of technology

It realizes automatic update of entity object model files, adapts to dynamic changes in message fields, improves the adaptability of the rule engine to heterogeneous packets, and avoids the need to restart the project.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119647414A_ABST
    Figure CN119647414A_ABST
Patent Text Reader

Abstract

The invention provides a heterogeneous message conversion method, device and equipment, and relates to the technical field of computers, the method comprises the following steps: parsing a field of a request message, and if a comparison result shows that the field is different from a parsing field of a corresponding entity object model file, updating the entity object model file according to the field of the request message; calling a latest entity object model file corresponding to the request message to generate a first view object, and analyzing the request message to assign a value to the first view object; and generating a first message in a first rule engine support format based on the assigned first view object. Thus, the corresponding entity object model file in the cache list is automatically updated without restarting an item to add an entity class file corresponding to the message after field change, the problem of message field dynamic change is solved, the request message can also be converted into the first message adaptive to the rule engine, and the user experience is improved. And the adaptation capability of the rule engine to heterogeneous messages is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device and equipment for converting heterogeneous messages. Background Art

[0002] The rule engine receives data input, interprets business rules and ultimately makes corresponding decisions based on the business rules. With the advantage of separating business rules from program code, it can quickly respond to frequently iterated market demands and management regulations, while reducing the cost of application development and operation and maintenance, and is widely used.

[0003] At present, in high-efficiency and highly continuous application scenarios, the flexibility of rules has also brought new challenges. In particular, in the interaction using different interface specifications, it is necessary to meet the efficient adaptation of heterogeneous messages and the dynamic changeability of message fields. This puts higher requirements on the adaptability of the rule engine platform. Summary of the invention

[0004] In view of this, the present application provides a heterogeneous message conversion method, device and equipment, aiming to improve the adaptability of the rule engine to heterogeneous messages.

[0005] In a first aspect, the present application provides a heterogeneous message conversion method, comprising:

[0006] Parse the fields of the request message, and if there is a difference between the fields and the parsed fields of the corresponding entity object model file in the cache list, update the entity object model file according to the fields of the request message;

[0007] Calling the latest entity object model file corresponding to the request message from the cache list to generate a first view object, and parsing the request message to assign a value to the first view object;

[0008] A first message in a format supported by a first rule engine is generated based on the assigned first view object.

[0009] Optionally, before the fields of the resolution request message, the following is also included:

[0010] Receive a request message and perform a validity check on the request message;

[0011] If the request message is verified to be legal, obtain parameter information of the request message;

[0012] According to the parameter information, determining whether to switch the rule engine;

[0013] If the rule engine is switched, the fields of the parsing request message are executed according to the first rule engine indicated by the parameter information.

[0014] Optionally, the method further includes:

[0015] If the rule engine is not switched, the request message is sent to the default rule engine for processing, and a response message fed back by the default rule engine is obtained.

[0016] Optionally, the parameter information is the rule engine indicated by the engine selection field;

[0017] The determining whether to switch the rule engine according to the parameter information includes:

[0018] According to the parameter information, it is determined whether the rule engine indicated by the engine selection field in the request message is a default rule engine.

[0019] Optionally, after generating the first message in the format supported by the first rule engine based on the assigned first view object, the method further includes:

[0020] The first message is sent to the first rule engine indicated by the engine selection field of the first message, and a response message fed back by the first rule engine is obtained.

[0021] Optionally, the method further includes:

[0022] If the rule engine has been switched, the latest entity object model file corresponding to the response message is called to generate a second view object, and the response message is parsed to assign a value to the second view object; based on the assigned second view object, a second message in a format supported by the default rule engine is generated, and the second message is sent to an upper-layer business application;

[0023] If the rule engine is not switched, the response message is sent to the upper-layer business application.

[0024] In a first aspect, the present application provides a heterogeneous message conversion device, comprising a message conversion unit and an entity update unit; the message conversion unit and the entity update unit communicate bidirectionally; the message conversion unit comprises a message converter, a data reader and a cache list, and the entity update unit comprises a message parser and an entity updater;

[0025] The message parser is used to parse the request message to obtain fields, obtain the entity object model file corresponding to the request message from the cache queue and parse and obtain the fields;

[0026] The entity updater is used to compare the fields of the request message parsed by the message parser with the fields of the corresponding entity object model file, and if there is a difference in the comparison, update the corresponding entity object model file in the cache queue according to the fields of the request message;

[0027] The data reader is used to call the latest entity object model file corresponding to the request message from the cache queue;

[0028] The message converter is used to send the received request message to the message parser; generate a first view object according to the latest entity object model file called by the data reader, and parse the request message to assign a value to the first view object; and generate a first message in a format supported by the first rule engine based on the assigned first view object.

[0029] Optionally, the device further includes: an engine control unit; the engine control unit communicates bidirectionally with the message conversion unit, and the engine control unit also communicates bidirectionally with the bottom layer of the rule engine; the engine control unit includes an engine switch, an object computing driver and a message processor;

[0030] The engine switcher is used to receive a request message sent by an upper-layer business application, and determine whether the rule engine corresponding to the engine selection field in the request message is a default rule engine. If the rule engine corresponding to the engine selection field in the request message is not the default rule engine, the request message is sent to the message converter; if the rule engine corresponding to the engine selection field in the request message is the default rule engine, the request message is sent to the object computing driver;

[0031] The object computing driver is used to receive the request message sent by the engine switch and the first message sent by the message converter, and send the received message to the rule engine corresponding to the engine selection field in the message;

[0032] The message processor is used to filter the response message fed back from the bottom layer of the rule engine. If the rule engine has been switched, the response message is sent to the message converter of the message conversion unit for message conversion to obtain a second message in a format supported by the default rule engine, and the second message is sent to the upper-layer business application. If the rule engine has not been switched, the response message is sent to the upper-layer business application.

[0033] Optionally, the device further includes: a message delivery unit, the message delivery unit is arranged between the upper layer service application and the engine control unit, and the message delivery unit includes a message receiver and a message sender;

[0034] The message receiver is used to receive the request message sent by the upper-layer business application, perform a validity check on the request message, and send the verified validity request message to the engine switch of the engine control unit;

[0035] The message sender is used to receive the message fed back by the message processor of the engine control unit and send it to the upper-layer business application.

[0036] In a third aspect, the present application also provides a computer device, comprising a memory and a processor, wherein the memory is used to store instructions or codes, and the processor is used to execute the instructions or codes so that the device executes any one of the heterogeneous message conversion methods described above.

[0037] The present application provides a method, device and equipment for converting heterogeneous messages, the method comprising parsing the fields of a request message, and if there is a difference between the fields and the parsed fields of the corresponding entity object model file in the cache list, then updating the entity object model file according to the fields of the request message; calling the latest entity object model file corresponding to the request message from the cache list to generate a first view object, and parsing the request message to assign a value to the first view object; and generating a first message in a format supported by a first rule engine based on the assigned first view object. In this way, by parsing and comparing the differences in the fields of the request file and the corresponding entity object model file, the corresponding entity object model file in the cache list is automatically updated, without restarting the project to add the entity class file corresponding to the message after the field change, thus solving the problem of dynamic changes in message fields, and being able to convert the request message into a first message adapted to the rule engine, thereby improving the rule engine's adaptability to heterogeneous messages. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0039] Figure 1 A schematic diagram of a flow chart of a heterogeneous message conversion method provided in an embodiment of the present application;

[0040] Figure 2 A schematic diagram of an application flow of a heterogeneous message conversion method provided in an embodiment of the present application;

[0041] Figure 3 A schematic diagram of a message conversion process provided in an embodiment of the present application;

[0042] Figure 4 A schematic diagram of the structure of a heterogeneous message conversion device provided in an embodiment of the present application;

[0043] Figure 5 A schematic diagram of the structure of another heterogeneous message conversion device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] Based on the above problems, the present application provides a heterogeneous message conversion method, device and equipment, which relates to the field of computer technology. The method includes parsing the fields of the request message. If there is a difference between the fields and the parsed fields of the corresponding entity object model file, the entity object model file is updated according to the fields of the request message; the latest entity object model file corresponding to the request message is called to generate a first view object, and the request message is parsed to assign a value to the first view object; based on the assigned first view object, a first message in a format supported by a first rule engine is generated. The fields in the request message are identified. When the fields in the request message change, an entity class can be set corresponding to the fields in the request message to update the corresponding entity object model file in the cache list, and then a custom class loader is used to read the latest entity object file corresponding to the request message from the cache queue to generate the view object corresponding to the message. In this way, the entity object model file is automatically updated without restarting the project, and the entity class file corresponding to the message after the field change is added, which solves the problem of dynamic changes in the message field, and also realizes the conversion of the request message into a message adapted to the rule engine, thereby improving the adaptability of the rule engine to heterogeneous messages.

[0045] In addition, the upper-layer business application and rule engine A support messages of the same format, and rule engine A will be used as the default rule engine. However, rule calculation uses the rule set as the minimum granularity, and different engines have different adaptability to rule sets. When rule engine B is more suitable for the message for rule calculation, the request message of the upper-layer business application can be forwarded to rule engine B for rule calculation by switching the rule set switch state. However, it is necessary to convert the message in the format supported by the default rule engine into the message in the format supported by rule engine B, and convert the calculation result of rule engine B into the message in the format supported by the upper-layer business application for feedback.

[0046] The present application also constructs a heterogeneous message conversion device. First, the entity object model file is automatically updated through the message conversion unit and the entity update unit to adapt to the dynamic changes of the message fields. It can also realize the heterogeneous conversion between the format supported by the upper-level business application and the format supported by the rule engine adapted to the message. Furthermore, after the engine control unit receives the request message, its engine switch determines whether the message needs to be sent to the message conversion unit for heterogeneous message conversion, and sends the message to the rule engine for processing through the object computing driver. After the engine control unit receives the response message, the message processor then determines whether it needs to be sent to the message conversion unit for conversion into a message format adapted to the upper-level application. In this way, the accurate conversion of heterogeneous messages in the dynamic switching process of the rule engine provides unified services for the upper-level business applications, shields the differences caused by the dynamic switching process of the underlying engine, and ensures business continuity.

[0047] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.

[0048] The terms "first", "second", etc. in the specification and claims of the embodiments 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 terms used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.

[0049] Unless otherwise stated, the term "plurality" means two or more.

[0050] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.

[0051] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.

[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0053] See also Figure 1 , Figure 1 A flow chart of a heterogeneous message conversion method provided in an embodiment of the present application, a heterogeneous message conversion method comprising:

[0054] S101. parse the fields of the request message, and if there are differences between the fields and the parsed fields of the corresponding entity object model file in the cache list, update the entity object model file according to the fields of the request message.

[0055] The cache list is used to store entity object model files, and a custom class loader can be used to read entity object model files from the cache queue. The class loader is an important part of the Java virtual machine, which is used to load classes into memory and dynamically generate Java objects at runtime.

[0056] Parse the fields of the request message. Call the entity object model file corresponding to the request message from the cache list and parse the fields of the entity object model file. Compare the differences between the fields of the request message and the fields of the entity object model file. When there are differences, the fields of the request message have changed. The latest rule entity object model file can be generated based on the fields of the request message and the cache list can be updated. In this way, the cache list can be automatically updated to better adapt to the dynamic changes of the fields.

[0057] S102: Call the latest entity object model file corresponding to the request message from the cache list to generate a first view object, and parse the request message to assign a value to the first view object.

[0058] The view object is a display layer object, which is mainly used in the binding operation of front-end data and controls and exists in the form of key-value pairs.

[0059] S103: Generate a first message in a format supported by a first rule engine based on the assigned first view object.

[0060] A rule engine is a component embedded in an application that separates business logic from application code. The rule engine uses a specific syntax to write business rules, receives data input, interprets business rules, and ultimately makes decisions based on business rules.

[0061] The above steps complete the heterogeneous message conversion from the request message to the first message, wherein message conversion generally refers to conversion between different communication protocols or data formats. Common messages include JSON (JavaScript) messages, SOAP (Simple Object Access Protocol) messages, HTTP messages, etc.

[0062] In the above steps S101-S103, before the request message is subjected to heterogeneous conversion, the entity object model file in the cache list has been updated according to the changes in the fields of the request message through step S101. Then, in step S102, the entity object model file applicable to the request message where the field is updated can be read, and its entity class is loaded into the memory through the class loader, and the attribute is filled and assigned by parsing the request message field. Then in step S103, the fields of the request message are carried out using the view object as a carrier, and the class constructor is used to assemble and parse the message according to the message format supported by the first rule engine to form a first message. In this way, the entity object model file is automatically updated without restarting the project, and the entity class file corresponding to the message after the field change is added, which solves the problem of dynamic changes in the message field, and also realizes the conversion of the request message into the first message adapted to the rule engine, thereby improving the rule engine's adaptability to heterogeneous messages.

[0063] In the embodiment of the present application, the above Figure 1 There are many possible application implementations of the steps S101-S103, which are introduced below. It should be noted that the implementations given in the following introduction are only for illustrative purposes and do not represent all implementations of the embodiments of the present application.

[0064] See also Figure 2 The schematic diagram of the application process of a heterogeneous message conversion method is shown. The request message sent by the upper-layer business application can be adapted to the corresponding rule engine for processing and the processing result can be fed back to the upper-layer business application.

[0065] S201: Receive a request message and perform a validity check on the request message.

[0066] S202: If the request message is verified to be legal, obtain parameter information of the request message.

[0067] Of course, if the request message verification is illegal, the subsequent process ends.

[0068] In a possible implementation, the parameter information may be the rule engine indicated by the engine selection field.

[0069] S203: Determine whether to switch the rule engine according to the parameter information.

[0070] For example, when the upper-layer business application and rule engine A support messages of the same format, rule engine A is the default rule engine, but rule calculation uses the rule set as the minimum granularity. Different engines have different adaptability to rule sets. When rule engine B is more suitable for the current message for rule calculation, the default rule engine can be switched to rule engine B for calculation and processing.

[0071] In a possible implementation, the parameter information is the rule engine indicated by the engine selection field, and the determination of whether to switch the rule engine can be made by determining whether the rule engine indicated by the engine selection field in the request message is the default rule engine. When the rule engine indicated by the engine selection field in the request message is not the default rule engine, the rule engine is switched; when the rule engine indicated by the engine selection field in the request message is the default rule engine, the rule engine is not switched and the default rule engine continues to be used.

[0072] S204: If the rule engine is switched, execute steps S101-S103 according to the first rule engine indicated by the parameter information to obtain a first message in a format supported by the first rule engine; if the rule engine is not switched, directly execute step S205.

[0073] Exemplarily, when the default rule engine (Rule Engine A) is not suitable for calculating and processing the request message, it is possible to switch to the first rule engine (Rule Engine B) indicated by the request message for processing. However, before using the first rule engine (Rule Engine B) for processing, it is necessary to execute steps S101-S103 to convert the message to convert the request message into a first message in a format supported by the first rule engine (Rule Engine B).

[0074] S205: Send the first message to the first rule engine indicated by the engine selection field of the first message, and obtain a response message fed back by the first rule engine; or, without switching the rule engine, send the request message to the default rule engine for processing, and obtain a response message fed back by the default rule engine.

[0075] When the request message is directly adapted to the current default rule engine (rule engine A), steps S101-S103 may not be performed, and the request message is directly sent to the default rule engine for processing to obtain a response message fed back by the default rule engine.

[0076] S206: Determine whether the rule engine has been switched.

[0077] S207, if the rule engine has been switched, call the latest entity object model file corresponding to the response message to generate a second view object, parse the response message to assign a value to the second view object; and generate a second message in a format supported by the default rule engine based on the assigned second view object. If the rule engine has been switched, directly execute step S207.

[0078] The response message is converted into a second message in a format supported by the default rule engine (upper-layer business application).

[0079] S208: Send the second message to the upper-layer business application; or if the rule engine has not been switched, send the response message to the upper-layer business application.

[0080] The above steps S201-S208 enable the request message sent by the upper-layer business application to be adapted to the corresponding rule engine for processing and the processing result to be fed back to the upper-layer business application.

[0081] See also Figure 3 The schematic diagram of a message conversion process shown realizes message conversion adapted to different rule engines, thereby realizing seamless dynamic switching of rule engines.

[0082] For step S204 and step S207 in the above steps S201-S208, two message conversions are performed. Among them, step S204 performs the first message conversion, and the conversion occurs when the request message is converted into the first message in the format supported by the B rule engine of the non-default rule engine. In this process, first, the A rule engine access layer of the default rule engine first acts as the destination to receive the request message of the upper-layer business application. First, the latest entity object model file corresponding to the request message is loaded from the cache queue into the memory through the class loader. Secondly, the view object is generated using the entity object model, and then the request message field is parsed to assign a value to the view object. Finally, the assigned view object is used to generate a streaming message (first message) that adapts to the support of the B rule engine, and the first message is forwarded to the B rule engine.

[0083] Step S207 performs the second message conversion. The conversion occurs when the calculation result of the B rule engine is returned to the upper-level business application. The B rule engine feeds back a response message. The A rule engine access layer acts as the source. First, the corresponding entity object model file is loaded from the cache queue through the class loader to generate an entity class view object. Secondly, the field content of the response message is assigned to the view object. Then, the assigned view object is converted into a second message in the format supported by the A rule engine, completing the message conversion between the B rule engine and the A rule engine. Finally, the second message is returned to the upper-level business application.

[0084] Based on the above embodiments, the present application realizes accurate conversion of heterogeneous messages during the dynamic switching process of the rule engine, provides unified services for upper-layer business applications, shields the differences caused by the dynamic switching process of the underlying rule engine, realizes seamless switching and ensures business continuity.

[0085] The above are some specific implementations of a heterogeneous message conversion method provided by the embodiment of the present application. Based on this, the present application also provides a corresponding device. The device provided by the embodiment of the present application will be introduced from the perspective of functional modularization.

[0086] See also Figure 4The structural schematic diagram of a heterogeneous message conversion device shown in the figure, a heterogeneous message conversion device comprises: a message conversion unit and an entity update unit;

[0087] The message conversion unit communicates bidirectionally with the entity update unit; the message conversion unit includes a message converter, a data reader and a cache list, and the entity update unit includes a message parser and an entity updater;

[0088] The message parser is used to parse the request message to obtain fields, obtain the entity object model file corresponding to the request message from the cache queue and parse and obtain the fields;

[0089] The entity updater is used to compare the fields of the request message parsed by the message parser with the fields of the corresponding entity object model file, and if there is a difference in the comparison, update the corresponding entity object model file in the cache queue according to the fields of the request message;

[0090] The data reader is used to call the latest entity object model file corresponding to the request message from the cache queue;

[0091] The message converter is used to send the received request message to the message parser; generate a first view object according to the latest entity object model file called by the data reader, and parse the request message to assign a value to the first view object; and generate a first message in a format supported by the first rule engine based on the assigned first view object.

[0092] based on Figure 4 The device shown realizes automatic updating of entity object model files through message conversion units and entity updating units, adapts to dynamic changes in message fields, and can also realize heterogeneous conversion between the format supported by upper-layer business applications and the format supported by the rule engine for message adaptation.

[0093] In one possible implementation, see Figure 5 The structural diagram of another heterogeneous message conversion device shown is based on Figure 4 The device shown also includes an engine control unit; the engine control unit communicates bidirectionally with the message conversion unit, and the engine control unit also communicates bidirectionally with the bottom layer of the rule engine; the engine control unit includes an engine switch, an object computing driver and a message processor;

[0094] The engine switcher is used to receive a request message sent by an upper-layer business application and obtain parameter information of the request message; determine whether to switch the rule engine based on the parameter information; if the rule engine is switched, execute the field of the parsed request message according to the first rule engine indicated by the parameter information; if the rule engine is not switched, send the request message to the object computing driver.

[0095] The object computing driver is used to receive the request message sent by the engine switch and the first message sent by the message converter, and send the received message to the rule engine corresponding to the engine selection field in the message;

[0096] The message processor is used to filter the response message fed back from the bottom layer of the rule engine. If the rule engine has been switched, the response message is sent to the message converter of the message conversion unit for message conversion to obtain a second message in a format supported by the default rule engine, and the second message is sent to the upper-layer business application. If the rule engine has not been switched, the response message is sent to the upper-layer business application.

[0097] Rule calculation uses rule sets as the minimum granularity. Different engines have different adaptability to rule sets. When rule engine B is more suitable for the message for rule calculation, the service provider (providing rule engine calculation services) can forward the request message of the consumer (who needs to perform rule engine calculation) to rule engine B for rule calculation by switching the switch state of the rule set, and return the calculation result of rule engine B to the consumer, ultimately making the switching process imperceptible to the consumer. Switching the rule engine is to set the rule set switch at the rule engine access layer. Under normal circumstances, the switch points to the default rule engine (rule engine A) and calls rule engine A for calculation. When the rule engine type B is more suitable for rule calculation, the switch will switch to rule engine B and call rule engine B for calculation.

[0098] Optionally, the engine switch is also used to receive a request message sent by an upper-layer business application, and determine whether the rule engine corresponding to the engine selection field in the request message is a default rule engine. If the rule engine corresponding to the engine selection field in the request message is not the default rule engine, the request message is sent to the message converter; if the rule engine corresponding to the engine selection field in the request message is the default rule engine, the request message is sent to the object computing driver.

[0099] Optional, see Figure 5 , the device further comprises: a message delivery unit, the message delivery unit is arranged between the upper layer business application and the engine control unit, the message delivery unit comprises a message receiver and a message transmitter;

[0100] The message receiver is used to receive the request message sent by the upper-layer business application, and to verify the legitimacy of the request message, and to send the verified legitimacy request message to the engine switch of the engine control unit; the message transmitter is used to receive the message fed back by the message processor of the engine control unit and send it to the upper-layer business application.

[0101] Based on the above device, the operation process of the device can be as follows:

[0102] Step 1. The message receiver receives the request message sent by the upper layer application and performs a legitimacy check. If the request message is not legal, the subsequent process ends. If the request message is legal, the request message is sent to the engine switch of the engine control unit.

[0103] Step 2. The engine switch determines whether the rule engine indicated by the engine selection field in the request message is the default rule engine. If so, the message is sent to the object computing driver, otherwise the request message is sent to the message converter of the message conversion unit.

[0104] Step 3. The message converter sends the request message to the entity update unit. When the entity update unit determines that the field has changed, the entity update unit generates an entity object model file with the latest rules and stores it in the cache queue of the message conversion unit.

[0105] Step 4. The message converter uses the data reader and the cache queue to complete the dynamic conversion of heterogeneous messages, and sends the converted first message to the object computing driver.

[0106] Step 5. The object calculation driver selects a corresponding rule engine to perform rule calculation according to the engine selection field in the first message.

[0107] Step 6. The message processor filters the response message fed back by the rule engine. If the rule engine has been switched, the response message is sent to the message converter of the message conversion unit for message conversion to obtain a second message in the format supported by the default rule engine, and the second message is sent to the upper-layer business application. If the rule engine has not been switched, the response message is sent to the upper-layer business application.

[0108] Step 7. Determine whether the called rule engine is the default rule engine. If so, send the return message to the message sender; otherwise, send the return message to the message converter, perform message conversion on the return message again, and send the converted return second message to the message processor, which sends it to the message sender.

[0109] Step 8. The message sender sends the message recognizable by the upper-layer business application to the upper-layer application.

[0110] based on Figure 5The device shown realizes automatic updating of entity object model files through message conversion units and entity update units, adapts to dynamic changes in message fields, and can also realize heterogeneous conversion between the format supported by the upper-layer business application and the format supported by the rule engine adapted to the message. Further, after the engine control unit receives the request message, its engine switch determines whether the message needs to be sent to the message conversion unit for conversion of heterogeneous messages, and sends the message to the rule engine for processing through the object computing driver. After the engine control unit receives the response message, the message processor then determines whether it needs to be sent to the message conversion unit for conversion to the message format adapted to the upper-layer application. In this way, the accurate conversion of heterogeneous messages during the dynamic switching process of the rule engine provides unified services for the upper-layer business applications, shields the differences caused by the dynamic switching process of the underlying engine, and ensures business continuity.

[0111] The embodiments of the present application also provide corresponding devices and computer storage media for implementing the solutions provided by the embodiments of the present application.

[0112] The device includes a memory and a processor, the memory is used to store instructions or codes, and the processor is used to execute the instructions or codes so that the device executes a heterogeneous message conversion method described in any embodiment of the present application.

[0113] The computer storage medium stores codes, and when the codes are executed, the device executing the codes implements a heterogeneous message conversion method described in any embodiment of the present application.

[0114] The "first" and "second" in the names such as "first" and "second" (if any) mentioned in the embodiments of the present application are only used as name identifiers and do not represent the first or second in order.

[0115] Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment of the present application or some parts of the embodiments.

[0116] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

[0117] The above description is merely an exemplary embodiment of the present application and is not intended to limit the protection scope of the present application.

Claims

1. A heterogeneous message conversion method, characterized in that: include: Parse the fields of the request message, and if there is a difference between the fields and the parsed fields of the corresponding entity object model file in the cache list, update the entity object model file according to the fields of the request message; Calling the latest entity object model file corresponding to the request message from the cache list to generate a first view object, and parsing the request message to assign a value to the first view object; A first message in a format supported by a first rule engine is generated based on the assigned first view object.

2. The method according to claim 1, characterized in that Before the fields of the resolution request message, it also includes: Receive a request message and perform a validity check on the request message; If the request message is verified to be legal, obtain parameter information of the request message; According to the parameter information, determining whether to switch the rule engine; If the rule engine is switched, the fields of the parsing request message are executed according to the first rule engine indicated by the parameter information.

3. The method according to claim 2, characterized in that The method further comprises: If the rule engine is not switched, the request message is sent to the default rule engine for processing, and a response message fed back by the default rule engine is obtained.

4. The method according to claim 2 or 3, characterized in that: The parameter information is the rule engine indicated by the engine selection field; The determining whether to switch the rule engine according to the parameter information includes: According to the parameter information, it is determined whether the rule engine indicated by the engine selection field in the request message is a default rule engine.

5. The method according to claim 4, characterized in that After generating the first message in the format supported by the first rule engine based on the assigned first view object, the method further includes: The first message is sent to the first rule engine indicated by the engine selection field of the first message, and a response message fed back by the first rule engine is obtained.

6. The method according to claim 3 or 5, characterized in that: The method further comprises: If the rule engine has been switched, the latest entity object model file corresponding to the response message is called to generate a second view object, and the response message is parsed to assign a value to the second view object; based on the assigned second view object, a second message in a format supported by the default rule engine is generated, and the second message is sent to an upper-layer business application; If the rule engine is not switched, the response message is sent to the upper-layer business application.

7. A heterogeneous message conversion device, characterized in that: It includes a message conversion unit and an entity update unit; the message conversion unit and the entity update unit communicate bidirectionally; the message conversion unit includes a message converter, a data reader and a cache list, and the entity update unit includes a message parser and an entity updater; The message parser is used to parse the request message to obtain fields, obtain the entity object model file corresponding to the request message from the cache queue and parse and obtain the fields; The entity updater is used to compare the fields of the request message parsed by the message parser with the fields of the corresponding entity object model file, and if there is a difference in the comparison, update the corresponding entity object model file in the cache queue according to the fields of the request message; The data reader is used to call the latest entity object model file corresponding to the request message from the cache queue; The message converter is used to send the received request message to the message parser; Generate a first view object according to the latest entity object model file called by the data reader, and parse the request message to assign a value to the first view object; A first message in a format supported by a first rule engine is generated based on the assigned first view object.

8. The device according to claim 7, characterized in that The device further includes: an engine control unit; the engine control unit communicates bidirectionally with the message conversion unit, and the engine control unit also communicates bidirectionally with the bottom layer of the rule engine; the engine control unit includes an engine switch, an object computing driver, and a message processor; The engine switcher is used to receive a request message sent by an upper-layer business application, and determine whether the rule engine corresponding to the engine selection field in the request message is a default rule engine. If the rule engine corresponding to the engine selection field in the request message is not the default rule engine, the request message is sent to the message converter; if the rule engine corresponding to the engine selection field in the request message is the default rule engine, the request message is sent to the object computing driver; The object computing driver is used to receive the request message sent by the engine switch and the first message sent by the message converter, and send the received message to the rule engine corresponding to the engine selection field in the message; The message processor is used to filter the response message fed back from the bottom layer of the rule engine. If the rule engine has been switched, the response message is sent to the message converter of the message conversion unit for message conversion to obtain a second message in a format supported by the default rule engine, and the second message is sent to the upper-layer business application. If the rule engine has not been switched, the response message is sent to the upper-layer business application.

9. The device according to claim 8, characterized in that The device further comprises: a message delivery unit, the message delivery unit being arranged between the upper layer service application and the engine control unit, the message delivery unit comprising a message receiver and a message transmitter; The message receiver is used to receive the request message sent by the upper-layer business application, perform a validity check on the request message, and send the verified validity request message to the engine switch of the engine control unit; The message sender is used to receive the message fed back by the message processor of the engine control unit and send it to the upper-layer business application.

10. A computer device comprising a memory and a processor, characterized in that: The memory is used to store instructions or codes, and the processor is used to execute the instructions or codes so that the device executes the heterogeneous message conversion method described in any one of claims 1-6.

Citation Information

Patent Citations

  • Heterogeneous system integration method and device, computer equipment and storage medium

    CN111683066A

  • Message conversion method and device

    CN113268955A

  • Rule engine-oriented middleware adaptation device, configuration method and matching method

    CN117632539A

  • Method and apparatus for tansforming packet format

    KR1020160016234A