Request processing method and device, computer equipment and storage medium
In the cloud collaboration scenario, the target end is determined according to the request parameters and the communication protocol matching message encapsulation is solved, and data sharing and security are improved.
Patent Information
- Application Number
- CN202411212688.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-06
AI Technical Summary
In the cloud collaboration scenario, when traditional cloud gateways are used to forward request messages to edge devices, the data transmission security between cloud and edge devices is low.
By obtaining the synchronization request sent by the central server, determining the target end based on the request parameters, and message encapsulating the synchronization data according to the communication protocol matched by the target end, forming a target end-specific communication message to ensure the security of the message during transmission.
It improves security during data transmission, realizes data sharing between the central server and the target end, and enhances the security of communication messages.
Smart Images

Figure CN119094540A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data security technology, and in particular to a request processing method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] In the cloud collaboration scenario, the cloud gateway is used to forward the request messages sent by the server to the edge device, so as to achieve collaborative work between the cloud and edge devices, and optimize the utilization of system resources through data sharing and task allocation.
[0003] In the traditional way, the cloud gateway forwards request messages from the cloud to different edge devices according to the load balancing constraints between the edge devices, resulting in low data transmission security between the cloud and edge devices. Summary of the invention
[0004] Based on this, it is necessary to provide a request processing method, apparatus, computer device, computer-readable storage medium and computer program product that can improve the security of data transmission in response to the above technical problems.
[0005] In a first aspect, the present application provides a request processing method. The method comprises:
[0006] Obtain a synchronization request for the data to be synchronized sent by the central server; determine the target end of the data to be synchronized based on the request parameters carried in the synchronization request; encapsulate the data to be synchronized in messages according to the communication protocols matched by each of the target ends, and obtain the communication messages corresponding to each of the target ends corresponding to the synchronization request; and send each of the communication messages to each of the target ends.
[0007] In one of the embodiments, the data to be synchronized are respectively encapsulated as messages according to the communication protocols matched by each of the target terminals, so as to obtain the communication messages corresponding to the synchronization requests to the respective target terminals, including: for each of the target terminals, determining a candidate gateway for connecting the target terminal with a central service terminal; based on the candidate communication protocol matched with the candidate gateway and the target communication protocol matched with the target terminal, the data to be synchronized are encapsulated as messages, so as to obtain the communication messages corresponding to the target terminals for the synchronization requests.
[0008] In one of the embodiments, the data to be synchronized is encapsulated as a message based on a candidate communication protocol that matches the candidate gateway and a target communication protocol that matches the target end to obtain a communication message of the synchronization request corresponding to the target end, including: encapsulating the data to be synchronized as a message according to the candidate communication protocol that matches the candidate gateway to obtain a candidate communication message that the synchronization request corresponds to the candidate gateway; encapsulating the data to be synchronized as a message according to the target communication protocol that matches the target end to obtain a target communication message that the synchronization request corresponds to the target end; and concatenating the candidate communication message and the target communication message to obtain a communication message of the synchronization request corresponding to the target end.
[0009] In one of the embodiments, based on the candidate communication protocol that matches the candidate gateway and the target communication protocol that matches the target end, the data to be synchronized is encapsulated in a message to obtain the communication message of the synchronization request corresponding to the target end, including: according to the target communication protocol that matches the target end, the data to be synchronized is encapsulated in a message to obtain a first communication message; according to the candidate communication protocol that matches the candidate gateway, the first communication message and the data to be synchronized are encapsulated in a message to obtain the communication message of the synchronization request corresponding to the target end.
[0010] In one of the embodiments, determining a candidate gateway for connecting the target end and the central server end includes: obtaining a port structure tree of the central server end; the root node of the port structure tree is the central server end; determining the target node to which the target end belongs in the port structure tree; and extracting a candidate gateway corresponding to an intermediate node between the root node and the target node according to the connection relationship between the nodes in the port structure tree, the candidate gateway being used to connect the target end and the central server end.
[0011] In one of the embodiments, sending each of the communication messages to each of the target ends respectively includes: determining a synchronization order for each of the target ends according to system status information for each of the target ends; and sending each of the communication messages to each of the target ends in sequence according to the synchronization order.
[0012] In one of the embodiments, determining the synchronization order of each target end according to the system status information of each target end includes: determining the expected synchronization duration of each target end according to the system status information of each target end; determining the synchronization order of each target end according to the expected synchronization duration.
[0013] In a second aspect, the present application also provides a request processing device. The device comprises:
[0014] A request acquisition module is used to obtain a synchronization request for the data to be synchronized sent by the central server; a target end determination module is used to determine the target end of the data to be synchronized based on the request parameters carried in the synchronization request; an encapsulation module is used to encapsulate the data to be synchronized according to the communication protocol matched by each target end, so as to obtain the communication message corresponding to each target end of the synchronization request; and a sending module is used to send each communication message to each target end.
[0015] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0016] Obtain a synchronization request for the data to be synchronized sent by the central server; determine the target end of the data to be synchronized based on the request parameters carried in the synchronization request; encapsulate the data to be synchronized in messages according to the communication protocols matched by each of the target ends, and obtain the communication messages corresponding to each of the target ends corresponding to the synchronization request; and send each of the communication messages to each of the target ends.
[0017] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0018] Obtain a synchronization request for the data to be synchronized sent by the central server; determine the target end of the data to be synchronized based on the request parameters carried in the synchronization request; encapsulate the data to be synchronized in messages according to the communication protocols matched by each of the target ends, and obtain the communication messages corresponding to each of the target ends corresponding to the synchronization request; and send each of the communication messages to each of the target ends.
[0019] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0020] Obtain a synchronization request for the data to be synchronized sent by the central server; determine the target end of the data to be synchronized based on the request parameters carried in the synchronization request; encapsulate the data to be synchronized in messages according to the communication protocols matched by each of the target ends, and obtain the communication messages corresponding to each of the target ends corresponding to the synchronization request; and send each of the communication messages to each of the target ends.
[0021] The request processing method, device, computer equipment, storage medium and computer program product described above obtain the synchronization request for the data to be synchronized sent by the central server, and determine the target end of the data to be synchronized based on the request parameters carried in the synchronization request, which is conducive to the subsequent forwarding of the communication message, and realizes data sharing between the central server and the target end. According to the communication protocol matched by each target end, the data to be synchronized are respectively encapsulated as messages, and the synchronization request corresponding to the communication message of each target end is obtained, and each communication message is sent to each target end respectively. The above method is used to re-encapsulate the data to be synchronized, which improves the security of the communication message during the data transmission process. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 An application environment diagram of a request processing method in an embodiment;
[0023] Figure 2 A schematic diagram of a request processing method in one embodiment;
[0024] Figure 3 A flowchart of a service collaboration security reinforcement method for a cloud-edge collaboration scenario in one embodiment;
[0025] Figure 4 A schematic diagram of a cloud-edge collaborative architecture in one embodiment;
[0026] Figure 5 A schematic diagram of the interaction between the central cloud and the edge cloud in one embodiment;
[0027] Figure 6 A schematic diagram of a configuration interface for synchronous routing in one embodiment;
[0028] Figure 7 is a structural block diagram of a request processing device in one embodiment;
[0029] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0031] The request processing method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown, the central gateway 102 communicates with the central service end 104 and the target end 106 respectively. The data storage system can store the data that needs to be processed by the server to which the central gateway 102 belongs. The data storage system can be integrated on the server, or placed on the cloud or other network servers.
[0032] The central gateway 102 obtains the synchronization request for the data to be synchronized sent by the central server 104. The central gateway 102 determines the target end 106 of the data to be synchronized based on the request parameters carried in the synchronization request. The central gateway 102 encapsulates the data to be synchronized according to the communication protocol matched by each target end 106, and obtains the communication message corresponding to each target end 106 of the synchronization request. The central gateway 102 sends each communication message to each target end 106 respectively.
[0033] Among them, the central gateway 102 can be a device with network interconnection and protocol conversion capabilities. The central service end 104 can be a central cloud client or a central cloud service end, and the central cloud client can be but not limited to various personal computers, laptops, smart phones, tablets, etc. The central cloud service end can be implemented with an independent server or a server cluster composed of multiple servers. The target end 106 can be a target gateway or a target client or a target service end. The target gateway represents a device with network interconnection and protocol conversion capabilities. The target client can be but not limited to various personal computers, laptops, smart phones, tablets, etc. The target service end can be implemented with an independent server or a server cluster composed of multiple servers.
[0034] In one embodiment, Figure 2 As shown, a request processing method is provided, which is applied to Figure 1 The central gateway in the example is used to illustrate the following:
[0035] S202: Obtain a synchronization request for the data to be synchronized sent by the central server.
[0036] The central server may be a port that provides services to the central gateway and is connected to the central cloud. Specifically, the central server may be a central cloud client and a central cloud server. The central cloud client refers to an end-user device that can be used by a user, such as a laptop, a mobile phone, etc. The central cloud client may be a client of the central cloud server. The central cloud server refers to a port of the central cloud server.
[0037] The data to be synchronized refers to the data sent by the central server that needs to be synchronized. More specifically, in the data synchronization scenario, the data to be synchronized needs to be sent by the central gateway to different target terminals.
[0038] The synchronization request indicates a request message corresponding to the data to be synchronized, and the request message indicates a message sent from the client to the server.
[0039] The request message may include a request line and a request header. The request line consists of fields such as the request method field, the URL field, and the communication protocol field. The request header contains the client's environment information, etc. The request message may also include a blank line and a request body. Some request messages also include a request body, which represents the data sent to the server, and the data may be part of the data to be synchronized. A blank line represents the separator between the request header and the request body, indicating the end of the request header.
[0040] Specifically, the central gateway obtains a synchronization request for the data to be synchronized sent by the central cloud client.
[0041] In one of the embodiments, the central gateway periodically extracts synchronization requests for data to be synchronized from the central client.
[0042] In one of the embodiments, in response to a synchronization operation of the central cloud client, the central gateway obtains a synchronization request for the data to be synchronized sent by the central cloud client.
[0043] S204: Determine the target end of the data to be synchronized based on the request parameters carried in the synchronization request.
[0044] The request parameter indicates the parameter corresponding to the data structure in the synchronization request. For example, in an HTTP synchronization request, the request parameter may be a request method parameter in the HTTP request, such as GET, POST, DELETE, etc. The request parameter may also indicate a path parameter in the synchronization request, and the path parameter may indicate the initial forwarding path URL of the synchronization request.
[0045] The target end may be a target gateway, a target client, or a target server, and the target end is used to receive and process synchronization requests.
[0046] Taking the target end as the target server as an example, the target server can actually represent the server that provides services to the central server. For example, in the cloud-edge collaboration scenario, the target end can represent the server in the edge cloud, and the central server can represent the client in the central cloud. The client in the central cloud and the server in the edge cloud are connected through the central gateway.
[0047] Specifically, the central gateway determines the target end of the data to be synchronized in the edge cloud cluster based on the request parameters (request method parameters, initial forwarding path URL, etc.) carried in the synchronization request. The number of target ends can be multiple.
[0048] Among them, the edge cloud cluster refers to a server cluster formed by multiple edge clouds connected to the central gateway, and the cluster contains multiple ports. For example, a server cluster includes multiple edge gateways, multiple edge servers and multiple edge clients.
[0049] In one of the embodiments, the central gateway determines the target end of the data to be synchronized by using a leaf node in the port structure tree that matches the request parameters in the port structure tree based on the request parameters carried in the synchronization request.
[0050] The port structure tree may be a root node with the central gateway as the root node, and each edge gateway, each edge server, and each edge client in the edge cloud cluster as an intermediate node or a leaf node. For example, a branch of the port structure tree is a root node-intermediate node-leaf node, the root node is the central gateway, the intermediate node is the edge gateway, and the leaf node is the edge server. When the edge server matches the request parameters, the edge server is determined as the target end of the data to be synchronized.
[0051] S206, encapsulating the data to be synchronized in messages according to the communication protocols matched by the target terminals respectively, and obtaining the communication messages of the synchronization requests corresponding to the target terminals respectively.
[0052] The communication protocol refers to the rules and agreements that the two parties need to follow to complete the communication or service. The communication protocol includes HTTP communication protocol and HTTPS communication protocol.
[0053] The communication message refers to a request message containing data to be synchronized and corresponding to a synchronization request. More specifically, the synchronization request refers to a request obtained by the central gateway at the central service end, and the communication message refers to a request message sent by the central gateway to the target end.
[0054] Since the communication protocols supported by the target ends sent by the central gateway are not exactly the same, it is necessary to encapsulate the synchronization data in accordance with the communication protocol matched by the target end.
[0055] Message encapsulation refers to the process of encapsulating the data to be synchronized according to the data structure and format of the communication protocol, thereby obtaining the communication messages of each target end corresponding to the synchronization request.
[0056] Specifically, for each target end, the central gateway performs message encapsulation on the data to be synchronized according to the communication protocol matched by the target end, and obtains the communication message of the synchronization request corresponding to the target end.
[0057] In one of the embodiments, the central gateway does not send the message directly to the target end, but sends it to the target end through the edge gateway. Since the communication protocols supported by the edge gateway and the target end are not exactly the same, the central gateway can encapsulate the message twice at a time during message encapsulation to obtain a communication message that can be recognized and forwarded by the edge gateway, and can be recognized and processed by the target end.
[0058] In one of the embodiments, the central gateway may encapsulate the data to be synchronized according to the communication protocols matched by the edge gateway and the target end, and obtain the communication message of the synchronization request corresponding to the target end.
[0059] S208, sending each communication message to each target end respectively.
[0060] The process of sending each communication message to each target end involves sending multiple communication messages at once, so it is necessary to determine the distribution order of each communication message, or the receiving order of each target end in advance. Since it is a scenario of information synchronization, the receiving order can also be called the synchronization order.
[0061] Specifically, the central gateway determines the synchronization order of each target terminal according to the system status information of each target terminal, and the central gateway sends each communication message to each target terminal in sequence according to each synchronization order.
[0062] In one implementation, each communication message is sent to each target end in sequence according to the number of synchronization threads of the central gateway and the synchronization order, wherein the number of synchronization threads refers to the number of communication messages sent simultaneously by the central gateway.
[0063] In the above request processing method, the synchronization request for the data to be synchronized sent by the central server is obtained, and the target end of the data to be synchronized is determined based on the request parameters carried in the synchronization request, which is conducive to the subsequent forwarding of the communication message, and realizes data sharing between the central server and the target end. According to the communication protocol matched by each target end, the data to be synchronized are respectively encapsulated as messages, and the synchronization request corresponding to the communication message of each target end is obtained, and each communication message is sent to each target end respectively. The above method is used to re-encapsulate the data to be synchronized, which improves the security of the communication message during the data transmission process.
[0064] In one embodiment, according to the communication protocols matched by each target terminal, the data to be synchronized are respectively encapsulated as messages, and the synchronization request corresponds to the communication message of each target terminal, including: for each target terminal, a candidate gateway for connecting the target terminal and the central service terminal is determined, and based on the candidate communication protocol matched with the candidate gateway and the target communication protocol matched with the target terminal, the data to be synchronized are encapsulated as messages, and the synchronization request corresponds to the communication message of the target terminal.
[0065] Among them, the candidate gateway represents the gateway connecting the target end and the central server end. More specifically, the candidate gateway can be an edge gateway in the edge cloud. The communication message is first sent to the edge gateway, and then the communication message is sent to the target end through the edge gateway.
[0066] Candidate gateways represent devices that have network interconnection and protocol conversion capabilities.
[0067] The candidate communication protocol indicates the communication protocol supported by the candidate gateway. The target communication protocol indicates the communication protocol supported by the target end. The security level of the candidate communication protocol is greater than the security level of the communication protocol involved in the synchronization request. For example, the candidate communication protocol may be the HTTPS communication protocol, while the communication protocol involved in the synchronization request is the HTTP communication protocol.
[0068] Specifically, the central gateway performs message encapsulation on the data to be synchronized based on the candidate communication protocol that matches the candidate gateway and the target communication protocol that matches the target end, and obtains a communication message of the synchronization request corresponding to the target end.
[0069] In one of the embodiments, the central gateway performs message encapsulation on the data to be synchronized according to the candidate communication protocol matched by the candidate gateway, and obtains a synchronization request corresponding to the candidate communication message matched by the candidate gateway; performs message encapsulation on the data to be synchronized according to the target communication protocol matched by the target end, and obtains a target communication message matched by the target end for the synchronization request; and performs message splicing on the candidate communication message and the target communication message, and obtains a communication message corresponding to the target end for the synchronization request.
[0070] In one of the embodiments, the central gateway encapsulates the data to be synchronized according to the target communication protocol matched by the target end to obtain a first communication message; and encapsulates the first communication message and the data to be synchronized according to the candidate communication protocol matched by the candidate gateway to obtain a communication message corresponding to the target end of the synchronization request.
[0071] In this embodiment, for each target end, a candidate gateway for connecting the target end and the central service end is determined, and based on the candidate communication protocol matching the candidate gateway and the target communication protocol matching the target end, the data to be synchronized is encapsulated in a message to obtain the communication message of the synchronization request corresponding to the target end. On the one hand, the communication message is obtained by encapsulating multiple times at one time, which, to a certain extent, reduces the time for the candidate gateway to parse the communication message, thereby improving the transmission efficiency of the communication message. On the other hand, the security level of the candidate communication protocol is greater than the security level of the communication protocol involved in the synchronization request, which improves the security of the communication message during the data transmission process.
[0072] In one embodiment, based on a candidate communication protocol that matches a candidate gateway and a target communication protocol that matches a target end, message encapsulation is performed on the data to be synchronized to obtain a communication message of a synchronization request corresponding to the target end, including: according to the candidate communication protocol that matches the candidate gateway, message encapsulation is performed on the data to be synchronized to obtain a candidate communication message of a synchronization request corresponding to the candidate gateway; according to the target communication protocol that matches the target end, message encapsulation is performed on the data to be synchronized to obtain a target communication message of a synchronization request corresponding to the target end; and message splicing is performed on the candidate communication message and the target communication message to obtain a communication message of a synchronization request corresponding to the target end.
[0073] The candidate communication message refers to a request message that contains data to be synchronized and corresponds to a synchronization request. More specifically, the candidate communication message refers to a communication message that can be directly identified by the candidate gateway.
[0074] The target communication message refers to a request message that contains data to be synchronized and corresponds to a synchronization request. More specifically, the target communication message refers to a communication message that can be directly recognized by the target end.
[0075] Among them, the message splicing can be to splice the candidate communication message and the target communication message head to tail or other splicing methods to obtain the communication message of the synchronization request corresponding to the target end. The communication message includes the candidate communication message and the target communication message. When the communication message is sent to the candidate gateway, the candidate gateway can directly forward the target communication message to the target end according to the candidate communication message. This process does not involve the communication protocol conversion of the candidate communication message, which reduces the time for the candidate gateway to convert the communication protocol and improves the transmission efficiency of the communication message.
[0076] Specifically, the central gateway encapsulates the synchronization data according to the candidate communication protocol matched by the candidate gateway, and obtains the synchronization request corresponding to the candidate communication message matched by the candidate gateway. The central gateway encapsulates the synchronization data according to the target communication protocol matched by the target end, and obtains the synchronization request corresponding to the target communication message matched by the target end. The central gateway splices the candidate communication message and the target communication message, and obtains the synchronization request corresponding to the communication message of the target end.
[0077] In one embodiment, the central gateway performs message splicing on the candidate communication message and the target communication message according to their respective splicing sequence numbers to obtain a communication message corresponding to the target end of the synchronization request. The splicing sequence number of the candidate communication message is smaller than the splicing sequence number of the target communication message. In other words, in the communication message after the message splicing, the candidate communication message is in the first half of the message structure, and the target communication message is in the second half of the message structure in the target message.
[0078] In this embodiment, according to the candidate communication protocol matched by the candidate gateway, the data to be synchronized is encapsulated as a message to obtain a synchronization request corresponding to the candidate communication message matched by the candidate gateway; according to the target communication protocol matched by the target end, the data to be synchronized is encapsulated as a message to obtain a synchronization request corresponding to the target communication message matched by the target end; the candidate communication message and the target communication message are concatenated to obtain a communication message corresponding to the target end, which reduces the time for the candidate gateway to convert the communication protocol and improves the transmission efficiency of the communication message.
[0079] In one embodiment, based on a candidate communication protocol that matches the candidate gateway and a target communication protocol that matches the target end, the data to be synchronized is encapsulated in a message to obtain a communication message of the synchronization request corresponding to the target end, including: according to the target communication protocol that matches the target end, the data to be synchronized is encapsulated in a message to obtain a first communication message; according to the candidate communication protocol that matches the candidate gateway, the first communication message and the data to be synchronized are encapsulated in a message to obtain a communication message of the synchronization request corresponding to the target end.
[0080] The first communication message represents a complete communication message of the target communication protocol for the target end.
[0081] The first communication message and the data to be synchronized are encapsulated by the central gateway using the first communication message as the request body of the candidate communication protocol, encapsulating the data to be synchronized, and obtaining a communication message of the synchronization request corresponding to the target end.
[0082] Specifically, in the scenario where the central gateway directly sends the communication message to the target end, the central gateway can send the first communication message to the target end. In the scenario where the central gateway sends the communication message to the candidate gateway and sends it to the target end through the candidate gateway, the central gateway encapsulates the first communication message and the data to be synchronized according to the candidate communication protocol matched by the candidate gateway, and obtains the communication message of the synchronization request corresponding to the target end.
[0083] In one embodiment, the central gateway uses the first communication message and the data to be synchronized as the request body of the HTTP communication protocol, encapsulates the data to be synchronized, and obtains the communication message corresponding to the target end of the synchronization request.
[0084] In this embodiment, according to the target communication protocol matched by the target end, the data to be synchronized is encapsulated in a message to obtain a first communication message, and according to the candidate communication protocol matched by the candidate gateway, the first communication message and the data to be synchronized are encapsulated in a message to obtain a communication message of the synchronization request corresponding to the target end, thereby reducing the time for the candidate gateway to encapsulate the message of the data to be synchronized and improving the transmission efficiency of the communication message.
[0085] In one embodiment, determining a candidate gateway for connecting a target end with a central server end includes: obtaining a port structure tree of the central server end, the root node of the port structure tree being the central server end, determining a target node to which the target end belongs in the port structure tree, and extracting a candidate gateway corresponding to an intermediate node between the root node and the target node according to a connection relationship between nodes in the port structure tree, wherein the candidate gateway is used to connect the target end with the central server end.
[0086] The port structure tree is a nonlinear data structure, and the port structure tree can be a binary tree or a structure tree of other structural types. The port structure tree includes a root node, an intermediate node, and a leaf node from top to bottom.
[0087] Taking the central server as the root node as an example, the candidate gateway can be an intermediate node, and the target end can be a leaf node or an intermediate node. Similarly, the candidate gateway can also be a leaf node.
[0088] The target node to which the target end belongs in the port structure tree indicates the node position of the target end in the port structure. For example, the target node can be an intermediate node or a leaf node. When the target node is an intermediate node, it means that there are no other ports between the target end and the central gateway, and the target end and the central gateway are directly connected. When the target node is a leaf node, it means that there are other ports between the target end and the central gateway, such as a candidate gateway.
[0089] The connection relationship between the nodes in the port structure tree represents the network connection relationship between the central server, the candidate gateway, and the target end.
[0090] Specifically, after the central gateway determines the target node to which the target end belongs in the port structure tree, the central gateway extracts candidate gateways corresponding to intermediate nodes between the root node and the target node according to the connection relationship between the nodes in the port structure tree.
[0091] In this embodiment, a port structure tree of the central server is obtained, the root node of the port structure tree is the central server, the target node to which the target terminal belongs in the port structure tree is determined, and according to the connection relationship between the nodes in the port structure tree, the candidate gateway corresponding to the intermediate node between the root node and the target node is extracted. The candidate gateway is used to connect the target terminal and the central server. The candidate gateway is extracted quickly and accurately, which is beneficial to the subsequent improvement of the transmission efficiency of communication messages.
[0092] In one embodiment, sending each communication message to each target end respectively includes: determining the synchronization order of each target end according to the system status information of each target end, and sending each communication message to each target end in sequence according to each synchronization order.
[0093] The system status information indicates the status information of the server to which each target end belongs, including IO idle rate, CPU load rate, network status, etc.
[0094] The system status information represents the target end's ability and efficiency in receiving files. Since the number of communication messages sent simultaneously by the central gateway is prioritized in the cloud-edge collaboration scenario, it is necessary to determine the synchronization order of each communication message.
[0095] Specifically, the central gateway may determine the synchronization order of each target end according to at least one of the IO idle rate, CPU load rate, and network status of each target end.
[0096] In one of the embodiments, the central gateway can determine the synchronization order of each target end according to the IO idle rate of each target end. The higher the IO idle rate, the greater the synchronization order, and the lower the IO idle rate, the smaller the synchronization order. That is, the central gateway preferentially sends communication messages to the target end with a lower IO idle rate, thereby reducing the total synchronization time consumed by each synchronization process.
[0097] In one of the embodiments, the central gateway can determine the synchronization order of each target end according to the CPU load rate of each target end. The higher the CPU load rate, the smaller the synchronization order, and the lower the CPU load rate, the larger the synchronization order. That is, the central gateway preferentially sends communication messages to the target end with a high CPU load rate, thereby reducing the total synchronization time consumed by each synchronization process.
[0098] In one of the embodiments, the central gateway may determine the synchronization order of each target end according to the IO idle rate of each target end and the CPU load rate of each target end.
[0099] Specifically, the central gateway may first determine the expected synchronization duration of each target terminal according to the system status information of each target terminal, and determine the synchronization order of each target terminal according to the expected synchronization duration.
[0100] Specifically, after determining the synchronization order of each target end, each communication message is sent to each target end in sequence according to each synchronization order.
[0101] In one embodiment, the number of tasks for synchronizing communication messages is less than or equal to the number of threads due to the limitation of the number of threads of the central gateway. The central gateway first sends the communication message to the target end whose synchronization order is 1, then sends the communication message to the target end whose synchronization order is 1, and so on, and completes the synchronization of each synchronization message in batches according to the synchronization order of each target end.
[0102] In this embodiment, the synchronization order of each target end is determined according to the system status information of each target end, and each communication message is sent to each target end in sequence according to each synchronization order, so that the total time for synchronization of each communication message is shortened and the transmission efficiency of the communication message is improved.
[0103] In one embodiment, the synchronization order of each target end is determined according to the system status information of each target end, including: determining the expected synchronization duration of each target end according to the system status information of each target end, and determining the synchronization order of each target end according to the expected synchronization duration.
[0104] The expected synchronization time indicates the time required for the target end to receive and process the communication message. The longer the expected synchronization time is, the longer it takes for the target end to synchronize the communication message. In order to ensure that the total time consumed by each target end to synchronize the communication message is the shortest, the communication message can be synchronized to the target end with a longer expected synchronization time first, and then synchronized to the target end with a shorter expected synchronization time.
[0105] Specifically, the central gateway may perform sorting based on the expected synchronization durations, and determine the synchronization order of each target file system according to the sorting result.
[0106] In one of the embodiments, the central gateway lowers the synchronization order of the target end with a longer expected synchronization time, that is, the communication message is sent to the target end preferentially.
[0107] In this embodiment, the expected synchronization duration of each target end is determined according to the system status information of each target end, and the synchronization order of each target end is determined according to each expected synchronization duration. This can shorten the total time for each communication message to be synchronized to each target end, thereby improving the overall synchronization efficiency of each communication message.
[0108] In one embodiment, Figure 3 As shown, a service collaboration security reinforcement method for cloud-edge collaboration scenarios is provided, including:
[0109] S302: Obtain a synchronization request for the data to be synchronized sent by the central server.
[0110] For example, the method is applied to Figure 4 The cloud-edge collaborative architecture shown in the figure is explained: the central cloud and edge cloud each contain an API gateway to provide a unified entrance for the cluster service, and a network strategy based on the https communication protocol is provided between the central cloud and the edge cloud. Figure 5 The interaction diagram of the central cloud and the edge cloud is shown, and the client and the API gateway of the central cloud communicate through the http communication protocol.
[0111] Among them, when the service collaborative server and client communicate through the http protocol, it is necessary to apply for a synchronous route through the synchronous route management page. The synchronous route needs to specify whether the central cloud accesses the edge cloud or the edge cloud accesses the central cloud, the communication protocol (http or https), the service path and other information. In this way, the gateway management service can configure the API gateways of the central cloud and edge cloud based on this information, that is, open the http protocol route from the internal server or client of the central cloud and edge cloud to the API gateway in this cluster, and open the https protocol route between the central cloud and edge cloud.
[0112] The configuration interface of synchronous routing is as follows Figure 6 As shown in the figure: Basic information indicates the route configured for the central cloud. Matching conditions indicate that the central cloud configuration contains request parameters with different paths and different HTTP methods. Request rewriting indicates rewriting the path in the request.
[0113] The upstream service indicates that the target end is the server end. When the server end is determined as: the service provider is the Shenzhen station, the host name is 10.121.5.66, and the port is 1080, the edge gateway of the edge cloud described by the Shenzhen station can be determined based on the server end. Then a complete route is configured: central gateway - edge gateway of edge cloud - target end (server end).
[0114] S304: Determine the target end of the data to be synchronized based on the request parameters carried in the synchronization request.
[0115] S306, for each target end, obtain a port structure tree of the central server end; the root node of the port structure tree is the central server end.
[0116] S308, determining the target node to which the target end belongs in the port structure tree.
[0117] S310: extract candidate gateways corresponding to intermediate nodes between the root node and the target node according to the connection relationship between the nodes in the port structure tree.
[0118] Among them, the candidate gateway is used to connect the target end and the central server.
[0119] S312, encapsulating the data to be synchronized according to the candidate communication protocol matched by the candidate gateway, and obtaining the candidate communication message corresponding to the synchronization request that matches the candidate gateway.
[0120] S314, encapsulating the data to be synchronized according to the target communication protocol matched by the target end, and obtaining a target communication message that the synchronization request corresponds to and matches the target end.
[0121] S316, concatenating the candidate communication message and the target communication message to obtain a communication message corresponding to the target end of the synchronization request.
[0122] S318, encapsulating the data to be synchronized according to the target communication protocol matched by the target end to obtain a first communication message.
[0123] S320, encapsulating the first communication message and the data to be synchronized according to the candidate communication protocol matched by the candidate gateway, and obtaining a communication message of the synchronization request corresponding to the target end.
[0124] S322: Determine the expected synchronization duration of each target end according to the system status information of each target end.
[0125] S324, determining the synchronization order of each target end according to each expected synchronization duration.
[0126] S326, sending each communication message to each target end in sequence according to each synchronization order.
[0127] In this embodiment, the synchronization request for the data to be synchronized sent by the central server is obtained, and the target end of the data to be synchronized is determined based on the request parameters carried in the synchronization request, which is conducive to the subsequent forwarding of the communication message, thereby realizing data sharing between the central server and the target end. According to the communication protocol matched by each target end, the data to be synchronized is respectively encapsulated as a message, and the synchronization request corresponds to the communication message of each target end. Each communication message is sent to each target end respectively. The above method is used to re-encapsulate the message of the data to be synchronized, thereby improving the security of the communication message during the data transmission process. This method supports service collaboration by configuring the API gateway of the central cloud and the edge cloud so that communication can be carried out according to the http protocol, but only the https protocol is used for communication between the central cloud and the edge cloud, thereby achieving the purpose of service collaboration security reinforcement.
[0128] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0129] Based on the same inventive concept, the embodiment of the present application also provides a request processing device for implementing the request processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more request processing device embodiments provided below can refer to the limitations on the request processing method above, and will not be repeated here.
[0130] In one embodiment, Figure 7 As shown, a request processing device is provided, including: a request acquisition module 702, a target end determination module 704, an encapsulation module 7067 and a sending module 708, wherein:
[0131] The request acquisition module 702 is used to acquire the synchronization request for the data to be synchronized sent by the central server;
[0132] The target end determination module 704 is used to determine the target end of the data to be synchronized based on the request parameters carried in the synchronization request;
[0133] The encapsulation module 706 is used to encapsulate the data to be synchronized according to the communication protocols matched by the target terminals, and obtain the communication messages corresponding to the synchronization requests of the target terminals;
[0134] The sending module 708 is used to send each communication message to each target end respectively.
[0135] In one embodiment, the encapsulation module 706 is also used to determine, for each target end, a candidate gateway for connecting the target end and the central server end; based on the candidate communication protocol matching the candidate gateway and the target communication protocol matching the target end, the data to be synchronized is encapsulated in a message to obtain a communication message corresponding to the target end of the synchronization request.
[0136] In one of the embodiments, the encapsulation module 706 is further used to perform message encapsulation on the data to be synchronized according to the candidate communication protocol matched by the candidate gateway, and obtain the synchronization request corresponding to the candidate communication message matched by the candidate gateway; perform message encapsulation on the data to be synchronized according to the target communication protocol matched by the target end, and obtain the synchronization request corresponding to the target communication message matched by the target end; perform message splicing on the candidate communication message and the target communication message, and obtain the synchronization request corresponding to the communication message of the target end.
[0137] In one embodiment, the encapsulation module 706 is also used to encapsulate the data to be synchronized according to the target communication protocol matched by the target end to obtain a first communication message; and encapsulate the first communication message and the data to be synchronized according to the candidate communication protocol matched by the candidate gateway to obtain a communication message corresponding to the target end of the synchronization request.
[0138] In one of the embodiments, the encapsulation module 706 is also used to obtain a port structure tree of the central server; the root node of the port structure tree is the central server; determine the target node to which the target end belongs in the port structure tree; and extract the candidate gateway corresponding to the intermediate node between the root node and the target node according to the connection relationship between the nodes in the port structure tree, and the candidate gateway is used to connect the target end and the central server.
[0139] In one embodiment, the sending module 708 is further used to determine the synchronization order of each target end according to the system status information of each target end; and send each communication message to each target end in sequence according to each synchronization order.
[0140] In one embodiment, the sending module 708 is further used to determine the expected synchronization duration of each target end according to the system status information of each target end; and determine the synchronization order of each target end according to the expected synchronization duration.
[0141] Each module in the above request processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0142] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data to be synchronized. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a request processing method is implemented.
[0143] Those skilled in the art will understand that Figure 8The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0144] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0145] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0146] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0147] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium 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), magnetoresistive 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0148] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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.
[0149] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A request processing method, characterized in that: Applied to a central gateway, the method includes: Get the synchronization request for the data to be synchronized sent by the central server; Determining a target end of the data to be synchronized based on the request parameters carried in the synchronization request; According to the communication protocols matched by the target ends, the data to be synchronized are respectively encapsulated in messages to obtain the communication messages corresponding to the synchronization requests of the target ends; Each of the communication messages is sent to each of the target ends respectively.
2. The method according to claim 1, characterized in that The step of encapsulating the data to be synchronized according to the communication protocols matched by the target ends to obtain the communication messages of the synchronization requests corresponding to the target ends includes: For each of the target terminals, determining a candidate gateway for connecting the target terminal to a central server terminal; Based on the candidate communication protocol that matches the candidate gateway and the target communication protocol that matches the target end, the data to be synchronized is message encapsulated to obtain a communication message of the synchronization request corresponding to the target end.
3. The method according to claim 2, characterized in that The method of encapsulating the data to be synchronized based on the candidate communication protocol matched with the candidate gateway and the target communication protocol matched with the target end to obtain the communication message of the synchronization request corresponding to the target end includes: According to the candidate communication protocol matched by the candidate gateway, the data to be synchronized is encapsulated in a message to obtain a candidate communication message matched by the candidate gateway corresponding to the synchronization request; According to the target communication protocol matched by the target end, the data to be synchronized is encapsulated in a message to obtain a target communication message matched by the target end corresponding to the synchronization request; The candidate communication message and the target communication message are concatenated to obtain a communication message of the target end corresponding to the synchronization request.
4. The method according to claim 2, characterized in that: The method of encapsulating the data to be synchronized based on the candidate communication protocol matched with the candidate gateway and the target communication protocol matched with the target end to obtain the communication message of the synchronization request corresponding to the target end includes: According to the target communication protocol matched by the target end, the data to be synchronized is encapsulated into a message to obtain a first communication message; According to the candidate communication protocol matched by the candidate gateway, the first communication message and the data to be synchronized are encapsulated to obtain a communication message of the synchronization request corresponding to the target end.
5. The method according to claim 2, characterized in that: The determining of a candidate gateway for connecting the target end and the central server end includes: Obtaining a port structure tree of the central server; the root node of the port structure tree is the central server; Determine the target node to which the target end belongs in the port structure tree; According to the connection relationship between the nodes in the port structure tree, a candidate gateway corresponding to the intermediate node between the root node and the target node is extracted, and the candidate gateway is used to connect the target end and the central service end.
6. The method according to any one of claims 1 to 5, characterized in that The sending each of the communication messages to each of the target ends respectively includes: Determining the synchronization order of each of the target ends according to the system status information of each of the target ends; According to the synchronization order, the communication messages are sent to the target terminals in sequence.
7. The method according to claim 6, characterized in that Determining the synchronization order of each of the target ends according to the system status information of each of the target ends includes: Determining the expected synchronization duration of each of the target ends according to the system status information of each of the target ends; According to the expected synchronization durations, a synchronization order for each of the target ends is determined.
8. A request processing device, characterized in that: The device comprises: A request acquisition module is used to obtain synchronization requests for data to be synchronized sent by the central server; A target end determination module, used to determine the target end of the data to be synchronized based on the request parameters carried in the synchronization request; An encapsulation module, used to encapsulate the data to be synchronized according to the communication protocols matched by the target ends, so as to obtain the communication messages corresponding to the synchronization requests of the target ends; The sending module is used to send each of the communication messages to each of the target ends respectively.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
