CN111064791B - Method, device, equipment and medium for processing identifier field of JMS (Java Server System) message - Google Patents

Method, device, equipment and medium for processing identifier field of JMS (Java Server System) message Download PDF

Info

Publication number
CN111064791B
CN111064791B CN201911317308.8A CN201911317308A CN111064791B CN 111064791 B CN111064791 B CN 111064791B CN 201911317308 A CN201911317308 A CN 201911317308A CN 111064791 B CN111064791 B CN 111064791B
Authority
CN
China
Prior art keywords
message
identifier
jms
jms message
format
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.)
Active
Application number
CN201911317308.8A
Other languages
Chinese (zh)
Other versions
CN111064791A (en
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 Group Jiangsu Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Group Jiangsu 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 Group Jiangsu Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201911317308.8A priority Critical patent/CN111064791B/en
Publication of CN111064791A publication Critical patent/CN111064791A/en
Application granted granted Critical
Publication of CN111064791B publication Critical patent/CN111064791B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Abstract

The invention discloses a method, a device, equipment and a medium for processing an identifier field of a JMS message. The method comprises the following steps: in a process that a first service application sends a JMS message to a second service application, communication related information of the JMS message is acquired; generating an identifier field carrying communication related information; wherein the communication-related information comprises at least one of: the correlation identification of the first service application, the correlation identification of the process and the correlation identification of the JMS message. According to the method, the device, the equipment and the medium for processing the identifier field of the JMS message, provided by the embodiment of the invention, the traceability of the JMS message is improved.

Description

Method, device, equipment and medium for processing identifier field of JMS (Java Server System) message
Technical Field
The present invention relates to the field of communications, and in particular, to a method, an apparatus, a device, and a medium for processing an identifier field of a JMS message.
Background
On the basis of a JAVA (computer programming language) platform, business applications communicate with each other through JAVA Message Service (JMS) messages.
The JMS message consists of three parts, namely a message header, a message attribute and a message body. Wherein an Identifier (ID) field in the header of the message is used to uniquely identify the JMS message.
At present, a Universal Unique Identifier (UUID) is generally used as the content of the Identifier field. However, since the UUID can only serve as a unique identifier for the JMS message, and cannot carry additional information, the JMS message does not have traceability capability.
Disclosure of Invention
The method, the device, the equipment and the medium for processing the identifier field of the JMS message improve the traceability of the JMS message.
In a first aspect, a method for processing an identifier field of a JMS message is provided, including: in a process that a first service application sends a JMS message to a second service application, communication related information of the JMS message is acquired; generating an identifier field carrying communication related information; wherein the communication-related information comprises at least one of: the correlation identification of the first service application, the correlation identification of the process and the correlation identification of the JMS message.
According to the method for processing the identifier field of the JMS message in the embodiment of the present invention, the identifier field of the JMS message may carry communication related information of the JMS message, and the communication related information may include a related identifier of the first service application, a related identifier of the process, a related identifier of the JMS message, and other messages. The information such as the production end, the production process, the JMS message and the like of the JMS message can be traced according to the information such as the related identification of the first service application, the related identification of the process, the related identification of the JMS message and the like, so that the traceability of the JMS message is improved.
In an optional implementation manner, if the JMS message includes a relevant identifier of the first service application, and the relevant identifier of the first service application includes a type identifier of an IP address of a server where the first service application is located; generating an identifier field carrying communication related information, comprising: on the basis of the type identification, coding the communication related information according to the coding format corresponding to the type of the IP address to obtain a coding result of the IP format; coding the coding result in the IP format according to a predefined coding format so as to convert the coding result in the IP format into a predefined character string format and obtain a coding result in the character string format; generating an identifier field of the JMS message based on the encoding result of the character string format; if the type identifier indicates that the type of the IP address is an IPv4 address, the encoding format corresponding to the IPv4 address is an IPv4 format, and if the type identifier indicates that the type of the IP address is an IPv6 address, the encoding format corresponding to the IPv6 address is an IPv6 format.
With this example, it may be encoded according to the features of IPv4 and IPv6, and into a predefined string format as required. Especially when the JMS information is coded into a printable character string format, the ability of carrying extra information by the JMS information can be ensured.
In an alternative embodiment, the related identification of the first service application comprises at least one of: the method comprises the steps of identifying a first service application, an IP address of a terminal where the first service application is located, and type identification of the IP address; the relevant identification of the process includes at least one of: a terminal port identifier corresponding to the process, a starting time of the process, an identifier of a connection between a client of the first service application and a message intermediate terminal, and an identifier of a session for sending the JMS message; the related identification of the JMS message comprises: an identification of a producer of the JMS message, and/or an identification of the JMS message.
By the embodiment of the invention, the traceability and global uniqueness of the JMS message can be improved.
In an optional implementation manner, if the communication related information includes an identifier of the first service application, an IP address of a terminal where the first service application is located, a terminal port identifier corresponding to a process, a start time of the process, an identifier of a connection between a client of the first service application and a message intermediate end, an identifier of a session for sending the JMS message, an identifier of a production end of the JMS message, N pieces of sub information in the identifiers of the JMS message, and a type identifier of the IP address, N is a positive integer greater than or equal to 2; on the basis of the type identifier, encoding the communication related information according to the encoding format corresponding to the type of the IP address to obtain an encoding result, including: acquiring N pieces of sub information and generating type identification of the IP address, wherein the N pieces of sub information and the type information of the IP address are in a binary format; converting the N pieces of sub information into N pieces of sub information with preset bit length; carrying out left shift with different preset lengths on the N pieces of sub information with preset bit length and the type identification of the IP address to obtain left shift results of the N pieces of sub information and the type identification of the IP address; and performing OR operation on the left shift result to obtain a coding result.
With this example, the information can be placed in order in the identifier field of the JMS message, thereby ensuring that the JMS message identifier field is locally ordered.
In a second aspect, a method for processing an identifier field of a JMS message includes: acquiring an identifier field of communication related information carrying JMS information, wherein the JMS information is generated in a process of sending the JMS information from a first service application to a second service application; extracting communication-related information from the identifier field, wherein the communication-related information includes at least one of: the related identification of the first service application, the related identification of the process and the related identification of the JMS message.
According to the method for processing the identifier field of the JMS message in the embodiment of the present invention, the identifier field of the JMS message may carry communication related information of the JMS message, and the communication related information may include a related identifier of the first service application, a related identifier of the process, a related identifier of the JMS message, and other messages. The information such as the production end, the production process, the JMS message and the like of the JMS message can be traced according to the information such as the related identification of the first service application, the related identification of the process, the related identification of the JMS message and the like, so that the traceability of the JMS message is improved.
In an alternative embodiment, if the format of the identifier field of the JMS message is a string format, extracting the communication related information from the identifier field includes: performing a first decoding operation on an identifier field of the JMS message to convert a format of the JMS message into an IP format; communication-related information is extracted from an identifier field of the JMS message in IP format.
By the method and the device, the communication related information can be accurately analyzed by combining the characteristics of the identifier field of the JMS message.
In an alternative embodiment, if the identifier field of the JMS message includes the identifier of the identifier field and the encoding result in the form of a character string; performing a first decoding operation on the identifier field of the JMS message includes: removing the identifier of the identifier field from the identifier field to obtain a removal result; and executing a first decoding operation on the culling result.
By the method, useless information can be eliminated, and communication related information can be accurately extracted.
In an alternative embodiment, if the IP formats include IPv4 format and IPv6 format, extracting the communication-related information from the identifier field of the JMS message of the IP includes: if the IP format is the IPv4 format, decoding the JMS message in the predefined format in the IPv4 format; if the IP format is the IPv6 format, decoding in the IPv6 format is performed on the JMS message in the predefined format.
In this example, decoding can be performed according to a specific format and an encoding mode of an information sending end, and accuracy of decoding is guaranteed.
In an optional implementation manner, if the communication related information includes a related identifier of the JMS message, and the related identifier of the JMS message includes an identifier of the JMS message, the method further includes: judging whether other information except the identification of the JMS message in the communication related information of the JMS message is the same as other information except the identification of the JMS message in the communication related information of other JMS messages; if the JMS messages are the same, judging whether the identification of the JMS messages in the JMS messages is larger than the maximum identification of the pre-stored JMS messages; if so, determining that the JMS message is a non-repeated message, and updating the identifier of the JMS message in the JMS message to the maximum identifier of the pre-stored JMS message; and if the JMS message is less than or equal to the repetition message, determining the JMS message as the repetition message.
By the aid of the method and the device, whether the information is repeated can be judged according to the related communication information, so that the JMS message has the characteristic of auditability, and the JMS message can be locally deduplicated. For example, the method can be applied to the specific scene of tracking and auditing of order flow in the service support system of a telecom operator.
In a third aspect, an apparatus for an identifier field of a JMS message is provided, including: the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring communication related information of the JMS message in a process that a first service application sends the JMS message to a second service application; the field generating module is used for generating an identifier field carrying communication related information; wherein the communication-related information comprises at least one of: the correlation identification of the first service application, the correlation identification of the process and the correlation identification of the JMS message.
In a fourth aspect, an apparatus for an identifier field of a JMS message is provided, including: a field acquisition module, configured to acquire an identifier field of communication related information carrying JMS information, where the JMS information is generated in a process in which a first service application sends the JMS information to a second service application; an information extraction module to extract communication-related information from the identifier field, wherein the communication-related information includes at least one of: the correlation identification of the first service application, the correlation identification of the process and the correlation identification of the JMS message.
In a fifth aspect, there is provided a device for processing an identifier field of a JMS message, including: a memory for storing a program; a processor, configured to run a program stored in the memory, to perform the method for processing the identifier field of the JMS message provided in the first aspect or any optional implementation of the first aspect, or to perform the method for processing the identifier field of the JMS message provided in the second aspect or any optional implementation of the second aspect.
A sixth aspect provides a computer storage medium having stored thereon computer program instructions which, when executed by a processor, implement the method for processing the identifier field of the JMS message provided in the first aspect or any of the alternative embodiments of the first aspect, or implement the method for processing the identifier field of the JMS message provided in the second aspect or any of the alternative embodiments of the second aspect.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the embodiments of the present invention will be briefly described below, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a logic flow diagram of a JMS message generation process and a JMS message transmission process according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a method for processing an identifier field of a JMS message according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an exemplary encoding result in IPv4 format according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an exemplary encoding result in IPv6 format according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart of a method for processing an identifier field of a JMS message according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a processing apparatus for processing an identifier field of a JMS message according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a processing apparatus for processing an identifier field of a JMS message according to an embodiment of the present invention;
fig. 8 is a block diagram of an exemplary hardware architecture of a processing device for an identifier field of a JMS message according to an embodiment of the present invention.
Detailed Description
Features of various aspects and exemplary embodiments of the present invention will be described in detail below, and in order to make objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail below with reference to the accompanying drawings and the embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It will be apparent to one skilled in the art that the present invention may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present invention by illustrating examples of the present invention.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The embodiment of the invention provides a method for processing an identifier field of a JMS message, which can be applied to a specific scene for transmitting the JMS message by two service applications.
Fig. 1 is a logic flow diagram of a generation process and a transmission process of a JMS message according to an embodiment of the present invention.
First, a description of the business application, client, JMS message service component, and message middleware is as follows.
The first service application and the second service application both represent a class of service applications, and the first service application and the second service application perform data exchange with a message system consisting of a message production end, a message intermediate end and a message receiving end by running a JMS program through a client.
And the client can run a Java process of the JMS program. Wherein the JMS program represents a JAVA program written using a JMS message service component to interact with the messaging system. In particular, the client can invoke the JMS program through the JMS application program interface of the JMS message service component.
And the message middle end can be implemented as message middle ware. The function of the message intermediate end can be realized by the server end of the message system, and the message intermediate end receives the message sent by the message production end and distributes the message to the message receiving end.
Next, the relationship among connection, session, message producer, message receiver, JMS message, and destination will be described below.
Where a connection represents a physical network connection between the client and the message broker, the connection being created by the client program. A session represents a single threaded context for sending and receiving JMS messages. Sessions may be created on a connected basis. The message producer is used to send the JMS message to the destination, created on the basis of the session. The message receiver is for receiving a message from the destination, as determined by the session. The destination represents a logical address that can send and receive JMS messages. The JMS message carries the service data, which is the object created by the session.
Finally, the overall logic flow for generating and transmitting the JMS message is described in detail below.
As shown in fig. 1, when a first service application needs to send JMS information to a second service application, the first service application may create a process for sending JMS messages on a client where the first service application is located. After the process is created, the client can create a connection between the client and the message broker by calling the JMS message service component. On the basis of the connection, a session between the client and the message intermediate is created. And on the basis of the conversation, creating a JMS message, and creating a message production end and a message receiving end of the JMS message. After the JMS message is created, the producer of the JMS message may send the JMS message to the message middle, and then the message middle sends the JMS message to the message receiver. In the embodiment of the present invention, the message producer of the JMS message may be considered as the first service application or the client where the first service application is located. The message receiver of the JMS message may be considered a second service application.
In order to better understand the technical solution of the embodiment of the present invention, a method, an apparatus, a device, and a medium for processing an identifier field of a JMS message according to the embodiment of the present invention will be described in detail below with reference to the accompanying drawings.
Fig. 2 is a schematic flowchart of a method for processing an identifier field of a JMS message according to an embodiment of the present invention. The execution main body of each step of the embodiment of the present invention may be a message sending end shown in fig. 1. As shown in fig. 2, the method 200 for processing the identifier field of the JMS message in the present embodiment may include the following steps S210 to S220.
S210, in the process that the first service application sends the JMS message to the second service application, the communication related information of the JMS message is obtained.
First, the communication-related information of the JMS message is explained as follows. The JMS message is used. . . The communication-related information includes at least one of: the related identification of the first service application, the related identification of the process and the related identification of the JMS message.
Specifically, for the relevant identifier of the first service application, the relevant identifier of the first service application is used to reflect various types of information of the first service application. For example, the relevant identification of the first service application comprises at least one of sub-information a-sub-information C.
The sub information a, the identity of the first service application, it is used to mark different service applications, set by the user according to the service application. 15 bits, and can represent 32767 service applications at maximum.
Sub information B, an Internet Protocol Address (IP) Address of a terminal where the first service application is located. The IP address is uniformly assigned by an international organization nic (network Information center). The length of the Internet Protocol version four (IPv 4) address is 32 bits (bit), and the length of the Internet Protocol version six (IPv 6) address is 128 bits.
The sub information C, the type identification of the IP address of the terminal where the first service application is located. It is used to distinguish IP address types. Since the IP address can be divided into an IPv4 address and an IPv6 address, the type identifier of the IP address may include a first type identifier for indicating an IPv4 address and a second type identifier for indicating an IPv6 address.
For the correlation identification of the process, for example, the correlation identification of the process includes at least one of the sub information D-the sub information G.
And the sub information D and the terminal port identification corresponding to the process are used for identifying different ports on the same terminal. Each service process on the terminal corresponds to a port, and after the process that the first service application sends the JMS message to the second service application is established, an unoccupied port can be selected from the terminal.
Sub information E, start time of the process. In particular, a UNIX timestamp representation may be employed. The starting moment of the process can be accurate to milliseconds.
The sub information F, the identity of the connection between the client of the first service application and the message intermediate. Illustratively, the connection identification may be an incremental value starting from 1, within the same JMS client process.
Sub information G, identification of a session for sending the JMS message. The identification of sessions is used to mark different sessions that correspond to the same connection. The session created by the same connection within the same JMS client process may have an identification of an incremental value starting from 1.
And aiming at the related identification of the JMS message, the related identification of the JMS message is used. . . The associated identification of the JMS message includes sub information H and/or sub information I.
The identity of the message producer of the sub-information H, JMS message is used to mark different message producers created by the same session. The identity of the message producer created by the same session within the same JMS client process may be an incremental value starting from 1.
The identity of the sub-information I, JMS message is used to mark different JMS messages created by the same session. The identification of the JMS message for the same session may be an incremental value starting from 1.
It should be noted that, in order to improve the traceability of the communication related message, the communication related message may also carry messages such as a message intermediate end and a message receiving end according to a specific working scenario and a working requirement, which is not limited herein.
S220, an Identifier (ID) field carrying the communication-related information is generated.
According to the method for processing the identifier field of the JMS message in the embodiment of the invention, the identifier field of the JMS message can carry the communication related information of the JMS message, and the communication related information can comprise the related identification of the first service application, the related identification of the process, the related identification of the JMS message and other messages. The information such as the production end, the production process, the JMS message and the like of the JMS message can be traced according to the information such as the related identification of the first service application, the related identification of the process, the related identification of the JMS message and the like, so that the traceability of the JMS message is improved.
In some embodiments, if the JMS message includes the relevant identifier of the first service application, and the relevant identifier of the first service application includes the type identifier of the IP address of the terminal where the first service application is located, the JMS message may be first encoded according to the type of the IP address, then encoded for the second time by using a predetermined encoding format, and then the identifier field is generated based on the second encoding result.
A specific embodiment of S220 may include three steps, which are a first step to a third step.
The first step, on the basis of the type identification, coding the communication related information according to the coding format corresponding to the type of the IP address to obtain the coding result of the IP format.
First, regarding the encoding format in S221, if the type identifier indicates that the type of the IP address is an IPv4 address, the encoding format corresponding to the IPv4 address is an IPv4 format. If the type identifier indicates that the type of the IP address is an IPv6 address, the encoding format corresponding to the IPv6 address is an IPv6 format. Illustratively, the length of the encoding result in IPv4 format and the encoding result in IPv6 format may be different.
As an example, taking the communication-related information including the sub information a-sub signal I, and taking the encoding result in the IP format as a binary string as an example, fig. 3 is a schematic structural diagram of an exemplary encoding result in the IPv4 format provided in the embodiment of the present invention. As shown in fig. 3, the length of the encoding result in the IP format may be 192 bits.
The length of the identifier AppID of the first service application may be 15 bits, that is, the identifier of the first service application may represent 32767 services at most.
The type identifier IPType of the IP address occupies 1 bit. Illustratively, an IPv4 address may be represented by 0 and an IPv6 address may be represented by 1. That is, the value 0 of the type identifier of the IP address in the encoding result in the IPv4 format.
The length of the IP address IPv4 of the terminal where the first service application is located is 32 bits.
The Port identification Port takes 16 bits and can represent 65535 ports at the most.
The length of the start Time of the process is 48 bits, and if the start Time of the process is accurate to the millisecond value, the maximum start Time of the process can be represented by the argument 10889.
The connection identification ConnID is 48 bits long. The identification of a connection, ConnID, may represent 65535 different connections at the most.
The session identifier SessionID is 8 bits long. That is, the identification SessionID of a session may represent up to 255 different sessions of the same connection.
The message producer id has a length of 8 bits and can represent up to 255 different message producers created by the same session.
The identification MsgID of a JMS message is 48 bits in length and can represent a number of messages on the order of billions at most.
As another example, taking the communication-related information including the sub information a-sub signal I, the encoding result in IP format is a binary string as an example, fig. 4 is a schematic structural diagram of an exemplary encoding result in IPv6 format according to an embodiment of the present invention. As shown in fig. 4, the length of the encoding result in the IP format may be 288 bits.
As can be seen from comparison between fig. 4 and fig. 3, the encoding result in IPv6 format is substantially the same as the encoding result in IPv4 format, and the difference between the two formats is that the IP address IPv6 has a length of 128 bits.
Next, in some embodiments, if the communication-related information includes N pieces of the sub information a-I in addition to the sub information C, N is a positive integer greater than or equal to 2.
The first step may specifically comprise: firstly, N pieces of sub information are obtained, and type identification of the IP address is generated, wherein the N pieces of sub information and the type information of the IP address are in a binary format. Secondly, the N pieces of sub information are converted into N pieces of sub information of a preset bit length. And performing left shift with different preset lengths on the N pieces of sub information with the preset bit length and the type identifier of the IP address to obtain a left shift result of the N pieces of sub information and the type identifier of the IP address. And finally, performing OR operation on the left shift result to obtain a coding result.
In order to facilitate understanding of the specific implementation of the first step, the encoding method in IPv4 format and the encoding method in IPv6 format are exemplarily described below with reference to fig. 3 and fig. 4, respectively.
As an example, with continued reference to fig. 3, since the encoding result in IPv4 format may be a binary string consisting of 192 binary digits, that is, the encoding result in IPv4 format has a length of 192 bits (1 byte ═ 8 bits, i.e. 24 bytes). For convenience of calculation, the eight bytes are respectively encoded firstly, and finally, an encoding result in an IPv4 format is generated on the basis of the encoding results of three eight bytes. Specifically, the binary string may be divided into upper octets, middle octets and lower octets in the order from front to back.
With continued reference to fig. 1, the high octet H1 may be an encoding of four pieces of sub information, i.e., an identifier AppID (15bit) of the first service application, an IP address (32bit) of the terminal where the first service application is located, a type identifier (1bit) of the IP address of the terminal where the first service application is located, and a terminal port identifier corresponding to the process. Specifically, the calculation steps of the high octet H1 include the following (1) to (7).
(1) And the identification AppID of the first service application is shifted to the left by one bit, and the 0xFFFE is subjected to AND operation, and the operation result is shifted to the left by 48 bits. Wherein, left shifting the AppID by one bit means that after all binary bits of the AppID are left shifted by one bit, the last bit is padded to 0. 0x represents a number with FFFE of 16. One 16-digit number corresponds to 4 binary digits, that is, FFFE corresponds to 1111111111111110 (length 16 bit). Specifically, the and operation is performed on the AppID and 0 xffffe (corresponding to binary 111111111111110), the last bit of the and operation result is constantly 0, and the last bit of the and operation result can represent the type identifier of the IP address of the IPv4 address. Meanwhile, the length of the and operation result can be limited to the preset 16 bits by and-operating the AppID with 0xFFFE of 16bit length. In addition, the operation result is shifted to the left by 48 bits, so that the first 16 bits of the high octet H1 can be ensured not to influence the operation result of the later 48 bits, and the effect of splicing all information can be realized.
(2) The first part of the IP address (the first 8 bits of the IP address in binary form) is converted into an integer and 0xFF for AND operation, and the operation result is shifted to the left by 40 bits. And operation is carried out through the sum of 0xFF, and the length of the first part of the IP address can be ensured to be preset 8 bits.
(3) And the second part of the IP address (9 th to 16 th bits of the IP address in binary form) is converted into an integer and 0xFF to carry out AND operation, and the operation result is shifted to the left by 32 bits. And operation is carried out by the sum of the first part and the second part of the IP address 0xFF, and the length of the second part of the IP address can be ensured to be preset 8 bits.
(4) And the third part of the IP address (the 17 th to 24 th bits of the IP address in the binary form) is converted into an integer and 0xFF to carry out AND operation, and the operation result is shifted to the left by 24 bits. And operation is carried out through the sum of 0xFF, and the length of the third part of the IP address can be guaranteed to be 8 bits.
(5) And the fourth part of the IP address (25 th to 32 th bits of the IP address in binary form) is converted into an integer and 0xFF to carry out AND operation, and the operation result is shifted to the left by 16 bits.
(6) And the terminal Port identification Port and 0xFFFF perform AND operation. And operation is carried out on the terminal Port identifier and 0xFFFF, and the length of the terminal Port identifier Port can be ensured to reach the preset 16 bit.
(7) And (4) performing OR operation on the operation results of the (1) to (6), wherein the operation result is the value of H1. Specifically, on the basis of performing the or operation again on the operation results from (1) to (6), the 16 bits representing the identifier of the first service application and the type identifier of the IP address of the terminal to which the first service application is located are shifted to the left by 48 bits, so that the 1 st to 16 th bits of the upper eight bytes can represent the identifier of the first service application and the IP address of the terminal to which the first service application is located. The IP address of the terminal where the first service application is positioned can be represented by the 17 th to 48 th bits which are eight bytes higher by shifting the 8bit which represents the first part of the IP address to the left by 40 bits, shifting the 8bit which represents the second part of the IP address to the left by 32 bits, shifting the 8bit which represents the third part of the IP address to the left by 24 bits and shifting the 8bit which represents the fourth part of the IP address to the left by 16 bits. The 8bit of the terminal Port identification Port is not moved, and the last 8 bits of the high eight bytes are used for representing the terminal Port identification Port.
With continued reference to fig. 3, the medium octet M may be an encoding of the start Time of the process Time (48 bits), the identification of the connection ConnID (16 bits). Specifically, the calculation steps of the high octet H1 include the following (1) to (3).
(1) And the starting Time of the process is equal to 0xFFFFFFFFFF, and the operation result is shifted to the left by 16 bits. And operation is carried out on the starting time and 0xFFFFFFFFFF, so that the length of the starting time of the process can be ensured to be 48 bits.
(2) And the connected identifiers ConnID and 0 xFFFF. By performing and operation with 0xFFFF, the length of the connected identifier ConnID can be guaranteed to reach a preset 16 bit.
(3) And performing OR operation on the operation results of the (1) and the (2), wherein the operation result is the value of the medium eight bytes M. Specifically, on the basis of performing the or operation again on the operation results of (1) and (2), all 48 bits of the start Time of the process are shifted to the left by 16 bits, so that the 1 st to 48 th bits of the medium octet can be used to represent the start Time of the process. The 16 bits of the connection identity ConnID are not moved and the last 16 bits of the octet M are used to represent the connection identity ConnID.
With continued reference to fig. 3, the lower octet L may be the encoding of the session identification SessionID (8bit), the message producer id (8bit), and the JMS message identification MsgID (48 bit). Specifically, the calculation steps of the lower octet L include the following (1) to (4).
(1) And the session identifier SessionID and 0xFF are anded, and the result is shifted to the left by 56 bits. And operation is carried out on the session identifier and 0xFF, so that the length of the session identifier sessionID can reach a preset 8 bit.
(2) And the identifier ProducerID of the message production end and 0xFF are subjected to AND operation, and the operation result is shifted to the left by 48 bits. And operation is carried out on the message producer ID and 0xFF, so that the length of the producer ID of the message producer can reach the preset 8 bits.
(3) And the identifier MsgID of the JMS message and 0 xFFFFFFFFFFFFFF are subjected to AND operation. And operation is carried out on the JMS message and 0xFFFFFFFFFF, so that the length of the MsgID of the JMS message can reach 48 bits.
(4) And (4) performing OR operation on the operation results from the steps (1) to (3), wherein the operation result is the value of the low eight bytes L. Specifically, on the basis of the or operation of the operation results of (1) and (2), all 8 bits of the session identifier SessionID are shifted to the left by 56 bits, so that the 1 st to 8 th bits of the eight bytes in the sequence can be used to represent the session identifier SessionID. All 8 bits of the producer id of the message are shifted to the left by 48 bits, so that the 9 th to 16 th bits of the eight bytes in the message can be used to represent the producer id of the message. The 48 bits of the JMS message's identification MsgID are not moved, and the last 48 bits of the lower octet L are used to represent the JMS message's identification MsgID.
After the high octet H1, the medium octet M and the low octet L are calculated, the three can be directly subjected to OR operation to obtain an encoding result in an IPv4 format.
As another example, with continued reference to fig. 4, since the encoding result in IPv6 format may be a binary string consisting of 288 binary digits, that is, the encoding result in IPv6 format has a length of 288 bits (36 characters). For the convenience of calculation, the encoding result in the IPv6 format may be generated on the basis of the encoding result of the small parts. Specifically, the binary string may be first divided into twenty high bytes H2, eight medium bytes M, and eight low bytes L in front-to-back order. As can be seen from fig. 3 and 4, the medium octet M and the low octet L in the IPv4 format and the IPv6 format are the same. Therefore, the following parts will not be described again for the encoding steps of the middle octet M and the lower octet L, and the following parts mainly describe the encoding steps of the upper twenty octets H2 in detail. Specifically, the method comprises the following steps:
for the twenty-high byte H2, it can be divided into four-high byte H21, twenty-high byte H22 and twenty-high byte H23 in front-to-back order.
The upper four bytes H21 may be codes of a first part (first 16 bits) of an identifier AppID (15 bits) of the first service application, a type identifier (1bit) of an IP address of a terminal where the first service application is located, and an IP address (128 bits in total) of the terminal where the first service application is located. Specifically, the calculation steps of the upper nibble H21 include the following (1) to (3).
(1) And the identification AppID of the first service application is shifted to the left by one bit, and 0x01 is subjected to OR operation, and the operation result is shifted to the left by 16 bits. 0x01 corresponds to 00000001. And after the identifier AppID of the first service application is shifted to the left by one bit, carrying out OR operation on the identifier AppID and 0x01, so that the length of a calculation result can be ensured to be 16 bits preset, and the last 1bit is constant to be 1. That is, through the above operation, the bits 1 to 15 of the upper four bytes H21 can be made to represent the identification AppID of the first service application, and the last bit 1 can be made to represent the type identification of the IP address of the IPv6 address.
(2) The first part of the IP address is converted into an integer and 0xFFFF is subjected to AND operation. In the embodiment of the invention, the IP address in the IPv6 format can be divided into 8 parts by taking 16 bits as a unit.
(3) And (3) performing OR operation on the operation results from the (1) to (2), wherein the operation result is the value of H21. For specific contents of (2) and (3), reference may be made to the description of the encoding process in the IPv4 format in the foregoing embodiment, and details are not described herein again.
The high octet H22 may be the encoding of the second to fifth part of the IP address (bits 17-80 of the IP address) of the terminal where the first service application is located. Specifically, the calculation steps of the high octet H22 include the following (1) to (5).
(1) And the second part (bit 17-32) of the IP address is converted into an integer and 0xFFFF to be subjected to AND operation, and the operation result is shifted to the left by 48 bits.
(2) And the third part (33 th to 48 th bits) of the IP address is converted into an integer and 0xFFFF to be subjected to AND operation, and the operation result is shifted to the left by 32 bits.
(3) And the fourth part (49 th to 64 th bits) of the IP address is converted into an integer and 0xFFFF to carry out AND operation, and the operation result is shifted to the left by 16 bits.
(4) The fifth part of the IP address (bits 67-80) is converted to an integer and 0xFFFF for ANDing.
(5) And (4) performing OR operation on the operation results of the steps (1) to (4), wherein the operation result is the value of H22. For specific contents of (1) and (5), reference may be made to the description of the encoding process in the IPv4 format in the foregoing embodiment, and details are not repeated here.
The high octet H23 may be the encoding of the sixth to eighth part of the IP address (bits 81-128 of the IP address) and the terminal Port identification Port for the terminal to which the first service is applied. Specifically, the calculation steps of the high octet H23 include the following (1) to (3).
(1) And the sixth part of the IP address (the 81 st to 96 th bits of the IP address) is converted into an integer and 0xFFFF, and the operation result is shifted to the left by 48 bits.
(2) And the seventh part of the IP address (bits 97-112 of the IP address) is converted into an integer and 0xFFFF to be subjected to AND operation, and the operation result is shifted to the left by 32 bits.
(3) And the eighth part of the IP address (the 113 st and 128 th bits of the IP address) is converted into an integer and 0xFFFF to be subjected to AND operation, and the operation result is shifted to the left by 16 bits.
(4) Port and 0xFFFF are ANDed.
(5) And (5) performing OR operation on the operation results of the (1) to (4), wherein the operation result is the value of H3. For specific contents of (1) to (3), reference may be made to the description of the encoding process in the IPv4 format in the above embodiment, and details are not repeated here.
Finally, since the encoding formats corresponding to the IP address types are different, before performing the first step, S220 may further include: and judging the IP address type according to the IP address of the server terminal where the first service application is positioned. And if the judgment result is that the IP address is the IPv4 address, selecting the IPv4 format for coding, and if the judgment result is that the IP address is the IPv6 address, selecting the IPv6 format for coding.
And secondly, coding the coding result in the IP format according to a predefined coding format so as to convert the coding result into a predefined character string format and obtain the coding result in the character string format. In one embodiment, the predefined string format may be a printable string format, and the predefined encoding format may be an encoding format of a printable string. For example, if the printable string is an ASCII string, the predefined encoding format may be a BASE64 encoding format. The encoding result may be compiled into an American Standard Code for Information Interchange (ASCII) string of a predetermined length. For example 64 ASCII characters.
And a third step of generating an identifier field of the JMS message based on the encoding result of the character string format. In one embodiment, the identification of the identifier field may be added before the encoded result in the string format, and the encoded result in the string format with the identification of the identifier field added thereto is written into the identifier field of the JMS message. For example, if the encoding result in the string format can be represented as base64.encode (D), the identifier field is identified as "ID: ", the contents of the JMS identifier field include" ID: + base64.encode (D) ".
Fig. 5 is a schematic flowchart of a method for processing an identifier field of a JMS message according to an embodiment of the present invention. The execution main body of each step of the embodiment of the present invention may be the message intermediate end and/or the message receiving end shown in fig. 1. As shown in fig. 5, the method 500 for processing the identifier field of the JMS message in the present embodiment may include the following steps S210 to S220.
S510, an identifier field of communication related information carrying JMS information is obtained, wherein the JMS information is generated in a process of sending the JMS information from a first service application to a second service application. For specific content of the communication related information, reference may be made to the related description of the above embodiments of the present invention, which is not described again.
S520, extracting communication-related information from the identifier field.
According to the method for processing the identifier field of the JMS message in the embodiment of the present invention, the identifier field of the JMS message may carry communication related information of the JMS message, and the communication related information may include a related identifier of the first service application, a related identifier of the process, a related identifier of the JMS message, and other messages. The information such as the production end, the production process, the JMS message and the like of the JMS message can be traced according to the information such as the related identification of the first service application, the related identification of the process, the related identification of the JMS message and the like, so that the traceability of the JMS message is improved.
In some embodiments, if the format of the identifier field of the JMS message is a string format, S520 may specifically include the first step and the second step.
First, a first decoding operation is performed on an identifier field of the JMS message to convert the format of the JMS message into an IP format. For example, if the encoding result in the IP format is converted to the predefined string format at the message production end, it is also required to convert the encoding result in the IP format from the predefined string format using a decoding operation corresponding to the encoding operation. For example, if the message producer uses the BASE64 encoding algorithm to convert the IP-formatted encoded results into an ASCII string, then in this first step, the ASCII string may also need to be converted into IP-formatted encoded results using the corresponding BASE64 decoding algorithm. For details of the IP format, please refer to the specific description contents of the IP format in conjunction with fig. 3 and fig. 4, which are not repeated herein.
In one embodiment, if the identifier field of the JMS message includes the identifier of the identifier field and the encoded result in the form of a character string, the specific implementation manner of the first step may include: the identifier of the identifier field is removed from the identifier field to obtain a removal result. And then, executing a first decoding operation on the rejection result.
Illustratively, the contents of the JMS identifier field include "ID: + base64.encode (D) ". Then the identifier field needs to be removed first, which is identified as "ID: ", and then performs a first decoding operation on the encoding result base64.encode (D) in the character string format.
And a second step of extracting communication-related information from an identifier field of the JMS message in the IP format. In particular, since the predefined formats include the IPv4 format and the IPv6 format,
the step may specifically include: if the predefined format is the IPv4 format, decoding the JMS message in the predefined format in the IPv4 format; if the predefined format is an IPv6 format, decoding in an IPv6 format is performed on the JMS message in the predefined format. The process of extracting the communication related information from the identifier field of the JMS message in the IP format in this step is a process of encoding the communication related information in the encoding format corresponding to the type of the IP address described with reference to fig. 3 and 4.
As an example, with continuing reference to fig. 3, for the identifier field of the JMS message in IPv4 format, the identifier field may be first split into eight high bytes H1, eight medium bytes M, and eight low bytes L, and then the sub-information of the communication-related information is extracted from the eight high bytes H1, the eight medium bytes M, and the eight low bytes L, respectively.
Specifically, the following operations (1) - (6) may be performed for the upper octet H1.
(1) H1 is shifted to the right by 48 bits and then shifted to the right by 1bit, and the operation result is the value of AppId.
(2) H1 right-shifts the operation result of 40 bits and 0xFF to perform AND operation, and the operation result is the value of the first part (1 st-8 th bits) of the IP address.
(3) H1 right-shifts the 32-bit operation result and 0xFF to perform AND operation, and the operation result is the value of the second part (9 th-16 th bits) of the IP address.
(4) H1 right-shifts the operation result of 24 bits and 0xFF to perform AND operation, and the operation result is the value of the third part (17 th-24 th bits) of the IP address.
(5) And the operation result of H1 right shifting by 16 bits and 0xFF are subjected to AND operation, and the operation result is the value of the fourth part (25 th to 32 th bits) of the IP address.
(6) H1 and 0xFFFF are subjected to AND operation, and the operation result is the value of Port.
Specifically, for the medium octet M, the following operations (1) and (2) are performed.
(1) And the M is subjected to AND operation by shifting the operation result of 16 bits to the right and 0xFFFFFFFFFFFF, and the operation result is the value of the Time.
(2) And M and 0xFFFF are subjected to AND operation, and the operation result is the value of ConnID.
Specifically, for the lower octet L, the following operation is performed.
(1) And the operation result of L right shift by 56 bits and 0xFF are subjected to AND operation, and the operation result is the value of the Session ID.
(2) And the L is subjected to the AND operation with the operation result of shifting the L by 48 bits and 0xFF, and the operation result is the value of ProducerID.
(3) And the L and the 0xFFFFFFFFFF are subjected to AND operation, and the operation result is the value of the MsgID.
As another example, with continued reference to fig. 4, for the identifier field of the JMS message in IPv6 format, the sub-information of the communication-related information may be extracted from the upper four bytes H21, the upper eight bytes H22, the upper eight bytes H23, the middle eight bytes M, and the lower eight bytes L, respectively, and then extracted from the upper four bytes H21, the upper eight bytes H22, the upper eight bytes H23, the middle eight bytes M, and the lower eight bytes L. As can be seen from fig. 3 and 4, the medium octet M and the low octet L in the IPv4 format and the IPv6 format are the same. Therefore, the following parts are not described in detail again for the decoding steps of the medium-octet M and the low-octet L, and the following parts mainly describe the decoding steps of the high-four-byte H21, the high-octet H22 and the high-octet H23 in detail.
Specifically, the following operations (1) and (2) are performed for the upper nibble H21.
(1) H21 is shifted to the right by 16 bits and then shifted to the right by 1bit, and the operation result is the value of AppID.
(2) H21 and 0xFFFF, and the result is the value of the first part (bits 1 to 16) of the IP address.
Specifically, the following operations (1) - (4) are performed for the upper octet H22.
(1) H22 right-shifts the result of the operation by 48 bits and 0xFFFF, and the result is the value of the second part (bits 17 to 32) of the IP address.
(2) H22 right-shifts the 32-bit operation result and 0xFFFF to perform AND operation, and the operation result is the value of the third part (32 th-48 th bits) of the IP address.
(3) And the H22 right-shifts the operation result of 16 bits and 0xFFFF to perform AND operation, wherein the operation result is the value of the fourth part (49-64 bits) of the IP address.
(4) H22 and 0xFFFF, and the operation result is the value of the fifth part (67 th-80 th bit) of the IP address.
Specifically, the following operations (1) - (4) are performed for the upper octet H23.
(1) H23 right-shifts the operation result of 48 bits and 0xFFFF to perform AND operation, and the operation result is the value of the sixth part (81-96 bits of the IP address) of the IP address.
(2) And H23 right-shifts the 32-bit operation result and 0xFFFF to perform AND operation, wherein the operation result is the value of the seventh part (97 th to 112 th bits of the IP address) of the IP address.
(3) H23 right shifts the operation result of 16 bits and 0xFFFF to perform AND operation, and the operation result is the value of the eighth part (113 th and 128 th bits of the IP address) of the IP address.
(4) H23 and 0xFFFF are subjected to AND operation, and the operation result is the value of Port.
In some embodiments, after the communication-related information is acquired through S520, if the communication-related information includes the MsgID of the JMS message, the method 500 for processing the identifier field of the JMS message may further include the following first to fourth steps.
The method comprises the steps of firstly, judging whether other information except the identification of the JMS message in the communication related information of the JMS message to be judged is the same as other information except the identification of the JMS message in the communication related information of other JMS messages. For example, if the communication related message of the JMS message further includes the sub information a-sub information H, it may be determined whether the sub information a-sub information H of the other JMS messages is the same as the sub information a-sub information H of the JMS message to be determined. And if at least one of the sub information A-the sub information H is different, determining that the JMS message to be judged is a non-repeated message, and stopping continuously executing the following steps.
And secondly, if the JMS messages are completely the same, judging whether the identification of the JMS messages in the JMS messages to be judged is larger than the maximum identification of the pre-stored JMS messages.
And step three, if the current identification MsgID is larger than the maximum identification of the JMS message, determining that the JMS message to be judged is a non-repeated message, and updating the identification MsgID of the JMS message in the JMS message to be the maximum identification of the pre-stored JMS message.
And step four, if the JMS message to be judged is less than or equal to the repeat message, determining the JMS message to be judged as the repeat message.
An apparatus according to an embodiment of the present invention will be described in detail below with reference to the accompanying drawings.
Based on the same inventive concept, the embodiment of the invention provides a device for processing the identifier field of the JMS message. Fig. 6 is a schematic structural diagram of a processing apparatus for processing an identifier field of a JMS message according to an embodiment of the present invention. As shown in fig. 6, the processing device 600 for the identifier field of the JMS message includes an acquisition module 610 and a field generation module 620.
The obtaining module 610 is configured to obtain communication related information of a JMS message in a process in which a first service application sends the JMS message to a second service application.
A field generating module 620, configured to generate an identifier field carrying communication related information.
In some embodiments of the invention, the relevant identity of the first service application comprises at least one of: the identification of the first service application, the IP address of the terminal where the first service application is located, and the type identification of the IP address.
In some embodiments of the invention, the relevant identification of the process comprises at least one of: the method comprises the steps of a terminal port identification corresponding to a process, a starting time of the process, an identification of connection between a client of a first service application and a message intermediate end, and an identification of a session for sending a JMS message.
In some embodiments of the invention, the related identification of the JMS message comprises: an identification of a producer of the JMS message, and/or an identification of the JMS message.
In some embodiments of the present invention, if the JMS message includes the identifier associated with the first service application, the identifier associated with the first service application includes a type identifier of an IP address of a server where the first service application is located.
The field generating module 620 is specifically configured to: on the basis of the type identification, coding the communication related information according to the coding format corresponding to the type of the IP address to obtain a coding result of the IP format; coding the coding result in the IP format according to a predefined coding format so as to convert the coding result in the IP format into a predefined character string format and obtain a coding result in the character string format; an identifier field of the JMS message is generated based on the encoding result of the character string format.
If the type identifier indicates that the type of the IP address is an IPv4 address, the encoding format corresponding to the IPv4 address is an IPv4 format, and if the type identifier indicates that the type of the IP address is an IPv6 address, the encoding format corresponding to the IPv6 address is an IPv6 format.
In some embodiments, if the communication related information includes an identifier of the first service application, an IP address of a terminal where the first service application is located, a terminal port identifier corresponding to the process, a start time of the process, an identifier of a connection between the client of the first service application and the message intermediate end, an identifier of a session for sending the JMS message, an identifier of a production end of the JMS message, N pieces of sub information in the identifiers of the JMS message, and a type identifier of the IP address, N is a positive integer greater than or equal to 2.
The field generating module 620 is specifically configured to: acquiring N pieces of sub information and generating type identification of the IP address, wherein the N pieces of sub information and the type information of the IP address are in binary format; converting the N pieces of sub information into N pieces of sub information with preset bit length; carrying out left shift with different preset lengths on the N pieces of sub information with preset bit length and the type identification of the IP address to obtain left shift results of the N pieces of sub information and the type identification of the IP address; and performing OR operation on the left shift result to obtain a coding result.
Other details of the processing apparatus for the identifier field of the JMS message according to the embodiment of the present invention are similar to the methods according to the embodiments of the present invention described above with reference to fig. 1 to 5, and are not repeated herein.
Based on the same inventive concept, the embodiment of the invention provides a device for processing the identifier field of the JMS message. Fig. 7 is a schematic structural diagram of a processing apparatus for processing an identifier field of a JMS message according to an embodiment of the present invention. As shown in fig. 7, the processing device 700 of the identifier field of the JMS message includes a field acquisition module 710 and an information extraction module 720.
A field obtaining module 710, configured to obtain an identifier field of communication related information carrying JMS information, where the JMS information is generated in a process in which a first service application sends the JMS information to a second service application.
An information extraction module 720 for extracting communication-related information from the identifier field.
In some embodiments of the present invention, if the format of the identifier field of the JMS message is a string format, the field obtaining module 710 is specifically configured to: performing a first decoding operation on an identifier field of the JMS message to convert a format of the JMS message into an IP format; communication-related information is extracted from an identifier field of the JMS message in IP format.
In some embodiments, if the identifier field of the JMS message includes an identifier of the identifier field and an encoding result in a string format, the field obtaining module 710 is specifically configured to: removing the identifier of the identifier field from the identifier field to obtain a removal result; and executing a first decoding operation on the culling result.
In some embodiments, if the IP formats include IPv4 format and IPv6 format, the field obtaining module 710 is specifically configured to: if the IP format is the IPv4 format, decoding the JMS message in the predefined format in the IPv4 format; if the IP format is the IPv6 format, decoding in the IPv6 format is performed on the JMS message in the predefined format.
In some embodiments of the present invention, if the communication related information includes a related identifier of a JMS message, and the related identifier of the JMS message includes an identifier of the JMS message, the processing device 700 for the identifier field of the JMS message further includes a determining module.
And the judging module is used for judging whether other information except the identification of the JMS information in the communication related information of the JMS information is the same as other information except the identification of the JMS information in the communication related information of other JMS information.
And the judging module is also used for judging whether the identification of the JMS message in the JMS message is larger than the maximum identification of the pre-stored JMS message if the JMS message is the same as the JMS message.
And the judging module is also used for determining that the JMS message is a non-repeated message if the JMS message is larger than the maximum JMS message, and updating the identifier of the JMS message in the JMS message into the maximum identifier of the pre-stored JMS message.
And the judging module is also used for determining that the JMS message is a repeated message if the JMS message is less than or equal to the repetition threshold.
Other details of the processing device for the identifier field of the JMS message according to the embodiment of the present invention are similar to the method according to the embodiment of the present invention described above with reference to fig. 1 to 5, and are not repeated herein.
Fig. 8 is a block diagram of an exemplary hardware architecture of a processing device for an identifier field of a JMS message according to an embodiment of the present invention.
As shown in fig. 8, the processing device 800 of the identifier field of the JMS message includes an input device 801, an input interface 802, a central processor 803, a memory 804, an output interface 805, and an output device 806. The input interface 802, the central processing unit 803, the memory 804 and the output interface 805 are connected to each other through a bus 810, and the input device 801 and the output device 806 are connected to the bus 810 through the input interface 802 and the output interface 805, respectively, and further connected to other components of the processing device 800 of the identifier field of the JMS message.
Specifically, the input device 801 receives input information from the outside, and transmits the input information to the central processor 803 through the input interface 802; the central processor 803 processes input information based on computer-executable instructions stored in the memory 804 to generate output information, temporarily or permanently stores the output information in the memory 804, and then transmits the output information to the output device 806 via the output interface 805; the output device 806 outputs the output information to the outside of the processing device 800 of the identifier field of the JMS message for use by the user.
That is, the processing device of the identifier field of the JMS message shown in fig. 8 may also be implemented to include: a memory storing computer-executable instructions; and a processor which, when executing computer executable instructions, may implement the method and apparatus of a processing device for the identifier field of a JMS message described in connection with fig. 1-2.
In one embodiment, the processing device 800 of the identifier field of the JMS message shown in fig. 8 may be implemented as a device that may include: a memory for storing a program; and a processor for executing the program stored in the memory to perform the method for processing the identifier field of the JMS message according to the embodiment of the present invention.
The embodiment of the invention also provides a computer storage medium, wherein computer program instructions are stored on the computer storage medium, and when being executed by a processor, the computer program instructions realize the method for processing the identifier field of the JMS message.
It is to be understood that the invention is not limited to the specific arrangements and instrumentality described above and shown in the drawings. A detailed description of known methods is omitted herein for the sake of brevity. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present invention are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications and additions or change the order between the steps after comprehending the spirit of the present invention.
The functional blocks shown in the above structural block diagrams may be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, or the like. When implemented in software, the elements of the invention are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include electronic circuits, semiconductor memory devices, ROM, flash memory, Erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, Radio Frequency (RF) links, and so forth. The code segments may be downloaded via computer networks such as the internet, intranet, etc.
As will be apparent to those skilled in the art, for convenience and brevity of description, the specific working processes of the systems, modules and units described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.

Claims (13)

1. A method for processing an identifier field of a JMS message, which is applied to a production end of the JMS message, and comprises the following steps:
in a process that a first service application sends the JMS message to a second service application, acquiring communication related information of the JMS message;
generating the identifier field carrying the communication related information;
wherein the communication-related information includes at least two of: the correlation identification of the first service application, the correlation identification of the process and the correlation identification of the JMS message.
2. The method of claim 1, wherein if the JMS message includes the identifier associated with the first service application, and the identifier associated with the first service application includes a type identifier of an IP address of a server where the first service application is located;
the generating the identifier field carrying the communication related information includes:
on the basis of the type identification, coding the communication related information according to a coding format corresponding to the type of the IP address to obtain a coding result of the IP format;
coding the coding result of the IP format according to a predefined coding format so as to convert the coding result of the IP format into a predefined character string format to obtain a coding result of the character string format;
generating an identifier field of the JMS message based on the encoding result of the character string format;
wherein if the type identifier indicates that the type of the IP address is an IPv4 address, the encoding format corresponding to the IPv4 address is an IPv4 format,
if the type identifier indicates that the type of the IP address is an IPv6 address, the encoding format corresponding to the IPv6 address is an IPv6 format.
3. The method of claim 1,
the related identification of the first service application comprises at least one of: the identification of the first service application, the IP address of the terminal where the first service application is located and the type identification of the IP address;
the relevant identification of the process includes at least one of: a terminal port identifier corresponding to the process, a starting time of the process, an identifier of a connection between a client of the first service application and a message intermediate terminal, and an identifier of a session for sending the JMS message;
the related identification of the JMS message comprises: an identifier of a producer of the JMS message, and/or an identifier of the JMS message.
4. The method according to claim 2, wherein if the communication related information includes an identifier of the first service application, an IP address of a terminal where the first service application is located, a terminal port identifier corresponding to the process, a start time of the process, an identifier of a connection between a client of the first service application and a message intermediate terminal, an identifier of a session for sending the JMS message, N pieces of sub information in an identifier of a producer of the JMS message and an identifier of the JMS message, and a type identifier of the IP address, where N is a positive integer greater than or equal to 2;
then, on the basis of the type identifier, encoding the communication related information according to the encoding format corresponding to the type of the IP address to obtain an encoding result, including:
acquiring the N pieces of sub information and generating a type identifier of the IP address, wherein the N pieces of sub information and the type information of the IP address are in a binary format;
converting the N pieces of sub information into the N pieces of sub information with preset bit lengths;
carrying out left shift with different preset lengths on the N pieces of sub information with preset bit lengths and the type identification of the IP address to obtain left shift results of the N pieces of sub information and the type identification of the IP address;
and carrying out OR operation on the left shift result to obtain the coding result.
5. A method for processing an identifier field of a JMS message, wherein the method is applied to a message middle end of the JMS message and/or a message receiving end of the JMS message, and the method comprises the following steps:
acquiring the identifier field of communication related information carrying the JMS information, wherein the JMS information is generated in a process of sending the JMS information from a first service application to a second service application;
extracting the communication-related information from the identifier field,
wherein the communication-related information includes at least two of: the correlation identification of the first service application, the correlation identification of the process and the correlation identification of the JMS message.
6. The method of claim 5, wherein if the format of the identifier field of the JMS message is a string format,
extracting the communication-related information from the identifier field, including:
performing a first decoding operation on an identifier field of the JMS message to convert a format of the JMS message into an IP format;
extracting the communication-related information from an identifier field of the JMS message in the IP format.
7. The method according to claim 6, wherein if the identifier field of the JMS message comprises the identification of the identifier field and the encoding result in the string format;
the performing a first decoding operation on the identifier field of the JMS message comprises:
removing the identifier of the identifier field from the identifier field to obtain a removal result;
and executing a first decoding operation on the elimination result.
8. The method of claim 6, wherein if the IP formats include IPv4 format and IPv6 format,
the extracting the communication-related information from the identifier field of the JMS message of the IP includes:
if the IP format is an IPv4 format, decoding the JMS message in a predefined format in an IPv4 format;
if the IP format is an IPv6 format, performing decoding in an IPv6 format on the JMS message in the predefined format.
9. The method of claim 5, wherein if the communication-related information comprises the JMS message-related identifier and the JMS message-related identifier comprises the JMS message identifier, the method further comprises:
judging whether other information except the identification of the JMS message in the communication related information of the JMS message is the same as other information except the identification of the JMS message in the communication related information of other JMS messages;
if the JMS message is the same as the JMS message, judging whether the identifier of the JMS message in the JMS message is larger than the pre-stored maximum identifier of the JMS message;
if so, determining that the JMS message is a non-repeated message, and updating the identifier of the JMS message in the JMS message to the pre-stored maximum identifier of the JMS message;
and if the JMS message is smaller than or equal to the preset message, determining that the JMS message is a repeated message.
10. An apparatus for processing an identifier field of a JMS message, the apparatus comprising:
the acquisition module is used for acquiring the communication related information of the JMS message in the process of sending the JMS message to a second service application by a first service application;
a field generating module, configured to generate the identifier field carrying the communication-related information;
wherein the communication-related information includes at least two of: the correlation identification of the first service application, the correlation identification of the process and the correlation identification of the JMS message.
11. An apparatus for processing an identifier field of a JMS message, the apparatus comprising:
a field obtaining module, configured to obtain the identifier field of the communication related information carrying the JMS information, where the JMS information is generated in a process in which a first service application sends the JMS information to a second service application;
an information extraction module for extracting the communication-related information from the identifier field;
wherein the communication-related information includes at least two of: the correlation identification of the first service application, the correlation identification of the process and the correlation identification of the JMS message.
12. A device for processing an identifier field of a JMS message, the device comprising:
a memory for storing a program;
a processor for executing the program stored in the memory to perform the method of processing the identifier field of the JMS message of any of claims 1-9.
13. A computer storage medium having stored thereon computer program instructions which, when executed by a processor, implement a method of processing an identifier field of a JMS message as claimed in any of claims 1 to 9.
CN201911317308.8A 2019-12-19 2019-12-19 Method, device, equipment and medium for processing identifier field of JMS (Java Server System) message Active CN111064791B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911317308.8A CN111064791B (en) 2019-12-19 2019-12-19 Method, device, equipment and medium for processing identifier field of JMS (Java Server System) message

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911317308.8A CN111064791B (en) 2019-12-19 2019-12-19 Method, device, equipment and medium for processing identifier field of JMS (Java Server System) message

Publications (2)

Publication Number Publication Date
CN111064791A CN111064791A (en) 2020-04-24
CN111064791B true CN111064791B (en) 2022-08-23

Family

ID=70302398

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911317308.8A Active CN111064791B (en) 2019-12-19 2019-12-19 Method, device, equipment and medium for processing identifier field of JMS (Java Server System) message

Country Status (1)

Country Link
CN (1) CN111064791B (en)

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7941514B2 (en) * 2002-07-31 2011-05-10 Level 3 Communications, Llc Order entry system for telecommunications network service
US7664879B2 (en) * 2004-11-23 2010-02-16 Cisco Technology, Inc. Caching content and state data at a network element
US7706368B2 (en) * 2007-04-06 2010-04-27 Research In Motion Limited System and method for correlating messages within a wireless transaction
US8453163B2 (en) * 2009-06-29 2013-05-28 Software Ag Usa, Inc. Systems and/or methods for policy-based JMS broker clustering
US8700892B2 (en) * 2010-03-19 2014-04-15 F5 Networks, Inc. Proxy SSL authentication in split SSL for client-side proxy agent resources with content insertion
CN102480335B (en) * 2010-11-30 2015-08-05 金蝶软件(中国)有限公司 A kind of sending method of business datum and system
US9141681B2 (en) * 2012-11-29 2015-09-22 Red Hat, Inc. Creating a column family in a database
CN107105036B (en) * 2017-04-24 2020-10-23 深信服科技股份有限公司 Activity tracing method and system for server
CN110035039B (en) * 2018-01-12 2020-09-18 华为技术有限公司 Method and equipment for maintaining session
CN108712501B (en) * 2018-05-28 2023-04-07 腾讯科技(北京)有限公司 Information sending method and device, computing equipment and storage medium
CN109672735A (en) * 2018-12-20 2019-04-23 中国移动通信集团江苏有限公司 A kind of method, device and equipment of Message Processing

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
JMS在基于J2EE架构的电子商务系统中的应用;付长伟等;《微机发展》;20040410(第04期);全文 *
基于JMS和MDB的铁路调度管理系统消息路由研究;朱涛等;《铁路计算机应用》;20090526(第05期);全文 *
基于JMS的消息过滤改进算法;姚刚等;《计算机技术与发展》;20060710(第07期);全文 *

Also Published As

Publication number Publication date
CN111064791A (en) 2020-04-24

Similar Documents

Publication Publication Date Title
CN111328108B (en) 5G service data processing method, device and distribution equipment
EP3790239A1 (en) Network access method and device for edge router
CN105376225A (en) Software-as-a-service method and device
CN108696899A (en) Sip message transmits and method of reseptance and transmission and reception device
US7512715B2 (en) System and method for requesting a resource over at least one network with reduced overhead
CN111064791B (en) Method, device, equipment and medium for processing identifier field of JMS (Java Server System) message
CN112803950A (en) Data compression method, device and equipment and computer storage medium
CN113890897B (en) Message processing method and related device
CN111355821A (en) Connection code generation method, device, electronic device and storage medium
CN105827699A (en) Data synchronization method
CN113204683B (en) Information reconstruction method and device, storage medium and electronic equipment
CN113595980B (en) Configuration method based on TCP communication custom protocol
JP7443533B2 (en) Reference signal processing method, device, first communication node and second communication node
CN111245973B (en) Domain name based message transmission method, message forwarding control method and system
CN110838924B (en) Block transmission method and device
CN114221883A (en) Message testing method, device, server and storage medium
CN115276889A (en) Decoding processing method, decoding processing device, computer equipment and storage medium
US8130765B2 (en) Method for processing data packets while communicating with a machine via one or more secondary networks
JPWO2008072667A1 (en) Telecommunications network, network node device and routing method
CN114828140B (en) Service flow message forwarding method and device, storage medium and electronic equipment
CN111277449A (en) Safety testing method and device for voice service equipment
WO2021232887A1 (en) Method for acquiring hpack dynamic table, and communication device, core network system and storage medium
CN114900494B (en) Intranet IP address transmission method, system and storage medium
CN110008032A (en) A kind of implementation method and electronic equipment of communication mode
CN111131425B (en) Distributed system and communication method for distributed system

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
GR01 Patent grant
GR01 Patent grant