CN113438134B - Request message processing method, device, server and medium - Google Patents

Request message processing method, device, server and medium Download PDF

Info

Publication number
CN113438134B
CN113438134B CN202110743089.0A CN202110743089A CN113438134B CN 113438134 B CN113438134 B CN 113438134B CN 202110743089 A CN202110743089 A CN 202110743089A CN 113438134 B CN113438134 B CN 113438134B
Authority
CN
China
Prior art keywords
target
request
processor
request message
interface
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
CN202110743089.0A
Other languages
Chinese (zh)
Other versions
CN113438134A (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.)
Henan Xufang Technology Co ltd
Original Assignee
Weikun Shanghai Technology Service 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 Weikun Shanghai Technology Service Co Ltd filed Critical Weikun Shanghai Technology Service Co Ltd
Priority to CN202110743089.0A priority Critical patent/CN113438134B/en
Publication of CN113438134A publication Critical patent/CN113438134A/en
Application granted granted Critical
Publication of CN113438134B publication Critical patent/CN113438134B/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
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/145Network analysis or design involving simulating, designing, planning or modelling of a network
    • 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]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures

Abstract

The embodiment of the application discloses a request message processing method, a device, a server and a medium, wherein the request message processing method comprises the following steps: firstly, acquiring a target request message, wherein the target request message comprises interface parameters of a processor interface, the interface parameters are used for indicating a request type and/or a request identification code corresponding to the processor interface, then determining a target processor corresponding to the interface parameters according to the interface parameters and a first mapping relation, the first mapping relation comprises a corresponding relation between the interface parameters of the processor interface and the processor, and finally, processing the target request message through the target processor to generate a target response message. By adopting the method and the device, the correspondence between the request message and the server can be ensured, the processing efficiency of the target request message is improved, and the error rate of the target request message is reduced.

Description

