A communication method, apparatus, device, and storage medium

By acquiring and updating reachability configuration information and selecting an appropriate target gateway to handle network requests, the problem of parallel operation of multiple gateway services in enterprise-level mobile client applications is solved, improving the efficiency and accuracy of network request processing.

CN116389601BActive Publication Date: 2026-03-27AGRICULTURAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-03
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In enterprise-level mobile client applications, how to efficiently and accurately handle network requests from different business modules, call the most suitable gateway for data processing, and especially how to achieve parallel operation in scenarios with multiple gateway services.

Method used

By obtaining reachability configuration information from local storage, it determines whether the information has expired, and selects a target gateway to process network requests based on the reachability configuration information and the availability status of candidate gateways. This supports real-time dynamic switching and parallel operation of multiple gateways.

Benefits of technology

It enables efficient and accurate processing of network requests from different business modules, improves the processing efficiency of network requests, and ensures the stability and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116389601B_ABST
    Figure CN116389601B_ABST
Patent Text Reader

Abstract

The application discloses a communication method, device, equipment and storage medium. The method comprises the following steps: if a network request sent by a service module in a client is detected, obtaining locally stored reachable relationship configuration information; determining whether the reachable relationship configuration information is expired, if not, determining a target gateway according to the reachable relationship configuration information and the available state of each candidate gateway; processing the network request according to the attribute information of the target gateway, forwarding the processed network request to the target gateway, and obtaining service data fed back by the target gateway. According to the technical scheme of the application, the target gateway corresponding to the network request of the service module can be determined according to the reachable relationship configuration information and the available state of the gateway, and the target gateway is called to provide service to obtain service data, so that efficient and accurate processing of different network requests of service modules is realized, and the processing efficiency of network requests is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of communication, and in particular to a communication method, device, equipment and storage medium. BACKGROUND

[0002] With the development of communication technology and the popularity of mobile intelligent devices, the business functions contained in an enterprise-level mobile client application are increasingly rich and complex. In addition, with the continuous upgrading and iteration of technology stacks, the updating and iteration of gateway services are also increasingly intense.

[0003] There are scenarios in which multiple business modules need to call multiple different gateways for communication interaction, that is, there are scenarios in which multiple gateway services need to be accessed. How to call the most appropriate gateway for data processing for network requests of different business modules is a problem that needs to be solved at present. SUMMARY

[0004] The present application provides a communication method, device, equipment and storage medium, which can realize efficient and accurate processing of network requests of different business modules and improve the processing efficiency of network requests.

[0005] According to an aspect of the present application, a communication method is provided, comprising:

[0006] If a network request sent by a business module in a client is detected, the locally stored reachability configuration information is obtained; the reachability configuration information represents the reachability between the business module and the candidate gateway;

[0007] It is determined whether the reachability configuration information is expired, and if not, the target gateway is determined according to the reachability configuration information and the available state of each candidate gateway;

[0008] The network request is processed according to the attribute information of the target gateway, the processed network request is forwarded to the target gateway, and the business data fed back by the target gateway is obtained.

[0009] According to another aspect of the present application, a communication device is provided, comprising:

[0010] The information acquisition module is configured to obtain the locally stored reachability configuration information if a network request sent by a business module in a client is detected; the reachability configuration information represents the reachability between the business module and the candidate gateway;

[0011] The gateway determination module is configured to determine whether the reachability configuration information is expired, and if not, to determine the target gateway according to the reachability configuration information and the available state of each candidate gateway;

[0012] The data acquisition module is configured to process the network request according to the attribute information of the target gateway, forward the processed network request to the target gateway, and acquire service data fed back by the target gateway.

[0013] According to another aspect of the present application, there is provided an electronic device comprising:

[0014] at least one processor; and

[0015] a memory in communication with the at least one processor; wherein

