Data access method, device, system, equipment and medium
By configuring forwarding configuration information in the gateway, the problem of performance mismatch when reusing back-end services between mobile terminals and personal computer terminal devices is solved, the response efficiency and user experience of mobile terminals are improved, and development and maintenance costs are reduced.
Patent Information
- Application Number
- CN202110878225.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-30
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-07-30
AI Technical Summary
Between different terminal devices such as mobile terminals and personal computers, there is a performance mismatch problem when reusing back-end services, resulting in high costs and difficulty in meeting the performance requirements of mobile terminals.
Forward configuration information through gateway configuration, receive access requests from mobile terminal devices, and based on the configuration information, request data resources from multiple interfaces of the back-end service, process and feed back to the mobile terminal device, reduce the number of network connections and calls, and improve response efficiency.
It achieves compatibility and scalability for mobile terminals, improves user experience, reduces development and maintenance costs, and avoids the need to modify back-end services.
Smart Images

Figure CN113596164B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of Internet technology and can be used in the financial field or other fields. More specifically, it relates to a data access method, device, system, equipment, medium and program product. Background Art
[0002] With the advancement of Internet technology, new terminal devices are constantly emerging, and the transformation and upgrading of the backend that provides services for the terminals may lag behind the terminals, and will be much more complicated and costly. For example, mobile Internet is becoming more and more popular, and more and more netizens frequently use mobile terminals to surf the Internet. The development and operation of applications for mobile terminals are very different from those on computer terminals. This leads to a large number of interface reuses and multiple complex calls when reusing the backend services developed for computer terminals, resulting in performance mismatch problems. If a new set of backend services for mobile terminals needs to be developed, the cost will be very high. Summary of the invention
[0003] In view of the above problems, the present disclosure provides a data access method, apparatus, device, medium and program product that can improve data access performance when reusing existing backend services.
[0004] In a first aspect of an embodiment of the present disclosure, a data access method is provided, which is applied to a gateway. The method comprises: receiving a first access request sent by a first type of terminal device; based on the first access request and the forwarding configuration information of the gateway for the access request of the first type of terminal device, requesting data resources from M interfaces of a backend service to obtain M data resources, wherein M is an integer greater than 1; processing the M data resources into first response data; and feeding back the first response data to the first type of terminal device. The backend service is a service platform developed for a second type of terminal device, and the first type of terminal device and the second type of terminal device are of different types.
[0005] According to an embodiment of the present disclosure, the different types of the first-category terminal device and the second-category terminal device include: the second-category terminal device and the first-category terminal device are used in different ways by users.
[0006] According to an embodiment of the present disclosure, the first type of terminal device is a mobile terminal, and the second type of terminal device is a personal computer.
[0007] According to an embodiment of the present disclosure, processing the M data resources into first response data includes: reducing or merging each field in the M data resources according to the format of the response data of the first type of terminal device to obtain the first response data.
[0008] According to an embodiment of the present disclosure, the method further includes: configuring the forwarding configuration information in the gateway, wherein the forwarding configuration information includes a correspondence between each interface in the gateway and at least one interface of the backend service, wherein each interface in the gateway is called by the first type of terminal device through the network address in the access request. The first interface in the gateway called by the first access request corresponds to the M interfaces of the backend service.
[0009] According to an embodiment of the present disclosure, requesting data resources from M interfaces of a backend service based on the first access request and the forwarding configuration information of the gateway's access request to the first type of terminal device to obtain M data resources includes: calling the first interface in the gateway based on the network address of the first access request; determining the M interfaces in the backend service corresponding to the first interface based on the forwarding configuration information; and requesting data from the M interfaces to obtain the M data.
[0010] According to an embodiment of the present disclosure, there is a logical order between the M interfaces; configuring the forwarding configuration information in the gateway includes: in the correspondence between the first interface and the M interfaces, arranging and configuring the M interfaces according to the logical order.
[0011] According to an embodiment of the present disclosure, requesting data resources from the M interfaces of the backend service includes: requesting data from the M interfaces in sequence according to the logical order.
[0012] According to an embodiment of the present disclosure, the method further includes: updating the forwarding configuration information in real time based on a user's update operation on the forwarding configuration information.
[0013] According to a second aspect of an embodiment of the present disclosure, there is provided a data access device, which is arranged in a gateway. The device includes a routing forwarding module and a query aggregation module, and the routing forwarding module includes a receiving module, a calling module and a sending module. The receiving module is used to receive a first access request sent by a first type of terminal device. The calling module is used to request data resources from M interfaces of a backend service based on the first access request and the forwarding configuration information of the gateway for the access request of the first type of terminal device, so as to obtain M data resources; wherein M is an integer greater than 1; wherein the backend service is a service platform developed for a second type of terminal device, and the types of the first type of terminal device and the second type of terminal device are different. The query aggregation module is used to process the M data resources into first response data. The sending module is used to feed back the first response data to the first type of terminal device.
[0014] According to an embodiment of the present disclosure, the device further includes a background configuration module. The background configuration module is used to configure the forwarding configuration information in the gateway, wherein the forwarding configuration information includes a correspondence between each interface in the gateway and at least one interface of the backend service, wherein each interface in the gateway is called by the first type of terminal device through the network address in the access request; wherein the first interface in the gateway called by the first access request corresponds to the M interfaces of the backend service.
[0015] According to an embodiment of the present disclosure, the background configuration module is also used to arrange and configure the M interfaces according to the logical order in the corresponding relationship between the first interface and the M interfaces when there is a logical order between the M interfaces.
[0016] According to an embodiment of the present disclosure, the background configuration module is further used to update the forwarding configuration information in real time based on a user's update operation on the forwarding configuration information.
[0017] According to a third aspect of an embodiment of the present disclosure, a data access system is provided. The system includes a first type of terminal device, a second type of terminal device, a backend service, and a gateway. The backend service is a service platform developed for the second type of terminal device. The second type of terminal device is of a different type from the first type of terminal device. The gateway is used to forward information between the backend service and the first type of terminal device, including: receiving a first access request sent by a first type of terminal device; based on the first access request and the forwarding configuration information of the gateway for the access request of the first type of terminal device, requesting data resources from M interfaces of the backend service to obtain M data resources; wherein M is an integer greater than 1; processing the M data resources into first response data; and feeding back the first response data to the first type of terminal device.
[0018] According to a fourth aspect of the embodiments of the present disclosure, an electronic device is provided. The electronic device includes one or more processors and one or more memories. The one or more memories are used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors execute the method as described above.
[0019] According to a fifth aspect of the present disclosure, a computer-readable storage medium is provided, on which executable instructions are stored, and when the instructions are executed by a processor, the processor executes the above method.
[0020] According to a sixth aspect of the present disclosure, a computer program product is provided, including a computer program, which implements the above method when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above contents and other purposes, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0022] Figure 1 The application scenario diagram of the data access method, apparatus, system, device, medium and program product according to the embodiments of the present disclosure is schematically shown;
[0023] Figure 2 A system architecture diagram of a data access method according to an embodiment of the present disclosure is schematically shown;
[0024] Figure 3 A flowchart of a data access method according to an embodiment of the present disclosure is schematically shown;
[0025] Figure 4 A flowchart schematically shows an interface for a gateway to call a backend service in a data access method according to an embodiment of the present disclosure;
[0026] Figure 5 A flowchart of a data access method according to another embodiment of the present disclosure is schematically shown;
[0027] Figure 6 A flowchart of a data access method according to another embodiment of the present disclosure is schematically shown;
[0028] Figure 7 A block diagram schematically shows a data access device according to an embodiment of the present disclosure; and
[0029] Figure 8 A block diagram of an electronic device suitable for implementing a data access method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0030] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0031] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0032] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0033] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0034] It should be understood herein that any number of elements in the specification and drawings is for illustration rather than limitation, and any naming (eg, first, second) is only for distinction but not for limitation.
[0035] Embodiments of the present disclosure provide a data access method, apparatus, system, device, medium, and program product. The data access method can be applied to a gateway, and the gateway can be used to forward information between a first-class terminal device and a backend service, wherein the backend service is a service platform developed for a second-class terminal device, and the first-class terminal device and the second-class terminal device are of different types. The data access method may include first receiving a first access request sent by a first-class terminal device, and then based on the first access request and the forwarding configuration information of the gateway for the access request of the first-class terminal device, requesting data resources from M interfaces of the backend service to obtain M data resources, then processing the M data resources into first response data, and finally feeding back the first response data to the first-class terminal device.
[0036] According to the embodiments of the present disclosure, the first type of terminal device and the second type of terminal device can use a set of backend services to obtain data. Moreover, when the first type of terminal device communicates with the backend service, through the forwarding configuration in the gateway, multiple resource data can be obtained from the backend service at one time through one request. In this way, the number of network connections and calls of the first type of terminal device can be reduced by aggregating the multiple resource data, thereby improving the request efficiency and enhancing the compatibility and extensibility of the existing backend service for the first type of terminal device.
[0037] According to various embodiments of the present disclosure, the first type of terminal device and the second type of terminal device are of different types, for example, they have different user usage modes, different operating systems, or different request response speeds.
[0038] In one embodiment, the first type of terminal device may be, for example, a mobile terminal, and the corresponding second type of terminal device may be a personal computer. Mobile terminals and personal computers are used differently by users, resulting in different user experiences and requirements for the timeliness of data display.
[0039] For example, personal computers are usually used by users for office work, while mobile terminals are usually used by users for leisure or fragmented time. In this way, multiple pages in a website can be requested separately on a personal computer multiple times and displayed separately on the personal computer one by one. In this case, users have relatively sufficient patience to wait for the pages to load and display. On a mobile terminal, if a user logs in to a website, each time they switch pages, they need to repeatedly request data from the backend service like a personal computer, which will make the user feel that they have to wait a long time each time they switch pages, and the user experience is reduced. It can be seen that users are more sensitive to response time when using mobile terminals than when using personal computers, which requires that the data display of applications on mobile terminals be more timely.
[0040] However, due to the early rise and development of personal computers, enterprises have often developed corresponding backend services for personal computers. When enterprises develop applications for mobile terminals, they face the problem of redeveloping backend services or upgrading existing backend services. Moreover, if existing backend services are reused, a large number of complex calls will inevitably occur, and it is often difficult to meet the performance requirements of mobile terminals.
[0041] In view of this, according to the methods, devices, systems, equipment, media and program products provided by the embodiments of the present disclosure, when an enterprise develops an application for a mobile terminal, it can configure the gateway 103, and for some requests of the mobile terminal, it can obtain multiple data from the backend service at one time through one request, thereby reducing the number of calls to the backend service by the mobile terminal, and after the mobile terminal obtains the data at one time, it can be quickly displayed to the user through the display control technology on the mobile terminal, thereby improving the user experience. Therefore, it is not necessary to develop a backend service separately, nor to modify the existing backend service, and it can also reduce the request frequency of the mobile terminal, while improving the user experience of using the mobile terminal.
[0042] For example, according to an embodiment of the present disclosure, for a product page (for example, including a product homepage, a details page, and an evaluation information page, etc.), when a user opens the product page through a personal computer, the information of the corresponding page can be displayed through the browser each time according to the request of the personal computer. When the user opens the product page through a mobile terminal, data including the product homepage, the details page, and the evaluation information page can be fed back to the mobile terminal at one time, and then the product homepage can be displayed to the user at the beginning through the display technology of the mobile terminal, and the details page and the evaluation information page can be quickly displayed to the user when the user switches the display content. Therefore, compared with a personal computer, the mobile terminal can obtain the product page through a network connection request once, which can reduce the time for each request to establish a connection with the backend service, thereby improving access efficiency and access timeliness.
[0043] The above first-class terminal device may be a mobile terminal, and the corresponding second-class terminal device may be a personal computer, which is used as an example to introduce the concept and application of the embodiment of the present disclosure, so as to help those skilled in the art to have a perceptual understanding of the present solution. It can be understood that the above examples are only illustrative, and the embodiment of the present disclosure is not limited to mobile terminals and personal computers.
[0044] It should be noted that the data access methods, devices, systems, equipment, media and program products determined in the various embodiments of the present disclosure can be used in the financial field (for example, applications in Internet finance) and can also be used in any field other than the financial field. The present disclosure does not limit the application field.
[0045] Figure 1 The following schematically illustrates an application scenario diagram of a data access method, apparatus, system, device, medium, and program product according to an embodiment of the present disclosure. It should be noted that: Figure 1 What is shown are merely examples of application scenarios to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0046] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a first type of terminal device 101, a second type of terminal device 102, a gateway 103, and a backend service 104. The first type of terminal device 101 is different from the second type of terminal device 102. For example, in the application scenario 100, the first type of terminal device 101 is exemplified as a mobile terminal (e.g., a smart phone or an iPad), and the second type of terminal device 102 is exemplified as a personal computer.
[0047] The backend service 104 is a service system developed for the second type of terminal device 102. In the application scenario 100, the communication between the second type of terminal device 102 and the backend service 104 is simplified and illustrated. In actual applications, the communication between the second type of terminal device 102 and the backend service 104 can be carried out in any manner known in the art.
[0048] The gateway 103 is used to forward information between the first type of terminal device 101 and the backend service 104 , so that the first type of terminal device 101 can communicate with the backend service 104 .
[0049] Figure 2 The system architecture diagram of the data access method according to the embodiment of the present disclosure is schematically shown.
[0050] Combination Figure 1 and Figure 2 The system architecture illustrates the process of a user using a first type of terminal device 101 to access a backend service 104 through a gateway 103 .
[0051] According to an embodiment of the present disclosure, the URL of the interface (eg, A-J) of the gateway 103 may be exposed to the first type of terminal device 101, so that the first type of terminal device 101 may access the interface in the gateway 103 through the network address in the access request.
[0052] In the gateway 103, forwarding configuration information can be configured for each interface in A to J. The forwarding configuration information can define the correspondence between each interface in the gateway 103 and at least one of the interfaces (a, b, ...i, ...) in the backend service 104, so that when the first type of terminal device 101 calls one of the interfaces in A to J through an access request, the gateway 103 can obtain data from at least one interface in the backend service 104 according to the forwarding configuration information, and then feed it back to the first type of terminal device 101. The correspondence can be one-to-one or one-to-many. When one interface in the gateway 103 corresponds to multiple interfaces of the backend service 104, after the gateway 103 obtains data from the multiple interfaces of the backend service 104, it can be aggregated into a response data and then fed back to the terminal device 101.
[0053] Specifically, when the application in the first type of terminal device 101 sends an access request, it can be uniformly passed through the gateway 103, where the request can be securely encrypted and forwarded to the corresponding interface of the backend service 104 through the configured route. Among them, the gateway 103 can query and sort out multiple interface data of the backend service 104 according to the configuration, and aggregate the results and return them to the first type of terminal device 101, so that the backend service 104 has mobile service capabilities. In this process, it is not necessary to expose the interface of the backend service 104 to the first type of terminal device 101, and it is not necessary to modify the backend service 104 according to the access logic of the first type of terminal device 101, so that the service support of the backend service 104 to the first type of terminal device 101 can be realized.
[0054] It can be seen that the backend service 104 can provide services to the first type of terminal device 101 and the second type of terminal device 102 at the same time, realizing a solution in which one backend supports multiple sets of terminal devices. Therefore, for changes in terminal devices or changes in user needs caused by market changes, the new service needs can be met by configuring the gateway 103 without changing the backend service 104, so that enterprises can respond more actively and flexibly to market technology changes or changes in needs.
[0055] It should be noted that the data access method provided in the embodiment of the present disclosure can generally be executed by the gateway 103. Accordingly, the data access device, equipment, medium and program provided in the embodiment of the present disclosure can generally be set in the gateway 103.
[0056] It should be understood that Figure 1 and Figure 2 The number and types of terminal devices, gateways, servers, and interfaces in the embodiment are merely illustrative. Any number and types of terminal devices, networks, gateways, servers, and interfaces may be provided as required.
[0057] The following will be based on Figure 1 Application scenarios]00, through Figure 3 to Figure 6 The data access method of the disclosed embodiment is described in detail.
[0058] Figure 3 The flowchart of the data access method according to the embodiment of the present disclosure is schematically shown.
[0059] like Figure 3 As shown, the data access method according to this embodiment may include operations S310 to S340.
[0060] First, in operation S310 , a first access request sent by a first-category terminal device 101 is received.
[0061] Then, in operation S320, based on the first access request and the forwarding configuration information of the gateway 103 for the access request of the first type of terminal device 101, data resources are requested from the M interfaces of the backend service 104 to obtain M data resources. Wherein, M is an integer greater than 1. Wherein, the backend service 104 is a service platform developed for the second type of terminal device 102, and the first type of terminal device 101 and the second type of terminal device 102 are of different types.
[0062] For example, the first interface of the gateway 103 may be called according to the network address in the first access request, and then data may be obtained from the M interfaces of the backend service 104 according to the M interfaces corresponding to the first interface in the forwarding configuration information. A specific implementation process may refer to Figure 4 's hint.
[0063] Figure 4 The flowchart of the gateway calling the interface of the backend service in operation S320 in the data access method according to the embodiment of the present disclosure is schematically shown.
[0064] like Figure 4 As shown, according to an embodiment of the present disclosure, operation S320 may include operations S321 to S323.
[0065] In operation S321, based on the network address of the first access request, the first interface in the gateway 103 is called. For example, the first access request may include a network address URL, and the first interface is located through the network address URL.
[0066] Next, in operation S322, based on the forwarding configuration information, the M interfaces in the backend service 104 corresponding to the first interface are determined. In some embodiments, the network address URL processed in the first access request may also include suffix information, which may be information of the requested data resource, etc. After determining the first interface, the M interfaces may be matched from the forwarding configuration information through the suffix information.
[0067] Then in operation S323, data is requested from the M interfaces to obtain M data.
[0068] Continue to refer Figure 3 . After obtaining the M data, the M data resources are then processed into the first response data in operation S330. For example, the fields in the M data resources may be reduced or merged according to the format of the response data of the first type of terminal device 101 to obtain the first response data. For example, the M data resources are data resources set for computer terminals. When a mobile terminal requests these data, the data of the same field in the M data resources may be merged according to the data layout, data field and format of the mobile terminal, and some fields that may not be needed by the mobile terminal may be deleted.
[0069] Next, in operation S340 , the first response data is fed back to the first type terminal device 101 , thereby enabling the first type terminal device 101 to access the backend service 104 .
[0070] In this way, the gateway 103 can be used as a traffic gate between the first-class terminal device 101 and the back-end service 104. By aggregating multiple interface query services of the back-end service 104, the number of network connections and accesses between the first-class terminal device 101 and the back-end service 104 can be reduced, thereby improving the request efficiency of the first-class terminal device 101 and enhancing the compatibility and extensibility of the existing back-end service 104 to the first-class terminal device 101.
[0071] By shielding and converting the data access differences between the first type of terminal device 101 and the backend service 104 through the gateway 103, the development efficiency of the first type of terminal device 101 can be simplified, and the backend service 104 can be reused. Moreover, through configuration, the data message of the backend service 104 can be deleted for the first type of terminal device 101, reducing the workload and maintenance cost of developers.
[0072] Figure 5 The flowchart of a data access method according to another embodiment of the present disclosure is schematically shown.
[0073] like Figure 5 As shown, the data access method according to the embodiment of the present disclosure may further include operation S510 before operation S310 to operation S340. Furthermore, in some other embodiments, after operation S510 and before operation S310, operation S520 may be included.
[0074] Specifically, in operation S510, forwarding configuration information is configured in the gateway 103, wherein the forwarding configuration information includes a correspondence between each interface in the gateway 103 and at least one interface of the backend service 104, wherein each interface in the gateway 103 is called by the first type of terminal device 101 through the network address in the access request. The first interface in the gateway 103 called by the first access request corresponds to M interfaces of the backend service 104.
[0075] Next, when the first type of terminal device 101 sends a first access request, the backend service 104 may be accessed through the gateway 103 through operations S310 to S340.
[0076] In other embodiments, after the forwarding configuration information is configured in operation S510, if the forwarding configuration information needs to be modified (for example, a change in business requirements causes the forwarding configuration information to be added, deleted, or modified, etc.), it can be achieved in real time through operation S520.
[0077] Specifically, in operation S520, the forwarding configuration information is updated in real time based on the user's update operation on the forwarding configuration information. For example, in one embodiment, after the forwarding configuration information is saved and published, it can take effect in milliseconds and can be used without restarting the gateway 103, thus realizing dynamic configuration.
[0078] Therefore, if the first type of terminal device 101 sends the first access request after operation S520, forwarding of the access request, aggregation of backend data, and feedback of response data can be implemented based on the updated forwarding configuration information in operations S310 to S340.
[0079] According to the embodiments of the present disclosure, forwarding configuration information can be configured and modified using a visual interface, which is easy to operate and takes effect in real time, thereby improving the availability and durability of the system.
[0080] Figure 6 The following schematically shows a flow chart of a data access method according to another embodiment of the present disclosure.
[0081] like Figure 6 As shown, the data access method according to this embodiment may include operations S601 to S607.
[0082] In operation S601, a correspondence between a first interface and M interfaces is configured in forwarding configuration information of the gateway 103, wherein when there is a logical sequence between the M interfaces, the M interfaces are arranged and configured according to the logical sequence of the M interfaces.
[0083] Next, when the first type terminal device 101 sends a first access request, first in operation S602, the first access request sent by the first type terminal device 101 is received.
[0084] Then in operation S603, based on the network address of the first access request, the first interface in the gateway 103 is called.
[0085] Next, in operation S604, based on the forwarding configuration information, M interfaces in the backend service 104 corresponding to the first interface are determined.
[0086] Then in operation S605, data is requested from the M interfaces in sequence according to a logical order.
[0087] Next, in operation S606, the M data resources are processed into first response data. For details, please refer to the relevant description of operation S330, which will not be repeated here.
[0088] Then in operation S607, the first response data is fed back to the first type terminal device 101. Thus, through one access of the first type terminal device 101, multiple access data can be obtained from the backend service 104, reducing the access frequency of the first type terminal device 101 and improving the access efficiency of the first type terminal device 101.
[0089] Based on the data access methods of the above embodiments, the present disclosure also provides a data access device. Figure 7 The data access device according to the embodiment of the present disclosure is described in detail.
[0090] Figure 7 A block diagram of a data access device 700 according to an embodiment of the present disclosure is schematically shown.
[0091] like Figure 7 As shown, according to an embodiment of the present disclosure, the data access device 700 is set in the gateway 103, and can include a routing forwarding module 710, a query aggregation module 720, and a background configuration module 730. The device 700 can be used to implement reference Figure 3 to Figure 6 The method described.
[0092] The routing and forwarding module 710 is mainly responsible for the basic communication configuration and traffic forwarding between the first type of terminal device 101 and the backend service 104. Specifically, after receiving the first access request sent by the first type of terminal device 101, the routing and forwarding module 710 dynamically processes the request message and sends the processed data to the backend service 104 according to the forwarding configuration information obtained. After the backend service 104 receives the request, it processes the data and returns it. Then, the routing and forwarding module 710 performs operations such as adaptation and message processing on the response message and returns it to the first type of terminal device 101.
[0093] The routing and forwarding module 710 may include a receiving module 711 , a calling module 712 and a sending module 713 .
[0094] Specifically, the receiving module 711 may, for example, execute operation S310 or operation S602 to receive a first access request sent by the first-category terminal device 101 .
[0095] The calling module 712 can, for example, execute operation S320 or operation S603 to operation S605, and is used to request data resources from M interfaces of the backend service 104 based on the first access request and the forwarding configuration information of the gateway 103 for the access request of the first type of terminal device 101, so as to obtain M data resources; wherein M is an integer greater than 1; wherein the backend service 104 is a service platform developed for the second type of terminal device 102, and the first type of terminal device 101 and the second type of terminal device 102 are of different types.
[0096] The sending module 713 may, for example, execute operation S340 or operation S607 to feed back the first response data aggregated by the query aggregation module 720 to the first type of terminal device 101 .
[0097] The query aggregation module 720 can aggregate and organize the data obtained from multiple interfaces of the backend service 104 according to the interface correspondence in the forwarding configuration information, and then transfer it to the routing forwarding module 710 and return it to the first type of terminal device 101 through a single route, thereby reducing network resource consumption and the number of requests between the first type of terminal device 101 and the gateway 103.
[0098] Specifically, the query aggregation module 720 can, for example, perform operation S330 or operation S606 to process the M data resources into the first response data. For example, the M data resources are aggregated and sorted into a large result data and returned to the first type of terminal device 101, wherein the message fields of the M data resources can be reduced and merged according to the format requirements of the first type of terminal device 101 for the response data, thereby reducing the number of requests of the first type of terminal device 101 to the backend service 104, and reducing the data size of the response message, thereby improving the response speed of the first type of terminal device 101 and improving the user experience.
[0099] The background configuration module 730 can provide configuration support for the routing forwarding module 710 and the query aggregation module 720, provide an operation interface for the administrator, modify the configuration information according to environmental changes and the operations of the administrator, and persist the forwarding configuration information and basic data used by the gateway 103.
[0100] Specifically, the background configuration module 730 can, for example, perform operation S510 to configure forwarding configuration information in the gateway 103, wherein the forwarding configuration information includes a correspondence between each interface in the gateway 103 and at least one interface of the backend service 104, wherein each interface in the gateway 103 is called by the first type of terminal device 101 through the network address in the access request; wherein the first interface in the gateway 103 called by the first access request corresponds to M interfaces of the backend service 104.
[0101] According to some embodiments of the present disclosure, the background configuration module 730 may also perform operation S601, for example, to arrange and configure the M interfaces in a logical order in the correspondence between the first interface and the M interfaces when there is a logical order between the M interfaces.
[0102] According to some embodiments of the present disclosure, the background configuration module 730 may further perform operation S520, for example, to update the forwarding configuration information in real time based on the user's update operation on the forwarding configuration information.
[0103] The background configuration module 730 can provide functions such as data configuration and parameter modification for the routing forwarding module 710 and the query aggregation module 720 in a visual manner. For example, the background configuration module 730 can provide a configurable user interface for the routing forwarding module 710 and the query aggregation module 720, receive configuration operations from administrators, save the information to the database after processing, and then provide it to the routing forwarding module 710 and the query aggregation module 720 for access when the gateway 103 is running. In one embodiment, after the background configuration module 730 saves and publishes the configuration information, it can take effect at the millisecond level, and the new configuration can be used for routing forwarding and query aggregation without restarting the gateway 103, realizing flexible dynamic configuration capabilities.
[0104] According to an embodiment of the present disclosure, any multiple modules in the routing forwarding module 710, the query aggregation module 720, and the background configuration module 730 can be combined in one module for implementation, or any one of the modules can be split into multiple modules (for example, the routing forwarding module 710 can be split into three modules: a receiving module 711, a calling module 712, and a sending module 713, which is only an example). Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the routing forwarding module 710, the query aggregation module 720, and the background configuration module 730 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware or in an appropriate combination of any of them. Alternatively, at least one of the routing forwarding module 710, the query aggregation module 720, and the background configuration module 730 may be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function may be performed.
[0105] Figure 8 The block diagram of an electronic device 800 suitable for implementing the data access method according to an embodiment of the present disclosure is schematically shown. The electronic device 800 may be arranged in the gateway 103 .
[0106] like Figure 8As shown, the electronic device 800 according to an embodiment of the present disclosure includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 to a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include an onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0107] In RAM 803, various programs and data required for the operation of electronic device 800 are stored. Processor 801, ROM 802 and RAM 803 are connected to each other via bus 804. Processor 801 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 802 and / or RAM 803. It should be noted that the program can also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in one or more memories.
[0108] According to an embodiment of the present disclosure, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to the bus 804. The electronic device 800 may further include one or more of the following components connected to the I / O interface 805: an input portion 806 including a keyboard, a mouse, etc.; an output portion 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 808 including a hard disk, etc.; and a communication portion 809 including a network interface card such as a LAN card, a modem, etc. The communication portion 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage portion 808 as needed.
[0109] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0110] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 802 and / or RAM 803 described above and / or one or more memories other than ROM 802 and RAM 803.
[0111] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the method provided by the embodiment of the present disclosure.
[0112] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 801. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0113] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 809, and / or installed from a removable medium 811. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0114] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0115] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0116] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0117] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0118] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A data access method, applied to a gateway, comprising: receiving a first access request sent by a first type of terminal device; Based on the first access request and the forwarding configuration information of the gateway for the access request of the first type of terminal device, request data resources from M interfaces of the backend service to obtain M data resources; wherein M is an integer greater than 1; wherein the forwarding configuration information includes a correspondence between each interface in the gateway and multiple interfaces of the backend service, wherein each interface in the gateway is called by the first type of terminal device through the network address in the access request; Processing the M data resources into first response data; and Feeding back the first response data to the first type of terminal device; The requesting data resources from M interfaces of a backend service based on the first access request and the forwarding configuration information of the gateway for the access request of the first type of terminal device to obtain M data resources includes: Based on the network address of the first access request, calling a first interface in the gateway; Based on the forwarding configuration information, determining the M interfaces in the backend service corresponding to the first interface; and Request data from the M interfaces to obtain the M data; Among them, the back-end service is a service platform developed for the second type of terminal devices, and the first type of terminal devices and the second type of terminal devices are of different types; wherein the user is more sensitive to the response time when using the first type of terminal devices than when using the second type of terminal devices.
2. The method according to claim 1, wherein: The difference between the types of the first-category terminal device and the second-category terminal device includes: the second-category terminal device and the first-category terminal device are used in different ways by users.
3. The method according to claim 1 or 2, wherein: The first type of terminal device is a mobile terminal, and the second type of terminal device is a personal computer.
4. The method according to claim 1, wherein: The processing of the M data resources into first response data includes: According to the format of the response data of the first type of terminal equipment, the fields in the M data resources are reduced or merged to obtain the first response data.
5. The method according to claim 1, wherein: The method further comprises: The forwarding configuration information is configured in the gateway.
6. The method according to claim 5, wherein: The M interfaces have a logical order; and configuring the forwarding configuration information in the gateway includes: In the correspondence between the first interface and the M interfaces, the M interfaces are arranged and configured according to the logical order.
7. The method according to claim 6, wherein: The requesting of data resources from the M interfaces of the backend service includes: Data is requested from the M interfaces in sequence according to the logical order.
8. The method according to claim 5, wherein: The method further comprises: Based on the user's update operation on the forwarding configuration information, the forwarding configuration information is updated in real time.
9. A data access device, arranged in a gateway, wherein: The device includes a routing forwarding module and a query aggregation module, wherein the routing forwarding module includes a receiving module, a calling module and a sending module; wherein, The receiving module is used to receive a first access request sent by a first type of terminal device; The calling module is used to request data resources from M interfaces of the backend service based on the first access request and the forwarding configuration information of the gateway for the access request of the first type of terminal device, so as to obtain M data resources; wherein M is an integer greater than 1; wherein the backend service is a service platform developed for the second type of terminal device, and the first type of terminal device and the second type of terminal device are of different types; wherein the user is more sensitive to the response time when using the first type of terminal device than when using the second type of terminal device; wherein the forwarding configuration information includes a correspondence between each interface in the gateway and multiple interfaces of the backend service, wherein each interface in the gateway is called by the first type of terminal device through the network address in the access request; The query aggregation module is used to process the M data resources into first response data; and The sending module is used to feed back the first response data to the first type of terminal device; Wherein, the calling module is specifically used for: Based on the network address of the first access request, calling a first interface in the gateway; Based on the forwarding configuration information, determining the M interfaces in the backend service corresponding to the first interface; and Request data from the M interfaces to obtain the M data.
10. A data access system comprising: Category I terminal equipment; a second type of terminal device, which is different from the first type of terminal device; wherein the user is more sensitive to the response time when using the first type of terminal device than when using the second type of terminal device; Backend service, which is a service platform developed for the second type of terminal equipment; A gateway, which is used to forward information between the first type of terminal device and the backend service, including: receiving a first access request sent by a first type of terminal device; Based on the first access request and the forwarding configuration information of the gateway for the access request of the first type of terminal device, request data resources from M interfaces of the backend service to obtain M data resources; wherein M is an integer greater than 1; Processing the M data resources into first response data; and Feeding back the first response data to the first type of terminal device; The requesting data resources from M interfaces of a backend service based on the first access request and the forwarding configuration information of the gateway for the access request of the first type of terminal device to obtain M data resources includes: Based on the network address of the first access request, calling the first interface in the gateway; wherein each interface in the gateway is called by the first type of terminal device through the network address in the access request; Determine the M interfaces in the backend service corresponding to the first interface based on the forwarding configuration information; the forwarding configuration information includes a correspondence between each interface in the gateway and multiple interfaces of the backend service; and Request data from the M interfaces to obtain the M data.
11. An electronic device, comprising: one or more processors; one or more memories for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors execute the method according to any one of claims 1 to 8.
12. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Method for implementing protocol conversion by API gateway
CN108989356A
