Method and device for processing message forwarding service
By deploying the forwarding server on the cloud and registering the whitelist information of the target server as a forwarding IP address, the problem of whitelist update during cloud service provider migration is solved, and TCP packet forwarding monitoring and monitoring are realized in the IoT business system. The early warning function ensures the stability of the system and the normal access.
Patent Information
- Application Number
- CN202411308133.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-01-07
AI Technical Summary
In the prior art, when the Internet of Things business provider migrates from one cloud service provider to another, it is difficult to achieve real-time update of whitelist information, resulting in the problem that the cloud system cannot access the operating service system normally after the cloud system is started, and regular agents /Forwarding Service Development Kit lacks forwarding monitoring and early warning functions.
Deploy multiple business servers in the first cloud, and deploy the forwarding server in the second cloud, and register the whitelist information of the target server as the forwarding IP address. The forwarding server is used to transfer the service between the service server and the target server. TCP packets are forwarded, and monitored and early warning are performed during the forwarding of SFTP and HTTPS protocols.
Real-time update and forwarding monitoring of whitelist information during cloud system migration process, and provides forwarding exceptions and fluctuations warning functions, ensuring the normal access of the Internet of Things business system and the stability of the operation service system.
Smart Images

Figure CN119276545A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method and device for processing a message forwarding service. Background Art
[0002] In order to reduce development costs and improve business deployment flexibility, many small and medium-sized IoT service providers will rent cloud servers from cloud service providers (such as Amazon Cloud, Alibaba Cloud, and Huawei Cloud) to develop and deploy their own IoT business systems. Each IoT service provider's IoT business system usually needs to be connected to the telecom operator's operation service system. At present, many telecom operators will prevent malicious attacks by assigning a corresponding whitelist information (used to store information such as the IP address of the corresponding business system) to each legitimate IoT business system on the operation service system side, and only respond to service requests from IoT business systems corresponding to each whitelist IP address.
[0003] If an IoT service provider plans to relocate its IoT service system from Cloud A of a high-priced cloud service provider to Cloud B of a low-priced cloud service provider for cost control reasons, the service provider must first replicate the system on Cloud B, and after the system replication is completed, shut down the system on Cloud A and start the system on Cloud B. In addition, if the operation service system is configured with whitelist information, the whitelist information on the operation service system must be updated synchronously when the Cloud B system is started. However, this is difficult to achieve in reality because most telecom operators do not provide real-time whitelist update functions. This means that after the Cloud B system is started, it is possible that the Cloud B system cannot access the operation service system normally because the whitelist on the telecom operator side has not been updated in time.
[0004] This problem can be solved by configuring a proxy / forwarding service, that is, configuring a small proxy / forwarding service C on cloud A, and after shutting down the cloud A system, the proxy / forwarding service C inherits the public IP address of the shut down system (that is, the IP address on the telecom operator's whitelist), and then the proxy / forwarding service C completes the data forwarding between the cloud B system and the operation service system. The proxy / forwarding service and its corresponding development kit are relatively mature, and the proxy / forwarding service C can be quickly built using a conventional development configuration kit.
[0005] However, we found a new problem in the actual development process: the conventional proxy / forwarding service development kit does not provide forwarding monitoring and early warning functions, which is unacceptable to IoT service providers. To this end, we have specially improved the functions of the conventional proxy / forwarding service development kit so that it can complete TCP message forwarding between the cloud B system and the operation service system and monitor and warn the forwarding process, which is exactly the technical problem solved by the technical solution of the present invention. Summary of the invention
[0006] The purpose of the present invention is to provide a method, device, electronic device and computer-readable storage medium for processing message forwarding services in view of the defects of the prior art. The present invention deploys multiple business service terminals on the first cloud and a transfer service terminal on the second cloud, and records the remote service terminals that each business service terminal needs to access as the target service terminal; and confirms that the registered IP address in the whitelist information corresponding to each business service terminal stored on the target service terminal is the forwarding IP address of the transfer service terminal; then the transfer service terminal forwards and monitors the TCP message between the business service terminal and the target service terminal. The business service end of the present invention corresponds to the Internet of Things business system of the Internet of Things business provider, the target service end corresponds to the operation service system of the telecommunications operator, and the transfer service end corresponds to an improved proxy / forwarding service end; the transfer service end of the present invention can forward two types of TCP messages (TCP messages whose upper-layer network protocol is the SFTP / HTTPS protocol) between the business service end and the target service end, and can monitor whether a single message times out during the forwarding process of one type of TCP message (TCP message whose upper-layer network protocol is the SFTP protocol) and issue an early warning based on the monitoring result, and can monitor whether the forwarding quantity in the recent period has a significant fluctuation during the forwarding process of the other type of TCP message (TCP message whose upper-layer network protocol is the HTTPS protocol) and issue an early warning based on the monitoring result.
[0007] To achieve the above object, a first aspect of an embodiment of the present invention provides a method for processing a message forwarding service, the method comprising:
[0008] Deploy multiple business servers on the first cloud; deploy a transfer server on the second cloud; record the remote servers that each of the business servers needs to access as the corresponding target servers; and confirm that the registered IP addresses in the whitelist information corresponding to each of the business servers stored on the target servers are the forwarding IP addresses of the transfer server;
[0009] When the business service end and the target service end perform TCP message interaction, the transfer service end forwards and monitors and warns the TCP messages between the business service end and the target service end.
[0010] Preferably, the IP address registered by each of the business service terminals on the public network is recorded as the corresponding business IP address; the IP address registered by the transfer service terminal on the public network is recorded as the corresponding forwarding IP address; the IP address registered by the remote service terminal on the public network is recorded as the corresponding remote service IP address;
[0011] The source address and destination address of the IP message in the TCP / IP message sent by the business service end to the transfer service end are the corresponding business IP address and the forwarding IP address respectively; the source address and destination address of the IP message in the TCP / IP message sent by the transfer service end to the target server end are the corresponding forwarding IP address and the remote service IP address respectively; the source address and destination address of the IP message in the TCP / IP message sent by the target server end to the transfer service end are the corresponding remote service IP address and the forwarding IP address respectively; the source address and destination address of the IP message in the TCP / IP message sent by the transfer service end to the business service end are the corresponding forwarding IP address and the business IP address respectively.
[0012] Preferably, the remote access service provided by the target server to each of the business servers includes at least a first remote service using the SFTP protocol as a service message encapsulation protocol and a second remote service using the HTTPS protocol as a service message encapsulation protocol;
[0013] The target server allocates a corresponding service port to each of the first and second remote services, which are recorded as the corresponding first service port and second service port;
[0014] The target server configures and saves a corresponding whitelist information for each business server with legal access qualifications; each whitelist information includes at least one corresponding registered IP address.
[0015] Preferably, the forwarding and monitoring and early warning processing of the TCP message between the business service end and the target service end by the transfer service end specifically includes:
[0016] The transfer server processes the TCP messages and monitoring warnings between the business server and the target server on a first local port that matches the first service port; and processes the TCP messages and monitoring warnings between the business server and the target server on a second local port that matches the second service port.
[0017] Further, the TCP message and monitoring warning processing between the business service end and the target service end on the first local port matching the first service port specifically includes:
[0018] When the transfer service end receives a TCP / IP message A sent by the business service end on the first local port, the transfer service end extracts the corresponding TCP message a from the TCP / IP message A received at that time; and performs a second TCP / IP message encapsulation on the TCP message a with the forwarding IP address and the remote service IP address as the corresponding IP message source address and destination address to obtain a new TCP / IP message A. ’ forwarding to the first service port of the target server; and in the TCP / IP message A ’ When the message forwarding of the first service port is completed, a corresponding message forwarding state is assigned to it, and the message forwarding state is initialized to forwarding; and the TCP / IP message sent back by the first service port is waited for reception within a preset first waiting time; if the TCP / IP message A is received within the first waiting time ’ The corresponding TCP / IP message B is forwarded to the service IP address of the TCP / IP message A, and the corresponding TCP / IP message b is encapsulated twice with the forwarding IP address and the service IP address corresponding to the TCP / IP message A as the corresponding IP message source address and destination address to obtain a new TCP / IP message B. ’ forwarding to the service server corresponding to the TCP / IP message A; if the TCP / IP message A is not received within the first waiting time, ’ The corresponding TCP / IP message B sets the corresponding message forwarding state to forwarding exception, and sends a TCP / IP message with timeout prompt information back to the business service end corresponding to the TCP / IP message A; the message forwarding state includes forwarding, forwarding exception and forwarding completion;
[0019] The transfer service monitors the latest setting information of each message forwarding status; and every time a message forwarding status is set to a forwarding exception, the TCP / IP message A corresponding to the currently set message forwarding status is saved as a corresponding first warning record, and the first warning record obtained this time is sent to a preset first service warning interface; the first service warning interface includes at least an email notification interface, a SMS notification interface, a voice notification interface, an instant messaging software notification interface, and an office system software notification interface.
[0020] Further, the processing of TCP messages and monitoring warnings between the business service end and the target service end on the second local port matching the second service port specifically includes:
[0021] The transfer server sets a current day counter initialized to 0 each time the server is started, restarted, or the date is switched; and each time a TCP / IP message C sent by the business server is received on the second local port, the current day counter is incremented by 1, and the corresponding TCP message C is extracted from the TCP / IP message C received at that time; and the TCP message C is encapsulated twice with the forwarding IP address and the remote service IP address as the corresponding IP message source address and destination address to obtain a new TCP / IP message C. ’ forwarding to the second service port of the target server; and waiting for receiving the TCP / IP message sent back by the second service port within a preset second waiting time; if the TCP / IP message C is received within the second waiting time ’ The corresponding TCP / IP message D is added to the current day counter by 1, and the corresponding TCP message d is extracted from the TCP / IP message D, and the TCP message d is encapsulated twice with the forwarding IP address and the service IP address corresponding to the TCP / IP message C as the corresponding IP message source address and destination address to obtain a new TCP / IP message D. ’ forwarding to the service server corresponding to the TCP / IP message C; if the TCP / IP message C is not received within the second waiting time, ’ The corresponding TCP / IP message D then sends a TCP / IP message with timeout prompt information back to the business service end corresponding to the TCP / IP message C;
[0022] The transfer service end periodically identifies the daily counter at a preset first sampling frequency to obtain a corresponding first sampling count value; uses the current time as the corresponding first sampling time; and forms a corresponding first sampling record composed of the first sampling count value and the first sampling time and adds it to a preset first record sequence; and extracts a plurality of the first sampling records in the first record sequence whose sampling times are within a preset first most recent time length, and sorts them in chronological order to form a corresponding second record sequence; and performs differential calculation on the first sampling count values of two adjacent first sampling times in the second record sequence to obtain a corresponding first differential count value, and sorts all the obtained first differential count values in chronological order to form a corresponding second record sequence. into a corresponding current differential sequence; and identify whether all the first differential count values in the current differential sequence meet the preset reasonable differential count value range; if at least one of the first differential count values in the current differential sequence does not meet the reasonable differential count value range, then all the first sampling records corresponding to the first differential count values in the current differential sequence that do not meet the reasonable differential count value range form a corresponding second warning record and save it, and send the second warning record obtained this time to a preset second service warning interface; the second service warning interface at least includes an email notification interface, a text message notification interface, a voice notification interface, an instant messaging software notification interface, and an office system software notification interface.
[0023] A second aspect of an embodiment of the present invention provides a device for implementing the method for processing a message forwarding service according to the first aspect, the device comprising: a service deployment module and a message forwarding monitoring module;
[0024] The service deployment module is used to deploy multiple business service terminals on the first cloud; and deploy a transfer service terminal on the second cloud; and record the remote service terminals that each of the business service terminals needs to access as the corresponding target service terminals; and confirm that the registered IP addresses in the whitelist information corresponding to each of the business service terminals stored on the target service terminals are the forwarding IP addresses of the transfer service terminals;
[0025] The message forwarding monitoring module is used for forwarding and monitoring and early warning processing of TCP messages between the business service end and the target service end by the transfer service end when the business service end and the target service end perform TCP message interaction.
[0026] A third aspect of an embodiment of the present invention provides an electronic device, including: a memory, a processor, and a transceiver;
[0027] The processor is used to be coupled to the memory, read and execute instructions in the memory, so as to implement the method steps described in the first aspect above;
[0028] The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
[0029] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions. When the computer instructions are executed by a computer, the computer executes the instructions of the method described in the first aspect above.
[0030] The embodiment of the present invention provides a method, device, electronic device and computer-readable storage medium for processing message forwarding services. As can be seen from the above content, the embodiment of the present invention deploys multiple business service terminals on the first cloud and deploys a transfer service terminal on the second cloud, and records the remote service terminals that each business service terminal needs to access as the target service terminal; and confirms that the registered IP address in the whitelist information corresponding to each business service terminal stored on the target service terminal is the forwarding IP address of the transfer service terminal; then the transfer service terminal forwards and monitors the TCP message between the business service terminal and the target service terminal. The business service end of the embodiment of the present invention corresponds to the Internet of Things business system of the Internet of Things business provider, the target service end corresponds to the operation service system of the telecommunications operator, and the transfer service end corresponds to an improved proxy / forwarding service end; through the embodiment of the present invention, not only can two types of TCP messages (TCP messages whose upper-layer network protocol is the SFTP / HTTPS protocol) between the business service end and the target service end be forwarded, but also different monitoring and early warning methods can be customized for the two types of TCP messages: 1) during the forwarding process of one type of TCP message (TCP message whose upper-layer network protocol is the SFTP protocol), whether a single message times out is monitored and an early warning is issued based on the monitoring result; 2) during the forwarding process of another type of TCP message (TCP message whose upper-layer network protocol is the HTTPS protocol), whether the forwarding quantity in the recent period has a significant fluctuation is monitored and an early warning is issued based on the monitoring result. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A schematic diagram of a method for processing a message forwarding service provided in Embodiment 1 of the present invention;
[0032] Figure 2 A schematic diagram of the connection relationship between the service server, the transfer server and the target server provided in the first embodiment of the present invention;
[0033] Figure 3 A module structure diagram of a processing device for a message forwarding service provided in Embodiment 2 of the present invention;
[0034] Figure 4 A schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all 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.
[0036] Embodiment 1 of the present invention provides a method for processing a message forwarding service, such as Figure 1 As shown in a schematic diagram of a method for processing a message forwarding service provided in Embodiment 1 of the present invention, the method mainly comprises the following steps:
[0037] Step 1: deploy multiple business servers on the first cloud; and deploy a transfer server on the second cloud; and record the remote servers that each business server needs to access as the corresponding target servers; and confirm that the registered IP addresses in the whitelist information corresponding to each business server stored on the target server are the forwarding IP addresses of the transfer server.
[0038] Here, the connection relationship between the service server, the transfer server and the target server in the embodiment of the present invention is as follows: Figure 2 The connection relationship diagram of the service service end, the transfer service end and the target service end provided in the first embodiment of the present invention is shown. The service service end of the embodiment of the present invention corresponds to the IoT service system of the IoT service provider, and can also be a service virtual machine, server, system or platform of other types. The IP address registered by each service service end on the public network is recorded as the corresponding service IP address; the target service end of the embodiment of the present invention corresponds to the operation service system of the telecommunications operator, and can also be a remote service virtual machine, server, remote system or remote platform of other types. The IP address registered by the remote service end on the public network is recorded as the corresponding remote service IP address; the transfer service end of the embodiment of the present invention corresponds to an improved proxy / forwarding service end, which can be specifically implemented by a virtual machine, server, system or platform. The transfer service end can not only complete the message forwarding operation of the conventional proxy / forwarding service, but also monitor and warn the forwarding process. The IP address registered by the transfer service end on the public network is recorded as the corresponding forwarding IP address.
[0039] In simple terms, the message forwarding operation of the transfer server in the embodiment of the present invention is to keep the TCP message in the current TCP / IP message unchanged and switch the source address / destination address of the IP message part during each one-way source-destination (from the business service end to the target service end or from the target service end to the business service end) transmission process.
[0040] For example, a one-way transmission process from a business server to a target server will become: business server -> transfer server -> target server after adding a transfer server. In this process, two TCP / IP messages will be generated, recorded as messages 1 and 2. Message 1 is between the business server -> transfer server, and message 2 is between the transfer server -> target server. It should be noted that the content of the TCP messages in messages 1 and 2 remains unchanged, but the IP messages are different: 1) Business server -> transfer server: The source address and destination address of the IP message in the TCP / IP message (i.e., message 1) sent by the business server to the transfer server are the corresponding business IP address and forwarding IP address respectively; 2) Transfer server -> target server: The source address and destination address of the IP message in the TCP / IP message (i.e., message 2) sent by the transfer server to the target server are the corresponding forwarding IP address and remote service IP address respectively.
[0041] Another example: a one-way transmission process from a target server to a business server will become: target server -> transfer server -> business server after adding a transfer server. In this process, two TCP / IP messages will be generated, recorded as messages 3 and 4. Message 3 is between the target server -> transfer server, and message 4 is between the transfer server -> business server. It should be noted that the content of the TCP messages in messages 3 and 4 remains unchanged, but the IP messages are different: 1) Target server -> transfer server: The source address and destination address of the IP message in the TCP / IP message (i.e., message 3) sent by the target server to the transfer server are the corresponding remote service IP address and forwarding IP address respectively; 2) Transfer server -> business server: The source address and destination address of the IP message in the TCP / IP message (i.e., message 4) sent by the transfer server to the business server are the corresponding forwarding IP address and business IP address respectively.
[0042] In addition, the remote access service provided by the target server of the embodiment of the present invention to each business server includes at least a first remote service using the SFTP protocol as the service message encapsulation protocol and a second remote service using the HTTPS protocol as the service message encapsulation protocol; and a corresponding service port is allocated to each of the first and second remote services, recorded as the corresponding first service port and second service port; and a corresponding whitelist information is configured and saved for each business server with legal access qualifications; each whitelist information mentioned here includes at least one corresponding registered IP address. It should be noted that the registered IP address in the whitelist information corresponding to the business server stored on the target server of the embodiment of the present invention should match the forwarding IP address of the transfer server corresponding to the current business server.
[0043] Corresponding to the above two types of services, the specific processing methods for monitoring and warning the forwarding process by the transfer service end in the embodiment of the present invention are also divided into two categories: 1) monitoring and warning the interactive messages of the first remote service based on whether a single message has timed out are monitored as the monitoring principle, and the specific implementation is implemented by step 21 in step 2 below; 2) monitoring and warning the interactive messages of the second remote service based on whether the number of messages in the recent period has fluctuated significantly are monitored as the monitoring principle, and the specific implementation is implemented by step 22 in step 2 below.
[0044] Step 2: When the business server and the target server exchange TCP messages, the transfer server forwards and monitors the TCP messages between the business server and the target server, and performs early warning processing;
[0045] Specifically comprising: step 21, the transfer server processes the TCP message and monitoring warning between the business server and the target server on the first local port matching the first service port;
[0046] Specifically, the process comprises: step 211, when the transfer server receives a TCP / IP message A sent by a service server on the first local port, the transfer server extracts the corresponding TCP message a from the TCP / IP message A received at that time; and performs a second TCP / IP message encapsulation on the TCP message a with the forwarding IP address and the remote service IP address as the corresponding IP message source address and destination address to obtain a new TCP / IP message A. ’ forward to the first service port of the target server; and in TCP / IP message A ’ When the message forwarding of the first service port is completed, a corresponding message forwarding state is assigned to it, and the message forwarding state is initialized to forwarding; and the TCP / IP message sent back by the first service port is waited for reception within a preset first waiting time; if a TCP / IP message A is received within the first waiting time, ’ The corresponding TCP / IP message B is forwarded in the same way as the TCP / IP message A. The corresponding message forwarding state is set to forwarding completed, and the corresponding TCP message b is extracted from TCP / IP message B. The TCP message b is encapsulated twice with the forwarding IP address and the service IP address corresponding to TCP / IP message A as the corresponding IP message source address and destination address to obtain a new TCP / IP message B. ’ Forward to the service server corresponding to TCP / IP message A; if TCP / IP message A is not received within the first waiting time ’ For the corresponding TCP / IP message B, the corresponding message forwarding state is set to forwarding exception, and a TCP / IP message with timeout prompt information is sent back to the business service end corresponding to TCP / IP message A;
[0047] The message forwarding status includes forwarding, forwarding exception and forwarding completion; the first waiting time is a preset time length parameter;
[0048] Step 212, the transfer service end monitors the latest setting information of each message forwarding state; and whenever a message forwarding state is set to forwarding abnormality, the TCP / IP message A corresponding to the currently set message forwarding state is saved as a corresponding first warning record, and the first warning record obtained this time is sent to the preset first service warning interface;
[0049] Among them, the first service warning interface at least includes an email notification interface, a text message notification interface, a voice notification interface, an instant messaging software notification interface, and an office system software notification interface; the instant messaging software here includes WeChat, Weibo, DingTalk, etc.;
[0050] Here, it can be known from the aforementioned step 211 that the embodiment of the present invention will monitor the interactive process of the transfer server -> target server -> transfer server corresponding to each TCP / IP message A, and set a corresponding message forwarding status as the monitoring status of the current interactive process; if the message forwarding status is forwarding, it means that the transfer server -> target server has been completed; if the message forwarding status is forwarding abnormality, it means that the target server -> transfer server has timed out; if the message forwarding status is forwarding completed, it means that the target server -> transfer server has been completed; the current step 212 will monitor the status of each message forwarding status Setting events to monitor, specifically, monitoring the setting event that the message forwarding state is set to "forwarding abnormality" by a setting action. Once a message forwarding state is set to "forwarding abnormality" by a setting action, it means that the TCP / IP message A corresponding to the message forwarding state has timed out in the interaction process of the target server -> the transfer server. At this time, the embodiment of the present invention will regard the TCP / IP message A corresponding to the current message forwarding state as a suspicious message and issue an early warning, that is, send the current TCP / IP message A as the corresponding first early warning record to the first service early warning interface;
[0051] Step 22, the transfer server processes the TCP message and monitoring warning between the business server and the target server on the second local port matching the second service port;
[0052] Specifically, the process comprises: step 221, the transfer server sets a current day counter initialized to 0 each time the server is started, restarted, or the date is switched; and each time a TCP / IP message C sent by a service server is received on the second local port, the current day counter is incremented by 1, and the corresponding TCP message C is extracted from the TCP / IP message C received at that time; and the TCP message C is encapsulated twice with the forwarding IP address and the remote service IP address as the corresponding IP message source address and destination address to obtain a new TCP / IP message C. ’ forwarding to the second service port of the target server; and waiting for receiving the TCP / IP message sent back by the second service port within a preset second waiting time; if a TCP / IP message C is received within the second waiting time ’ The corresponding TCP / IP message D is added to the current day counter by 1, and the corresponding TCP message d is extracted from TCP / IP message D. The TCP message d is encapsulated twice with the forwarding IP address and the service IP address corresponding to TCP / IP message C as the corresponding IP message source address and destination address to obtain a new TCP / IP message D. ’ Forward to the service server corresponding to TCP / IP message C; if TCP / IP message C is not received within the second waiting time ’ The corresponding TCP / IP message D then sends a TCP / IP message with timeout prompt information back to the business server corresponding to TCP / IP message C;
[0053] Here, the date switching mentioned in the above steps means daily switching, which actually means clearing the day counter once every 24 hours; the second waiting time is a preset time length parameter;
[0054] Step 222, the transfer service end periodically identifies the counter of the day according to the preset first sampling frequency to obtain the corresponding first sampling count value; and uses the current time as the corresponding first sampling time; and forms a corresponding first sampling record with the first sampling count value and the first sampling time and adds it to the preset first record sequence; and extracts multiple first sampling records with sampling times within the preset first latest time length in the first record sequence and sorts them in chronological order to form a corresponding second record sequence; and performs differential calculation on the first sampling count values of two adjacent first sampling times in the second record sequence to obtain the corresponding first differential count value, and sorts all the obtained first differential count values in chronological order to form a corresponding current differential sequence; and identifies whether all the first differential count values in the current differential sequence meet the preset reasonable differential count value range; if at least one first differential count value in the current differential sequence does not meet the reasonable differential count value range, then all the first sampling records corresponding to the first differential count values in the current differential sequence that do not meet the reasonable differential count value range form a corresponding second warning record and save it, and send the second warning record obtained this time to the preset second service warning interface;
[0055] Among them, the first sampling frequency is a preset time frequency parameter; the first record sequence is a record sequence for saving historical sampling records, which is composed of one or more first sampling records sorted in chronological order; the first most recent duration is a preset time length parameter; the reasonable differential count value range is a preset differential value range; the second service warning interface at least includes email notification interface, SMS notification interface, voice notification interface, instant messaging software notification interface, and office system software notification interface.
[0056] Here, if all the first differential count values in the current differential sequence are within the above-mentioned reasonable differential count value range, it means that the number of messages forwarded in the recent time period (the length matches the first recent time length) has not fluctuated significantly; if at least one first differential count value in the current differential sequence is not within this reasonable differential count value range, it means that the number of messages forwarded in the recent time period has fluctuated significantly at least once. At this time, the embodiment of the present invention will issue an early warning for each time point and message quantity information where obvious fluctuations occur in the recent time period, that is, send a second early warning record consisting of all first sampling records corresponding to all first differential count values that do not meet the reasonable differential count value range to the second service early warning interface.
[0057] Figure 3The module structure diagram of a processing device for a message forwarding service provided in the second embodiment of the present invention is a terminal device or a server that implements the aforementioned method embodiment, and can also be a device that enables the aforementioned terminal device or server to implement the aforementioned method embodiment. For example, the device can be a device or chip system of the aforementioned terminal device or server. Figure 3 As shown, the device includes: a service deployment module 201 and a message forwarding monitoring module 202.
[0058] The service deployment module 201 is used to deploy multiple business servers on the first cloud; and deploy a transfer server on the second cloud; and record the remote servers that each business server needs to access as the corresponding target servers; and confirm that the registered IP address in the whitelist information corresponding to each business server stored on the target server is the forwarding IP address of the transfer server.
[0059] The message forwarding monitoring module 202 is used for forwarding and monitoring and early warning processing of TCP messages between the business service end and the target service end by the transfer service end when the business service end and the target service end perform TCP message interaction.
[0060] A processing device for a message forwarding service provided in an embodiment of the present invention can execute the method steps in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here.
[0061] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the service deployment module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the above-determined module. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in software form.
[0062] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital signal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module above is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0063] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the above method embodiments are generated. The above computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The above-mentioned computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the above-mentioned computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, Bluetooth, microwave, etc.) methods. The above-mentioned computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The above-mentioned available medium can be a magnetic medium (such as a floppy disk, a hard disk, a tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.
[0064] Figure 4 This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. The electronic device may be a terminal device or a server for implementing the method of the aforementioned embodiment, or may be a terminal device or a server for implementing the method of the aforementioned embodiment connected to the aforementioned terminal device or server. Figure 4As shown, the electronic device may include: a processor 301 (such as a CPU), a memory 302, and a transceiver 303; the transceiver 303 is coupled to the processor 301, and the processor 301 controls the transceiver 303. Various instructions may be stored in the memory 302 to complete various processing functions and implement the processing steps described in the aforementioned embodiment method. Preferably, the electronic device involved in the embodiment of the present invention also includes: a power supply 304, a system bus 305 and a communication port 306. The system bus 305 is used to realize the communication connection between components. The above-mentioned communication port 306 is used for connecting and communicating between the electronic device and other peripherals.
[0065] exist Figure 4 The system bus 305 mentioned in the figure can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used to realize the communication between the database access device and other devices (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM), and may also include non-volatile memory (Non-Volatile Memory), such as at least one disk storage.
[0066] The above-mentioned processor can be a general-purpose processor, including a central processing unit CPU, a network processor (Network Processor, NP), a graphics processing unit (Graphics Processing Unit, GPU), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0067] It should be noted that an embodiment of the present invention further provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the method and processing process provided in the above embodiments.
[0068] An embodiment of the present invention further provides a chip for executing instructions, wherein the chip is used to execute the processing steps described in the aforementioned method embodiment.
[0069] The embodiment of the present invention provides a method, device, electronic device and computer-readable storage medium for processing message forwarding services. As can be seen from the above content, the embodiment of the present invention deploys multiple business service terminals on the first cloud and deploys a transfer service terminal on the second cloud, and records the remote service terminals that each business service terminal needs to access as the target service terminal; and confirms that the registered IP address in the whitelist information corresponding to each business service terminal stored on the target service terminal is the forwarding IP address of the transfer service terminal; then the transfer service terminal forwards and monitors the TCP message between the business service terminal and the target service terminal. The business service end of the embodiment of the present invention corresponds to the Internet of Things business system of the Internet of Things business provider, the target service end corresponds to the operation service system of the telecommunications operator, and the transfer service end corresponds to an improved proxy / forwarding service end; through the embodiment of the present invention, not only can two types of TCP messages (TCP messages whose upper-layer network protocol is the SFTP / HTTPS protocol) between the business service end and the target service end be forwarded, but also different monitoring and early warning methods can be customized for the two types of TCP messages: 1) during the forwarding process of one type of TCP message (TCP message whose upper-layer network protocol is the SFTP protocol), whether a single message times out is monitored and an early warning is issued based on the monitoring result; 2) during the forwarding process of another type of TCP message (TCP message whose upper-layer network protocol is the HTTPS protocol), whether the forwarding quantity in the recent period has a significant fluctuation is monitored and an early warning is issued based on the monitoring result.
[0070] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0071] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0072] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for processing a message forwarding service, characterized in that: The method comprises: Deploy multiple business servers on the first cloud; deploy a transfer server on the second cloud; record the remote servers that each of the business servers needs to access as the corresponding target servers; and confirm that the registered IP addresses in the whitelist information corresponding to each of the business servers stored on the target servers are the forwarding IP addresses of the transfer server; When the business service end and the target service end perform TCP message interaction, the transfer service end forwards and monitors and warns the TCP messages between the business service end and the target service end.
2. The method for processing message forwarding service according to claim 1, characterized in that: The IP address registered by each of the service servers on the public network is recorded as the corresponding service IP address; The IP address registered by the transfer server on the public network is recorded as the corresponding forwarding IP address; The IP address registered by the remote server on the public network is recorded as the corresponding remote service IP address; The source address and the destination address of the IP message in the TCP / IP message sent by the business service end to the transfer service end are the corresponding business IP address and the forwarding IP address respectively; The source address and the destination address of the IP message in the TCP / IP message sent by the transfer server to the target server are the corresponding forwarding IP address and the remote service IP address respectively; The source address and the destination address of the IP message in the TCP / IP message sent by the target server to the transfer server are the corresponding remote service IP address and the forwarding IP address respectively; The source address and the destination address of the IP message in the TCP / IP message sent by the transfer service end to the service service end are the corresponding forwarding IP address and the service IP address respectively.
3. The method for processing message forwarding service according to claim 2, characterized in that: The remote access service provided by the target server to each of the business servers includes at least a first remote service using the SFTP protocol as a service message encapsulation protocol and a second remote service using the HTTPS protocol as a service message encapsulation protocol; The target server allocates a corresponding service port to each of the first and second remote services, which are recorded as the corresponding first service port and second service port; The target server configures and saves a corresponding whitelist information for each business server with legal access qualifications; each whitelist information includes at least one corresponding registered IP address.
4. The method for processing message forwarding service according to claim 3, characterized in that: The forwarding and monitoring and early warning processing of the TCP message between the business service end and the target service end by the transfer service end specifically includes: The transfer server processes the TCP messages and monitoring warnings between the business server and the target server on a first local port that matches the first service port; and processes the TCP messages and monitoring warnings between the business server and the target server on a second local port that matches the second service port.
5. The method for processing message forwarding service according to claim 4, characterized in that: The processing of TCP messages and monitoring warnings between the business service end and the target service end on the first local port matching the first service port specifically includes: When the transfer service end receives a TCP / IP message A sent by the business service end on the first local port, the transfer service end extracts the corresponding TCP message a from the TCP / IP message A received at that time; and performs a second TCP / IP message encapsulation on the TCP message a with the forwarding IP address and the remote service IP address as the corresponding IP message source address and destination address to obtain a new TCP / IP message A. ’ forwarding to the first service port of the target server; and in the TCP / IP message A ’ When the message forwarding of the first service port is completed, a corresponding message forwarding state is assigned to it, and the message forwarding state is initialized to forwarding; and the TCP / IP message sent back by the first service port is waited for reception within a preset first waiting time; if the TCP / IP message A is received within the first waiting time ’ The corresponding TCP / IP message B is forwarded to the service IP address of the TCP / IP message A, and the corresponding TCP / IP message b is encapsulated twice with the forwarding IP address and the service IP address corresponding to the TCP / IP message A as the corresponding IP message source address and destination address to obtain a new TCP / IP message B. ’ forwarding to the service server corresponding to the TCP / IP message A; if the TCP / IP message A is not received within the first waiting time, ’ The corresponding TCP / IP message B sets the corresponding message forwarding state to forwarding exception, and sends a TCP / IP message with timeout prompt information back to the business service end corresponding to the TCP / IP message A; the message forwarding state includes forwarding, forwarding exception and forwarding completion; The transfer service monitors the latest setting information of each message forwarding status; and every time a message forwarding status is set to a forwarding exception, the TCP / IP message A corresponding to the currently set message forwarding status is saved as a corresponding first warning record, and the first warning record obtained this time is sent to a preset first service warning interface; the first service warning interface includes at least an email notification interface, a SMS notification interface, a voice notification interface, an instant messaging software notification interface, and an office system software notification interface.
6. The method for processing message forwarding service according to claim 4, characterized in that: The processing of the TCP message and monitoring warning between the business service end and the target service end on the second local port matching the second service port specifically includes: The transfer server sets a current day counter initialized to 0 each time the server is started, restarted, or the date is switched; and each time a TCP / IP message C sent by the business server is received on the second local port, the current day counter is incremented by 1, and the corresponding TCP message C is extracted from the TCP / IP message C received at that time; and the TCP message C is encapsulated twice with the forwarding IP address and the remote service IP address as the corresponding IP message source address and destination address to obtain a new TCP / IP message C. ’ forwarding to the second service port of the target server; and waiting for receiving the TCP / IP message sent back by the second service port within a preset second waiting time; if the TCP / IP message C is received within the second waiting time ’ The corresponding TCP / IP message D is added to the current day counter by 1, and the corresponding TCP message d is extracted from the TCP / IP message D, and the TCP message d is encapsulated twice with the forwarding IP address and the service IP address corresponding to the TCP / IP message C as the corresponding IP message source address and destination address to obtain a new TCP / IP message D. ’ forwarding to the service server corresponding to the TCP / IP message C; if the TCP / IP message C is not received within the second waiting time, ’ The corresponding TCP / IP message D then sends a TCP / IP message with timeout prompt information back to the business service end corresponding to the TCP / IP message C; The transfer service end periodically identifies the daily counter at a preset first sampling frequency to obtain a corresponding first sampling count value; uses the current time as the corresponding first sampling time; and forms a corresponding first sampling record composed of the first sampling count value and the first sampling time and adds it to a preset first record sequence; and extracts a plurality of the first sampling records in the first record sequence whose sampling times are within a preset first most recent time length, and sorts them in chronological order to form a corresponding second record sequence; and performs differential calculation on the first sampling count values of two adjacent first sampling times in the second record sequence to obtain a corresponding first differential count value, and sorts all the obtained first differential count values in chronological order to form a corresponding second record sequence. into a corresponding current differential sequence; and identify whether all the first differential count values in the current differential sequence meet the preset reasonable differential count value range; if at least one of the first differential count values in the current differential sequence does not meet the reasonable differential count value range, then all the first sampling records corresponding to the first differential count values in the current differential sequence that do not meet the reasonable differential count value range form a corresponding second warning record and save it, and send the second warning record obtained this time to a preset second service warning interface; the second service warning interface at least includes an email notification interface, a text message notification interface, a voice notification interface, an instant messaging software notification interface, and an office system software notification interface.
7. A device for executing the processing method of the message forwarding service according to any one of claims 1 to 6, characterized in that: The device comprises: a service deployment module and a message forwarding monitoring module; The service deployment module is used to deploy multiple business service terminals on the first cloud; and deploy a transfer service terminal on the second cloud; and record the remote service terminals that each of the business service terminals needs to access as the corresponding target service terminals; and confirm that the registered IP addresses in the whitelist information corresponding to each of the business service terminals stored on the target service terminals are the forwarding IP addresses of the transfer service terminals; The message forwarding monitoring module is used for forwarding and monitoring and early warning processing of TCP messages between the business service end and the target service end by the transfer service end when the business service end and the target service end perform TCP message interaction.
8. An electronic device, characterized in that: include: memory, processors, and transceivers; The processor is used to couple with the memory, read and execute instructions in the memory, so as to implement the method according to any one of claims 1 to 6; The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 6.