[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the communication method according to any one of the embodiments of the present application.

[0017] According to another aspect of the present application, there is provided a computer readable storage medium storing computer instructions for enabling a processor to perform the communication method according to any one of the embodiments of the present application when executed by the processor.

[0018] The technical solution of the embodiments of the present application is that if a network request sent by a service module in a client is detected, the reachable relationship configuration information stored locally is acquired; it is determined whether the reachable relationship configuration information is expired, and if not, a target gateway is determined according to the reachable relationship configuration information and the available states of each candidate gateway; the network request is processed according to the attribute information of the target gateway, the processed network request is forwarded to the target gateway, and service data fed back by the target gateway is acquired. By determining the target gateway corresponding to the network request of the service module according to the reachable relationship configuration information and the available states of the gateways, and calling the target gateway to perform service to acquire the service data, efficient and accurate processing of different network requests of service modules can be realized, and the processing efficiency of network requests is improved.

[0019] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of these drawings.

[0021] Figure 1Ais a flow chart of a communication method provided by an embodiment of the present application;

[0022] Figure 1B is a flow chart of a communication method provided by an embodiment of the present application;

[0023] Figure 2 is a structural block diagram of a communication device provided by an embodiment of the present application;

[0024] Figure 3 is a structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to enable persons skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative labor should fall within the scope of protection of the present application.

[0026] It should be noted that the terms "first", "second", "target", "candidate", "alternative" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.

[0027] It should be noted that with the popularity of mobile smart devices, the business functions contained in an enterprise-level mobile client application are increasingly rich and complex. In addition, with the continuous upgrading and iteration of the technology stack, the updating and iteration of the gateway service are also increasingly intense.

[0028] In the design of conventional applications, in order to control the design complexity of the system and the maintainability of the business function, different business functions are usually divided into different modules, which can be native Android, iOS such as App (Application, application) level module, or H5 container (H5 container is a component used by the client to load and render H5 pages, generally provided by the system framework layer, and the application development layer is the consumer of the component, and the H5 container has a browser kernel), or a small program module, each business module is also independent in code structure, each performs its own function, and has a clear boundary. By using the relative independence between business modules, the gateway used can be specified module by module.

[0029] With the continuous improvement of enterprise-level application embedded modules, different modules may use different gateway services, and there may be a need to simultaneously access different gateway services. In addition, in different business scenarios, the gateway service used may need to be selected on demand, and therefore, the parallel operation of multiple gateways is also an urgent need to provide.

[0030] Therefore, how to realize the parallel operation of different gateway services in a mobile application is a problem to be solved. The technical solution of the embodiment of the present application can timely and effectively determine the corresponding target gateway when detecting a network request, quickly respond to the network request, and also can perform timely switching and parallel operation of multiple gateways, and the specific implementation mode will be described in detail in the subsequent embodiments.

[0031] Embodiment one

[0032] Figure 1A is a flowchart of a communication method provided by the embodiment one of the present application. Figure 1B is a flowchart of a communication method provided by the embodiment one of the present application. The embodiment can be applicable to the case that the network request sent by different business modules in the client is called to respond and feed back business data by corresponding gateway, the method can be executed by a communication device, the communication device can be realized in the form of hardware and / or software, and the communication device can be configured in an electronic device, such as an enterprise-level mobile client application, and executed by a processing module in the client. As shown in the figure, the communication method comprises the following steps. Figure 1A

[0033] S101, if a network request sent by a business module in the client is detected, the reachable relationship configuration information stored locally is acquired.

[0034] ​The client can be a mobile application end. The client can be configured with at least two service modules that can implement different service functions. The network request is a request sent by the service module to the processing module of the client, in which the target calling gateway interacts with the server. The network request can be a service transaction request.

[0035] The reachable relationship configuration information refers to the reachability between the service module and the candidate gateway. The candidate gateway refers to a gateway that can be called by the client to communicate with the server. The number of candidate gateways can be at least two. The reachability indicates whether the service module can call the corresponding candidate gateway to communicate with the server.

[0036] Optionally, the user can operate on the client to send a related service instruction to the client. When the service module detects the related service instruction, the network request is sent to the processing module in the client. At this time, the processing module determines that the service module needs to communicate with the server, that is, detects the network request sent by the service module in the client.

[0037] Optionally, if the network request sent by the service module in the client is detected, the storage module in the client can be interacted with to obtain the latest reachable relationship configuration information stored in the storage module, that is, the locally stored reachable relationship configuration information is obtained.

[0038] Optionally, if the client startup event is detected, a configuration information acquisition request is sent to the preset master gateway to instruct the master gateway to generate the reachable relationship configuration information according to the whitelist information of each candidate gateway and feedback. The reachable relationship configuration information fed back by the master gateway is obtained and stored locally.

[0039] Optionally, based on the preset rule, when the update condition is met, the locally stored reachable relationship configuration information can be updated, specifically including: determining abnormal information in the communication process; updating the locally stored reachable relationship configuration information according to the abnormal information.

[0040] The abnormal information includes at least one of the following: network exception, service exception, message parameter exception, and operator exception.

[0041] Optionally, the processing module in the client can determine the candidate gateway that occurs the abnormality when detecting the network exception, the service exception, the message parameter exception, or the operator exception. Further, the reachability between each service module and the candidate gateway that occurs the abnormality in the locally stored reachable relationship configuration information is modified to be unreachable, so as to update the locally stored reachable relationship configuration information.

[0042] It should be noted that the embodiment is aimed at abnormal situations in the communication process, and automatically identifies abnormal information, including but not limited to network abnormalities, service abnormalities, message parameter abnormalities, operator abnormalities, etc. The reachability relationship can be updated and optimized according to the abnormal scene, to ensure the real-time and accuracy of the reachability relationship configuration information.

[0043] S102, determine whether the reachability relationship configuration information is expired, if not, determine the target gateway according to the reachability relationship configuration information and the available state of each candidate gateway.

[0044] The available state refers to a state indicating whether the candidate gateway can be called. The target gateway refers to the determined target gateway corresponding to the network request.

[0045] Optionally, determining whether the reachability relationship configuration information is expired includes: determining the local storage time of the reachability relationship configuration information, the validity period of the reachability relationship configuration information, and the current time; if it is detected that the deviation between the local storage time and the current time is greater than the validity period of the reachability relationship configuration information, it is determined that the reachability relationship configuration information has expired.

[0046] Illustratively, the client can request the configuration information of the double-track state from the server in advance, which will contain the configuration validity period, and record the time of the request return locally (i.e. the local storage time). When the client needs to judge the validity period, it will judge whether it is overdue according to whether the "local client current time-local record request return time" is greater than the validity period in the configuration. Specifically, if it is detected that the deviation between the local storage time and the current time is greater than the validity period of the reachability relationship configuration information, it is determined that the reachability relationship configuration information has expired.

[0047] Optionally, after determining whether the reachability relationship configuration information is expired, it further includes: if it is determined that the reachability relationship configuration information has expired, sending a configuration information acquisition request to a preset master gateway to instruct the master gateway to generate reachability relationship configuration information according to the white list information of each candidate gateway and feedback.

[0048] Optionally, after sending the configuration information acquisition request to the preset master gateway, the latest reachability relationship configuration information feedback by the master gateway can be acquired and stored locally, to update the locally stored reachability relationship configuration information, and further determine the target gateway according to the updated reachability relationship configuration information and the available state of each candidate gateway.

[0049] It should be noted that by determining that the locally stored reachability relationship configuration information has expired, the latest reachability relationship configuration information can be acquired from the master gateway in time, so that the subsequently determined target gateway is more accurate and effective, and the processing efficiency of the network request is ensured.

[0050] S103, processing the network request according to the attribute information of the target gateway, forwarding the processed network request to the target gateway, and obtaining service data fed back by the target gateway.

[0051] The attribute information of the target gateway can include the type of the target gateway and data format requirements, etc. The service data refers to service data generated by the server in response to the gateway request.

[0052] Optionally, the client can forward the processed network request to the target gateway to instruct the target gateway to forward and obtain the service data of the server, and after obtaining the service data forwarded by the target gateway, the service data can be rendered in the corresponding business module according to the service data to realize the response to the instruction of the user.

[0053] Optionally, processing the network request according to the attribute information of the target gateway includes: determining the data format requirement of the target gateway in the attribute information of the target gateway; and formatting the transmission data in the network request according to the data format requirement and the characteristics of the target gateway.

[0054] Optionally, after forwarding the processed network request to the target gateway, the target gateway can interact with the server to obtain the service data generated by the server for the network request and feed back to the client, and the client can obtain the service data fed back by the target gateway.

[0055] Optionally, after forwarding the processed network request to the target gateway, it further includes: if it is detected that the target gateway does not respond for more than a preset number of times, determining a second gateway according to the reachable relationship configuration information; forwarding the processed network request to the second gateway to instruct the second gateway to interact with the server to obtain the service data; obtaining the service data fed back by the second gateway and rendering the function in the client according to the service data. The second gateway refers to a candidate gateway most matched with the business module except the target gateway, such as a gateway with optimal reachability. The preset number of times can be 3, for example.

[0056] It should be noted that in this way, real-time dynamic switching of multiple gateways can be realized to ensure the processing efficiency of the network request.

[0057] Optionally, if it is detected that at least two network requests are sent by different business modules in the client, at least two target gateways corresponding to the different business modules are determined; the corresponding network requests are sent to the at least two target gateways in parallel to instruct the target gateways to process the network requests simultaneously; the service data fed back by the target gateways is obtained and forwarded to the corresponding business modules.

[0058] It should be noted that by detecting at least two network requests, determining at least two target gateways, and then processing in parallel, the parallel operation of multiple gateways is realized, and the processing efficiency of network requests can be effectively improved.

[0059] Optionally, if at least two network requests sent by the same service module are detected, the at least two network requests can be processed in sequence according to the sending time of the network requests, in time sequence or in preset priority.

[0060] The technical scheme of the embodiment of the application, if a network request sent by a service module in the client is detected, the locally stored reachable relationship configuration information is acquired; it is determined whether the reachable relationship configuration information is expired, if not, the target gateway is determined according to the reachable relationship configuration information and the available state of each candidate gateway; the network request is processed according to the attribute information of the target gateway, the processed network request is forwarded to the target gateway, and the service data fed back by the target gateway is acquired. By determining the target gateway corresponding to the network request of the service module according to the reachable relationship configuration information and the available state of the gateway, and calling the target gateway for service to acquire the service data, efficient and accurate processing of different service module network requests can be realized, and the processing efficiency of network requests can be improved.

[0061] Preferably, a master gateway can be preconfigured, and the client can interact with the master gateway when it is determined that the reachable relationship configuration information has expired or when a preset time period is reached, to acquire the latest reachable relationship configuration information. For example, the master gateway can include a reachable relationship configuration module, a reachable relationship generation module, a data communication security module, a white list configuration module, a reachable relationship engine module, a reachable relationship management module, a gateway service forwarding module, and a reachable relationship cache module.

[0062] The reachable relationship configuration module provides a user visual management and configuration center, and can configure the reachable relationship in multiple gateway service, interface, and other dimensions. This module is the basis of all reachable relationships, and all accesses and uses of reachable relationships come from the data source of this module.

[0063] The reachable relationship generation module formats the relevant data into a data format available for the client side and the network communication link based on the configured reachable relationship, so that other modules can access and acquire the formatted data as needed. The data communication security module ensures the security of data communication between the master gateway service and the client side, and ensures the security of network data communication between the client and the master gateway service. This module supports multiple security algorithms and can adapt to multiple different types of client requests.

[0064] White list configuration module: in order to ensure that the business module can carry out gray migration, the module can support the configuration of white list related information of reachable relationship, so that the reachable relationship generation module can generate personalized reachable relationship based on the white list. The module can support the parameterized configuration of information such as mobile phone model, version, user ID (Identity document, unique code), geographical location, etc., to support multi-dimensional white list management and control.

[0065] Reachable relationship engine module: provide client-side reachable relationship request access engine, provide flow control and delay tolerance fault tolerance and other reliability services to ensure the high availability and stability of reachable relationship request. Reachable relationship management module: provides dynamic identification of reachable relationship, sniffs for abnormal conditions of gateway service, can support automatic detection of abnormal state of other gateway services, so as to update the reachable relationship of gateway service in real time, and ensure the high availability of the whole service.

[0066] Gateway service forwarding module: after the gateway service receives the regular network request and completes the data security check, the module can forward the gateway request to the corresponding background business service, so as to complete the processing of business request data and ensure that the business logic of business module can be normally processed. Reachable relationship cache module: in order to ensure the high availability and stability of reachable relationship, the corresponding cache processing is carried out for the reachable relationship, so as to ensure that the reachable relationship can be quickly returned to the client and improve the corresponding speed of reachable relationship return.

[0067] For example, the client can be configured with a reachable relationship request module, a data communication security module, a reachable relationship cache module, a reachable relationship identification module, a reachable relationship verification module, a gateway data formatting module, a gateway request queuing module, an abnormal scene intelligent identification module, a multi gateway adaptation module, a multi gateway detection module, an H5 container data processing module and an H5 container communication module.

[0068] Among them, the reachable relationship request module: the module is used for the client to request the reachable relationship to the main gateway service, and carries out preliminary formatting processing on the requested reachable relationship. Data communication security module: in order to ensure the data communication security between the main gateway service and the client side, the module ensures the network data communication security between the client and the main gateway service, and the module supports a variety of security algorithms, which can adapt to a variety of different types of client requests.

[0069] Reachable relationship cache module: To ensure the high availability and stability of the reachable relationship, the corresponding cache processing is performed on the reachable relationship to ensure that the reachable relationship can quickly respond when needed by the client, and the cache data can be updated in real time according to the validity period to ensure the high availability of the service. Reachable relationship identification module: According to the module information transmitted by the business module, the gateway service required by the current network request can be intelligently identified according to the reachable relationship on the terminal side, and the reachable relationship is fed back to other modules.

[0070] Reachable relationship verification module: According to the available relationship returned by the reachable relationship identification module, validity verification is performed on information such as module ID and validity period to ensure that the reachable relationship is in a legal and effective state. Gateway data formatting module: In order to ensure the effectiveness of data communication of different gateway services and to be able to meet the data format requirements of different gateway services, this module can ensure that the data can be formatted according to the data format requirements of the corresponding gateway when sending a request to the gateway service, and can adapt to different gateway services, greatly improving the reliability and compatibility of multi-gateway parallel operation.

[0071] Gateway request queuing module: In order to ensure the logical order and effectiveness of the gateway request, this module ensures the sequential execution and priority scheduling of the gateway request, so that when multiple network requests are triggered at the same time, the network request can be triggered according to the priority, order and other rules, improving the reliability of parallel operation and avoiding the occupation of core resources.

[0072] Abnormal scenario intelligent identification module: For abnormal situations during device operation, this module can automatically identify abnormal information, including but not limited to network abnormalities, service abnormalities, message parameter abnormalities, and operator abnormalities. The reachable relationship can be updated and optimized intelligently according to the abnormal scenario, so that the device can automatically handle when an abnormality occurs, and can automatically return to normal state after the abnormal scenario is restored.

[0073] Multi-gateway adaptation module: Since there are multiple gateway modules in the client, in order to ensure the compatibility and adaptation of different gateway modules, this module can ensure that the differences between multiple gateway modules are shielded and transparently processed in the client, so that other devices can not need to pay attention to the differences between different gateway services when calling gateway services, thereby reducing the complexity of system calls. Multi-gateway detection module: This module is used to intelligently detect the state of each access gateway service, such as gateway service abnormalities, which can automatically update the local reachable information, and after the gateway service is restored to normal, it can automatically identify and distinguish, and obtain the latest reachable information, so as to restore the reachable information to normal state.

[0074] H5 container data processing module: when the business module displayed in the H5 container makes a data request, the module can perform format processing on the channel information, business parameters and other data transmitted by the business module, so that other modules can be called homogeneously, the differences between different business modules are reduced, and the data calling and processing costs are reduced. H5 container communication module: when the business module displayed in the H5 container makes a data request, the module can transmit data to the client native module according to the channel information, business parameters and other data transmitted by the business module, so as to ensure the data communication between the H5 container and the client native layer and ensure the data continuity of the whole process.

[0075] It should be noted that based on the organic cooperation of the above-mentioned modules in the client, the gateway service used can be intelligently selected during gateway communication, and the upper application and the accessed backend service are transparent, the related configurations are automatically updated by the related modules, and the abnormal detection and retry are completed, thereby ensuring the independence of the gateway services used between the business modules.

[0076] For example, the communication scheme implemented by the interaction of the modules can be: the business personnel first use the "reachable relationship configuration module" and the "reachable relationship management module" through the main gateway console to configure and maintain the reachable relationship, and the "reachable relationship generation module" performs data processing and logical generation on the reachable relationship configured by the business personnel, and caches the generated data in the "reachable relationship cache" module of the main gateway; if there is a "white list" in the reachable relationship, that is, only the users in the white list can hit certain reachable relationships, then the business personnel synchronously configure the white list information through the "white list configuration module" through the main gateway console, and match the corresponding white list configuration when configuring the reachable relationship, and format the related white list data when generating the reachable relationship in the main gateway;

[0077] When the client starts, the "reachable relationship request module" calls the "data communication security module" and the "gateway data formatting module" to initiate a secure network request to the main gateway, which is used to request the reachable relationship configuration information, and the reachable relationship is saved in the client local through the "reachable relationship cache module", which is used for subsequent multi-gateway access decision; if the client initiates other network requests (such as business transaction requests) at the same time, the "gateway request queuing module" queues the network requests. If an abnormal situation occurs during the network request process or the business processing process, the "abnormal scenario intelligent identification module" uniformly processes the abnormal scenario.

[0078] When the client network request arrives at the main gateway service, the main gateway service "data communication security module" performs security check, routes the request to the "reachable relationship engine module", reads the relevant data from the "reachable relationship cache" module, and returns to the client through the engine. Based on the above process, the client can obtain and cache the latest reachable relationship configuration data after startup. At this time, the client can normally load the H5 container to render business functions. In addition, the client "multi-gateway detection module" can periodically detect the availability of each gateway and synchronously update the state in the local "reachable relationship cache module";

[0079] When the business logic needs to send a network request, call the relevant network request method in the "H5 container communication module". First, the "H5 container data processing module" formats the incoming parameters and generates relevant public parameters. Then, the "reachable relationship identification module" intelligently decides which gateway service to use based on the current state, and checks whether the current decision is available and legal through the "reachable relationship verification module". After the final decision of the gateway service to be accessed, the "multi-gateway adaptation module" further processes and encapsulates the network request based on the gateway characteristics, and sends the relevant network request.

[0080] Preferably, referring to Figure 1B , the process of interaction between the H5 container in the client, the client (i.e. the processing module in the client), the self-developed gateway service (i.e. the target gateway), and the service side (i.e. the server) to realize communication can include the following steps: 1. Different business modules in the client call um RPC (Remote Procedure Call, um protocol) based on the H5 container to initiate a network request. 2. The client judges the validity period of the state. 3.1. The client judges that it is not expired and directly sends (for example, the self-developed gateway). 3.2. The client judges that it is close to expiration, re-requests the state, and continues to send the network request. 3.3. The client receives the state information returned by the self-developed gateway service. Through the above steps, the transparency of the upper application and the backend service can be guaranteed. 4. The self-developed gateway performs gateway signature decryption according to the received request. 5. The decrypted request is forwarded to the gateway backend application side (server). 6. Obtain the business data feedback from the service side. 7. Organize the message according to the feedback business data and encrypt and sign the message. 8. Return the encrypted and signed organized message to the client. 9. The client performs signature decryption and formats the message. 10. Feedback the formatted feedback message to the H5 container. The corresponding business module can render business functions based on the business data in the feedback message.

[0081] Embodiment Two

[0082] Figure 2is a structural block diagram of a communication device provided by Embodiment Two of the present application. The communication device provided by the embodiment of the present application can be applied to the case that a network request sent by a different service module in a client is responded and service data is fed back by calling a corresponding gateway. The communication device can be realized in the form of hardware and / or software and configured in a device with specific communication function, such as an enterprise-level mobile client application. As shown in FIG. Figure 2 The device specifically includes:

[0083] An information obtaining module 201 is configured to obtain locally stored reachability configuration information if a network request sent by a service module in a client is detected.

[0084] A gateway determining module 202 is configured to determine whether the reachability configuration information is expired. If not, a target gateway is determined according to the reachability configuration information and the available state of each candidate gateway.

[0085] A data obtaining module 203 is configured to process the network request according to the attribute information of the target gateway, forward the processed network request to the target gateway, and obtain service data fed back by the target gateway.

[0086] The technical solution of the embodiment of the present application is configured to obtain locally stored reachability configuration information if a network request sent by a service module in a client is detected, determine whether the reachability configuration information is expired, if not, determine a target gateway according to the reachability configuration information and the available state of each candidate gateway, process the network request according to the attribute information of the target gateway, forward the processed network request to the target gateway, and obtain service data fed back by the target gateway. By determining a target gateway corresponding to a network request of a service module according to reachability configuration information and the available state of a gateway and calling the target gateway to obtain service data, efficient and accurate processing of different network requests of service modules can be realized, and the processing efficiency of network requests can be improved.

[0087] Further, the gateway determining module 202 is specifically configured to:

[0088] determine the local storage time of the reachability configuration information, the validity period of the reachability configuration information, and the current time.

[0089] If the deviation between the local storage time and the current time is greater than the validity period of the reachability configuration information, it is determined that the reachability configuration information is expired.

[0090] Further, the gateway determining module 202 is further configured to:

[0091] If it is determined that the reachability relationship configuration information is expired, a configuration information acquisition request is sent to a preset master gateway to instruct the master gateway to generate reachability relationship configuration information according to the white list information of each candidate gateway and feed back the reachability relationship configuration information.

[0092] Further, the data acquisition module 203 is specifically configured to:

[0093] determine the data format requirement of the target gateway in the attribute information of the target gateway;

[0094] format the transmission data in the network request according to the data format requirement and the characteristics of the target gateway.

[0095] Further, the device is further configured to:

[0096] if it is detected that the target gateway does not respond for more than a preset number of times, determine a second gateway according to the reachability relationship configuration information;

[0097] forward the processed network request to the second gateway to instruct the second gateway to interact with the server to obtain service data;

[0098] acquire the service data fed back by the second gateway, and render a function according to the service data on the client.

[0099] Further, the device is further configured to:

[0100] if it is detected that at least two network requests are sent by different service modules in the client, determine at least two target gateways corresponding to the different service modules;

[0101] send corresponding network requests to the at least two target gateways in parallel to instruct each target gateway to process the network request at the same time;

[0102] acquire the service data fed back by each target gateway and forward to the corresponding service module.

[0103] Further, the device is further configured to:

[0104] determine abnormal information in the communication process; the abnormal information includes at least one of the following: network anomaly, service anomaly, message parameter anomaly and operator anomaly;

[0105] update the locally stored reachability relationship configuration information according to the abnormal information.

[0106] Embodiment Three

[0107] Figure 3 is a structural schematic diagram of an electronic device provided by the embodiment three of the present application. Figure 3A structural diagram of an electronic device 10 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the present application described and / or claimed in this document.

[0108] As shown, Figure 3 The electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., communicatively connected to the at least one processor 11, where the memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer programs stored in the read-only memory (ROM) 12 or loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0109] Various components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc., an output unit 17, such as various types of displays, speakers, etc., a storage unit 18, such as a magnetic disk, an optical disk, etc., and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0110] The processor 11 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as a communication method.

[0111] In some embodiments, the communication method can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as storage unit 18. In some embodiments, parts or all of the computer program can be loaded and / or installed onto electronic device 10 via, e.g., ROM 12 and / or communication unit 19. When the computer program is loaded onto RAM 13 and executed by processor 11 as aforementioned, one or more steps of the communication method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the communication method by way of other means (e.g., by way of firmware).

[0112] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, specially designed application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0113] Computer programs used to implement the methods of the application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed by the processor of the machine, implements the functions / acts specified in the flowcharts and / or block diagrams. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine and partially on a remote machine or entirely on a remote machine or server.

[0114] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0115] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0116] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0117] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.

[0118] It should be understood that the various forms of flow shown above can be reordered, added to, or have steps deleted. For example, the steps described in the present application can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions of the present application can be achieved, which are not limited herein.

[0119] The above detailed description does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A communication method characterized by comprising: The method comprises the following steps: If a client start event is detected, a configuration information acquisition request is sent to a preset master gateway to instruct the master gateway to generate reachability configuration information according to the white list information of each candidate gateway and feed back the reachability configuration information; The reachability configuration information fed back by the master gateway is acquired and stored locally; the client is configured with at least two service modules capable of realizing different service functions; If a network request sent by a service module in the client is detected, the locally stored reachability configuration information is acquired; The reachability configuration information represents the reachability between the service module and the candidate gateway; The network request refers to a request sent by the service module to a processing module of the client, in which a target gateway is called to interact with a server; It is determined whether the reachability configuration information is expired, and if not, a target gateway is determined according to the reachability configuration information and the available state of each candidate gateway; The network request is processed according to the attribute information of the target gateway, the processed network request is forwarded to the target gateway, and service data fed back by the target gateway is acquired; The method further comprises the following steps: Abnormal information in a communication process is determined; the abnormal information comprises at least one of the following: network abnormality, service abnormality, message parameter abnormality, and operator abnormality; according to the abnormal information, a candidate gateway in which the abnormality occurs is determined, the reachability between each service module and the candidate gateway in which the abnormality occurs in the locally stored reachability configuration information is modified to be unreachable, and the locally stored reachability configuration information is updated.

