CN116801207A - Message management method, device, electronic equipment and computer readable storage medium - Google Patents

Message management method, device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN116801207A
CN116801207A CN202210260533.8A CN202210260533A CN116801207A CN 116801207 A CN116801207 A CN 116801207A CN 202210260533 A CN202210260533 A CN 202210260533A CN 116801207 A CN116801207 A CN 116801207A
Authority
CN
China
Prior art keywords
message
platform
processor
determining
definition class
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
CN202210260533.8A
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.)
China Mobile Communications Group Co Ltd
China Mobile Financial Technology Co Ltd
China Mobile Group Electronic Commerce Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Financial Technology Co Ltd
China Mobile Group Electronic Commerce Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Financial Technology Co Ltd, China Mobile Group Electronic Commerce Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202210260533.8A priority Critical patent/CN116801207A/en
Publication of CN116801207A publication Critical patent/CN116801207A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to the field of IT application and Java development, and provides a message management method, a message management device, electronic equipment and a computer readable storage medium, wherein the method comprises the following steps: determining an access request and a tangential point method name of the access request; determining a platform identifier according to the URL placeholder parameter in the access request, and determining a platform to be accessed of the platform identifier; determining a platform message definition class and a platform message processor of a platform to be accessed according to the tangential point method name and the platform identifier; and carrying out serialization and anti-serialization on the request message to be accessed to the platform according to the platform message definition class and the platform message processor to generate a response message. According to the message management method provided by the embodiment of the application, the platform message definition class and the platform message processor of the platform to be accessed are determined through the tangential point method name of the access request and the platform identification of the platform to be accessed, so that the request message of the platform to be accessed can be processed, the minimum difference processing is realized, and the butting efficiency with each platform to be accessed is improved.

Description

