CN109818836B - Service access method, device, computer equipment and computer storage medium - Google Patents

Service access method, device, computer equipment and computer storage medium Download PDF

Info

Publication number
CN109818836B
CN109818836B CN201811325359.0A CN201811325359A CN109818836B CN 109818836 B CN109818836 B CN 109818836B CN 201811325359 A CN201811325359 A CN 201811325359A CN 109818836 B CN109818836 B CN 109818836B
Authority
CN
China
Prior art keywords
service
client
background
disassembled
access
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811325359.0A
Other languages
Chinese (zh)
Other versions
CN109818836A (en
Inventor
韩亚洲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201811325359.0A priority Critical patent/CN109818836B/en
Publication of CN109818836A publication Critical patent/CN109818836A/en
Application granted granted Critical
Publication of CN109818836B publication Critical patent/CN109818836B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a service access method, a service access device, computer equipment and a computer storage medium, which relate to the field of micro-service architecture and can read services required to be called by a client from a relational database more conveniently, so that the service access time is saved. The method comprises the following steps: disassembling the background service in a field form to obtain disassembled service elements; acquiring a mapping relation between the disassembled service elements and the client information, and storing the mapping relation between the disassembled service elements and the client information into a relational database according to a preset binding rule; when a background service access request sent by a client is received, searching a plurality of service elements mapped with client information from the relational database according to the client information carried in the background service access request; determining background services corresponding to the service requests according to the service elements mapped with the client information; and pushing the service elements which are matched with the background service corresponding to the service request and are disassembled to the client so that the client can conveniently perform service access.

Description

Service access method, device, computer equipment and computer storage medium
Technical Field
The present invention relates to the field of micro service architecture, and in particular, to a service access method, apparatus, computer device, and computer storage medium.
Background
The API gateway is a server, is a unique entrance of the system, internally encapsulates a system internal architecture, provides a customized API for each client, can provide API access for a Web end and an APP end, and can also provide an API interface for the equipment of the Internet of things.
As the only entrance of all the clients, the API gateway can gather all the background services of the application program, and after the requests sent by all the clients are authenticated, checked and the like through the uniform API gateway, the requests are forwarded to the background services so that the API gateway calls the related background services API and returns the API to the clients, thereby realizing the service access of the clients.
In the actual application process, in order to facilitate the service access of the client, the API gateway configures each background service in a preset file in advance, and calls a corresponding background service API to return to the client according to the request content of the client. However, as the number of services increases, the service content carried by the preset file in the API gateway also increases, so that it is time consuming to read the service API to be called from many service contents, and errors are easy to occur, thereby increasing the difficulty in maintaining the services.
Disclosure of Invention
In view of the above, the present invention provides a service access method, a service access device, a computer device, and a computer storage medium, and mainly aims to solve the problem that the service access process in the related art is time-consuming and error-prone.
According to an aspect of the present invention, there is provided a service access method, including:
disassembling the background service in a field form to obtain disassembled service elements;
acquiring a mapping relation between the disassembled service elements and the client information, and storing the mapping relation between the disassembled service elements and the client information into a relational database according to a preset binding rule;
when a background service access request sent by a client is received, searching a plurality of service elements mapped with client information from the relational database according to the client information carried in the background service access request;
determining background services corresponding to the service requests according to the service elements mapped with the client information;
and pushing the service elements which are matched with the background service corresponding to the service request and are disassembled to the client so that the client can conveniently perform service access.
Further, the disassembling the background service in the form of a field to obtain disassembled service elements includes:
defining a splitting field according to the attribute parameters of the background service;
and disassembling the background service according to the disassembly field to obtain disassembled service elements.
Further, the obtaining the mapping relationship between the disassembled service element and the client information includes:
determining a mapping relation between the background service and the client information by inquiring whether the binding service exists in the background service;
and acquiring the mapping relation between the disassembled service elements and the client information according to the mapping relation between the platform service and the client information.
Further, the service request carries a unique identifier of a requested service, and determining, according to the plurality of service elements mapped with the client information, a background service corresponding to the service request includes:
searching for the unique identifier of the requested access service from the plurality of service elements mapped with the client information;
and taking the background service corresponding to the unique identification service of the request access service as the background service corresponding to the service request.
Further, before the pushing the service element corresponding to the service request after the background service is disassembled to the client, so that the client performs service access, the method further includes:
sending a pre-generated safety information table to the client for safety verification, wherein safety information required by the client is recorded in the safety information table;
and sending a request response of background service access to the client according to the received safety information fed back by the client.
Further, the sending a request response for background service access to the client according to the received security information fed back by the client includes:
when the safety information fed back by the client side meets the preset safety condition, sending a request response for agreeing to background service access to the client side;
and when the safety information fed back by the client side does not accord with the preset safety condition, sending a request response for rejecting background service access to the client side.
Further, before the parsing the background service in the form of a field to obtain parsed service elements, the method further includes:
and performing field division on the background services according to the service fields corresponding to the background services to obtain the background services in different fields.
In accordance with another aspect of the present invention, there is provided a service access apparatus, the apparatus comprising:
the disassembling unit is used for disassembling the background service in a field form to obtain disassembled service elements;
the acquiring unit is used for acquiring the mapping relation between the disassembled service elements and the client information and storing the mapping relation between the disassembled service elements and the client information into a relational database according to a preset binding rule;
the searching unit is used for searching a plurality of service elements mapped with the client information from the relational database according to the client information carried in the background service access request when the background service access request sent by the client is received;
the determining unit is used for determining the background service corresponding to the service request according to the plurality of service elements mapped with the client information;
and the access unit is used for pushing the service elements which are matched with the background service corresponding to the service request and are disassembled to the client so that the client can conveniently carry out service access.
Further, the disassembling unit includes:
the definition module is used for defining a splitting field according to the attribute parameters of the background service;
and the disassembling module is used for disassembling the background service according to the disassembling field to obtain disassembled service elements.
Further, the acquisition unit includes:
the first determining module is used for determining the mapping relation between the background service and the client information by inquiring whether the binding service exists in the background service;
and the obtaining module is used for obtaining the mapping relation between the disassembled service element and the client information according to the mapping relation between the platform service and the client information.
Further, the service request carries a unique identifier of a requested service, and the determining unit includes:
a searching module, configured to search the unique identifier of the requested access service from the plurality of service elements mapped with the client information;
and the second determining module is used for taking the background service corresponding to the unique identification service of the request access service as the background service corresponding to the service request.
Further, the apparatus further comprises:
a first sending unit, configured to send a pre-generated security information table to a client for security verification before the service element corresponding to the service request is pushed to the client so that the client performs service access, where the security information table records security information required by the client;
and the second sending unit is used for sending a request response of background service access to the client according to the received safety information fed back by the client.
Further, the second sending unit is specifically configured to send a request response for granting background service access to the client when the security information fed back by the client meets a preset security condition;
the second sending unit is specifically configured to send a request response for rejecting background service access to the client when the security information fed back by the client does not meet a preset security condition.
Further, the apparatus further comprises:
and the dividing unit is used for performing field division on the background service according to the service field corresponding to the background service to obtain background services in different fields before the background service is disassembled in the form of fields to obtain disassembled service elements.
According to yet another aspect of the invention, there is provided a computer device comprising a memory storing a computer program and a processor implementing the steps of the service access method when the processor executes the computer program.
According to yet another aspect of the invention, a computer storage medium is provided, having a computer program stored thereon, which, when being executed by a processor, carries out the steps of the service access method.
By the technical scheme, compared with the mode that each background service is configured in a preset file in advance and the corresponding background service is called according to the request content of the client in the prior art, the method and the device for accessing the service provided by the invention have the advantages that the background service is disassembled into the service elements in the form of fields, the service elements are respectively in mapping relation with the background service and the client after the disassembly, the mapping relation between the disassembled service elements and the client information is stored in the relational database according to the preset binding rule, the dynamic configuration mapping relation between different clients and the background service is realized, the maintenance difficulty of the background service is reduced, when the background service access request of the client is received, a plurality of service elements mapped with the client identification information corresponding to the background service access request are searched from the relational database, therefore, the background service corresponding to the service request is determined, the API gateway can read the background service required to be called by the client from the relational database more conveniently, the service elements obtained after the background service is disassembled are pushed to the client, the client can conveniently perform service access, and the service access time is saved.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic flow chart illustrating a service access method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of another service access method provided by the embodiment of the present invention;
fig. 3 is a schematic structural diagram of a service access apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of another service access device provided in the embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The embodiment of the invention provides a service access method, which can realize dynamic configuration of mapping relations between different clients and background services, and as shown in fig. 1, the method comprises the following steps:
101. and disassembling the background service in a field form to obtain disassembled service elements.
Because the background services are equivalent to necessary programs supporting the system to run, in the running process of the application program, the background services are mutually matched to realize different functions, the more the background services are, the higher the coupling degree of the system is, and the more time is consumed for subsequently calling the background services, wherein the service elements can be attribute parameters defined by the background services, such as a service field, a request address, a return type, a parameter name and the like.
For the embodiment of the present invention, the background service may be specifically disassembled into service elements in a field form according to defined attribute parameters, for example, the background service related to purchase management belongs to the field of purchase-sale-inventory management, and the background service related to purchase management is disassembled into a new purchase order, a purchase order query, a purchase return, a purchase detail table, and the like according to a core service supported by purchase management.
102. And acquiring the mapping relation between the disassembled service elements and the client information, and storing the mapping relation between the disassembled service elements and the client information into a relational database according to a preset binding rule.
Because the disassembled service elements are attribute parameters defined by the background service, one background service can correspond to a plurality of disassembled service elements. Each disassembled service element may correspond to a plurality of background services, and if the disassembled service element is the unique identifier of the background service, the service element corresponds to one background service.
For the embodiment of the invention, the mapping relationship between the background service and the client information can be obtained by checking whether the binding service with the client exists in the background service, and the mapping relationship between the disassembled service elements and the client information is further obtained because the background service corresponds to a plurality of disassembled service elements, and the mapping relationship between the disassembled service elements and the client information is stored in the relational database according to the preset binding rule.
The preset binding rule is equivalent to a mapping relation between the disassembled service element and client information, the client information mainly comprises a unique identifier of the client, and certainly can also comprise information such as a client name, a client address and the like, the relational database can be ORACLE, Sybase, SQL Server and the like, and the selection of the relational database is not limited in the embodiment of the invention. .
It should be noted that the mapping relationship between the disassembled service element and the client information is mainly based on the unique client identifier, and because of the uniqueness of the client identifier, a mapping relationship between the client and the disassembled service element can be established.
For example, the service names of the background services that the intelligent terminal device M can access are a1, a2, A3, etc., or the request addresses of the background servers that the PC terminal N can access are B1, B2, B3, etc., and the specific binding rule is not limited in the embodiment of the present invention.
For the embodiment of the invention, after the background service is disassembled into the service elements, the mapping relation between the disassembled service elements and the client information is stored in the relational database according to the preset binding rule. By establishing the relational database, the mapping relation between the client and the background service can be dynamically configured, and the maintenance difficulty of the background service is reduced.
103. When a background service access request sent by a client is received, searching a plurality of service elements mapped with client information from the relational database according to the client information carried in the background service access request.
The background service access request is a request for accessing the background service, which is sent by a client to an API gateway, and carries client information, such as a client name, a client address, and other information capable of identifying a client identity, and a unique client identifier.
For the embodiment of the present invention, the data table where the client information is located may be searched from the relational database through the unique client identifier, and a plurality of service elements mapped with the client information are further searched, for example, after a user initiates a login request on the mobile APP, the mobile APP sends a login request background service accessed to the background to the API gateway, because the mapping relationship between the unique identifier of the mobile APP and the service elements disassembled from the login request background service is stored in the relational database, the plurality of service elements disassembled from the login request background service mapped with the unique identifier of the mobile APP is searched from the relational database, which may specifically include a user login service, an IP address of the login service, a return type, and the like.
104. And determining the background service corresponding to the service request according to the plurality of service elements mapped with the client information.
For the embodiment of the present invention, since a plurality of service elements mapped with the client information may correspond to a plurality of background services, the background service corresponding to the service request needs to be determined from the plurality of background services,
105. and pushing the service elements which are matched with the background service corresponding to the service request and are disassembled to the client so that the client can conveniently perform service access.
For the embodiment of the present invention, since the relational database stores the mapping relationship between the disassembled background service and the client information, after a plurality of service elements mapped with the client information carried in the background access service request are further searched from the relational database, background services corresponding to the plurality of service elements are searched, and the corresponding background services are pushed to the client.
The invention provides a service access method, compared with the prior art that each background service is configured in a preset file in advance and the corresponding background service is called according to the request content of a client, the embodiment of the invention disassembles the background service into service elements in a field form, because the disassembled service elements respectively have mapping relations with the background service and the client, and stores the mapping relation between the disassembled service elements and client information into a relational database according to the preset binding rule, the dynamic configuration mapping relation between different clients and the background service is realized, the maintenance difficulty of the background service is reduced, when the background service access request of the client is received, a plurality of service elements mapped with the client identification information corresponding to the background service access request are searched from the relational database, so as to determine the background service corresponding to the service request, the API gateway can read the background service required to be called by the client from the relational database more conveniently, and pushes the service elements after the background service is disassembled to the client so that the client can perform service access, and the service access time is saved.
The embodiment of the present invention provides another service access method, which can more conveniently read a service to be called by a client from a relational database, and save service access time, as shown in fig. 2, the method includes:
201. and defining a splitting field according to the attribute parameters of the background service.
The attribute parameter of the background service may be a back parameter type, a service name, a request address, a version, and the like of the background service, which is not limited herein.
202. And disassembling the background service according to the disassembly field to obtain disassembled service elements.
For the embodiment of the present invention, specifically, in the process of disassembling the background services according to the split field, each background service has its own split field, and the background services can be disassembled into a plurality of service elements for different background services, where the service elements disassembled by different background services may be the same or different, for example, the unique identifiers of the background service a and the background service B are definitely different, and both the background service a and the background service B have the same version.
It should be noted that, because background services in the same service field have similarities on some service elements, to facilitate disassembling the background services, before disassembling the background services, the background services may also be subjected to field division according to the service field corresponding to the background services to obtain background services in different fields, and the background services in the same field are disassembled to improve the disassembling speed of the background services.
For the embodiment of the present invention, a memory may be created in a process between the service interface and the relational data database, and the service element is loaded to the background cache according to the cache function configured in the relational data database, for example, the field-form service element is stored to the corresponding cache interval by using a public cache such as redis or memcache. Specifically, when a client calls a service interface to send a background service access request, the service interface directly queries corresponding service elements in the redis, and if the service elements exist in the redis, the service elements are directly returned without querying a relational database; if the service element does not exist in the redis, searching in the relational database, and storing the searched service element in the redis. By adding a cache layer between the service interface and the relational database, the response speed of the client access is obviously improved.
203. And determining the mapping relation between the background service and the client information by inquiring whether the binding service exists in the background service or not.
In the process of calling the background service by the client each time, in order to facilitate service access of the client, a binding service can be created in the process of calling the background service by the client for the first time, the binding service is used for providing an interface used by the client for interacting with the server, so that the client realizes background service calling through the interface, for example, a weather forecast background service is defined, the background service can provide the binding service for a plurality of clients, and if the binding service is not created, the client cannot access the background service.
The client information includes information such as the type of the client and the unique identifier of the client. Because the number and the authority of the background services which can be accessed by different clients are different, whether the binding service exists in the background service is further inquired to obtain the mapping relation between the client information and the background service, so that the clients can be ensured to accurately finish service access operation, and access failure caused by exceeding the access number or having no access authority is avoided.
For the embodiment of the invention, the mapping relationship between the background service and the client information can be determined by checking whether the binding service with the client exists in the background service, if the binding service exists, the mapping relationship exists between the background service and the client, and if the binding service does not exist, the mapping relationship does not exist between the background service and the client.
204. And acquiring the mapping relation between the disassembled service elements and the client information according to the mapping relation between the platform service and the client information, and storing the mapping relation between the disassembled service elements and the client information into a relational database according to a preset binding rule.
Since the background service corresponds to a plurality of disassembled service elements, the mapping relationship between the disassembled service elements and the client is obtained according to the mapping relationship between the station service and the client information, for example, the service names of the background services that the mobile APP of the client identification information can access are a1, a2, A3, etc., or the request addresses of the background servers that the PC of the client identification can access are B1, B2, B3, etc., which is not limited herein.
It should be noted that, in order to facilitate a user to operate a background service in the relational database in real time, specifically, the service elements may be imported into a visualization tool, then the service elements that need to be visualized are selected, a corresponding visualization effect is determined, and the disassembled service elements stored in the relational database are visualized by the big data magic mirror cloud or the big data analysis cloud service tool, so as to update and observe the visualized service elements in real time.
205. When a background service access request sent by a client is received, searching a plurality of service elements mapped with client information from the relational database according to the client information carried in the background service access request.
Because the client information may be mapped with a plurality of background services, each background service is disassembled into service elements and stored in the relational database, the relational database can search the service elements after the disassembly of the plurality of background services, and thus a plurality of service elements mapped with the client information are obtained.
206. And searching the unique identification of the request access service from the plurality of service elements mapped with the client information.
For the embodiment of the invention, when the client sends the background service access request, the background service access request carries the background service content requested to be accessed, such as a request for acquiring data information, a request for checking commodity information and the like, and in order to ensure the accuracy of the background service access, the background service content requested to be accessed also comprises the unique identifier of the requested access service, and the unique identifier of the requested access service is further extracted from the background service content requested to be accessed. Since the service element comprises a service name, a service address, a unique identifier of the service and the like, the unique identifier of the service requested to be accessed is further searched from a plurality of service elements mapped with the client information.
207. And taking the background service corresponding to the unique identification service of the request access service as the background service corresponding to the service request.
For the embodiment of the invention, the background service can be determined through the unique identifier of the access request service, and the background service is the background service which is requested to be accessed by the client.
208. And sending a pre-generated safety information table to the client for safety verification, wherein safety information required by the client is recorded in the safety information table.
The safety information table comprises safety information such as client identification information, a client configuration channel, client request parameters and the like. Before the client accesses the background service, in order to ensure the security of background service access, the client and the background service are generally required to perform authentication of both sides, so as to improve the reliability of the whole service access process.
For the embodiment of the invention, specifically, in the process of sending the pre-generated safety information table to the client for safety verification, firstly, after receiving a service request sent by the client, the API gateway pre-generates the safety information table through an algorithm, and the safety information table is used for asking for safety information from the client and sending the safety information table to the client; and then, in order to obtain the trust of the background service, the client provides the client identification information, the client configuration channel, the client request parameter and other security information to the API gateway according to the security information table after receiving the security information table.
It should be noted that, in order to ensure the security in the transmission process of the security information table, the client may encrypt or sign the security information table before transmitting the security information table, on the other hand, the API gateway may decrypt or sign the security information table after receiving the security information table, and after the security authentication is passed, search for the service element associated with the client identification information corresponding to the background service access request from the relational database.
209. And sending a request response of background service access to the client according to the received safety information fed back by the client.
After receiving a safety information table filled with safety information fed back by the client, the safety information such as client identification information, a client configuration channel, client request parameters and the like can be obtained according to the safety information fed back by the client, safety verification is carried out on the client, further, corresponding requests for background service access are sent to the client according to the safety information fed back by the client,
for the embodiment of the invention, when the safety information fed back by the client side meets the preset safety condition, a request response of agreeing to background service access is sent to the client side; and when the safety zone information fed back by the client side does not accord with the preset safety condition, sending a request response for rejecting background service access to the client side. The preset security condition may be set, for example, all the security information in the returned security information must be matched with each other, or the returned security information cannot have a null value, and the like.
210. And pushing the service elements which are matched with the background service corresponding to the service request and are disassembled to the client so that the client can conveniently perform service access.
The invention provides a service access method, compared with the prior art that each background service is configured in a preset file in advance and the corresponding background service is called according to the request content of a client, the embodiment of the invention disassembles the background service into service elements in a field form, because the disassembled service elements respectively have mapping relations with the background service and the client, and stores the mapping relation between the disassembled service elements and client information into a relational database according to the preset binding rule, the dynamic configuration mapping relation between different clients and the background service is realized, the maintenance difficulty of the background service is reduced, when the background service access request of the client is received, a plurality of service elements mapped with the client identification information corresponding to the background service access request are searched from the relational database, so as to determine the background service corresponding to the service request, the API gateway can read the background service required to be called by the client from the relational database more conveniently, and pushes the service elements after the background service is disassembled to the client so that the client can perform service access, and the service access time is saved.
Further, as a specific implementation of the method shown in fig. 1, an embodiment of the present invention provides a service access apparatus, and as shown in fig. 3, the apparatus includes: disassembling unit 31, obtaining unit 32, searching unit 33, determining unit 34, and accessing unit 35.
The disassembling unit 31 may be configured to disassemble the background service in a field form to obtain disassembled service elements;
the obtaining unit 32 may be configured to obtain a mapping relationship between the disassembled service element and the client information, and store the mapping relationship between the disassembled service element and the client information in a relational database according to a preset binding rule;
the searching unit 33 may be configured to, when a background service access request sent by a client is received, search, according to client information carried in the background service access request, a plurality of service elements mapped with the client information from the relational database;
a determining unit 34, configured to determine, according to the plurality of service elements mapped with the client information, a background service corresponding to a service request;
the access unit 35 may be configured to push the service element, which is obtained by disassembling the background service corresponding to the service request, to the client, so that the client performs service access.
The invention provides a service access device, compared with the prior art that each background service is configured in a preset file in advance and the corresponding background service is called according to the request content of a client, the embodiment of the invention disassembles the background service into service elements in a field form, because the disassembled service elements respectively have mapping relations with the background service and the client, and stores the mapping relation between the disassembled service elements and client information into a relational database according to the preset binding rule, the dynamic configuration mapping relation between different clients and the background service is realized, the maintenance difficulty of the background service is reduced, when the background service access request of the client is received, a plurality of service elements mapped with the client identification information corresponding to the background service access request are searched from the relational database, so as to determine the background service corresponding to the service request, the API gateway can read the background service required to be called by the client from the relational database more conveniently, and pushes the service elements after the background service is disassembled to the client so that the client can perform service access, and the service access time is saved.
As a further description of the service access apparatus shown in fig. 3, fig. 4 is a schematic structural diagram of another service access apparatus according to an embodiment of the present invention, and as shown in fig. 4, the apparatus further includes:
the dividing unit 36 may be configured to perform domain division on the background service according to the service domain corresponding to the background service to obtain background services in different domains before the background service is disassembled in the form of a field to obtain a disassembled service element;
the first sending unit 37 may be configured to send a pre-generated security information table to the client for security verification before the service element corresponding to the service request is pushed to the client so as to facilitate service access by the client, where the security information table records security information required by the client;
the second sending unit 38 may be configured to send a request response of background service access to the client according to the received security information fed back by the client.
Further, the second sending unit 36 may be specifically configured to send a request response for granting background service access to the client when the security information fed back by the client meets a preset security condition;
the second sending unit 36 may be specifically configured to send a request response for rejecting background service access to the client when the security information fed back by the client does not meet a preset security condition.
Further, the disassembling unit 31 includes:
a defining module 311, configured to define a split field according to the attribute parameter of the background service;
the disassembling module 312 may be configured to disassemble the background service according to the disassembling field, so as to obtain disassembled service elements.
Further, the acquiring unit 32 includes:
a first determining module 321, configured to determine a mapping relationship between the background service and the client information by querying whether a binding service exists in the background service;
the obtaining module 322 may be configured to obtain a mapping relationship between the disassembled service element and the client information according to the mapping relationship between the platform service and the client information.
Further, the service request carries a unique identifier of a requested service, and the determining unit 34 includes:
a look-up module 341, configured to look up a unique identifier of the requested access service from the plurality of service elements mapped with the client information;
the second determining module 342 may be configured to use the background service corresponding to the unique identification service requesting to access the service as the background service corresponding to the service request.
It should be noted that other corresponding descriptions of the functional units related to the service access apparatus provided in the embodiment of the present invention may refer to the corresponding descriptions in fig. 1 and fig. 2, and are not described herein again.
Based on the methods shown in fig. 1 and fig. 2, correspondingly, an embodiment of the present invention further provides a storage device, on which a computer program is stored, and the program, when executed by a processor, implements the service access method shown in fig. 1 and fig. 2.
Based on the foregoing embodiments of the method shown in fig. 1 and fig. 2 and the virtual device shown in fig. 3 and fig. 4, to achieve the foregoing object, an embodiment of the present invention further provides an entity device for service access, where the entity device includes a storage device and a processor; the storage device is used for storing a computer program; the processor is configured to execute the computer program to implement the service access method shown in fig. 1 and fig. 2.
By applying the technical scheme of the invention, the background service is disassembled, the dynamic configuration mapping relationship between different clients and the background service is realized, the maintenance difficulty of the background service is reduced, and the API gateway can more conveniently read the service elements required to be called by the clients after the background service is disassembled from the relational database, so that the clients can conveniently access the service, and the service access time is saved.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present application can be implemented by hardware, and also by software plus a necessary general hardware platform. Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.), and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the implementation scenarios of the present application.
Those skilled in the art will appreciate that the figures are merely schematic representations of one preferred implementation scenario and that the blocks or flow diagrams in the figures are not necessarily required to practice the present application.
Those skilled in the art will appreciate that the modules in the devices in the implementation scenario may be distributed in the devices in the implementation scenario according to the description of the implementation scenario, or may be located in one or more devices different from the present implementation scenario with corresponding changes. The modules of the implementation scenario may be combined into one module, or may be further split into a plurality of sub-modules.
The above application serial numbers are for description purposes only and do not represent the superiority or inferiority of the implementation scenarios.
The above disclosure is only a few specific implementation scenarios of the present application, but the present application is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present application.

Claims (10)

1. A method for service access, comprising:
disassembling the background service in a field form to obtain disassembled service elements;
acquiring a mapping relation between the disassembled service elements and the client information, and storing the mapping relation between the disassembled service elements and the client information into a relational database according to a preset binding rule;
when a background service access request sent by a client is received, searching a plurality of service elements mapped with client information from the relational database according to the client information carried in the background service access request;
determining background services corresponding to the service requests according to the service elements mapped with the client information;
and pushing the service elements which are matched with the background service corresponding to the service request and are disassembled to the client so that the client can conveniently perform service access.
2. The method of claim 1, wherein the parsing the background service in the form of a field to obtain parsed service elements comprises:
defining a splitting field according to the attribute parameters of the background service;
and disassembling the background service according to the disassembly field to obtain disassembled service elements.
3. The method of claim 1, wherein the obtaining the mapping relationship between the disassembled service element and the client information comprises:
determining a mapping relation between the background service and the client information by inquiring whether the binding service exists in the background service;
and acquiring the mapping relation between the disassembled service elements and the client information according to the mapping relation between the platform service and the client information.
4. The method of claim 1, wherein the service request carries a unique identifier for requesting access to a service, and wherein determining the background service corresponding to the service request according to the plurality of service elements mapped with the client information comprises:
searching for the unique identifier of the requested access service from the plurality of service elements mapped with the client information;
and taking the background service corresponding to the unique identifier of the request access service as the background service corresponding to the service request.
5. The method according to claim 1, wherein before pushing the service elements corresponding to the service request after disassembling the background service to the client for service access by the client, the method further comprises:
sending a pre-generated safety information table to the client for safety verification, wherein safety information required by the client is recorded in the safety information table;
and sending a request response of background service access to the client according to the received safety information fed back by the client.
6. The method of claim 5, wherein the sending a request response for background service access to the client according to the received security information fed back by the client comprises:
when the safety information fed back by the client side meets the preset safety condition, sending a request response for agreeing to background service access to the client side;
and when the safety information fed back by the client side does not accord with the preset safety condition, sending a request response for rejecting background service access to the client side.
7. The method according to any of claims 1-6, wherein before said parsing the background service in the form of a field to obtain parsed service elements, the method further comprises:
and performing field division on the background services according to the service fields corresponding to the background services to obtain the background services in different fields.
8. A service access apparatus, the apparatus comprising:
the disassembling unit is used for disassembling the background service in a field form to obtain disassembled service elements;
the acquiring unit is used for acquiring the mapping relation between the disassembled service elements and the client information and storing the mapping relation between the disassembled service elements and the client information into a relational database according to a preset binding rule;
the searching unit is used for searching a plurality of service elements mapped with the client information from the relational database according to the client information carried in the background service access request when the background service access request sent by the client is received;
the determining unit is used for determining the background service corresponding to the service request according to the plurality of service elements mapped with the client information;
and the access unit is used for pushing the service elements which are matched with the background service corresponding to the service request and are disassembled to the client so that the client can conveniently carry out service access.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.
10. A computer storage medium on which a computer program is stored, characterized in that the computer program, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN201811325359.0A 2018-11-08 2018-11-08 Service access method, device, computer equipment and computer storage medium Active CN109818836B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811325359.0A CN109818836B (en) 2018-11-08 2018-11-08 Service access method, device, computer equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811325359.0A CN109818836B (en) 2018-11-08 2018-11-08 Service access method, device, computer equipment and computer storage medium

Publications (2)

Publication Number Publication Date
CN109818836A CN109818836A (en) 2019-05-28
CN109818836B true CN109818836B (en) 2021-12-14

Family

ID=66601881

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811325359.0A Active CN109818836B (en) 2018-11-08 2018-11-08 Service access method, device, computer equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN109818836B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112256452A (en) * 2020-10-21 2021-01-22 上海商汤智能科技有限公司 Service item determination method, device, equipment and storage medium of cloud service platform

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1813251A (en) * 2004-03-22 2006-08-02 网飞亚技术公司 A streaming based contents distribution network system and methods for splitting, merging and retrieving files
US8595267B2 (en) * 2011-06-27 2013-11-26 Amazon Technologies, Inc. System and method for implementing a scalable data storage service
CN102427480B (en) * 2011-12-31 2015-01-14 北京新媒传信科技有限公司 Application access method in a plurality of application service platform systems
CN107404508B (en) * 2016-05-20 2021-04-27 阿里巴巴集团控股有限公司 Client page access method, client and electronic equipment
CN107612950B (en) * 2016-07-11 2021-02-05 阿里巴巴集团控股有限公司 Method, device and system for providing service and electronic equipment
CN107645508A (en) * 2017-10-16 2018-01-30 深圳市买买提乐购金融服务有限公司 A kind of data handling system, method, client and server
CN107819861A (en) * 2017-11-16 2018-03-20 中国银行股份有限公司 Business data processing method, apparatus and system
CN108306877B (en) * 2018-01-30 2020-11-10 泰康保险集团股份有限公司 NODE JS-based user identity information verification method and device and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于微服务架构的电力云服务平台;杨俊伟等;《电力信息与通信技术》;20170115(第01期);12-16 *
智能终端运营管理系统之微服务架构改造实践;王卫国等;《信息技术与网络安全》;20181010(第10期);95-98 *