2. The method of claim 1, wherein, It is determined whether the reachability configuration information is expired, which comprises the following steps: The local storage time of the reachability configuration information, the validity period of the reachability configuration information, and the current time are determined; If the deviation between the local storage time and the current time is greater than the validity period of the reachability configuration information, it is determined that the reachability configuration information is expired.

3. The method of claim 2, wherein, After it is determined whether the reachability configuration information is expired, the following steps are further included: If it is determined that the reachability configuration information is expired, a configuration information acquisition request is sent to a preset master gateway to instruct the master gateway to generate reachability configuration information according to the white list information of each candidate gateway and feed back the reachability configuration information.

4. The method of claim 1, wherein, The network request is processed according to the attribute information of the target gateway, which comprises the following steps: The data format requirement of the target gateway in the attribute information of the target gateway is determined; The transmission data in the network request is formatted according to the data format requirement and the characteristics of the target gateway.

5. The method of claim 1, wherein, After the processed network request is forwarded to the target gateway, the following steps are further included: If it is detected that the target gateway does not respond for more than a preset number of times, a second gateway is determined according to the reachability configuration information; forward the processed network request to the second gateway to instruct the second gateway to interact with a server to obtain service data; obtain the service data fed back by the second gateway and perform function rendering on the client according to the service data.

