CN111723312A - Data calling method, device, medium and electronic equipment - Google Patents

Data calling method, device, medium and electronic equipment Download PDF

Info

Publication number
CN111723312A
CN111723312A CN202010568434.7A CN202010568434A CN111723312A CN 111723312 A CN111723312 A CN 111723312A CN 202010568434 A CN202010568434 A CN 202010568434A CN 111723312 A CN111723312 A CN 111723312A
Authority
CN
China
Prior art keywords
connection
service
micro
identifier
storage process
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.)
Pending
Application number
CN202010568434.7A
Other languages
Chinese (zh)
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.)
Taikang Asset Management Co ltd
Taikang Insurance Group Co Ltd
Original Assignee
Taikang Asset Management Co ltd
Taikang Insurance Group 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 Taikang Asset Management Co ltd, Taikang Insurance Group Co Ltd filed Critical Taikang Asset Management Co ltd
Priority to CN202010568434.7A priority Critical patent/CN111723312A/en
Publication of CN111723312A publication Critical patent/CN111723312A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention provides a data calling method, which comprises the following steps: receiving a micro-service identifier sent by a terminal; determining a storage process identifier corresponding to the micro service identifier according to the micro service identifier; calling a storage process corresponding to the storage process identifier according to the storage process identifier; determining parameter information of the micro service according to a storage process; sending the parameter information of the micro service to a terminal; receiving a service calling code generated by the terminal according to the micro-service identifier, the storage process identifier and the parameter information; the method can improve the efficiency of calling the business data without manually writing SQL language or memorizing the memory process by related personnel. The invention also provides a data calling device, a medium and electronic equipment.

Description

Data calling method, device, medium and electronic equipment
Technical Field
The invention relates to the technical field of data processing, in particular to a data calling method, a data calling device, a data calling medium and electronic equipment.
Background
With the rapid development of the internet, more and more data is generated. The user can call the data wanted by the user in the database. For example, a business person may use a database client to write SQL language to view form data in a database; front-end developers also need to view stored procedures in the database when viewing form data and note them down for packaging the presentation. All the storage processes in the database need to be manually backed down by personnel, and the query efficiency is low when the SQL language is complex or the storage processes are too many.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present invention and therefore may include information that does not constitute prior art known to a person of ordinary skill in the art.
Disclosure of Invention
Embodiments of the present invention provide a data calling method, apparatus, medium, and electronic device, so as to improve efficiency of querying data at least to a certain extent.
Additional features and advantages of the invention will be set forth in the detailed description which follows, or may be learned by practice of the invention.
According to a first aspect of the embodiments of the present invention, there is provided a data calling method, including: receiving a micro-service identifier sent by a terminal; determining a storage process identifier corresponding to the micro service identifier according to the micro service identifier; calling a storage process corresponding to the storage process identifier according to the storage process identifier; determining parameter information of the micro service according to a storage process; sending the parameter information of the micro service to a terminal; receiving a service calling code generated by the terminal according to the micro-service identifier, the storage process identifier and the parameter information; and calling the service data related to the micro service according to the service calling code, and sending the service data to the terminal.
In some embodiments of the present invention, when the stored procedure identifier corresponding to the micro service identifier is plural, the method further comprises: sending a plurality of stored process identifications to a terminal; and receiving a storage process identifier selected by a user, and calling a storage process corresponding to the storage process identifier selected by the user according to the storage process identifier selected by the user.
In some embodiments of the present invention, before determining the stored procedure identity corresponding to the micro service identity from the micro service identity, the method further comprises: calling a connection from the connection pool according to the request instruction, and establishing connection with the database based on the connection; recording the connection time of the connection and the database; recording the number of times of submitting request instructions through the connection; whether to close the connection is determined based on the connection time and/or number.
In some embodiments of the invention, determining whether to close the connection based on the connection time and/or the number of times comprises: when the connection time of the connection and the database is longer than the preset time, closing the connection; or when the number of times of submitting the request instruction through the connection is greater than the preset number of times, closing the connection; or when the connection time of the connection and the database is greater than the preset time and the number of times of submitting the request instruction through the connection is greater than the preset number of times, closing the connection.
In some embodiments of the invention, the method further comprises: when a request instruction is submitted through a connection, detecting whether the connection is in a connection state with the database; if the connection and the database are in a connection state, submitting the request instruction through the connection, or if the connection and the database are not in a connection state, calling a new connection from a connection pool based on the request instruction and reconnecting with the database based on the new connection; and deleting a connection from the connection pool, the connection being a connection that is not in a connected state with the database.
In some embodiments of the invention, the request instruction comprises any one or more of: the instruction for inquiring the stored process identification, the instruction for inquiring the stored process, the instruction for inquiring the parameter information and the instruction for calling the service data.
In some embodiments of the invention, before transmitting the service data to the terminal, the method further comprises: and respectively processing the header and the body of the business data to obtain the business data in a preset format, wherein the preset format is a dataframe in the pandas.
According to a second aspect of the embodiments of the present invention, there is provided a data calling method, including: receiving a micro-service identifier input by a user, sending the micro-service identifier to a server, so that the server determines a storage process identifier corresponding to the micro-service identifier according to the micro-service identifier, calls a storage process corresponding to the storage process identifier according to the storage process identifier, and determines parameter information of the micro-service according to the storage process; receiving a storage process identification and parameter information; a service calling code generated based on the micro-service identifier, the stored procedure identifier and the parameter information; sending a service calling code to the server so that the server calls the service data related to the micro service according to the service calling code; and receiving the service data and displaying the service data on the terminal.
In some embodiments of the present invention, when the stored procedure identifier corresponding to the micro service identifier is plural, the method further comprises: receiving a plurality of stored procedure identifications; and responding to the selection operation of the user on the plurality of stored process identifications, and sending the stored process identification selected by the user to the server so that the server calls the stored process corresponding to the stored process identification selected by the user according to the stored process identification selected by the user.
According to a third aspect of the embodiments of the present invention, there is provided a data call apparatus, including: the first receiving module is used for receiving the micro-service identifier sent by the terminal; the first determining module is used for determining a storage process identifier corresponding to the micro service identifier according to the micro service identifier; the first calling module is used for calling the storage process corresponding to the storage process identifier according to the storage process identifier; the second determining module is used for determining the parameter information of the micro service according to the storage process; the first sending module is used for sending the parameter information of the micro service to the terminal; the second receiving module is used for receiving a service calling code generated by the terminal according to the micro-service identifier, the storage process identifier and the parameter information; and the second calling module is used for calling the service data related to the micro-service according to the service calling code and sending the service data to the terminal.
In some embodiments of the present invention, when the stored procedure identifier corresponding to the micro service identifier is plural, the apparatus further comprises: the second sending module is used for sending a plurality of storage process identifiers to the terminal; and the third receiving module is used for receiving the storage process identifier selected by the user and calling the storage process corresponding to the storage process identifier selected by the user according to the storage process identifier selected by the user.
In some embodiments of the invention, the apparatus further comprises: the third calling module is used for calling a connection from the connection pool according to the request instruction and establishing connection with the database based on the connection; the first recording module is used for recording the connection time of the connection and the database; the second recording module is used for recording the times of submitting the request instruction through the connection; and the third determining module is used for determining whether to close the connection according to the connection time and/or the connection times.
In some embodiments of the invention, the apparatus further comprises: the detection module is used for detecting whether the connection is in a connection state with the database when a request instruction is submitted through the connection; the submitting module submits the request instruction through the connection if the connection and the database are in a connection state, or calls a new connection from the connection pool based on the request instruction and reconnects with the database based on the new connection if the connection and the database are not in the connection state; and a deletion module for deleting a connection from the connection pool, the connection being a connection not in a connected state with the database.
In some embodiments of the invention, the request instruction comprises any one or more of: the instruction for inquiring the stored process identification, the instruction for inquiring the stored process, the instruction for inquiring the parameter information and the instruction for calling the service data.
In some embodiments of the invention, the apparatus further comprises: and the processing module is used for respectively processing the header and the body of the business data to acquire the business data in a preset format, wherein the preset format is a dataframe in the pandas.
According to a fourth aspect of the embodiments of the present invention, there is provided a data call apparatus, including: the first receiving module is used for receiving the micro-service identification input by the user and sending the micro-service identification to the server, so that the server determines a storage process identification corresponding to the micro-service identification according to the micro-service identification, calls a storage process corresponding to the storage process identification according to the storage process identification and determines parameter information of the micro-service according to the storage process; the second receiving module is used for receiving the storage process identification and the parameter information; the generating module is used for generating a service calling code based on the micro-service identifier, the storage process identifier and the parameter information; the first sending module is used for sending the service calling code to the server so that the server calls the service data related to the micro service according to the service calling code; and the third receiving module is used for receiving the service data and displaying the service data on the terminal.
In some embodiments of the present invention, when the stored procedure identifier corresponding to the micro service identifier is plural, the apparatus further comprises: a fourth receiving module, configured to receive a plurality of stored procedure identifiers; and the second sending module is used for responding to the selection operation of the user on the plurality of stored process identifiers, and sending the stored process identifiers selected by the user to the server so that the server calls the stored process corresponding to the stored process identifier selected by the user according to the stored process identifier selected by the user.
According to a fifth aspect of embodiments of the present invention, there is provided an electronic apparatus, including: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the data call method of the first aspect or the data call method of the second aspect as in the above embodiments.
According to a sixth aspect of embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor implements the data calling method according to the first aspect or the data calling method according to the second aspect of the embodiments.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the technical scheme provided by some embodiments of the present invention, a micro-service identifier sent by a terminal is received, a storage procedure identifier corresponding to the micro-service identifier is determined according to the micro-service identifier, then a storage procedure corresponding to the storage procedure identifier is called according to the storage procedure identifier, parameter information of a micro-service is determined according to the storage procedure, and the parameter information of the micro-service is sent to the terminal, a service calling code generated by the terminal according to the micro-service identifier, the storage procedure identifier and the parameter information is received, service data related to the micro-service is called according to the service calling code, and the service data is sent to the terminal.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 depicts a schematic diagram of an exemplary system architecture to which a data call method or data call apparatus of an embodiment of the invention may be applied;
FIG. 2 schematically illustrates a flow diagram of a data call method applied to a server, according to an embodiment of the present invention;
FIG. 3 schematically illustrates a flow diagram of a data invocation method applied to a server in accordance with another embodiment of the present invention;
FIG. 4 schematically illustrates a flow diagram of a data invocation method applied to a server in accordance with another embodiment of the present invention;
FIG. 5 schematically illustrates a flow diagram of a data invocation method applied to a server in accordance with another embodiment of the present invention;
fig. 6 schematically shows a flowchart of a data call method applied to a terminal according to an embodiment of the present invention;
fig. 7 schematically shows a flowchart of a data call method applied to a terminal according to another embodiment of the present invention;
fig. 8 is a diagram schematically illustrating a data call method applied to a terminal according to an embodiment of the present invention;
FIG. 9 is a schematic diagram illustrating server and terminal interaction of the present invention;
FIG. 10 schematically shows a block diagram of a data invocation device applied to a server according to an embodiment of the present invention;
fig. 11 is a block diagram schematically illustrating a data call apparatus applied to a server according to another embodiment of the present invention;
fig. 12 is a block diagram schematically illustrating a data call apparatus applied to a server according to another embodiment of the present invention;
fig. 13 is a block diagram schematically illustrating a data call apparatus applied to a server according to another embodiment of the present invention;
fig. 14 is a block diagram schematically illustrating a data call apparatus applied to a server according to another embodiment of the present invention;
fig. 15 is a block diagram schematically illustrating a data call apparatus applied to a terminal according to an embodiment of the present invention;
fig. 16 is a block diagram schematically illustrating a data call apparatus applied to a terminal according to another embodiment of the present invention;
fig. 17 shows a schematic structural diagram of a computer system of an electronic device (server) suitable for implementing an embodiment of the present invention.
Fig. 18 shows a schematic structural diagram of a computer system of an electronic device (terminal) adapted to be used to implement an embodiment of the present invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations or operations have not been shown or described in detail to avoid obscuring aspects of the invention.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
Fig. 1 shows a schematic diagram of an exemplary system architecture to which a data call method or a data call apparatus of an embodiment of the present invention may be applied.
As shown in fig. 1, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. For example, server 105 may be a server cluster comprised of multiple servers, or the like.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may be various electronic devices having a display screen, including but not limited to smart phones, tablet computers, portable computers, desktop computers, and the like.
The server 105 may be a server that provides various services. For example, the server 105 may receive the micro-service identification sent by the terminal; determining a storage process identifier corresponding to the micro service identifier according to the micro service identifier; calling a storage process corresponding to the storage process identifier according to the storage process identifier; determining parameter information of the micro service according to a storage process; sending the parameter information of the micro service to a terminal; receiving a service calling code generated by the terminal according to the micro-service identifier, the storage process identifier and the parameter information; and calling the service data related to the micro service according to the service calling code, and sending the service data to the terminal, so that the efficiency of calling the service data can be improved to a certain extent.
In some embodiments, the data call method provided by the embodiments of the present invention is generally executed by the server 105, and accordingly, the data call device is generally disposed in the server 105. In other embodiments, some terminals may have similar functionality as the server to perform the method. Therefore, the data calling method provided by the embodiment of the invention is not limited to be executed at the server side.
Fig. 2 schematically shows a flowchart of a data call method applied to a server according to an embodiment of the present invention.
As shown in fig. 2, the data calling method applied to the server may include steps S210 to S270.
In step S210, the micro-service identity transmitted by the terminal is received.
In step S220, a stored procedure identifier corresponding to the micro service identifier is determined according to the micro service identifier.
In step S230, a stored procedure corresponding to the stored procedure identifier is called according to the stored procedure identifier.
In step S240, parameter information of the micro service is determined according to the storage procedure.
In step S250, parameter information of the micro service is transmitted to the terminal.
In step S260, a service invocation code generated by the terminal according to the micro-service identifier, the stored procedure identifier and the parameter information is received.
In step S270, the service data related to the micro service is called according to the service calling code, and the service data is sent to the terminal.
The method can receive the micro-service identification sent by a terminal, determine the storage process identification corresponding to the micro-service identification according to the micro-service identification, then call the storage process corresponding to the storage process identification according to the storage process identification, determine the parameter information of the micro-service according to the storage process, send the parameter information of the micro-service to the terminal, receive the service call code generated by the terminal according to the micro-service identification, the storage process identification and the parameter information, call the business data related to the micro-service according to the service call code, and send the business data to the terminal.
Referring to fig. 8, the micro-service id entered by the user on the terminal may be a1, for example, a1 may be (10.88.103.24, 19999) or (dashboard-data-risk). After the user input is completed, the server may receive the micro-service identification sent by the terminal, i.e., a 1.
In an embodiment of the present invention, when the server receives the micro service identifier, the server may determine, according to the micro service identifier, a stored procedure identifier corresponding to the micro service identifier. Referring to fig. 8, the stored procedure identification corresponding to the micro service identification may be a2, for example, a2 may be PUB _ query. In this embodiment, the corresponding storage process can be called through PUB _ query.
In an embodiment of the present invention, when the storing process is called, the parameter information of the micro service may be determined based on the storing process, and referring to fig. 8, the parameter information extracted from the storing process may be A3, and A3 may specifically be I _ BGNDATE, I _ ENDDATE, I _ LEVEL, I _ query _ STR. In this embodiment, the parameter information in the storage process is only shown schematically. Generally, in the actual process of calling service data, the called storage processes respectively include values of I _ BGNDATE, I _ ENDDATE, I _ LEVEL, and I _ query _ STR, and the specific values can be shown in the long-bar block in fig. 8.
In an embodiment of the present invention, when the server determines the parameter information of the micro service according to the above storage procedure, the parameter information may be sent to the terminal, so that the parameter information may be exhibited on the terminal, as shown in detail in a3 in fig. 8. Generally, in the actual process of calling service data, the called storage processes respectively include values of I _ BGNDATE, I _ ENDDATE, I _ LEVEL, and I _ query _ STR, and the specific values can be shown in the long-bar block in fig. 8.
In an embodiment of the present invention, when the number of the storage process identifiers determined according to the micro service identifier is 1, after the server determines the parameter information of the micro service according to the storage process corresponding to the storage process identifier, the storage process identifier and the parameter information of the micro service may be sent to the terminal, so that the storage process identifier and the parameter information of the micro service may be displayed on the terminal. In addition, when the number of the storage procedure identifiers determined according to the micro service identifier is greater than 1, the server may first send the multiple storage procedure identifiers to the terminal, so that the user may select, on the terminal, the storage procedure identifier related to the service data that the user wants to invoke from the multiple storage procedure identifiers, after the user selects, the server may receive the storage procedure identifier selected by the user, invoke the storage procedure corresponding to the storage procedure identifier selected by the user, then determine the parameter information of the micro service according to the storage procedure, and finally send the parameter information of the micro service to the terminal, so that the identifier of the storage procedure and the parameter information of the micro service are displayed on the terminal, specifically, as shown in fig. 8, a2 and A3.
In an embodiment of the present invention, after the terminal receives the stored procedure identifier and the parameter information of the micro service, the terminal may generate a service invocation code based on the micro service identifier, the stored procedure identifier and the parameter information of the micro service, which are input by the user, and at this time, the server may receive the service invocation code generated by the terminal according to the micro service identifier, the stored procedure identifier and the parameter information, may invoke the service data related to the micro service according to the service invocation code, and finally send the service data to the terminal, specifically, as a5 in fig. 8, a5 is the service data invoked by the user. The method for calling the business data does not need to write SQL language manually or memorize specific storage process manually, so that the efficiency of calling the data can be improved by calling the business data in the method. Referring to fig. 8, the service invocation code may be a4, e.g., a4 is tk. proxy ("dashboard-data-RISK") ("PUB _ query. pkg _ RISK _ REPORT _ kf. sp _ RISK _ NAV, { I _ BGNDATE, I _ ENDDATE, I _ LEVEL, I _ query _ STR }).
In an embodiment of the present invention, before transmitting the service data to the terminal, the method further includes: and respectively processing the header and the body of the business data to obtain the business data in a preset format, wherein the preset format is a dataframe in the pandas. The dataframe formatted service data in pandas may be adapted for further processing on a given platform. For example, business data in dataframe format may be further processed on the Jupyter platform.
Fig. 3 schematically shows a flowchart of a data call method applied to a server according to another embodiment of the present invention.
When the stored procedure identifier corresponding to the micro-service identifier is multiple, the data calling method applied to the server further includes steps S310 and S320, as shown in fig. 3.
In step S310, a plurality of stored procedure identifications are transmitted to the terminal.
In step S320, the stored procedure identifier selected by the user is received, and the stored procedure corresponding to the stored procedure identifier selected by the user is called according to the stored procedure identifier selected by the user.
In the method, when the number of the storage process identifications corresponding to the micro-service identification is multiple, the storage process identifications can be sent to the terminal, and the storage process identification selected by the user can be received after the user selects the storage process identifications, so that the storage process corresponding to the storage process identification selected by the user can be called according to the storage process identification selected by the user without the need of remembering the storage processes by the user.
In an embodiment of the present invention, when the number of the storage procedure identifiers determined according to the micro service identifier is greater than 1, the server may first send a plurality of storage procedure identifiers to the terminal, so that the user may select, on the terminal, a storage procedure identifier related to the service data that the user wants to invoke from the plurality of storage procedure identifiers, after the user selects, the server may receive the storage procedure identifier selected by the user, invoke a storage procedure corresponding to the storage procedure identifier selected by the user according to the storage procedure identifier selected by the user, then determine parameter information of the micro service according to the storage procedure, and finally send the parameter information of the micro service to the terminal, so that the identifier of the storage procedure and the parameter information of the micro service are displayed on the terminal, specifically, as shown in fig. 8, a2 and A3.
Fig. 4 schematically shows a flowchart of a data call method applied to a server according to another embodiment of the present invention.
Before determining the stored procedure id corresponding to the micro service id according to the micro service id, the data calling method applied to the server may include steps S410 to S440, as shown in fig. 4,
in step S410, a connection is called from the connection pool according to the request instruction, and a connection is established with the database based on the connection.
In step S420, the connection time of the connection with the database is recorded.
In step S430, the number of times the request instruction is submitted through the connection is recorded.
In step S440, it is determined whether to close the connection according to the connection time and/or number of times.
The method can call a connection from the connection pool according to the request instruction, and establish the connection with the database based on the connection, under the condition, the connection time of the connection and the database can be recorded in real time, and the times of submitting the request instruction through the connection can be recorded, so that whether the connection is closed or not can be determined according to the connection time and/or the times, the judgment mode can be coupled with a firewall, the connection pool can be coupled with the firewall of a certain enterprise, and the condition that the traditional connection pool is blocked by the firewall due to standby overtime or excessive submitted transaction times after being established is effectively avoided.
In one embodiment of the invention, the request instruction comprises any one or more of: the instruction for inquiring the stored process identification, the instruction for inquiring the stored process, the instruction for inquiring the parameter information and the instruction for calling the service data.
In one embodiment of the invention, a connection is called from the connection pool according to the request instruction, and a connection is established with the database based on the connection. For example, a connection is called from a connection pool according to an instruction of inquiring the stored procedure identification, the connection is established with the database based on the connection, and after the connection is established with the database based on the connection, the connection time of the connection with the database is recorded in real time and the number of times of submitting request instructions through the connection is recorded. For example, after the connection is established, other instructions, such as an instruction for querying a stored procedure, an instruction for querying parameter information, and an instruction for invoking service data, may be submitted through the called connection, and the number of submissions may be recorded in real time when the instructions are submitted, so as to determine whether to close the connection according to the connection time and/or the number of submissions. Additionally, in this embodiment, multiple threads may be employed to submit request instructions. For example, when multiple connections of the connection pool are simultaneously connected with the database, request instructions can be submitted to the multiple connections through multiple threads, so that the speed of processing the request instructions can be increased.
In some embodiments of the invention, determining whether to close the connection based on the connection time and/or the number of times comprises: when the connection time of the connection and the database is longer than the preset time, closing the connection; or when the number of times of submitting the request instruction through the connection is greater than the preset number of times, closing the connection; or when the connection time of the connection and the database is longer than the preset time and the number of times of submitting the request instruction through the connection is longer than the preset number of times, closing the connection, thus effectively avoiding the occurrence of the condition that the traditional connection pool is blocked by a firewall due to standby overtime or excessive submitted transaction number after being created.
Fig. 5 schematically shows a flowchart of a data call method applied to a server according to another embodiment of the present invention.
As shown in fig. 5, the data applied to the server calls a method to include steps S510 to S540.
In step S510, when a request instruction is submitted through a connection, it is detected whether the connection is in a connected state with the database.
In step S520, if the connection is in a connected state with the database, the request instruction is submitted through the connection.
Or
In step S510, when a request instruction is submitted through a connection, it is detected whether the connection is in a connected state with the database.
In step S530, if the connection is not in a connected state with the database, a new connection is called from the connection pool based on the request instruction, and the connection is reconnected with the database based on the new connection.
In step S540, a connection that is not in a connected state with the database is deleted from the connection pool.
In the method, after the connection is established with the database based on the called connection, when a request instruction is submitted through the connection each time, whether the connection is in a connection state with the database needs to be detected, so that the situation that no feedback exists after the instruction is submitted can be avoided. And if the connection is in a connection state with the database, submitting the request instruction through the connection. Or if the connection is not connected with the database, a new connection is called from the connection pool based on the request instruction, and is reconnected with the database based on the new connection, so that the request instruction submitted by the user can be ensured to be responded. At this time, the connection which is not in the connection state with the database before can be deleted from the connection pool, so that a good connection environment can be provided for the subsequent reconnection.
Fig. 6 schematically shows a flowchart of a data call method applied to a terminal according to an embodiment of the present invention.
As shown in fig. 6, the data calling method applied to the terminal includes steps S610 to S650.
In step S610, a micro service identifier input by a user is received, and the micro service identifier is sent to a server, so that the server determines a stored procedure identifier corresponding to the micro service identifier according to the micro service identifier, invokes a stored procedure corresponding to the stored procedure identifier according to the stored procedure identifier, and determines parameter information of the micro service according to the stored procedure.
In step S620, the stored procedure identification and parameter information is received.
In step S630, a service invocation code is generated based on the micro-service identifier, the stored procedure identifier and the parameter information.
In step S640, a service calling code is sent to the server, so that the server calls the service data related to the micro service according to the service calling code.
In step S650, the service data is received and presented on the terminal.
The method can receive the micro-service identification input by a user, then receive the storage process identification determined by the server based on the micro-service identification, receive the parameter information of the micro-service determined by the server according to the storage process corresponding to the storage process identification, and generate the service calling code based on the micro-service identification, the storage process identification and the parameter information, so that the user does not need to manually write SQL language or memorize the storage process by the user. And then sending a service calling code to the server so that the server calls the service data related to the micro-service according to the service calling code and displays the service data on the terminal, and the efficiency can be improved by calling the data in this way.
In one embodiment of the invention, when the server receives the micro-service identification input by the user, the server is enabled to automatically traverse all stored procedures and corresponding parameters in the database according to the micro-service identification, and then display the content related to the micro-service identification (for example, the stored procedure identification and the parameter information of the micro-service) on the terminal interface or the document interface. For example, the stored procedure list in the database is periodically traversed to obtain all the stored procedures in the database. And traversing the search parameter table according to the obtained storage process to obtain the name and the type of the input and output parameter information of the storage process. And returning the result to the micro service, and then calling the service data related to the micro service according to the micro service identification. In addition, the different parameter information is graphically displayed on the terminal through a rendering display, as shown in fig. 8 in particular.
Fig. 7 schematically shows a flowchart of a data call method applied to a terminal according to another embodiment of the present invention.
When the stored procedure identifier corresponding to the micro-service identifier is multiple, the data calling method applied to the terminal includes step S710 and step S720.
In step S710, a plurality of stored procedure identifications are received.
In step S720, in response to the user selecting operation on the plurality of stored procedure identifiers, the stored procedure identifier selected by the user is sent to the server, so that the server invokes the stored procedure corresponding to the stored procedure identifier selected by the user according to the stored procedure identifier selected by the user.
In the method, when the storage process identifiers corresponding to the micro-service identifiers are multiple, the multiple storage process identifiers sent by the server are received, the identifiers of the multiple storage processes can be displayed on the terminal, referring to fig. 8, a user can click an arrow at a2, so that the user can browse the multiple storage processes and select the storage process identifier related to the service data which the user wants to call, at the moment, the terminal can respond to the selection operation of the multiple storage process identifiers by the user and send the storage process identifier selected by the user to the server, so that the server calls the storage process corresponding to the storage process identifier selected by the user according to the storage process identifier selected by the user, and the user does not need to memorize the multiple storage processes.
FIG. 9 is a schematic diagram illustrating server and terminal interaction of the present invention;
as shown in fig. 9, when the user invokes the service data, the interaction process between the server and the terminal may include the following steps:
s1: the terminal receives the micro-service identification input by the user and sends the micro-service identification to the server.
S2: and the server determines a storage process identifier corresponding to the micro-service identifier according to the micro-service identifier and sends the identifier of the storage process to the terminal. It should be understood that there are a plurality of stored procedure identifications corresponding to the micro-service identification.
S3: the terminal receives the plurality of stored process identifications and responds to the selection operation of the user on the plurality of stored process identifications, and the stored process identifications selected by the user are sent to the server.
S4: and the server receives the storage process identification selected by the user and calls the storage process corresponding to the storage process identification selected by the user according to the storage process identification selected by the user.
S5: the server determines the parameter information of the micro-service according to the storage process and sends the parameter information of the micro-service to the terminal.
S6: and generating a service calling code by the terminal micro-service identifier, the storage process identifier and the parameter information, and sending the service calling code to the server.
S7: and the server receives the service calling code, calls the service data related to the micro-service according to the service calling code and sends the service data to the terminal.
S8: the terminal receives the service data, and displays the service data on an interface of the terminal, as shown in fig. 8.
Fig. 10 schematically shows a block diagram of a data call apparatus applied to a server according to an embodiment of the present invention.
As shown in fig. 10, the data invoking device 200 applied to the server includes a first receiving module 201, a first determining module 202, a first invoking module 203, a second determining module 204, a first sending module 205, a second receiving module 206, and a second invoking module 207.
Specifically, the first receiving module 201 is configured to receive a micro service identifier sent by a terminal.
The first determining module 202 is configured to determine, according to the micro service identifier, a storage procedure identifier corresponding to the micro service identifier.
And the first calling module 203 is configured to call the stored procedure corresponding to the stored procedure identifier according to the stored procedure identifier.
A second determining module 204, configured to determine parameter information of the micro service according to a stored procedure.
A first sending module 205, configured to send parameter information of the micro service to the terminal.
And a second receiving module 206, configured to receive a service invocation code generated by the terminal according to the micro-service identifier, the storage procedure identifier, and the parameter information.
And the second calling module 207 is configured to call service data related to the micro service according to the service calling code, and send the service data to the terminal.
The data invoking device 200 applied to the server may receive the micro-service identifier sent by the terminal, and determine the stored procedure identifier corresponding to the micro-service identifier according to the micro-service identifier, then, calling a storage process corresponding to the storage process identification according to the storage process identification, determining parameter information of the micro-service according to the storage process, and sends the parameter information of the micro service to the terminal, receives the service calling code generated by the terminal according to the micro service identification, the storage process identification and the parameter information, calling the service data related to the micro-service according to the service calling code and sending the service data to the terminal, in this way, the efficiency of calling the business data can be improved, the related personnel do not need to manually write SQL language or memorize and memorize the storage process, this can also eliminate SQL gaps when people without database operation experience call databases.
According to the embodiment of the present invention, the data calling apparatus 200 applied to the server may be used to implement the data calling method applied to the server described in the embodiment of fig. 2.
Fig. 11 is a block diagram schematically illustrating a data call apparatus applied to a server according to another embodiment of the present invention.
As shown in fig. 12, the data invoking device 200 applied to the server further includes a second sending module 208 and a third receiving module 209.
In particular, the second sending module 208 is configured to send a plurality of stored procedure identifications to the terminal.
And a third receiving module 209, configured to receive the stored procedure identifier selected by the user, and invoke the stored procedure corresponding to the stored procedure identifier selected by the user according to the stored procedure identifier selected by the user.
In the data invoking device 200 applied to the server, when a plurality of stored procedure identifiers corresponding to the micro-service identifier are provided, a plurality of stored procedure identifiers may be sent to the terminal, and the stored procedure identifier selected by the user may be received after the user selects the plurality of stored procedure identifiers, so that the stored procedure corresponding to the stored procedure identifier selected by the user may be invoked according to the stored procedure identifier selected by the user without the user remembering the plurality of stored procedures.
According to the embodiment of the present invention, the data calling apparatus 200 applied to the server may be used to implement the data calling method applied to the server described in the embodiment of fig. 3.
Fig. 12 is a block diagram schematically illustrating a data call apparatus applied to a server according to another embodiment of the present invention.
As shown in fig. 12, the data calling apparatus 200 applied to the server further includes a third calling module 210, a first recording module 211, a second recording module 212, and a third determining module 213.
Specifically, the third invoking module 210 is configured to invoke a connection from the connection pool according to the request instruction, and establish a connection with the database based on the connection.
A first recording module 211, configured to record a connection time of the connection with the database.
A second recording module 212, configured to record the number of times the request instruction is submitted through the connection.
A third determining module 213, configured to determine whether to close the connection according to the connection time and/or the connection times.
The data calling device 200 applied to the server can call a connection from the connection pool according to the request instruction, and establish a connection with the database based on the connection, in this case, the connection time of the connection and the database can be recorded in real time, and the number of times of submitting the request instruction through the connection can be recorded, so that whether to close the connection can be determined according to the connection time and/or the number of times.
According to the embodiment of the present invention, the data calling apparatus 200 applied to the server may be used to implement the data calling method applied to the server described in the embodiment of fig. 4.
Fig. 13 is a block diagram schematically illustrating a data call apparatus applied to a server according to another embodiment of the present invention.
As shown in fig. 13, the data call apparatus 200 applied to the server further includes a detection module 214, a submission module 215, and a deletion module 216.
Specifically, the detecting module 214 is configured to detect whether the connection is in a connection state with the database when the request instruction is submitted through the connection.
The submit module 215 submits the request instruction over the connection if the connection is in a connected state with the database, or invokes a new connection from the connection pool based on the request instruction and reconnects with the database based on the new connection if the connection is not in a connected state with the database.
A delete module 216 for deleting a connection from the connection pool, the connection being a connection not in a connected state with the database.
In the data calling device 200 applied to the server, after the connection is established with the database based on the called connection, each time a request instruction is submitted through the connection, it is required to detect whether the connection is in a connection state with the database, so that the situation that no feedback exists after the instruction is submitted can be avoided. And if the connection is in a connection state with the database, submitting the request instruction through the connection. Or if the connection is not connected with the database, a new connection is called from the connection pool based on the request instruction, and is reconnected with the database based on the new connection, so that the request instruction submitted by the user can be ensured to be responded. At this time, the connection which is not in the connection state with the database before can be deleted from the connection pool, so that a good connection environment can be provided for the subsequent reconnection.
According to the embodiment of the present invention, the data calling apparatus 200 applied to the server may be used to implement the data calling method applied to the server described in the embodiment of fig. 5.
Fig. 14 is a block diagram schematically illustrating a data call apparatus applied to a server according to another embodiment of the present invention.
As shown in fig. 14, the data calling apparatus 200 applied to the server further includes a processing module 217.
Specifically, the processing module 217 is configured to process the header and the body of the service data respectively to obtain the service data in a preset format, where the preset format is a dataframe in the pandas.
Fig. 15 schematically shows a block diagram of a data call apparatus applied to a terminal according to an embodiment of the present invention.
As shown in fig. 15, the data invoking device 300 applied to the terminal further includes a first receiving module 301, a second receiving module 302, a generating module 303, a first sending module 304, and a third receiving module 305.
Specifically, the first receiving module 301 is configured to receive a micro service identifier input by a user, and send the micro service identifier to a server, so that the server determines a stored procedure identifier corresponding to the micro service identifier according to the micro service identifier, invokes a stored procedure corresponding to the stored procedure identifier according to the stored procedure identifier, and determines parameter information of the micro service according to the stored procedure.
A second receiving module 302, configured to receive the stored procedure identification and the parameter information.
And the generating module 303 is used for generating a service calling code based on the micro-service identifier, the stored procedure identifier and the parameter information.
A first sending module 304, configured to send the service invocation code to the server, so that the server invokes the service data related to the micro service according to the service invocation code.
And a third receiving module 305, configured to receive the service data and display the service data on the terminal.
The data calling device 300 applied to the terminal can receive the micro-service identifier input by the user, then receive the storage process identifier determined by the server based on the micro-service identifier, receive the parameter information of the micro-service determined by the server according to the storage process corresponding to the storage process identifier, and generate the service calling code based on the micro-service identifier, the storage process identifier and the parameter information, so that the user does not need to manually write a language SQL or memorize the storage process by the user. And then sending a service calling code to the server so that the server calls the service data related to the micro-service according to the service calling code and displays the service data on the terminal, and the efficiency can be improved by calling the data in this way.
According to the embodiment of the present invention, the data calling apparatus 300 applied to the terminal may be used to implement the data calling method applied to the terminal described in the embodiment of fig. 6.
Fig. 16 schematically shows a block diagram of a data call apparatus applied to a terminal according to another embodiment of the present invention.
As shown in fig. 16, the data invoking device 300 applied to the terminal further includes a fourth receiving module 306 and a fourth receiving module 306.
In particular, the fourth receiving module 306 is configured to receive a plurality of stored procedure identifications.
The fourth receiving module 306 is configured to, in response to a user selecting operation on multiple stored procedure identifiers, send the stored procedure identifier selected by the user to the server, so that the server invokes, according to the stored procedure identifier selected by the user, the stored procedure corresponding to the stored procedure identifier selected by the user.
In the data invoking device 300 applied to the terminal, when the number of the storage process identifiers corresponding to the micro-service identifier is multiple, the multiple storage process identifiers sent by the server are received, the identifiers of the multiple storage processes can be displayed on the terminal, referring to fig. 8, a user can click an arrow at a2, so that the user can browse the multiple storage processes and select the storage process identifier related to the service data that the user wants to invoke, at this time, the terminal can respond to the selection operation of the multiple storage process identifiers by the user and send the storage process identifier selected by the user to the server, so that the server invokes the storage process corresponding to the storage process identifier selected by the user according to the storage process identifier selected by the user, and thus, the user does not need to memorize the multiple storage processes.
According to the embodiment of the present invention, the data calling apparatus 300 applied to the terminal may be used to implement the data calling method applied to the terminal described in the embodiment of fig. 7.
Referring now to FIG. 17, a block diagram of a computer system 400 suitable for use with the electronic device (server) used to implement an embodiment of the present invention is shown. The computer system 400 of the electronic device shown in fig. 17 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 17, the computer system 400 includes a Central Processing Unit (CPU)401 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage section 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for system operation are also stored. The CPU401, ROM 402, and RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
The following components are connected to the I/O interface 405: an input section 406 including a keyboard, a mouse, and the like; an output section 407 including a display device such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 408 including a hard disk and the like; and a communication section 409 including a network interface card such as a LAN card, a modem, or the like. The communication section 409 performs communication processing via a network such as the internet. A driver 410 is also connected to the I/O interface 405 as needed. A removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 410 as necessary, so that a computer program read out therefrom is mounted into the storage section 408 as necessary.
In particular, according to an embodiment of the present invention, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the invention include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 409, and/or installed from the removable medium 411. The above-described functions defined in the system of the present application are executed when the computer program is executed by a Central Processing Unit (CPU) 401.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device (server) is enabled to implement the data call method applied to the server as described in the above embodiments.
For example, the electronic device (server) may implement the following as shown in fig. 2: in step S210, the micro-service identity transmitted by the terminal is received. In step S220, a stored procedure identifier corresponding to the micro service identifier is determined according to the micro service identifier. In step S230, a stored procedure corresponding to the stored procedure identifier is called according to the stored procedure identifier. In step S240, parameter information of the micro service is determined according to the storage procedure. In step S250, parameter information of the micro service is transmitted to the terminal. In step S260, a service invocation code generated by the terminal according to the micro-service identifier, the stored procedure identifier and the parameter information is received. In step S270, the service data related to the micro service is called according to the service calling code, and the service data is sent to the terminal.
Referring now to FIG. 18, shown is a block diagram of a computer system 500 suitable for use with the electronic device (terminal) used to implement an embodiment of the present invention. The computer system 500 of the electronic device shown in fig. 18 is only an example, and should not bring any limitation to the function and the scope of use of the embodiments of the present invention.
As shown in fig. 18, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for system operation are also stored. The CPU501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to an embodiment of the present invention, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the invention include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The above-described functions defined in the system of the present application are executed when the computer program is executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device (terminal) is enabled to implement the data calling method applied to the terminal as described in the above embodiments.
For example, the electronic device (terminal) may implement the following as shown in fig. 6: in step S610, a micro service identifier input by a user is received, and the micro service identifier is sent to a server, so that the server determines a stored procedure identifier corresponding to the micro service identifier according to the micro service identifier, invokes a stored procedure corresponding to the stored procedure identifier according to the stored procedure identifier, and determines parameter information of the micro service according to the stored procedure. In step S620, the stored procedure identification and parameter information is received. In step S630, a service invocation code is generated based on the micro-service identifier, the stored procedure identifier and the parameter information. In step S640, a service calling code is sent to the server, so that the server calls the service data related to the micro service according to the service calling code. In step S650, the service data is received and presented on the terminal.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the invention. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiment of the present invention.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

1. A method for data invocation, the method comprising:
receiving a micro-service identifier sent by a terminal;
determining a storage process identifier corresponding to the micro service identifier according to the micro service identifier;
calling a storage process corresponding to the storage process identifier according to the storage process identifier;
determining parameter information of the micro service according to the storage process;
sending the parameter information of the micro service to the terminal;
receiving a service calling code generated by the terminal according to the micro-service identifier, the storage process identifier and the parameter information;
and calling the service data related to the micro service according to the service calling code, and sending the service data to the terminal.
2. The method of claim 1, wherein when the stored procedure identifier corresponding to the micro-service identifier is plural, the method further comprises:
sending a plurality of stored procedure identifications to the terminal;
receiving a storage process identifier selected by a user, and calling a storage process corresponding to the storage process identifier selected by the user according to the storage process identifier selected by the user.
3. The method of claim 1, wherein prior to determining the stored procedure identity corresponding to the microservice identity from the microservice identity, the method further comprises:
calling a connection from the connection pool according to the request instruction, and establishing connection with the database based on the connection;
recording the connection time of the connection and the database;
recording the times of submitting the request instruction through the connection;
and determining whether to close the connection according to the connection time and/or the times.
4. The method of claim 3, wherein determining whether to close the connection according to the connection time and/or the number of times comprises:
when the connection time of the connection and the database is longer than the preset time, closing the connection; or
When the times of submitting the request instructions through the connection are larger than the preset times, closing the connection; or
And when the connection time of the connection and the database is greater than the preset time and the times of submitting the request instruction through the connection are greater than the preset times, closing the connection.
5. The method of claim 3, further comprising:
detecting whether the connection is in a connection state with the database when the request instruction is submitted through the connection;
if the connection and the database are in a connection state, submitting the request instruction through the connection, or if the connection and the database are not in a connection state, calling a new connection from the connection pool based on the request instruction and reconnecting with the database based on the new connection; and
and deleting the connection from the connection pool, wherein the connection is not in a connection state with the database.
6. The method of claim 3, wherein the request instruction comprises any one or more of: the instruction for inquiring the stored process identification, the instruction for inquiring the stored process, the instruction for inquiring the parameter information and the instruction for calling the service data.
7. The method according to any one of claims 1 to 6, wherein before sending the service data to the terminal, the method further comprises:
and respectively processing the header and the body of the business data to obtain the business data in a preset format, wherein the preset format is a dataframe in the pandas.
8. A data call apparatus, comprising:
the first receiving module is used for receiving the micro-service identifier sent by the terminal;
the first determining module is used for determining a storage process identifier corresponding to the micro service identifier according to the micro service identifier;
the first calling module is used for calling the storage process corresponding to the storage process identifier according to the storage process identifier;
the second determining module is used for determining the parameter information of the micro service according to the storage process;
the first sending module is used for sending the parameter information of the micro service to the terminal;
the second receiving module is used for receiving a service calling code generated by the terminal according to the micro-service identifier, the storage process identifier and the parameter information;
and the second calling module is used for calling the service data related to the micro-service according to the service calling code and sending the service data to the terminal.
9. An electronic device, comprising:
one or more processors; and
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to carry out a method according to any one of claims 1 to 7.
10. A computer-readable medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method according to any one of claims 1 to 7.
CN202010568434.7A 2020-06-19 2020-06-19 Data calling method, device, medium and electronic equipment Pending CN111723312A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010568434.7A CN111723312A (en) 2020-06-19 2020-06-19 Data calling method, device, medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010568434.7A CN111723312A (en) 2020-06-19 2020-06-19 Data calling method, device, medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN111723312A true CN111723312A (en) 2020-09-29

Family

ID=72568403

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010568434.7A Pending CN111723312A (en) 2020-06-19 2020-06-19 Data calling method, device, medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111723312A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190182309A1 (en) * 2017-12-08 2019-06-13 Salesforce.Com, Inc. Apparatus and method for low-latency message request/response processing
CN109922158A (en) * 2019-03-22 2019-06-21 泰康保险集团股份有限公司 Data processing method, device, medium and electronic equipment based on micro services
CN111143352A (en) * 2019-11-28 2020-05-12 泰康保险集团股份有限公司 Data processing method and device, electronic equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190182309A1 (en) * 2017-12-08 2019-06-13 Salesforce.Com, Inc. Apparatus and method for low-latency message request/response processing
CN109922158A (en) * 2019-03-22 2019-06-21 泰康保险集团股份有限公司 Data processing method, device, medium and electronic equipment based on micro services
CN111143352A (en) * 2019-11-28 2020-05-12 泰康保险集团股份有限公司 Data processing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110708346B (en) Information processing system and method
CN110505141B (en) Instant messaging message processing method and device, readable medium and electronic equipment
WO2020143557A1 (en) Method and device for displaying information
JP2021103506A (en) Method and device for generating information
CN110489440B (en) Data query method and device
CN109359194B (en) Method and apparatus for predicting information categories
EP4113985A1 (en) Multimedia conference data processing method and apparatus, and electronic device
CN110519155B (en) Information processing method and system
CN109492200A (en) Cooperated documents restoring method, device, storage medium and electronic equipment
WO2022152018A1 (en) Method and device for identifying multiple accounts belonging to the same person
CN114513552B (en) Data processing method, device, equipment and storage medium
CN111427899A (en) Method, device, equipment and computer readable medium for storing file
CN114840379A (en) Log generation method, device, server and storage medium
CN110765752A (en) Test question generation method and device, electronic equipment and computer readable storage medium
CN113313623A (en) Watermark information display method, watermark information display device, electronic equipment and computer readable medium
CN105933417B (en) Consultation method and device
AU2018403361A1 (en) Data transmission
WO2022022473A1 (en) Information processing method and apparatus and electronic device
CN111723312A (en) Data calling method, device, medium and electronic equipment
CN112822089B (en) Method and device for adding friends
CN113486749A (en) Image data collection method, device, electronic equipment and computer readable medium
CN109614137B (en) Software version control method, device, equipment and medium
CN111125501B (en) Method and device for processing information
CN113568907A (en) Method, device, server and storage medium for processing station information message
CN112306596A (en) Information interaction method and device and electronic equipment

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