Request message processing method, device, server and medium
Technical Field
The present application relates to the field of project testing technologies, and in particular, to a request packet processing method, apparatus, server, and medium.
Background
In the project testing process, a plurality of simultaneously developed collaborators often depend on each other, and the dependence can restrict each other in the project testing process and even influence the project construction period. Therefore, in the development process of the project, a simulation tool is generally used for simulating the expected return result of the request message, and the development joint debugging efficiency is improved.
The conventional simulation tool does not support complex processing of messages, does not support dynamic result return according to requests, is not friendly to support a remote test environment, needs to spend much manpower to maintain simulation data, does not have a general solution, and the whole simulation processing flow is lack of standardization.
Disclosure of Invention
Embodiments of the present application provide a method, an apparatus, a server, and a medium for processing a request packet, which may ensure correspondence between the request packet and the server, improve processing efficiency of a target request packet, and reduce an error rate of the target request packet.
In a first aspect, an embodiment of the present application provides a method for processing a request packet, where the method includes:
acquiring a target request message, wherein the target request message comprises interface parameters of a processor interface, and the interface parameters are used for indicating a request type and/or a request identification code corresponding to the processor interface;
determining a target processor corresponding to the interface parameter according to the interface parameter and a first mapping relation, wherein the first mapping relation comprises the corresponding relation between the interface parameter of a processor interface and a processor;
and processing the target request message through the target processor to generate a target response message.
Wherein, the obtaining the target request message includes:
acquiring a test request message, wherein the test request message comprises an Internet Protocol (IP) address of a request application;
testing the request application according to the test request message;
and acquiring the target request message from the request application from the IP address.
If the target processor is a first processor, the processing the target request packet by the target processor to generate a target response packet includes:
determining the request type of the target request according to the target request message;
acquiring a configuration file corresponding to the request type according to the request type and a second mapping relation, wherein the second mapping relation comprises the corresponding relation between the request type and the configuration file, the configuration file comprises configuration information, and the configuration information is used for indicating message coding and message interaction format;
determining a target template of the target request message according to the configuration file;
assigning a template variable of the target template;
and generating the target response message of the target request message according to the assigned target template.
If the target processor is a second processor, the processing the target request packet by the target processor to generate a target response packet includes:
acquiring a code input by a user, wherein the code is used for indicating a processing rule of the target request message, and the processing rule is used for restricting the content of a target response message of the target request message;
and generating the target response message according to the code and the target request message.
If the target processor is a third processor, the processing the target request packet by the target processor to generate a target response packet includes:
generating a characteristic vector of the processor target request message according to the interface parameter;
and importing the characteristic vector into a pre-trained network model to obtain the target response message.
Wherein, after the target processor processes the target request message and generates a target response message, the method further comprises:
generating a digital signature according to a private key, wherein the digital signature is used for triggering a request application of the target request message to perform signature authentication of the digital signature;
signing the target response message through the digital signature to obtain the signed target response message;
and sending the signed target response message to the request application.
In a second aspect, an embodiment of the present application provides a request packet processing apparatus, where the apparatus includes:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a target request message, the target request message comprises interface parameters of a processor interface, and the interface parameters are used for indicating a request type and/or a request identification code corresponding to the processor interface;
a processor determining unit, configured to determine a target processor corresponding to the interface parameter according to the interface parameter and a first mapping relationship, where the first mapping relationship includes a correspondence relationship between the interface parameter of the processor interface and the processor;
and the response message generating unit is used for processing the target request message through the target processor and generating a target response message.
In the aspect of acquiring the target request packet, the acquiring unit is specifically configured to:
acquiring a test request message, wherein the test request message comprises an Internet Protocol (IP) address of a request application;
testing the request application according to the test request message; and (c) a second step of,
and acquiring the target request message from the request application from the IP address.
Wherein, in the aspect that the target request packet is processed by the target processor and a target response packet is generated if the target processor is the first processor, the response packet generating unit is specifically configured to:
determining the request type of the target request according to the target request message;
acquiring a configuration file corresponding to the request type according to the request type and a second mapping relation, wherein the second mapping relation comprises the corresponding relation between the request type and the configuration file, the configuration file comprises configuration information, and the configuration information is used for indicating message coding and message interaction format;
determining a target template of the target request message according to the configuration file;
assigning a template variable of the target template;
and generating the target response message of the target request message according to the assigned target template.
Wherein, in the aspect that the target request packet is processed by the target processor and a target response packet is generated if the target processor is a second processor, the response packet generating unit is specifically configured to:
acquiring a code input by a user, wherein the code is used for indicating a processing rule of the target request message, and the processing rule is used for restricting the content of a target response message of the target request message;
and generating the target response message according to the code and the target request message.
Wherein, in the aspect that the target request packet is processed by the target processor and a target response packet is generated if the target processor is a third processor, the response packet generating unit is specifically configured to:
generating a characteristic vector of the processor target request message according to the interface parameter;
and importing the characteristic vector into a pre-trained network model to obtain the target response message.
Wherein, the device still includes: a signature adding unit, configured to generate a digital signature according to a private key after the target request packet is processed by the target processor and a target response packet is generated, where the digital signature is used to trigger a request application of the target request packet to perform signature authentication of the digital signature;
signing the target response message through the digital signature to obtain the signed target response message;
and sending the signed target response message to the request application.
In a third aspect, embodiments provide a server comprising a processor, a memory, a communication interface, and one or more programs stored in the memory and configured to be executed by the processor, the one or more programs including instructions for performing steps in a method as described below:
acquiring a target request message, wherein the target request message comprises interface parameters of a processor interface, and the interface parameters are used for indicating a request type and/or a request identification code corresponding to the processor interface;
determining a target processor corresponding to the interface parameter according to the interface parameter and a first mapping relation, wherein the first mapping relation comprises the corresponding relation between the interface parameter of a processor interface and a processor;
and processing the target request message through the target processor to generate a target response message.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program for electronic data exchange, wherein the computer program causes a computer to execute the steps in the method as follows:
acquiring a target request message, wherein the target request message comprises interface parameters of a processor interface, and the interface parameters are used for indicating a request type and/or a request identification code corresponding to the processor interface;
determining a target processor corresponding to the interface parameters according to the interface parameters and a first mapping relation, wherein the first mapping relation comprises the corresponding relation between the interface parameters of a processor interface and a processor;
and processing the target request message through the target processor to generate a target response message.
In the embodiment of the application, firstly, a target request message is obtained, the target request message includes interface parameters of a processor interface, the interface parameters are used for indicating a request type and/or a request identification code corresponding to the processor interface, then, a target processor corresponding to the interface parameters is determined according to the interface parameters and a first mapping relation, the first mapping relation includes a corresponding relation between the interface parameters of the processor interface and the processor, and finally, the target request message is processed through the target processor to generate a target response message. By adopting the method and the device, the interface parameters of the server interface are corresponding to the request type and/or the request identification code of the request message, so that the correspondence between the request message and the server can be ensured, the processing efficiency of the target request message is improved, and the error rate of the target request message is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a request message processing system according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a request packet processing method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a request packet processing apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a server according to another embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
The terms "first," "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, apparatus, and storage medium, product, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may alternatively include other steps or elements not expressly listed or inherent to such process, method, product, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the technical solutions of the present application better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
At present, a common simulation tool does not support complex processing of messages, does not support dynamic result return according to requests, is not friendly to support a remote test environment, needs to spend a lot of manpower to maintain simulation data, does not have a general solution, and the whole simulation processing flow is lack of standardization.
Based on the above problem, an embodiment of the present invention provides a method for processing a request packet, which is described in detail below. Referring to fig. 1, fig. 1 is a schematic diagram illustrating an architecture of a request message processing system according to an embodiment of the present application. As shown in fig. 1, the request message processing system includes a server 110 and an electronic device 120, and b =3 is taken as an example for explanation. A data transmission channel can be created between the server 110 and the electronic device 120 for data transmission, and the electronic devices 120 can also communicate with each other.
Based on the system architecture shown in fig. 1, the server 110 can obtain a target request message from the electronic device 120, where the target request message includes interface parameters of a processor interface, and the interface parameters are used to indicate a request type and/or a request identification code corresponding to the processor interface; determining a target processor corresponding to the interface parameter according to the interface parameter and a first mapping relation, wherein the first mapping relation comprises the corresponding relation between the interface parameter of a processor interface and a processor; and processing the target request message through the target processor to generate a target response message. By corresponding the interface parameters of the server interface with the request type and/or the request identification code of the request message, the correspondence between the request message and the server can be ensured, the processing efficiency of the target request message is improved, and the error rate of the target request message is reduced.
It should be noted that the form and the number of the servers 110 and the electronic devices 120 shown in fig. 1 are only for example and do not limit the embodiments of the present application.
A request packet processing method in the embodiment of the present application is described below with reference to fig. 2, where fig. 2 is a schematic flow chart of the request packet processing method provided in the embodiment of the present application, and the method is applied to a server, and the method specifically includes the following steps S101 to S103.
S101, a target request message is obtained, wherein the target request message comprises an interface parameter of a processor interface, and the interface parameter is used for indicating a request type and/or a request identification code corresponding to the processor interface.
The target request may be a transaction request, a text processing request, an image processing request, etc., and is not particularly limited. The interface parameters may include, but are not limited to, a request type and/or a request identification code of the target request.
In a specific implementation, when the target request is a transaction request, the interface parameter may be a transaction type and a transaction code; when the target request is an image processing request, the interface parameter may be an image type and an image encoding; when the target request is a text processing request, the interface parameter may be a text type and a text encoding.
The implementation manner of obtaining the processor target request message may be: acquiring a test request message, wherein the test request message comprises an Internet Protocol (IP) address of a request application; testing the request application according to the test request message; and acquiring the target request message from the request application from the IP address.
When the request application runs in the electronic equipment, under the condition that the test request message carries the IP address of the request application, the server can generate a corresponding test instruction based on the IP address and send the test instruction to the electronic equipment where the IP address is located, so that the electronic equipment runs the request application according to the test instruction to obtain running information of the request application and sends the running information to the server, and the server identifies the target request message in the running information after receiving the running information from the electronic equipment from the IP address.
Further, the implementation manner of obtaining the test request message may be: and monitoring at a Transmission Control Protocol (TCP) port and a hypertext transfer protocol (Http) port to acquire a test request message.
As can be seen, in this example, the TCP port and the Http port are monitored to obtain the test request information carrying the IP address of the request application, the IP of the request application in the test request information is identified, the request application is tested based on the IP address, and the target request generated in the test process is identified.
S102, determining a target processor corresponding to the interface parameter according to the interface parameter and a first mapping relation, wherein the first mapping relation comprises a corresponding relation between the interface parameter of a processor interface and a processor.
The first mapping relation is set in the server in advance, in other words, the processor is marked by the interface parameter, and different processors correspond to different interface parameters.
In a specific implementation, a corresponding relationship between a request type and/or a request identification code and a processor may be preset, where a processor interface corresponds to a processor, one processor interface corresponds to one processor, different processor interfaces correspond to different processors, and the request type and/or the request identification code corresponds to the processor interface, that is, when an interface parameter is used to indicate the request type and/or the request identification code corresponding to the processor interface, the request type and/or the request identification code corresponds to the processor where the processor interface is located.
In specific implementation, three processors are preset, including a first processor, a second processor and a third processor, where the first processor is a template-based processor, the second processor is a custom processor, and the third processor is a model prediction processor, and the three processors have priority levels from high to low in order of the first processor, the second processor and the third processor, that is, in a process of determining to process a target request packet, it is determined whether the target request packet can be processed by the first processor, if the target request packet cannot be processed by the first processor, it is determined whether the target request packet can be processed by the second processor, and if the target request packet cannot be processed by the second processor, it is processed by the third processor.
S103, processing the target request message through the target processor to generate a target response message.
It can be seen that, in the embodiment of the present application, first, an object request packet is obtained, where the object request packet includes an interface parameter of a processor interface, the interface parameter is used to indicate a request type and/or a request identification code corresponding to the processor interface, then, an object processor corresponding to the interface parameter is determined according to the interface parameter and a first mapping relationship, where the first mapping relationship includes a correspondence relationship between the interface parameter of the processor interface and the processor, and finally, the object request packet is processed by the object processor to generate an object response packet. Therefore, by adopting the method and the device, the interface parameters of the server interface are corresponding to the request type and/or the request identification code of the request message, the correspondence between the request message and the server can be ensured, the processing efficiency of the target request message is improved, and the error rate of the target request message is reduced.
Optionally, if the target processor is a first processor, processing the target request packet by the target processor to generate a target response packet includes: determining the request type of the target request according to the target request message; acquiring a configuration file corresponding to the request type according to the request type and a second mapping relation, wherein the second mapping relation comprises the corresponding relation between the request type and the configuration file, the configuration file comprises configuration information, and the configuration information is used for indicating message coding and message interaction format; determining a target template of the target request message according to the configuration file; assigning a template variable of the target template; and generating the target response message of the target request message according to the assigned target template.
The first processor is a template-based processor.
It should be noted that the request messages of different request types correspond to different templates, a corresponding template is set in advance for each request type of request message according to needs, each template corresponds to a different template variable, and a corresponding template variable is set in advance for each template according to needs.
The rule processing in the target template supports four ways, wherein the first returned field is from a request message, the second is from a request floor message to be queried, for example, there are two target request messages, one is a submission request, the other is a query request, the submission request and the query request include the same field, such as a transaction serial number, when the return result of the query request is generated, the query database finds the value of the field when the submission request is submitted according to the serial number when the submission request is submitted, it can be understood that the system records the field to be queried to the database when the submission request is submitted. And the third is conditional generation, which presets the corresponding relation between the request parameter and the result, and when processing the target request message, according to the content of the request parameter, queries the corresponding relation to return the corresponding result. The fourth is self-generated or randomly generated, such as returning the current time.
Optionally, if the target processor is a second processor, processing the target request packet by the target processor to generate a target response packet includes: acquiring a code input by a user, wherein the code is used for indicating a processing rule of the target request message, and the processing rule is used for restricting the content of a target response message of the target request message; and generating the target response message according to the code and the target request message.
Wherein the second processor is a custom processor.
In specific implementation, if the target request message is processed by the custom processor, the user writes corresponding codes in the project to assemble the returned message according to the interface document of the processor interface.
When the custom processor processes the target request message, specifically, the user may write a corresponding code to implement at least one of the following.
First, the content of the target response message is obtained from the request content of the target request message.
And secondly, when the target request message is an inquiry request message, acquiring a request serial number of the inquiry request, and inquiring a value recorded when a submission request corresponding to the inquiry request is submitted according to the request serial number.
And thirdly, generating according to a value setting condition of the content of the target request message, namely, setting a corresponding relation between the request parameter and the content of the response message, and when the target request message is processed, inquiring the corresponding relation according to the content of the request parameter to return a corresponding response message, for example, the set corresponding relation may be that when the request amount of the target request message is between 20 and 30, the response message includes that the request result is failed, when the request amount of the target request message is 10, the response message includes that the request result is processed, and when the request amount of the target request message is other than 20 to 30, and 10, the response message includes that the request result is successful.
Fourthly, the content of the target request message is a randomly generated value or a corresponding value is configured to the database according to the requirement, and then the database is inquired to obtain a response message of the target request message.
In this example, the target request message may be processed by the custom processor, which is convenient for a user with code experience to process the corresponding target request message.
Optionally, if the target processor is a third processor, processing the target request packet by the target processor to generate a target response packet includes: generating a characteristic vector of the processor target request message according to the interface parameter; and importing the characteristic vector into a pre-trained network model to obtain the target response message.
The method includes that different processor interfaces correspond to different interface parameters (request type and request identification code), namely, when a target request message is processed, a third processor is determined according to the request type and the request identification code, then a feature vector of the target request message is generated based on the interface parameters, and the feature vector is imported into a pre-trained network model to obtain a response message of the target request message.
It should be noted that the training process of the network model includes: acquiring a plurality of data samples, wherein one data sample comprises a target request message-target response message pair; preprocessing the plurality of data samples to obtain a plurality of characteristic vectors; and obtaining a corresponding network model according to the plurality of feature vectors.
The data samples of the network model may be 1000, 2000, 500, etc., and may be set as required.
Specifically, data sample preprocessing is performed first, and parameters and values corresponding to each data sample are represented as vectors. Assuming that the number of different characters in the data set is N, each character has a one-to-one correspondence with a consecutive integer value index from 0 to N-1. If the index of a character is an integer i, a vector with the length of N and all 0 s is created, and the element with the position of i is set to be 1, and the vector is the one-hot vector of the original character. In consideration of the fixity of the interface parameters in the message, the interface parameters may be mapped as a whole.
The network model needs to complete the mapping from the matrix after the input request message is processed to the matrix after the response message is processed.
In the process of training the network model, a data set is divided into a test set and a training set, the test set and the training set are input into the network model by using a cross validation method, and based on a residual square loss function, the gradient iteration model parameters calculated by back propagation are used for training, so that the optimal network model parameters are finally obtained.
As can be seen, in this example, the input request message can be mapped to a response message, that is, the response message of the request message submitted by the user can be predicted based on the network model.
It can be seen that, in this example, by presetting a corresponding relationship between interface parameters and processors, when a target request is generated, the target request is made to carry the interface parameters, so that a target processor that processes the target request can be determined based on the interface parameters carried by the target request, so as to implement processing of the target request by the target processor, obtain a response packet of the target request, and finally implement feedback of the target request.
In a possible embodiment, after the target request message is processed by the target processor to generate a target response message, the method further includes: generating a digital signature according to a private key, wherein the digital signature is used for triggering a request application of the target request message to perform signature authentication of the digital signature; signing the target response message through the digital signature to obtain the signed target response message; and sending the signed target response message to the request application.
The private key is preset by the request application and the target processor, the request application carries out signature authentication on the digital signature after receiving the second response message, the target response message can be obtained only after the authentication is passed, and the target response message cannot be obtained if the authentication is not passed.
As can be seen, in this example, by tagging the response packet, the security of data interaction between the requester of the target request packet and the server is improved.
Optionally, the server and the electronic device in the present application may both refer to any node device in a block chain, where the block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission (P2P transmission), a consensus mechanism, and an encryption algorithm, and is essentially a decentralized database; the blockchain can be composed of a plurality of serial transaction records (also called blocks) which are connected in series by cryptography and protect the contents, and the distributed accounts connected in series by the blockchain can effectively record the transactions by multiple parties and can permanently check the transactions (can not be tampered). The consensus mechanism is a mathematical algorithm for establishing trust and obtaining rights and interests among different nodes in the block chain network; that is, the consensus mechanism is a mathematical algorithm that is commonly agreed upon by the network nodes of the blockchain. The method and the device can utilize a consensus mechanism of the block chains to restore the target image into the target request message for processing, and can improve the accuracy of the processing of the restored target request message.
For example, if the execution results of the steps S101 to S103 are subjected to consensus verification by each node device in the block chain, and the execution result of each step is passed through the consensus verification, it may be determined that the processing accuracy of generating the target request packet is higher; if the execution result of the existing step is not verified by the consensus, it may be determined that the accuracy of the target request message generation process is relatively low, and the node device may execute the above steps S101 to S103 again to re-acquire the target request message process. Or, each node device in the block chain may perform consensus verification on the target request packet processing (i.e., only the execution result of step S103), and if the consensus verification passes, it is determined that the accuracy of the target request packet processing is higher; if the consensus verification fails, it is determined that the accuracy of the target request message processing is low, and the node device may perform the steps S101 to S103 again to re-acquire the target request message processing.
Fig. 3 is a schematic structural diagram of a request message processing apparatus 200 according to an embodiment of the present application, where the request message processing apparatus according to the embodiment of the present application may be in the above-mentioned server. In this embodiment, the request packet processing apparatus includes:
an obtaining unit 210, configured to obtain a target request packet, where the target request packet includes an interface parameter of a processor interface, and the interface parameter is used to indicate a request type and/or a request identifier corresponding to the processor interface;
a processor determining unit 220, configured to determine a target processor corresponding to the interface parameter according to the interface parameter and a first mapping relationship, where the first mapping relationship includes a correspondence relationship between the interface parameter of the processor interface and the processor;
a response message generating unit 230, configured to process the target request message through the target processor, and generate a target response message.
In the aspect of obtaining the target request packet, the obtaining unit 210 is specifically configured to:
acquiring a test request message, wherein the test request message comprises an Internet Protocol (IP) address of a request application;
testing the request application according to the test request message; and the number of the first and second groups,
and acquiring the target request message from the request application from the IP address.
In the aspect that, if the target processor is the first processor, the target request packet is processed by the target processor to generate a target response packet, the response packet generating unit 230 is specifically configured to:
determining the request type of the target request according to the target request message;
acquiring a configuration file corresponding to the request type according to the request type and a second mapping relation, wherein the second mapping relation comprises the corresponding relation between the request type and the configuration file, the configuration file comprises configuration information, and the configuration information is used for indicating message coding and message interaction format;
determining a target template of the target request message according to the configuration file;
assigning a template variable of the target template;
and generating the target response message of the target request message according to the assigned target template.
In the aspect that, if the target processor is a second processor, the target request packet is processed by the target processor to generate a target response packet, where the response packet generating unit 230 is specifically configured to:
acquiring a code input by a user, wherein the code is used for indicating a processing rule of the target request message, and the processing rule is used for restricting the content of a target response message of the target request message;
and generating the target response message according to the code and the target request message.
In the aspect that, if the target processor is a third processor, the target request packet is processed by the target processor to generate a target response packet, the response packet generating unit 230 is specifically configured to:
generating a characteristic vector of the processor target request message according to the interface parameter;
and importing the characteristic vector into a pre-trained network model to obtain the target response message.
The request message processing apparatus 200 further includes: a signature adding unit, configured to generate a digital signature according to a private key after the target request packet is processed by the target processor and a target response packet is generated, where the digital signature is used to trigger a request application of the target request packet to perform signature authentication of the digital signature;
signing the target response message through the digital signature to obtain the signed target response message;
and sending the signed target response message to the request application.
In the embodiment of the application, firstly, a target request message is obtained, the target request message includes interface parameters of a processor interface, the interface parameters are used for indicating a request type and/or a request identification code corresponding to the processor interface, then, a target processor corresponding to the interface parameters is determined according to the interface parameters and a first mapping relation, the first mapping relation includes a corresponding relation between the interface parameters of the processor interface and the processor, and finally, the target request message is processed through the target processor to generate a target response message. By adopting the method and the device, the interface parameters of the server interface are corresponding to the request type and/or the request identification code of the request message, so that the correspondence between the request message and the server can be ensured, the processing efficiency of the target request message is improved, and the error rate of the target request message is reduced.
Referring to fig. 4, which is a schematic structural diagram of a server provided in the embodiment of the present application, as shown in fig. 4, a server 300 in the embodiment may include: a processing module 310, a memory 320, a communication interface 330, and one or more programs 321, the one or more programs 321 being stored in the memory 320 and configured to be executed by the processing module 310, the one or more programs 321 comprising instructions for performing steps in a method as described below:
acquiring a target request message, wherein the target request message comprises interface parameters of a processor interface, and the interface parameters are used for indicating a request type and/or a request identification code corresponding to the processor interface;
determining a target processor corresponding to the interface parameter according to the interface parameter and a first mapping relation, wherein the first mapping relation comprises the corresponding relation between the interface parameter of a processor interface and a processor;
and processing the target request message through the target processor to generate a target response message.
The Processing module 310 may be a Central Processing Unit (CPU), and the Processor may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 320 may include both read-only memory and random access memory and provides instructions and data to the processing module 310. A portion of the memory 320 may also include a non-volatile random access memory, the memory 320 for storing a computer program comprising program instructions, the processing module 310 for executing the program instructions stored by the memory 320 for performing a request message processing method for performing the following operations:
acquiring a target request message, wherein the target request message comprises interface parameters of a processor interface, and the interface parameters are used for indicating a request type and/or a request identification code corresponding to the processor interface;
determining a target processor corresponding to the interface parameter according to the interface parameter and a first mapping relation, wherein the first mapping relation comprises the corresponding relation between the interface parameter of a processor interface and a processor;
and processing the target request message through the target processor to generate a target response message.
The processing module 310 described in this embodiment of the present application may execute the implementation manners described in the first embodiment and the second embodiment of the request packet processing method provided in this embodiment of the present application, and may also execute the implementation manner of the server described in this embodiment of the present application, which is not described herein again.
In the embodiment of the application, first, a target request message is obtained, where the target request message includes an interface parameter of a processor interface, the interface parameter is used to indicate a request type and/or a request identification code corresponding to the processor interface, then, a target processor corresponding to the interface parameter is determined according to the interface parameter and a first mapping relationship, where the first mapping relationship includes a correspondence relationship between the interface parameter of the processor interface and the processor, and finally, the target request message is processed by the target processor, so as to generate a target response message. By adopting the method and the device, the interface parameters of the server interface are corresponding to the request type and/or the request identification code of the request message, so that the correspondence between the request message and the server can be ensured, the processing efficiency of the target request message is improved, and the error rate of the target request message is reduced.
A computer-readable storage medium is further provided in an embodiment of the present application, where the computer-readable storage medium stores a computer program, where the computer program includes program instructions, and the program instructions, when executed by a processor, implement the request message processing method shown in the embodiments of fig. 2 and fig. 3.
The computer readable storage medium may be an internal storage unit of the server according to any of the foregoing embodiments, for example, a hard disk or a memory of the control device. The computer-readable storage medium may also be an external storage device of the control device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like provided on the control device. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of the control device. The computer-readable storage medium is used for storing the computer program and other programs and data required by the control device. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
By way of example, the computer-readable storage medium described above may be deployed to be executed on one computer device or on multiple computer devices at one site or distributed across multiple sites and interconnected by a communication network, and the multiple computer devices distributed across the multiple sites and interconnected by the communication network may constitute a blockchain network.
While the invention has been described with reference to specific embodiments, the scope of the invention is not limited thereto, and those skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method for processing request message is characterized in that the method comprises the following steps:
acquiring a target request message, wherein the target request message comprises interface parameters of a processor interface, and the interface parameters are used for indicating a request type and/or a request identification code corresponding to the processor interface; when the target request is a transaction request, the interface parameters comprise a transaction type and a transaction code; when the target request is an image processing request, the interface parameters comprise an image type and an image code; when the target request is a text processing request, the interface parameters comprise a text type and a text code;
determining a target processor corresponding to the interface parameters according to the interface parameters and a first mapping relation, wherein the first mapping relation comprises the corresponding relation between the interface parameters of a processor interface and a processor;
and processing the target request message through the target processor to generate a target response message.
2. The method of claim 1, wherein the obtaining the target request message comprises:
acquiring a test request message, wherein the test request message comprises an Internet Protocol (IP) address of a request application;
testing the request application according to the test request message;
and acquiring the target request message from the request application from the IP address.
3. The method of claim 1, wherein if the target processor is a first processor, the processing the target request message by the target processor to generate a target response message comprises:
determining the request type of the target request according to the target request message;
acquiring a configuration file corresponding to the request type according to the request type and a second mapping relation, wherein the second mapping relation comprises the corresponding relation between the request type and the configuration file, the configuration file comprises configuration information, and the configuration information is used for indicating message coding and message interaction format;
determining a target template of the target request message according to the configuration file;
assigning a template variable of the target template;
and generating the target response message of the target request message according to the assigned target template.
4. The method of claim 1, wherein if the target processor is a second processor, the processing the target request message by the target processor to generate a target response message comprises:
acquiring a code input by a user, wherein the code is used for indicating a processing rule of the target request message, and the processing rule is used for restricting the content of a target response message of the target request message;
and generating the target response message according to the code and the target request message.
5. The method of claim 1, wherein if the target processor is a third processor, the processing the target request message by the target processor to generate a target response message comprises:
generating a characteristic vector of the processor target request message according to the interface parameter;
and importing the characteristic vector into a pre-trained network model to obtain the target response message.
6. The method according to any of claims 1-5, wherein after processing the target request message by the target processor and generating a target response message, the method further comprises:
generating a digital signature according to a private key, wherein the digital signature is used for triggering a request application of the target request message to perform signature authentication of the digital signature;
signing the target response message through the digital signature to obtain the signed target response message;
and sending the signed target response message to the request application.
7. A request message processing apparatus, the apparatus comprising:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a target request message, the target request message comprises an interface parameter of a processor interface, and the interface parameter is used for indicating a request type and/or a request identification code corresponding to the processor interface; when the target request is a transaction request, the interface parameters comprise a transaction type and a transaction code; when the target request is an image processing request, the interface parameters comprise an image type and an image code; when the target request is a text processing request, the interface parameters comprise a text type and a text code;
the processor determining unit is used for determining a target processor corresponding to the interface parameter according to the interface parameter and a first mapping relation, wherein the first mapping relation comprises the corresponding relation between the interface parameter of the processor interface and the processor;
and the response message generating unit is used for processing the target request message through the target processor and generating a target response message.
8. The apparatus according to claim 7, wherein, in the aspect of obtaining the target request packet, the obtaining unit is specifically configured to:
acquiring a test request message, wherein the test request message comprises an Internet Protocol (IP) address of a request application;
testing the request application according to the test request message; and the number of the first and second groups,
and acquiring the target request message from the request application from the IP address.
9. A server, comprising a processor, memory, a communication interface, and one or more programs, the one or more programs stored in the memory and configured to be executed by the processor, the one or more programs including instructions for performing the steps in the method of any of claims 1-6.
10. A computer-readable storage medium, characterized in that a computer program for electronic data exchange is stored, wherein the computer program causes a computer to perform the steps in the method according to any of claims 1-6.
CN202110743089.0A 2021-06-30 2021-06-30 Request message processing method, device, server and medium Active CN113438134B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110743089.0A CN113438134B (en) 2021-06-30 2021-06-30 Request message processing method, device, server and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110743089.0A CN113438134B (en) 2021-06-30 2021-06-30 Request message processing method, device, server and medium