Message management method, device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of IT applications and Java development, and in particular, to a method and apparatus for managing a message, an electronic device, and a computer readable storage medium.
Background
The current intelligent telephone charge recharging depends on the functions of providing balance early warning, reversely paying intelligent telephone charge recharging by number marketing users and the like by each provincial administrative district system. When the intelligent telephone charge recharging platform is in butt joint with each provincial administrative area through an interface, due to the difference of each provincial administrative area system, messages of the interfaces have some differences, and the intelligent telephone charge recharging platform cannot be in butt joint with each provincial administrative area through a unified interface. The interface messages of most provincial administrative regions are in the JSON format, the messages of individual provincial administrative regions are in the XML format and the messages of the same type are also in the field difference. And (3) carrying out message analysis and response processing aiming at the new access provincial administrative division when the new provincial administrative division is accessed, and carrying out serialization and reverse serialization of the JSON message by using FastJson or reading and writing of the XML message by using dom4j aiming at the message characteristics of the provincial administrative division.
Therefore, in the process that the current intelligent telephone charge recharging platform is in butt joint with each provincial administrative district through an interface, the logic and the flow of message processing are basically the same, and the only difference to be processed is that the message formats of each provincial administrative district are different. However, the existing technical scheme has the problems of a large number of repeated codes, low development efficiency, incapability of keeping pace with the development speed of the service and the like.
Disclosure of Invention
The application provides a message management method, a message management device, electronic equipment and a computer readable storage medium, and aims to realize minimized difference processing and improve the docking efficiency with each platform.
In a first aspect, the present application provides a method for managing a message, including:
determining an access request intercepted by a tangent point of a controller, and determining a tangent point method name of the access request;
determining a platform identifier according to the URL placeholder parameter in the access request, and determining a platform to be accessed according to the platform identifier;
determining a platform message definition class and a platform message processor of the platform to be accessed according to the tangential point method name and the platform identifier;
and carrying out serialization and anti-serialization on the request message of the platform to be accessed according to the platform message definition class and the platform message processor to generate a response message.
In one embodiment, the determining the platform message definition class and the platform message processor of the platform to be accessed according to the tangential point method name and the platform identifier includes:
determining whether a target message definition class and a target message processor matched with the tangential point method name and the platform identifier exist;
if the target message definition class and the target message processor do not exist, determining a preset message definition class and a preset message processor;
and determining the preset message definition class and the preset message processor as the platform message definition class and the platform message processor.
The step of serializing and deserializing the request message of the platform to be accessed according to the platform message definition class and the platform message processor to generate a response message comprises the following steps:
serializing the request message through the preset message definition class and the preset message processor to obtain a java object of the request message;
determining a signature algorithm and a signature key of a platform to be accessed, and determining a response message definition class of the platform to be accessed according to a tangential point method name and a platform identifier;
configuring the signature algorithm and the signature key to the data of the java object of the request message;
and deserializing the java object of the signed request message through the response message definition class to generate the response message.
The serializing the request message through the preset message definition class and the preset message processor to obtain a java object of the request message includes:
determining the message type of the request message, wherein the message type comprises a JSON message type and an XML message type;
and serializing the request message according to the message type, the preset message definition class and the preset message processor to obtain a java object of the request message.
The serializing the request message according to the message type, the preset message definition class and the preset message processor to obtain a java object of the request message, including:
if the message type is JSON message type, converting the message character string of the request message into the java object of the preset message definition class through a Gson message processor to obtain the java object of the request message.
The serializing the request message according to the message type, the preset message definition class and the preset message processor to obtain a java object of the request message, including:
if the message type is an XML message type, converting the message character string of the request message into a java object of the preset message definition class through an XStream message processor to obtain the java object of the request message.
After determining whether the target message definition class and the target message processor matched with the tangential point method name and the platform identifier exist, the method further comprises:
if the target message definition class and the target message processor exist, a signature algorithm and a signature key are configured for the request message through the target message definition class and the target message processor.
In a second aspect, the present application provides a message management apparatus, including:
the first determining module is used for determining an access request intercepted by a tangent point of the controller and determining a tangent point method name of the access request;
the second determining module is used for determining a platform identifier according to the URL placeholder parameter in the access request and determining a platform to be accessed according to the platform identifier;
the third determining module is used for determining a platform message definition class and a platform message processor of the platform to be accessed according to the tangential point method name and the platform identifier;
and the message processing module is used for serializing and deserializing the request message of the platform to be accessed according to the platform message definition class and the platform message processor to generate a response message.
In a third aspect, the present application further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the method for managing messages according to the first aspect when executing the program.
In a fourth aspect, the present application also provides a non-transitory computer readable storage medium, the non-transitory computer readable storage medium comprising a computer program, which when executed by the processor, implements the method for managing messages according to the first aspect.
In a fifth aspect, the present application also provides a computer program product comprising a computer program which, when executed by the processor, implements the message management method of the first aspect.
In the message management method, the device, the electronic equipment and the computer readable storage medium provided by the application, in the message processing process of the platform to be accessed, the platform message definition class and the platform message processor of the platform to be accessed can be determined directly through the tangential point method name of the access request and the platform identification of the platform to be accessed, the request message of the platform to be accessed can be processed through the platform message definition class and the platform message processor quickly, a large number of repeated codes are not required to be set, the minimized difference processing is realized, and the docking efficiency with each platform to be accessed is improved.
Drawings
In order to more clearly illustrate the technical solutions of the present application, the following description will be given with a brief introduction to the drawings used in the embodiments or the description of the prior art, it being obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained from these drawings without the inventive effort of a person skilled in the art.
FIG. 1 is a flow chart of a message management method provided by the application;
FIG. 2 is a schematic diagram of a message processor according to the present application;
FIG. 3 is a schematic diagram of a request message provided by the present application;
FIG. 4 is a schematic diagram of a response message provided by the present application;
FIG. 5 is a schematic diagram of a message management device according to the present application;
fig. 6 is a schematic structural diagram of an electronic device provided by the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Fig. 1 to fig. 6 describe a method, an apparatus, an electronic device, and a computer readable storage medium for managing a message provided by the present application. FIG. 1 is a flow chart of a message management method provided by the application; FIG. 2 is a schematic diagram of a message processor according to the present application; FIG. 3 is a schematic diagram of a request message provided by the present application; FIG. 4 is a schematic diagram of a response message provided by the present application; FIG. 5 is a schematic diagram of a message management device according to the present application; fig. 6 is a schematic structural diagram of an electronic device provided by the present application.
The embodiments of the present application provide embodiments of a message management method, and it should be noted that although a logic sequence is shown in the flowchart, steps shown or described may be performed in a different order than presented herein under certain data.
Referring to fig. 1, fig. 1 is a flow chart of a message management method provided by the present application. The message management method provided by the embodiment of the application comprises the following steps:
it should be noted that, in the embodiment of the present application, the electronic device is taken as an execution main body to exemplify, and the execution main body in the embodiment of the present application determines application scenarios, where the application scenarios include, but are not limited to, a telephone fee recharging application scenario, a traffic recharging application scenario, and a service ordering application scenario. The telephone charge recharging application scene corresponds to an intelligent telephone charge recharging platform, the flow recharging application scene corresponds to an intelligent flow recharging platform, and the service ordering application scene corresponds to an intelligent service ordering platform. For easy understanding, the embodiment of the application is illustrated by using the telephone fee recharging application scene, so that the embodiment of the application is limited by using the intelligent telephone fee recharging platform as an execution main body.
It should be further noted that the smart phone fee recharging platform includes, but is not limited to, a Controller and a message processor message handler. The controller comprises a controller tangential point for intercepting an access request sent to the intelligent telephone charge recharging platform, and the message processor has the functions of analyzing a request message, analyzing and processing the analyzed message, processing the response before the response and generating a response message.
Step S10, determining an access request intercepted by a tangent point of a controller, and determining a tangent point method name of the access request.
The intelligent telephone charge recharging platform is in butt joint with each regional platform or each enterprise platform through an interface, wherein each regional platform is a mobile platform of each provincial administrative district, a mobile platform of a direct administration municipal administration district, such as a Guangdong province mobile platform, a Beijing municipal mobile platform and a Shanghai municipal mobile platform; each enterprise platform such as Zhi Xiaobao platform and the mini-letter platform. Further, the intelligent telephone charge recharging platform is dependent on each regional platform or each enterprise platform to provide a balance early warning function and a reverse reduction intelligent telephone charge recharging function of the number sales user, so that when a certain regional platform or a certain enterprise platform needs to be connected to the intelligent telephone charge recharging platform, an access request sent to the intelligent telephone charge recharging platform is needed.
Further, the intelligent telephone charge recharging platform intercepts an access request sent by a certain regional platform or a certain enterprise platform in real time through a controller tangential point in the controller so as to determine the access request intercepted by the controller tangential point and determine the tangential point method name of the access request.
Step S20, determining a platform identifier according to the URL placeholder parameter in the access request, and determining a platform to be accessed according to the platform identifier;
it should be noted that, in the embodiment of the present application, the access request is represented in URL (Uniform Resource Locator ) format.
Therefore, after determining the access request URL intercepted by the tangent point of the controller, the smart phone fee recharging platform needs to determine the URL placeholder parameter in the access request URL, and then determine the platform identifier according to the URL placeholder parameter, where the URL placeholder parameter is the end of the access request URL, and further can be understood as that the URL placeholder parameter is the platform identifier. In one embodiment, a certain access request URL is https:// ip: port/recycle/henan, so that the URL placeholder parameter of a certain access request is determined to be henan, namely the intelligent telephone charge recharging platform determines that the platform identifier of the certain access request URL is henan.
Further, the intelligent telephone charge recharging platform queries a platform to be accessed corresponding to the platform identification in a preset identification platform lookup table of the intelligent telephone charge recharging platform according to the platform identification, wherein the preset identification platform lookup table is set by platform service personnel according to actual conditions, the preset identification platform lookup table is { the platform identification is the hunan, the platform to be accessed is the mobile platform in Hunan province }, { the platform identification is the shanghai, the platform to be accessed is the mobile platform in Shanghai city }, { the platform identification is the beijin, the platform to be accessed is the mobile platform in Beijing city }, the platform identification is the guangdong, and the platform to be accessed is the mobile platform in Guangdong province }. Thus, in the above embodiment, the platform identifier of a certain access request URL is henan, i.e. the platform to be accessed that sends the certain access request URL is a mobile platform in hunan province.
And step S30, determining a platform message definition class and a platform message processor of the platform to be accessed according to the tangential point method name and the platform identifier.
Further, after the smart phone fee recharging platform determines the platform to be accessed, which sends the access request URL, the platform message definition class and the platform message processor applicable to the platform to be accessed corresponding to the platform identifier are determined according to the determined tangential point method name and the determined platform identifier, and in particular, as described in steps S301 to S303. The request message has default definition class, the message processor has default realization of interface, and when each regional platform or each enterprise platform has special treatment, the request message can be customized and identified by annotation.
Further, referring to fig. 2, fig. 2 is a schematic diagram of a message processor provided in the present application. The message processor comprises a message processor interface, a JSON message processing program and an XML message processing program. The XML message processing program and the JSON message processing program are mainly used for analyzing the request message and generating the response message, and the message processor is mainly used for analyzing the request message, processing after analysis, preprocessing the response and generating the response message. Furthermore, the intelligent telephone fee recharging platform supports the access of JSON message format and XML message format by default, and can rewrite corresponding methods by inheriting a default message processor or realize a message processor interface again to realize special processing of the message. Post-parsing and pre-response processing are default methods of the interface. The post-analysis processing can be used for special inspection of the access messages of different access parties, intercept the problem messages and directly return the analyzed message objects without special processing by default. The response preprocessing can be used for converting the returned messages such as returned contents of different access parties.
Further, the descriptions of step S301 to step S303 are as follows:
step S301, determining whether a target message definition class and a target message processor matched with the tangential point method name and the platform identifier exist;
step S302, if the target message definition class and the target message processor do not exist, determining a preset message definition class and a preset message processor;
step S303, determining the preset message definition class and the preset message processor as the platform message definition class and the platform message processor.
Specifically, the intelligent telephone charge recharging platform determines whether a platform message definition class and a platform message processor which are applicable to the platform to be accessed and correspond to the platform identifier exist according to the point-cutting method name and the platform identifier, namely, determines whether the platform message definition class and the target message processor are matched with the point-cutting method name and the platform identifier. If the target message definition class and the target message processor which are matched with the cut point method name and the platform identification do not exist, the intelligent telephone fee recharging platform determines a default preset message definition class and a default preset message processor of the intelligent telephone fee recharging platform, and determines the default preset message definition class and the default preset message processor of the intelligent telephone fee recharging platform as the platform message definition class and the platform message processor of the platform to be accessed. If the target message definition class and the target message processor which are matched with the tangential point method name and the platform identification exist, the intelligent telephone charge recharging platform determines the target message definition class and the target message processor as the platform message definition class and the platform message processor of the platform to be accessed.
The embodiment of the application determines the platform message definition class and the platform message processor of the platform to be accessed directly through the tangential point method name of the access request and the platform identification of the platform to be accessed, thereby realizing the processing of the request message of the platform to be accessed, realizing the minimum difference processing and improving the butting efficiency with each platform to be accessed.
And step S40, serializing and deserializing the request message of the platform to be accessed according to the platform message definition class and the platform message processor, and generating a response message.
It should be noted that, in the embodiment of the present application, serialization is to convert a request message into a message java object, and reverse serialization is to convert the message java object into a message string.
Further, for the case that the platform message definition class and the platform message processor are the preset message definition class and the preset message processor: the intelligent telephone fee recharging platform determines the message type of the request message of the platform to be accessed, and the message type comprises the JSON message type and the XML message type because the intelligent telephone fee recharging platform supports the access of the JSON message format and the XML message format by default. Then, the intelligent telephone charge recharging platform calls the preset message processor to sequence the request message according to the message type of the request message, which can be understood as calling the preset message processor to convert the request message into a java object of a preset message definition class, so as to obtain the java object of the request message.
Further, the intelligent telephone charge recharging platform determines a signature algorithm and a signature key of the platform to be accessed, determines a response message definition class of the platform to be accessed according to the tangential point method name and the platform identification of the platform to be accessed, and configures the signature algorithm and the signature key for the data of the java object of the request message.
Further, if the analysis and post-analysis processing of the request message are successful, the service processing is performed. Finally, the intelligent telephone charge recharging platform deserializes the java object of the signed request message through the response message definition class, which can be understood as converting the java object of the signed request message into a message character string through the response message definition class, and generating a response message of the platform to be accessed, which is specifically described in step S401 to step S404.
Further, for the case that the platform message definition class and the platform message processor define the class and the target message processor for the target message: if the intelligent telephone charge recharging platform determines that the target message definition class and the target message processor exist, the target message definition class and the target message processor are used as the platform message definition class and the platform message processor of the platform to be accessed, and a signature algorithm and a signature key are configured for the request message of the platform to be accessed directly through the target message definition class and the target message processor to generate a response message without serializing and deserializing the request message of the platform to be accessed. According to the embodiment of the application, the request message of the platform to be accessed is flexibly processed according to the actual conditions of the platform to be accessed and the intelligent telephone charge recharging platform, so that the minimum difference processing is realized, and the docking efficiency with each platform to be accessed is improved.
The embodiment provides a message management method, in the process of processing a message of a platform to be accessed, a platform message definition class and a platform message processor of the platform to be accessed can be determined directly through a tangential point method name of an access request and a platform identifier of the platform to be accessed, so that the request message of the platform to be accessed can be processed through the platform message definition class and the platform message processor quickly, a large number of repeated codes are not required to be set, the minimum difference processing is realized, the docking efficiency with each platform to be accessed is improved, and the stability of the platform is further improved.
Further, referring to fig. 3, fig. 3 is a schematic diagram of a request packet provided in the present application. The request message in the embodiment of the application comprises a reverse reduction interface, an early warning recharging interface, a signing 95 reduction interface, a reverse reduction function, an early warning recharging function, a signing 95 reduction function and an access request generation function. The reverse reduction interface can acquire a protocol ID, a mobile phone number, a payment account number and a payment account number type; the early warning recharging interface can acquire protocol ID, early warning balance, recharging amount, mobile phone number and payment account number; the signing 95 reduces the interface to obtain the mobile phone number, the payment account number, the effective date and the expiration date; the reverse reduction function is used for signing the acquired protocol ID, the mobile phone number and the payment account; the early warning recharging function is used for signing the acquired protocol ID, early warning balance, recharging amount, mobile phone number and payment account number; the signing 95 reduces the function and is used for signing the acquired mobile phone number, payment account number, effective date and expiration date; the access request generation function is used for acquiring the signature string and acquiring the signature to generate an access request.
Furthermore, the intelligent telephone charge recharging platform provided by the embodiment of the application can provide a unified transaction access entrance for each regional platform or each enterprise platform, and the platform identification of each regional platform or each enterprise platform is transmitted through the URL placeholder parameter, and the POST data is transmitted to the message body. When a new regional platform or an enterprise platform is accessed, if the new regional platform or the enterprise platform uses a default message format, the intelligent telephone fee recharging platform only needs to configure parameters such as a signature key, a signature algorithm and the like for the message of the new regional platform or the enterprise platform. If the new regional platform or the enterprise platform has different requirements on the message format, the intelligent telephone fee recharging platform needs to define the message realization class of the new regional platform or the enterprise platform besides the configuration, and notes the new regional platform or the enterprise platform and the transaction name corresponding to the message realization class in an annotating mode.
Further, for each type of message, a unified interface is defined according to service requirements, when a new regional platform or enterprise platform is accessed, a default message implementation class is used, or a message implementation class is defined according to a new regional platform or enterprise platform message specification, and relevant interfaces of the type of message are realized. The method for obtaining signature strings can use defaults or overwrites for personalized treatment according to the new regional platform or enterprise platform message specifications. Further, for each message of the regional platform or the enterprise platform, the signature rules of all interfaces are generally the same, the existing default method can be used for obtaining the signature string, the method for obtaining the signature string can be rewritten for the regional platform or the enterprise platform, and the method for obtaining the signature string can be rewritten for a certain interface alone, so that the processing of different signature rules of different interfaces of different regional platforms or enterprise platforms can be satisfied.
Further, referring to fig. 4, fig. 4 is a schematic diagram of a response message provided by the present application. The response message comprises an access return interface, a 95-fold order inquiry interface, a protocol inquiry interface, an access return function, a 95-fold order inquiry function and a protocol inquiry function. The access return interface is used for setting a return code and setting return information; the 95-fold order inquiry interface is used for acquiring the order quantity and the total amount of orders; the protocol inquiry interface is used for acquiring a protocol number, an early warning amount and a recharging amount; the access return function is used for returning a return code and return information; the 95-fold order inquiry function is used for returning the order quantity and the order total; the agreement inquiring function returns the agreement number, the early warning amount and the recharging amount.
Further, the current response message only prompts whether each regional platform or each enterprise platform is successful or not by default, such as failure and failure reason. The partial region platform or the enterprise platform needs to return more information, the message realization class can be redefined for the partial region platform or the enterprise platform and the interface, and the partial region platform or the enterprise platform and the interface name corresponding to the message realization class are noted in an annotating mode.
Further, the descriptions of step S401 to step S404 are as follows:
step S401, serializing the request message through the preset message definition class and the preset message processor to obtain a java object of the request message;
step S402, determining a signature algorithm and a signature key of a platform to be accessed, and determining a response message definition class of the platform to be accessed according to a tangential point method name and a platform identification;
step S403, configuring the signature algorithm and the signature key to the data of the java object of the request message;
step S404, deserializing the java object of the signed request message through the response message definition class to generate the response message.
Specifically, the smart phone fee recharging platform invokes the preset message processor to sequence the request message, that is, converts the request message into a java object of a preset message definition class, and obtains the java object of the request message, which is specifically described in steps S4011 to S4012. Further, the intelligent telephone charge recharging platform determines a signature algorithm and a signature key of the platform to be accessed, determines a response message definition class of the platform to be accessed according to the tangential point method name and the platform identification of the platform to be accessed, and configures the signature algorithm and the signature key for the data of the java object of the request message. And finally, the intelligent telephone charge recharging platform deserializes the java object of the signed request message through the response message definition class, namely, converts the java object of the signed request message into a message character string, and generates a response message of the platform to be accessed.
The embodiment of the application carries out special treatment on the request message in a serialization way, the message encryption and decryption way and no signature or the like when the special line is accessed, and realizes the special treatment on the difference through the self-defined message processor.
Further, the descriptions of step S4011 to step S4012 are as follows:
step S4011, determining a message type of the request message, wherein the message type includes a JSON message type and an XML message type;
step S4012, according to the message type, the preset message definition class and the preset message processor, serializing the request message to obtain a java object of the request message.
Specifically, the intelligent telephone fee recharging platform determines the message type of the request message of the platform to be accessed, and because the intelligent telephone fee recharging platform supports the access of the JSON message format and the XML message format by default, the message type comprises the JSON message type and the XML message type. Then, the intelligent telephone fee recharging platform sequences the request message according to the message type of the request message, the preset message definition class and the preset message processor to obtain a java object of the request message, which is specifically described in step S40121 to step S40122.
The embodiment of the application can sequence the request message in different formats according to the message type of the request message, thereby realizing flexible processing of the request message.
Further, the descriptions of step S40121 to step S40122 are as follows:
step S40121, if the message type is JSON message type, converting the message string of the request message into a java object of the preset message definition class by a Gson message processor to obtain the java object of the request message;
step S40122, if the message type is an XML message type, converting, by an XStream message processor, the message string of the request message into a java object of the preset message definition class, thereby obtaining the java object of the request message.
Specifically, if the message type is determined to be JSON message type, the intelligent telephone charge recharging platform converts the message character string of the request message into a java object of a preset message definition class through the Gson message processor to obtain the java object of the request message. If the message type is determined to be the XML message type, the intelligent telephone charge recharging platform converts the message character string of the request message into a java object of a preset message definition class through an XStream message processor to obtain the java object of the request message. Further, if the platform to be accessed has special processing after the message analysis, but does not belong to the service processing range, the method can be realized by an overwriting analysis post-processing method.
Further, the reverse serialization and serialization of the JSON message type correspond to each other, and the reverse serialization and serialization of the XML message type correspond to each other, specifically:
reverse serialization for JSON message types: if the message type is determined to be JSON message type, the intelligent telephone charge recharging platform converts the java object of the request message into a message character string through the Gson message processor to generate a response message of the JSON message.
Reverse serialization for XML message types: if the message type is determined to be the XML message type, the intelligent telephone charge recharging platform converts the java object of the request message into a message character string through an XStream message processor to generate a response message of the XML message.
The embodiment of the application can carry out serialization and deserialization of different formats on the request message according to the message type of the request message, thereby realizing flexible processing of the request message.
Further, the message management device provided by the application is described below, and the message management device described below and the message management method described above can be referred to correspondingly.
As shown in fig. 5, fig. 5 is a schematic structural diagram of a message management device provided by the present application, where the message management device includes:
a first determining module 501, configured to determine an access request intercepted by a tangent point of a controller, and determine a name of a tangent point method of the access request;
a second determining module 502, configured to determine a platform identifier according to the URL placeholder parameter in the access request, and determine a platform to be accessed according to the platform identifier;
a third determining module 503, configured to determine a platform message definition class and a platform message processor of the platform to be accessed according to the tangent point method name and the platform identifier;
and the message processing module 504 is configured to sequence and reverse sequence the request message of the platform to be accessed according to the platform message definition class and the platform message processor, and generate a response message.
Further, the third determining module 503 is further configured to:
determining whether a target message definition class and a target message processor matched with the tangential point method name and the platform identifier exist;
if the target message definition class and the target message processor do not exist, determining a preset message definition class and a preset message processor;
and determining the preset message definition class and the preset message processor as the platform message definition class and the platform message processor.
Further, the message processing module 504 is further configured to:
serializing the request message through the preset message definition class and the preset message processor to obtain a java object of the request message;
determining a signature algorithm and a signature key of a platform to be accessed, and determining a response message definition class of the platform to be accessed according to a tangential point method name and a platform identifier;
configuring the signature algorithm and the signature key to the data of the java object of the request message;
and deserializing the java object of the signed request message through the response message definition class to generate the response message.
Further, the message processing module 504 is further configured to:
determining the message type of the request message, wherein the message type comprises a JSON message type and an XML message type;
and serializing the request message according to the message type, the preset message definition class and the preset message processor to obtain a java object of the request message.
Further, the message processing module 504 is further configured to:
if the message type is JSON message type, converting the message character string of the request message into the java object of the preset message definition class through a Gson message processor to obtain the java object of the request message.
Further, the message processing module 504 is further configured to:
if the message type is an XML message type, converting the message character string of the request message into a java object of the preset message definition class through an XStream message processor to obtain the java object of the request message.
Further, the message processing module 504 is further configured to:
if the target message definition class and the target message processor exist, a signature algorithm and a signature key are configured for the request message through the target message definition class and the target message processor.
The specific embodiments of the message management device provided by the present application are basically the same as the embodiments of the message management method described above, and will not be described herein.
Fig. 6 illustrates a physical schematic diagram of an electronic device, as shown in fig. 6, which may include: processor 610, communication interface (Communications Interface) 620, memory 630, and communication bus 640, wherein processor 610, communication interface 620, and memory 630 communicate with each other via communication bus 640. The processor 610 may invoke logic instructions in the memory 630 to perform a message management method comprising:
determining an access request intercepted by a tangent point of a controller, and determining a tangent point method name of the access request;
determining a platform identifier according to the URL placeholder parameter in the access request, and determining a platform to be accessed according to the platform identifier;
determining a platform message definition class and a platform message processor of the platform to be accessed according to the tangential point method name and the platform identifier;
and carrying out serialization and anti-serialization on the request message of the platform to be accessed according to the platform message definition class and the platform message processor to generate a response message.
Further, the logic instructions in the memory 630 may be implemented in the form of software functional units and stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present application also provides a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the method of message management provided by the methods described above, the method comprising:
determining an access request intercepted by a tangent point of a controller, and determining a tangent point method name of the access request;
determining a platform identifier according to the URL placeholder parameter in the access request, and determining a platform to be accessed according to the platform identifier;
determining a platform message definition class and a platform message processor of the platform to be accessed according to the tangential point method name and the platform identifier;
and carrying out serialization and anti-serialization on the request message of the platform to be accessed according to the platform message definition class and the platform message processor to generate a response message.
In yet another aspect, the present application further provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the above-provided message management methods, the method comprising:
determining an access request intercepted by a tangent point of a controller, and determining a tangent point method name of the access request;
determining a platform identifier according to the URL placeholder parameter in the access request, and determining a platform to be accessed according to the platform identifier;
determining a platform message definition class and a platform message processor of the platform to be accessed according to the tangential point method name and the platform identifier;
and carrying out serialization and anti-serialization on the request message of the platform to be accessed according to the platform message definition class and the platform message processor to generate a response message.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present application without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A method for managing messages, comprising:
determining an access request intercepted by a tangent point of a controller, and determining a tangent point method name of the access request;
determining a platform identifier according to the URL placeholder parameter in the access request, and determining a platform to be accessed according to the platform identifier;
determining a platform message definition class and a platform message processor of the platform to be accessed according to the tangential point method name and the platform identifier;
and carrying out serialization and anti-serialization on the request message of the platform to be accessed according to the platform message definition class and the platform message processor to generate a response message.
2. The method for message management according to claim 1, wherein determining the platform message definition class and the platform message processor of the platform to be accessed according to the tangential point method name and the platform identifier comprises:
determining whether a target message definition class and a target message processor matched with the tangential point method name and the platform identifier exist;
if the target message definition class and the target message processor do not exist, determining a preset message definition class and a preset message processor;
and determining the preset message definition class and the preset message processor as the platform message definition class and the platform message processor.
3. The method of claim 2, wherein the step of serializing and deserializing the request message of the platform to be accessed according to the platform message definition class and the platform message processor to generate a response message includes:
serializing the request message through the preset message definition class and the preset message processor to obtain a java object of the request message;
determining a signature algorithm and a signature key of a platform to be accessed, and determining a response message definition class of the platform to be accessed according to a tangential point method name and a platform identifier;
configuring the signature algorithm and the signature key to the data of the java object of the request message;
and deserializing the java object of the signed request message through the response message definition class to generate the response message.
4. The method for managing a message according to claim 3, wherein the serializing the request message by the preset message definition class and the preset message processor to obtain the java object of the request message includes:
determining the message type of the request message, wherein the message type comprises a JSON message type and an XML message type;
and serializing the request message according to the message type, the preset message definition class and the preset message processor to obtain a java object of the request message.
5. The method according to claim 4, wherein the serializing the request message according to the message type, the preset message definition class and the preset message processor to obtain the java object of the request message includes:
if the message type is JSON message type, converting the message character string of the request message into the java object of the preset message definition class through a Gson message processor to obtain the java object of the request message.
6. The method according to claim 4, wherein the serializing the request message according to the message type, the preset message definition class and the preset message processor to obtain the java object of the request message includes:
if the message type is an XML message type, converting the message character string of the request message into a java object of the preset message definition class through an XStream message processor to obtain the java object of the request message.
7. The method according to any one of claims 1 to 6, wherein said determining whether there is a target message definition class and a target message processor matching the cut point method name and the platform identifier further comprises:
if the target message definition class and the target message processor exist, a signature algorithm and a signature key are configured for the request message through the target message definition class and the target message processor.
8. A message management apparatus, comprising:
the first determining module is used for determining an access request intercepted by a tangent point of the controller and determining a tangent point method name of the access request;
the second determining module is used for determining a platform identifier according to the URL placeholder parameter in the access request and determining a platform to be accessed according to the platform identifier;
the third determining module is used for determining a platform message definition class and a platform message processor of the platform to be accessed according to the tangential point method name and the platform identifier;
and the message processing module is used for serializing and deserializing the request message of the platform to be accessed according to the platform message definition class and the platform message processor to generate a response message.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the message management method of any of claims 1 to 7 when the computer program is executed by the processor.
10. A non-transitory computer readable storage medium comprising a computer program, characterized in that the computer program, when executed by a processor, implements the message management method of any of claims 1 to 7.
CN202210260533.8A 2022-03-16 2022-03-16 Message management method, device, electronic equipment and computer readable storage medium Pending CN116801207A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210260533.8A CN116801207A (en) 2022-03-16 2022-03-16 Message management method, device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210260533.8A CN116801207A (en) 2022-03-16 2022-03-16 Message management method, device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN116801207A true CN116801207A (en) 2023-09-22

