[go: up one dir, main page]

CN109145061B - Method for distributing session object by database, database and server - Google Patents

Method for distributing session object by database, database and server Download PDF

Info

Publication number
CN109145061B
CN109145061B CN201810841642.2A CN201810841642A CN109145061B CN 109145061 B CN109145061 B CN 109145061B CN 201810841642 A CN201810841642 A CN 201810841642A CN 109145061 B CN109145061 B CN 109145061B
Authority
CN
China
Prior art keywords
database
session
application
objects
session objects
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810841642.2A
Other languages
Chinese (zh)
Other versions
CN109145061A (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.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Advanced New Technologies 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 Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201810841642.2A priority Critical patent/CN109145061B/en
Publication of CN109145061A publication Critical patent/CN109145061A/en
Application granted granted Critical
Publication of CN109145061B publication Critical patent/CN109145061B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

The embodiment of the specification discloses a method for allocating session objects to a database, the database and a server, under the condition that the connection session resources of the database are prior, the session objects of the database are reasonably and intensively allocated to applications, the utilization rate of sessions can be improved to a great extent, the possibility that the session resources of the database service are still idle on other application servers when the applications wait for the session resources of the database, namely, other session resources of the database cannot provide services even if the other session resources are idle in the aspect of the database is reduced, the call loss rate is obviously reduced, the response success rate of the database is improved, and a more excellent connection scheme is provided for the database and the applications.

Description

Method for distributing session object by database, database and server
Technical Field
The present application relates to the field of database technologies, and in particular, to a method, a database, and a server for allocating session objects to a database.
Background
The database technology is a core part of various information systems such as a management information system, an office automation system, a decision support system and the like, and is an important technical means for scientific research and decision management. Databases are of many types, ranging from the simplest tables that store various types of data to large database systems that can store large amounts of data.
In the running process of the database, the database needs to be connected with a plurality of applications simultaneously to transmit data, and with the development of technology, the number of applications which the database needs to be connected with at the same time is higher and higher, which requires that the database can provide a more stable connection scheme.
Disclosure of Invention
The invention provides a method for distributing session objects by a database, the database and a server.
In a first aspect, an embodiment of the present specification provides a method for allocating a session object by a database, including: the database receives an access request of an application; the database responds to the access request and allocates a session object to the application from all allocable session objects; and the database transmits the data in the corresponding logic data source to the application through the distributed session object.
In a second aspect, an embodiment of the present specification provides a database, including:
a receiving unit configured to receive an access request of an application;
the distribution unit is used for responding to the access request and distributing a session object to the application from all distributable session objects;
and the data transmission unit is used for transmitting the data in the corresponding logic data source to the application through the allocated session object.
In a third aspect, the present specification provides a server, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the method according to any one of the first aspect when executing the program.
In a fourth aspect, the present specification provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the method according to any one of the first aspect.
The embodiment of the specification has the following beneficial effects:
the database allocates a session object to the application from all allocable session objects, which is equivalent to sharing the session object in the same database to allocate to the application, thereby avoiding the situation that the session object of a logical data source in the database is completely occupied and the session objects of other logical data sources cannot provide service even if the session objects are idle, improving the utilization rate of the session object, obviously reducing the call loss rate, improving the success rate of database response, and providing a more stable connection scheme for the database.
Drawings
FIG. 1 is a schematic diagram of a scenario of interaction between a database and an application provided in an embodiment of the present specification;
FIG. 2 is a flowchart of a method for allocating session objects to a database according to an embodiment of the present disclosure;
FIG. 3 is a block diagram of a database provided by an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a server provided in an embodiment of the present specification.
Detailed Description
In order to better understand the technical solutions, the technical solutions of the embodiments of the present specification are described in detail below with reference to the drawings and specific embodiments, and it should be understood that the specific features of the embodiments and embodiments of the present specification are detailed descriptions of the technical solutions of the embodiments of the present specification, and are not limitations of the technical solutions of the present specification, and the technical features of the embodiments and embodiments of the present specification may be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a schematic view of a scenario of interaction between a database and an application provided in an embodiment of the present specification, in the embodiment of the present specification, User data is divided into 5 sub-epitopes according to a User Identification (UID) level of a User, as shown in fig. 1, a database 100 includes 5 logical data sources, the 5 logical data sources are 00, 01, 02, 03, and 04, respectively, and a plurality of session objects are configured to enable the database 100 to transmit data of each logical data source to a plurality of applications at the same time.
In other embodiments of this specification, the user data may be divided into a greater number according to the actual situation of the user data, and the application is provided with services through a plurality of databases, but it should be noted that the manner adopted when dividing the user data, the number of databases, and the number of logical data sources in each database are not limited herein, and those skilled in the art may correspondingly select an appropriate manner and value to meet the needs of the actual situation, which is not described herein again.
Referring to fig. 2, fig. 2 is a flowchart of a method for allocating session objects to a database according to an embodiment of the present disclosure, where as shown in fig. 2, the first embodiment of the method for allocating session objects to a database specifically includes the following steps:
s202: receiving an access request of an application by a database, wherein the database comprises a plurality of logical data sources and a plurality of session objects;
specifically, referring to fig. 1, when an application 110 needs to access data in the database 100, the application 110 sends an access request to the database 100, and the database 100 can receive the access request of the application 110.
S204: the database responds to the access request and allocates a session object to the application from all allocable session objects;
specifically, with continued reference to fig. 1, in response to an access request from an application 110, a Session object (Session) needs to be assigned to the application 110 so that the database 100 can establish a connection with the application 110 through the Session object, and thus the database 100 can transfer data to the application 110.
In practical applications, please continue to refer to fig. 1, generally speaking, the behavior of the application 110 accessing the database 100 is controlled by the user, and the business behavior of the user is in accordance with poisson distribution, that is, the number of transactions actually falling in a single logical database is in accordance with poisson distribution, and it is set that the number of transactions executed by a server in a unit time of a single data source is, for example, M800T (T represents a transaction) in 1 second, where the time required for each transaction is S10 ms/T0.01S/T, and the traffic volume is calculated as: a is 800 · 0.01 is 8 irish. Thus, for a database 100 comprising 5 logical data sources, the traffic volume is 40 Ireland.
In this embodiment, please refer to fig. 1 again, if the number of session objects in each logical data source is set to 6, and the number of session objects included in the database 100 is 30, then it can be calculated that the call loss rate of the database 100 is:
Figure BDA0001744480590000041
this is equivalent to sharing session objects in the same database, sharing session objects in the same database for allocation to applications, and avoiding the situation where session objects of one logical data source in the database are all occupied and session objects of other logical data sources cannot provide services even if they are idle.
If the call loss rate is calculated by using a single logical data source including 6 session objects, the call loss rate is:
Figure BDA0001744480590000042
it should be noted that the two calculation processes for calculating the call loss rate are simplified calculation, the numerical values are approximate values, and the actual call loss rate can be searched and compared according to the ireland call loss rate formula, which is not described herein again.
It is evident that the call loss rate is greatly reduced and, correspondingly, the success rate of the database 100 in responding to the access request of the application 110 is greatly increased.
S206: and the database transmits the data in the corresponding logical data source to the application through the allocated session object.
After S204, that is, after the database 100 allocates one session object to the application 110 from all allocable session objects, the database can transmit the data in the corresponding logical data source to the application 110 through the session object allocated to the application 110, which is not described herein again.
It can be seen that, in the embodiment, the database 100 allocates one session object to the application 110 from all allocable session objects, which is equivalent to sharing the session object in the same database to allocate to the application, so as to avoid the situation that the session object of one logical data source in the database is fully occupied and the session objects of other logical data sources cannot provide services even if they are idle, and improve the usage rate of the session object, thereby significantly reducing call loss rate, improving the success rate of database response, that is, providing a more stable connection scheme for the database.
In a specific implementation process, please continue to refer to fig. 2, after S206, the method for allocating session objects by a database according to the embodiment of the present disclosure further includes S208: the database sets the session object allocated to the application as unallocated.
Specifically, since the session object allocated to the application 110 by the database 100 is bound to the application 110 and is also bound during the process of accessing the database by the application 110, if the session object is allocated to another application, an error may occur in the process of accessing the database 100 by the application 110 or an error may occur in the process of accessing the database 100 by another application, and thus the database 100 is required to set the session object allocated to the application 100 as unallocated.
If there are other applications that need to access the database 100, the database 100 only needs to re-execute the method for allocating session objects to the database provided in this embodiment from S202, which is not described herein again.
Referring to fig. 2, unlike the first embodiment described above, the method for allocating session objects by using a database according to the second embodiment of the present disclosure further includes, after S208, S210: and the database marks the unallocated session objects to identify the session objects occupied by the current application.
Specifically, if a single sub-location point, that is, a certain logical data source, appears as a hot spot, that is, when the access amount to the logical data source is large, the hot spot may be spread to other logical data sources under the same database, because the database may allocate assignable session objects to the logical data source at the hot spot, the session objects that the database allocates to applications accessing other logical data sources are greatly reduced, and therefore, tagging may be performed on non-assignable session objects, specifically, tagging may be performed on the use of each session object, for example, the session object occupied by the current ID may be identified by using the application ID, so that it is ensured that one application occupies at most one session object to access the logical data source at the hot spot, thereby avoiding spreading of the hot spot.
The other steps in the second embodiment have been described in detail in the first embodiment, and are not described herein again.
Unlike the first embodiment described above, the method for allocating session objects by a database provided in the third embodiment of the present specification further includes, before S202, S200: when a server loading the database is started, the database sets all the session objects to be in an assignable state, so that the session objects are assigned to the applications needing to access the database.
Specifically, to improve the automation of the server and ensure that the database 100 can provide a more stable connection scheme as soon as possible after the server is started, the database 100 sets all session objects to an assignable state at the time of starting the server loaded with the database 100, thereby assigning session objects to applications that need to access the database. This enables sharing of session objects in the same database to avoid situations where the session objects of one logical data source in the database are fully occupied and the session objects of other logical data sources cannot provide services even if they are idle.
Other steps in the third embodiment have already been described in detail in the first embodiment, and are not described herein again.
In a specific implementation, for any of the three embodiments described above, the database 100 allocates the session object to the application 110 at the granularity of a single service on a single server.
The foregoing describes certain embodiments of this specification. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
In a second aspect, based on the same inventive concept, an embodiment of the present specification provides a database, please refer to fig. 3, fig. 3 is a block diagram of the database provided in the embodiment of the present specification, as shown in fig. 3, including:
a receiving unit 301, configured to receive an access request of an application;
an allocating unit 302, configured to respond to the access request, allocate a session object to the application from all allocable session objects of the application;
and a data transfer unit 303, configured to transfer the data in the corresponding logical data source to the application through the allocated session object.
In an optional manner, the database further includes a first setting unit 304, and the first setting unit 304 is configured to, when a server loading the database is started, set all session objects to an allocable state by the database, so as to allocate the session objects for applications that need to access the database.
In an alternative, the database further includes a second setting unit 305, and the second setting unit 305 is configured to, after allocating a session object to an application from all available session objects of the database, set the session object allocated to the application to a non-allocable state by the database.
In an optional manner, the database further includes a marking unit 306, and the marking unit 306 is configured to mark the session object set in the unallocated state to identify the session object occupied by the current user.
In an alternative, the database allocates session objects for applications at the granularity of a single service on a single server.
In a third aspect, based on the same inventive concept as the method for allocating session objects based on a database in the foregoing embodiments, referring to fig. 4, fig. 4 is a schematic structural diagram of the server provided in this embodiment, as shown in fig. 4, including a memory 604, a processor 602, and a computer program stored in the memory 604 and being executable on the processor 602, where the processor 602, when executing the program, implements the steps of any one of the foregoing methods for allocating session objects based on a database.
Where in fig. 4 a bus architecture (represented by bus 600) is shown, bus 600 may include any number of interconnected buses and bridges, and bus 600 links together various circuits including one or more processors, represented by processor 602, and memory, represented by memory 604. The bus 600 may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface 606 provides an interface between the bus 600 and the receiver 601 and transmitter 603. The receiver 601 and the transmitter 603 may be the same element, i.e., a transceiver, providing a means for communicating with various other apparatus over a transmission medium. The processor 602 is responsible for managing the bus 600 and general processing, and the memory 604 may be used for storing data used by the processor 602 in performing operations.
In a fourth aspect, based on the same inventive concept as the method for allocating session objects by a database in the foregoing embodiments, the present specification embodiment further provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of any one of the methods for allocating session objects by a database.
The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A method of database allocation of session objects, comprising:
receiving an access request of an application by a database, wherein the database comprises a plurality of logical data sources and a plurality of session objects;
the database responds to the access request and allocates a session object to the application from all allocable session objects; the database sets the session object allocated to the application as unallocated;
and the database transmits the data in the corresponding logic data source to the application through the distributed session object.
2. The method of claim 1, prior to the database receiving an access request for an application, the method further comprising:
when a server loading the database is started, the database sets all the session objects to be in an allocable state, so that the session objects are allocated to the applications needing to access the database.
3. The method of claim 2, after the database sets a session object allocated to the application as unallocated, the method further comprising:
and the database marks the unallocated session objects to identify the session objects occupied by the current application.
4. The method of any of claims 1-3, the database to allocate session objects for applications at a granularity of a single service on a single server.
5. An apparatus for allocating a session object to a database, wherein the database comprises:
a plurality of logical data sources and a plurality of session objects;
a receiving unit configured to receive an access request of an application;
the distribution unit is used for responding to the access request and distributing a session object to the application from all distributable session objects;
the data transmission unit is used for transmitting the data in the corresponding logic data source to the application through the distributed session object;
the database also comprises a second setting unit, and the second setting unit is used for setting the session object allocated to the application to be in a non-allocable state after allocating one session object to the application from all the available session objects.
6. The apparatus according to claim 5, wherein the database further comprises a first setting unit, and the first setting unit is configured to set all session objects to an allocable state by the database when a server loading the database is started, so as to allocate session objects for applications needing to access the database.
7. The apparatus of claim 5, the database further comprising a marking unit, configured to mark the session object set in the unallocated state to identify the session object occupied by the current user.
8. The apparatus of any of claims 5-7, the database to allocate session objects for applications at a granularity of a single service on a single server.
9. A server comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method of any one of claims 1-4 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 4.
CN201810841642.2A 2018-07-26 2018-07-26 Method for distributing session object by database, database and server Active CN109145061B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810841642.2A CN109145061B (en) 2018-07-26 2018-07-26 Method for distributing session object by database, database and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810841642.2A CN109145061B (en) 2018-07-26 2018-07-26 Method for distributing session object by database, database and server

Publications (2)

Publication Number Publication Date
CN109145061A CN109145061A (en) 2019-01-04
CN109145061B true CN109145061B (en) 2022-02-01

Family

ID=64798200

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810841642.2A Active CN109145061B (en) 2018-07-26 2018-07-26 Method for distributing session object by database, database and server

Country Status (1)

Country Link
CN (1) CN109145061B (en)

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101009697B (en) * 2006-01-26 2011-06-15 华为技术有限公司 The system and method for improving the success rate and efficiency of the resource request at the service layer
CN102263808B (en) * 2010-05-28 2014-04-30 北京邮电大学 Session control service method, device and system
US8732191B2 (en) * 2011-06-27 2014-05-20 Oracle International Corporation System and method for improving application connectivity in a clustered database environment
CN105468619B (en) * 2014-09-03 2019-10-29 阿里巴巴集团控股有限公司 Resource allocation methods and device for database connection pool
CN104317800A (en) * 2014-09-19 2015-01-28 山东大学 Hybrid storage system and method for mass intelligent power utilization data
CN105279263A (en) * 2015-10-23 2016-01-27 国网信息通信产业集团有限公司 Database connection system and method capable of supporting multi-application sharing
CN107291747A (en) * 2016-03-31 2017-10-24 北京优朋普乐科技有限公司 A kind of management method of database connection pool, apparatus and system
CN106021544B (en) * 2016-05-27 2020-02-07 北京京东尚科信息技术有限公司 Database distributed connection pool management method and system
CN106973062A (en) * 2017-04-27 2017-07-21 努比亚技术有限公司 A kind of conversation managing method and server
CN108259616B (en) * 2018-01-26 2021-06-15 中企动力科技股份有限公司 Session sharing method and device, electronic equipment and readable storage medium

Also Published As

Publication number Publication date
CN109145061A (en) 2019-01-04

Similar Documents

Publication Publication Date Title
CN109684065B (en) Resource scheduling method, device and system
CN108958894B (en) Distributed transaction processing method, system, transaction manager and terminal equipment
JP7506096B2 (en) Dynamic allocation of computing resources
CN109379448B (en) File distributed deployment method and device, electronic equipment and storage medium
US11496413B2 (en) Allocating cloud computing resources in a cloud computing environment based on user predictability
TW202121274A (en) Cloud resource management method and apparatus, and electronic device and computer readable storage medium
CN112073532B (en) Resource allocation method and device
CN111798113A (en) Resource allocation method, device, storage medium and electronic equipment
CN106302640A (en) Data request processing method and device
CN106897299B (en) Database access method and device
CN112905342A (en) Resource scheduling method, device, equipment and computer readable storage medium
CN107682391B (en) Electronic device, server allocation control method, and computer-readable storage medium
CN106502918A (en) A kind of scheduling memory method and device
CN114155026A (en) A resource allocation method, device, server and storage medium
CN112269661B (en) Partition migration method and device based on Kafka cluster
CN113791890A (en) Container distribution method and device, electronic equipment and storage medium
CN105824705A (en) A task assignment method and electronic device
CN111352735A (en) Data acceleration method, device, storage medium and equipment
CN114816764A (en) Resource migration method, device, processor and electronic device
CN113934525A (en) Hadoop cluster task scheduling method based on positive and negative feedback load scheduling algorithm
CN111813564B (en) Cluster resource management method and device and container cluster management system
CN109614242A (en) A computing power sharing method, apparatus, device and medium
CN109145061B (en) Method for distributing session object by database, database and server
US20160139940A1 (en) Systems and methods for creating virtual machine
CN115878309A (en) Resource allocation method, apparatus, processing core, device and computer readable medium

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200930

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200930

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

GR01 Patent grant
GR01 Patent grant