CN114827260B - Data transmission method and related device - Google Patents

Data transmission method and related device Download PDF

Info

Publication number
CN114827260B
CN114827260B CN202210384489.1A CN202210384489A CN114827260B CN 114827260 B CN114827260 B CN 114827260B CN 202210384489 A CN202210384489 A CN 202210384489A CN 114827260 B CN114827260 B CN 114827260B
Authority
CN
China
Prior art keywords
component
packet
data
proxy
data receiving
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
CN202210384489.1A
Other languages
Chinese (zh)
Other versions
CN114827260A (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.)
Beijing Duxiaoman Payment Technology Co ltd
Du Xiaoman Technology Beijing Co Ltd
Original Assignee
Du Xiaoman Technology Beijing 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 Du Xiaoman Technology Beijing Co Ltd filed Critical Du Xiaoman Technology Beijing Co Ltd
Priority to CN202210384489.1A priority Critical patent/CN114827260B/en
Publication of CN114827260A publication Critical patent/CN114827260A/en
Application granted granted Critical
Publication of CN114827260B publication Critical patent/CN114827260B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The embodiment of the application provides a data transmission method and a related device, wherein an agent component of a data transmission component acquires an original data packet transmitted by the data transmission component and an identification of a data receiving component, generates an agent data packet based on the original data packet under the condition that the operation state of the agent component of the data receiving component is determined to be normal according to a preset judging condition, and transmits the agent data packet to the agent component of the data receiving component so as to enable the agent component of the data receiving component to forward the original data packet to the data receiving component. And under the condition that the operation state of the proxy component of the data receiving component is abnormal according to the judging condition, transmitting the original data packet to the data receiving component. Therefore, the scheme switches the receiving party of the original data packet according to the running state of the proxy component of the data receiving component, so that the failure of sending the original data packet caused by abnormal running of the proxy component of the data receiving component is avoided, and the stability of data transmission is improved.

Description

