CN113760886A - Method, apparatus, device and computer readable medium for providing data service - Google Patents

Method, apparatus, device and computer readable medium for providing data service Download PDF

Info

Publication number
CN113760886A
CN113760886A CN202011159671.4A CN202011159671A CN113760886A CN 113760886 A CN113760886 A CN 113760886A CN 202011159671 A CN202011159671 A CN 202011159671A CN 113760886 A CN113760886 A CN 113760886A
Authority
CN
China
Prior art keywords
data
virtual
data request
instance
link
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.)
Granted
Application number
CN202011159671.4A
Other languages
Chinese (zh)
Other versions
CN113760886B (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.)
Beijing Jingdong Zhenshi Information Technology Co Ltd
Original Assignee
Beijing Jingdong Zhenshi Information Technology 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 Beijing Jingdong Zhenshi Information Technology Co Ltd filed Critical Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority to CN202011159671.4A priority Critical patent/CN113760886B/en
Publication of CN113760886A publication Critical patent/CN113760886A/en
Application granted granted Critical
Publication of CN113760886B publication Critical patent/CN113760886B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method, a device, equipment and a computer readable medium for providing data service, and relates to the technical field of computers. One embodiment of the method comprises: monitoring that an application system providing services to the outside is started, and acquiring an array of virtual hash sub-base sub-table main keys according to a routing forwarding rule; constructing a parameter value of the method of the example according to the array of the hash sub-base sub-table main key and the parameter type of the method of the example; executing the method of the example by combining the entry parameter of the method to construct a virtual data request; and submitting the virtual data request to a thread pool, and establishing a link with a data provider so as to provide data service. This embodiment can reduce the time-consuming first operation.

Description