Publications (2)

Publication Number Publication Date
CN113438134A CN113438134A (en) 2021-09-24
CN113438134B true CN113438134B (en) 2023-03-31

Family

ID=77758577

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110743089.0A Active CN113438134B (en) 2021-06-30 2021-06-30 Request message processing method, device, server and medium

Country Status (1)

Country Link
CN (1) CN113438134B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114978888B (en) * 2022-04-25 2024-02-06 平安付科技服务有限公司 Message forwarding method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651362A (en) * 2020-06-23 2020-09-11 平安银行股份有限公司 Test case generation method and device, storage medium and computer equipment
CN112463510A (en) * 2021-01-25 2021-03-09 卡斯柯信号(北京)有限公司 Deployment method and device of temporary speed limiting server test system

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103580937B (en) * 2012-07-24 2016-11-23 阿里巴巴集团控股有限公司 A kind of Web services the method and system thereof and service broker system simulated
US9146841B2 (en) * 2013-03-15 2015-09-29 Vmware, Inc. Proxy server assisted product testing
CN106802859A (en) * 2015-11-25 2017-06-06 北京京东尚科信息技术有限公司 A kind of method and device of client software test
CN108347361B (en) * 2018-03-06 2020-08-04 平安普惠企业管理有限公司 Application program testing method and device, computer equipment and storage medium
CN111224834B (en) * 2019-11-18 2021-12-14 北京三快在线科技有限公司 Simulation test method, simulation test device, server and storage medium
CN112511366B (en) * 2020-07-10 2022-08-05 中国移动通信有限公司研究院 Test system, method, device, equipment and storage medium
CN112306881B (en) * 2020-11-02 2023-11-24 金联兴电子(深圳)有限公司 Analog data generation method, device, equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651362A (en) * 2020-06-23 2020-09-11 平安银行股份有限公司 Test case generation method and device, storage medium and computer equipment
CN112463510A (en) * 2021-01-25 2021-03-09 卡斯柯信号(北京)有限公司 Deployment method and device of temporary speed limiting server test system