Data transmission method and related device
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a data transmission method and a related device.
Background
In the micro-service system, a corresponding proxy component is configured for each micro-service, so that the purpose of realizing data monitoring and data forwarding of the micro-service is realized, but when the proxy component runs abnormally, communication among the micro-services is often impossible, and the running stability of the whole micro-service system is further influenced.
Disclosure of Invention
The application provides a data transmission method and a related device, as follows:
a data transmission method is applied to a proxy component of a data transmission component, and comprises the following steps:
acquiring an original data packet and an identification of a data receiving assembly, wherein the original data packet is transmitted by the data transmitting assembly;
under the condition that the operation state of the proxy component of the data receiving component is determined to be normal according to a preset judging condition, generating a proxy data packet based on the original data packet, and sending the proxy data packet to the proxy component of the data receiving component so that the proxy component of the data receiving component forwards the original data packet to the data receiving component;
under the condition that the operation state of the proxy component of the data receiving component is abnormal according to the judging condition, the original data packet is sent to the data receiving component;
The discrimination conditions include: and receiving a response packet in a first preset time period, wherein the response packet meets a response rule, the response packet is generated and transmitted for the proxy component of the data receiving component in response to receiving a query packet transmitted by the proxy component of the data transmitting component, and the query packet comprises the response rule for generating the response packet by the proxy component of the data receiving component.
Optionally, the answer rule includes:
the field value of the first preset field is equal to a first standard value, and the first standard value is a preset value indicating that the running state is normal.
Optionally, the method further comprises:
periodically sending the query packet to a proxy component of the data receiving component;
if no response packet is received within the first preset duration after the query packet is sent in any period, or the received response packet does not meet the response rule, marking the state identification in any period as abnormal.
Optionally, the process of determining whether the operation state of the proxy component of the data receiving component is normal according to the discrimination condition includes:
acquiring a state identifier of a history period;
if the state identification of the history period meets an abnormal condition, determining that the operation state of the proxy component of the data receiving component is abnormal, wherein the abnormal condition comprises the following steps: the state of the last n consecutive periods is identified as abnormal and/or the number of periods in which the state is identified as abnormal is greater than a preset number threshold, wherein n is a preset value.
Optionally, after the obtaining the identification of the original data packet and the data receiving component, the method further includes:
if the state identification of the history period meets the abnormal condition, sending the query packet to a proxy component of the data receiving component;
if no response packet is received within the first preset time period after the query packet is sent, or the received response packet does not meet a response rule, determining that the operation state of the proxy component of the data receiving component is abnormal;
and if the response packet received in the first preset time after the query packet is sent meets a response rule, determining that the operation state of the proxy component of the data receiving component is normal.
Optionally, after the proxy data packet is sent to the proxy component of the data receiving component, the method further includes:
receiving a response packet, the response packet generated by a proxy component of the data receiving component in response to receiving the proxy data packet;
judging whether a field value of a preset field in the response packet is equal to a second standard value or not, wherein the second standard value is the same as the field value of the preset field in the response packet; the response packet is used for feeding back whether the proxy component of the data receiving component successfully forwards the original data packet to the data receiving component, and the second standard value is a preset value indicating successful forwarding;
And if not, sending the original data packet to the data receiving component.
A data transmission apparatus comprising:
the data receiving unit is used for acquiring an original data packet and an identification of the data receiving assembly, wherein the original data packet is sent by the data sending assembly;
the first data sending unit is used for generating a proxy data packet based on the original data packet and sending the proxy data packet to the proxy component of the data receiving component under the condition that the operation state of the proxy component of the data receiving component is determined to be normal according to a preset judging condition, so that the proxy component of the data receiving component forwards the original data packet to the data receiving component;
the second data sending unit is used for sending the original data packet to the data receiving component under the condition that the operation state of the proxy component of the data receiving component is abnormal according to the judging condition;
the discrimination conditions include: and receiving a response packet in a first preset time period, wherein the response packet meets a response rule, the response packet is generated and transmitted for the proxy component of the data receiving component in response to receiving a query packet transmitted by the proxy component of the data transmitting component, and the query packet comprises the response rule for generating the response packet by the proxy component of the data receiving component.
A data transmission system, comprising: a data transmitting component, a proxy component of the data receiving component, and the data receiving component;
the data sending component is used for sending the original data packet to the proxy component of the data sending component;
the proxy component of the data sending component is used for:
acquiring the identifications of the original data packet and the data receiving assembly;
under the condition that the operation state of the proxy component of the data receiving component is determined to be normal according to a preset judging condition, generating a proxy data packet based on the original data packet, and sending the proxy data packet to the proxy component of the data receiving component;
under the condition that the operation state of the proxy component of the data receiving component is abnormal according to the judging condition, the original data packet is sent to the data receiving component;
the discrimination conditions include: and receiving a response packet in a first preset time period, wherein the response packet meets a response rule, the response packet is generated and transmitted for the proxy component of the data receiving component in response to receiving a query packet transmitted by the proxy component of the data transmitting component, and the query packet comprises the response rule for generating the response packet by the proxy component of the data receiving component.
The proxy component of the data receiving component is used for acquiring and forwarding the original data packet to the data receiving component based on the proxy data packet.
A data transmission apparatus comprising: a memory and a processor;
the memory is used for storing programs;
the processor is configured to execute the program to implement each step of the data transmission method.
A readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of a data transmission method.
According to the data transmission method and the related device, the proxy component of the data transmission component acquires the original data packet sent by the data transmission component and the identification of the data receiving component, generates the proxy data packet based on the original data packet under the condition that the operation state of the proxy component of the data receiving component is determined to be normal according to the preset judging condition, and sends the proxy data packet to the proxy component of the data receiving component so that the proxy component of the data receiving component forwards the original data packet to the data receiving component. And under the condition that the operation state of the proxy component of the data receiving component is abnormal according to the judging condition, transmitting the original data packet to the data receiving component. Wherein, the discrimination conditions include: and receiving a response packet in the first preset time period, wherein the response packet meets the response rule, and the response packet is generated and transmitted by the proxy component of the data receiving component in response to the query packet transmitted by the proxy component of the data transmitting component, wherein the query packet comprises the response rule for generating the response packet by the proxy component of the data receiving component. Thus, the decision condition is used to determine whether the proxy component of the data receiving component successfully received and parsed the query packet and is functioning properly. Therefore, the method and the device can switch the receiving party of the original data packet according to the running state of the proxy component of the data receiving component, forward the original data packet through the proxy component of the data receiving component under the normal running condition of the proxy component of the data receiving component so as to realize the functions of the preset data control and the flow monitoring, and directly send the original data packet to the data receiving component under the abnormal running condition of the proxy component of the data receiving component, thereby avoiding the failure of sending the original data packet caused by the abnormal running condition of the proxy component of the data receiving component and further improving the stability of data transmission.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of a data transmission system according to an embodiment of the present application;
fig. 2 is a schematic flow chart of a data transmission method according to an embodiment of the present application;
fig. 3 is a schematic flow chart of a specific implementation of a data transmission method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a data transmission device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a data transmission device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The data transmission method provided by the embodiment of the application is applied to, but not limited to, a data transmission process between service components in a data transmission system, wherein the service components comprise a data sending component and a data receiving component, fig. 1 illustrates a specific structural schematic diagram of the data transmission system provided by the embodiment of the application, and as shown in fig. 1, the data transmission system comprises a data sending component 101, a proxy component (a first proxy component in fig. 1) 102 of the data sending component, a proxy component (a second proxy component in fig. 1) 103 of the data receiving component, and a data receiving component 104. It should be noted that, the corresponding service component and the proxy component are pre-bound and disposed in the same device or container, see in particular the prior art.
Fig. 2 illustrates a flow chart of a data transmission method according to an embodiment of the present application, as shown in fig. 1, the method includes:
s201, the data sending component sends the original data packet to the proxy component of the data sending component.
Optionally, the original data packet includes an identification of the data receiving component, for example, a name or number of the data receiving component. The method for obtaining and transmitting the original data packet by the first proxy component is referred to in the prior art.
It should be noted that, the data sending component is a service component, and may specifically be a micro-service or other components, and the original data packet sent by the data sending component to the data receiving component is not limited to a service for calling the data receiving component, which is not limited in this embodiment.
S202, the proxy component of the data sending component receives the original data packet and the identification of the data receiving component, and determines whether the operation state of the proxy component of the data receiving component is normal or not according to preset judging conditions.
In this embodiment, the normal operation state refers to that the proxy component of the data receiving component and the data transmission link of the data receiving component operate normally, and the proxy component of the data receiving component and the data transmission link of the proxy component of the data transmitting component operate normally, that is, the proxy component of the data receiving component has the capability of receiving and analyzing the data sent by the proxy component of the data transmitting component and successfully forwarding the data to the data receiving component.
In this embodiment, the discrimination conditions include: and receiving a response packet in the first preset time period, wherein the response packet meets the response rule, the response packet is generated and transmitted by the proxy component of the data receiving component in response to the query packet transmitted by the proxy component of the data transmitting component, and the query packet comprises the response rule for generating the response packet by the proxy component of the data receiving component.
Optionally, the specific answer rule includes a plurality of types, and one optional answer rule includes that a field value of the first preset field is equal to a first standard value, for example, a status code is equal to 200. Another optional reply rule includes a field for indicating the time at which the query packet was received. It should be noted that, specific implementation methods for determining whether the operation state of the proxy component of the data receiving component is normal include various methods, and specific reference may be made to the following embodiments.
And S203, under the condition that the proxy component of the data sending component determines that the operation state of the proxy component of the data receiving component is normal, generating a proxy data packet based on the original data packet, and sending the proxy data packet to the proxy component of the data receiving component.
In this embodiment, an optional method for generating a proxy packet based on an original packet includes: and packaging the original data packet by using a preset communication protocol to obtain a proxy data packet, wherein the communication protocol is a protocol agreed in advance by a proxy component of the data sending component and a proxy component of the data receiving component. Specific protocol conventions are referred to in the art.
S204, the proxy component of the data receiving component receives the proxy data packet, and acquires and sends the original data packet to the data receiving component based on the proxy data packet.
In this embodiment, the method for the proxy component of the data receiving component to obtain the original data packet based on the proxy data packet includes parsing the proxy data packet based on a preset communication protocol to obtain the original data packet.
S205, the proxy component of the data sending component sends the original data packet to the data receiving component under the condition that the operation state of the proxy component of the data receiving component is abnormal.
According to the data transmission method provided by the embodiment of the application, the receiving party of the original data packet is switched according to the operation state of the proxy component of the data receiving component, so that the original data packet can be forwarded through the proxy component of the data receiving component under the condition that the proxy component of the data receiving component operates normally, the functions of preset data control and flow monitoring are realized, and under the condition that the proxy component of the data receiving component operates abnormally, the original data packet is directly transmitted to the data receiving component, and the transmission failure of the original data packet caused by the abnormal operation of the proxy component of the data receiving component is avoided, thereby improving the stability of data transmission.
Fig. 3 illustrates a specific implementation flow of a method for judging an operation state of a proxy component of a data receiving component according to an embodiment of the present application, where, as shown in fig. 3, the proxy component of the data receiving component is taken as a first proxy component, the proxy component of the data receiving component is taken as a second proxy component, and a response rule includes that a field value of a first preset field is equal to a first standard value, where the method specifically includes:
S301, the first proxy component periodically sends a query packet to the second proxy component.
In this embodiment, the periods are divided according to a preset rule, for example, one period is divided every 5 seconds. Specifically, a query packet is sent to the second proxy component at the sending time indicated by each period, where the query packet is used to request the running state of the proxy component of the data receiving component, optionally, the query packet includes a response rule for generating a response packet by the proxy component of the data receiving component, that is, the query packet includes a field value of a first preset field in the generated response packet for indicating that the proxy component of the data receiving component is normal if the running state is normal, where the first standard value is a preset value indicating that the running state is normal.
S302, the second agent component responds to the received query packet to judge whether the running state of the second agent component is normal.
In this embodiment, the operation state includes a forwarding state, where the forwarding state indicates that the communication link of the second proxy component and the data receiving component is normal. The method for judging whether the forwarding state of the second proxy component is normal by the second proxy component includes various methods, for example, sending preset test information to the data receiving component, and if feedback information for responding to the test information, which is fed back by the data receiving component, is received within a second preset time, determining that the operation state of the second proxy component is normal.
S303, the second proxy component generates a response packet based on the running state and the response rule, and sends the response packet to the first proxy component.
In this embodiment, the second proxy component only generates a response packet with a field value of the first preset field equal to the first standard value when the query packet is successfully received and parsed and the forwarding state is normal.
It should be noted that, in the case that the operation state of the second proxy component is abnormal, the field value of the first preset field in the generated response packet is not equal to the first standard value, or in the case that the operation state of the second proxy component is abnormal, the operation of generating the response packet is not executed, that is, when the operation state of the second proxy component is abnormal, the response packet is not sent.
S304, the first proxy component receives the response packet within a first preset time period after sending the query packet, and if the field value of a first preset field in the response packet is not equal to a first standard value, marks the state of the corresponding period as abnormal.
In this embodiment, the first standard value is a preset value indicating that the running state is normal, for example, the first preset field is a status code, and the first standard value is 200, and if the status code in the response packet is not equal to 200, the status flag of the corresponding cycle is marked as abnormal.
S305, the first proxy component does not receive the response packet within a first preset time period after sending the query packet, and marks the state of the corresponding period as abnormal.
In this embodiment, the first proxy component polls all proxy components communicatively connected to the first proxy component according to a period, and executes the steps S301 to S305 for each polled proxy component, so as to obtain a status identifier of each period of each proxy component, and correspondingly stores the status identifier in a preset database.
S306, the first proxy component responds to the received original data packet and the identification of the data receiving component to acquire the state identification of the history period.
In this embodiment, the original data packet is sent by the data sending component, and the history period includes a period in a preset period of time before the current time, for example, the status identifiers of all periods in 24 hours are obtained. It should be noted that, the first proxy component obtains the status identifier around the history from the database.
S307, when the state identification of the history period meets the abnormal condition, the first proxy component determines that the running state of the second proxy component is abnormal.
In this embodiment, the abnormal conditions include: the state of the last consecutive n cycles is identified as abnormal, or the number of cycles for which the state is identified as abnormal is greater than a preset number threshold, where n is a preset number. Taking n=3 as an example and the number threshold=10 as an example, when the state identifications of 3 periods closest and consecutive to the current time in the history period are all abnormal, determining that the running state of the second agent component is abnormal. Alternatively, if the number of cycles in the history period for which the status is identified as abnormal is greater than 10, then the operational status of the second agent component is determined to be abnormal.
It should be noted that, the abnormal condition may be configured according to the historical operation log and the preset importance level of the original data packet. For example, if the importance level of the original data packet is high, n is preset to a small value or the number threshold is set to a small value for more stable transmission of the original data packet.
And S308, when the state identification of the history period meets the abnormal condition, the first proxy component sends a query packet to the proxy component of the data receiving component.
S309, the first proxy component does not receive the response packet or the field value of the first preset field in the response packet is not equal to the first standard value within the first preset time period after the first proxy component sends the query packet, and it is determined that the second proxy component operates abnormally.
S310, the first proxy component determines that the running state of the second proxy component is normal when the field value of a first preset field in the received response packet is equal to a first standard value within a first preset time period after the query packet is sent.
According to the method for acquiring the running state of the second proxy component, the running state of the proxy component of the data receiving component is periodically queried and marked, the state identification of the proxy component of the data receiving component is acquired after the identification of the original data packet and the data receiving component is received, and when the running state of the proxy component of the data receiving component at the current time is judged to be abnormal through the state identification and the abnormal condition, the running state abnormality of the proxy component of the data receiving component is determined without waiting for the instant response of the proxy component of the data receiving component, so that the speed of data transmission is improved. Further, according to the operation state of the proxy component of the data receiving component in the history period, the operation state of the proxy component of the data receiving component in the current time can be accurately judged.
Further, when the running state of the proxy component of the data receiving component at the current time cannot be judged to be abnormal through the state identification and the abnormal condition, the query packet is sent immediately to determine whether the running state of the proxy component of the data receiving component is normal or not, so that the judgment accuracy of the running state can be further improved.
It should be noted that, the above embodiment is only an optional specific implementation manner of the data transmission method provided by the embodiment, and the present application further includes other specific implementation manners.
For example, the method further includes that the field value of the first preset field in the response packet received by the first proxy component within the first preset time period after the query packet is sent is equal to the first standard value, and the state of the period corresponding to the mark is identified as normal, and in S304, whether the running state of the second proxy component is normal may be further determined according to the rule and the feature that the state of the history period is identified as normal, which is specifically referred to in the prior art, and this embodiment is not repeated. As another example, fig. 3 illustrates only one alternative reply rule, where the reply rule in the query packet includes multiple types, for example, the reply rule includes a rule code, where the rule code is used to indicate one of preset rules, and a correspondence between the preset rule and the rule code is stored in advance. That is, the answer rule is a dynamic rule.
For another example, the method further includes the step of determining whether the second agent component is normal according to the response condition, specifically including:
1. after the first proxy component sends the proxy data packet to the second proxy component, the response packet is received.
In this embodiment, the response packet is generated by the second proxy component in response to receiving the proxy data packet. The specific method for generating the response packet is referred to in the prior art, wherein the response packet is used for feeding back whether the proxy component of the data receiving component successfully forwards the original data packet to the data receiving component.
2. Judging whether the field value of the second preset field in the response packet is equal to a second standard value.
In this embodiment, the second standard value is a preset value indicating successful forwarding.
3. If not, the first proxy component sends the original data packet to the data receiving component.
Therefore, after the proxy data packet is sent, whether the operation state of the proxy component of the data receiving component is normal or not can be judged through the received response packet, so that the passive detection of the operation state is realized, and the stability of data transmission and the instantaneity of the judgment result of the operation state can be further improved.
Fig. 4 is a schematic structural diagram of a data transmission device according to an embodiment of the present application, where, as shown in fig. 4, the device may include:
The data receiving unit is used for acquiring an original data packet and an identification of the data receiving assembly, wherein the original data packet is sent by the data sending assembly;
the first data sending unit is used for generating a proxy data packet based on the original data packet and sending the proxy data packet to the proxy component of the data receiving component under the condition that the operation state of the proxy component of the data receiving component is determined to be normal according to a preset judging condition, so that the proxy component of the data receiving component forwards the original data packet to the data receiving component;
the second data sending unit is used for sending the original data packet to the data receiving component under the condition that the operation state of the proxy component of the data receiving component is abnormal according to the judging condition;
the discrimination conditions include: and receiving a response packet in a first preset time period, wherein the response packet meets a response rule, the response packet is generated and transmitted for the proxy component of the data receiving component in response to receiving a query packet transmitted by the proxy component of the data transmitting component, and the query packet comprises the response rule for generating the response packet by the proxy component of the data receiving component.
Optionally, the answer rule includes:
the field value of the first preset field is equal to a first standard value, and the first standard value is a preset value indicating that the running state is normal.
Optionally, the apparatus further includes: a first query unit configured to:
periodically sending the query packet to a proxy component of the data receiving component;
if no response packet is received within the first preset duration after the query packet is sent in any period, or the received response packet does not meet the response rule, marking the state identification in any period as abnormal.
Optionally, the apparatus further includes: the state judging unit is used for determining whether the operation state of the agent component of the data receiving component is normal according to the judging condition, and the state judging unit is specifically used for:
acquiring a state identifier of a history period;
if the state identification of the history period meets an abnormal condition, determining that the operation state of the proxy component of the data receiving component is abnormal, wherein the abnormal condition comprises the following steps: the state of the last n consecutive periods is identified as abnormal and/or the number of periods in which the state is identified as abnormal is greater than a preset number threshold, wherein n is a preset value.
Optionally, the device further includes a second query unit, configured to send the query packet to a proxy component of the data receiving component after the obtaining of the identifier of the original data packet and the identifier of the data receiving component, if it is determined that the status identifier of the history period meets the abnormal condition;
if no response packet is received within the first preset time period after the query packet is sent, or the received response packet does not meet a response rule, determining that the operation state of the proxy component of the data receiving component is abnormal;
and if the response packet received in the first preset time after the query packet is sent meets a response rule, determining that the operation state of the proxy component of the data receiving component is normal.
Optionally, the apparatus further includes a third data sending unit, configured to receive a response packet after sending the proxy data packet to the proxy component of the data receiving component, where the response packet is generated by the proxy component of the data receiving component in response to receiving the proxy data packet;
judging whether a field value of a preset field in the response packet is equal to a second standard value or not, wherein the second standard value is the same as the field value of the preset field in the response packet; the response packet is used for feeding back whether the proxy component of the data receiving component successfully forwards the original data packet to the data receiving component, and the second standard value is a preset value indicating successful forwarding;
And if not, sending the original data packet to the data receiving component.
Fig. 5 shows a schematic structural diagram of the data transmission device, which may include: at least one processor 501, at least one communication interface 502, at least one memory 503, and at least one communication bus 504;
in the embodiment of the present application, the number of the processor 501, the communication interface 502, the memory 503 and the communication bus 504 is at least one, and the processor 501, the communication interface 502 and the memory 503 complete communication with each other through the communication bus 504;
the processor 501 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement embodiments of the present application, etc.;
the memory 503 may include a high-speed RAM memory, and may further include a non-volatile memory (non-volatile memory), etc., such as at least one magnetic disk memory;
the memory stores a program, and the processor can execute the program stored in the memory to realize the steps of the data transmission method provided by the embodiment of the application, as follows:
a data transmission method is applied to a proxy component of a data transmission component, and comprises the following steps:
Acquiring an original data packet and an identification of a data receiving assembly, wherein the original data packet is transmitted by the data transmitting assembly;
under the condition that the operation state of the proxy component of the data receiving component is determined to be normal according to a preset judging condition, generating a proxy data packet based on the original data packet, and sending the proxy data packet to the proxy component of the data receiving component so that the proxy component of the data receiving component forwards the original data packet to the data receiving component;
under the condition that the operation state of the proxy component of the data receiving component is abnormal according to the judging condition, the original data packet is sent to the data receiving component;
the discrimination conditions include: and receiving a response packet in a first preset time period, wherein the response packet meets a response rule, the response packet is generated and transmitted for the proxy component of the data receiving component in response to receiving a query packet transmitted by the proxy component of the data transmitting component, and the query packet comprises the response rule for generating the response packet by the proxy component of the data receiving component.
Optionally, the answer rule includes:
The field value of the first preset field is equal to a first standard value, and the first standard value is a preset value indicating that the running state is normal.
Optionally, the method further comprises:
periodically sending the query packet to a proxy component of the data receiving component;
if no response packet is received within the first preset duration after the query packet is sent in any period, or the received response packet does not meet the response rule, marking the state identification in any period as abnormal.
Optionally, the process of determining whether the operation state of the proxy component of the data receiving component is normal according to the discrimination condition includes:
acquiring a state identifier of a history period;
if the state identification of the history period meets an abnormal condition, determining that the operation state of the proxy component of the data receiving component is abnormal, wherein the abnormal condition comprises the following steps: the state of the last n consecutive periods is identified as abnormal and/or the number of periods in which the state is identified as abnormal is greater than a preset number threshold, wherein n is a preset value.
Optionally, after the obtaining the identification of the original data packet and the data receiving component, the method further includes:
If the state identification of the history period meets the abnormal condition, sending the query packet to a proxy component of the data receiving component;
if no response packet is received within the first preset time period after the query packet is sent, or the received response packet does not meet a response rule, determining that the operation state of the proxy component of the data receiving component is abnormal;
and if the response packet received in the first preset time after the query packet is sent meets a response rule, determining that the operation state of the proxy component of the data receiving component is normal.
Optionally, after the proxy data packet is sent to the proxy component of the data receiving component, the method further includes:
receiving a response packet, the response packet generated by a proxy component of the data receiving component in response to receiving the proxy data packet;
judging whether a field value of a preset field in the response packet is equal to a second standard value or not, wherein the second standard value is the same as the field value of the preset field in the response packet; the response packet is used for feeding back whether the proxy component of the data receiving component successfully forwards the original data packet to the data receiving component, and the second standard value is a preset value indicating successful forwarding;
And if not, sending the original data packet to the data receiving component.
The embodiment of the application also provides a readable storage medium, which can store a computer program suitable for being executed by a processor, and when the computer program is executed by the processor, the steps of the data transmission method provided by the embodiment of the application are realized as follows:
a data transmission method is applied to a proxy component of a data transmission component, and comprises the following steps:
acquiring an original data packet and an identification of a data receiving assembly, wherein the original data packet is transmitted by the data transmitting assembly;
under the condition that the operation state of the proxy component of the data receiving component is determined to be normal according to a preset judging condition, generating a proxy data packet based on the original data packet, and sending the proxy data packet to the proxy component of the data receiving component so that the proxy component of the data receiving component forwards the original data packet to the data receiving component;
under the condition that the operation state of the proxy component of the data receiving component is abnormal according to the judging condition, the original data packet is sent to the data receiving component;
The discrimination conditions include: and receiving a response packet in a first preset time period, wherein the response packet meets a response rule, the response packet is generated and transmitted for the proxy component of the data receiving component in response to receiving a query packet transmitted by the proxy component of the data transmitting component, and the query packet comprises the response rule for generating the response packet by the proxy component of the data receiving component.
Optionally, the answer rule includes:
the field value of the first preset field is equal to a first standard value, and the first standard value is a preset value indicating that the running state is normal.
Optionally, the method further comprises:
periodically sending the query packet to a proxy component of the data receiving component;
if no response packet is received within the first preset duration after the query packet is sent in any period, or the received response packet does not meet the response rule, marking the state identification in any period as abnormal.
Optionally, the process of determining whether the operation state of the proxy component of the data receiving component is normal according to the discrimination condition includes:
acquiring a state identifier of a history period;
if the state identification of the history period meets an abnormal condition, determining that the operation state of the proxy component of the data receiving component is abnormal, wherein the abnormal condition comprises the following steps: the state of the last n consecutive periods is identified as abnormal and/or the number of periods in which the state is identified as abnormal is greater than a preset number threshold, wherein n is a preset value.
Optionally, after the obtaining the identification of the original data packet and the data receiving component, the method further includes:
if the state identification of the history period meets the abnormal condition, sending the query packet to a proxy component of the data receiving component;
if no response packet is received within the first preset time period after the query packet is sent, or the received response packet does not meet a response rule, determining that the operation state of the proxy component of the data receiving component is abnormal;
and if the response packet received in the first preset time after the query packet is sent meets a response rule, determining that the operation state of the proxy component of the data receiving component is normal.
Optionally, after the proxy data packet is sent to the proxy component of the data receiving component, the method further includes:
receiving a response packet, the response packet generated by a proxy component of the data receiving component in response to receiving the proxy data packet;
judging whether a field value of a preset field in the response packet is equal to a second standard value or not, wherein the second standard value is the same as the field value of the preset field in the response packet; the response packet is used for feeding back whether the proxy component of the data receiving component successfully forwards the original data packet to the data receiving component, and the second standard value is a preset value indicating successful forwarding;
And if not, sending the original data packet to the data receiving component.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A data transmission method, characterized by being applied to a proxy component of a data transmission component, comprising:
acquiring an original data packet and an identification of a data receiving assembly, wherein the original data packet is transmitted by the data transmitting assembly;
periodically sending a query packet to a proxy component of the data receiving component, the query packet including a reply rule for the proxy component of the data receiving component to generate a reply packet;
if no response packet is received within a first preset time period after the query packet is sent in any period, or the received response packet does not meet the response rule, marking the state identification in any period as abnormal;
Determining whether the operation state of the agent component of the data receiving component is normal according to preset judging conditions, wherein the judging conditions comprise: receiving a response packet in the first preset time period, wherein the response packet meets the response rule, and the response packet is generated and transmitted by the proxy component of the data receiving component in response to the query packet transmitted by the proxy component of the data transmitting component;
the process of determining whether the operation state of the proxy component of the data receiving component is normal according to the discrimination conditions includes: acquiring a state identifier of a history period; if the state identification of the history period meets an abnormal condition, determining that the operation state of the proxy component of the data receiving component is abnormal, wherein the abnormal condition comprises the following steps: the state of the last n continuous periods is marked as abnormal, and/or the number of the periods of which the state is marked as abnormal is greater than a preset number threshold, wherein n is a preset numerical value;
under the condition that the operation state of the proxy component of the data receiving component is determined to be normal according to the judging condition, generating a proxy data packet based on the original data packet, and sending the proxy data packet to the proxy component of the data receiving component so that the proxy component of the data receiving component forwards the original data packet to the data receiving component;
And under the condition that the abnormal operation state of the proxy component of the data receiving component is determined according to the judging condition, the original data packet is sent to the data receiving component.
2. The method of claim 1, wherein the reply rule comprises:
the field value of the first preset field is equal to a first standard value, and the first standard value is a preset value indicating that the running state is normal.
3. The method of claim 2, further comprising, after said obtaining the identity of the original data packet and the data receiving component:
if the state identification of the history period meets the abnormal condition, sending the query packet to a proxy component of the data receiving component;
if no response packet is received within the first preset time period after the query packet is sent, or the received response packet does not meet a response rule, determining that the operation state of the proxy component of the data receiving component is abnormal;
and if the response packet received in the first preset time after the query packet is sent meets a response rule, determining that the operation state of the proxy component of the data receiving component is normal.
4. The method according to claim 1 or 2, further comprising, after said sending said proxy data packet to a proxy component of said data receiving component:
receiving a response packet, the response packet generated by a proxy component of the data receiving component in response to receiving the proxy data packet;
judging whether a field value of a preset field in the response packet is equal to a second standard value or not, wherein the second standard value is the same as the field value of the preset field in the response packet; the response packet is used for feeding back whether the proxy component of the data receiving component successfully forwards the original data packet to the data receiving component, and the second standard value is a preset value indicating successful forwarding;
and if not, sending the original data packet to the data receiving component.
5. A data transmission device, characterized by a proxy component applied to a data transmission component, comprising:
the data receiving unit is used for acquiring an original data packet and an identification of the data receiving assembly, wherein the original data packet is sent by the data sending assembly;
a first query unit configured to periodically send a query packet to the proxy component of the data receiving component, where the query packet includes a response rule for generating a response packet by the proxy component of the data receiving component; if no response packet is received within a first preset time period after the query packet is sent in any period, or the received response packet does not meet the response rule, marking the state identification in any period as abnormal;
The state judging unit is used for determining whether the operation state of the agent component of the data receiving component is normal according to preset judging conditions, and the judging conditions comprise: receiving a response packet in the first preset time period, wherein the response packet meets the response rule, and the response packet is generated and transmitted by the proxy component of the data receiving component in response to the query packet transmitted by the proxy component of the data transmitting component;
the process of determining whether the operation state of the proxy component of the data receiving component is normal according to the discrimination conditions includes: acquiring a state identifier of a history period; if the state identification of the history period meets an abnormal condition, determining that the operation state of the proxy component of the data receiving component is abnormal, wherein the abnormal condition comprises the following steps: the state of the last n continuous periods is marked as abnormal, and/or the number of the periods of which the state is marked as abnormal is greater than a preset number threshold, wherein n is a preset numerical value;
the first data sending unit is used for generating a proxy data packet based on the original data packet and sending the proxy data packet to the proxy component of the data receiving component under the condition that the operation state of the proxy component of the data receiving component is determined to be normal according to the judging condition, so that the proxy component of the data receiving component forwards the original data packet to the data receiving component;
And the second data sending unit is used for sending the original data packet to the data receiving component under the condition that the operation state of the proxy component of the data receiving component is abnormal according to the judging condition.
6. A data transmission system, comprising: a data transmitting component, a proxy component of the data receiving component, and the data receiving component;
the data sending component is used for sending the original data packet to the proxy component of the data sending component;
the proxy component of the data sending component is used for:
acquiring the identifications of the original data packet and the data receiving assembly;
periodically sending a query packet to a proxy component of the data receiving component, the query packet including a reply rule for the proxy component of the data receiving component to generate a reply packet;
if no response packet is received within a first preset time period after the query packet is sent in any period, or the received response packet does not meet the response rule, marking the state identification in any period as abnormal;
determining whether the operation state of the agent component of the data receiving component is normal according to preset judging conditions, wherein the judging conditions comprise: receiving a response packet in the first preset time period, wherein the response packet meets the response rule, and the response packet is generated and transmitted by the proxy component of the data receiving component in response to the query packet transmitted by the proxy component of the data transmitting component;
The process of determining whether the operation state of the proxy component of the data receiving component is normal according to the discrimination conditions includes: acquiring a state identifier of a history period; if the state identification of the history period meets an abnormal condition, determining that the operation state of the proxy component of the data receiving component is abnormal, wherein the abnormal condition comprises the following steps: the state of the last n continuous periods is marked as abnormal, and/or the number of the periods of which the state is marked as abnormal is greater than a preset number threshold, wherein n is a preset numerical value;
under the condition that the operation state of the proxy component of the data receiving component is determined to be normal according to the judging condition, generating a proxy data packet based on the original data packet, and sending the proxy data packet to the proxy component of the data receiving component so that the proxy component of the data receiving component forwards the original data packet to the data receiving component;
under the condition that the operation state of the proxy component of the data receiving component is abnormal according to the judging condition, the original data packet is sent to the data receiving component;
the proxy component of the data receiving component is used for acquiring and forwarding the original data packet to the data receiving component based on the proxy data packet.
7. A data transmission apparatus, comprising: a memory and a processor;
the memory is used for storing programs;
the processor is configured to execute the program to implement the respective steps of the data transmission method according to any one of claims 1 to 4.
8. A readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the data transmission method according to any one of claims 1 to 4.
CN202210384489.1A 2022-04-13 2022-04-13 Data transmission method and related device Active CN114827260B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210384489.1A CN114827260B (en) 2022-04-13 2022-04-13 Data transmission method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210384489.1A CN114827260B (en) 2022-04-13 2022-04-13 Data transmission method and related device

