Data transmission methods, devices, computer equipment, and media based on SaaS services
By using a long-connection connector server in the SaaS service to communicate with the local area network client, the problem of wasted storage resources caused by full uploads is solved, and secure and efficient data transmission is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-21
- Publication Date
- 2026-03-10
AI Technical Summary
In the SaaS model, uploading all database files from the local area network to the SaaS server consumes a large amount of storage space and resources, resulting in high resource consumption.
By establishing a long-lived connection between the connector server and the target connector client on the public network, forwarding data service requests and obtaining target data, the full upload is avoided, and data is only obtained from the local area network when needed.
It enables secure communication between the public network and the local area network, saves storage resources, and improves data transmission efficiency and security.
Smart Images

Figure CN116192927B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data transmission technology, and in particular to a data transmission method, apparatus, computer equipment, medium, and computer program product based on SaaS services. Background Technology
[0002] With the development of computer technology, the SaaS (Software as a Service) model has emerged. The SaaS model delivers software via the internet. In this model, software vendors deploy application software on SaaS servers. Users do not need to purchase or install the application software; instead, they rent the software provided by the vendor to fulfill their specific business needs. SaaS applications are typically deployed on SaaS servers on the public internet. Users can access the SaaS application software and use its functions via an internet connection. When implementing certain functions, the SaaS application software needs to obtain business data from the user's local area network (LAN) for business logic operations. Typically, to enable the SaaS application software on the public internet to access business data on the LAN, the user first uploads the entire database file containing the business data from the LAN to the SaaS server. When the SaaS application software needs to access business data from the LAN, it can directly retrieve that data from the SaaS server.
[0003] However, uploading all database files from the local area network to the SaaS server will consume a large amount of storage space on the SaaS server, resulting in significant resource consumption. Summary of the Invention
[0004] Therefore, it is necessary to provide a resource-saving data transmission method, apparatus, computer equipment, medium, and computer program product based on SaaS services to address the aforementioned technical problems.
[0005] Firstly, this application provides a data transmission method based on SaaS services. The method includes:
[0006] The connector server receives a data service request sent via SaaS service on the public network; the data service request carries a target connector client identifier, which points to a target connector client in the local area network.
[0007] The connector server forwards the data service request to the target connector client through a long connection with the target connector client;
[0008] The connector server receives target data from the local area network returned by the target connector client; the target data is obtained by the target connector client by calling a data service in the local area network according to the data service request.
[0009] The connector server sends the target data to the SaaS service so that the SaaS service can perform business calculations using the target data.
[0010] In one embodiment, the method further includes:
[0011] The target connector client sends heartbeat packets to the connector server at preset time intervals to maintain the long-term connection between the target connector client and the connector server.
[0012] When the target connector client detects that the long connection with the connector server is disconnected, the target connector client sends a disconnection reconnection request to the connector server every preset time interval until the connection with the connector server is successfully established.
[0013] In one embodiment, the method further includes:
[0014] If the connector server does not receive a heartbeat packet from the target connector client within a preset time period, the connector server disconnects the long connection with the target connector client.
[0015] In one embodiment, after the connector server receives a data service request sent via a SaaS service on the public network, the method further includes:
[0016] The connector server parses the data service request and determines the target connector client identifier carried in the data service request.
[0017] If the connector server determines that the long connection with the target connector client is disconnected based on the target connector client identifier, the connector server returns a prompt message to the SaaS service and stops responding to the data service request.
[0018] In one embodiment, the connector server forwards the data service request to the target connector client via a long-lived connection, including:
[0019] The connector server serializes the data service request;
[0020] The connector server encrypts the serialized data service request;
[0021] The connector server forwards the encrypted data service request to the target connector client through a long-lived connection with the target connector client.
[0022] In one embodiment, after the connector server forwards the data service request to the target connector client, the method further includes:
[0023] The target connector client loads and executes the corresponding data service code according to the data service request to invoke the data service;
[0024] The target connector client obtains the target data in the local area network and sends the target data to the connector server.
[0025] In one embodiment, the target connector client obtains target data in the local area network and sends the target data to the connector server, including:
[0026] The target connector client obtains target data from the local area network and serializes the obtained target data;
[0027] The target connector client encrypts the serialized target data;
[0028] The target connector client sends the encrypted target data to the connector server.
[0029] In one embodiment, the connector server sending the target data to the SaaS service includes:
[0030] When the connector server receives the target data returned by the target connector client, the connector server directly sends the target data to the SaaS service; or,
[0031] In response to the data retrieval requests periodically sent by the SaaS service carrying a request identifier, the connector server returns the stored target data corresponding to the request identifier to the SaaS service; the request identifier is returned by the connector server to the SaaS service after receiving the data service request sent through the SaaS service on the public network.
[0032] Secondly, this application also provides a connector server. The connector server includes:
[0033] The service interface module is used to receive data service requests sent via SaaS services on the public network; the data service request carries a target connector client identifier, which points to a target connector client in the local area network;
[0034] The forwarding module is used to forward the data service request to the target connector client through a long connection with the target connector client;
[0035] The service interface module is further configured to receive target data from the local area network returned by the target connector client; the target data is obtained by the target connector client by calling the data service in the local area network according to the data service request; and send the target data to the SaaS service so that the SaaS service can perform business calculations using the target data.
[0036] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0037] The connector server receives a data service request sent via SaaS service on the public network; the data service request carries a target connector client identifier, which points to a target connector client in the local area network.
[0038] The connector server forwards the data service request to the target connector client through a long connection with the target connector client;
[0039] The connector server receives target data from the local area network returned by the target connector client; the target data is obtained by the target connector client by calling a data service in the local area network according to the data service request.
[0040] The connector server sends the target data to the SaaS service so that the SaaS service can perform business calculations using the target data.
[0041] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0042] The connector server receives a data service request sent via SaaS service on the public network; the data service request carries a target connector client identifier, which points to a target connector client in the local area network.
[0043] The connector server forwards the data service request to the target connector client through a long connection with the target connector client;
[0044] The connector server receives target data from the local area network returned by the target connector client; the target data is obtained by the target connector client by calling a data service in the local area network according to the data service request.
[0045] The connector server sends the target data to the SaaS service so that the SaaS service can perform business calculations using the target data.
[0046] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0047] The connector server receives a data service request sent via SaaS service on the public network; the data service request carries a target connector client identifier, which points to a target connector client in the local area network.
[0048] The connector server forwards the data service request to the target connector client through a long connection with the target connector client;
[0049] The connector server receives target data from the local area network returned by the target connector client; the target data is obtained by the target connector client by calling a data service in the local area network according to the data service request.
[0050] The connector server sends the target data to the SaaS service so that the SaaS service can perform business calculations using the target data.
[0051] The aforementioned data transmission method, apparatus, computer equipment, media, and computer program products based on SaaS services allow the connector server in the public network to identify the target connector client in the local area network (LAN) through the target connector client identifier carried in the data service request. The data service request is forwarded through a long-lived connection with the target connector client, enabling communication between the public network and the LAN without requiring a public IP address, thus ensuring LAN network security. Furthermore, the target data is obtained by the target connector client calling the data service according to the data service request. The SaaS service retrieves the target data from the LAN for business calculations through the data service request; that is, the target data is only retrieved when the SaaS service needs it, eliminating the need to upload the entire database file from the LAN to the SaaS service server, thus saving storage resources. Attached Figure Description
[0052] Figure 1 This is an application environment diagram of a data transmission method based on SaaS services in one embodiment;
[0053] Figure 2 This is a flowchart illustrating a data transmission method based on SaaS services in one embodiment;
[0054] Figure 3 This is a flowchart illustrating the steps of maintaining connection and reconnecting after disconnection in one embodiment of a long connection;
[0055] Figure 4 This is a schematic diagram of the connector architecture in one embodiment;
[0056] Figure 5 This is a schematic diagram of the RPC component in one embodiment;
[0057] Figure 6 This is a request-response sequence diagram of a SaaS service in one embodiment;
[0058] Figure 7 This is a schematic diagram illustrating the principle of connector request relay service in one embodiment;
[0059] Figure 8 This is a schematic diagram illustrating the connector keep-alive and disconnection reconnection mechanism in one embodiment.
[0060] Figure 9 This is a structural block diagram of the connector server in one embodiment;
[0061] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0062] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0063] The data transmission method based on SaaS services provided in this application embodiment can be applied to, for example... Figure 1The application environment is shown. Connector server 104 can communicate with SaaS service 102, and connector server 104 can communicate with target connector client 106 via a long connection. SaaS service 102 can run on a SaaS server on the public network; the SaaS server can be implemented using a standalone server or a server cluster composed of multiple servers. Connector server 104 can run on a connector server on the public network; the connector server can be implemented using a standalone server or a server cluster composed of multiple servers. Target connector client 106 can run on a computer device on a local area network (LAN); the computer device can be a desktop computer, laptop, smartphone, tablet, or server. The database is used to store data within the LAN where target connector client 106 is located; it can be integrated into the computer device or placed on other computer devices within the LAN.
[0064] Based on such Figure 1 In the application environment shown, the connector server 104 can receive data service requests sent through the SaaS service 102, forward the data service request to the target connector client 106 through a long connection with the target connector client identifier carried in the data service request, receive the target data in the local area network returned by the target connector client 106, and send the target data to the SaaS service 102.
[0065] In one embodiment, such as Figure 2 As shown, a data transmission method based on SaaS services is provided. This embodiment applies this method to... Figure 1 Taking connector server 104 as an example, the method includes the following steps:
[0066] Step 202: The connector server receives a data service request sent via the SaaS service on the public network; the data service request carries the target connector client identifier, which points to the target connector client in the local area network.
[0067] In this context, a public network (WAN) is a network accessible to all computers, allowing them to communicate with each other via public IP addresses (Internet Protocol). A local area network (LAN) is a private network formed by interconnecting computer devices within a specific geographical area; computers within a LAN can communicate with each other.
[0068] SaaS is a model for delivering software services over the internet. A SaaS service is a web application software operating under the SaaS model. A data service request is a service request to retrieve data from a local area network (LAN). The target connector client identifier is a unique computer identity that distinguishes the target connector client from other connector clients.
[0069] In one embodiment, the connector server can receive data service requests sent by the SaaS service via a Web API (Application Programming Interface) over the public internet.
[0070] In one embodiment, the connector server can receive data service requests sent via SaaS services over the public network, parse the data service requests, and obtain the target connector client identifier pointing to the target connector client in the local area network.
[0071] In one embodiment, the SaaS service may respond to a data service trigger event by calling a Web API to access the connector server and sending a data service request to the connector server. The data service trigger event is an event that triggers the acquisition of data from the local area network for business calculations. The data service trigger event can be an automatically triggered event, such as a scheduled data service task set up through the SaaS service and automatically triggered at a specified time; or it can be a manually triggered operation, such as triggering a data service function key within the SaaS service.
[0072] Step 204: The connector server forwards the data service request to the target connector client through a long connection with the target connector client.
[0073] In this context, "connection" refers to a network connection, which can include short connections and long connections. A short connection is a network connection established when two communicating parties need to exchange data and closed after one data exchange is completed. A long connection is a network connection that maintains network connectivity for a long time, allowing the two communicating parties to exchange data multiple times. A long connection can be a persistent HTTP (Hypertext Transfer Protocol) connection, or a data path for continuously sending and receiving messages established based on at least one of the following protocols: TCP (Transmission Control Protocol), UDP (User Datagram Protocol), or others. Forwarding refers to the act of the connector server receiving a data service request and then sending the data service request to the target connector client.
[0074] In one embodiment, the connector server can directly forward received data service requests to the target connector client through a long-lived connection with the target connector client.
[0075] In one embodiment, the connector server can extract request data from a received data service request, construct a new data service request using the extracted request data, and forward the constructed data service request to the target connector client via a long-lived connection. The request data is the data in the data service request that instructs the target connector client to invoke the data service.
[0076] In one embodiment, the connector server may forward a data service request to the target connector client if it determines that the long connection between the connector server and the target connector client is in a connected state.
[0077] Step 206: The connector server receives the target data in the local area network returned by the target connector client; the target data is obtained by the target connector client calling the data service in the local area network according to the data service request.
[0078] The target data refers to the data within the local area network (LAN) that the SaaS service requests through a data service. The data service is the functional module that retrieves the target data from the LAN. Examples of data services include database connection services and database access services.
[0079] In one embodiment, the connector server can store a request identifier corresponding to a data service request sent by a SaaS service. In this embodiment, the connector server can receive target data from the local area network returned by the target connector client through a long-lived connection with the target connector client, and store the target data according to the request identifier of the data service request corresponding to the target data. The request identifier is a computer identifier that distinguishes different data service requests sent by the SaaS service.
[0080] In one embodiment, after forwarding a data service request to the target connector client, the connector server may periodically query the target connector client for the target data corresponding to the data service request, and obtain the target data upon finding the target data corresponding to the data service request.
[0081] Step 208: The connector server sends the target data to the SaaS service so that the SaaS service can perform business calculations using the target data.
[0082] Business computing refers to the processing of using target data to perform calculations in order to realize business functions in SaaS services.
[0083] In one embodiment, after receiving the target data, the connector server can respond to the data service request sent by the SaaS service and send the target data to the SaaS service.
[0084] In one embodiment, the connector server may store the target data after receiving it, and send the target data of the data service request to the SaaS service when the SaaS service actively queries the connector server for the response result of the data service request.
[0085] The aforementioned data transmission method based on SaaS services allows the connector server on the public network to identify the target connector client on the local area network (LAN) through the target connector client identifier carried in the data service request. It then forwards the data service request via a long-lived connection with the target connector client, enabling communication between the public network and the LAN without requiring a public IP address, thus ensuring LAN network security. Furthermore, the target data is obtained by the target connector client calling the data service according to the data service request. The SaaS service retrieves the target data from the LAN for business calculations via the data service request, meaning it only retrieves the target data when needed, eliminating the need to upload the entire database file from the LAN to the SaaS service server, thus saving storage resources.
[0086] In one embodiment, such as Figure 3 As shown, the data transmission method based on SaaS services described above also includes a persistent connection maintenance and reconnection step, which includes:
[0087] Step 302: The target connector client sends heartbeat packets to the connector server at preset time intervals to maintain the long-term connection between the target connector client and the connector server.
[0088] The preset time interval is a pre-set time interval, such as 10 seconds. A heartbeat packet is a data packet sent by the target connector client to notify the connector server that it is still online. The connection status refers to the state in which the target connector client and the connector server can exchange data via a persistent connection.
[0089] In one embodiment, after establishing a long connection with the connector server, the target connector client can continuously send heartbeat packets to the connector server at preset time intervals until it detects that the long connection with the connector server is disconnected.
[0090] Step 304: When the target connector client detects that the long connection with the connector server is in a disconnected state, the target connector client sends a disconnection reconnection request to the connector server every preset time interval until the connection with the connector server is successfully established.
[0091] The disconnected state is when the target connector client and the connector server are unable to exchange data via a persistent connection. The reconnection request is used to re-establish the persistent connection between the target connector client and the connector server.
[0092] In one embodiment, when the target connector client sends a heartbeat packet to the connector server, the target connector client can receive an acknowledgment message returned by the connector server. In this embodiment, if the target connector client does not receive an acknowledgment message from the connector server within a preset time period, the target connector client determines that the long connection with the connector server is disconnected.
[0093] In one embodiment, when the target connector client detects a disconnection event triggered by the connector server, the target connector client determines that the long-term connection with the connector server is broken. Here, the disconnection event is the event in which the connector server disconnects the long-term connection with the target connector client.
[0094] In this embodiment, the target connector client sends heartbeat packets to the connector server at preset time intervals, so that the connector server can know that the target connector client is still online, maintaining the long connection between the connector server and the target connector client without frequently establishing a connection. Moreover, when the long connection is broken, the target connector client sends a disconnection reconnection request to the connector server to re-establish the long connection, ensuring that the target connector client and the connector server can communicate, enabling subsequent rapid data exchange through the long connection and improving data transmission efficiency.
[0095] In one embodiment, the above-mentioned data transmission method based on SaaS services further includes the step of disconnecting the long connection, which includes: when the connector server does not receive a heartbeat packet sent by the target connector client within a preset time period, the connector server disconnects the long connection with the target connector client.
[0096] The preset duration is a pre-set time length, such as 5 minutes.
[0097] In this embodiment, if the connector server does not receive a heartbeat packet from the target connector client within a preset time period, it indicates that the target connector client is currently inactive. Disconnecting the long connection with the target connector client can save resources on the connector server.
[0098] In one embodiment, the connector server may include a monitoring module. After establishing a long-term connection with the target connector client, the monitoring module sets a timer for the target connector client. Each time a heartbeat packet is received from the target connector client, the timer is reset and restarted. In this embodiment, when the timer set for the target connector client reaches a preset duration, the connector server disconnects the long-term connection with the target connector client. The monitoring module is used to monitor the long-term connection between the connector server and the target connector client.
[0099] In one embodiment, the monitoring module in the connector server can record the target connector client as active when it receives a heartbeat packet sent by the target connector client; when the connector server detects that more than a preset time has passed since the last heartbeat packet was received, it disconnects the long connection with the target connector client and records the target connector client as inactive.
[0100] In one embodiment, after the connector server receives the data service request sent through the SaaS service on the public network in step 202, the above-mentioned data transmission method based on the SaaS service further includes: the connector server parses the data service request and determines the target connector client identifier carried in the data service request; if the connector server determines that the long connection with the target connector client is in a disconnected state based on the target connector client identifier, the connector server returns a prompt message to the SaaS service and stops responding to the data service request.
[0101] The notification message is sent to the SaaS service indicating that the long-term connection between the connector server and the target connector client is disconnected.
[0102] In this embodiment, when the connector server determines that the long connection with the target connector client is disconnected, the connector server and the target connector client cannot communicate, and therefore cannot forward the data service request to the target connector client for processing. At this time, returning a prompt message to the SaaS service can enable the SaaS service to be aware of the abnormal information in a timely manner and terminate the data service request in a timely manner, which can reduce resource consumption.
[0103] In one embodiment, the connector server may record the correspondence between the target connector client identifier and the target connector client's status, which includes an active state and an inactive state. An active state indicates that the long-lived connection between the connector server and the target connector client is in a connected state, while an inactive state indicates that the long-lived connection between the connector server and the target connector client is in a disconnected state. In this embodiment, the connector server can parse data service requests, extract the target connector client identifier from the data service request, and query the status of the target connector client based on the target connector client identifier. When the query finds that the target connector client is in an inactive state, the connector server returns a prompt message to the SaaS service and stops responding to data service requests.
[0104] In one embodiment, the data service request may carry request data, which may include service parameters. In this embodiment, when the connector server detects that the target connector client is active, it can further validate the service parameters using pre-configured annotations. If the parameter validation fails, the connector server returns a message indicating a parameter error to the SaaS service and stops responding to the data service request. Here, the service parameters are those that instruct the target connector client to invoke the data service. For example, when the data service is a database access service, the service parameters may be database access parameters.
[0105] In one embodiment, step 204 includes: the connector server serializing the data service request; the connector server encrypting the serialized data service request; and the connector server forwarding the encrypted data service request to the target connector client through a long connection with the target connector client.
[0106] Serialization refers to the process of converting data requested by a data service into a binary data stream. Encryption is the process of converting readable plaintext data into unreadable ciphertext.
[0107] In this embodiment, the connector server serializes the data service request, which helps to improve the transmission efficiency of the data service request; the serialized data service request is encrypted and then forwarded to the target connector client, which can ensure the data security during the transmission of the data service request.
[0108] In one embodiment, the connector server may serialize the received data service request using a serialization algorithm, encrypt the serialized data service request using an encryption algorithm, and forward the encrypted data service request to the target connector client through a long-lived connection. The serialization algorithm may include ProtoBuf (Protocol Buffers) serialization, JDK (Java Development Kit) serialization, or others. The encryption algorithm may include AES (Advanced Encryption Standard), DES (Data Encryption Standard), or others.
[0109] In one embodiment, the connector server can extract request data from the received data service request, serialize the extracted request data using a serialization algorithm, encrypt the serialized request data using an encryption algorithm, construct a new data service request, and forward the new data service request to the target connector client through a long connection with the target connector client.
[0110] In one embodiment, after performing step 204, the above-mentioned data transmission method based on SaaS services further includes: the target connector client loading and executing the corresponding data service code according to the data service request to call the data service; the target connector client obtaining the target data in the local area network and sending the target data to the connector server.
[0111] Among them, data service code is computer program code used to call data services to obtain target data.
[0112] In this embodiment, the connector server acts as a relay for data service requests, while the target connector client acts as the specific implementation of the data service. It loads and executes the corresponding data service code in the local area network, which can conveniently obtain the target data existing in the local area network with fast transmission speed and high security.
[0113] In one embodiment, the data service request received by the target connector client may carry request data, which may include the service name and service parameters. In this embodiment, the target connector server may read and load the data service code corresponding to the service name, pass in the service parameters, and execute the loaded data service code to invoke the data service.
[0114] In one embodiment, the step of the target connector client obtaining target data in the local area network and sending the target data to the connector server includes: the target connector client obtaining the target data in the local area network, serializing the obtained target data, encrypting the serialized target data, and sending the encrypted target data to the connector server.
[0115] In this embodiment, the target connector client serializes the target data obtained in the local area network, which can improve the transmission efficiency of the target data; and encrypts the serialized target data to ensure data security during the transmission of the target data.
[0116] In one embodiment, after the target connector client obtains the target data in the local area network by calling the data service, it serializes the target data using a serialization algorithm, encrypts the serialized target data using an encryption algorithm, and sends the encrypted target data to the connector server.
[0117] In one embodiment, step 208, in which the connector server sends the target data to the SaaS service, includes: when the connector server receives the target data returned by the target connector client, the connector server directly sends the target data to the SaaS service; or, in response to a data acquisition request carrying a request identifier periodically issued by the SaaS service, the connector server returns the stored target data corresponding to the request identifier to the SaaS service; the request identifier is returned by the connector server to the SaaS service after receiving the data service request sent through the SaaS service on the public network.
[0118] Among them, the data acquisition request is a request issued by the SaaS service to obtain target data from the connector server.
[0119] In this embodiment, when the connector server receives the target data, it sends the target data to the SaaS service, which can promptly return the target data to the SaaS service and improve request processing efficiency. When the SaaS service sends a data acquisition request, the connector server sends the target data to the SaaS service, so that the SaaS service does not need to wait for the connector server to return the target data after sending the data service request, but can obtain the target data by actively sending a data acquisition request, which is highly flexible.
[0120] In one embodiment, the SaaS service can send multiple data service requests to the connector server, each with its own request identifier. In this embodiment, the SaaS service can periodically send data acquisition requests to the connector server, polling the connector server for the target data corresponding to each of the multiple request identifiers carried in the data acquisition requests, and acquiring the target data corresponding to any request identifier when any of the multiple request identifiers has a corresponding target data.
[0121] In one embodiment, in a specific application scenario, the connector architecture diagram of the above-mentioned SaaS service-based data transmission method is as follows: Figure 4 As shown, the target connector client communicates with the connector server running on the connector server on the public network via a long TCP connection. The SaaS service running on the SaaS server on the public network communicates with the connector server via a Web API. The connector server and the target connector client can form a structure as follows: Figure 5 The diagram shown illustrates the principle of an RPC (Remote Procedure Call) component. The connector server may include a service forwarding center (forwarding module), a service caller (service interface module), and a service monitoring center (monitoring module). Based on... Figure 5 The request-response sequence diagram of the RPC component and SaaS service shown is as follows: Figure 6As shown. The above-described data transmission method based on SaaS services can be implemented using a dedicated communication protocol stack. This dedicated communication protocol stack may include the target connector client identifier, the request model for the data service request, the request identifier, the service name, service parameters, and error messages. Specifically, the above-described data transmission method based on SaaS services may include the following steps.
[0122] After establishing a persistent connection with the connector server for initial communication, the target connector client can register through the service forwarding center within the connector server. This service forwarding center can be implemented using a message queue middleware.
[0123] For reference Figure 6 The request-response sequence diagram shown illustrates that the connector server can receive data service requests sent via Web API through the SaaS service on the public network, parse the data service request, and obtain the target connector client identifier, service name, and service parameters carried in the data service request.
[0124] The connector server determines the status of the target connector client based on the target connector client identifier. Specifically, the connector server can perform link monitoring on the target connector client through a monitoring center, recording the mapping relationship between the target connector client identifier and the target connector client's status. Simultaneously, the monitoring center records session information of long-lived connections between the connector server and the target connector client, records data service requests, and records the response time for those data service requests.
[0125] When the target connector client is inactive (the target connector client does not exist), the connector server returns a message indicating that the target connector client is inactive to the SaaS service and stops responding to data service requests. When the target connector client is active, but the service parameters fail parameter validation, the connector server returns a message indicating that the service parameters are incorrect to the SaaS service and stops responding to data service requests.
[0126] When the target connector client is active and the service parameters pass validation, the connector server constructs a new data service request based on the service name and service parameters. (See example...) Figure 7 The diagram illustrates the principle of the connector request relay service. The connector server, based on the target connector client's identifier, forwards the constructed data service request to the target connector client via a long-lived connection, and returns the request identifier of the original data service request to the SaaS service. The connector server can connect to multiple connector clients, including the target connector client. The connector server can uniquely identify the target connector client using its identifier.
[0127] After receiving a forwarded data service request, the target connector client obtains the service name and service parameters, loads the corresponding data service code, and executes the loaded data service code after passing in the service parameters to invoke the data service and obtain the target data from the local area network. The way the target connector client invokes the data service based on the service name and service parameters is achieved using reflection, a mechanism in computer programming languages. Reflection is a mechanism that dynamically invokes code to implement functionality during program execution.
[0128] After receiving the target data returned by the target connector client, the connector server can store the target data under the corresponding request identifier of the data service request. When the SaaS service sends a data retrieval request to the connector server with the request identifier, the connector server retrieves the target data according to the request identifier, sends the target data to the SaaS service, and completes the response to the data service request sent by the SaaS service.
[0129] For reference Figure 8 The diagram illustrates the connector keep-alive and reconnection mechanism. After establishing a long-lived connection with the connector server, the target connector client can continuously send heartbeat packets to the connector server at preset time intervals to maintain the connection between the target connector client and the connector server. The preset time interval can be 10 seconds.
[0130] If the connector server does not receive a heartbeat packet from the target connector client within a preset time period, the connector server will disconnect the persistent connection with the target connector client. The preset time period can be 5 minutes.
[0131] When the target connector client detects that the long connection with the connector server is disconnected, the target connector client sends a disconnection reconnection request to the connector server at preset time intervals until the connection with the connector server is successfully established.
[0132] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0133] Based on the same inventive concept, this application also provides a connector server for implementing the data transmission method based on SaaS services described above. The solution provided by this connector server is similar to the implementation described in the above method; therefore, the specific limitations in one or more connector server embodiments provided below can be found in the limitations of the data transmission method based on SaaS services described above, and will not be repeated here.
[0134] In one embodiment, such as Figure 9 As shown, a connector server 900 is provided, including: a service interface module 910 and a forwarding module 920, wherein:
[0135] Service interface module 910 is used to receive data service requests sent through the SaaS service on the public network; the data service request carries the target connector client identifier, which points to the target connector client in the local area network; receive the target data in the local area network returned by the target connector client; the target data is obtained by the target connector client calling the data service in the local area network according to the data service request; and send the target data to the SaaS service so that the SaaS service can perform business calculations through the target data.
[0136] Forwarding module 920 is used to forward data service requests to the target connector client through a long connection with the target connector client.
[0137] In one embodiment, the target connector client sends heartbeat packets to the connector server at preset time intervals to maintain the connection status of the long connection between the target connector client and the connector server; when the target connector client detects that the long connection with the connector server is in a disconnected state, it sends a disconnection reconnection request to the connector server at preset time intervals until the connection with the connector server is successfully established.
[0138] In one embodiment, the connector server 900 further includes a monitoring module, which is used to disconnect the long connection with the target connector client when the connector server does not receive a heartbeat packet sent by the target connector client within a preset time period.
[0139] In one embodiment, the service interface module 910 is further configured to parse the data service request, determine the target connector client identifier carried in the data service request, and, if the connector server determines that the long connection with the target connector client is in a disconnected state based on the target connector client identifier, return a prompt message to the SaaS service and stop responding to the data service request.
[0140] In one embodiment, the forwarding module 920 is further configured to serialize the data service request; encrypt the serialized data service request; and forward the encrypted data service request to the target connector client via a long connection with the target connector client.
[0141] In one embodiment, the target connector client is also used to load and execute the corresponding data service code according to the data service request, so as to invoke the data service; obtain the target data in the local area network, and send the target data to the connector server.
[0142] In one embodiment, the target connector client is also used to obtain target data in the local area network, serialize the obtained target data, encrypt the serialized target data, and send the encrypted target data to the connector server.
[0143] In one embodiment, the service interface module 910 is further configured to, upon receiving target data returned by the target connector client, directly send the target data to the SaaS service; or, in response to a data acquisition request carrying a request identifier periodically issued by the SaaS service, return the stored target data corresponding to the request identifier to the SaaS service; the request identifier is returned by the connector server to the SaaS service after receiving the data service request sent through the SaaS service on the public network.
[0144] Each module in the aforementioned connector server can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of the computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0145] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores the data required for executing the aforementioned SaaS-based data transmission method. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a SaaS-based data transmission method.
[0146] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0147] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0148] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0149] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0150] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0151] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0152] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A data transmission method based on a SaaS service, characterized by, The method comprises: The connector server end receives a data service request sent by the SaaS service through the public network; the data service request carries a target connector client identifier pointing to a target connector client in a local area network; The connector server end serializes a service name and a service parameter in the data service request; the connector server end encrypts the serialized data service request; the connector server end forwards the encrypted data service request to the target connector client through a long connection between the connector server end and the target connector client, and returns a request identifier of the data service request before forwarding to the SaaS service; The connector server end receives target data in the local area network returned by the target connector client; the target data is obtained by the target connector client through calling a data service in the local area network by a data service code according to the service name and by inputting the service parameter into the loaded data service code; When the SaaS service sends a data acquisition request to the connector server end carrying the request identifier, the connector server end sends the target data to the SaaS service, so that the SaaS service performs business calculation through the target data.
2. The method of claim 1, wherein, The method further comprises: The target connector client sends a heartbeat packet to the connector server end at a preset time interval, so as to maintain the connection state of the long connection between the target connector client and the connector server end; When the target connector client detects that the long connection with the connector server end is in a disconnected state, the target connector client sends a disconnection reconnection request to the connector server end at a preset time interval until the connection with the connector server end is successful.
3. The method of claim 2, wherein, The method further comprises: When the connector server end does not receive the heartbeat packet sent by the target connector client within a preset time length, the connector server end disconnects the long connection with the target connector client.
4. The method of claim 1, wherein, After the connector server end receives a data service request sent by the SaaS service through the public network, the method further comprises: The connector server end analyzes the data service request and determines the target connector client identifier carried by the data service request; In a case where the connector server end determines that the long connection with the target connector client is in a disconnected state according to the target connector client identifier, the connector server end returns prompt information to the SaaS service and stops responding to the data service request.
5. The method of claim 1, wherein, The method further comprises: The target connector client obtains target data in the local area network and serializes the obtained target data; The target connector client encrypts the serialized target data; The target connector client sends the encrypted target data to the connector server end.
6. The method of claim 1, wherein the connector server end sending the target data to the SaaS service comprises: The connector server returns the stored target data corresponding to the request identifier to the SaaS service in response to a data acquisition request with the request identifier periodically sent by the SaaS service.
7. A connector service end, characterized by, The connector server comprises: a service interface module, configured to receive a data service request sent by a SaaS service through a public network; the data service request carries a target connector client identifier, and the target connector client identifier points to a target connector client in a local area network; a forwarding module, configured to serialize a service name and a service parameter in the data service request by the connector server; the connector server encrypts the serialized data service request; the connector server forwards the encrypted data service request to the target connector client through a long connection between the connector server and the target connector client, and returns a request identifier of the data service request before forwarding to the SaaS service; the service interface module is further configured to receive target data in the local area network returned by the target connector client; the target data is obtained by the target connector client in the local area network through a data service code according to the service name and by inputting the service parameter into the loaded data service code; when the SaaS service sends a data acquisition request to the connector server carrying the request identifier, the target data is sent to the SaaS service, so that the SaaS service performs business calculation through the target data.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to realize the steps of the method in any one of claims 1 to 6.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the steps of the method in any one of claims 1 to 6.
10. A computer program product, characterised in that, The computer program is executed by the processor to realize the steps of the method in any one of claims 1 to 6. The computer program is executed by the processor to realize the steps of the method in any one of claims 1 to 6.
Citation Information
Patent Citations
Hybrid cloud private deployment data acquisition method, electronic equipment and storage medium
CN113938282A