Data interaction methods, devices, and data service platforms
By introducing an intermediate layer server into the data service platform for interface transfer, and utilizing the intermediate layer interface identifier and backend service path, the problem of messy interface configuration between the front-end server and the back-end server is solved, thereby achieving server decoupling and reducing maintenance difficulty.
Patent Information
- Application Number
- CN202010359809.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-29
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2040-04-29
AI Technical Summary
In existing technologies, the interface configurations between front-end and back-end servers are often disorganized, leading to high server maintenance difficulty.
A data service platform is adopted, which uses an intermediate layer server to transfer interfaces between the front-end server and the back-end server. The intermediate layer interface identifier and the back-end service path are used to transfer requests, thereby decoupling the front-end server from the intermediate layer server and the intermediate layer server from the back-end server.
It simplifies server maintenance, reduces configuration complexity, and improves system flexibility and maintainability.
Smart Images

Figure CN113569172B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network service technology, and in particular to a data interaction method, apparatus, and data service platform. Background Technology
[0002] With the rapid development of the Internet, an increasing number of websites have emerged for users to access and obtain information. Simultaneously, the amount of information carried by each website is constantly increasing, and a single website contains more and more web pages, also known as subpages. Consequently, the number of servers used by a website is also increasing. Therefore, many websites currently use multiple servers, which can be categorized into front-end servers and back-end servers based on their purpose. The front-end server is primarily used for interactive operations with users, receiving user access commands, such as commands to access a specific subpage. The back-end server is mainly used for data extraction and retrieval, such as retrieving a specific subpage and displaying it to the user through the front-end server.
[0003] Currently, the development of website front-end servers and back-end servers is mostly separate, with data interaction between the two through Application Programming Interfaces (APIs). However, since large projects or websites typically have hundreds of APIs, the interface configurations between the front-end and back-end servers become very messy, leading to technical problems that make server maintenance difficult. Summary of the Invention
[0004] The purpose of this invention is to provide a data interaction method, apparatus, and data service platform to alleviate the technical problem of high maintenance difficulty of existing servers.
[0005] In a first aspect, embodiments of the present invention provide a data interaction method applied to a front-end server in a data service platform, wherein the data service platform further includes a middleware server and a back-end server;
[0006] The method includes:
[0007] Receive service access requests; wherein the service access requests include the middleware interface identifier and the backend service path;
[0008] Read the intermediate layer interface identifier from the service access request;
[0009] Based on the intermediate layer interface identifier, the service access request is forwarded to the corresponding intermediate layer server.
[0010] In one possible implementation, the step of reading the intermediate interface identifier in the service access request includes:
[0011] Read the path field of the service access request;
[0012] Extract the intermediate layer interface identifier from the path field.
[0013] In one possible implementation, the front-end server is an Nginx server.
[0014] Secondly, embodiments of the present invention also provide a data interaction method, applied to an intermediate layer server in a data service platform, wherein the data service platform further includes a front-end server and a back-end server;
[0015] The method includes:
[0016] Receive service access requests from the front-end server; wherein the service access request includes the middle-layer interface identifier and the back-end service path;
[0017] Read the backend service path from the service access request;
[0018] Based on the backend service path, the service access request is forwarded to the corresponding backend server.
[0019] In one possible implementation, the step of reading the backend service path in the service access request includes:
[0020] Read the path field of the service access request;
[0021] Extract the backend service path from the path field.
[0022] In one possible implementation, the intermediate layer server is an Nginx server.
[0023] Thirdly, embodiments of the present invention also provide a data interaction device applied to a front-end server in a data service platform, wherein the data service platform further includes a middle-layer server and a back-end server;
[0024] The device includes:
[0025] A receiving module is used to receive service access requests; wherein the service access request includes an intermediate layer interface identifier and a backend service path;
[0026] The reading module is used to read the intermediate layer interface identifier in the service access request;
[0027] The transfer module is used to transfer the service access request to the corresponding intermediate layer server according to the intermediate layer interface identifier.
[0028] Fourthly, embodiments of the present invention also provide a data interaction device applied to an intermediate layer server in a data service platform, wherein the data service platform further includes a front-end server and a back-end server;
[0029] The device includes:
[0030] The receiving module is used to receive service access requests from the front-end server; wherein the service access request includes the middle-layer interface identifier and the back-end service path;
[0031] The reading module is used to read the backend service path in the service access request;
[0032] The transfer module is used to transfer the service access request to the corresponding backend server according to the backend service path.
[0033] Fifthly, embodiments of the present invention also provide a data service platform, including a front-end server, a middleware server, and a back-end server;
[0034] The front-end server is equipped with the data interaction device described in the third aspect above.
[0035] The intermediate layer server is equipped with the data interaction device described in the fourth aspect above.
[0036] In a sixth aspect, embodiments of the present invention also provide a computer-readable storage medium storing machine-executable instructions, which, when invoked and executed by a processor, cause the processor to perform the method provided in the first or second aspect.
[0037] The data service platform provided in this embodiment of the invention includes a front-end server, a middleware server, and a back-end server. The front-end server interacts with users and receives service access requests from them; the back-end server extracts and invokes services or data; and the middleware server primarily serves as the interface between the front-end server and the back-end server.
[0038] When a front-end server receives a service access request, it can read the middleware interface identifier from it. This middleware interface identifier is uniquely associated with each middleware server; that is, each middleware server has a unique middleware interface identifier. Therefore, the front-end server can forward the service access request to the corresponding middleware server based on the middleware interface identifier. The middleware server can read the backend service path from the service access request. This backend service path indicates the domain name of the backend server, allowing the middleware server to forward the service access request to the corresponding backend server and invoke the service on the backend server.
[0039] In the data service platform provided by this invention, because the front-end server and the middle-layer server communicate only through the middle-layer interface identifier, the front-end server and the middle-layer server can be configured once and do not require maintenance when services change. The middle-layer server and the back-end server form a mapping relationship through the back-end service path. When a service changes, such as adding a new service, only a new domain name needs to be registered on the back-end server, and a corresponding new interface needs to be registered on the middle-layer server. Therefore, the data service platform provided by this invention decouples the front-end server and the back-end server, simplifying server maintenance and alleviating the technical problem of high server maintenance difficulty in existing systems. Attached Figure Description
[0040] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0041] Figure 1 A schematic diagram of a data service platform provided in an embodiment of the present invention;
[0042] Figure 2 A flowchart illustrating a data interaction method applied to a front-end server, as provided in an embodiment of the present invention;
[0043] Figure 3 This is a detailed flowchart of step S202 in an embodiment of the present invention;
[0044] Figure 4 A flowchart illustrating a data interaction method applied to a middleware server provided in an embodiment of the present invention;
[0045] Figure 5 This is a detailed flowchart of step S402 in an embodiment of the present invention;
[0046] Figure 6 A schematic diagram of a data interaction device applied to a front-end server provided in an embodiment of the present invention;
[0047] Figure 7 A schematic diagram of a data interaction device applied to a middleware server provided in an embodiment of the present invention;
[0048] Figure 8 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0049] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0050] The terms "comprising" and "having," and any variations thereof, used in the embodiments of this application, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.
[0051] As the amount of information carried by each website continues to increase, a website also contains more and more web pages, also known as subpages, and the number of servers used by the website also increases accordingly. Therefore, many websites now use multiple servers, which can be divided into front-end servers and back-end servers according to their purpose. The front-end server is mainly used for interactive operations with users, receiving user access commands, such as commands to access a specific subpage; the back-end server is mainly used for data retrieval and retrieval, such as retrieving a specific subpage and displaying it to the user through the front-end server.
[0052] Currently, the development of website front-end servers and back-end servers is mostly separate, with data interaction between the two through Application Programming Interfaces (APIs). However, since large projects or websites typically have hundreds of APIs, the interface configurations between the front-end and back-end servers become very messy, leading to technical problems that make server maintenance difficult.
[0053] The relevant technologies mainly employ the following two approaches:
[0054] 1. Specify the full path in the front-end server, for example, / / api.ksyun.com / dsMgQuery / getList
[0055] 2. Write the absolute path in the front-end server, for example, / / dsMgQuery / getList, and then forward it through the front-end server.
[0056] The first approach mentioned above will result in a large number of APIs with domain names, such as / / api.ksyun.com / dsMgQuery / getList, appearing on the website's pages. This will make server maintenance difficult later on and may also lead to cross-domain maintenance issues.
[0057] The second approach mentioned above, where / / dsMgQuery / getList is forwarded through the front-end server, results in the front-end server having many configuration files. In fact, a large service or project may have hundreds of configuration files, making maintenance more difficult than the first approach.
[0058] like Figure 1 As shown, this embodiment of the invention provides a data service platform, including a front-end server 101, a middleware server 102, and a back-end server 103. The front-end server 101 interacts with users and receives service access requests from users; the back-end server 103 extracts and invokes services or data; and the middleware server 102 primarily serves as the interface bridge between the front-end server 101 and the back-end server 103.
[0059] This data service platform can be a website, such as Kingsoft Cloud's website, with the domain name www.ksyun.com. When a user visits a page or a subpage of this website, data service interaction occurs through front-end servers, middleware servers, and back-end servers.
[0060] Accordingly, this embodiment of the invention also provides a data interaction method, applied to the front-end server in the aforementioned data service platform.
[0061] like Figure 2 As shown, this data interaction method includes the following steps:
[0062] S201: Receive service access request.
[0063] The service access request includes the middleware interface identifier and the backend service path. The middleware interface identifier is uniquely associated with the middleware server; that is, each middleware server has a unique middleware interface identifier.
[0064] S202: Read the intermediate interface identifier in the service access request.
[0065] When the front-end server receives a service access request from a user, it can read the middle-layer interface identifier from the service access request.
[0066] like Figure 3 As shown, in one possible implementation, step S202 may specifically include the following steps:
[0067] S2021: Read the path field of the service access request.
[0068] The path field is a field included in a service access request, for example:
[0069] / i / dsMgQuery / getList
[0070] / i / dsMgMd / createList
[0071] / i / di / editeList
[0072] / i / dataMap / query
[0073] These are all practical examples of path fields.
[0074] S2022: Extract the intermediate layer interface identifier from the path field.
[0075] The common part / i / in the above four path fields is the middleware interface identifier, which points to a unique middleware server. For example, the middleware interface identifier / i / points to the address of the middleware server i.api.ksyun.com.
[0076] The following paths, / dsMgQuery / getList, / dsMgMd / createList, / di / editeList, and / dataMap / query, belong to the backend service paths, and their specific functions will be described in detail below.
[0077] S203: Based on the middleware interface identifier, the service access request is forwarded to the corresponding middleware server.
[0078] Because there is a one-to-one correspondence between the middleware interface identifier and the middleware server, the front-end server can forward service access requests to the corresponding middleware server based on the middleware interface identifier.
[0079] As a possible implementation, the front-end server in this embodiment uses an Nginx server. Nginx (formerly known as engine x) is a high-performance HyperText Transfer Protocol (HTTP) and reverse proxy web server. It is also a lightweight web server, reverse proxy server, and email proxy server, released under a BSD-like license. Nginx is characterized by its low memory consumption and high concurrency capabilities, as its concurrency performance has already achieved excellent results among similar web servers.
[0080] In addition, the middleware server and backend server in the data service platform provided in this embodiment of the invention can also be Nginx servers.
[0081] Accordingly, this embodiment of the invention also provides a data interaction method, applied to the intermediate layer server in the aforementioned data service platform.
[0082] like Figure 4 As shown, this data interaction method includes the following steps:
[0083] S401: Receive service access requests from the front-end server.
[0084] Through the front-end server's relay, the middle-layer server obtains the service access request from the user. Of course, this service access request still contains the middle-layer interface identifier and the back-end service path.
[0085] S402: Read the backend service path in the service access request.
[0086] When the middleware server receives a request to access the service, it can read the backend service path from it.
[0087] like Figure 5 As shown, in one possible implementation, step S402 may specifically include the following steps:
[0088] S4021: Read the path field of the service access request.
[0089] Referring to the examples above, path fields include the following types:
[0090] / i / dsMgQuery / getList
[0091] / i / dsMgMd / createList
[0092] / i / di / editeList
[0093] / i / dataMap / query.
[0094] S4022: Extract the backend service path from the path field.
[0095] Of the four path fields above, excluding the middleware interface identifier ` / i / `, ` / dsMgQuery / getList`, ` / dsMgMd / createList`, ` / di / editeList`, and ` / dataMap / query` represent their respective backend service paths and names. Their corresponding backend service paths are...
[0096] dsMgQuery.server.api.ksyun.com
[0097] dsMgMd.server.api.ksyun.com
[0098] di.server.api.ksyun.com
[0099] dataMap.server.api.ksyun.com.
[0100] S403: Based on the backend service path, forward the service access request to the corresponding backend server.
[0101] The aforementioned backend service path indicates the domain name of the backend server corresponding to the service access request. Therefore, after the middleware server reads the backend service path from the service access request, it can forward the service access request to the corresponding backend server and call the service in the backend server.
[0102] The data service platform provided in this embodiment of the invention includes a front-end server, a middleware server, and a back-end server. The front-end server interacts with the user and receives service access requests input by the user through the methods described in steps S201-S203 above. The middleware server performs interface switching between the front-end server and the back-end server through the methods described in steps S401-S403 above. The back-end server is used to extract and invoke services or data.
[0103] When the front-end server receives a service access request, it can read the middleware interface identifier from it. Since each middleware server has a unique identifier, the front-end server can forward the service access request to the appropriate middleware server based on this identifier. Because the front-end server and the middleware server communicate only through the middleware interface identifier, both can be configured once and do not require further maintenance should service changes occur later.
[0104] When a middleware server receives a service access request from a frontend server, it can retrieve the backend service path from the request. This backend service path indicates the domain name of the backend server, allowing the middleware server to forward the service access request to the corresponding backend server and invoke the service there. Because a mapping relationship is established between the middleware server and the backend server through the backend service path, when a service changes, such as adding a new service, it is only necessary to register a new domain name on the backend server and a corresponding new interface on the middleware server.
[0105] Therefore, the data service platform provided by the embodiments of the present invention can decouple the front-end server and the back-end server, simplify the difficulty of server maintenance, and thus alleviate the existing technical problem of high server maintenance difficulty.
[0106] This invention also provides a data interaction device applied to the front-end server of the aforementioned data service platform.
[0107] like Figure 6 As shown, the data interaction device includes:
[0108] The receiving module 601 is used to receive service access requests. The service access request includes the middleware interface identifier and the backend service path.
[0109] The reading module 602 is used to read the intermediate layer interface identifier in the service access request.
[0110] The transfer module 603 is used to transfer service access requests to the corresponding intermediate layer server based on the intermediate layer interface identifier.
[0111] Accordingly, embodiments of the present invention also provide a data interaction device applied to the intermediate layer server in the aforementioned data service platform.
[0112] like Figure 7 As shown, the data interaction device includes:
[0113] The receiving module 701 is used to receive service access requests from the front-end server. The service access request includes the middleware interface identifier and the back-end service path.
[0114] The reading module 702 is used to read the backend service path in the service access request.
[0115] The transfer module 703 is used to transfer service access requests to the corresponding backend server according to the backend service path.
[0116] When the receiving module 601 of the front-end server receives a service access request, the reading module 602 can read the middleware interface identifier from it. Since the middleware interface identifier is uniquely associated with each middleware server (meaning each middleware server has a unique middleware interface identifier), the front-end server can use the forwarding module 603 to forward the service access request to the corresponding middleware server based on the middleware interface identifier. Because the front-end server and the middleware server communicate only through the middleware interface identifier, both the front-end server and the middleware server can be configured once and do not require further maintenance should service changes occur later.
[0117] When the receiving module 701 of the intermediate-layer server receives a service access request from the front-end server, the reading module 702 can read the backend service path from the service access request. This backend service path indicates the domain name of the backend server. Therefore, the transfer module 703 of the intermediate-layer server, based on the backend service path, forwards the service access request to the corresponding backend server and invokes the service on the backend server. Because a mapping relationship is formed between the intermediate-layer server and the backend server through the backend service path, when a service changes, such as adding a new service, it is only necessary to register a new domain name on the backend server and a corresponding new interface on the intermediate-layer server.
[0118] Therefore, the data service platform provided by the embodiments of the present invention can decouple the front-end server and the back-end server, simplify the difficulty of server maintenance, and thus alleviate the existing technical problem of high server maintenance difficulty.
[0119] Because the data interaction device for the front-end server and the data interaction device for the middle-layer server provided in the embodiments of the present invention have corresponding technical features as the data interaction method for the front-end server and the data interaction method for the middle-layer server provided in the above embodiments, they can also solve the same technical problems and achieve the same technical effects.
[0120] An electronic device provided in this application embodiment, such as Figure 8 As shown, the electronic device 800 includes a memory 801 and a processor 802. The memory stores a computer program that can run on the processor. When the processor executes the computer program, it implements the steps of the method provided in the above embodiments.
[0121] like Figure 8 As shown, the electronic device also includes a bus 803 and a communication interface 804. The processor 802, the communication interface 804, and the memory 801 are connected via the bus 803. The processor 802 is used to execute executable modules, such as computer programs, stored in the memory 801.
[0122] The memory 801 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 804 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc.
[0123] Bus 803 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 8 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0124] The memory 801 is used to store programs. After receiving an execution instruction, the processor 802 executes the program. The method executed by the apparatus defined by the process disclosed in any of the preceding embodiments of this application can be applied to the processor 802 or implemented by the processor 802.
[0125] The processor 802 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 802 or by instructions in software form. The processor 802 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 801, and processor 802 reads the information from memory 801 and, in conjunction with its hardware, completes the steps of the above method.
[0126] Corresponding to the above-described real-time data processing method, this application embodiment also provides a computer-readable storage medium storing machine-executable instructions. When the machine-executable instructions are invoked and executed by a processor, the machine-executable instructions cause the processor to perform the steps of the above-described real-time data processing method.
[0127] The real-time data processing apparatus provided in this application embodiment can be specific hardware on a device or software or firmware installed on the device. The implementation principle and technical effects of the apparatus provided in this application embodiment are the same as those in the foregoing method embodiments. For the sake of brevity, any parts not mentioned in the apparatus embodiment can be referred to the corresponding content in the foregoing method embodiments. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, apparatuses, and units described above can all be referred to the corresponding processes in the above method embodiments, and will not be repeated here.
[0128] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0129] For example, the division of units is merely a logical functional division; in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be indirect couplings or communication connections through some communication interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0130] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0131] In addition, the functional units in the embodiments provided in this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0132] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the real-time data processing method described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0133] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0134] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application. All should be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.
Claims
1. A data interaction method, characterized in that, A front-end server is used in a data service platform, which also includes a middle-layer server and a back-end server, wherein the middle-layer server uses an Nginx server; The intermediate layer server is used for interface switching between the front-end server and the back-end server; The method includes: Receive service access requests; wherein the service access requests include the middleware interface identifier and the backend service path; Read the intermediate layer interface identifier from the service access request; Based on the intermediate layer interface identifier, the service access request is forwarded to the corresponding intermediate layer server, so that the intermediate layer server forwards the service access request to the corresponding backend server according to the backend service path.
2. The method according to claim 1, characterized in that, The step of reading the intermediate interface identifier in the service access request includes: Read the path field of the service access request; Extract the intermediate layer interface identifier from the path field.
3. The method according to claim 1, characterized in that, The front-end server uses an Nginx server.
4. A data interaction method, characterized in that, An intermediate layer server used in a data service platform, wherein the intermediate layer server adopts an Nginx server, and the data service platform also includes a front-end server and a back-end server; The intermediate layer server is used for interface switching between the front-end server and the back-end server; The method includes: Receive service access requests from the front-end server; wherein the service access request includes the middle-layer interface identifier and the back-end service path; Read the backend service path from the service access request; Based on the backend service path, the service access request is forwarded to the corresponding backend server.
5. The method according to claim 4, characterized in that, The step of reading the backend service path in the service access request includes: Read the path field of the service access request; Extract the backend service path from the path field.
6. A data interaction device, characterized in that, A front-end server is used in a data service platform, which also includes a middle-layer server and a back-end server, wherein the middle-layer server uses an Nginx server; The intermediate layer server is used for interface switching between the front-end server and the back-end server; The device includes: A receiving module is used to receive service access requests; wherein the service access request includes an intermediate layer interface identifier and a backend service path; The reading module is used to read the intermediate layer interface identifier in the service access request; The transfer module is used to transfer the service access request to the corresponding intermediate layer server according to the intermediate layer interface identifier, so that the intermediate layer server transfers the service access request to the corresponding backend server according to the backend service path.
7. A data interaction device, characterized in that, An intermediate layer server used in a data service platform, wherein the intermediate layer server adopts an Nginx server, and the data service platform also includes a front-end server and a back-end server; The intermediate layer server is used for interface switching between the front-end server and the back-end server; The device includes: The receiving module is used to receive service access requests from the front-end server; wherein the service access request includes the middle-layer interface identifier and the back-end service path; The reading module is used to read the backend service path in the service access request; The transfer module is used to transfer the service access request to the corresponding backend server according to the backend service path.
8. A data service platform, characterized in that, It includes a front-end server, a middle-tier server, and a back-end server, wherein the middle-tier server uses an Nginx server; the middle-tier server is used for interface switching between the front-end server and the back-end server; The front-end server is equipped with the data interaction device described in claim 6 above; The intermediate layer server is equipped with the data interaction device described in claim 7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores machine-executable instructions that, when invoked and executed by a processor, cause the processor to perform the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
HTTP remote data access system and method
CN105554133A
Processing method and device for API request
CN108881448A