Publications (2)

Publication Number Publication Date
CN114827260A CN114827260A (en) 2022-07-29
CN114827260B true CN114827260B (en) 2023-08-25

Family

ID=82534130

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210384489.1A Active CN114827260B (en) 2022-04-13 2022-04-13 Data transmission method and related device

Country Status (1)

Country Link
CN (1) CN114827260B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007009255A1 (en) * 2005-07-22 2007-01-25 Research In Motion Limited A method of controlling delivery of multi-part content from an origin server to a mobile device browser via a server
CN101005698A (en) * 2006-01-20 2007-07-25 华为技术有限公司 Method and system for optimizing route in moving IPv6
CN111835737A (en) * 2020-06-29 2020-10-27 中国平安财产保险股份有限公司 WEB attack protection method based on automatic learning and related equipment thereof
CN112738284A (en) * 2021-04-01 2021-04-30 腾讯科技(深圳)有限公司 Data transmission method, device, equipment and storage medium in service integration
CN112764956A (en) * 2021-01-14 2021-05-07 网宿科技股份有限公司 Database exception handling system, and database exception handling method and device
CN114090338A (en) * 2021-11-19 2022-02-25 中国银行股份有限公司 Request processing method and device and electronic equipment
CN114185743A (en) * 2021-12-14 2022-03-15 中国平安财产保险股份有限公司 Data processing method and device, computer equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4648182B2 (en) * 2005-12-19 2011-03-09 富士通株式会社 Packet relay system
US8958291B2 (en) * 2009-10-09 2015-02-17 At&T Intellectual Property I, L.P. Data routing in hybrid wireless communication networks

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007009255A1 (en) * 2005-07-22 2007-01-25 Research In Motion Limited A method of controlling delivery of multi-part content from an origin server to a mobile device browser via a server
CN101005698A (en) * 2006-01-20 2007-07-25 华为技术有限公司 Method and system for optimizing route in moving IPv6
CN111835737A (en) * 2020-06-29 2020-10-27 中国平安财产保险股份有限公司 WEB attack protection method based on automatic learning and related equipment thereof
CN112764956A (en) * 2021-01-14 2021-05-07 网宿科技股份有限公司 Database exception handling system, and database exception handling method and device
CN112738284A (en) * 2021-04-01 2021-04-30 腾讯科技(深圳)有限公司 Data transmission method, device, equipment and storage medium in service integration
CN114090338A (en) * 2021-11-19 2022-02-25 中国银行股份有限公司 Request processing method and device and electronic equipment
CN114185743A (en) * 2021-12-14 2022-03-15 中国平安财产保险股份有限公司 Data processing method and device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Boukhlouf Djemaa ; Kazar Okba.Intrusion detection system: Hybrid approach based mobile agent.International Conference on Education and e-Learning Innovations.2012,全文. *

Also Published As

Publication number Publication date
CN114827260A (en) 2022-07-29

Similar Documents

Publication Publication Date Title
CN108566405B (en) Medical equipment state monitoring method and device and storage medium
CN108111499B (en) Business processing performance optimization method and device, electronic equipment and storage medium
CN108111346B (en) Method and device for determining frequent item set in alarm correlation analysis and storage medium
CN107395451B (en) Processing method, device and equipment for internet traffic abnormity and storage medium
CN111198804A (en) Gateway-based industrial internet platform third-party micro-service monitoring and early warning method
CN112039718A (en) Upgrade state detection method, server, device and storage medium
CN114827260B (en) Data transmission method and related device
CN112615700B (en) Data sending method, gateway, system, electronic equipment and readable storage medium
CN111539499B (en) Method and device for detecting antenna equipment and computer readable storage medium
CN111190617A (en) Remote firmware upgrading system and method based on intelligent perception technology and terminal equipment
CN110995522B (en) Information processing method and device
CN110505177B (en) Information collection system, terminal equipment and remote host
CN111064729A (en) Message processing method and device, storage medium and electronic device
CN110572315A (en) Information interaction method and device, robot and storage medium
CN107341086B (en) Method and system for monitoring running state of server
CN114338794B (en) Service message pushing method and device, electronic equipment and storage medium
CN115658343A (en) Method and device for detecting and processing message sequence in distributed system
CN113726647B (en) Identification analysis method and device
CN106998282B (en) Communication setting notifies device
CN111880949B (en) Service information processing method, system, device, server and terminal
CN111787102A (en) Service processing method and device for multiple application platforms, electronic equipment and storage medium
CN108449224B (en) Data acquisition method, device, equipment and storage medium
CN113424159A (en) Operation device maintenance method and apparatus, storage medium, and program product
CN110611602A (en) Two-layer point-to-point channel state monitoring method and system
CN110855785B (en) Data processing method and 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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240104

Address after: Room 301, 3rd Floor, Building 4, West District, No.10 Northwest Wangdong Road, Haidian District, Beijing, 100085

Patentee after: Beijing Duxiaoman Payment Technology Co.,Ltd.

Patentee after: Du Xiaoman Technology (Beijing) Co.,Ltd.

Address before: 100193 Room 606, 6 / F, building 4, West District, courtyard 10, northwest Wangdong Road, Haidian District, Beijing

Patentee before: Du Xiaoman Technology (Beijing) Co.,Ltd.