Method, apparatus, device and computer readable medium for providing data service
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a computer-readable medium for providing data services.
Background
When the application system providing data service to the outside is started, a database and table dividing rule is generated. Then, the online service flow enters an application system and is dynamically routed to a designated table. And then the data is routed to the designated database through the designated table.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art: the first operation takes a particularly long time immediately after the application system is started.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a device, and a computer-readable medium for providing data services, which can reduce the time consumption of the first operation.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method of providing a data service, including:
monitoring that an application system providing services to the outside is started, and acquiring an array of virtual hash sub-base sub-table main keys according to a routing forwarding rule;
constructing a parameter value of the method of the example according to the array of the hash sub-base sub-table main key and the parameter type of the method of the example;
executing the method of the example by combining the entry parameter of the method to construct a virtual data request;
and submitting the virtual data request to a thread pool, and establishing a link with a data provider so as to provide data service.
After the submitting the virtual data request to the thread pool and establishing a link with a data provider, the method further includes:
and responding to the actual data request, and providing the data service based on the link with the data provider.
The actual data request corresponds to the same instance as the virtual data request.
The instance and the method of the instance are obtained from a configuration file.
The configuration file comprises an instance of the database connection operation and a method of the instance of the database connection operation, and an instance of the middleware and a method of the instance of the middleware.
The method for executing the example by combining the entry values of the method and constructing the virtual data request comprises the following steps:
and executing the method of the example through a reflection method, and transmitting the entry parameter value of the method to construct a virtual data request.
The submitting the virtual data request to a thread pool and establishing a link with a data provider includes:
and synchronously or asynchronously submitting the virtual data request to a thread pool, and establishing a link with a data provider.
According to a second aspect of the embodiments of the present invention, there is provided an apparatus for providing a data service, including:
the acquisition module is used for monitoring that an application system providing services for the outside is started and acquiring an array of virtual hash sub-base sub-table main keys according to a routing forwarding rule;
the parameter module is used for constructing the parameter value of the method of the example according to the array of the hash sub-base sub-table main key and the parameter type of the method of the example;
the request module is used for executing the method of the example by combining the entry parameter of the method and constructing a virtual data request;
and the establishing module is used for submitting the virtual data request to a thread pool and establishing a link with a data provider so as to provide data service.
According to a third aspect of the embodiments of the present invention, there is provided an electronic device providing a data service, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method as described above.
According to a fourth 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 method as described above.
One embodiment of the above invention has the following advantages or benefits: monitoring that an application system providing services to the outside is started, and acquiring an array of virtual hash sub-base sub-table main keys according to a routing forwarding rule; constructing the parameter value of the method of the example according to the array of the primary key of the Hash sub-library sub-table and the parameter type of the example; combining the entry parameter of the method, executing the method of the example, and constructing a virtual data request; and submitting the virtual data request to a thread pool, and establishing a link with a data provider to provide data service. Since the data service can be directly provided without establishing a connection with the data provider after the actual data request is received, time consumption for the first operation can be reduced.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram of a main flow of a method of providing a data service according to an embodiment of the present invention;
FIG. 2 is a schematic flow diagram of building a virtual data request according to an embodiment of the invention;
FIG. 3 is a schematic flow chart of a conventional method for providing data services;
FIG. 4 is a schematic flow chart of providing data services according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a main structure of an apparatus for providing a data service according to an embodiment of the present invention;
FIG. 6 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 7 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Since the time consumption of the first operation is extremely long, all service threads are full, and no available thread is given to the data caller. Therefore, the thread pool is exhausted, and the alarm information is sent to the data caller, so that the experience of the data caller is particularly poor.
Sometimes, when the business is online, the system of the data caller feeds back the alarm message, and some services are open to the outside, which is not good for the experience of the business related to the service call.
In order to solve the problem that the first operation is time-consuming and particularly long, the following technical scheme in the embodiment of the invention can be adopted.
Referring to fig. 1, fig. 1 is a schematic diagram of a main flow of a method for providing a data service, according to an embodiment of the present invention, for establishing a link with a data provider by constructing a virtual data request to provide the data service. As shown in fig. 1, the method specifically comprises the following steps:
s101, monitoring that an application system providing service to the outside is started, and acquiring an array of virtual hash sub-base sub-table main keys according to a routing forwarding rule.
In the embodiment of the present invention, it is considered that the first operation is particularly time-consuming because a link with a data provider needs to be established during the first operation. Then, the link with the data provider can be established with the virtual data request, and in the case of receiving the actual data request, since the data service can be directly provided without establishing the link with the data provider, the time consumption of the first operation can be reduced.
Specifically, the technical solution in the embodiments of the present invention may be executed after the application system is completely started. Moreover, the technical scheme in the embodiment of the invention is only executed once after the application system is completely started, and the operation of the application system is executed asynchronously. In this way, a link is established with the data provider through the virtual data request without affecting the normal use of the application system.
In the embodiment of the present invention, the application system may be understood as application software, that is, application software for providing a service to the outside.
In an embodiment of the present invention, when monitoring that an application system providing services to the outside is started, the method triggers obtaining an array of virtual hash sub-base sub-table main keys according to a route forwarding rule. Wherein the booting may include a first boot and a restart.
As an example, an event may be triggered after the application system has been started, and when the trigger event is monitored, it is known that the application system has been started for the first time.
In the embodiment of the present invention, the route forwarding rule may be preset. Specifically, the routing forwarding rule is a rule for selecting an optimal path according to information in a routing table and forwarding data. Then, an array of virtual hash sub-base sub-table primary keys may be obtained based on the route forwarding rule. The array is not an array related to an actual data request, but an array obtained by performing hash operation on a virtual sub-base sub-table main key.
The virtual data request can be constructed by utilizing the array of the virtual hash sub-base sub-table main key.
S102, according to the array of the virtual hash library sub-table main keys and the entry type of the instance, an entry value of the instance method is constructed.
The method involving the instance and the value of the instance's arguments are needed in building the virtual data request. A class is an abstract template, such as a Student class. An instance is a specific object created from a class, each object having the same method.
In the embodiment of the invention, the specified instance and the instance method are obtained through the dynamic configuration file. That is, instances and methods of instances are stored in a configuration file, and the configuration file is dynamic. That is, the instances included in the configuration file and the method of the instances are not invariable.
In one embodiment of the invention, the configuration file includes an instance of the database join operation and a method of the instance of the database join operation, and an instance of the middleware and a method of the instance of the middleware.
That is, a method for including an instance of a database connection operation and an instance of a database connection operation in a configuration file in the case where a data provider is a database. In this way, a link is established with the database.
For the case where the data provider is middleware, the configuration file includes an instance of the middleware and a method of the instance of the middleware. In this way, a link is established with the middleware. Data can be interacted with other databases through the middleware.
In embodiments of the present invention, a configuration file includes multiple instances and methods of the instances. The method parameters of the instance to be initialized are selected based on the actual requirements. The example method may be a query operation or a newly developed operation, etc.
In an embodiment of the invention, the data provider comprises a database and/or middleware. That is to say, the technical solution of the embodiment of the present invention is not only applicable to databases, but also applicable to middleware. As one example, the middleware may be JDDL, ES middleware, redis cache, and the like. JDDL is the middleware of the library and the table. Elastic search (es) is a Lucene-based highly extended distributed search server.
Referring to fig. 2, fig. 2 is a schematic flowchart of a process of constructing a virtual data request according to an embodiment of the present invention, which specifically includes the following steps:
s201, initializing a parameter array.
Initialization operations are required before building the parameters of the method of the instance.
As an example, a set of parameter arrays can be initialized according to the number of parameters of the example method, and the parameter types in the parameter arrays need to be consistent with the parameter types of the example method.
That is, a set of parameter arrays obtained by initialization, the number of parameters is the same as that of the parameters of the example method; the parameter types are the same as the entry types of the methods of the examples. The purpose of the initialization is to construct the entries for the example method.
S202, according to the array of the virtual hash library sub-table main key and the initialized parameter array, the parameter value of the method of the embodiment is constructed.
The number of the parameters of the initialized parameter array is the same as that of the parameters of the example method, and the type of the parameters of the initialized parameter array is the same as that of the parameters of the example method.
Aiming at the parameter values of the method for constructing the example, the method is based on an array of virtual hash sub-base sub-table main keys and an initialized parameter array. Under the condition of constructing a plurality of parameter values, the array of the primary key of the sub-table of the virtual hash sub-base and the initialized parameter array can be used.
Thus, according to the technical solution in the embodiment of fig. 2, the reference values of the method of the example are constructed.
In one embodiment of the invention, the virtual data request is constructed by reflecting the method of the execution instance of the method and transmitting the input parameter value of the method.
Reflection is a computer processing means. There is the ability for a program to access, detect and modify its own state or behavior. Objects can be provided that encapsulate sets, types of programs. All resources related to the instance can be obtained by the reflection method.
S103, combining the entry parameter of the method, executing the method of the example, and constructing the virtual data request.
Thus, if the instance, the method of the instance, the method type of the instance, and the arguments to the method of the instance are known, then a virtual data request can be constructed. Namely, the method of the example is executed by combining the reference value of the method of the example, and the virtual data request is constructed.
And S104, submitting the virtual data request to a thread pool, and establishing a link with a data provider so as to provide data service.
As one example, a set of thread pools is initialized into which virtual data requests constructed each time they are executed may be submitted. The default number of thread pools may be preset, for example: the default number of thread pools is 100.
In embodiments of the present invention, the virtual data requests may be submitted to the thread pool synchronously or asynchronously. Because the virtual data requests are submitted synchronously, the number of the virtual data requests in the thread pool is large, and the normal operation of the main thread can be influenced.
Then, a link with a data provider may be established to improve efficiency by asynchronously submitting the virtual data request, i.e., asynchronously submitting the virtual data request to the thread pool.
The virtual data requests are asynchronously submitted to the thread pool. Executing the virtual data request in the task queue of the thread pool, the task is executed asynchronously for the main thread, and the main thread is not blocked from further execution. The main thread and a plurality of virtual data requests do not need to be processed simultaneously, so that the normal operation of the main thread is guaranteed.
The virtual data request is submitted to the thread pool, and the virtual data request is executed in a task queue of the thread pool so as to establish a link with the data provider.
The virtual data request is established by executing a method of the class example, and in interaction with the data provider, a link is established with the data provider.
In one embodiment of the invention, data services are provided based on a link to a data provider in response to an actual data request. .
After receiving the actual data request, in order to process the actual data request, the service directly adopts a link with a data provider, and the service is released to be on-line to provide data service. And the actual data request and the virtual data request correspond to the same instance method.
It will be appreciated that the virtual data request is established by an instance-based method. After the link with the data provider is established according to the virtual data request, for the actual data request of the method of the same example as the virtual data request, the link with the data provider is not required to be established, and the service release can be carried out on line, so that the time consumption of the first operation is reduced.
In the embodiment, the application system providing the service to the outside is monitored to be started, and the array of the virtual hash sub-base sub-table main key is obtained according to the routing forwarding rule; constructing the parameter value of the method of the example according to the array of the primary key of the Hash sub-library sub-table and the parameter type of the example; combining the entry parameter of the method, executing the method of the example, and constructing a virtual data request; and submitting the virtual data request to a thread pool, and establishing a link with a data provider to provide data service. Since the link with the data provider is established in advance, the data service can be directly provided, and thus, the time consumption of the first operation can be reduced.
The virtual data request constructed in the above way is sent to the data provider, so that the application system can be preheated. And the service quality is improved. The first transmission of the actual data request is imperceptible to the service user and also imperceptible to the merchant. The problem of warning, namely unstable service overtime and the like caused by the exhaustion of the thread pool in the prior art is solved. The experience of the merchant end and the service user is greatly improved.
Referring to fig. 3, fig. 3 is a schematic flow chart of a conventional method for providing data services. It will be appreciated that the application system may receive the actual data request. An application system may be understood as software that provides data services to the outside through actual data requests.
The application system starts to initialize. In response to the actual data request, the service posts an online. And in the process of service release online, establishing a link with a data provider, and then realizing service release online.
In fig. 3, the time-consuming first operation is particularly long because a link with a data provider needs to be established.
Referring to fig. 4, fig. 4 is a schematic flow chart of providing data services according to an embodiment of the present invention, and the technical solution of fig. 4 is different from that of fig. 3 in that a preheating step is added.
The application system in fig. 4 may adopt the technical solution in the embodiment of the present invention. The application system starts to initialize.
And according to the array of the primary key of the Hash sub-base sub-table and the entry parameter type of the example method, constructing an entry parameter value of the example method, and further constructing a virtual data request.
In the process of preheating, a virtual data request is submitted to a thread pool, and a link with a data provider is established.
And then in the process of service release online, responding to the actual data request, and providing data service based on the link with the data provider to realize the service release online.
As one example, the database is accessed through a JDDL middleware client. The database is divided into a database and a table, and a redis cache is used as a method for improving the query performance in an application system. By implementing the scheme in the embodiment of the invention in an application system, the time consumption of the first operation can be reduced.
In the above-described embodiment, the link with each data provider is established in advance. When the application system is started, only the link pool of the database is initialized, no link is actually created with each data provider, and no actual data interaction occurs. This results in the need to establish a link with each data provider when accessing the actual data request.
Establishing a link with each data provider is actually time-consuming, and the virtual data request is used for simulating an actual data request, establishing a link with the data provider in advance, performing data interaction, enabling the application system which is just started to reach the state the same as the running application system, and then distributing the line.
Referring to fig. 5, fig. 5 is a schematic diagram of a main structure of an apparatus for providing data services according to an embodiment of the present invention, where the apparatus for providing data services may implement a method for providing data services, and as shown in fig. 5, the apparatus for providing data services specifically includes:
an obtaining module 501, configured to monitor that an application system providing services to the outside is started, and obtain an array of virtual hash sub-base sub-table main keys according to a route forwarding rule;
a parameter module 502, configured to construct a parameter value of the method of the instance according to the array of the hash sub-library sub-table primary key and the method parameter type of the instance;
a request module 503, configured to execute the method of the example in combination with the entry parameter of the method, and construct a virtual data request;
the establishing module 504 is configured to submit the virtual data request to a thread pool, and establish a link with a data provider to provide a data service.
In one embodiment of the invention, model 504 is established and is further used to provide data services based on the link with the data provider in response to actual data requests. .
In one embodiment of the invention, the actual data request corresponds to the same instance of the virtual data request.
In one embodiment of the invention, the instance and the method of the instance are obtained from a configuration file.
In one embodiment of the invention, the configuration file comprises an instance of the database connection operation and a method of the instance of the database connection operation, and an instance of the middleware and a method of the instance of the middleware.
In an embodiment of the present invention, the request module 503 is specifically configured to execute the method of the example by a reflection method, and introduce the entry parameters of the method to construct the virtual data request.
In an embodiment of the present invention, the establishing module 504 is specifically configured to asynchronously submit the virtual data request to a thread pool, and establish a link with a data provider.
Fig. 6 illustrates an exemplary system architecture 600 of a method of providing data services or an apparatus for providing data services to which embodiments of the present invention may be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 serves to provide a medium for communication links between the terminal devices 601, 602, 603 and the server 605. Network 604 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 601, 602, 603 to interact with the server 605 via the network 604 to receive or send messages or the like. The terminal devices 601, 602, 603 may have installed thereon various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 605 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 601, 602, 603. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the method for providing data service provided by the embodiment of the present invention is generally executed by the server 605, and accordingly, the apparatus for providing data service is generally disposed in the server 605.
It should be understood that the number of terminal devices, networks, and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 7 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. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure 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 can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 701.
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 modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes an acquisition module, a parameter module, a request module, an establishment module, and a service module. The names of these modules do not in some cases constitute a limitation on the unit itself, for example, the obtaining module may also be described as an "array for obtaining a virtual hash sub-base sub-table primary key according to a route forwarding rule".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise:
monitoring that an application system providing services to the outside is started, and acquiring an array of virtual hash sub-base sub-table main keys according to a routing forwarding rule;
constructing a parameter value of the method of the example according to the array of the hash sub-base sub-table main key and the parameter type of the method of the example;
executing the method of the example by combining the entry parameter of the method to construct a virtual data request;
and submitting the virtual data request to a thread pool, and establishing a link with a data provider so as to provide data service.
According to the technical scheme of the embodiment of the invention, an application system providing service to the outside is monitored to be started, and an array of virtual hash sub-base sub-table main keys is obtained according to a route forwarding rule; constructing the parameter value of the method of the example according to the array of the primary key of the Hash sub-library sub-table and the parameter type of the example; combining the entry parameter of the method, executing the method of the example, and constructing a virtual data request; and submitting the virtual data request to a thread pool, and establishing a link with a data provider to provide data service. Since the data service can be directly provided without establishing a connection with the data provider after the actual data request is received, time consumption for the first operation can be reduced.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of providing data services, comprising:
monitoring that an application system providing services to the outside is started, and acquiring an array of virtual hash sub-base sub-table main keys according to a routing forwarding rule;
constructing a parameter value of the method of the example according to the array of the hash sub-base sub-table main key and the parameter type of the method of the example;
executing the method of the example by combining the entry parameter of the method to construct a virtual data request;
and submitting the virtual data request to a thread pool, and establishing a link with a data provider so as to provide data service.
2. The method of providing data services according to claim 1, wherein said submitting said virtual data request to a thread pool, after establishing a link with a data provider, further comprises:
and responding to the actual data request, and providing the data service based on the link with the data provider.
3. The method of providing data services according to claim 2, wherein the actual data request corresponds to the same instance of the virtual data request.
4. The method of providing data services according to claim 1 wherein the instance and the method of the instance are obtained from a configuration file.
5. The method of providing data services according to claim 4, wherein the configuration file includes an instance of a database join operation and a method of an instance of a database join operation, and an instance of middleware and a method of an instance of middleware.
6. The method of claim 1, wherein the executing the instance method in conjunction with the method's entry parameters constructs a virtual data request comprising:
and executing the method of the example through a reflection method, and transmitting the entry parameter value of the method to construct a virtual data request.
7. The method of any of claims 1 to 6, wherein said submitting said virtual data request to a thread pool, establishing a link with a data provider, comprises:
and asynchronously submitting the virtual data request to a thread pool, and establishing a link with a data provider.
8. An apparatus for providing data services, comprising:
the acquisition module is used for monitoring that an application system providing services for the outside is started and acquiring an array of virtual hash sub-base sub-table main keys according to a routing forwarding rule;
the parameter module is used for constructing the parameter value of the method of the example according to the array of the hash sub-base sub-table main key and the parameter type of the method of the example;
the request module is used for executing the method of the example by combining the entry parameter of the method and constructing a virtual data request;
and the establishing module is used for submitting the virtual data request to a thread pool and establishing a link with a data provider so as to provide data service.
9. An electronic device that provides data services, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202011159671.4A 2020-10-26 2020-10-26 Method, apparatus, device and computer readable medium for providing data service Active CN113760886B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011159671.4A CN113760886B (en) 2020-10-26 2020-10-26 Method, apparatus, device and computer readable medium for providing data service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011159671.4A CN113760886B (en) 2020-10-26 2020-10-26 Method, apparatus, device and computer readable medium for providing data service

Publications (2)

Publication Number Publication Date
CN113760886A true CN113760886A (en) 2021-12-07
CN113760886B CN113760886B (en) 2023-09-01

Family

ID=78785868

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011159671.4A Active CN113760886B (en) 2020-10-26 2020-10-26 Method, apparatus, device and computer readable medium for providing data service

Country Status (1)

Country Link
CN (1) CN113760886B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100046531A1 (en) * 2007-02-02 2010-02-25 Groupe Des Ecoles Des Telecommunications (Get) Institut National Des Telecommunications (Int) Autonomic network node system
US20140201348A1 (en) * 2013-01-16 2014-07-17 International Business Machines Corporation Virtual appliance chaining and management
CN107040416A (en) * 2017-04-12 2017-08-11 大连理工大学 A kind of virtual data center visual management method based on Cairngorm frameworks
CN111367983A (en) * 2020-03-10 2020-07-03 中国联合网络通信集团有限公司 Database access method, system, device and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100046531A1 (en) * 2007-02-02 2010-02-25 Groupe Des Ecoles Des Telecommunications (Get) Institut National Des Telecommunications (Int) Autonomic network node system
US20140201348A1 (en) * 2013-01-16 2014-07-17 International Business Machines Corporation Virtual appliance chaining and management
CN107040416A (en) * 2017-04-12 2017-08-11 大连理工大学 A kind of virtual data center visual management method based on Cairngorm frameworks
CN111367983A (en) * 2020-03-10 2020-07-03 中国联合网络通信集团有限公司 Database access method, system, device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
孙士清;彭建华;游伟;: "一种时延约束下可靠性保证的服务功能链部署方法", 计算机应用研究, no. 08 *

Also Published As

Publication number Publication date
CN113760886B (en) 2023-09-01

Similar Documents

Publication Publication Date Title
WO2021023149A1 (en) Method and apparatus for dynamically returning message
CN109245908B (en) Method and device for switching master cluster and slave cluster
CN111478781B (en) Message broadcasting method and device
US10924590B1 (en) Virtual workspace experience visualization and optimization
CN111831461A (en) Method and device for processing business process
CN113282589A (en) Data acquisition method and device
CN113946816A (en) Cloud service-based authentication method and device, electronic equipment and storage medium
CN112819638A (en) Transaction weight judging method, device, equipment and computer readable medium
CN111953718A (en) Page debugging method and device
CN113760886B (en) Method, apparatus, device and computer readable medium for providing data service
CN110765445B (en) Method and device for processing request
CN112860447B (en) Interaction method and system between different applications
CN110768855B (en) Method and device for testing linkmzation performance
CN109981320B (en) Method and device for managing configuration information
CN110909269B (en) Log reporting method and device
CN113779122A (en) Method and apparatus for exporting data
CN113556370A (en) Service calling method and device
CN109213815B (en) Method, device, server terminal and readable medium for controlling execution times
CN112579447A (en) Browser testing method and device
CN112131095A (en) Pressure testing method and device
CN112559001A (en) Method and device for updating application
CN110262756B (en) Method and device for caching data
CN109446183B (en) Global anti-duplication method and device
CN113452739A (en) Message processing method and device
CN113495747A (en) Gray scale publishing method and device

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