6. A communication device, characterized by Comprise: An information obtaining module is configured to, if it is detected that a network request sent by a service module in the client, obtain locally stored reachability configuration information; The reachability configuration information represents reachability between the service module and a candidate gateway; The network request is a request sent by the service module to a processing module in the client to call a target gateway to interact with a server; A gateway determining module is configured to determine whether the reachability configuration information is expired, and if not, determine a target gateway according to the reachability configuration information and available states of each candidate gateway; A data obtaining module is configured to process the network request according to attribute information of the target gateway, forward the processed network request to the target gateway, and obtain service data fed back by the target gateway; The device is further configured to, if a client startup event is detected, send a configuration information obtaining request to a preset main gateway to instruct the main gateway to generate reachability configuration information according to whitelist information of each candidate gateway and feed back the reachability configuration information; obtain the reachability configuration information fed back by the main gateway and store the reachability configuration information locally; and the client is configured with at least two service modules that can implement different service functions; The device is further configured to, if at least two network requests sent by different service modules in the client are detected, determine at least two target gateways corresponding to the different service modules; send the corresponding network requests to the at least two target gateways in parallel to instruct each target gateway to process the network requests simultaneously; and obtain service data fed back by each target gateway and forward the service data to the corresponding service module; The device is further configured to determine abnormal information in a communication process; the abnormal information includes at least one of network abnormality, service abnormality, message parameter abnormality, and operator abnormality; according to the abnormal information, determine a candidate gateway that has an abnormality, modify reachability between each service module and the candidate gateway that has the abnormality in the locally stored reachability configuration information to be unreachable, and update the locally stored reachability configuration information.

7. An electronic device, comprising: The electronic device comprises: at least one processor; and a memory connected with the at least one processor in communication; wherein The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the communication method in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for enabling the processor to execute the communication method in any one of claims 1-5 when the processor executes the computer instructions.

Citation Information

Patent Citations

  • Gateway selection method, system and device in service system, server and medium

    CN112738153A

  • Service request processing method and device, equipment, storage medium and product

    CN114785854A