CN115292624A - Universal message processing method and device based on HTTP (hyper text transport protocol) - Google Patents

Universal message processing method and device based on HTTP (hyper text transport protocol) Download PDF

Info

Publication number
CN115292624A
CN115292624A CN202211219617.3A CN202211219617A CN115292624A CN 115292624 A CN115292624 A CN 115292624A CN 202211219617 A CN202211219617 A CN 202211219617A CN 115292624 A CN115292624 A CN 115292624A
Authority
CN
China
Prior art keywords
expr
message
http
request message
http request
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.)
Granted
Application number
CN202211219617.3A
Other languages
Chinese (zh)
Other versions
CN115292624B (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.)
Chengdu Synchronous Xinchuang Technology Co ltd
Original Assignee
Chengdu Synchronous Xinchuang Technology 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 Chengdu Synchronous Xinchuang Technology Co ltd filed Critical Chengdu Synchronous Xinchuang Technology Co ltd
Priority to CN202211219617.3A priority Critical patent/CN115292624B/en
Publication of CN115292624A publication Critical patent/CN115292624A/en
Application granted granted Critical
Publication of CN115292624B publication Critical patent/CN115292624B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9566URL specific, e.g. using aliases, detecting broken or misspelled links
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Abstract

The invention discloses a general message processing method and a device based on an HTTP protocol, wherein the method comprises the following steps: acquiring a parameter extraction rule according to the HTTP request message; if the request mode is a GET request or a DELETE request, extracting the URL parameter, and converting the URL parameter from a QueryString structure into a dictionary structure; otherwise, judging the message format; if the message format is the xml format, the HTTP request message is converted into a dictionary structure from a tree structure; if the message format is json format, the HTTP request message is converted into a dictionary structure from a tree structure; reading target parameters from the HTTP request message based on parameter extraction rules; and generating an HTTP response message according to the target parameters. The invention carries out planarization and then extraction and analysis on the data in the message, and can adapt to various messages.

Description