Also Published As

Publication number Publication date
CN109818836A (en) 2019-05-28

Similar Documents

Publication Publication Date Title
CN111522922B (en) Log information query method and device, storage medium and computer equipment
US20190158594A1 (en) System and apparatus to manage data using a peer-to-peer network and the blockchain
US8745088B2 (en) System and method of performing risk analysis using a portal
CN104506487B (en) The credible execution method of privacy policy under cloud environment
CN107169094B (en) Information aggregation method and device
CN110413595B (en) Data migration method applied to distributed database and related device
WO2018201887A1 (en) Data response method, apparatus, terminal device, and medium
CN109063077B (en) Data access method and device based on elastic search
CN106685949A (en) Container access method, container access device and container access system
CN109246078B (en) Data interaction method and server
CN109040337A (en) A kind of information query method, Edge Server and information query system
US10140347B2 (en) Exposing data to query generating applications using usage profiles
CN109151025B (en) Load balancing method and device based on URL, computer storage medium and equipment
CN108154024B (en) Data retrieval method and device and electronic equipment
CN109818836B (en) Service access method, device, computer equipment and computer storage medium
CN109558710B (en) User login method, device, system and storage medium
US20230325521A1 (en) Data processing method and apparatus based on blockchain network, device, and storage medium
US9648103B2 (en) Non-uniform file access in a distributed file system
CN113486060A (en) Data access processing method and device, storage medium and electronic equipment
CN111324799B (en) Search request processing method and device
CN103138922B (en) A kind of method, system and device of digital content transmissions
CN112835863A (en) Processing method and processing device of operation log
WO2017096886A1 (en) Content pushing method, apparatus and system
CN115599982A (en) Data query method and device of hybrid cloud
US10951600B2 (en) Domain authentication

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant