CN109669979A - The processing method and processing device of data, storage medium - Google Patents
The processing method and processing device of data, storage medium Download PDFInfo
- Publication number
- CN109669979A CN109669979A CN201811550472.9A CN201811550472A CN109669979A CN 109669979 A CN109669979 A CN 109669979A CN 201811550472 A CN201811550472 A CN 201811550472A CN 109669979 A CN109669979 A CN 109669979A
- Authority
- CN
- China
- Prior art keywords
- data
- subprocess
- agent process
- work
- access
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/466—Transaction processing
Abstract
The present invention provides a kind of processing method and processing devices of data, storage medium;Wherein, this method comprises: the data for being used to access the Database Systems sent by access process that agent process is received to Database Systems forwarding;The agent process receives the Database Systems and executes the result fed back after the data;In the case where result instruction current database access terminates, the agent process recycles the connection resource of the access process release.Through the invention, it solves the problems, such as that the middleware for introducing third party database in the related technology causes system complexity high, has achieved the effect that reduce system complexity while improving database communication bonding ratio.
Description
Technical field
The present invention relates to computer fields, processing method and processing device, storage medium in particular to a kind of data.
Background technique
Developing rapidly and being easy to dispose is that (Professional Hypertext Preprocessor is serviced using PHP
Device end programming language) language write processing HTTP (Hyper Text Transport Protocol, hypertext transfer protocol) ask
The main reason for asking, and each FPM process for executing PHP script is independently to be independent of each other mutually, and being equivalent to will be each
Request is isolated, therefore also avoids the pollution of global variable and the modification of related global parameter, and problem is facilitated to be traced.
But with the continuous promotion of project complexity and simultaneously online client is more and more, request becomes increasingly complex,
Need to extend more PHP processes to meet growing concurrent HTTP request.Each HTTP request is owned by independence before
The service of PHP process the advantages of, as the process of concurrent services increases, each process can create database independent and connect
It connects, also this means that the connection number of MySQL can also be increased therewith with the ratio of 1:1.
Discovery is surveyed by pressure: disposing database pipe on the machine of the installation (SuSE) Linux OS of a 72 core 512G memories
Reason system MySQL, database QueryInfo result pressure surveys discovery on artificial line, and the QPS of database can increasing with connection number
And performance indicator has different degrees of decline.Such as connection number increases to 20,000, each connection utilization rate is high and frequent wound
In the case where building/disconnecting, QPS is 1/5th in the case of connection number 2,000.
It can be seen that traditional PHP+MySQL framework has two: 1) connection number of database is as PHP works
Increasing for process and increase;2) single database connection utilization rate is not high, and whole database performance sharply declines.Therefore
Database connection number is reduced, the utilization rate for improving connection is the urgent problem to be solved introduced with the extension of PHP process number.
In this regard, solving the above problems in the following ways in the related technology:
Mode (1) provides database in the process of processing HTTP request itself and connects for part static compilation language
Pool concept, such as the Java.sql.ConnectionPool.java class of Java language are connect, is provided based on JDBC (Java
Database Connectivity) connection pool function, when worker thread needs to operate the data in database
It waits, needs to obtain an idle connection from connection pool, the data by that will pass to MySQL are sent to connection thread, even
Wiring journey forwards data to be transmitted to upper layer worker thread to database, then by the result returned in database.Connect in essence
It connects pond and worker thread belongs to the different threads with process.
Mode (2), third party database middleware scheme also provide similar connection pool function.Such as the well-known project in community
The middlewares such as Atlas, MyCat, the database request sended over by agency's forwarding upper-layer service process, build in middleware layer
Vertical database connection, is separated, it is real that a series of functions of load balancing finally forward requests to different databases by principal and subordinate
Example, and business layer process will be forwarded back to after collection.
But it is based on aforesaid way (1) and mode (2), for online project, if to access among third party
Part not can avoid then and be modified on a large scale existing business, originally in operation layer differentiation to data base read-write principal and subordinate
Isolated code needs again addition configuration adaptation middleware one by one.And it introduces new middleware services and is also mentioning to a certain degree
High system complexity then will affect client end response once middleware services are unavailable, particularly with functions such as login/chargings,
It is unacceptable for being unable to real-time response then.
In view of the above problems in the related art, not yet there is effective solution at present.
Summary of the invention
The embodiment of the invention provides a kind of processing method and processing devices of data, storage medium, at least to solve related skill
The problem that the middleware of third party database causes system complexity high is introduced in art.
According to one embodiment of present invention, a kind of processing method of data is provided, comprising: agent process is to database
The data for being used to access the Database Systems sent by access process that system forwards receive;The agent process receives
The Database Systems execute the result fed back after the data;The case where result instruction current database access terminates
Under, the agent process recycles the connection resource of the access process release.
According to another aspect of the present invention, a kind of processing unit of data is provided, agent process side, packet are applied to
Include: forwarding module is used to access the data base set for what is received to Database Systems forwarding by what access process was sent
The data of system;Receiving module executes the result fed back after the data for receiving the Database Systems;Recycling module is used
In in the case where result instruction current database access terminates, the connection resource of the access process release is recycled.
According to still another embodiment of the invention, a kind of storage medium is additionally provided, meter is stored in the storage medium
Calculation machine program, wherein the computer program is arranged to execute the step in any of the above-described embodiment of the method when operation.
Through the invention, agent process forwards the data for accessing Database Systems, and then executes corresponding access number
According to the operation in library, cause system complexity is high to ask to solve the middleware of introducing third party database in the related technology
Topic, has achieved the effect that reduce system complexity while improving database communication bonding ratio.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes part of this application, this hair
Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is the flow chart of the processing method of data according to an embodiment of the present invention;
Fig. 2 is the internal topology schematic diagram of agent process according to an embodiment of the present invention;
Fig. 3 is the schematic diagram of worker state transition according to an embodiment of the present invention;
Fig. 4 is the method flow that PHP process according to an embodiment of the present invention chooses that free time worker carries out database manipulation
Figure;
Fig. 5 is the structural schematic diagram of the processing unit of data according to an embodiment of the present invention.
Specific embodiment
Hereinafter, the present invention will be described in detail with reference to the accompanying drawings and in combination with Examples.It should be noted that not conflicting
In the case of, the features in the embodiments and the embodiments of the present application can be combined with each other.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, "
Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.
Embodiment 1
A kind of processing method of data is provided in the present embodiment, and Fig. 1 is the place of data according to an embodiment of the present invention
The flow chart of reason method, as shown in Figure 1, the process includes the following steps:
Step S102, what agent process was received to Database Systems forwarding is used to access data by what access process was sent
The data of library system;
Step S104, agent process receive Database Systems and execute the result fed back after data;
Step S106, in the case where result instruction current database access terminates, agent process recycling access process is released
The connection resource put.
S102 to step S106 through the above steps can be forwarded by agent process for access number in this application
According to the data of library system, and then the operation of corresponding access database is executed, to solve introducing third number formulary in the related technology
According to the problem that the middleware in library causes system complexity high, reaches to reduce while improving database communication bonding ratio and be
System complexity.
In the optional embodiment of the present embodiment, for the agent process that is related in the present embodiment step S102 to number
It, can be by such as according to the mode for the data for accessing Database Systems sent by access process that library system forwards receive
Under type is realized:
Step S102-11, after receiving the data, agent process judge in agent process with the presence or absence of idle work
Process;
Step S102-12, in the case where there is idle work subprocess in agent process, agent process passes through the free time
Work subprocess by data to Database Systems forward;
Step S102-13, there is no in the case where idle work subprocess in agent process, agent process judges non-
Whether the connection number that the data of access Database Systems are used for transmission in the waiting list of idle work subprocess is more than default
Threshold value;
Step S102-14, in the case where connection number is less than preset threshold, agent process will be used to access data base set
The data of system are inserted into the waiting list of busy work subprocess to wait and be forwarded;It is more than preset threshold in connection number
In the case where, agent process disconnects the connection that number is more than the work subprocess and Database Systems of preset threshold.
Through the above steps S102-12 to step S102-14 it is found that if work available free in agent process into
Journey then carries out the forwarding of data by the work subprocess of the free time;If there is no idle work in agent process
Process waits the number in need being forwarded since each busy work subprocess has corresponding waiting list in queue
According to;But whether the waiting number of each waiting list, i.e. connection number have been more than maximum allowable connection number, if it is, directly
The abnormal return of disconnection is connect, avoids server from accumulating excessive request and causes database snowslide;If it is not, then wait state becomes empty
It is waken up after not busy work subprocess.
It should be noted that the agent process being related in the present embodiment also wraps other than including above-mentioned work subprocess
It includes: service subprocess and management subprocess.
Wherein, agent process is connected by the socket between service subprocess snoop accesses process and agent process;With
And by the entire subprocess in the service subprocess start and stop agent process and reconfigure the state of work subprocess.And it acts on behalf of
Process can star management subprocess by servicing subprocess;And then agent process by management subprocess start work into
Journey, and be managed by state of the management subprocess to work subprocess.
In the optional embodiment of the present embodiment, the agent process being related in the present embodiment be can be
ProxyServer.Based on this, the Database Systems being related in the present embodiment are MySQL, and access process can be PHP
Process.
Therefore, three kinds of sub threads of the agent process in the concrete application scene of the present embodiment, a Server process (clothes
Business subprocess), a manager process (management subprocess) and several worker subprocess (work subprocess).Each
Group represents one group of worker subprocess set for connecting different MySQL examples.It should be noted that Group is not single
Only process.Fig. 2 is the internal topology schematic diagram of agent process according to an embodiment of the present invention.
Therefore, effect of the Server as main thread, played in agent process are as follows:
1) initial configuration starts manager sub thread;
2) it monitors the TCP connection of PHP and ProxyServer and receives the event that sends of socket and handled, example
Signal signal such as is sent to worker sub thread or manager sub thread, increases/exit new worker subprocess etc.;
3) signal of the entire process of start and stop and reload configuration file receives and manager is notified to carry out configuration heavy duty.
And Manager subprocess is used to create/manage subprocess, it is specific as follows:
1) it is responsible for starting worker subprocess;
2) it is responsible for exiting monitoring to subprocess, needs to restart if exiting extremely;
3) to will be more than to default Smallest connection number and be currently at the worker of idle state to recycle, guarantee with industry
Be engaged in pressure variation and newly-increased connection can be recycled when the free time.
It should be noted that Worker subprocess is the actual progress of work, there can be 7 kinds of states in the present embodiment:
1) del state, this state are recovered by manager progress recycle;
2) idle state, this state indicate that current worker is in the free time, can be used;
3) busy state, current worker are handling MySQL operation;
4) recycle_busy state, it should be recovered at once, recycling is converted into busy after restarting;
5) worker of recycle state is carried out the state in restarting process, still table by recycling_busy state
Show that service is unavailable;
6) recycle_idle state, it should recycle immediately, but without being lined up PHP fpm process, recycling turns after restarting
Change idle into;
7) recycle_idle is carried out the state in restarting process, still indicates service by recycling_idle state
It is unavailable.
Fig. 3 is the schematic diagram of worker state transition according to an embodiment of the present invention, as shown in figure 3, Idle- > del: by
Manager regular check then carries out worker if it find that current idle worker is more than minimum free time worker number
Recycling, worker are exited, the status set del of worker.
Idle- > busy: the corresponding group of some PHP process discovery database to be accessed have one it is idle
Worker is then arranged to busy by worker, and by carrying out MySQL database inquiry with worker interaction data.
Busy- > idle:PHP process terminate MySQL operation after, have been found that do not wait in line service other PHP into
Worker is then set to idle by journey.
Busy- > recycle: it does not discharge worker or affairs since apache process exits and does not submit/rollback etc.
Operation or apache wait overtime return not discharge worker, it should restart worker, then worker is set to recycle;
Recycle- > recycling:manager is restarting the worker for being marked as recycle state;
Recycling- > busy:worker checked after restarting in current group whether have waiting server-side PHP into
Journey, if so, then waking up PHP by signal, the state of juxtaposition oneself is idle;
Oneself, then be set to by the PHP process of discovery and N-free diet method service after recycling- > idle:worker is restarted
Idle carries out data interaction after waiting new PHP process to choose.
In concrete application scene, the agent process being related in the present embodiment can be ProxyServer.And data
In the case that library system is MySQL, access process is PHP process, also need to access MySQL to PHP process in the present embodiment
It is transformed, specific as follows:
1), by being registered in PHP is initialized to the construction (_ _ construct) of pdo object, destructed (_ _
), destruct the location registration call back function of (_ _ call) these three basic driving functions is called;
2), increase the calling function to the release of pdo object;
3), by the function of the above-mentioned function of rewriting/extension, realize that the connection of database is actually and the company of agent process
It connects, to the data interaction of database access and acquisition is actually and the data interaction of agent process achieves the goal.
4) logic, being lined up if selection worker without the free time and if failure, passes through the side between process by shared drive
The state of worker is inquired or modified to formula;
5), worker is waken up if there is being lined up when PHP process is then responsible for and connection is exited or discharged in current PHP process
Function;
6) interprocess communication with worker, is realized by name pipeline (named pipe), to interaction sequence
MySQL data afterwards;
7) it, is communicated, is realized by the server process of TCP connection mode and foregoing agents process ProxyServer
It is required that increasing worker;In addition, abnormal exit the event for resulting in the need for destroying corresponding work worker in time.
In another optional embodiment of the present embodiment, for being related in the present embodiment step S102-12
In the case where there is idle work subprocess in agent process, agent process is by idle work subprocess by data to number
According to the mode of library system forwards, can be achieved in that
Step S102-121, agent process judge whether there is packetization process corresponding with data;Wherein, agent process packet
One or more packets process is included, each packetization process includes one or more work subprocess;
Step S102-122, in agent process exist it is corresponding with the data for accessing Database Systems be grouped into
Journey, and in the case where work subprocess available free in packetization process, agency forwarded by the work subprocess of the free time
Data;
Step S102-123, in the case where packetization process corresponding with data is not present in agent process, agent process
And the process of access establishes new packetization process corresponding with data, and is turned based on the vacant working subprocess in new packetization process
Send out data.
In another optional embodiment of the present embodiment, the method and step of the present embodiment further include:
Step S108, the current data in waiting list execute access data base set based on busy work subprocess
In the case that the operation of system is completed, judge whether waiting list is empty;
Step S110, in the case where the judgment result is yes, agent process set the state of busy work subprocess
It is set to the free time;If the determination result is NO, it is used to access Database Systems in the queue of agent process wake-up waiting
Data continue to access to Database Systems based on busy work subprocess.
S108 and step S110 is it is found that for the busy work subprocess with waiting list through the above steps,
If the operation that data in waiting list execute access data system is fully completed, waiting list is sky, by work into
The state of journey is set as idle, if continuing to execute the access behaviour to Database Systems there are also other data in waiting list
Make.
In another optional embodiment of the present embodiment, the method and step of this implementation can also include:
Step S112 is receiving the letter for being used to indicate the first work subprocess and exiting extremely and discharging Database Systems connection
In the case where number, agent process generates the second work subprocess;
Step S114, agent process wake up the waiting list in the first work subprocess based on the second work subprocess.
The application is illustrated below with reference to the optional embodiment of the present embodiment;
One: PHP process of optional embodiment chooses free time worker and carries out database manipulation
Fig. 4 is the method flow that PHP process according to an embodiment of the present invention chooses that free time worker carries out database manipulation
Figure, as shown in figure 4, this method step includes:
Step S401 judges to be judged whether there is according to MySQL database link information (IP/PORT/USER) and build
Vertical group grouping;
Step S402 judges whether number of packet reaches the upper limit if there is grouping;
Step S403 judges whether current waiting list reaches maximum if number of packet has reached maximum, if not,
Then block waiting, if it is exits process and avoid the busy waiting always of PHP fpm process;
Step S404 is then communicated using current worker if there is grouping and available free worker;
Step S405 needs mmap shared drive newly to distribute corresponding group letter if number of packet does not reach the upper limit
Breath, and the TCP connection by establishing with server process send and need to create the worker event for creating grouping;
Step S406 determines whether there is corresponding molecule, PHP process database request warp to be sent by Manager
Name pipeline corresponding with worker is sent to after crossing serializing, and by process blocking;
Step S407 passes through if it is when needing newly-increased worker, Server to receive TCP to increase event newly
Signal signal notifies Manager process to need according to newly-increased worker;
Step S408 after Manager receives signal, is created that worker process;Pass through name pipeline after Worker starting
Operation data after receiving PHP process sequence, and by group information creating MySQL connection, forward the data to MySQL;
After step S409, Worker get the data of MySQL return, by name pipeline send result to PHP into
Journey returns again to and gives PHP upper-layer service result.
It wakes up and waits in line between two: PHP process of optional embodiment;
The PHP process wakes up the method and step waited in line
Step S502, for process PHP1, if it is normally exiting or release namely upper-layer service guarantee couple
The operation of database has been finished, and needs to check whether the waiting list of itself group is empty at this time;
Step S504, if waiting list is sky, needing to set current worker is idle state, so as to what is newly executed
PHP process can reuse current worker;
Step S506 does not need modification worker state, still maintains busy, connect down if waiting list is not sky
The process PHP2 that queue heads are waited is waken up by signal, and PHP2 is multiplexed current worker and operates to database.
Optional embodiment three: when PHP process, because inquiry returns, time-out is exited or an affairs are in PHP process terminates
When do not carry out commit/rollback operation, namely without correctly release connection;
This without correctly release connect in the case where processing method the step of include:
Step S602 notifies that ProxyServer, message content include to restart by TCP in the call back function exited
Worker relevant information (group_id, worker_id);
Step S604, Server will wait client to write or be stuck in database IO's by sending signal to worker
Worker wakes up;
Step S606, Worker terminate own process after receiving signal, to achieve the purpose that discharge current database connection,
The database data locked is discharged to stop slow inquiry operation or rollback affairs;
Step S608, Manager receive worker exit signal after, if restarted after state is recycle
Fork generates new worker2;
Step S610, Worker2 if it find that being that abnormal exit restarts substitution, then judge whether in own process
Need the PHP2 waiting process of wake-up;
The state of oneself if there is then passing through signal PHP2, and is set to busy by step S612;
Step S614 sets idle for the state of oneself if not, so as to the use of subsequent PHP process;
Step S616, the major cycle and PHP for entering worker carry out data interaction.
It should be noted that ProxyServer additionally provides reload function, it is right in the case where not withdrawing on line to facilitate
Configuration file carries out heavy duty, and content that at present can be heavily loaded includes: the maximum/minimum worker number that each group may include,
It can control MySQL connection number;Each manager process is grouped recuperable worker maximum upper limit for some;PHP
The queue maximum value that fpm can be lined up is more than maximum value, other queuing process then directly exit, and avoids fpm process card
Extremely, database connection cannot decline always and then cause snowslide phenomenon.
In the related art, it in the case where the short no connection pool of connection, as PHP fpm process number increases, is built with MySQL
Vertical connection number is also continuously increased, and MySQL search efficiency can be reduced with the growth of connection number;And pass through above-mentioned optional implementation
After mode one to three is it is found that there is the connection pool of long connection, pass through agent process ProxyServer management and MySQL creation
Connection, can effectively control connection number number of concurrent, control concurrent connection number, promote the efficiency individually connected, can greatly mention
Rise the performance of MySQL.
Through the above description of the embodiments, those skilled in the art can be understood that according to above-mentioned implementation
The method of example can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but it is very much
In the case of the former be more preferably embodiment.Based on this understanding, technical solution of the present invention is substantially in other words to existing
The part that technology contributes can be embodied in the form of software products, which is stored in a storage
In medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, calculate
Machine, server or network equipment etc.) execute method described in each embodiment of the present invention.
Embodiment 2
A kind of processing unit of data is additionally provided in the present embodiment, and the device is for realizing above-described embodiment and preferably
Embodiment, the descriptions that have already been made will not be repeated.As used below, predetermined function may be implemented in term " module "
The combination of software and/or hardware.Although device described in following embodiment is preferably realized with software, hardware, or
The realization of the combination of person's software and hardware is also that may and be contemplated.
Fig. 5 is the structural schematic diagram of the processing unit of data according to an embodiment of the present invention, the device be applied to act on behalf of into
It is sent out for what is received to Database Systems forwarding by access process as shown in figure 5, the device includes: forwarding module 52 journey side
That send is used to access the data of Database Systems;Receiving module 54 is of coupled connections, for receiving data library system with forwarding module 52
System executes the result fed back after data;Recycling module 56 is of coupled connections with receiving module 54, for indicating current data in result
In the case that library access terminates, the connection resource of recycling access process release.
Optionally, which includes: the first judging unit, for after receiving the data, judging agent process
In with the presence or absence of idle work subprocess;First retransmission unit, for there is idle work subprocess in agent process
In the case where, data are forwarded to Database Systems by idle work subprocess;Second judgment unit, for act on behalf of into
There is no in the case where idle work subprocess in journey, judge to be used for transmission in the waiting list of busy work subprocess
Whether the connection number for accessing the data of Database Systems is more than preset threshold;Second retransmission unit, for being less than in connection number
In the case where preset threshold, the data for being used to access Database Systems are inserted into the waiting list of busy work subprocess
In with wait be forwarded;Processing unit is more than default threshold in the case where connection number is more than preset threshold, disconnecting number
The connection of the work subprocess and Database Systems of value.
Wherein, which may include: judgment sub-unit, whether there is and number in agent process for judging
According to corresponding packetization process;Wherein, agent process includes one or more packets process, and each packetization process includes one or more
A work subprocess;First forwarding subelement, for exist it is corresponding with the data for accessing Database Systems be grouped into
Journey, and in the case where work subprocess available free in packetization process, it carries out forwarding data by the work subprocess of the free time;
Second forwarding subelement, is used in the case where packetization process corresponding with data is not present, with the foundation of access process and data
Corresponding new packetization process, and data are forwarded based on the vacant working subprocess in new packetization process.
It should be noted that above-mentioned modules can be realized by software or hardware, for the latter, Ke Yitong
Following manner realization is crossed, but not limited to this: above-mentioned module is respectively positioned in same processor;Alternatively, above-mentioned modules are with any
Combined form is located in different processors.
Embodiment 3
The embodiments of the present invention also provide a kind of storage medium, computer program is stored in the storage medium, wherein
The computer program is arranged to execute the step in any of the above-described embodiment of the method when operation.
Optionally, in the present embodiment, above-mentioned storage medium can be set to store by executing based on following steps
Calculation machine program:
S1, what agent process was received to Database Systems forwarding is used to access Database Systems by what access process was sent
Data;
S2, agent process receive Database Systems and execute the result fed back after data;
S3, in the case where result instruction current database access terminates, agent process recycles the company of access process release
Connect resource.
Optionally, in the present embodiment, above-mentioned storage medium can include but is not limited to: USB flash disk, read-only memory (Read-
Only Memory, referred to as ROM), it is random access memory (Random Access Memory, referred to as RAM), mobile hard
The various media that can store computer program such as disk, magnetic or disk.
The embodiments of the present invention also provide a kind of electronic device, including memory and processor, stored in the memory
There is computer program, which is arranged to run computer program to execute the step in any of the above-described embodiment of the method
Suddenly.
Optionally, above-mentioned electronic device can also include transmission device and input-output equipment, wherein the transmission device
It is connected with above-mentioned processor, which connects with above-mentioned processor.
Optionally, the specific example in the present embodiment can be with reference to described in above-described embodiment and optional embodiment
Example, details are not described herein for the present embodiment.
Obviously, those skilled in the art should be understood that each module of the above invention or each step can be with general
Computing device realize that they can be concentrated on a single computing device, or be distributed in multiple computing devices and formed
Network on, optionally, they can be realized with the program code that computing device can perform, it is thus possible to which they are stored
It is performed by computing device in the storage device, and in some cases, it can be to be different from shown in sequence execution herein
Out or description the step of, perhaps they are fabricated to each integrated circuit modules or by them multiple modules or
Step is fabricated to single integrated circuit module to realize.In this way, the present invention is not limited to any specific hardware and softwares to combine.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field
For art personnel, the invention may be variously modified and varied.It is all within principle of the invention, it is made it is any modification, etc.
With replacement, improvement etc., should all be included in the protection scope of the present invention.
Claims (11)
1. a kind of processing method of data characterized by comprising
What agent process was received to Database Systems forwarding is used to access the Database Systems by what access process was sent
Data;
The agent process receives the Database Systems and executes the result fed back after the data;
In the case where result instruction current database access terminates, the agent process recycles the access process release
Connection resource.
2. the method according to claim 1, wherein agent process to Database Systems forwarding receive by visiting
Ask the data for being used to access the Database Systems that process is sent, comprising:
After receiving the data, the agent process judge in the agent process with the presence or absence of idle work into
Journey;
There are in the case where the work subprocess of the free time in the agent process, the agent process passes through the free time
Work subprocess the data are forwarded to the Database Systems;
There is no in the case where idle work subprocess in the agent process, the agent process judges busy work
Make to be used for transmission whether the connection number of the data of access Database Systems is more than preset threshold in the waiting list of subprocess;
In the case where the connection number is less than the preset threshold, the agent process will be used to access Database Systems
Data are inserted into the waiting list of the busy work subprocess to wait and be forwarded;It is more than described in the connection number
In the case where preset threshold, the agent process disconnects the work subprocess and the data base set that number is more than preset threshold
The connection of system.
3. according to the method described in claim 2, it is characterized in that, there are the work of free time in the agent process
In the case where process, the agent process is turned the data to the Database Systems by the work subprocess of the free time
Hair, comprising:
The agent process judges whether there is packetization process corresponding with the data;Wherein, the agent process includes one
A or multiple packetization process, each packetization process include one or more work subprocess;
Exist in the agent process with described for accessing the corresponding packetization process of the data of Database Systems, and described point
In group process in the case where available free work subprocess, the agency is carried out described in the work subprocess forwarding by the free time
Data;
In the agent process be not present packetization process corresponding with the data in the case where, the agent process with it is described
Access process establishes new packetization process corresponding with the data, and based on vacant working in the new packetization process
Process forwards the data.
4. according to the method described in claim 2, it is characterized in that, the method also includes:
Current data in the waiting list is executed based on the busy work subprocess accesses the data base set
In the case that the operation of system is completed, judge whether the waiting list is empty;
In the case where the judgment result is yes, the agent process sets empty for the state of the busy work subprocess
It is not busy;If the determination result is NO, the agent process wakes up in the waiting list and is used to access Database Systems
Data the operation that accesses to the Database Systems is continued based on the busy work subprocess.
5. according to the method described in claim 2, it is characterized in that, the method also includes:
The case where the first work subprocess exits extremely and discharges the signal of the Database Systems connection is used to indicate receiving
Under, the agent process generates the second work subprocess;
The agent process wakes up the waiting list in the first work subprocess based on the second work subprocess.
6. according to the method described in claim 2, it is characterized in that, the agent process further include: service subprocess, the side
Method further include:
The agent process monitors the socket between the access process and the agent process by the service subprocess
Connection;
The agent process is by the entire subprocess in agent process described in the service subprocess start and stop and reconfigures work
Make the state of subprocess.
7. according to the method described in claim 6, it is characterized in that, the agent process further include: management subprocess, the side
Method further include:
The agent process passes through service subprocess starting management subprocess;
The agent process starts the work subprocess by the management subprocess;
The agent process is managed the state of the work subprocess by the management subprocess.
8. a kind of processing unit of data is applied to agent process side characterized by comprising
Forwarding module is used to access the data base set for what is received to Database Systems forwarding by what access process was sent
The data of system;
Receiving module executes the result fed back after the data for receiving the Database Systems;
Recycling module, for recycling the access process and releasing in the case where result instruction current database access terminates
The connection resource put.
9. device according to claim 8, which is characterized in that the forwarding module includes:
First judging unit, for after receiving the data, judging in the agent process with the presence or absence of idle work
Subprocess;
First retransmission unit, for, there are in the case where the work subprocess of the free time, passing through institute in the agent process
Idle work subprocess is stated to forward the data to the Database Systems;
Second judgment unit, for, there is no in the case where idle work subprocess, judging non-empty in the agent process
Whether the connection number that the data of access Database Systems are used for transmission in the waiting list of not busy work subprocess is more than default threshold
Value;
Second retransmission unit, for that will be used to access database in the case where the connection number is less than the preset threshold
The data of system are inserted into the waiting list of the busy work subprocess to wait and be forwarded;
Processing unit, in the case where the connection number is more than the preset threshold, disconnecting number to be more than preset threshold
Work subprocess and the Database Systems connection.
10. device according to claim 9, which is characterized in that first retransmission unit includes:
Judgment sub-unit, for judging in agent process with the presence or absence of packetization process corresponding with the data;Wherein, the generation
Reason process includes one or more packets process, and each packetization process includes one or more work subprocess;
First forwarding subelement, for existing with described for accessing the corresponding packetization process of the data of Database Systems, and
In the packetization process in the case where available free work subprocess, carry out forwarding the number by the work subprocess of the free time
According to;
Second forwarding subelement, for be not present packetization process corresponding with the data in the case where, with it is described access into
Cheng Jianli new packetization process corresponding with the data, and turned based on the vacant working subprocess in the new packetization process
Send out data described.
11. a kind of storage medium, which is characterized in that be stored with computer program in the storage medium, wherein the computer
Program is arranged to execute method described in any one of claim 1 to 7 when operation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811550472.9A CN109669979A (en) | 2018-12-18 | 2018-12-18 | The processing method and processing device of data, storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811550472.9A CN109669979A (en) | 2018-12-18 | 2018-12-18 | The processing method and processing device of data, storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109669979A true CN109669979A (en) | 2019-04-23 |
Family
ID=66145003
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811550472.9A Pending CN109669979A (en) | 2018-12-18 | 2018-12-18 | The processing method and processing device of data, storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109669979A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111240827A (en) * | 2019-12-27 | 2020-06-05 | 广东睿江云计算股份有限公司 | Improved method for transaction type database connection pool |
CN112115118A (en) * | 2020-08-20 | 2020-12-22 | 北京健康之家科技有限公司 | Database pressure measurement optimization method and device, storage medium and electronic equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101556587A (en) * | 2008-04-10 | 2009-10-14 | 中兴通讯股份有限公司 | Operation agent device for heterogeneous database |
CN102243655A (en) * | 2011-06-16 | 2011-11-16 | 苏州阔地网络科技有限公司 | Method and device for managing database connections |
US20120239698A1 (en) * | 2011-03-16 | 2012-09-20 | Fujitsu Limited | Control device, control method, and storage medium |
CN106021399A (en) * | 2016-05-12 | 2016-10-12 | 网易(杭州)网络有限公司 | Query request message processing method and apparatus |
-
2018
- 2018-12-18 CN CN201811550472.9A patent/CN109669979A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101556587A (en) * | 2008-04-10 | 2009-10-14 | 中兴通讯股份有限公司 | Operation agent device for heterogeneous database |
US20120239698A1 (en) * | 2011-03-16 | 2012-09-20 | Fujitsu Limited | Control device, control method, and storage medium |
CN102243655A (en) * | 2011-06-16 | 2011-11-16 | 苏州阔地网络科技有限公司 | Method and device for managing database connections |
CN106021399A (en) * | 2016-05-12 | 2016-10-12 | 网易(杭州)网络有限公司 | Query request message processing method and apparatus |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111240827A (en) * | 2019-12-27 | 2020-06-05 | 广东睿江云计算股份有限公司 | Improved method for transaction type database connection pool |
CN112115118A (en) * | 2020-08-20 | 2020-12-22 | 北京健康之家科技有限公司 | Database pressure measurement optimization method and device, storage medium and electronic equipment |
CN112115118B (en) * | 2020-08-20 | 2023-09-22 | 北京水滴科技集团有限公司 | Database pressure measurement optimization method and device, storage medium and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104618693B (en) | A kind of monitor video based on cloud computing handles task management method and system online | |
CN101799751B (en) | Method for building monitoring agent software of host machine | |
US8270299B2 (en) | Communicator-based token/buffer management for eager protocol support in collective communication operations | |
CN111813570A (en) | Event-driven message interaction method for power Internet of things | |
US6477569B1 (en) | Method and apparatus for computer network management | |
CN107025139A (en) | A kind of high-performance calculation Scheduling Framework based on cloud computing | |
CN101146127B (en) | A client buffer update method and device in distributed system | |
CN102185860A (en) | Standardized bottom layer control driving system for integrated circuit manufacturing equipment | |
CN105468619B (en) | Resource allocation methods and device for database connection pool | |
CN102457578B (en) | A kind of distributed network monitoring method based on case mechanism | |
US20220171652A1 (en) | Distributed container image construction scheduling system and method | |
CN1055557C (en) | Method of controlling message overload of unit program in multi processor controlling system | |
CN109669979A (en) | The processing method and processing device of data, storage medium | |
CN110297862A (en) | Data bank access method and Database-access Middleware Based | |
CN106993043A (en) | Data communication system and method based on agency | |
CN107066339A (en) | Distributed job manager and distributed job management method | |
CN111240819A (en) | Dispatching task issuing system and method | |
CN112612635B (en) | Multi-level protection method for application program | |
CN103645959A (en) | Telecom real-time system multi-process SMP (shared memory pool) interaction assembly and method | |
CN109525443B (en) | processing method and device for distributed pre-acquisition communication link and computer equipment | |
CN116719623A (en) | Job scheduling method, job result processing method and device | |
CN114257614B (en) | Multi-service-mode hospital big data platform system and resource scheduling method | |
CN115102999B (en) | DevOps system, service providing method, storage medium and electronic device | |
CN113485812B (en) | Partition parallel processing method and system based on large-data-volume task | |
CN112463167B (en) | Bank account dynamic account notification service system |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190423 |