Universal message processing method and device based on HTTP (hyper text transport protocol)
Technical Field
The invention belongs to the technical field of HTTP protocol message processing, and particularly relates to a general message processing method and device based on an HTTP protocol.
Background
At present, common messages of the HTTP protocol comprise XML, JSON and key value peer-to-peer formats, and different methods and class libraries are usually provided for processing messages of different formats, so that complete unification is difficult to achieve. Such as: the method comprises the following steps that a certain API function is provided for a plurality of external users to call, different external user interaction parties have different development languages, different system architectures, different requirements and different request message contents, for example, some are in a soap format, and some are in a json or other format ports. The existing scheme basically corresponds to different messages by defining different entity classes, and performs complicated serialization, deserialization, hard coding of most of the logic of message analysis by software developers, shutdown and online operation and the like.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a general message processing method and a general message processing device based on an HTTP (hyper text transport protocol).
The purpose of the invention is realized by the following technical scheme:
according to a first aspect of the present invention, a general packet processing method based on an HTTP protocol includes:
s100, acquiring a corresponding parameter extraction rule according to a received HTTP request message;
s200, judging a request mode of the HTTP request message, if the request mode is a GET request or a DELETE request, executing S300, otherwise executing S400;
s300, extracting URL parameters from the HTTP request message, converting the obtained URL parameters from a QueryString structure into a dictionary structure based on a preset first planarization algorithm, and then executing S700;
s400, judging the message format of the HTTP request message, if the message format of the HTTP request message is the xml format, executing S500, and if the message format of the HTTP request message is the json format, executing S600;
s500, converting the HTTP request message from a tree structure into a dictionary structure based on a preset second planarization algorithm, and then executing S700;
s600, converting the HTTP request message from a tree structure to a dictionary structure based on a preset third planarization algorithm, and then executing S700;
s700, reading target parameters from the HTTP request message based on the parameter extraction rules;
and S800, generating an HTTP response message according to the target parameters.
Further, acquiring a corresponding parameter extraction rule according to the received HTTP request message includes:
and acquiring a corresponding parameter extraction rule according to a sender of the received HTTP request message.
Further, the method for processing a general packet further includes:
and setting a corresponding parameter extraction rule for each sender.
Further, in S400, if the HTTP request message is in a format other than xml format and json format, an HTTP response message is generated, where the HTTP response message includes a prompt message that does not support the message format.
Further, converting the HTTP request packet from a tree structure to a dictionary structure based on a preset second flattening algorithm, including:
and recursively traversing all leaf nodes in the HTTP request message, and adding character strings- > in the names of the parent nodes and the child nodes as connections.
Further, if the xml format has no attribute, generating a Path and a Value;
if the xml format is attributed, then "Path- > # text": value and "Path- > @ attribute": attribute Value are generated.
Further, the converting the HTTP request packet from a tree structure to a dictionary structure based on a preset third flattening algorithm includes:
and recursively traversing all leaf nodes in the HTTP request message, and adding character strings- > in the names of the parent nodes and the child nodes as connections.
Further, when the HTTP request message is converted from a tree structure to a dictionary structure, each leaf node is converted into two cts, and the two cts are encapsulated into a help class.
According to a second aspect of the present invention, a general message processing apparatus based on HTTP protocol comprises a processor and a memory, wherein the memory is used for storing program codes and data of the general message processing method based on HTTP protocol, and the processor is used for calling program instructions in the memory to execute the general message processing method based on HTTP protocol according to the first aspect of the present invention.
The invention has the beneficial effects that:
(1) All URL requests are mapped to a global API controller, the API controller reads the most original character string message of an HTTP request message, and the most original character string message, whether xml, json or QueryString, is subjected to planarization processing in a centralized way by the API controller, so that the problem that a corresponding API controller needs to be set for each URL in the prior art is solved;
(2) The invention can adapt to various different messages, the internal data of the message is flattened and then extracted and analyzed, the whole process can be configured, and the online without stopping can be realized by updating the configuration and refreshing the cache.
Drawings
Fig. 1 is a flowchart of a general message processing method based on the HTTP protocol in this embodiment;
fig. 2 is a block diagram of a general message processing apparatus based on the HTTP protocol in this embodiment.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the following embodiments, and it should be understood that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive effort based on the embodiments of the present invention, are within the scope of the present invention.
Referring to fig. 1 to fig. 2, the present embodiment provides a general packet processing method and apparatus based on the HTTP protocol:
one embodiment of the general message processing method based on the HTTP protocol provided by the invention comprises the following steps: as shown in fig. 1, the general message processing method based on the HTTP protocol includes:
and S100, acquiring a corresponding parameter extraction rule according to the received HTTP request message.
In one embodiment, acquiring a corresponding parameter extraction rule according to a received HTTP request message includes: and acquiring a corresponding parameter extraction rule according to a sender of the received HTTP request message. That is, in this embodiment, the corresponding parameter extraction rule is obtained according to the source of the HTTP request packet.
In one embodiment, the method for processing a generic packet further includes: and setting a corresponding parameter extraction rule for each sender. That is, a corresponding parameter extraction rule is set for each sender in advance, and when an HTTP request message is received, the corresponding parameter extraction rule is determined according to the sender of the HTTP request message.
S200, judging the request mode of the HTTP request message, if the request mode is a GET request or a DELETE request, executing S300, otherwise executing S400.
S300, extracting URL parameters from the HTTP request message, converting the obtained URL parameters from a QueryString structure into a dictionary structure based on a preset first planarization algorithm, and then executing S700.
For example, the first flattening algorithm is: and for QueryString, taking the left content of the equal sign as key, taking the right content of the equal sign as value, and adding dictionary.
S400, judging the message format of the HTTP request message, if the message format of the HTTP request message is xml format, executing S500, and if the message format of the HTTP request message is json format, executing S600.
In one embodiment, if the HTTP request message is in a format other than xml format and json format, an HTTP response message is generated, where the HTTP response message includes a prompt message that does not support the message format. That is, if the HTTP request message is in a format other than xml format and json format, a prompt message of "not supporting" is returned to prompt the sender that the HTTP request message in the format is not supported.
And S500, converting the HTTP request message from a tree structure to a dictionary structure based on a preset second flattening algorithm, and then executing S700.
In one embodiment, converting the HTTP request packet from a tree structure to a dictionary structure based on a preset second flattening algorithm includes: and recursively traversing all leaf nodes in the HTTP request message, and adding character strings- > in the middles of the names of the parent nodes to serve as connections.
If the xml format does not have the attribute, generating 'Path': value;
if the xml format is attributed, then "Path- > # text": value and "Path- > @ attribute": attribute Value are generated.
S600, converting the HTTP request message from a tree structure to a dictionary structure based on a preset third planarization algorithm, and then executing S700.
For xml format and json format. The planarization method comprises the following steps: for both json and xml, a form of a pre-order traversal can be adopted, and if the current node is not a leaf node, the following steps are generated: the path of the "ancestor- > father- >" style, and passes the path as a parameter to the next layer of recursion. If the current node is a leaf node, three situations are distinguished: (1) Json, taking leaf node names, combining the leaf node names into a form of 'ancestor- > father- > son' as key, taking a leaf node value as value, and adding dictionary; (2) xml: if the node has no attribute, only one pair of keys, namely value, is generated in the same steps of (1), (1) and (2); (3) xml: and if the node band attribute is adopted, a ' ancestor- > father- > child- > attribute 1 ', a ' ancestor- > father- > child- > attribute 2 ', a ' 8230; a ' ancestor- > father- > child- > attribute N ', and a ' ancestor- > father- > child- > text ' style are formed according to the attribute, a group of keys, values, are generated, and a dictionary is added.
In one embodiment, converting the HTTP request packet from a tree structure to a dictionary structure based on a preset third flattening algorithm includes: and recursively traversing all leaf nodes in the HTTP request message, and adding character strings- > in the middles of the names of the parent nodes to serve as connections.
Because the tree structure does not support the query of fuzzy paths and regular expression query paths, and is difficult to realize by indirect means; the dictionary structure can realize fuzzy and regular query through a cycle Key, and has the characteristics of high query speed and the like.
In one embodiment, when the HTTP request packet is converted from a tree structure to a dictionary structure, each leaf node is converted into two cts, and the two cts are encapsulated into a helper class. Since the key length of the dictionary structure is very long after the tree structure is converted into the dictionary structure, there is a problem of path assembly during program call, and in this embodiment, each leaf node of the tree structure is converted into two dicts.
For example, for a message:
<a><b>1</b><b>2</b><c>2</c><c><e>4</e></c><d><e>3</e></d></a>
converting a leaf node into two dits, dit 1 and dit 2: where ditt 1 is an index dictionary (which functions to record the absolute path of the abbreviated key):
{
"b": ["a->b->[0]", "a->b->[1]"],
"c": ["a->c"],
"e": ["a->d->e", "a->c->e"]
}
and dit 2 is a path-value dictionary (which functions to record the values corresponding to absolute paths):
{
"a->b->[0]": 1,
"a->b->[1]": 2,
"a->c": 2,
"a->d->e": 3,
"a->c->e": 4
}
the two dicts are then packaged into a help class, assuming the class name plattreehaler { dict1, dict2 }.
After instantiation: pth = new PlatTreeHelper (), which can be applied as follows
1) By passing
pth.Parse("<a><b>1</b><b>2</b><c>2</c><c><e>3</e></c><d><e>3</e></d></a>");
Two dicts may be generated.
2) Find ("e") can get the value of e-node: [3,4], the find method obtains a complete path by querying dit 1: a- > d- > e, and then the fact of choosing dit 2 is realized, so that the speed is fast, and the problem of too long path is not worried during programming.
3) Find ("c- > e") is used to obtain the unique value 4, and the method directly cycles keys of the fact 2 and compares the keys by a character string, so that the method is poor in efficiency and flexible in query.
4) By passing
Figure 123028DEST_PATH_IMAGE002
And acquiring a unique value 4, wherein the method directly circulates keys of the dit 2 and compares the keys by the regular mode, and the method has poor efficiency and flexible query.
5) Both methods 3,4 scan all keys with poor efficiency and pass
Find ("c- > e, e") defines the scan in [ "a- > d- > e", "a- > c- > e" ].
6) Implementation method (pseudo code implementation) of find function:
value list common search method (path)
If (path index exists in index dictionary) last
Taking the values of all the specific paths, forming a list and returning
Else
If (comma is included in path) last
Then the first part is the path we want to find
The second part is [ search range ]
Else
The whole dictionary is [ search range ]
}
If (regular expression included in the first part) the front face
We go through every option in [ search Range ] with the canonical
Putting the matched result into a return list
Else
We traverse by way of string lookup
Putting the matched result into a return list
}
}
Returning a result list;
}
some extended uses:
7) Find ("c- > e | d- > e"), it can be checked to return the value of c- > e if it is not empty, otherwise it returns the value of d- > e.
8) Find ("c & d- > e"), can take the values of unique leaf nodes c and d- > e simultaneously, combine into an array return: [2,4].
9) If there is one
Parse ("< stds > < std > < name > -three > < name > < 8 > </std > < name > -four > < name > < 9 > </std >);
find ("age/name = zhang san") may be used to obtain the age of zhang san.
10 Advanced lookup algorithm specification:
1. finding the back if the front is not satisfied: c- > e | d- > e
2. Both the results before and after: c & d- > e
3. The previous result is also presumed from the following result: age/name = Zhang three
Priority: 3 > 2 > 1, support bracket expression
Complex path: (a- > b | c- > d) & e- > f & age/name = Zhang III/sex = man | g | h
11 Syntax analysis derivative of the advanced lookup algorithm implementation:
path expression parsing:
or_expr => and_expr _or_expr
_or_expr => | or_expr
=> ε
and_expr => comp_expr _and_expr
_and_expr => & and_expr
=> ε
comp_expr => (or_expr)
=> qry_expr
qry_expr => path _qry_expr
_qry_expr => / _pv_expr
=> ε
_pv_expr => path _val_expr
_val_expr => / _pv_expr
=> = val _val_expr2
=> in val _val_expr2
=> has val _val_expr2
_val_expr2 => / _pv_expr
=> ε
val = > string taking function
val = > get digital function
12 Verify as follows:
(a- > b | c- > d) & age/name = three/sex = male | g | h
or_expr => and_expr _or_expr
or_expr => comp_expr _and_expr _or_expr
or_expr => (or_expr) _and_expr _or_expr
or_expr => (and_expr _or_expr) _and_expr _or_expr
or_expr => (comp_expr _and_expr _or_expr) _and_expr _or_expr
or_expr => (qry_expr _and_expr _or_expr) _and_expr _or_expr
or_expr => (path _qry_expr _and_expr _or_expr) _and_expr _or_expr
or_expr => (a->b ε ε _or_expr) _and_expr _or_expr
or_expr => (a->b ε ε | or_expr) _and_expr _or_expr
or_expr => (a->b ε ε | and_expr _or_expr) _and_expr _or_expr
or_expr => (a->b ε ε | comp_expr _and_expr _or_expr) _and_expr _or_expr
or_expr => (a->b ε ε | qry_expr _and_expr _or_expr) _and_expr _or_expr
or_expr => (a->b ε ε | path _qry_expr _and_expr _or_expr) _and_expr _or_expr
or_expr => (a->b ε ε | c->d ε ε ε) _and_expr _or_expr
(a- > b | c- > d) & age/name = Zhang three/sex = man | g | h
or_expr => (a->b|c->d) _and_expr _or_expr
or_expr => (a->b|c->d) & and_expr _or_expr
or_expr => (a->b|c->d) & qry_expr _and_expr _or_expr
or_expr => (a->b|c->d) & path _qry_expr _and_expr _or_expr
or_expr => (a->b|c->d) & age _qry_expr _and_expr _or_expr
or_expr => (a->b|c->d) & age / _pv_expr _and_expr _or_expr
or_expr => (a->b|c->d) & age / name _val_expr _and_expr _or_expr
or_expr => (a->b|c->d) & age / name = val _val_expr2 _and_expr _or_expr
or _ expr = > (a- > b | c- > d) & age/name = zhang _ val _ expr2 _ and _ expr _ or _ expr
or _ expr = > (a- > b | c- > d) & age/name = zhang/_ pv _ expr _ and _ expr _ or _ expr _ p _
or _ expr = > (a- > b | c- > d) & age/name = three/path _ val _ expr _ and _ expr _ or _ expr
or _ expr = > (a- > b | c- > d) & age/name = three/sex _ val _ expr _ and _ expr _ or _ expr
or _ expr = > (a- > b | c- > d) & age/name = three/sex = val _ val _ expr2 _ and _ expr _ or _ expr
or _ expr = > (a- > b | c- > d) & age/name = zhang/six = man epsilon _ and _ expr _ or _ expr
(a- > b | c- > d) & age/name = three/sex = male | g | h
or _ expr = > (a- > b | c- > d) & age/name = Zhan/sex = man _ or _ expr
or _ expr = > (a- > b | c- > d) & age/name = three/sex = man | or _ expr
or _ expr = > (a- > b | c- > d) & age/name = zhang/six = man | and _ expr _ or _ expr
or _ expr = > (a- > b | c- > d) & age/name = sheet three/six = male | comp _ expr _ and _ expr _ or _ expr
or _ expr = > (a- > b | c- > d) & age/name = three/sex = man | qry _ expr _ and _ expr _ or _ expr _ x = $/three/sex =
or _ expr = > (a- > b | c- > d) & age/name = three/sex = man | path _ qry _ expr _ and _ expr _ or _ expr _
or _ expr = > (a- > b | c- > d) & age/name = Zhang/sex = man | g ∈ or _ expr
(a- > b | c- > d) & age/name = three/sex = male | g | h
or _ expr = > (a- > b | c- > d) & age/name = three/sex = male | g ∈ | or _ expr
or _ expr = > (a- > b | c- > d) & age/name = zhang/six = male | g | and _ expr _ or _ expr
or _ expr = > (a- > b | c- > d) & age/name = three/six = male | g | comp _ expr _ and _ expr _ or _ expr _ for
or _ expr = > (a- > b | c- > d) & age/name = three/sex = male | g | qry _ expr _ and _ expr _ or _ expr = $/sex
or _ expr = > (a- > b | c- > d) & age/name = three/sex = male | g | path _ qry _ expr _ and _ expr _ or _ expr = > three/sex =
or _ expr = > (a- > b | c- > d) & age/name = three/sex = male | g | h _ qry _ expr _ and _ expr _ or _ expr = $/sex
or _ expr = > (a- > b | c- > d) & age/name = three/six = male | g | h epsilon ∈
or _ expr = > (a- > b | c- > d) & age/name = three/six = male | g | h
Grammar rule verification success!
13 The following applies in general:
an api table defining api _ id and corresponding path;
TABLE 1 api Table
Figure 368065DEST_PATH_IMAGE003
The c _ api _ paramter table allows the same api to adapt to different access messages, as follows:
source 1 access message:
curl-d '< root > < username > Zhangtriplet </root >' http:// baseUrl/api1
Source 2 access message:
curl-d { "root": { "user": student-Zhang three } } }' http:// baseUrl/api1
Then our table configuration is table 2;
TABLE 2
Figure 678960DEST_PATH_IMAGE004
Finally, only the username of the source 1 and the user of the source 2 are unified into the username field in the program, two different entity classes are no longer required to be defined to be converted, and the final username is the value of "zhang san".
The above describes a path query approach (similar to xpath of xml), and the rule is used for flattened dictionary path query to realize "unique matching, regular matching, preferential matching, conditional matching, and multipath matching" for the path, i.e. the rule can simplify the configuration. Different value-taking algorithms are available for json, xml and QueryString, so that the data structure for planarization is unified, and the value-taking algorithms are unified at the same time.
S700, reading target parameters from the HTTP request message based on the parameter extraction rules.
And S800, generating an HTTP response message according to the target parameters.
One embodiment of a general message processing apparatus based on the HTTP protocol provided by the present invention includes: as shown in fig. 2, the general message processing apparatus based on the HTTP protocol includes a processor and a memory, where the processor and the memory are connected through a communication bus, the memory is used to store program codes and data of the general message processing method based on the HTTP protocol, and the processor is used to call program instructions in the memory to perform the steps of the general message processing method based on the HTTP protocol in the above embodiment.
The foregoing is illustrative of the preferred embodiments of this invention, and it is to be understood that the invention is not limited to the precise form disclosed herein and that various other combinations, modifications, and environments may be resorted to, falling within the scope of the concept as disclosed herein, either as described above or as apparent to those skilled in the relevant art. And that modifications and variations may be effected by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (9)

1. The general message processing method based on the HTTP protocol is characterized by comprising the following steps:
s100, acquiring a corresponding parameter extraction rule according to the received HTTP request message;
s200, judging a request mode of the HTTP request message, if the request mode is a GET request or a DELETE request, executing S300, otherwise executing S400;
s300, extracting URL parameters from the HTTP request message, converting the obtained URL parameters from a QueryString structure into a dictionary structure based on a preset first planarization algorithm, and then executing S700;
s400, judging the message format of the HTTP request message, if the message format of the HTTP request message is the xml format, executing S500, and if the message format of the HTTP request message is the json format, executing S600;
s500, converting the HTTP request message from a tree structure into a dictionary structure based on a preset second planarization algorithm, and then executing S700;
s600, converting the HTTP request message from a tree structure to a dictionary structure based on a preset third planarization algorithm, and then executing S700;
s700, reading target parameters from the HTTP request message based on the parameter extraction rules;
and S800, generating an HTTP response message according to the target parameters.
2. The universal message processing method based on the HTTP protocol according to claim 1, wherein obtaining the corresponding parameter extraction rule according to the received HTTP request message includes:
and acquiring a corresponding parameter extraction rule according to a sender of the received HTTP request message.
3. The universal message processing method based on HTTP protocol as recited in claim 2, further comprising:
and setting a corresponding parameter extraction rule for each sender.
4. The method according to claim 1, wherein in S400, if the HTTP request packet is in a format other than xml format and json format, an HTTP response packet is generated, and the HTTP response packet includes a prompt message that does not support the packet format.
5. The universal message processing method based on the HTTP protocol as recited in claim 1, wherein the converting the HTTP request message from a tree structure to a dictionary structure based on a preset second flattening algorithm includes:
and recursively traversing all leaf nodes in the HTTP request message, and adding character strings- > in the names of the parent nodes and the child nodes as connections.
6. The universal message processing method based on HTTP protocol of claim 5, wherein if the xml format has no attribute, generate "Path": value;
if the xml format has attributes, then generate "Path- > # text": value and "Path- > @ attribute": attribute values.
7. The universal message processing method based on the HTTP protocol as recited in claim 1, wherein the converting the HTTP request message from a tree structure to a dictionary structure based on a preset third flattening algorithm includes:
and recursively traversing all leaf nodes in the HTTP request message, and adding character strings- > in the middles of the names of the parent nodes to serve as connections.
8. The universal message processing method based on the HTTP protocol as recited in claim 1, wherein when the HTTP request message is converted from a tree structure to a dictionary structure, each leaf node is converted into two cts, and the two cts are encapsulated into a helper class.
9. General message processing device based on the HTTP protocol, comprising a processor and a memory, said memory being adapted to store program code and data of the general message processing method based on the HTTP protocol, said processor being adapted to invoke program instructions in said memory to execute the general message processing method based on the HTTP protocol according to any of the claims 1 to 8.
CN202211219617.3A 2022-10-08 2022-10-08 General message processing method and device based on HTTP protocol Active CN115292624B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211219617.3A CN115292624B (en) 2022-10-08 2022-10-08 General message processing method and device based on HTTP protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211219617.3A CN115292624B (en) 2022-10-08 2022-10-08 General message processing method and device based on HTTP protocol

Publications (2)

Publication Number Publication Date
CN115292624A true CN115292624A (en) 2022-11-04
CN115292624B CN115292624B (en) 2023-08-04

Family

ID=83834813

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211219617.3A Active CN115292624B (en) 2022-10-08 2022-10-08 General message processing method and device based on HTTP protocol

Country Status (1)

Country Link
CN (1) CN115292624B (en)

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6873627B1 (en) * 1995-01-19 2005-03-29 The Fantastic Corporation System and method for sending packets over a computer network
CN101160816A (en) * 2005-06-13 2008-04-09 华为技术有限公司 Method of measuring performance parameter of multi-protocol label switching network
CN101399814A (en) * 2007-09-30 2009-04-01 华为技术有限公司 Method, system and device for verifying relation between data link layer address and sending side
JP2011227697A (en) * 2010-04-20 2011-11-10 Nippon Telegr & Teleph Corp <Ntt> Access control method, access control system, and access right management server
CN104410667A (en) * 2014-10-31 2015-03-11 北京思特奇信息技术股份有限公司 Method and system for conversion from XML message to JSON message
CN107896145A (en) * 2017-11-10 2018-04-10 郑州云海信息技术有限公司 A kind of anti-method for implanting of interface interchange and system
CN108628634A (en) * 2018-05-09 2018-10-09 平安普惠企业管理有限公司 Message configuration method, device, computer equipment and storage medium
WO2019043433A1 (en) * 2017-08-30 2019-03-07 Tobashi Fawzi Rule-based content sharing
CN109670081A (en) * 2018-12-28 2019-04-23 中国银行股份有限公司 The method and device of service request processing
CN109857958A (en) * 2019-02-13 2019-06-07 杭州孝道科技有限公司 A kind of method that http input point is searched
CN110830442A (en) * 2019-10-09 2020-02-21 贝壳技术有限公司 Message processing method, device and gateway
WO2020140679A1 (en) * 2019-01-03 2020-07-09 深圳壹账通智能科技有限公司 Interface docking method and apparatus, computer device and storage medium
CN111953540A (en) * 2020-08-04 2020-11-17 中国建设银行股份有限公司 Message generation method and device, electronic equipment and storage medium
CN113055494A (en) * 2021-03-30 2021-06-29 中国工商银行股份有限公司 Communication method and communication device
CN113704065A (en) * 2021-08-31 2021-11-26 平安普惠企业管理有限公司 Monitoring method, device, equipment and computer storage medium
CN114124918A (en) * 2021-11-25 2022-03-01 中国银行股份有限公司 Message parsing method and device

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6873627B1 (en) * 1995-01-19 2005-03-29 The Fantastic Corporation System and method for sending packets over a computer network
CN101160816A (en) * 2005-06-13 2008-04-09 华为技术有限公司 Method of measuring performance parameter of multi-protocol label switching network
CN101399814A (en) * 2007-09-30 2009-04-01 华为技术有限公司 Method, system and device for verifying relation between data link layer address and sending side
JP2011227697A (en) * 2010-04-20 2011-11-10 Nippon Telegr & Teleph Corp <Ntt> Access control method, access control system, and access right management server
CN104410667A (en) * 2014-10-31 2015-03-11 北京思特奇信息技术股份有限公司 Method and system for conversion from XML message to JSON message
WO2019043433A1 (en) * 2017-08-30 2019-03-07 Tobashi Fawzi Rule-based content sharing
CN107896145A (en) * 2017-11-10 2018-04-10 郑州云海信息技术有限公司 A kind of anti-method for implanting of interface interchange and system
CN108628634A (en) * 2018-05-09 2018-10-09 平安普惠企业管理有限公司 Message configuration method, device, computer equipment and storage medium
CN109670081A (en) * 2018-12-28 2019-04-23 中国银行股份有限公司 The method and device of service request processing
WO2020140679A1 (en) * 2019-01-03 2020-07-09 深圳壹账通智能科技有限公司 Interface docking method and apparatus, computer device and storage medium
CN109857958A (en) * 2019-02-13 2019-06-07 杭州孝道科技有限公司 A kind of method that http input point is searched
CN110830442A (en) * 2019-10-09 2020-02-21 贝壳技术有限公司 Message processing method, device and gateway
CN111953540A (en) * 2020-08-04 2020-11-17 中国建设银行股份有限公司 Message generation method and device, electronic equipment and storage medium
CN113055494A (en) * 2021-03-30 2021-06-29 中国工商银行股份有限公司 Communication method and communication device
CN113704065A (en) * 2021-08-31 2021-11-26 平安普惠企业管理有限公司 Monitoring method, device, equipment and computer storage medium
CN114124918A (en) * 2021-11-25 2022-03-01 中国银行股份有限公司 Message parsing method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
厉小军,俞欢军,胡上序: "化工企业优化多智能体系统的通信机制与协调规则", 计算机工程, no. 12, pages 146 - 149 *
李潇宇;张玉清;刘奇旭;郑晨;: "一种基于HTML5的安全跨文档消息传递方案", 中国科学院研究生院学报, no. 01, pages 127 - 133 *

Also Published As

Publication number Publication date
CN115292624B (en) 2023-08-04

Similar Documents

Publication Publication Date Title
Bjorklund The YANG 1.1 data modeling language
US11150874B2 (en) API specification generation
Bjorklund YANG-a data modeling language for the network configuration protocol (NETCONF)
KR101880456B1 (en) Enabling resource semantics
US8572157B2 (en) Configuration based approach to unify web services
US7234109B2 (en) Equality of extensible markup language structures
US20060230432A1 (en) Policy algebra and compatibility model
CN108696381B (en) Protocol configuration method and device
JP7065082B2 (en) Semantic queries against distributed semantic descriptors
US8250032B2 (en) Optimizing publish/subscribe matching for non-wildcarded topics
US20050076327A1 (en) Server-side wireless development tool
JP6734404B2 (en) Enable Semantics Inference Service in M2M/IOT Service Layer
CN110727417B (en) Data processing method and device
US9547633B2 (en) Methods for extending a selector application programming interface and devices thereof
JPH0650489B2 (en) ASN. 1 Information data conversion method
US11870873B2 (en) Service layer-based methods to enable efficient analytics of IoT data
US11115913B2 (en) Wireless communication core network and method for analyzing user equipment mobility in the same
CN113238740A (en) Code generation method, code generation device, storage medium, and electronic apparatus
EP3974960A1 (en) Method and system for automated testing of web service apis
US7716272B2 (en) Analysis of operations having input and output parameters and relating to network service
CN115292624A (en) Universal message processing method and device based on HTTP (hyper text transport protocol)
CN111353171A (en) CAD data network authorized browsing method
CN114840574A (en) Data query method, server, node and storage medium
CN115168365B (en) Data storage method and device, electronic equipment and storage medium
WO2018144517A1 (en) Semantic query processing with information asymmetry

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