Heartbeat connection-based interface authentication method and system

By adopting dynamic random generation of keys and encrypted data in inter-server communication, combined with the secure design of heartbeat connection, the problems of key management complexity, single authentication method and insufficient security of heartbeat mechanism in the prior art are solved, and the problem of key management complexity, single authentication method and insufficient security of heartbeat mechanism in the prior art is realized. More efficient inter-server communication security and simplified key management.

CN119483922APending Publication Date: 2025-02-18HANGZHOU ARCVIDEO TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411371720.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing inter-server communication authentication methods have problems such as complex key management, single authentication methods, lack of dynamicity and insufficient security of heartbeat mechanisms, which makes it difficult to ensure the security of inter-server communication in a complex and changeable network environment.

Method used

The interface authentication method based on heartbeat connection is adopted to dynamically randomly generate keys, encrypt request and response data, and establish and maintain heartbeat connections to ensure the dynamic and security of the keys and prevent unauthorized access and data leakage.

Benefits of technology

It improves the security of communication between servers, simplifies key management, enhances the diversity of authentication methods, and improves the security of the heartbeat mechanism to meet the needs of different distributed system architectures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119483922A_ABST
    Figure CN119483922A_ABST
Patent Text Reader

Abstract

The invention discloses an interface authentication method and system based on heartbeat connection, the method is applied to a system comprising an interface calling server and an interface providing server, and the method comprises the following steps: setting the interface calling server and the interface calling server to carry out key exchange and storage; setting an interface calling server and an interface providing server to generate a mixed encryption key according to an agreed algorithm; setting a heartbeat mechanism to transmit a heartbeat packet so as to confirm the states of the interface calling server and the interface providing server; the interface providing server receives the encrypted request data and carries out interface request decryption and processing; the interface providing server encrypts the response data by using the mixed encryption key, and sends the encrypted response data to the interface calling server; the interface calling server receives the encrypted response data; decrypting the response data by using the hybrid encryption key, and processing a decrypted response result; and executing the interface service logic, and responding to a result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of computer technology, and in particular relates to an interface authentication method and system based on heartbeat connection. Background Art

[0002] In the current distributed system architecture, the interaction between servers is becoming more and more frequent, especially in the fields of cloud computing, big data processing, microservice architecture, etc. These interactions usually involve the transmission and sharing of sensitive data, so how to ensure the security of communication between servers has become an urgent problem to be solved.

[0003] Traditional authentication methods for inter-server communication, such as authentication methods based on static keys or shared secret keys, have ensured the confidentiality of communication to a certain extent. However, due to the fixed nature of their keys, these methods are relatively vulnerable to malicious attacks. Once attackers obtain these keys, they can easily impersonate legitimate servers to perform illegal operations, posing a serious security threat to the system. The following deficiencies exist in the prior art: (1) Complexity of key management: In the interaction between servers, traditional key management methods often involve the generation, distribution and storage of multiple keys, which not only increases the complexity of management, but also easily leads to the risk of key leakage. (2) Single authentication method: Existing authentication methods for inter-server communication usually adopt a single authentication method, such as authentication based on username, password or token. This single authentication method is easily exploited by attackers to attack through brute force or stealing tokens. (3) Lack of dynamism: Traditional authentication methods for inter-server communication often lack dynamism and cannot adjust the authentication strategy in time according to changes in the network environment or server status. This makes it difficult to ensure the security of inter-server communication in a complex and changing network environment. (4) Insufficient security of the heartbeat mechanism: Although the existing interface authentication method based on the heartbeat connection has improved the security of communication to a certain extent, the security of the heartbeat mechanism is still insufficient in the interaction scenario between servers. For example, the content, frequency and transmission method of the heartbeat packet may lack sufficient security design, which can be easily exploited by attackers to attack or steal sensitive information. Summary of the invention

[0004] In view of the above problems, the present invention provides an interface authentication method and system based on heartbeat connection, which effectively prevents unauthorized access and data leakage by dynamically and randomly generating keys, encrypting request and response data, and establishing and maintaining heartbeat connections.

[0005] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0006] A first aspect of the present invention provides an interface authentication method based on a heartbeat connection, which is applied to a system including an interface calling server and an interface providing server, and comprises the following steps:

[0007] Setting up an interface calling server and an interface calling server to exchange and store keys, wherein the keys include a calling end key and a providing end key;

[0008] Set the interface calling server and the interface providing server to generate a hybrid encryption key based on the agreed algorithm by combining the calling end key and the providing end key, and the hybrid encryption key is used for subsequent data encryption and decryption;

[0009] Set up a heartbeat mechanism to transmit heartbeat packets to confirm the status of the interface calling server and the interface providing server;

[0010] If the status of the interface calling server and the interface providing server are normal, set the interface calling server to encrypt the interface calling request;

[0011] The interface provides a server to receive encrypted request data, decrypt and process the interface request; verify whether the associated key is valid. If the key is valid, the hybrid encryption key is used to decrypt the request data and execute the corresponding business logic; if the key is invalid, the request is rejected and an error response is returned;

[0012] The interface providing server encrypts the response data using a mixed encryption key and sends the encrypted response data to the interface calling server;

[0013] The interface calling server receives the encrypted response data; uses the hybrid encryption key to decrypt the response data, processes the decrypted response result, and initiates the actual business execution; executes the interface business logic and responds to the result.

[0014] In one possible implementation, the setting of the interface calling server and the interface calling server for key exchange and storage specifically includes: the interface calling server generates a random caller key, and when establishing a connection with the interface providing server, sends the caller key to the interface providing server through a secure channel; the interface providing server receives and verifies the caller key, generates a corresponding providing key, and stores it in association with the caller key; the interface calling server receives the providing key, and stores it in association with the caller key.

[0015] In a possible implementation manner, a status flag is set in the key association information when the key is associated and stored, and the status flag is used to mark whether the key is valid.

[0016] In a possible implementation, the setting of a heartbeat mechanism to transmit heartbeat packets and thereby confirm the status of the interface calling server and the interface providing server specifically includes: the interface calling server periodically sends heartbeat packets including calling end key information to the interface providing server; the interface providing server creates a heartbeat timing task after receiving the heartbeat connection parameters; the heartbeat sending module periodically generates heartbeat packets including providing end key information according to the timing task, and encrypts them with the calling end key and sends them to the interface calling server; the heartbeat receiving module continuously monitors and receives a response from the interface providing server. If no response is received from the interface providing server within a preset number of consecutive heartbeat cycles, the heartbeat is deemed to be disconnected, and the associated key is set to an invalid state.

[0017] In a possible implementation, the setting of the interface calling server to encrypt the interface calling request specifically includes: before initiating the interface call, the interface calling server checks whether the key is valid. If the key is valid, the request parameters are encrypting using the mixed encryption key, and the encrypted request data is sent to the interface providing server.

[0018] The second aspect of the present invention provides an interface authentication system based on a heartbeat connection, comprising a system of an interface calling server and an interface providing server, wherein the interface calling server is further configured to include a heartbeat connection module, a heartbeat receiving module, an interface providing server collection module, an encryption module and an interface calling module; the interface providing server is further configured to include a heartbeat creation module, a heartbeat sending module, an interface calling server collection module, an external interface module, a decryption verification module and an interface execution module, wherein:

[0019] The heartbeat connection module is used to generate random caller key information and initiate a heartbeat creation request;

[0020] The heartbeat receiving module is used to receive and verify the heartbeat packet information;

[0021] The interface providing server set module is used to store and manage the association information between the providing end key and the calling end key;

[0022] The encryption module is used to perform signature calculation on the requested interface parameters;

[0023] The interface calling module is used to initiate an interface calling application;

[0024] The heartbeat creation module is used to receive and verify heartbeat connection parameters and create a heartbeat timing task;

[0025] The heartbeat sending module is used to generate a provider key, and encrypt the heartbeat packet information in combination with the caller key for transmission;

[0026] The interface calling server assembly module is used to store and manage the association information between the calling end key and the providing end key;

[0027] The external interface module is used to provide business interface capabilities, encapsulate business execution logic, and receive business parameters;

[0028] The decryption verification module is used to verify the received signature and initiate the actual business execution;

[0029] The interface execution module is used to execute the interface business logic and respond to the result.