Family

ID=88042400

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210260533.8A Pending CN116801207A (en) 2022-03-16 2022-03-16 Message management method, device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116801207A (en)

Similar Documents

Publication Publication Date Title
US8463884B2 (en) Synchronization of mobile device with application server
CN109995713A (en) Service processing method and relevant device in a kind of micro services frame
CN109348434B (en) Scene information sending method, sending device and terminal equipment
US11115913B2 (en) Wireless communication core network and method for analyzing user equipment mobility in the same
CN108429739A (en) A kind of method, system and the terminal device of identification honey jar
CN111988418B (en) Data processing method, device, equipment and computer readable storage medium
CN113312675A (en) Attribute checking method and device, electronic equipment and storage medium
CN116502283A (en) Privacy data processing method and device
CN116801207A (en) Message management method, device, electronic equipment and computer readable storage medium
CN106936643B (en) Equipment linkage method and terminal equipment
CN114285859B (en) Data processing method, device, equipment and storage medium for middle layer block chain service
CN103077078A (en) Method of defining state transitions in a software and application control management object
CN112417402B (en) Authority control method, authority control device, authority control equipment and storage medium
CN112052267B (en) Data query method, equipment, server and storage medium
WO2019161600A1 (en) Method, device, server and medium for adding member to community
CN114866970A (en) Policy control method, system and related equipment
WO2018196613A1 (en) Application control method and device using function switches, server, and medium
CN113472781A (en) Service acquisition method, server and computer readable storage medium
CN112860398A (en) Data processing method, device, equipment and medium based on rule engine
KR20040105588A (en) Method with management of an opaque user identifier for checking complete delivery of a service using a set of servers
CN111324368A (en) Data sharing method and server
TW201437838A (en) Management method and system for intelligent type component library
CN111355761A (en) Directional flow resource acquisition system, method, device, electronic equipment and medium
CN109376023B (en) Method and equipment for generating calling information and issuing return code group
CN114785847B (en) Network control software development configuration method, terminal and storage medium

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