Inter-application data signature transmission method and data exchange platform gateway
By receiving and processing traffic requests with signature information in the data exchange platform gateway, and using the non-blocking IO framework and HTTP/HTTPS request headers to transmit signature information, the problem of insufficient docking and concurrent processing capabilities for information interaction between traditional systems is solved. It achieves efficient link tracking and fault handling, and improves the concurrent processing capabilities and visual monitoring capabilities of the data exchange platform.
Patent Information
- Application Number
- CN202310362116.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-04
- Publication Date
- 2024-10-15
AI Technical Summary
Information exchange between traditional systems has additional docking interaction requirements, insufficient concurrent processing capabilities, and the data exchange platform gateway cannot proactively detect and handle faults, resulting in an urgent need for link tracking, early warning, and visual monitoring.
By receiving the traffic request initiated by the client, the signature information is used for authentication, and the request is forwarded to the application server for processing according to the service degradation situation, and the processing results are obtained to update the service degradation situation. The non-blocking IO framework and HTTP/HTTPS request headers are used to transmit the signature information. To reduce resource consumption and improve concurrent processing capabilities.
While reducing the consumption of signature verification resources, it improves the concurrent processing capabilities of the data exchange platform gateway, realizes link tracking, early warning and visual monitoring, and can detect and handle service failures in a timely manner.
Smart Images

Figure CN118784252A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer data processing, and in particular relates to an inter-application data signature transmission method and a data exchange platform gateway. Background Art
[0002] In today's era of rapid development of informatization, information interaction is everywhere. The mutual trust of information interaction between two systems and the performance of identity recognition have become urgent issues that need to be solved. Traditionally, information interaction between systems is mainly carried out in the form of tokens, which has the disadvantages of requiring additional docking interactions and only generating tokens with a specific validity period.
[0003] In addition, because data interaction between systems has the characteristics of large data exchange volume, high real-time concurrency, and high availability requirements, similar data exchange platforms have urgent requirements for link tracking, early warning, and visual monitoring of the platform. Traditional data exchange platform gateways mainly passively discover problems from business-layer alarms, and are unable to discover and intervene in fault handling in advance on the exchange platform itself. Summary of the invention
[0004] The present invention provides an inter-application data signature transmission method and a data exchange platform gateway to solve the problem that the existing inter-application data transmission requires additional docking interaction and has insufficient concurrent processing capability.
[0005] Based on the above purpose, an embodiment of the present invention provides a method for transmitting data signatures between applications, including: receiving a traffic request initiated by a client, wherein the request header of the traffic request includes signature information; performing authentication based on the signature information in the request header, and forwarding the traffic request to an application server for processing based on service degradation conditions after successful authentication; obtaining the processing result of the application server and updating the service degradation conditions based on the processing result.
[0006] Optionally, the authentication according to the signature information in the request header includes: extracting the signature information in the request header, the signature information including a first coding value generated according to the timestamp and the public key of the client and an MD5 value obtained by applying the MD5 algorithm to the timestamp and the client private key; obtaining the corresponding private key according to the public key of the client; comparing the current timestamp with the timestamp to see whether it is within the valid signature range; if so, it means that the authentication is successful; otherwise, the signature is invalid.
[0007] Optionally, after successful authentication, the traffic request is forwarded to the application server for processing according to the service degradation situation, including: after successful authentication, determining the service degradation situation; if the service is not degraded, forwarding the traffic request to the application server for processing; if the service is degraded, forwarding the traffic request to the application server for processing according to the degradation check rules.
[0008] Optionally, forwarding the traffic request to the application server for processing according to the downgrade check rule includes: if the traffic request meets the downgrade check rule, forwarding the traffic request to the application server; if the traffic request does not meet the downgrade check rule, forwarding the traffic request to the message queue, and automatically pulling up the business consumer to process the messages in the message queue.
[0009] Optionally, the automatic launching of the service consumer processes the messages in the message queue, including: attempting to forward preset traffic to the application server at preset intervals to asynchronously process the traffic; if the service can process the traffic normally, resuming traffic forwarding.
[0010] Optionally, the method also includes: collecting the status of the entire or sampled traffic; calculating the collected data using a stream computing component according to preset warning rules to determine whether it complies with the warning rules; and issuing warning reminders for abnormal services and traffic that comply with the warning rules.
[0011] Optionally, obtaining the processing result of the application server and updating the service degradation status according to the processing result includes: receiving the processing result of the application server; and updating the service degradation status if the processing result.
[0012] Based on the same inventive concept, an embodiment of the present invention also proposes a data exchange platform gateway, including: a request receiving unit, used to receive a traffic request initiated by a client, wherein the request header of the traffic request includes signature information; a request forwarding unit, used to perform authentication based on the signature information in the request header, and after successful authentication, forward the traffic request to an application server for processing based on the service degradation situation; a downgrade update unit, used to obtain the processing result of the application server and update the service degradation situation based on the processing result.
[0013] Based on the same inventive concept, an embodiment of the present invention further proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the aforementioned method when executing the program.
[0014] Based on the same inventive concept, an embodiment of the present invention further proposes a computer storage medium, in which at least one executable instruction is stored, and the executable instruction enables a processor to execute the aforementioned method.
[0015] The beneficial effects of the present invention are as follows: as can be seen from the above description, an embodiment of the present invention provides an inter-application data signature transmission method and a data exchange platform gateway, the method comprising: receiving a traffic request initiated by a client, wherein the request header of the traffic request includes signature information; performing authentication according to the signature information in the request header, and forwarding the traffic request to an application server for processing according to the service degradation situation after successful authentication; obtaining the processing result of the application server and updating the service degradation situation according to the processing result, which can improve the concurrent processing capability of the data exchange platform gateway by reducing the resource consumption required for signature verification. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 Schematic diagram of the flow of the method for transmitting data signatures between applications in an embodiment of the present invention;
[0018] Figure 2 A schematic diagram of a method for processing a traffic request after successful authentication in an embodiment of the present invention;
[0019] Figure 3 This is a schematic diagram of the structure of a data exchange platform gateway in an embodiment of the present invention;
[0020] Figure 4 Schematic diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0022] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present invention should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present invention do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0023] The embodiment of the present invention provides a method for transmitting data signatures between applications. The method for transmitting data signatures between applications in the embodiment of the present invention is applied to a data exchange platform gateway. Figure 1 As shown, the method for transmitting data signatures between applications includes:
[0024] Step S11: receiving a traffic request initiated by a client, wherein a request header of the traffic request includes signature information.
[0025] In the embodiment of the present invention, digital signature and signature verification are performed based on asymmetric encryption algorithm and HTTP / HTTPS request header information transmission technology, which is used for data exchange platform gateway authorization and authentication between applications. At the same time, the data exchange platform gateway of JAVA NIO non-blocking IO framework NETTY is used to implement it, and the concurrent processing capability of the data exchange platform gateway is further improved while reducing the resource consumption required for signature verification. On the client side, a first encoding value is generated according to a 14-bit timestamp and a public key provided to the client, and the first encoding value is a BASE64 encoding value; an irreversible MD5 algorithm is applied according to the 14-bit timestamp and the assigned client private key to obtain a 32-bit MD5 value; the first encoding value is spliced with the MD5 value to obtain an irreversible unique signature with a time attribute. The 32-bit MD5 value generated by the client brings in the unique private key generated by the application platform for the client. The private key does not participate in the message transmission. At the same time, the MD5 algorithm is irreversible encryption, which effectively prevents criminals from launching attacks by stealing private keys and forging signatures.
[0026] In step S11, a traffic request initiated by a client is received, the request header of the traffic request includes signature information, the signature information includes a first coding value generated according to a timestamp and a public key of the client, and an MD5 value obtained by applying an MD5 algorithm to the timestamp and a private key of the client.
[0027] The embodiment of the present invention adopts a method of bringing in a timestamp signature to ensure that the same signature cannot be reused for a long time. At the same time, 1. an irreversible signature algorithm is adopted to ensure that the signature cannot be forged.
[0028] Step S12: Authentication is performed according to the signature information in the request header, and after successful authentication, the traffic request is forwarded to the application server for processing according to the service degradation situation.
[0029] In an embodiment of the present invention, optionally, the signature information in the request header is extracted, the signature information including a first coding value generated according to the timestamp and the public key of the client and an MD5 value obtained by applying the MD5 algorithm to the timestamp and the client private key; the corresponding private key is obtained according to the public key of the client; the current timestamp is compared with the timestamp to determine whether it is within the valid signature range; if so, it means that the authentication is successful, and the traffic request is forwarded to the application server; otherwise, the signature is invalid, and a 400 exception is directly returned to the client.
[0030] In order to prevent the data exchange platform gateway from wasting a lot of resources and CPU time slices due to extracting the message body at the permission verification level, the embodiment of the present invention uses the HTTP / HTTPS message header to transmit the signature and identity information. The signature information and the public key of the client are passed to the data exchange platform gateway through the request header. After receiving the request, the data exchange platform gateway only needs to extract the request header information to obtain the relevant data required for authentication with minimal resources. It does not need to consume a lot of resources and CPU time slices to extract and parse the message body, which effectively solves the authentication efficiency problem when the data exchange platform gateway is subjected to high concurrency.
[0031] In step S12, optionally, after successful authentication, the service degradation is determined; if the service is not degraded, the traffic request is forwarded to the application server for processing; if the service is degraded, the traffic request is forwarded to the application server for processing according to the degradation check rules.
[0032] If the service is downgraded, further determine whether the traffic request meets the downgrade check rules. If the traffic request meets the downgrade check rules, forward the traffic request to the application server; if the traffic request does not meet the downgrade check rules, forward the traffic request to the message queue (MQ), and automatically pull up the business consumer to process the messages in the message queue. Specifically, try to forward the preset traffic to the application server at preset time intervals to asynchronously process the traffic; if the service can process the traffic normally, resume traffic forwarding. Among them, the preset time and preset traffic can be set as needed and are not limited here.
[0033] In an embodiment of the present invention, it is also possible to embed points in the request header of all requests directly after the signature verification at the data exchange platform gateway entrance, add a unique link ID, and adopt the log system (ELK) online log collection and retrieval architecture to collect and summarize all logs to facilitate the operation and maintenance party to track the entire request from entering the data exchange platform gateway to the final return to the requester throughout the entire life cycle link.
[0034] In the embodiment of the present invention, optionally, the status of the traffic passing through is collected in full or in a sampled manner; the collected data is calculated using a stream computing component according to preset warning rules to determine whether it complies with the warning rules; and warning reminders are issued for abnormal services and traffic that comply with the warning rules. Specifically, the status of the traffic passing through the data exchange platform gateway is collected in full or in a sampled manner. The console sets warning rules, collects data and calculates it using a stream computing component, issues warning reminders for abnormal services and traffic that comply with the warning rules, and can generate general or specific reports according to the rules, real-time control towers, etc.
[0035] The signature information of the embodiment of the present invention is transmitted by HTTP / HTTPS request header, which can effectively improve the processing power and concurrency performance of the authentication data exchange platform gateway. The non-blocking IO (NIO) framework is adopted to improve the high concurrency capability of the data exchange platform gateway.
[0036] Step S13: Obtain the processing result of the application server and update the service degradation status according to the processing result.
[0037] In an embodiment of the present invention, optionally, the processing result of the application server is received; if the processing result updates the service degradation situation. Specifically, the processing result is monitored, and when the business processing service processing capacity is insufficient and the processing result is abnormal for the first preset number of consecutive times, the service is downgraded. The subsequent new traffic requested to the service is forwarded to the message queue, and the business consumer is automatically pulled up to process the message queue messages. The first preset number can be set as needed, and is not limited here, preferably 3. At the same time, try to forward a certain amount of traffic to the service at fixed intervals. When the service can handle the traffic normally, resume traffic forwarding.
[0038] The complete process of flow request processing after successful authentication in the embodiment of the present invention is as follows: Figure 3 As shown, including:
[0039] Step 1: The data exchange platform gateway requests traffic after successful authentication.
[0040] After successful authentication, the data exchange platform gateway determines that it needs to request traffic from the server.
[0041] Step 2: Determine whether the service is downgraded. If yes, go to step 5; if no, go to step 3.
[0042] First, determine whether the service corresponding to the traffic is degraded.
[0043] Step 3: Process the traffic request.
[0044] If the service corresponding to the traffic is not degraded, the traffic request is directly forwarded to the application server. The application server processes the traffic request and obtains the processing result of the traffic request.
[0045] Step 4: The processing result is fed back to the data exchange platform gateway. If there are continuous failures, the service will be downgraded. If there are continuous successes during service downgrade, the service will be restored.
[0046] The application server feeds back the processing result to the data exchange platform gateway. The data exchange platform gateway updates the degradation of the service corresponding to the traffic request according to the processing result. Specifically, if the service corresponding to the traffic request is not downgraded, and the processing results are abnormal for the first preset number of times in a row. The service is downgraded. If the service corresponding to the traffic request is in a degraded state, and the processing results are successful for the second preset number of times in a row, the normal processing of the service is restored. The first preset number and the second preset number can be set as needed and are not limited here.
[0047] Step 5: Determine whether the downgrade check rule is met. If yes, jump to step 3; if no, go to step 6.
[0048] If the service corresponding to the traffic is in a degraded state, it is further determined whether the traffic request satisfies the degraded check rule. If the traffic request satisfies the degraded check rule, it returns to step 3 and forwards the traffic request to the application server for normal processing.
[0049] Step 6: Add the traffic request to the message queue.
[0050] If the traffic request does not satisfy the downgrade check rule, the traffic request is added to the message queue.
[0051] Step 7: Business message consumers process traffic asynchronously.
[0052] Automatically pull up the business consumer to process the messages in the message queue. Specifically, try to forward the preset traffic to the application server at preset intervals to asynchronously process the traffic; if the service can process the traffic normally, resume traffic forwarding. The preset time and preset traffic can be set as needed and are not limited here.
[0053] The embodiments of the present invention realize the capabilities of full-link tracking, early warning, automatic recovery of service degradation and visual monitoring of the data exchange platform through service monitoring, log collection and stream computing.
[0054] To summarize, the method for transmitting data between applications with signatures in an embodiment of the present invention receives a traffic request initiated by a client, wherein the request header of the traffic request includes signature information; performs authentication based on the signature information in the request header, and after successful authentication, forwards the traffic request to an application server for processing based on the service degradation situation; obtains the processing result of the application server and updates the service degradation situation based on the processing result, thereby improving the concurrent processing capability of the data exchange platform gateway while reducing the resource consumption required for signature verification.
[0055] The above specific embodiments of the present invention are described. In some cases, the actions or steps recorded in the embodiments of the present invention can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the process depicted in the accompanying drawings does not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0056] Based on the same concept, the embodiment of the present invention also provides a data exchange platform gateway. Figure 3 As shown, the data exchange platform gateway includes: a request receiving unit, a request forwarding unit and a downgrade update unit.
[0057] A request receiving unit, configured to receive a traffic request initiated by a client, wherein a request header of the traffic request includes signature information;
[0058] A request forwarding unit, configured to perform authentication according to the signature information in the request header, and forward the traffic request to an application server for processing according to the service degradation situation after successful authentication;
[0059] A degradation updating unit is used to obtain a processing result of the application server and update the service degradation situation according to the processing result.
[0060] For the convenience of description, the above device is described as various modules according to their functions. Of course, when implementing the embodiment of the present invention, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0061] The device of the above embodiment is applied to the corresponding method in the above embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0062] Based on the same inventive concept, an embodiment of the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in any one of the above embodiments is implemented.
[0063] An embodiment of the present invention provides a non-volatile computer storage medium, wherein the computer storage medium stores at least one executable instruction, and the computer executable instruction can execute the method described in any of the above embodiments.
[0064] Figure 4 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 401, a memory 402, an input / output interface 403, a communication interface 404, and a bus 405. The processor 401, the memory 402, the input / output interface 403, and the communication interface 404 are connected to each other in communication within the device through the bus 405.
[0065] The processor 401 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solution provided by the method embodiment of the present invention.
[0066] The memory 402 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 402 can store an operating system and other application programs. When the technical solution provided by the method embodiment of the present invention is implemented by software or firmware, the relevant program code is stored in the memory 402 and called and executed by the processor 401.
[0067] The input / output interface 403 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0068] The communication interface 404 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0069] The bus 405 comprises a pathway for transmitting information between the various components of the device (eg, the processor 401 , the memory 402 , the input / output interface 403 , and the communication interface 404 ).
[0070] It should be noted that, although the above device only shows the processor 401, the memory 402, the input / output interface 403, the communication interface 404 and the bus 405, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiment of the present invention, and does not necessarily include all the components shown in the figure.
[0071] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application is limited to these examples. Based on the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the present application as described above, which are not provided in detail for the sake of simplicity.
[0072] This application is intended to cover all such substitutions, modifications and variations that fall within the broad scope of the embodiments of the present invention. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the scope of protection of this application.
Claims
1. A method for transmitting data signatures between applications, characterized in that: The method comprises: Receiving a traffic request initiated by a client, wherein a request header of the traffic request includes signature information; Performing authentication according to the signature information in the request header, and forwarding the traffic request to an application server for processing according to the service degradation situation after successful authentication; Obtain a processing result of the application server and update the service degradation status according to the processing result.
2. The method according to claim 1, characterized in that: The performing authentication according to the signature information in the request header includes: Extracting the signature information in the request header, the signature information including a first encoding value generated according to a timestamp and a public key of the client and an MD5 value obtained by applying an MD5 algorithm to the timestamp and a private key of the client; Obtaining a corresponding private key according to the public key of the client; Compare the current timestamp with the timestamp to see if it is within the valid signature range; If yes, the authentication is successful; otherwise the signature is invalid.
3. The method according to claim 1, characterized in that: After the authentication is successful, forwarding the traffic request to the application server for processing according to the service degradation situation includes: After successful authentication, determine the service degradation situation; If the service is not degraded, forwarding the traffic request to the application server for processing; If the service is degraded, the traffic request is forwarded to the application server for processing according to the degradation check rule.
4. The method according to claim 3, characterized in that: The forwarding the traffic request to the application server for processing according to the degradation check rule includes: If the traffic request satisfies the degradation check rule, forwarding the traffic request to the application server; If the traffic request does not satisfy the degradation check rule, the traffic request is forwarded to the message queue, and a service consumer is automatically started to process the messages in the message queue.
5. The method according to claim 4, characterized in that: The automatically pulling up the service consumer to process the messages in the message queue includes: Attempt to forward preset traffic to the application server at preset intervals to process traffic asynchronously; If the service can handle traffic normally, traffic forwarding is resumed.
6. The method according to claim 1, characterized in that: The method further comprises: Collect the full or sampled status of the traffic passing through; According to the preset warning rules, the collected data is calculated using the stream computing component to determine whether it meets the warning rules; Provide early warning reminders for abnormal services and traffic that meet the early warning rules.
7. The method according to claim 1, characterized in that: The obtaining the processing result of the application server and updating the service degradation situation according to the processing result includes: receiving a processing result from the application server; If the processing result updates the service degradation situation.
8. A data exchange platform gateway, characterized in that: The data exchange platform gateway includes: A request receiving unit, configured to receive a traffic request initiated by a client, wherein a request header of the traffic request includes signature information; A request forwarding unit, configured to perform authentication according to the signature information in the request header, and forward the traffic request to an application server for processing according to the service degradation situation after successful authentication; The downgrade updating unit is used to obtain the processing result of the application server and update the service degradation situation according to the processing result.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.
10. A computer storage medium, characterized in that: The storage medium stores at least one executable instruction, and the executable instruction enables the processor to execute the method according to any one of claims 1 to 7.