Also Published As

Publication number Publication date
CN113438134A (en) 2021-09-24

Similar Documents

Publication Publication Date Title
CN109040341B (en) Intelligent contract address generation method and device, computer equipment and readable storage medium
CN109194466B (en) Block chain-based cloud data integrity detection method and system
Chen Using algebraic signatures to check data possession in cloud storage
KR102603797B1 (en) How to verify the execution integrity of an application on a target device
CN107111713A (en) The automatic checking of software systems
CN111222176B (en) Block chain-based cloud storage possession proving method, system and medium
CN111669402B (en) Encrypted communication method, device, equipment and storage medium
CN109902493B (en) Script issuing method and server
CN111899019A (en) Method and system for cross validation and sharing of blacklist and multiple parties
CN107579968A (en) Video flowing address detection method, device and server
CN109145651B (en) Data processing method and device
US9425966B1 (en) Security mechanism evaluation service
CN111367923A (en) Data processing method, data processing device, node equipment and storage medium
CN113472883A (en) Method, device and equipment for storing data based on block chain and storage medium
CN110995720A (en) Encryption method, device, host terminal and encryption chip
CN113438134B (en) Request message processing method, device, server and medium
CN113610526A (en) Data trust method and device, electronic equipment and storage medium
CN113950679A (en) Validating a measurement dataset using speaker consensus
CN114185808A (en) Automatic testing method and device, electronic equipment and computer readable storage medium
CN113542405A (en) Block chain-based network communication system, method, device and storage medium
CN111079153B (en) Security modeling method and device, electronic equipment and storage medium
CN110209347B (en) Traceable data storage method
CN113051622B (en) Index construction method, device, equipment and storage medium
CN116244756A (en) Method and device for verifying browser plug-in and computing equipment
CN111049814B (en) Method for computing and verifying pollution attack in edge computing environment

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230714

Address after: Room 515, Block A, Free Trade Building, No. 296, Zhengkai Avenue, Kaifeng District, Henan Pilot Free Trade Zone, 475000

Patentee after: Henan Xufang Technology Co.,Ltd.

Address before: Floor 15, no.1333, Lujiazui Ring Road, pilot Free Trade Zone, Pudong New Area, Shanghai

Patentee before: Weikun (Shanghai) Technology Service Co.,Ltd.