CN117097813A - Protocol adaptation method, device, equipment and storage medium - Google Patents

Protocol adaptation method, device, equipment and storage medium Download PDF

Info

Publication number
CN117097813A
CN117097813A CN202311356880.1A CN202311356880A CN117097813A CN 117097813 A CN117097813 A CN 117097813A CN 202311356880 A CN202311356880 A CN 202311356880A CN 117097813 A CN117097813 A CN 117097813A
Authority
CN
China
Prior art keywords
data
adaptation
request
interaction
protocol
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202311356880.1A
Other languages
Chinese (zh)
Other versions
CN117097813B (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.)
Guangzhou Yuzhong Network Technology Co ltd
Original Assignee
Guangzhou Yuzhong Network 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 Guangzhou Yuzhong Network Technology Co ltd filed Critical Guangzhou Yuzhong Network Technology Co ltd
Priority to CN202311356880.1A priority Critical patent/CN117097813B/en
Publication of CN117097813A publication Critical patent/CN117097813A/en
Application granted granted Critical
Publication of CN117097813B publication Critical patent/CN117097813B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Communication Control (AREA)

Abstract

The invention belongs to the technical field of communication transmission and discloses a protocol adaptation method, a device, equipment and a storage medium. The method comprises the following steps: acquiring a connection request of a client and determining a target server of the client; based on the target server, determining an adaptation request parameter corresponding to the target server in a request parameter adaptation table; transmitting a connection request and the adaptation request parameters to a target server so as to verify between the client and the target server; after verification is successful, format conversion is carried out on initial interaction data of the client based on the adaptation request parameters, interaction data are obtained, and the interaction data are sent to the target server; performing anomaly detection on transmission frame data corresponding to the interaction data based on the anomaly identification model, and determining an interaction result; and recording the adaptation request parameters and interaction results corresponding to the adaptation request parameters, and generating adaptation record data. By the method, different communication protocols can be adapted to realize data interaction.

Description

Protocol adaptation method, device, equipment and storage medium
Technical Field
The present invention relates to the field of heartbeat management technologies, and in particular, to a protocol adaptation method, apparatus, device, and storage medium.
Background
In a distributed system, different services may use different communication protocols and data formats, which may cause communication barriers and integration difficulties between services, and compatibility problems with legacy services may occur when the protocols of the services are changed or upgraded.
The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present invention and is not intended to represent an admission that the foregoing is prior art.
Disclosure of Invention
The invention mainly aims to provide a protocol adaptation method, a device, equipment and a storage medium, and aims to solve the technical problems that communication barriers exist between different communication protocols and compatibility exists between different protocol versions in the prior art.
To achieve the above object, the present invention provides a protocol adaptation method, which includes the steps of:
acquiring a connection request of a client and determining a target server of the client;
based on the target server, determining an adaptation request parameter corresponding to the target server in a request parameter adaptation table;
sending the connection request and the adaptation request parameters to the target server so as to verify the client and the target server;
After verification is successful, format conversion is carried out on initial interaction data of the client based on the adaptation request parameters to obtain interaction data, and the interaction data is sent to the target server;
acquiring transmission frame data corresponding to the interaction data, performing anomaly detection on the transmission frame data based on an anomaly identification model, and determining an interaction result;
and recording the adaptation request parameters and interaction results corresponding to the adaptation request parameters, and generating adaptation record data.
Optionally, the acquiring the transmission frame data corresponding to the interaction data, performing anomaly detection on the transmission frame data based on an anomaly identification model, and determining the interaction result includes:
acquiring the transmission frame data, and inputting the transmission frame data into the anomaly identification model to obtain an anomaly probability score corresponding to the transmission frame data;
when the abnormal probability score is larger than a preset probability threshold, determining that the data interaction is abnormal, and updating the interaction result into the data interaction failure;
and when the anomaly probability score is smaller than or equal to a preset probability threshold, determining that no anomaly exists in the data interaction, and updating the interaction result into the data interaction success.
Optionally, the acquiring the transmission frame data corresponding to the interaction data, performing anomaly detection on the transmission frame data based on an anomaly identification model, and before determining the interaction result, further includes:
constructing the anomaly identification model based on historical transmission frame data;
the constructing the anomaly identification model based on the historical transmission frame data comprises the following steps:
determining sample data according to the historical transmission frame data, wherein the sample data comprises normal sample data and abnormal sample data;
preprocessing the sample data to obtain sample training data, wherein the preprocessing at least comprises data cleaning, missing value processing and abnormal value processing;
generating a decision tree based on the sample training data;
determining sample feature data in the sample training data based on the decision tree;
and generating the abnormality recognition model based on the sample characteristic data and the decision tree.
Optionally, the protocol adaptation method further includes:
determining initial request parameters according to a communication protocol of a preset server;
according to the protocol version of the preset server, the initial request parameters are adjusted, and the request parameters corresponding to the preset server are determined;
Based on the request parameters corresponding to the preset server, a request parameter adaptation table is established, the request parameters corresponding to the preset server and the preset server are stored in the request parameter adaptation table, and the request parameters comprise a request head, a request path, a request type, a request port, an encryption algorithm, verification information and a data format.
Optionally, the protocol adaptation method further includes:
acquiring protocol updating information of the preset server according to a preset protocol updating period;
updating request parameters corresponding to the preset server based on the protocol updating information;
and updating the request parameter adaptation table based on the updated request parameters.
Optionally, after the recording the adaptation request parameter and the interaction result corresponding to the adaptation request parameter, generating adaptation record data, the method further includes:
carrying out statistical analysis on the adaptive record data to determine the data interaction failure proportion;
when the data interaction failure proportion is larger than a preset proportion, determining that the request parameter adaptation table is abnormal;
acquiring a failure adaptation request parameter in the adaptation record data, and determining failure characteristic data based on the failure adaptation request parameter;
And optimizing the request parameter adaptation table based on the failure characteristic data.
Optionally, the sending the connection request and the adaptation request parameter to the target server to perform verification between the client and the target server includes:
the connection request and the adaptation request parameters are sent to the target server side, so that the target server side generates a request response and a server side random number;
forwarding the request response and the server random number to the client so that the client verifies the request response, and generating the client random number and response information after the request response is successfully verified;
the client random number and the response information are sent to the target server, so that the target server verifies the response information;
and after the response information is successfully verified, determining that the verification between the client and the target server is successful.
In addition, to achieve the above object, the present invention also proposes a protocol adaptation device, including:
the protocol adaptation module is used for acquiring a connection request of a client and determining a target server of the client;
The protocol adaptation module is further configured to determine, based on the target server, an adaptation request parameter corresponding to the target server in a request parameter adaptation table;
the data communication module is used for sending the connection request and the adaptation request parameters to the target server so as to verify the client and the target server;
the data communication module is further used for performing format conversion on the initial interaction data of the client based on the adaptation request parameters after verification is successful to obtain interaction data, and sending the interaction data to the target server;
the abnormal recognition module is used for acquiring transmission frame data corresponding to the interaction data, carrying out abnormal detection on the transmission frame data based on an abnormal recognition model, and determining an interaction result;
and the data recording module is used for recording the adaptation request parameters and interaction results corresponding to the adaptation request parameters and generating adaptation record data.
In addition, to achieve the above object, the present invention also proposes a protocol adaptation device, including: a memory, a processor and a protocol adaptation program stored on the memory and executable on the processor, the protocol adaptation program being configured to implement the steps of the protocol adaptation method as described above.
In addition, to achieve the above object, the present invention also proposes a storage medium having stored thereon a protocol adaptation program which, when executed by a processor, implements the steps of the protocol adaptation method as described above.
In the invention, a target server of a client is determined by acquiring a connection request of the client, an adaptation request parameter corresponding to the target server is determined in a request parameter adaptation table based on the target server, the connection request and the adaptation request parameter are sent to the target server so as to enable verification between the client and the target server, after the verification is successful, format conversion is carried out on initial interaction data of the client based on the adaptation request parameter to obtain interaction data, the interaction data is sent to the target server, transmission frame data corresponding to the interaction data is acquired, anomaly detection is carried out on the transmission frame data based on an anomaly identification model, an interaction result is determined, and the adaptation request parameter and an interaction result corresponding to the adaptation request parameter are recorded to generate adaptation record data. Because of communication barriers among different communication protocols and compatibility among different protocol versions, the invention constructs the request parameter adaptation table, so that adaptation can be carried out among different communication protocols and among different protocol versions, data interaction is realized, and the request parameter adaptation table is updated according to the period, thereby ensuring the accuracy of the adaptation.
Drawings
FIG. 1 is a schematic diagram of a protocol adaptation device of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart of a first embodiment of a protocol adaptation method according to the present invention;
FIG. 3 is a flowchart of a second embodiment of the protocol adaptation method of the present invention;
fig. 4 is a block diagram of a first embodiment of a protocol adaptation device according to the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic diagram of a protocol adaptation device of a hardware running environment according to an embodiment of the present invention.
As shown in fig. 1, the protocol adaptation device may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a client interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The client interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional client interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (Wi-Fi) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) Memory or a stable nonvolatile Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the architecture shown in fig. 1 does not constitute a limitation of the protocol adaptation device, and may include more or fewer components than shown, or may combine certain components, or may be a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a client interface module, and a protocol adaptation program may be included in the memory 1005 as one type of storage medium.
In the protocol adaptation device shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the client interface 1003 is mainly used for data interaction with clients; the processor 1001 and the memory 1005 in the protocol adaptation device of the present invention may be disposed in the protocol adaptation device, and the protocol adaptation device invokes a protocol adaptation program stored in the memory 1005 through the processor 1001 and executes the protocol adaptation method provided by the embodiment of the present invention.
An embodiment of the present invention provides a protocol adaptation method, referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of a protocol adaptation method of the present invention.
In this embodiment, the protocol adaptation method includes the following steps:
step S10: and acquiring a connection request of the client and determining a target server of the client.
It should be noted that, the execution body of the embodiment is an intelligent terminal, for example: and the computer is provided with a protocol adaptation program in the intelligent terminal, and the communication protocol between the client and the server is adapted through the protocol adaptation program.
It can be understood that the target server refers to a server that needs to perform communication/interaction with the client, where the client initiates a connection request to implement communication connection between the client and the target server.
Step S20: and based on the target server, determining an adaptation request parameter corresponding to the target server in a request parameter adaptation table.
It should be appreciated that the communication connection between the client and the target server needs to be based on a communication protocol, but the communication protocol of the client is often different from that of the target server, and thus protocol adaptation is usually required before the client establishes a connection with the target server.
It should be noted that, in this embodiment, the request parameter adaptation table stores preset service ends and request parameters corresponding to the preset service ends, where the preset service ends are all service ends that the client can request to connect, and the request parameter adaptation table is determined according to actual requirements, which is not limited in this embodiment. Before the connection between the client and the server is established, a series of data packets need to be exchanged between the client and the server to ensure that both parties understand the rule of communication and negotiate communication parameters, wherein the request parameters are related data/information which needs to be exchanged in the process, and at least comprise a request head, a request path, a request type, a request port, an encryption algorithm, verification information and data, and the request parameters stored in the request parameter adaptation table are usually the optimal request parameters corresponding to the preset server.
It will be appreciated that the request parameters applicable to different communication protocols are different, for example: the HTTP protocol (Hypertext Transfer Protocol ) request header contains a "Secure" field; the HTTP protocol differs from the HTTPs protocol (Hypertext Transfer Protocol Secure, hypertext transfer security protocol) in the request path; the request type of the HTTP protocol is a GET request, and the request type of the HTTPS protocol is a POST request; the request port of the HTTP protocol is 80, and the request port of the HTTPS protocol is 443; the HTTPS protocol needs to add authentication information such as SSL (Secure Sockets Layer, secure socket layer)/TLS (Transport Layer Security ) certificates for identity authentication; the HTTP protocol uses a symmetric encryption algorithm, which is commonly used as an AES (Advanced Encryption Standard ) algorithm and a DES (Data Encryption Standard, data encryption standard) algorithm, and the HTTPs protocol adopts a hybrid encryption mechanism, uses an asymmetric encryption algorithm in a key exchange link, and then uses a symmetric encryption algorithm. The request parameters applicable to different protocol versions also differ, for example: different versions of the TLS protocol (TLS 1.0, TLS 1.1, TLS 1.2 and TLS 1.3) use different data formats.
It should be understood that the adaptive request parameter refers to an optimal request parameter for a target server, and according to the target server, a preset server corresponding to the target server is found in the request parameter adaptive table, so as to find the request parameter corresponding to the preset server, and further determine the optimal request parameter of the target server.
Further, the specific establishment step of the request parameter adaptation table includes: determining initial request parameters according to a communication protocol of a preset server; according to the protocol version of the preset server, the initial request parameters are adjusted, and the request parameters corresponding to the preset server are determined; and establishing a request parameter adaptation table based on the request parameters corresponding to the preset server.
It should be noted that, the initial request parameter refers to an optimal request parameter determined primarily, which is determined based on the communication protocol, and the protocol version is not considered at this time, and based on this, the optimal request parameter determined primarily is further optimized based on the protocol version.
It should be understood that, considering that the communication protocol of the client may be different from the communication protocol of the server, the embodiment determines the best request parameters applicable to each server according to the communication protocol of each server, and considering that the protocol versions of the client and the server may be different when the communication protocol of the client is identical to the communication protocol of the server, the embodiment further adjusts the best request parameters applicable to each server according to the protocol version of each server, and finally obtains the best request parameters of each server, and establishes a request parameter adaptation table, so that any target server in the preset server can determine the best request parameters applicable from the best request parameters.
Further, in order to ensure accuracy of the request parameters in the request parameter adaptation table, the embodiment updates the request parameter adaptation table at regular time, which specifically includes the following steps: acquiring protocol updating information of the preset server according to a preset protocol updating period; updating request parameters corresponding to the preset server based on the protocol updating information; and updating the request parameter adaptation table based on the updated request parameters.
It should be noted that, the protocol update information refers to update conditions of a communication protocol and a protocol version, and includes update information of the communication protocol and update information of the protocol version, that is, update conditions of the communication protocol and update conditions of the protocol version. The preset protocol update period is an update period of a set communication protocol and protocol version, for example: 24 hours, 1 week, can be set according to the actual needs, and this embodiment is not limited thereto.
In a specific implementation, the communication protocol and the protocol version of each server are checked regularly, the update condition of the communication protocol and the update condition of the protocol version are determined, and the latest optimal request parameters are determined according to the update condition, so that the request parameter adaptation table is updated. The request parameter adaptation table is updated in time, the accuracy of the request parameters in the request parameter adaptation table is guaranteed, and even if the communication protocol and the protocol version of the server are transformed, the protocol adaptation between the client and the server is not affected.
Step S30: and sending the connection request and the adaptation request parameters to the target server side so as to verify the client side and the target server side.
Further, the step S30 includes: the connection request and the adaptation request parameters are sent to the target server side, so that the target server side generates a request response and a server side random number; forwarding the request response and the server random number to the client so that the client verifies the request response, and generating the client random number and response information after the request response is successfully verified; the client random number and the response information are sent to the target server, so that the target server verifies the response information; and after the response information is successfully verified, determining that the verification between the client and the target server is successful.
In a specific implementation, a client sends a connection request to a server, the connection request contains a request parameter, the server selects a proper protocol version and an encryption suite according to information provided by the client after receiving the connection request, and generates a random number (server random), then the random number and other information are sent to the client together, the client verifies the response of the server after receiving the response of the server, if the verification is successful, a random number (client random number) is generated, and the random number and other information are sent to the server together, after receiving the response of the client, the server verifies the response of the client, if the verification is successful, the handshake is successful, and communication can be started between the client and the server.
Step S40: after verification is successful, format conversion is carried out on the initial interaction data of the client based on the adaptation request parameters, interaction data are obtained, and the interaction data are sent to the target server.
It may be appreciated that the initial interaction data is data that the client needs to interact with the target server, for example: the heartbeat data, which is not limited in this embodiment. The initial interaction data is data generated by the client, and the data format of the initial interaction data may not be suitable for the target server, so that format conversion is required to be performed on the initial interaction data before interaction, and the interaction data is data suitable for the target server after format conversion. The data format suitable for each server is stored in the request parameter adaptation table, and the data format corresponding to the interactive data can be determined according to the adaptation request parameters corresponding to the target server, so that the initial interactive data can be accurately converted in format.
Step S50: and acquiring transmission frame data corresponding to the interaction data, carrying out anomaly detection on the transmission frame data based on an anomaly identification model, and determining an interaction result.
It should be understood that transmitting frame data refers to frame data corresponding to the interactive data during the interaction. The anomaly recognition model is a model for performing anomaly recognition on transmission frame data. The interaction result refers to the result of the current interaction, and there are two cases: data interaction success and data interaction failure.
Further, the step S50 includes: acquiring the transmission frame data, and inputting the transmission frame data into the anomaly identification model to obtain an anomaly probability score corresponding to the transmission frame data; when the abnormal probability score is larger than a preset probability threshold, determining that the data interaction is abnormal, and updating the interaction result into the data interaction failure; and when the anomaly probability score is smaller than or equal to a preset probability threshold, determining that no anomaly exists in the data interaction, and updating the interaction result into the data interaction success.
It should be noted that, the anomaly probability score is the judgment of the anomaly degree of the transmission frame data by the anomaly identification model, the preset probability threshold is a set score threshold, and can be set according to practical requirements, and this embodiment is not limited thereto, when the anomaly probability score is greater than the preset probability threshold, the anomaly degree is considered to have exceeded the normal range, at this time, the interaction data has anomalies, the data interaction process has anomalies, the data interaction fails, and when the anomaly probability score is less than or equal to the preset probability threshold, the anomaly degree is considered to be within the normal range, at this time, the data interaction is successful.
Step S60: and recording the adaptation request parameters and interaction results corresponding to the adaptation request parameters, and generating adaptation record data.
It should be noted that, the adaptation record data is a record of the result of each protocol adaptation and the data interaction after the protocol adaptation.
Further, after the step S60, the method further includes: carrying out statistical analysis on the adaptive record data to determine the data interaction failure proportion; when the data interaction failure proportion is larger than a preset proportion, determining that the request parameter adaptation table is abnormal; acquiring a failure adaptation request parameter in the adaptation record data, and determining failure characteristic data based on the failure adaptation request parameter; and optimizing the request parameter adaptation table based on the failure characteristic data.
It can be understood that the data interaction failure proportion refers to the proportion of the interaction result to the data interaction failure, the preset proportion is a set proportion threshold value, usually 0.5, when the data interaction failure proportion is greater than or equal to the preset proportion, the proportion of the interaction result to the data interaction failure is greater than the proportion of the interaction result to the data interaction success, the failure proportion is relatively large, and the currently used request parameter adaptation table is considered to be abnormal, so that the method is not suitable for most adaptation scenes and needs to be optimized.
It should be understood that the failed adaptation request parameter is a request parameter used when the interaction result is that the data interaction fails, in order to determine the optimization direction of the request parameter in the request parameter adaptation table, the failed adaptation request parameter needs to be analyzed, in this embodiment, feature extraction is performed on the failed adaptation request parameter, so as to obtain features related to the interaction failure, and then the request parameter adaptation table is optimized according to the obtained features.
In this embodiment, a target server of a client is determined by acquiring a connection request of the client, an adaptation request parameter corresponding to the target server is determined in a request parameter adaptation table based on the target server, the connection request and the adaptation request parameter are sent to the target server, so that verification is performed between the client and the target server, after the verification is successful, format conversion is performed on initial interaction data of the client based on the adaptation request parameter, interaction data is obtained, the interaction data is sent to the target server, transmission frame data corresponding to the interaction data is acquired, anomaly detection is performed on the transmission frame data based on an anomaly identification model, an interaction result is determined, and interaction results corresponding to the adaptation request parameter and the adaptation request parameter are recorded, so that adaptation record data is generated. Because of communication barriers among different communication protocols and compatibility problems among different protocol versions, the embodiment constructs the request parameter adaptation table, so that adaptation can be performed among different communication protocols and among different protocol versions, data interaction is realized, the request parameter adaptation table is updated in time according to the period, the accuracy of the adaptation is ensured, in addition, the request parameter adaptation table is optimized according to the result of the data interaction after the adaptation, and the accuracy of the adaptation is further ensured.
Referring to fig. 3, fig. 3 is a flowchart of a second embodiment of a protocol adaptation method according to the present invention.
Based on the above embodiment, before step S50, the method further includes:
step S41: and constructing the anomaly identification model based on the historical transmission frame data.
It should be noted that, the historical transmission frame data refers to a historical record of transmission frame data, and in this embodiment, a required anomaly identification model is built through the historical transmission frame data.
Further, the step S41 includes:
and determining sample data according to the historical transmission frame data, wherein the sample data comprises normal sample data and abnormal sample data.
It can be understood that the sample data, i.e. the samples used for constructing the anomaly identification model, include normal sample data and abnormal sample data, that is, a set of normal samples and a set of abnormal samples, divide normal data in the historical transmission frame data into normal sample data, and divide abnormal data in the historical transmission frame data into abnormal sample data. Wherein the sample data should be as comprehensive and accurate as possible to ensure accuracy and reliability of the model.
And preprocessing the sample data to obtain sample training data, wherein the preprocessing at least comprises data cleaning, missing value processing and abnormal value processing.
It should be understood that sample training data refers to pre-processed sample data that may be used for model training. The prepared sample data also needs to be preprocessed, including data cleaning, missing value processing, outlier processing and the like, so as to improve the quality and operability of the data.
Based on the sample training data, a decision tree is generated.
It should be noted that, in this embodiment, an isolated forest algorithm is used to train the preprocessed sample data to generate a plurality of decision trees, or other suitable algorithms may be used, which is not limited in this embodiment.
And determining sample characteristic data in the sample training data based on the decision tree, and generating the abnormality recognition model based on the sample characteristic data and the decision tree.
It is understood that sample feature data refers to features that are representative in sample training data. According to the trained decision tree, representative features are selected for model construction, and complexity and calculation amount of the model are reduced.
It should be appreciated that the trained anomaly identification model may calculate anomaly probability scores for the data to be detected, and determine whether anomalies are based on a magnitude relationship between the anomaly probability scores and a threshold value for further analysis and processing.
It should be noted that, a part of data can be divided from the sample training data to be used as test data, the trained abnormal recognition model is evaluated, indexes such as accuracy, recall rate, weighted harmonic mean (F-Measure) and the like of the model are analyzed, performance and effect of the model are known, and if the evaluated performance and effect of the model cannot reach the application standard, the abnormal recognition model needs to be optimized and adjusted, so that accuracy and performance of the model are improved.
Further, updating the historical transmission frame data according to a preset model updating period; and returning to execute the step of constructing an anomaly identification model based on the historical transmission frame data after updating, and updating the anomaly identification model.
It is to be understood that the preset model update period refers to an update period of a set abnormality recognition model, for example: 24 hours and 48 hours, which can be set according to practical requirements, the embodiment is not limited to this.
In a specific implementation, sample data required for constructing the anomaly identification model is updated at regular time, so that the model is updated, the accuracy of the model is improved, and the accuracy of anomaly detection is ensured.
In this embodiment, according to historical transmission frame data, sample data is determined, the sample data includes normal sample data and abnormal sample data, the sample data is preprocessed to obtain sample training data, the preprocessing at least includes data cleaning, missing value processing and abnormal value processing, a decision tree is generated based on the sample training data, sample feature data is determined in the sample training data based on the decision tree, and an abnormal recognition model is generated based on the sample feature data and the decision tree. According to the method, the device and the system, the abnormal recognition model is built to conduct abnormal detection on interactive data in the communication process, the model is high in accuracy and performance, the accuracy of abnormal detection can be guaranteed, meanwhile, the model can be updated regularly, the accuracy of abnormal detection is further improved, and further, based on an abnormal detection result, the request parameter adaptation table is optimized, and the accuracy of adaptation is guaranteed.
In addition, the embodiment of the invention also provides a storage medium, wherein the storage medium is stored with a protocol adaptation program, and the protocol adaptation program realizes the steps of the protocol adaptation method when being executed by a processor.
Referring to fig. 4, fig. 4 is a block diagram of a first embodiment of a protocol adaptation device according to the present invention.
As shown in fig. 4, the protocol adaptation device provided by the embodiment of the present invention includes:
the protocol adaptation module 10 is configured to obtain a connection request of a client, and determine a target server of the client.
The protocol adaptation module 10 is further configured to determine, based on the target server, an adaptation request parameter corresponding to the target server in a request parameter adaptation table.
And the data communication module 20 is configured to send the connection request and the adaptation request parameter to the target server, so as to perform verification between the client and the target server.
The data communication module 20 is further configured to perform format conversion on the initial interaction data of the client based on the adaptation request parameter after the verification is successful, obtain interaction data, and send the interaction data to the target server.
The anomaly identification module 30 is configured to obtain transmission frame data corresponding to the interaction data, perform anomaly detection on the transmission frame data based on an anomaly identification model, and determine an interaction result.
The data recording module 40 is configured to record the adaptation request parameter and an interaction result corresponding to the adaptation request parameter, and generate adaptation record data.
In this embodiment, a target server of a client is determined by acquiring a connection request of the client, an adaptation request parameter corresponding to the target server is determined in a request parameter adaptation table based on the target server, the connection request and the adaptation request parameter are sent to the target server, so that verification is performed between the client and the target server, after the verification is successful, interactive data of the client are sent to the target server, transmission frame data corresponding to the interactive data are acquired, anomaly detection is performed on the transmission frame data based on an anomaly identification model, an interaction result is determined, the adaptation request parameter and the interaction result corresponding to the adaptation request parameter are recorded, and adaptation record data are generated. Because of communication barriers among different communication protocols and compatibility problems among different protocol versions, the embodiment constructs the request parameter adaptation table, so that adaptation can be performed among different communication protocols and among different protocol versions, data interaction is realized, the request parameter adaptation table is updated in time according to the period, the accuracy of the adaptation is ensured, in addition, the request parameter adaptation table is optimized according to the result of the data interaction after the adaptation, and the accuracy of the adaptation is further ensured.
In an embodiment, the anomaly identification module 30 is further configured to obtain the transmission frame data, and input the transmission frame data into the anomaly identification model to obtain an anomaly probability score corresponding to the transmission frame data;
when the abnormal probability score is larger than a preset probability threshold, determining that the data interaction is abnormal, and updating the interaction result into the data interaction failure;
and when the anomaly probability score is smaller than or equal to a preset probability threshold, determining that no anomaly exists in the data interaction, and updating the interaction result into the data interaction success.
In one embodiment, the anomaly identification module 30 is further configured to construct the anomaly identification model based on historical transmission frame data.
In one embodiment, the anomaly identification module 30 is further configured to determine sample data according to the historical transmission frame data, where the sample data includes normal sample data and abnormal sample data;
preprocessing the sample data to obtain sample training data, wherein the preprocessing at least comprises data cleaning, missing value processing and abnormal value processing;
generating a decision tree based on the sample training data;
determining sample feature data in the sample training data based on the decision tree;
And generating the abnormality recognition model based on the sample characteristic data and the decision tree.
In an embodiment, the protocol adaptation module 10 is further configured to determine an initial request parameter according to a communication protocol of a preset server;
according to the protocol version of the preset server, the initial request parameters are adjusted, and the request parameters corresponding to the preset server are determined;
based on the request parameters corresponding to the preset server, a request parameter adaptation table is established, the request parameters corresponding to the preset server and the preset server are stored in the request parameter adaptation table, and the request parameters comprise a request head, a request path, a request type, a request port, an encryption algorithm, verification information and a data format.
In an embodiment, the protocol adaptation module 10 is further configured to obtain protocol update information of the preset server according to a preset protocol update period;
updating request parameters corresponding to the preset server based on the protocol updating information;
and updating the request parameter adaptation table based on the updated request parameters.
In an embodiment, the data recording module 40 is further configured to perform statistical analysis on the adaptive recording data to determine a data interaction failure proportion;
When the data interaction failure proportion is larger than a preset proportion, determining that the request parameter adaptation table is abnormal;
acquiring a failure adaptation request parameter in the adaptation record data, and determining failure characteristic data based on the failure adaptation request parameter;
and optimizing the request parameter adaptation table based on the failure characteristic data.
In an embodiment, the data communication module 20 is further configured to send the connection request and the adaptation request parameter to the target server, so that the target server generates a request response and a server random number;
forwarding the request response and the server random number to the client so that the client verifies the request response, and generating the client random number and response information after the request response is successfully verified;
the client random number and the response information are sent to the target server, so that the target server verifies the response information;
and after the response information is successfully verified, determining that the verification between the client and the target server is successful.
It should be understood that the foregoing is illustrative only and is not limiting, and that in specific applications, those skilled in the art may set the invention as desired, and the invention is not limited thereto.
It should be noted that the above-described working procedure is merely illustrative, and does not limit the scope of the present invention, and in practical application, a person skilled in the art may select part or all of them according to actual needs to achieve the purpose of the embodiment, which is not limited herein.
In addition, technical details that are not described in detail in this embodiment may refer to the protocol adaptation method provided in any embodiment of the present invention, and are not described herein.
Furthermore, it should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. Read Only Memory)/RAM, magnetic disk, optical disk) and including several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (10)

1. A protocol adaptation method, characterized in that the protocol adaptation method comprises:
Acquiring a connection request of a client and determining a target server of the client;
based on the target server, determining an adaptation request parameter corresponding to the target server in a request parameter adaptation table;
sending the connection request and the adaptation request parameters to the target server so as to verify the client and the target server;
after verification is successful, format conversion is carried out on initial interaction data of the client based on the adaptation request parameters to obtain interaction data, and the interaction data is sent to the target server;
acquiring transmission frame data corresponding to the interaction data, performing anomaly detection on the transmission frame data based on an anomaly identification model, and determining an interaction result;
and recording the adaptation request parameters and interaction results corresponding to the adaptation request parameters, and generating adaptation record data.
2. The method of claim 1, wherein the obtaining the transmission frame data corresponding to the interaction data, performing anomaly detection on the transmission frame data based on an anomaly identification model, and determining an interaction result comprises:
acquiring the transmission frame data, and inputting the transmission frame data into the anomaly identification model to obtain an anomaly probability score corresponding to the transmission frame data;
When the abnormal probability score is larger than a preset probability threshold, determining that the data interaction is abnormal, and updating the interaction result into the data interaction failure;
and when the anomaly probability score is smaller than or equal to a preset probability threshold, determining that no anomaly exists in the data interaction, and updating the interaction result into the data interaction success.
3. The method of claim 2, wherein the acquiring the transmission frame data corresponding to the interaction data, performing anomaly detection on the transmission frame data based on an anomaly identification model, and before determining the interaction result, further comprises:
constructing the anomaly identification model based on historical transmission frame data;
the constructing the anomaly identification model based on the historical transmission frame data comprises the following steps:
determining sample data according to the historical transmission frame data, wherein the sample data comprises normal sample data and abnormal sample data;
preprocessing the sample data to obtain sample training data, wherein the preprocessing at least comprises data cleaning, missing value processing and abnormal value processing;
generating a decision tree based on the sample training data;
determining sample feature data in the sample training data based on the decision tree;
And generating the abnormality recognition model based on the sample characteristic data and the decision tree.
4. The method of claim 1, wherein the protocol adaptation method further comprises:
determining initial request parameters according to a communication protocol of a preset server;
according to the protocol version of the preset server, the initial request parameters are adjusted, and the request parameters corresponding to the preset server are determined, wherein the request parameters comprise a request head, a request path, a request type, a request port, an encryption algorithm, verification information and a data format;
and establishing a request parameter adaptation table based on the request parameters corresponding to the preset server, wherein the request parameter adaptation table stores the preset server and the request parameters corresponding to the preset server.
5. The method of claim 4, wherein the protocol adaptation method further comprises:
acquiring protocol updating information of the preset server according to a preset protocol updating period;
updating request parameters corresponding to the preset server based on the protocol updating information;
and updating the request parameter adaptation table based on the updated request parameters.
6. The method of claim 1, wherein the recording the adaptation request parameter and the interaction result corresponding to the adaptation request parameter, after generating adaptation record data, further comprises:
carrying out statistical analysis on the adaptive record data to determine the data interaction failure proportion;
when the data interaction failure proportion is larger than a preset proportion, determining that the request parameter adaptation table is abnormal;
acquiring a failure adaptation request parameter in the adaptation record data, and determining failure characteristic data based on the failure adaptation request parameter;
and optimizing the request parameter adaptation table based on the failure characteristic data.
7. The method according to any one of claims 1 to 6, wherein the sending the connection request and the adaptation request parameter to the target server to authenticate between the client and the target server includes:
the connection request and the adaptation request parameters are sent to the target server side, so that the target server side generates a request response and a server side random number;
forwarding the request response and the server random number to the client so that the client verifies the request response, and generating the client random number and response information after the request response is successfully verified;
The client random number and the response information are sent to the target server, so that the target server verifies the response information;
and after the response information is successfully verified, determining that the verification between the client and the target server is successful.
8. A protocol adaptation device, the protocol adaptation device comprising:
the protocol adaptation module is used for acquiring a connection request of a client and determining a target server of the client;
the protocol adaptation module is further configured to determine, based on the target server, an adaptation request parameter corresponding to the target server in a request parameter adaptation table;
the data communication module is used for sending the connection request and the adaptation request parameters to the target server so as to verify the client and the target server;
the data communication module is further used for performing format conversion on the initial interaction data of the client based on the adaptation request parameters after verification is successful to obtain interaction data, and sending the interaction data to the target server;
the abnormal recognition module is used for acquiring transmission frame data corresponding to the interaction data, carrying out abnormal detection on the transmission frame data based on an abnormal recognition model, and determining an interaction result;
And the data recording module is used for recording the adaptation request parameters and interaction results corresponding to the adaptation request parameters and generating adaptation record data.
9. A protocol adaptation device, the device comprising: memory, a processor and a protocol adaptation program stored on the memory and executable on the processor, the protocol adaptation program being configured to implement the steps of the protocol adaptation method according to any one of claims 1 to 7.
10. A storage medium having stored thereon a protocol adaptation program, which when executed by a processor, implements the steps of the protocol adaptation method according to any one of claims 1 to 7.
CN202311356880.1A 2023-10-19 2023-10-19 Protocol adaptation method, device, equipment and storage medium Active CN117097813B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311356880.1A CN117097813B (en) 2023-10-19 2023-10-19 Protocol adaptation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311356880.1A CN117097813B (en) 2023-10-19 2023-10-19 Protocol adaptation method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117097813A true CN117097813A (en) 2023-11-21
CN117097813B CN117097813B (en) 2024-01-26

Family

ID=88775524

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311356880.1A Active CN117097813B (en) 2023-10-19 2023-10-19 Protocol adaptation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117097813B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102347947A (en) * 2011-09-21 2012-02-08 杭州海康威视软件有限公司 Streaming media adaptor, streaming media network interaction system and method
US20180198834A1 (en) * 2015-01-16 2018-07-12 Sagemcom Broadband Sas Method for transmitting a data stream using a streaming protocol
CN110324405A (en) * 2019-05-29 2019-10-11 北京奇艺世纪科技有限公司 Message method, device, system and computer readable storage medium
CN114338844A (en) * 2021-12-31 2022-04-12 北京升明科技有限公司 Cross-protocol communication method and device between client servers
CN114579397A (en) * 2022-02-22 2022-06-03 湖北美和易思教育科技有限公司 Anomaly detection method and system based on data mining
CN115225362A (en) * 2022-07-13 2022-10-21 南京元贝信息技术有限公司 Verification method, device, equipment and storage medium of man-machine behavior
CN115766902A (en) * 2022-11-14 2023-03-07 网络通信与安全紫金山实验室 Method, device, equipment and medium for transmitting non-sensitive data through QUIC
CN116346952A (en) * 2021-12-24 2023-06-27 北京奇虎科技有限公司 Transmission protocol parameter adjustment method, device, equipment and storage medium
CN116668557A (en) * 2023-08-02 2023-08-29 苏州浪潮智能科技有限公司 Data transmission method, system, electronic equipment and readable storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102347947A (en) * 2011-09-21 2012-02-08 杭州海康威视软件有限公司 Streaming media adaptor, streaming media network interaction system and method
US20180198834A1 (en) * 2015-01-16 2018-07-12 Sagemcom Broadband Sas Method for transmitting a data stream using a streaming protocol
CN110324405A (en) * 2019-05-29 2019-10-11 北京奇艺世纪科技有限公司 Message method, device, system and computer readable storage medium
CN116346952A (en) * 2021-12-24 2023-06-27 北京奇虎科技有限公司 Transmission protocol parameter adjustment method, device, equipment and storage medium
CN114338844A (en) * 2021-12-31 2022-04-12 北京升明科技有限公司 Cross-protocol communication method and device between client servers
CN114579397A (en) * 2022-02-22 2022-06-03 湖北美和易思教育科技有限公司 Anomaly detection method and system based on data mining
CN115225362A (en) * 2022-07-13 2022-10-21 南京元贝信息技术有限公司 Verification method, device, equipment and storage medium of man-machine behavior
CN115766902A (en) * 2022-11-14 2023-03-07 网络通信与安全紫金山实验室 Method, device, equipment and medium for transmitting non-sensitive data through QUIC
CN116668557A (en) * 2023-08-02 2023-08-29 苏州浪潮智能科技有限公司 Data transmission method, system, electronic equipment and readable storage medium

Also Published As

Publication number Publication date
CN117097813B (en) 2024-01-26

Similar Documents

Publication Publication Date Title
US11216814B1 (en) System and method for facilitating programmatic verification of transactions
US8341711B1 (en) Automated login session extender for use in security analysis systems
US11381629B2 (en) Passive detection of forged web browsers
US20200349639A1 (en) Computer systems, computer-implemented methods, and computer devices for processing a transaction message
EP2401839B1 (en) System and methods for automatically accessing a web site on behalf of client
US10511591B2 (en) Generation of shared secrets using pairwise implicit certificates
US20180239893A1 (en) Dynamically Updating CAPTCHA Challenges
US20130262873A1 (en) Method and system for authenticating remote users
CN113746638B (en) NFT storage method, NFT restoration method, computer device, and storage medium
US20190236248A1 (en) Multicomputer System for User Data Authentication and Processing
WO2018057691A1 (en) Unsupervised classification of web traffic users
CN113778879B (en) Interface fuzzy test method and device
CN114338054B (en) Block chain trusted data transmission, verification and acquisition method and device
CN117097813B (en) Protocol adaptation method, device, equipment and storage medium
CN105391692A (en) Detection identification method and device for performing batched attack on APP and gateway communication
CN112367146B (en) Method and device for delivering edge side message and electronic equipment
CN109286665B (en) Real-time mobile game long link processing method and device
CN116629379A (en) Federal learning aggregation method and device, storage medium and electronic equipment
US9237167B1 (en) Systems and methods for performing network counter measures
CN112804201B (en) Method and device for acquiring equipment information
CN114422227B (en) Data acquisition and analysis system based on network security
US8612751B1 (en) Method and apparatus for entitled data transfer over the public internet
CN114499951A (en) Identity authentication information cracking method and device and electronic equipment
CN113449167A (en) Data acquisition abnormity detection method and device, electronic equipment and readable storage medium
CN111949980A (en) Target client monitoring method and device, storage medium and electronic device

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