[0030] In a possible implementation, the working process is as follows:

[0031] The interface calling server and the interface calling server perform key exchange and storage, wherein the key includes a calling end key and a providing end key;

[0032] The interface calling server and the interface providing server generate a hybrid encryption key based on the agreed algorithm, combining the calling end key and the providing end key, and the hybrid encryption key is used for subsequent data encryption and decryption;

[0033] The heartbeat mechanism is used to transmit heartbeat packets to confirm the status of the interface calling server and the interface providing server;

[0034] If the status of the interface calling server and the interface providing server are normal, the interface calling server encrypts the interface calling request;

[0035] The interface provides a server to receive encrypted request data, decrypt and process the interface request; verify whether the associated key is valid. If the key is valid, the hybrid encryption key is used to decrypt the request data and execute the corresponding business logic; if the key is invalid, the request is rejected and an error response is returned;

[0036] The interface providing server encrypts the response data using a mixed encryption key and sends the encrypted response data to the interface calling server;

[0037] The interface calling server receives the encrypted response data; uses the hybrid encryption key to decrypt the response data, processes the decrypted response result, and initiates the actual business execution; executes the interface business logic and responds to the result.

[0038] In a possible implementation, the setting of the interface calling server and the interface calling server for key exchange and storage specifically includes: the heartbeat connection module of the interface calling server generates a random caller key, and when establishing a connection with the interface providing server, sends the caller key to the interface providing server through a secure channel; the interface providing server receives and verifies the caller key, the heartbeat sending module generates a corresponding providing key, and stores it in association with the caller key; the interface providing server collection module of the interface calling server receives the providing key, and stores it in association with the caller key. In the key association information when the key is stored in association, a status flag is set, and the status flag is used to mark whether the key is valid.

[0039] In a possible implementation manner, a status flag is set in the key association information when the key is associated and stored, and the status flag is used to mark whether the key is valid.

[0040] In a possible implementation, the setting of a heartbeat mechanism to transmit heartbeat packets and thereby confirm the status of the interface calling server and the interface providing server specifically includes: the heartbeat connection module of the interface calling server periodically sends heartbeat packets including the calling end key information to the heartbeat creation module of the interface providing server; the heartbeat creation module of the interface providing server creates a heartbeat timing task after receiving the heartbeat connection parameters; the heartbeat sending module periodically generates heartbeat packets including the providing end key information according to the timing task, and encrypts the packets with the calling end key and sends them to the heartbeat receiving module of the interface calling server; the heartbeat receiving module continuously monitors and receives the response from the interface providing server. If no response is received from the interface providing server within a preset number of consecutive heartbeat cycles, the heartbeat is deemed to be disconnected, and the associated key is set to an invalid state.

[0041] In a possible implementation, the setting of the interface calling server to encrypt the interface calling request specifically includes: before initiating the interface call, the interface calling server checks whether the key is valid. If the key is valid, the request parameters are encrypting using the mixed encryption key, and the encrypted request data is sent to the interface providing server.

[0042] The present invention has the following beneficial effects:

[0043] (1) Improve the security of inter-server communication: By dynamically generating random keys, it aims to eliminate the security risks brought by static keys, ensure the confidentiality and integrity of inter-server communication, and prevent unauthorized access and data leakage.

[0044] (2) Simplified key management: To address the problem that traditional key management methods are complex and prone to leakage, dynamic key generation reduces the complexity of key generation, distribution, and storage, thereby reducing the risk of key management.

[0045] (3) Enhance the diversity of authentication methods: In order to address the problem that a single authentication method is vulnerable to attacks, a combination of multiple authentication mechanisms is adopted, that is, the heartbeat connection uses key authentication, and signature authentication is used after the heartbeat connection is established. The heartbeat connection is combined with key authentication to improve the diversity and security of authentication.

[0046] (4) Enhance the security of the heartbeat mechanism: To address the problem of insufficient security of the existing heartbeat mechanism, security designs have been made to the content, frequency, and transmission method of the heartbeat packet to prevent attackers from using the heartbeat packet to launch attacks or steal sensitive information.

[0047] (5) Adapt to different distributed system architectures: Aims to adapt to different distributed system architectures, such as cloud computing, big data processing, microservice architecture, etc., and provide secure and reliable communication guarantees for the development of these fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A flowchart of a method for interface authentication based on a heartbeat connection according to an embodiment of the present invention;

[0049] Figure 2 The present invention is a block diagram of a heartbeat connection-based interface authentication system according to another embodiment of the present invention. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0051] Reference Figure 1 , shown is a flowchart of a method for interface authentication based on a heartbeat connection according to an embodiment of the present invention, which is applied to a system including an interface calling server and an interface providing server, and includes the following steps:

[0052] S10, setting the interface calling server and the interface calling server to exchange and store keys, the keys including the calling end key and the providing end key;

[0053] S20, setting the interface calling server and the interface providing server to generate a hybrid encryption key based on the agreed algorithm by combining the calling end key and the providing end key, and the hybrid encryption key is used for subsequent data encryption and decryption;

[0054] S30, setting a heartbeat mechanism to transmit a heartbeat packet to confirm the status of the interface calling server and the interface providing server;

[0055] S40, if the status of the interface calling server and the interface providing server are normal, setting the interface calling server to encrypt the interface calling request;

[0056] S50, the interface providing server receives the encrypted request data, decrypts and processes the interface request; verifies whether the associated key is valid, and if so, uses the hybrid encryption key to decrypt the request data and executes the corresponding business logic; if the key is invalid, refuses to process the request and returns an error response;

[0057] S60, the interface providing server encrypts the response data using the mixed encryption key, and sends the encrypted response data to the interface calling server;

[0058] S70, the interface calling server receives the encrypted response data; uses the hybrid encryption key to decrypt the response data, processes the decrypted response result, and initiates real business execution; executes the interface business logic and responds to the result.

[0059] In another embodiment of the present invention, an interface authentication method based on a heartbeat connection is provided. In S10, an interface calling server and an interface calling server are set to exchange and store keys, specifically including: the interface calling server generates a random calling end key, and when establishing a connection with an interface providing server, sends the calling end key to the interface providing server through a secure channel; the interface providing server receives and verifies the calling end key, generates a corresponding providing end key, and stores it in association with the calling end key; the interface calling server receives the providing end key, and stores it in association with the calling end key. In the key association information when the key is stored in association, a status identifier is set, and the status identifier is used to mark whether the key is valid.

[0060] According to another embodiment of the present invention, a method for interface authentication based on a heartbeat connection is provided, in which a heartbeat mechanism is set in S30 to transmit a heartbeat packet and then confirm the status of an interface calling server and an interface providing server. Specifically, the interface calling server periodically sends a heartbeat packet including the calling end key information to the interface providing server; after receiving the heartbeat connection parameters, the interface providing server creates a heartbeat timing task; the heartbeat sending module periodically generates a heartbeat packet including the providing end key information according to the timing task, and encrypts the heartbeat packet with the calling end key and sends it to the interface calling server; the interface calling server continuously monitors and receives a response from the interface providing server. If no response is received from the interface providing server within a preset number of consecutive heartbeat cycles, the heartbeat is considered to be disconnected, and the associated key is set to an invalid state.

[0061] Another embodiment of the present invention is an interface authentication method based on a heartbeat connection, in which an interface calling server is set in S40 to encrypt an interface calling request, specifically including: before initiating an interface call, the interface calling server checks whether the key is valid; if the key is valid, the request parameters are encrypting using a mixed encryption key, and the encrypted request data is sent to the interface providing server.

[0062] The interface authentication method based on the heartbeat connection set above effectively prevents unauthorized access and data leakage by dynamically and randomly generating keys, encrypting request and response data, and establishing and maintaining heartbeat connections. It also simplifies key management and reduces management risks. In addition, by combining multiple authentication mechanisms, the diversity of authentication methods is enhanced, and dynamic authentication strategies are introduced to adapt to different network environments or server states.

[0063] Corresponding to the embodiment of the method of the present invention, see Figure 2 , shown is a principle block diagram of an interface authentication system based on a heartbeat connection according to another embodiment of the present invention, including a system of an interface calling server and an interface providing server, wherein the interface calling server is further configured to include a heartbeat connection module, a heartbeat receiving module, an interface providing server collection module, an encryption module and an interface calling module; the interface providing server is further configured to include a heartbeat creation module, a heartbeat sending module, an interface calling server collection module, an external interface module, a decryption verification module and an interface execution module, wherein the heartbeat connection module is used to generate random calling end key information and initiate a heartbeat creation request; the heartbeat receiving module is used to receive and verify heartbeat packet information; the interface providing server collection module is used to store and manage The heartbeat sending module is used to generate the provider key, and encrypt the heartbeat packet information with the caller key for transmission; the interface call server collection module is used to store and manage the caller key and the provider key association information; the external interface module is used to provide business interface capabilities, encapsulate business execution logic, and receive business parameters; the decryption verification module is used to verify the received signature and initiate real business execution; the interface execution module is used to execute the interface business logic and respond to the results.

[0064] The interface authentication system based on heartbeat connection set up above works as follows:

[0065] The interface calling server and the interface calling server exchange and store keys, and the keys include the calling end key and the providing end key; the interface calling server and the interface providing server generate a hybrid encryption key according to the agreed algorithm, combining the calling end key and the providing end key, and the hybrid encryption key is used for subsequent data encryption and decryption; the heartbeat packet is transmitted through the heartbeat mechanism to confirm the status of the interface calling server and the interface providing server; if the status of the interface calling server and the interface providing server is normal, the interface calling server encrypts the interface calling request; the interface providing server receives the encrypted request data, decrypts and processes the interface request; verifies whether the associated key is valid, and if the key is valid, uses the hybrid encryption key to decrypt the request data, and executes the corresponding business logic; if the key is invalid, refuses to process the request and returns an error response; the interface providing server encrypts the response data using the hybrid encryption key, and sends the encrypted response data to the interface calling server; the interface calling server receives the encrypted response data; uses the hybrid encryption key to decrypt the response data, processes the decrypted response result, and initiates real business execution; executes the interface business logic, and responds to the result.

[0066] Another embodiment of the present invention is an interface authentication system based on a heartbeat connection, and setting an interface calling server and an interface calling server to exchange and store keys specifically includes: the heartbeat connection module of the interface calling server generates a random calling end key, and when establishing a connection with the interface providing server, sends the calling end key to the interface providing server through a secure channel; the interface providing server receives and verifies the calling end key, the heartbeat sending module generates a corresponding providing end key, and associates and stores it with the calling end key; the interface providing server collection module of the interface calling server receives the providing end key, and associates and stores it with the calling end key. In the key association information when the key is associated and stored, a status identifier is set, and the status identifier is used to mark whether the key is valid.

[0067] Another embodiment of the present invention is an interface authentication system based on heartbeat connection, and a heartbeat mechanism is set to transmit a heartbeat packet to confirm the status of the interface calling server and the interface providing server. Specifically, the heartbeat connection module of the interface calling server regularly sends a heartbeat packet including the calling end key information to the heartbeat creation module of the interface providing server; the heartbeat creation module of the interface providing server creates a heartbeat timing task after receiving the heartbeat connection parameters; the heartbeat sending module regularly generates a heartbeat packet including the providing end key information according to the timing task, and encrypts it in combination with the calling end key and sends it to the heartbeat receiving module of the interface calling server; the heartbeat receiving module continuously monitors and receives a response from the interface providing server. If the response of the interface providing server is not received within a preset multiple consecutive heartbeat cycles, it is considered that the heartbeat is disconnected, and the associated key is set to an invalid state. The heartbeat mechanism ensures the validity of the key and the continuity of the communication. When the heartbeat is disconnected, the associated key will be set to an invalid state, thereby ensuring the security of data transmission. In addition, the invalidation of the key can also be used as a security strategy to prevent unauthorized access and data leakage under abnormal circumstances.

[0068] Another embodiment of the present invention is an interface authentication system based on a heartbeat connection, and setting an interface call server to encrypt an interface call request specifically includes: before initiating an interface call, the interface call module of the interface call server checks whether the key is valid; if the key is valid, the request parameters are encrypting using a mixed encryption key, and the encrypted request data is sent to the interface providing server.

[0069] Through the interface authentication system based on the heartbeat connection set up above, the interface calling server is responsible for initiating requests, exchanging keys with the interface providing server, encrypting request data, and ensuring the continuity of communication through the heartbeat connection. The interface providing server is responsible for receiving requests, exchanging keys with the interface calling server, decrypting request data, processing requests and returning encrypted responses. By dynamically generating keys randomly, encrypting request and response data, and establishing and maintaining heartbeat connections, unauthorized access and data leakage are effectively prevented, while key management is simplified and management risks are reduced. In addition, by combining multiple authentication mechanisms, the diversity of authentication methods is enhanced, and dynamic authentication strategies are introduced to adapt to different network environments or server states.

[0070] It should be understood that the exemplary embodiments described herein are illustrative rather than restrictive. Although one or more embodiments of the present invention have been described in conjunction with the accompanying drawings, it should be understood by those skilled in the art that various changes in form and detail may be made without departing from the spirit and scope of the present invention as defined by the appended claims.

Claims

1. An interface authentication method based on heartbeat connection, characterized in that: Applicable to a system including an interface calling server and an interface providing server, comprising the following steps: Setting up an interface calling server and an interface calling server to exchange and store keys, wherein the keys include a calling end key and a providing end key; Set the interface calling server and the interface providing server to generate a hybrid encryption key based on the agreed algorithm by combining the calling end key and the providing end key, and the hybrid encryption key is used for subsequent data encryption and decryption; Set up a heartbeat mechanism to transmit heartbeat packets to confirm the status of the interface calling server and the interface providing server; If the status of the interface calling server and the interface providing server are normal, set the interface calling server to encrypt the interface calling request; The interface provides a server to receive encrypted request data, decrypt and process the interface request; verify whether the associated key is valid. If the key is valid, the hybrid encryption key is used to decrypt the request data and execute the corresponding business logic; if the key is invalid, the request is rejected and an error response is returned; The interface providing server encrypts the response data using a mixed encryption key and sends the encrypted response data to the interface calling server; The interface calling server receives the encrypted response data; uses the hybrid encryption key to decrypt the response data, processes the decrypted response result, and initiates the actual business execution; executes the interface business logic and responds to the result.

2. The interface authentication method based on heartbeat connection as claimed in claim 1, characterized in that: The setting of the interface calling server and the interface calling server for key exchange and storage specifically includes: the interface calling server generates a random calling end key, and when establishing a connection with the interface providing server, sends the calling end key to the interface providing server through a secure channel; the interface providing server receives and verifies the calling end key, generates a corresponding providing end key, and associates and stores it with the calling end key; the interface calling server receives the providing end key, and associates and stores it with the calling end key.

3. The interface authentication method based on heartbeat connection as claimed in claim 2, characterized in that: In the key association information when the key is stored in association, a status identifier is set, and the status identifier is used to mark whether the key is valid.

4. The interface authentication method based on heartbeat connection as claimed in claim 1, characterized in that: The setting of the heartbeat mechanism to transmit the heartbeat packet and then confirm the status of the interface calling server and the interface providing server specifically includes: the interface calling server periodically sends a heartbeat packet including the calling end key information to the interface providing server; after receiving the heartbeat connection parameters, the interface providing server creates a heartbeat timing task; according to the timing task, periodically generates a heartbeat packet including the providing end key information, and encrypts it with the calling end key and sends it to the interface calling server; the interface calling server continuously monitors and receives a response from the interface providing server. If no response is received from the interface providing server within a preset number of consecutive heartbeat cycles, it is considered that the heartbeat is disconnected and the associated key is set to an invalid state.

5. The interface authentication method based on heartbeat connection as described in claim 4, characterized in that: The setting of the interface calling server to encrypt the interface calling request specifically includes: before initiating the interface call, the interface calling server checks whether the key is valid. If the key is valid, the request parameters are encrypting using the mixed encryption key, and the encrypted request data is sent to the interface providing server.

6. An interface authentication system based on heartbeat connection, characterized in that: A system comprising an interface calling server and an interface providing server, wherein the interface calling server is further configured to include a heartbeat connection module, a heartbeat receiving module, an interface providing server collection module, an encryption module and an interface calling module; the interface providing server is further configured to include a heartbeat creation module, a heartbeat sending module, an interface calling server collection module, an external interface module, a decryption verification module and an interface execution module, wherein: The heartbeat connection module is used to generate random caller key information and initiate a heartbeat creation request; The heartbeat receiving module is used to receive and verify the heartbeat packet information; The interface providing server set module is used to store and manage the association information between the providing end key and the calling end key; The encryption module is used to perform signature calculation on the requested interface parameters; The interface calling module is used to initiate an interface calling application; The heartbeat creation module is used to receive and verify heartbeat connection parameters and create a heartbeat timing task; The heartbeat sending module is used to generate a provider key, and encrypt the heartbeat packet information in combination with the caller key for transmission; The interface calling server assembly module is used to store and manage the association information between the calling end key and the providing end key; The external interface module is used to provide business interface capabilities, encapsulate business execution logic, and receive business parameters; The decryption verification module is used to verify the received signature and initiate the actual business execution; The interface execution module is used to execute the interface business logic and respond to the result.

7. The interface authentication system based on heartbeat connection as claimed in claim 6, characterized in that: The working process is as follows: The interface calling server and the interface calling server perform key exchange and storage, wherein the key includes a calling end key and a providing end key; The interface calling server and the interface providing server generate a hybrid encryption key based on the agreed algorithm, combining the calling end key and the providing end key, and the hybrid encryption key is used for subsequent data encryption and decryption; The heartbeat mechanism is used to transmit heartbeat packets to confirm the status of the interface calling server and the interface providing server; If the status of the interface calling server and the interface providing server are normal, the interface calling server encrypts the interface calling request; The interface provides a server to receive encrypted request data, decrypt and process the interface request; Verify whether the associated key is valid. If the key is valid, use the hybrid encryption key to decrypt the request data and execute the corresponding business logic; If the key is invalid, the request is rejected and an error response is returned; The interface providing server encrypts the response data using a mixed encryption key and sends the encrypted response data to the interface calling server; The interface calls the server to receive the encrypted response data; Use the hybrid encryption key to decrypt the response data, process the decrypted response result, and initiate the actual business execution; execute the interface business logic and respond to the result.

8. The interface authentication system based on heartbeat connection as claimed in claim 7, characterized in that: The setting of the interface calling server and the interface calling server for key exchange and storage specifically includes: the heartbeat connection module of the interface calling server generates a random calling end key, and when establishing a connection with the interface providing server, sends the calling end key to the interface providing server through a secure channel; the interface providing server receives and verifies the calling end key, the heartbeat sending module generates a corresponding providing end key, and associates and stores it with the calling end key; the interface providing server collection module of the interface calling server receives the providing end key, and associates and stores it with the calling end key. In the key association information when the key is associated and stored, a status identifier is set, and the status identifier is used to mark whether the key is valid.

9. The interface authentication system based on heartbeat connection as claimed in claim 8, characterized in that: In the key association information when the key is stored in association, a status identifier is set, and the status identifier is used to mark whether the key is valid.

10. The interface authentication system based on heartbeat connection as claimed in claim 6, characterized in that: The heartbeat mechanism is set to transmit heartbeat packets and confirm the status of the interface calling server and the interface providing server. Specifically, the heartbeat connection module of the interface calling server periodically sends heartbeat packets including the calling end key information to the heartbeat creation module of the interface providing server; the heartbeat creation module of the interface providing server creates a heartbeat timing task after receiving the heartbeat connection parameters; the heartbeat sending module periodically generates heartbeat packets including the providing end key information according to the timing task, and encrypts them with the calling end key and sends them to the heartbeat receiving module of the interface calling server; the heartbeat receiving module continuously monitors and receives the response from the interface providing server. If no response is received from the interface providing server within a preset number of consecutive heartbeat cycles, it is considered that the heartbeat is disconnected and the associated key is set to an invalid state.

11. The interface authentication system based on heartbeat connection as claimed in claim 10, characterized in that: The setting of the interface calling server to encrypt the interface calling request specifically includes: before initiating the interface call, the interface calling server checks whether the key is valid. If the key is valid, the request parameters are encrypting using the mixed encryption key, and the encrypted request data is sent to the interface providing server.