CN117278625A - Message conversion method, device, computer equipment and storage medium - Google Patents

Message conversion method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN117278625A
CN117278625A CN202311253159.XA CN202311253159A CN117278625A CN 117278625 A CN117278625 A CN 117278625A CN 202311253159 A CN202311253159 A CN 202311253159A CN 117278625 A CN117278625 A CN 117278625A
Authority
CN
China
Prior art keywords
message
target
parameter
template
service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311253159.XA
Other languages
Chinese (zh)
Inventor
漆永强
王旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202311253159.XA priority Critical patent/CN117278625A/en
Publication of CN117278625A publication Critical patent/CN117278625A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to a message conversion method, a message conversion device, computer equipment and a storage medium, and relates to the technical field of computers. Can be used in the field of financial science and technology or other related fields. The method comprises the following steps: acquiring a service message, and checking the service message to obtain a target checking result; obtaining a target message template matched with the service message under the condition that the target verification result is verification passing; the message template comprises a parameter name and a parameter path identifier; according to the parameter path identifier, determining a parameter value corresponding to the parameter name from the service message; and replacing the parameter path identifier corresponding to the parameter name in the target message template with the parameter value corresponding to the parameter name to obtain the target message. By adopting the method, the message conversion efficiency can be improved.

Description

Message conversion method, device, computer equipment and storage medium
Technical Field
The present invention relates to the field of computer technology, and in particular, to a method, an apparatus, a computer device, a storage medium, and a computer program product for message conversion, which can be applied to the field of financial science and technology or other related fields.
Background
With the development of cloud computing technology, conventional banking systems are gradually migrating to cloud platforms. In the gradual migration process, part of the business systems run on the traditional platform, and the other part of the business systems run services on the cloud platform. Because the format of the message in the traditional platform is inconsistent with that of the message in the cloud platform, the message conversion is needed for the communication between different service systems.
In the related art, when the message is converted, parameter name matching needs to be repeatedly performed to obtain a parameter value required by the message in the target format, so that the message conversion efficiency is low.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a message conversion method, apparatus, computer device, computer readable storage medium, and computer program product that can improve the message conversion efficiency.
In a first aspect, the present application provides a method for message conversion. The method comprises the following steps:
acquiring a service message, and checking the service message to obtain a target checking result;
under the condition that the target verification result is that verification passes, a target message template matched with the service message is obtained; the message template comprises a parameter name and a parameter path identifier;
according to the parameter path identification, determining a parameter value corresponding to the parameter name from the service message;
and replacing the parameter path identifier corresponding to the parameter name in the target message template with the parameter value corresponding to the parameter name to obtain the target message.
In one embodiment, verifying the service message to obtain a target verification result includes:
non-empty verification is carried out on a message body of the service message, and a first verification result is obtained;
under the condition that the first verification result is that verification passes, obtaining a target parameter type and a target parameter range corresponding to the target parameter name;
and verifying the parameter value corresponding to the target parameter name in the service message according to the target parameter type and the target parameter range to obtain a target verification result.
In one embodiment, the method further comprises:
generating abnormal prompt information under the condition that the first verification result is that verification is not passed; the abnormal prompt information is used for representing that the message body of the service message is empty.
In one embodiment, the service message includes a source system identifier and a target system identifier; obtaining a target message template matched with a service message, comprising:
generating a query statement according to the source system identification and the target system identification;
inquiring a message template in the cache according to the inquiry statement to obtain a first inquiry result;
and under the condition that the first query result is that the corresponding message template is queried, taking the queried message template as a target message template.
In one embodiment, the method further comprises:
under the condition that the first query result is that the corresponding message template is not queried, querying the message template in a template database according to a query statement to obtain a second query result;
under the condition that the second query result is that the corresponding message template is queried, taking the queried message template as a target message template, and writing the query statement and the target message template into a cache.
In one embodiment, the method further comprises:
and under the condition that the second query result is that the corresponding message template is not queried, taking the service message as a target message.
In a second aspect, the present application further provides a message conversion device. The device comprises:
the acquisition module is used for acquiring the service message, checking the service message and obtaining a target checking result;
the matching module is used for acquiring a target message template matched with the service message under the condition that the target verification result is verification passing; the message template comprises a parameter name and a parameter path identifier;
the mapping module is used for determining a parameter value corresponding to the parameter name from the service message according to the parameter path identifier;
and the conversion module is used for replacing the parameter path identifier corresponding to the parameter name in the target message template with the parameter value corresponding to the parameter name to obtain the target message.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor which when executing the computer program performs the steps of:
acquiring a service message, and checking the service message to obtain a target checking result;
under the condition that the target verification result is that verification passes, a target message template matched with the service message is obtained; the message template comprises a parameter name and a parameter path identifier;
according to the parameter path identification, determining a parameter value corresponding to the parameter name from the service message;
and replacing the parameter path identifier corresponding to the parameter name in the target message template with the parameter value corresponding to the parameter name to obtain the target message.
In a fourth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
acquiring a service message, and checking the service message to obtain a target checking result;
under the condition that the target verification result is that verification passes, a target message template matched with the service message is obtained; the message template comprises a parameter name and a parameter path identifier;
according to the parameter path identification, determining a parameter value corresponding to the parameter name from the service message;
and replacing the parameter path identifier corresponding to the parameter name in the target message template with the parameter value corresponding to the parameter name to obtain the target message.
In a fifth aspect, the present application also provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the steps of:
acquiring a service message, and checking the service message to obtain a target checking result;
under the condition that the target verification result is that verification passes, a target message template matched with the service message is obtained; the message template comprises a parameter name and a parameter path identifier;
according to the parameter path identification, determining a parameter value corresponding to the parameter name from the service message;
and replacing the parameter path identifier corresponding to the parameter name in the target message template with the parameter value corresponding to the parameter name to obtain the target message.
According to the message conversion method, the device, the computer equipment, the storage medium and the computer program product, the service message is firstly obtained, the service message is checked to obtain the target checking result, so that the correctness and the completeness of the service message can be ensured, further, the target message template matched with the service message is obtained under the condition that the target checking result is that the checking is passed, the message template comprises the parameter name and the parameter path identifier, the parameter value corresponding to the parameter name is determined from the service message according to the parameter path identifier, the required parameter value can be directly determined according to the parameter path identifier, the parameter name matching is avoided, finally, the parameter path identifier corresponding to the parameter name in the target message template is replaced by the parameter value corresponding to the parameter name, so that the target message can be obtained, the target message can be directly generated according to the target message template, and the message conversion efficiency can be improved.
Drawings
FIG. 1 is a diagram of an application environment of a message conversion method in one embodiment;
FIG. 2 is a flow chart of a message conversion method in one embodiment;
FIG. 3 is a diagram of a target message template in one embodiment;
FIG. 4 is a schematic diagram of a service message in one embodiment;
FIG. 5 is a diagram of a target message in one embodiment;
FIG. 6 is a flow chart of a message conversion method according to another embodiment;
FIG. 7 is a block diagram of a message conversion device according to an embodiment;
fig. 8 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The message conversion method provided by the embodiment of the application can be applied to an application environment shown in fig. 1. Wherein the source business system 102 and the target business system 106 communicate with the server 104 over a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104 or may be located on a cloud or other network server. The source business system 102 may send a business message to the server 104, and the server 104 may be responsible for converting the business message into a target message and transmitting the target message to the target business system 106. The server 104 may be implemented as a stand-alone server or a server cluster including a plurality of servers.
In one embodiment, as shown in fig. 2, a method for converting a message is provided, which is illustrated by using the method applied to the server 104 in fig. 1 as an example, and includes the following steps:
s202: and acquiring a service message, and checking the service message to obtain a target checking result.
The service message refers to a message for communication between different service systems. The checking of the service message may be checking whether the service message conforms to the used network protocol format, checking whether the service message length conforms to the protocol length, checking whether the service message content is wrong according to the checksum, or checking whether the sending end of the service message has a corresponding operation authority, etc., which is not limited herein.
Optionally, in the service processing process, the server receives the service message, and verifies the service message according to a preset verification rule to ensure the effectiveness of the subsequent processing process.
S204: under the condition that the target verification result is that verification passes, a target message template matched with the service message is obtained; the message template comprises a parameter name and a parameter path identifier.
The template database in the data storage system is pre-configured with a plurality of message templates, and different message templates are used for carrying out message format conversion for communication among corresponding service systems. The parameter name refers to a parameter identifier corresponding to a required parameter in the target message, and the parameter path identifier refers to an attribute access identifier for the service message.
Optionally, in the case that the service message is determined to pass the verification, the server matches a target message template corresponding to the service message in the data storage system. For example, as shown in fig. 3, the target message template is shown in fig. 3, where the parameter path identifier corresponding to the parameter name Header is $ { message.header }, the parameter path identifier corresponding to the parameter name NameA is $ { message.body.name1}, and the parameter path identifier corresponding to the parameter name NameB is $ { message.body.name2.name3}.
S206: and determining a parameter value corresponding to the parameter name from the service message according to the parameter path identifier.
For example, as shown in fig. 4, according to the parameter path identifier and the service packet, it may be determined that the parameter value corresponding to the parameter name header is param1, the parameter value corresponding to the parameter name1 is param2, and the parameter value corresponding to the parameter name3 is param3.
S208: and replacing the parameter path identifier corresponding to the parameter name in the target message template with the parameter value corresponding to the parameter name to obtain the target message.
For example, the parameter path identifier corresponding to the parameter name Header is replaced by the parameter value param1, the parameter path identifier corresponding to the parameter name NameA is replaced by the parameter value param2, and the parameter path identifier corresponding to the parameter name NameB is replaced by the parameter value param3, so as to obtain the target message as shown in fig. 5. And under the condition of conversion failure, the server throws out corresponding abnormality to prompt the conversion failure of the service message.
In the message conversion method, the service message is firstly acquired and checked to obtain the target checking result, so that the correctness and the completeness of the service message can be ensured, further, a target message template matched with the service message is acquired under the condition that the target checking result is that the checking is passed, the message template comprises a parameter name and a parameter path identifier, the parameter value corresponding to the parameter name is determined from the service message according to the parameter path identifier, the required parameter value can be directly determined according to the parameter path identifier, frequent parameter name matching is avoided, and finally, the parameter path identifier corresponding to the parameter name in the target message template is replaced by the parameter value corresponding to the parameter name to obtain the target message, so that the target message can be directly generated according to the target message template, and the message conversion efficiency can be improved.
In one embodiment, verifying the service message to obtain a target verification result includes: non-empty verification is carried out on a message body of the service message, and a first verification result is obtained; under the condition that the first verification result is that verification passes, obtaining a target parameter type and a target parameter range corresponding to the target parameter name; according to the target parameter type and the target parameter range, verifying the parameter value corresponding to the target parameter name in the service message to obtain a target verification result;
generating abnormal prompt information under the condition that the first verification result is that verification is not passed; the abnormal prompt information is used for representing that the message body of the service message is empty.
Wherein, the message body refers to the service data bearing part in the service message. The target parameter type may be an integer, floating point number, character, boolean, etc., or other parameter types, which are not specifically limited herein. The target parameter range may be a length range of the target parameter or a numerical range of the target parameter, which is not particularly limited herein.
Optionally, after receiving the service message, the server first performs non-empty verification on the service data bearing part in the service message, so as to ensure the validity of the service message.
And under the condition that the service data bearing part is not empty, the server acquires a target parameter name to be checked, and a target parameter type and a target parameter range corresponding to the target parameter name according to the service property. And then, acquiring a parameter value corresponding to the target parameter name in the service message, and determining a target verification result according to whether the parameter type of the parameter value is consistent with the target parameter type and whether the parameter value is in a target parameter range.
And under the condition that the service data bearing part is determined to be empty, the server throws out the corresponding abnormality to prompt that the message body of the service message is empty.
In this embodiment, the validity of the service packet can be ensured by checking the message body and the target parameter of the service packet.
In one embodiment, the service message includes a source system identification and a target system identification; obtaining a target message template matched with a service message, comprising: generating a query statement according to the source system identification and the target system identification; inquiring a message template in the cache according to the inquiry statement to obtain a first inquiry result; and under the condition that the first query result is that the corresponding message template is queried, taking the queried message template as a target message template.
Wherein, the buffer memory stores the history inquiry statement and the message template matched with the history inquiry statement. The source system identifier refers to a unique identifier corresponding to a service system for sending the service message, and the target system identifier refers to a unique identifier corresponding to a service system for receiving the target message.
Optionally, under the condition that the service message is successfully checked, the server acquires the source system identifier and the target system identifier in the service message, and generates a query statement according to the source system identifier, the target system identifier and a preset query statement template. After generating the query statement, the server queries the message template in the cache through the query statement. Under the condition of cache hit, the server takes the hit message template as a target message template corresponding to the service message.
In an alternative embodiment, the cache is refreshed according to a preset time period.
In this embodiment, the message conversion efficiency can be improved by preferentially searching the target message template matched with the service message through the buffer memory.
In one embodiment, the method further comprises: under the condition that the first query result is that the corresponding message template is not queried, querying the message template in a template database according to a query statement to obtain a second query result; under the condition that the second query result is that the corresponding message template is queried, taking the queried message template as a target message template, and writing the query statement and the target message template into a cache;
and under the condition that the second query result is that the corresponding message template is not queried, taking the service message as a target message.
Optionally, in the case of a cache miss, the server further queries the template database for the message template according to the query statement.
Under the condition that the corresponding message template is inquired, the server takes the inquired message template as a target message template, and writes inquiry sentences and the target message template into a cache so as to improve the matching efficiency of the message template; under the condition that the corresponding message template is not queried, the server determines that the service message does not need to be subjected to message conversion, and directly uses the service message as a target message and transmits the target message to a service system corresponding to the target system identifier.
In this embodiment, the matching efficiency of the message templates can be improved by querying the message Wen Moban in the template database and writing the query statement and the target message template into the cache under the condition that the corresponding message template is queried.
In one embodiment, as shown in fig. 6, a message conversion method is provided, which includes the following steps:
and acquiring a service message, wherein the service message comprises a source system identifier and a target system identifier.
And carrying out non-empty verification on the message body of the service message to obtain a first verification result.
Under the condition that the first verification result is verification passing, obtaining a target parameter type and a target parameter range corresponding to the target parameter name, and verifying a parameter value corresponding to the target parameter name in the service message according to the target parameter type and the target parameter range to obtain a target verification result; and generating abnormal prompt information under the condition that the first verification result is that verification is not passed, wherein the abnormal prompt information is used for representing that the message body of the service message is empty.
And under the condition that the target verification result passes the verification, generating a query statement according to the source system identification and the target system identification, and querying a message template in a cache according to the query statement to obtain a first query result.
Under the condition that the first query result is that the corresponding message template is queried, taking the queried message template as a target message template; and under the condition that the first query result is that the corresponding message template is not queried, querying the message template in the template database according to the query statement to obtain a second query result.
Under the condition that the second query result is that the corresponding message template is queried, taking the queried message template as a target message template, and writing the query statement and the target message template into a cache; and under the condition that the second query result is that the corresponding message template is not queried, taking the service message as a target message.
And according to the parameter path identifier, determining a parameter value corresponding to the parameter name from the service message, and replacing the parameter path identifier corresponding to the parameter name in the target message template with the parameter value corresponding to the parameter name to obtain the target message.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a message conversion device for realizing the above-mentioned message conversion method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in the embodiments of one or more message conversion devices provided below may refer to the limitation of the message conversion method hereinabove, and will not be repeated herein.
In one embodiment, as shown in fig. 7, there is provided a message conversion apparatus, including: an acquisition module 710, a matching module 720, a mapping module 730, and a conversion module 740, wherein:
the acquiring module 710 is configured to acquire a service packet, and verify the service packet to obtain a target verification result;
the matching module 720 is configured to obtain a target message template that matches the service message when the target verification result is that the verification is passed; the message template comprises a parameter name and a parameter path identifier;
the mapping module 730 is configured to determine, from the service message, a parameter value corresponding to the parameter name according to the parameter path identifier;
the conversion module 740 is configured to replace the parameter path identifier corresponding to the parameter name in the target message template with the parameter value corresponding to the parameter name, so as to obtain the target message.
In one embodiment, the obtaining module 710 is further configured to perform non-empty verification on a message body of the service packet to obtain a first verification result; under the condition that the first verification result is that verification passes, obtaining a target parameter type and a target parameter range corresponding to the target parameter name; and verifying the parameter value corresponding to the target parameter name in the service message according to the target parameter type and the target parameter range to obtain a target verification result.
In one embodiment, the obtaining module 710 is further configured to generate an exception prompt message if the first verification result is that the verification is not passed; the abnormal prompt information is used for representing that the message body of the service message is empty.
In one embodiment, the matching module 720 is further configured to generate a query statement according to the source system identifier and the target system identifier; inquiring a message template in the cache according to the inquiry statement to obtain a first inquiry result; and under the condition that the first query result is that the corresponding message template is queried, taking the queried message template as a target message template.
In one embodiment, the matching module 720 is further configured to query the message template in the template database according to the query statement to obtain a second query result if the first query result is that the corresponding message template is not queried; under the condition that the second query result is that the corresponding message template is queried, taking the queried message template as a target message template, and writing the query statement and the target message template into a cache.
In one embodiment, the matching module 720 is further configured to use the service packet as the target packet if the second query result is that the corresponding packet template is not queried.
All or part of the modules in the message conversion device can be realized by software, hardware and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, and the internal structure of which may be as shown in fig. 8. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing message templates and other business data. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a message conversion method.
It will be appreciated by those skilled in the art that the structure shown in fig. 8 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of: acquiring a service message, and checking the service message to obtain a target checking result; under the condition that the target verification result is that verification passes, a target message template matched with the service message is obtained; the message template comprises a parameter name and a parameter path identifier; according to the parameter path identification, determining a parameter value corresponding to the parameter name from the service message; and replacing the parameter path identifier corresponding to the parameter name in the target message template with the parameter value corresponding to the parameter name to obtain the target message.
In one embodiment, the processor when executing the computer program further performs the steps of: non-empty verification is carried out on a message body of the service message, and a first verification result is obtained; under the condition that the first verification result is that verification passes, obtaining a target parameter type and a target parameter range corresponding to the target parameter name; and verifying the parameter value corresponding to the target parameter name in the service message according to the target parameter type and the target parameter range to obtain a target verification result.
In one embodiment, the processor when executing the computer program further performs the steps of: generating abnormal prompt information under the condition that the first verification result is that verification is not passed; the abnormal prompt information is used for representing that the message body of the service message is empty.
In one embodiment, the processor when executing the computer program further performs the steps of: generating a query statement according to the source system identification and the target system identification; inquiring a message template in the cache according to the inquiry statement to obtain a first inquiry result; and under the condition that the first query result is that the corresponding message template is queried, taking the queried message template as a target message template.
In one embodiment, the processor when executing the computer program further performs the steps of: under the condition that the first query result is that the corresponding message template is not queried, querying the message template in a template database according to a query statement to obtain a second query result; under the condition that the second query result is that the corresponding message template is queried, taking the queried message template as a target message template, and writing the query statement and the target message template into a cache.
In one embodiment, the processor when executing the computer program further performs the steps of: and under the condition that the second query result is that the corresponding message template is not queried, taking the service message as a target message.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of: acquiring a service message, and checking the service message to obtain a target checking result; under the condition that the target verification result is that verification passes, a target message template matched with the service message is obtained; the message template comprises a parameter name and a parameter path identifier; according to the parameter path identification, determining a parameter value corresponding to the parameter name from the service message; and replacing the parameter path identifier corresponding to the parameter name in the target message template with the parameter value corresponding to the parameter name to obtain the target message.
In one embodiment, the computer program when executed by the processor further performs the steps of: non-empty verification is carried out on a message body of the service message, and a first verification result is obtained; under the condition that the first verification result is that verification passes, obtaining a target parameter type and a target parameter range corresponding to the target parameter name; and verifying the parameter value corresponding to the target parameter name in the service message according to the target parameter type and the target parameter range to obtain a target verification result.
In one embodiment, the computer program when executed by the processor further performs the steps of: generating abnormal prompt information under the condition that the first verification result is that verification is not passed; the abnormal prompt information is used for representing that the message body of the service message is empty.
In one embodiment, the computer program when executed by the processor further performs the steps of: generating a query statement according to the source system identification and the target system identification; inquiring a message template in the cache according to the inquiry statement to obtain a first inquiry result; and under the condition that the first query result is that the corresponding message template is queried, taking the queried message template as a target message template.
In one embodiment, the computer program when executed by the processor further performs the steps of: under the condition that the first query result is that the corresponding message template is not queried, querying the message template in a template database according to a query statement to obtain a second query result; under the condition that the second query result is that the corresponding message template is queried, taking the queried message template as a target message template, and writing the query statement and the target message template into a cache.
In one embodiment, the computer program when executed by the processor further performs the steps of: and under the condition that the second query result is that the corresponding message template is not queried, taking the service message as a target message.
In one embodiment, a computer program product is provided comprising a computer program which, when executed by a processor, performs the steps of: acquiring a service message, and checking the service message to obtain a target checking result; under the condition that the target verification result is that verification passes, a target message template matched with the service message is obtained; the message template comprises a parameter name and a parameter path identifier; according to the parameter path identification, determining a parameter value corresponding to the parameter name from the service message; and replacing the parameter path identifier corresponding to the parameter name in the target message template with the parameter value corresponding to the parameter name to obtain the target message.
In one embodiment, the computer program when executed by the processor further performs the steps of: non-empty verification is carried out on a message body of the service message, and a first verification result is obtained; under the condition that the first verification result is that verification passes, obtaining a target parameter type and a target parameter range corresponding to the target parameter name; and verifying the parameter value corresponding to the target parameter name in the service message according to the target parameter type and the target parameter range to obtain a target verification result.
In one embodiment, the computer program when executed by the processor further performs the steps of: generating abnormal prompt information under the condition that the first verification result is that verification is not passed; the abnormal prompt information is used for representing that the message body of the service message is empty.
In one embodiment, the computer program when executed by the processor further performs the steps of: generating a query statement according to the source system identification and the target system identification; inquiring a message template in the cache according to the inquiry statement to obtain a first inquiry result; and under the condition that the first query result is that the corresponding message template is queried, taking the queried message template as a target message template.
In one embodiment, the computer program when executed by the processor further performs the steps of: under the condition that the first query result is that the corresponding message template is not queried, querying the message template in a template database according to a query statement to obtain a second query result; under the condition that the second query result is that the corresponding message template is queried, taking the queried message template as a target message template, and writing the query statement and the target message template into a cache.
In one embodiment, the computer program when executed by the processor further performs the steps of: and under the condition that the second query result is that the corresponding message template is not queried, taking the service message as a target message.
It should be noted that, the user information (including, but not limited to, user equipment information, user personal information, etc.) and the data (including, but not limited to, data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data are required to comply with the related laws and regulations and standards of the related countries and regions.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the various embodiments provided herein may include at least one of relational databases and non-relational databases. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic units, quantum computing-based data processing logic units, etc., without being limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.

Claims (10)

1. The message conversion method is characterized by comprising the following steps:
acquiring a service message, and checking the service message to obtain a target checking result;
obtaining a target message template matched with the service message under the condition that the target verification result is verification passing; the message template comprises a parameter name and a parameter path identifier;
according to the parameter path identifier, determining a parameter value corresponding to the parameter name from the service message;
and replacing the parameter path identifier corresponding to the parameter name in the target message template with the parameter value corresponding to the parameter name to obtain the target message.
2. The method of claim 1, wherein the verifying the service packet to obtain the target verification result comprises:
non-empty verification is carried out on the message body of the service message, and a first verification result is obtained;
under the condition that the first verification result is that verification is passed, obtaining a target parameter type and a target parameter range corresponding to the target parameter name;
and verifying the parameter value corresponding to the target parameter name in the service message according to the target parameter type and the target parameter range to obtain a target verification result.
3. The method according to claim 2, wherein the method further comprises:
generating abnormal prompt information under the condition that the first verification result is that verification is not passed; the abnormal prompt information is used for representing that the message body of the service message is empty.
4. The method of claim 1, wherein the service message comprises a source system identification and a target system identification; the obtaining the target message template matched with the service message comprises the following steps:
generating a query statement according to the source system identifier and the target system identifier;
inquiring a message template in a cache according to the inquiry statement to obtain a first inquiry result;
and under the condition that the first query result is that the corresponding message template is queried, taking the queried message template as the target message template.
5. The method according to claim 4, wherein the method further comprises:
under the condition that the first query result is that the corresponding message template is not queried, querying the message template in a template database according to the query statement to obtain a second query result;
and under the condition that the second query result is that the corresponding message template is queried, taking the queried message template as the target message template, and writing the query statement and the target message template into the cache.
6. The method of claim 5, wherein the method further comprises:
and under the condition that the second query result is that the corresponding message template is not queried, taking the service message as the target message.
7. A message conversion device, the device comprising:
the acquisition module is used for acquiring the service message, and checking the service message to obtain a target checking result;
the matching module is used for acquiring a target message template matched with the service message under the condition that the target verification result is verification passing; the message template comprises a parameter name and a parameter path identifier;
the mapping module is used for determining a parameter value corresponding to the parameter name from the service message according to the parameter path identifier;
and the conversion module is used for replacing the parameter path identifier corresponding to the parameter name in the target message template with the parameter value corresponding to the parameter name to obtain the target message.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN202311253159.XA 2023-09-26 2023-09-26 Message conversion method, device, computer equipment and storage medium Pending CN117278625A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311253159.XA CN117278625A (en) 2023-09-26 2023-09-26 Message conversion method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311253159.XA CN117278625A (en) 2023-09-26 2023-09-26 Message conversion method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117278625A true CN117278625A (en) 2023-12-22

Family

ID=89200431

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311253159.XA Pending CN117278625A (en) 2023-09-26 2023-09-26 Message conversion method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117278625A (en)

Similar Documents

Publication Publication Date Title
CN108572986B (en) Data updating method and node equipment
WO2019019640A1 (en) Simulated processing method and apparatus for order information, and storage medium and computer device
CN111858467B (en) File data processing method, device, equipment and medium based on artificial intelligence
CN106776795B (en) Data writing method and device based on Hbase database
CN114443503A (en) Test case generation method and device, computer equipment and storage medium
CN116155597A (en) Access request processing method and device and computer equipment
CN117278625A (en) Message conversion method, device, computer equipment and storage medium
CN112860755B (en) Service identifier generation method, device, computer equipment and medium
CN113313540B (en) Contract generation method and device, electronic equipment and readable storage medium
CN117349131A (en) System error information display method and device and computer equipment
CN116881164A (en) Verification and correction method, device and equipment for test data in financial information system
CN114238367A (en) Asset security information management method and device and computer equipment
CN117033172A (en) Test data processing method, apparatus, device, storage medium and program product
CN117453661A (en) Resource allocation method, device, computer equipment and storage medium
CN117763027A (en) Data processing method, device, computer equipment and storage medium
CN116880927A (en) Rule management method, device, computer equipment and storage medium
CN116680294A (en) Service data query method, device, computer equipment and storage medium
CN115629958A (en) Universal field level automatic checking method and device for different service interfaces
CN117408238A (en) Activity task management method, system, electronic device and storage medium
CN118227589A (en) Database compatibility verification method, device, computer equipment and storage medium
CN117785674A (en) Interface use case generation method, device, computer equipment and storage medium
CN117708151A (en) Data processing method and device and computer equipment
CN117971649A (en) Data processing method, device, computer equipment and storage medium
CN117370339A (en) Report blood edge relationship processing method and device, computer equipment and storage medium
CN116451199A (en) Access request processing method, device, equipment, storage medium and computer product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination