CN115292624B - General message processing method and device based on HTTP protocol - Google Patents

General message processing method and device based on HTTP protocol Download PDF

Info

Publication number
CN115292624B
CN115292624B CN202211219617.3A CN202211219617A CN115292624B CN 115292624 B CN115292624 B CN 115292624B CN 202211219617 A CN202211219617 A CN 202211219617A CN 115292624 B CN115292624 B CN 115292624B
Authority
CN
China
Prior art keywords
expr
message
request message
format
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.)
Active
Application number
CN202211219617.3A
Other languages
Chinese (zh)
Other versions
CN115292624A (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

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a general message processing method and device based on HTTP protocol, the method includes: acquiring parameter extraction rules according to the HTTP request message; if the request mode is a GET request or a DELETE request, extracting URL parameters, and converting the URL parameters into a dictionary structure from a QueryString structure; otherwise, judging the format of the message; if the message format is an xml format, converting the HTTP request message from a tree structure to a dictionary structure; if the message format is json format, converting the HTTP request message from a tree structure to a dictionary structure; reading target parameters from the HTTP request message based on the parameter extraction rule; and generating an HTTP response message according to the target parameter. The invention planarizes the internal data of the message and then extracts and analyzes the data, which can be suitable for various different messages.

Description

General message processing method and device based on HTTP 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 the HTTP protocol.
Background
At present, common messages of the HTTP protocol comprise XML, JSON and key value peer-to-peer formats, and for the processing of messages of different formats, different methods and class libraries are generally available, so that complete unification is difficult to achieve. Such as: the method provides certain API function 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 json or other format ports. The existing scheme basically corresponds to different messages by defining different entity classes, performs complicated serialization and reverse serialization, and most of the logic of message analysis needs hard coding by software developers and then needs shutdown, online and other operations.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a general message processing method and device based on an HTTP protocol.
The aim of the invention is realized by the following technical scheme:
according to a first aspect of the present invention, a general message processing method based on HTTP protocol includes:
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 executing S700;
s400, judging the message format of the HTTP request message, if the message format of the HTTP request message is an xml format, executing S500, and if the message format of the HTTP request message is a json format, executing S600;
s500, converting the HTTP request message into a dictionary structure from a tree structure based on a preset second planarization algorithm, and then executing S700;
s600, converting the HTTP request message into a dictionary structure from a tree 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 rule;
s800, generating an HTTP response message according to the target parameters.
Further, obtaining a corresponding parameter extraction rule according to the received HTTP request message, including:
and acquiring a corresponding parameter extraction rule according to the sender of the received HTTP request message.
Further, the general message processing method further includes:
corresponding parameter extraction rules are set 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 message from a tree structure to a dictionary structure based on a preset second planarization algorithm includes:
and recursively traversing all leaf nodes in the HTTP request message, and adding a character string- > between the names of the parent and child nodes as connection.
Further, if the xml format does not have the attribute, generating a Path Value;
and if the xml format has the attribute, generating a 'Path- > #text' Value and a 'Path- > @ attribute' Value.
Further, converting the HTTP request message from a tree structure to a dictionary structure based on a preset third planarization algorithm includes:
and recursively traversing all leaf nodes in the HTTP request message, and adding a character string- > between the names of the parent and child nodes as connection.
Further, when the HTTP request message is converted from the tree structure to the dictionary structure, each leaf node is converted into two facts and the two facts are encapsulated into one help class.
According to a second aspect of the present invention, a general packet processing device based on HTTP protocol includes a processor and a memory, where the memory is configured to store program codes and data of a general packet processing method based on HTTP protocol, and the processor is configured to call program instructions in the memory to execute the general packet processing method based on HTTP protocol according to the first aspect of the present invention.
The beneficial effects of the invention are as follows:
(1) According to the invention, all URL requests are mapped to a global API controller, and the API controller reads the most original character string message of the HTTP request message, whether xml, json or QueryString, the API controller performs planarization processing in a centralized way, so that the problem that a corresponding API controller needs to be arranged for each URL in the prior art is solved;
(2) The invention can adapt to various different messages, planarize the internal data of the messages and then extract and analyze the data, so that the whole process can be configured, and the online can be realized without stopping the machine 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 the present embodiment;
fig. 2 is a block diagram of a general packet processing device based on HTTP in this embodiment.
Detailed Description
The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments, and it is apparent that the described embodiments are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by a person skilled in the art without any inventive effort, are intended to be within the scope of the present invention, based on the embodiments of the present invention.
Referring to fig. 1-2, the present embodiment provides a general message processing method and apparatus based on HTTP protocol:
the embodiment of the invention provides a general message processing method based on the HTTP protocol, which comprises the following steps: as shown in fig. 1, the general message processing method based on the HTTP protocol includes:
s100, acquiring a corresponding parameter extraction rule according to the received HTTP request message.
In one embodiment, obtaining the corresponding parameter extraction rule according to the received HTTP request message includes: and acquiring a corresponding parameter extraction rule according to the 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 message.
In one embodiment, the general packet processing method further includes: corresponding parameter extraction rules are set 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 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 into a dictionary structure from a QueryString structure based on a preset first planarization algorithm, and executing S700.
For example, the first planarization algorithm is: 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, executing S500 if the message format of the HTTP request message is an xml format, and executing S600 if the message format of the HTTP request message is a json format.
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 prompt information 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 "unsupported" prompt message is returned to prompt the sender that the HTTP request message in the format is not supported.
S500, converting the HTTP request message into a dictionary structure from a tree structure based on a preset second planarization algorithm, and then executing S700.
In one embodiment, converting the HTTP request message from a tree structure to a dictionary structure based on a preset second planarization algorithm includes: and recursively traversing all leaf nodes in the HTTP request message, and adding a character string- > between the names of the parent and child nodes as connection.
If the xml format does not have the attribute, generating a Path Value;
and if the xml format has the attribute, generating a 'Path- > #text' Value and a 'Path- > @ attribute' Value.
S600, converting the HTTP request message into a dictionary structure from a tree 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 json and xml, the form of an order traversal may be used, if the current node is not a leaf node, then generate: the path of the "ancestor- > father- >" style and passes on to the next level of recursion with the path as a parameter. If the current node is a leaf node, three cases are: (1) Json, taking the name of a leaf node, combining the leaf node name into a 'ancestor- > father- > son' form as a key, taking the value of the leaf node as a value, and adding a dictionary; (2) xml: if the node does not have the attribute, only a pair of keys are generated in the same way as (1), (1) and (2); (3) xml: the node is provided with an attribute, and according to the attribute, a ' ancestor- > father- > son- > attribute 1 ', ' ancestor- > father- > son- > attribute 2 ', … … ', a ' ancestor- > father- > son- > attribute N ', ' ancestor- > father- > son- > texto ' style is formed, a group of keys are generated, and a dictionary is added.
In one embodiment, converting the HTTP request message from a tree structure to a dictionary structure based on a preset third planarization algorithm includes: and recursively traversing all leaf nodes in the HTTP request message, and adding a character string- > between the names of the parent and child nodes as connection.
Because the tree structure does not support the query of the fuzzy path and the regular expression query path, the query is difficult to realize by an indirect means; the dictionary structure can realize fuzzy and regular query through circulating Key, and has the characteristics of high query speed and the like.
In one embodiment, when the HTTP request message is converted from a tree structure to a dictionary structure, each leaf node is converted into two facts and the two facts are encapsulated into one help class. Since the key length of the dictionary structure is long after the tree structure is converted into the dictionary structure, there is a problem of path assembly when programming and calling, 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 the leaf node into two sections, namely a section 1 and a section 2: where subject 1 is an index dictionary (which functions to record the absolute path of the thumbnail key):
{
"b": ["a->b->[0]", "a->b->[1]"],
"c": ["a->c"],
"e": ["a->d->e", "a->c->e"]
}
and the part 2 is a path, a value dictionary (which is used for recording the value corresponding to the absolute path):
{
"a->b->[0]": 1,
"a->b->[1]": 2,
"a->c": 2,
"a->d->e": 3,
"a->c->e": 4
}
these two facts are then encapsulated into a help class, which is assumed to be named PlatTreeHelper { subject 1, subject 2 }.
After instantiation: pth= new PlatTreeHelper (); can be applied as follows
1) By passing through
pth.Parse("<a><b>1</b><b>2</b><c>2</c><c><e>3</e></c><d><e>3</e></d></a>");
Two text may be generated.
2) The value of the eNode can be obtained by pth.find ("e"): the find method is to get the complete path by querying the subject 1: a- > d- > e, and then taking the fact 2 for implementation, the speed is high, and the problem that the path is too long is not worried during programming.
3) The unique value 4 is obtained through pth.find ("c- > e"), the method is that key of the direct 2 is circulated, and then the comparison is carried out through the character string, and the method is poor in efficiency and flexible in inquiry.
4) By passing throughThe unique value 4 is obtained, the method is to directly circulate key of the direct 2 and compare the key with regular, and the method has poor efficiency but flexible inquiry.
5) The 3 rd and 4 th methods scan all keys, which are inefficient and can pass
pth.find ("c- > e, e") defines the scan in [ "a- > d- > e", "a- > c- > e" ].
6) Implementation method of find function (pseudo code implementation):
value list common lookup method (path) {
If (index dictionary exists path index) {
Taking the values of all the specific paths below, and returning the composition list
{ otherwise {
If (comma included in path) {
The first part is then the path we need to find
The second part is then the [ search range ]
{ otherwise {
The whole dictionary is [ search scope ]
}
If (regular expression contained in the first part) {
We traverse each option in the search scope with regular de-traversal
The result of the matching is put into a return list
{ otherwise {
We go through by means of string lookup
The result of the matching is put into a return list
}
}
Returning a result list;
}
some extended usage:
7) By pth.find ("c- > e|d- > e"), it can be checked that if the c- > e value is not null, the value of c- > e is returned, otherwise the value of d- > e is returned.
8) By pth.find ("c & d- > e"), the values of unique leaf nodes c and d- > e can be taken simultaneously, combined into sets of returns: [2,4].
9) There is one
PTh.Parse ("< stds > < std > < name > sheet three < age > < 8 </std > < name > Li four < name > < age > < 9 </std > </stds >").
The age of Zhang Sang can be obtained by pth.find ("age/name=Zhang Sang").
10 Advanced lookup algorithm description:
1. the front is not satisfied to find the rear: c- > e|d- > e
2. The results are as follows: c & d- > e
3. The leading edge results are also extrapolated from the following results: age/name = Zhang San
Priority level: 3 > 2 > 1, supporting bracket expressions
Complex path: (a- > b|c- > d) & e- > f & age/name=Zhangsan/sex=men|g|h
11 Syntax analysis derivative of advanced lookup algorithm implementation:
path expression syntax analysis:
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= > character string taking function
val= > taking a digital function
12 Verifying:
(a- > b|c- > d) & age/name=Zhangsan/sex=men|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=Zhangsan/sex=men|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 = Zhangsan_val_expr2_and_expr_or_expr = >
or_expr= > (a- > b|c- > d) & age/name = Zhang san/_pv_expr_and_expr_or_expr = >
or_expr= > (a- > b|c- > d) & age/name = Zhang san/path_val_expr_and_expr_or_expr = >
or_expr= > (a- > b|c- > d) & age/name = Zhang san/sex_val_expr_and_expr_or_expr
or_expr= > (a- > b|c- > d) & age/name = Zhang san/sex = val_val_expr2_and_expr_or_expr = >
or_expr= > (a- > b|c- > d) & age/name = Zhangsan/sex = men epsilon_and_expr_or_expr = >
(a- > b|c- > d) & age/name=Zhangsan/sex=men|g|h
or_expr= > (a- > b|c- > d) & age/name=Zhangsan/sex=men_or_expr
or_expr= > (a- > b|c- > d) & age/name=Zhangsan/sex=men|or_expr
or_expr= > (a- > b|c- > d) & age/name = Zhangsan/sex = men|and_expr_or_expr
or_expr= > (a- > b|c- > d) & age/name = Zhang san/sex = men|comp_expr_and_expr_or_expr = >
or_expr= > (a- > b|c- > d) & age/name = Zhang san/sex = men|qry_expr_and_expr_or_expr = >
or_expr= > (a- > b|c- > d) & age/name = Zhang san/sex = man|path_qry_expr_and_expr_or_expr = >
or_expr= > (a- > b|c- > d) & age/name=Zhangsan/sex=men|g epsilon epsilon_or_expr
(a- > b|c- > d) & age/name=Zhangsan/sex=men|g|h
or_expr= > (a- > b|c- > d) & age/name=Zhangsan/sex=men|g epsilon|or_expr = >
or_expr= > (a- > b|c- > d) & age/name = Zhang san/sex = men|g|and_expr_or_expr
or_expr= > (a- > b|c- > d) & age/name = Zhang san/sex = men|g|comp_expr_and_expr_or_expr = >
or_expr= > (a- > b|c- > d) & age/name = Zhang san/sex = men|g|qry_expr_and_expr_or_expr = >
or_expr= > (a- > b|c- > d) & age/name = Zhang san/sex = men|g|path_qry_expr_and_expr_or_expr =men|g|path_qry_expr_and_expr_or_expr
or_expr= > (a- > b|c- > d) & age/name = Zhang san/sex = men|g|h_qry_expr_and_expr_or_expr =men|g|qry_expr_and_expr_o_expr
or_expr= > (a- > b|c- > d) and age +. name=Zhang san/sex=men|g|h|epsilon epsilon
or_expr= > (a- > b|c- > d) & age/name=Zhangsan/sex=men|g|h
Grammar rule validation success-!
13 The following overall application:
an api table defining an api_id and a corresponding path;
TABLE 1 api Table
The c_api_paramter table allows the same api to accommodate different access messages as follows:
source 1 accesses the message:
curl-d '< root > < username > </root >' http:// baseUrl/api1
Source 2 accesses the message:
curl-d '{ "root" { "user": "student-Zhang Sanzh} }' http:// baseUrl/api1
Then our table configuration is table 2;
TABLE 2
Finally, we unify the usernames of source 1 and source 2 in the program, without defining two different entity classes to convert, and the final usernames are all "Zhang San", the value.
The above describes a path query approach (similar to xml xpath) that is used for planarized dictionary path queries to achieve "unique matching, regular matching, preferential matching, conditional matching, multipath matching" for paths, i.e., this rule can simplify configuration. Different value-taking algorithms are available for json, xml and QueryString, and the value-taking algorithms are unified for the data structure of planarization.
S700, reading target parameters from the HTTP request message based on the parameter extraction rule.
S800, generating an HTTP response message according to the target parameters.
One embodiment of the present invention provides a general message processing device based on HTTP protocol, including: as shown in fig. 2, the general packet processing device based on the HTTP protocol includes a processor and a memory, where the processor and the memory are connected by a communication bus, the memory is used to store program codes and data of the general packet processing method based on the HTTP protocol, and the processor is used to call the program instructions in the memory to execute the steps described in the general packet processing method based on the HTTP protocol in the above embodiment.
The foregoing is merely a preferred embodiment of the invention, and it is to be understood that the invention is not limited to the form disclosed herein but is not to be construed as excluding other embodiments, but is capable of numerous other combinations, modifications and environments and is capable of modifications within the scope of the inventive concept, either as taught or as a matter of routine skill or knowledge in the relevant art. And that modifications and variations which do not depart from the spirit and scope of the invention are intended to be within the scope of the appended claims.

Claims (2)

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 executing S700;
s400, judging the message format of the HTTP request message, if the message format of the HTTP request message is an xml format, executing S500, and if the message format of the HTTP request message is a json format, executing S600;
s500, converting the HTTP request message into a dictionary structure from a tree structure based on a preset second planarization algorithm, and then executing S700;
s600, converting the HTTP request message into a dictionary structure from a tree 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 rule;
s800, generating an HTTP response message according to the target parameter;
for xml format and json format, the planarization method is: for json and xml, the form of an order traversal may be used, if the current node is not a leaf node, then generate: a path of the 'ancestor- > father- >' style and passes the path to the next level of recursion as a parameter; if the current node is a leaf node, three cases are: (1) Json, taking the name of a leaf node, combining the leaf node name into a 'ancestor- > father- > son' form as a key, taking the value of the leaf node as a value, and adding a dictionary; (2) xml: if the node does not have the attribute, only a pair of keys are generated in the same way as (1), (1) and (2); (3) xml: the node has attributes, and forms a ' ancestor- > father- > son- > attribute 1 ', ' ancestor- > father- > son- > attribute 2 ', … … ', a ' ancestor- > father- > son- > attribute N ', ' ancestor- > father- > son- > texto ' style, a set of keys are generated according to the attributes, and a dictionary is added;
when the HTTP request message is converted into a dictionary structure from a tree structure, each leaf node is converted into two dicts, and the two dicts are packaged into a help class;
obtaining a corresponding parameter extraction rule according to the received HTTP request message, wherein the parameter extraction rule comprises the following steps:
acquiring a corresponding parameter extraction rule according to a sender of the received HTTP request message;
the general message processing method further comprises the following steps:
setting a corresponding parameter extraction rule for each sender;
in the step 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.
2. The general message processing device based on the HTTP protocol, comprising a processor and a memory, wherein the memory is used for storing program codes and data of the general message processing method based on the HTTP protocol, and the processor is used for calling program instructions in the memory to execute the general message processing method based on the HTTP protocol according to claim 1.
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 CN115292624A (en) 2022-11-04
CN115292624B true 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 (1)

* Cited by examiner, † Cited by third party
Title
一种基于HTML5的安全跨文档消息传递方案;李潇宇;张玉清;刘奇旭;郑晨;;中国科学院研究生院学报(第01期);第127-133页 *

Also Published As

Publication number Publication date
CN115292624A (en) 2022-11-04

Similar Documents

Publication Publication Date Title
US10324909B2 (en) Omega names: name generation and derivation utilizing nested three or more attributes
US10063649B2 (en) Data translation using a proxy service
US10904105B2 (en) Declarative and reactive data layer for component-based user interfaces
CN108696381B (en) Protocol configuration method and device
US20150149599A1 (en) Remote selection and authorization of collected media transmission
US20110196891A1 (en) Class loading using java data cartridges
US20160253304A1 (en) Method for controlling access to electronic documents based on stateless communication
US20090063423A1 (en) User interfaces for service object located in a distributed system
JP6734404B2 (en) Enable Semantics Inference Service in M2M/IOT Service Layer
US9483508B1 (en) Omega names: name generation and derivation
CN110727417B (en) Data processing method and device
US20240184620A1 (en) Invoking functions of agents via digital assistant applications using address templates
US10606568B2 (en) Method and apparatus for compiling computer language
CN115292624B (en) General message processing method and device based on HTTP protocol
US8095625B2 (en) Directory server plug-in call ordering
CN115168365B (en) Data storage method and device, electronic equipment and storage medium
EP2294793A1 (en) User interfaces for service object located in a distributed system
CN111563215A (en) Method and device for controlling front-end operation authority and related equipment
CN116149632A (en) Business logic customizing method and device, computer equipment and storage medium
CN114281842A (en) Method and device for sub-table query of database
WO2022164718A1 (en) Optimized data resolution for web components
KR100691261B1 (en) System and method for supporting xquery update language
US8312429B2 (en) Cell based data processing
CN117407457B (en) Multi-source data fusion method, system and equipment based on configurable rules
US11960507B2 (en) Hierarchical data

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