CN113467966A - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
CN113467966A
CN113467966A CN202110603895.8A CN202110603895A CN113467966A CN 113467966 A CN113467966 A CN 113467966A CN 202110603895 A CN202110603895 A CN 202110603895A CN 113467966 A CN113467966 A CN 113467966A
Authority
CN
China
Prior art keywords
connection
target
cloud server
data request
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110603895.8A
Other languages
Chinese (zh)
Inventor
邓练兵
朱俊
逯明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuhai Dahengqin Technology Development Co Ltd
Original Assignee
Zhuhai Dahengqin Technology Development 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 Zhuhai Dahengqin Technology Development Co Ltd filed Critical Zhuhai Dahengqin Technology Development Co Ltd
Priority to CN202110603895.8A priority Critical patent/CN113467966A/en
Publication of CN113467966A publication Critical patent/CN113467966A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a data processing method and a data processing device, wherein the method can be applied to a cooperative component system, the cooperative component system provides uniform external service for a plurality of butted service systems, and each service system is provided with a cloud server; the method comprises the following steps: receiving a data request, wherein the data request comprises a server identifier of a target cloud server; determining a target connection corresponding to the server identification from a preset connection pool, and sending the data request to a target cloud server by adopting the target connection; a plurality of historical connections are stored in a preset connection pool; and when the target connection corresponding to the server identification does not exist in the preset connection pool, establishing new connection with the target cloud server, and sending the data request to the target cloud server by adopting the new connection. According to the embodiment of the invention, the time for sending the data request of the request service to the corresponding cloud server is reduced, and the resource waste when the connection with the cloud server is repeatedly established is avoided.

Description

Data processing method and device
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for data processing.
Background
With the continuous development of internet technology, services provided by the internet are more and more.
When a user needs to use a certain service, a data request needs to be sent to a cloud server corresponding to the service through a mobile terminal to request the cloud server to provide the corresponding service.
In the prior art, when a data request is sent to a cloud server, the data request is sent through a connection established in real time. However, when the data request is transmitted by the real-time connection establishment method, a certain connection establishment time is required, so that the user needs to wait for a long time before enjoying the service, and a large amount of resources are consumed for repeatedly establishing the connection.
Disclosure of Invention
In view of the above, it is proposed to provide a method and apparatus for data processing that overcomes or at least partially solves the above mentioned problems, comprising:
a data processing method is applied to a cooperative component system, the cooperative component system provides uniform external service for a plurality of service systems which are butted, and each service system is provided with a cloud server; the method comprises the following steps:
the cooperative component system receives a data request, wherein the data request comprises a server identifier of a target cloud server;
determining a target connection corresponding to the server identification from a preset connection pool, and sending the data request to a target cloud server by adopting the target connection; the preset connection pool stores a plurality of historical connections;
and when the target connection corresponding to the server identification does not exist in the preset connection pool, establishing new connection with the target cloud server, and sending the data request to the target cloud server by adopting the new connection.
Optionally, the data request includes a user level, and the target connection includes a plurality of pieces;
adopt the target to connect and send the data request to the target cloud server, include:
determining whether the number of target connections is above a first threshold;
when the number of the target connections is higher than a first threshold value, adopting any item label connection in the multiple target connections to send the data request to the target cloud server;
and when the number of the target connections is lower than a first threshold value and the user level is lower than a preset level, establishing new connection with the target cloud server.
Optionally, the plurality of historical connections are respectively provided with a connection identifier; determining target connection corresponding to the server identification from a preset connection pool, wherein the target connection comprises the following steps:
matching the server identification with the connection identifications of the plurality of historical connections;
and taking the historical connection corresponding to the connection identification matched with the server identification as the target connection.
Optionally, before establishing a new connection with the target cloud server, the method further includes:
determining whether the number of connections currently used for the target cloud server is higher than a second threshold;
when the number of the connections used by the current target cloud server is higher than a second threshold value, placing the data request into a waiting queue;
when the number of connections currently used for the target cloud server is below a second threshold, establishing a new connection with the target cloud server.
Optionally, after the data request is sent to the target cloud server by using the target connection, the method further includes:
judging whether the target connection is in an idle state or not;
and when the target connection is in an idle state, returning the target connection to a preset connection pool.
Optionally, after sending the data request to the target cloud server by using the new connection, the method further includes:
judging whether the new connection is in an idle state;
and when the new connection is in an idle state, storing the new connection into a preset connection pool according to the server identification.
Optionally, the method further comprises:
and receiving service data returned by the target cloud server according to the data request.
A data processing device is applied to a cooperative component system, the cooperative component system provides uniform external service for a plurality of service systems which are butted, and each service system is provided with a cloud server; the device comprises:
the data receiving module is used for receiving a data request, and the data request comprises a server identifier of a target cloud server;
the first sending module is used for determining target connection corresponding to the server identification from a preset connection pool and sending the data request to a target cloud server by adopting the target connection; the preset connection pool stores a plurality of historical connections;
and the second sending module is used for establishing new connection with the target cloud server when the target connection corresponding to the server identifier does not exist in the preset connection pool, and sending the data request to the target cloud server by adopting the new connection.
A server comprising a processor, a memory and a computer program stored on the memory and capable of running on the processor, the computer program when executed by the processor implementing a method of data processing as above.
A computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements a method of data processing as above.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, after receiving a data request corresponding to a server identifier comprising a target cloud server, a cooperative component system firstly determines a target connection corresponding to the server identifier from a preset connection pool storing a plurality of historical connections, and sends the data request to the target cloud server by adopting the target connection; and when the target connection corresponding to the server identification does not exist in the preset connection pool, establishing new connection with the target cloud server, and sending the data request to the target cloud server by adopting the new connection. According to the embodiment of the invention, the time for sending the data request of the request service to the corresponding cloud server is reduced, and the resource waste when the connection with the cloud server is repeatedly established is avoided.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings needed to be used in the description of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a block diagram of an overall architecture of a collaboration system, in accordance with an embodiment of the present invention;
FIG. 2 is a flow chart of the steps of a method of data processing of an embodiment of the present invention;
FIG. 3 is a flow chart of steps of another method of data processing according to an embodiment of the present invention;
FIG. 4 is a flow chart of steps of a method of further data processing according to an embodiment of the present invention;
fig. 5 is a block diagram of a data processing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The service object is served to other persons and enterprises as one of the original motive power of product design, and the demand and feeling of the service object are focused. The cooperative component system integrates government affairs service, public service and convenient service resources comprehensively around the civil fields of immigration, residence, trip, learning, employment, entrepreneurship, medical treatment, endowment and the like, optimizes service application, and helps non-local individuals and enterprises to know the local, know the local and integrate into the local and local of life.
The cooperative component system is an open application framework platform and provides support capability for service intensive access and management. The system supports integration of various business applications and information resources on a unified management platform, provides a unified user interface for users, establishes service hubs of service operators, service providers and service users, enables governments to rapidly and widely release information and provides services; the enterprise and the person at other places can know the information and use the service in time; the third party of the society can develop and utilize information resources through a public service tool, and urban information and service can be operated, maintained and managed in a centralized way.
The collaborative component system fully utilizes the leading technical capabilities in the industries such as big data, voice recognition, natural language processing, man-machine interaction and the like to construct an intelligent service system integrating intelligent prompt, intelligent question answering, intelligent recommendation and the like; according to the behavior footprint of the user, the habits and the potential requirements of the user are analyzed, services such as accurate pushing, personalized resource subscription and the like are provided, the user is supported to establish a personalized intelligent home page, the 'thousands of people and thousands of faces' of mobile service is realized, and equal, quick, personalized and all-round services and experiences are provided for enterprises and individuals in other places.
Referring to fig. 1, the collaborative component system service architecture is divided into a presentation layer, a service application layer, a support layer, a data layer and a base layer.
1. Revealing layer
The display layer is a layer directly facing to a user and is divided into the following layers according to requirements: collaborative component system (IOS), collaborative component system (Android), collaborative component system (Web console) and H5 applications; the Android and IOS have the same function and are suitable for different platforms; the Web control console provides management functions for administrator users, including user management, service management, consultation management, operation management and the like; the H5 application is a third-party service for integrating in the collaborative component system and providing the user with the function of one application program for multiple services.
2. Business application layer
The business application layer is the central pivot of the whole system, provides all business services, controls the operation of the whole system, and embodies all the capabilities provided by the product; according to the design concept of the micro-service, the layer divides the system into a plurality of micro-service modules according to different provided capabilities, wherein the micro-service modules comprise My module, voice team module, service policy, consultation service, intelligent search, home page, user center, operation management, application integration and the like, and each module operates independently, so that the high availability of the whole service is ensured, and the fine management of the system is realized.
3. Supporting layer
The supporting layer extracts partial capacity of the system and peels off the partial capacity from specific services to realize the independence of the capacity; therefore, the stable operation of the capacity can be ensured, and the multiplexing of the capacity can be realized.
4. Data layer
The data layer provides data storage of the whole system, stores data generated in the running process of the system, realizes data circulation and persistence, and is the value of the whole system.
5. Base layer
The basic layer is a physical layer, which is a physical embodiment of the capabilities of the above layers, provides the running environment, the storage environment, the network environment, the security environment and the like of the system, and is the basis for the normal running of the system.
Referring to fig. 2, a flowchart of steps of a data processing method according to an embodiment of the present invention is shown, and is applied to a collaborative component system, where the collaborative component system provides a unified external service for a plurality of service systems that are docked, and each service system is deployed with a cloud server;
specifically, the method may include the steps of:
step 201, a cooperative component system receives a data request, wherein the data request comprises a server identifier of a target cloud server;
as an example, the data request may be a request generated by a user on a mobile terminal for a service to be used.
When the user is using the collaborative component system, services provided by different business systems can be enjoyed through the collaborative component system, such as: government affairs service, public service, convenience service, etc. For each service system, a corresponding cloud server can be deployed in advance; each cloud server may be pre-provisioned with a corresponding server identification.
When a user needs to use the service of a specific business system, the user can log in the cooperative component system on the mobile terminal; and then executing corresponding operation according to the service to be used so as to generate a data request aiming at the service to be used.
When generating the data request, the target cloud server corresponding to the service to be used may be determined first, and then the data request may be generated according to the server identifier of the target cloud server.
Step 202, determining a target connection corresponding to the server identification from a preset connection pool, and sending the data request to a target cloud server by adopting the target connection; the preset connection pool stores a plurality of historical connections;
as an example, the preset connection pool may refer to a buffer pool storing previously established historical connections for respective cloud servers.
In order to reduce the time spent on sending a data request to a target cloud server, whether historical connection corresponding to a server identifier exists in a plurality of historical connections in a preset connection pool or not can be judged; when historical connection corresponding to the server identifier exists, it can be shown that historical connection for the target cloud server is stored in the preset connection pool, at this time, the historical connection can be used as target connection corresponding to the server identifier, and the target connection is adopted to directly send the data request to the target cloud server corresponding to the server identifier, so that time and resources consumed when the data request is sent are reduced.
And 203, when the preset connection pool does not have the target connection corresponding to the server identification, establishing a new connection with the target cloud server, and sending the data request to the target cloud server by adopting the new connection.
Of course, the preset connection pool may not have a target connection corresponding to the server identifier at the current time, for example: target connections corresponding to the server identifications may be stored in a preset connection pool, but are currently used by other data requests; or the preset connection pool does not store the target connection corresponding to the server identifier.
At this time, a connection with the target cloud server may be newly established, and then the data request may be sent to the target cloud server through the newly established connection, so as to respond to the data request of the user in time.
In an embodiment of the present invention, the method may further include the following steps:
and receiving service data returned by the target cloud server according to the data request.
After sending the data request to the target cloud server, the target cloud server may return service data to the mobile terminal logged in by the collaborative component system in response to the data request, so as to provide the user with the required service.
In the embodiment of the invention, after receiving a data request, a cooperative component system firstly determines a target connection corresponding to a server identifier from a preset connection pool, and sends the data request to a target cloud server by adopting the target connection; and when the target connection corresponding to the server identification does not exist in the preset connection pool, establishing new connection with the target cloud server, and sending the data request to the target cloud server by adopting the new connection. According to the embodiment of the invention, the time for sending the data request of the request service to the corresponding cloud server is reduced, and the resource waste when the connection with the cloud server is repeatedly established is avoided.
Referring to fig. 3, a flowchart illustrating steps of another data processing method according to an embodiment of the present invention is shown, which may specifically include the following steps:
step 301, the cooperative component system receives a data request;
when a user needs to use a specific service, the user can log in the cooperative component system on the mobile terminal; and then executing corresponding operation according to the service to be used so as to generate a data request aiming at the service to be used.
Step 302, connecting identifiers are respectively arranged on the multiple historical connections; matching the server identification with the connection identifications of the plurality of historical connections;
as an example, when each connection is established, a connection identifier may be set for the established connection, and the connection identifier may correspond to the server identifier, so that when determining the target connection, the target connection corresponding to the server identifier of the target cloud server may be determined directly according to the correspondence between the server identifier and the connection identifier.
After the data request is received, the server identifier and the connection identifier of each historical connection may be matched one by one, so as to determine a target connection corresponding to the target cloud server from a preset connection pool.
Step 303, taking the historical connection corresponding to the connection identifier matched with the server identifier as a target connection;
when a connection identifier corresponding to a server identifier corresponding to a target cloud server is matched among the connection identifiers of the plurality of historical connections, the historical connection corresponding to the connection identifier obtained through matching can be used as the target connection.
Step 304, the data request comprises a user level, and the target connection comprises a plurality of connections; determining whether the number of target connections is above a first threshold;
the user level may refer to a level of a user who logs in the collaborative component system, and the level may be divided according to an importance level of each user in advance, or may be divided according to other user situations.
When a large number of data requests which need to be sent to a target cloud server occur, all target connections in a preset connection pool may be occupied; in this case, if an important user needs to use a service corresponding to the target cloud server, the user may wait for a long time.
In order to avoid waiting for a long time when the more important user uses the service corresponding to the target cloud server, before the data request needs to be sent to the target cloud server by using the target connection, it may be determined whether the number of target connections in the preset connection pool is higher than a first threshold value, so that a sufficient number of target connections are reserved in the preset connection pool for the more important user to use. The first threshold may be set according to circumstances, and the embodiment of the present invention is not limited thereto.
305, when the number of the target connections is higher than a first threshold value, adopting any item label connection in a plurality of target connections to send a data request to a target cloud server;
when the number of the target connections is higher than the first threshold value, it can be represented that a sufficient number of target connections still exist in the currently preset connection pool, and even if any item label connection is adopted to send the data request to the target cloud server, the use of the more important user cannot be influenced. At this time, any entry mark connection in the multiple target connections may be adopted, and the data request may be sent to the target cloud server for processing.
In an embodiment of the present invention, after sending the data request to the target cloud server by using the target connection, the method may further include the following steps:
judging whether the target connection is in an idle state or not; and when the target connection is in an idle state, returning the target connection to a preset connection pool.
In practical application, in order to ensure the number of connections in the preset connection pool, the state of the target connection may be monitored after the data request is sent to the target cloud server by using the target connection.
When the target connection is in a busy state, it may indicate that the target connection is in use; when the target is in idle state, it may indicate that the target connection is used up, and at this time, the target connection in idle state may be returned to the preset connection pool for subsequent use when sending data request.
And step 306, when the number of the target connections is lower than a first threshold value and the user level is lower than a preset level, establishing new connections with the target cloud server.
Due to the fact that the number of the target connections is limited, if all the target connections are in a busy state, the data requests of subsequent important users cannot be sent to the target cloud server in time; therefore, when the number of the target connections is lower than the first threshold, the user level corresponding to the data request may be determined first, so as to avoid the situation that the data request of the user with a higher target level is not available due to the fact that the target connection is used for the data request with a lower user level when the target connection is less.
In an example, if the user level is higher than a preset level, the data request may be sent to the target cloud server using any one of the target connections.
In an embodiment of the present invention, after sending the data request to the target cloud server by using the new connection, the method may further include the following steps:
judging whether the new connection is in an idle state; and when the new connection is in an idle state, storing the new connection into a preset connection pool according to the server identification.
In practical application, in order to ensure the number of connections in the preset connection pool, the state of the new connection may be monitored after the data request is sent to the target cloud server by using the newly established new connection.
When a new connection is in a busy state, it may indicate that the new connection is in use; when a new connection is idle, it may indicate that the new connection has been used, and at this point, the new connection in the idle state may be returned to a preset connection pool for subsequent use in sending data requests.
In the embodiment of the invention, after receiving a data request, the cooperative component system firstly matches a server identifier with a plurality of historical connection identifiers, and takes the historical connection corresponding to the connection identifier matched with the server identifier as a target connection; when the number of the target connections is higher than a first threshold value, adopting any item label connection in the multiple target connections to send the data request to the target cloud server; and when the number of the target connections is lower than a first threshold value and the user level is lower than a preset level, establishing new connection with the target cloud server. By the embodiment of the invention, whether the data request is sent by adopting the target connection is determined according to the number of the target connection pools in the preset connection pools and the user grades of the users, the problem that the data request of the important user is sent for too long time due to no target connection is solved, and the use experience of the important user is ensured.
Referring to fig. 4, a flowchart illustrating steps of another data processing method according to an embodiment of the present invention is shown, which may specifically include the following steps:
step 401, the cooperative component system receives a data request;
when a user needs to use a specific service, the user can log in the cooperative component system on the mobile terminal; and then executing corresponding operation according to the service to be used so as to generate a data request aiming at the service to be used.
Step 402, determining a target connection corresponding to the server identification from a preset connection pool, and sending the data request to a target cloud server by adopting the target connection;
after the data request is received, the server identifier and the connection identifier of each historical connection may be matched one by one, so as to determine a target connection corresponding to the target cloud server from a preset connection pool.
When a connection identifier corresponding to a server identifier corresponding to a target cloud server is matched in connection identifiers of a plurality of historical connections, the historical connection corresponding to the connection identifier obtained through matching can be used as a target connection; then, the data request can be directly sent to a target cloud server corresponding to the server identifier by adopting target connection for processing.
Step 403, when there is no target connection corresponding to the server identifier in the preset connection pool, determining whether the number of connections currently used for the target cloud server is higher than a second threshold;
the number of data requests that can be processed by one cloud server is also limited, and if a large number of connections have been made to send data requests to a target cloud server, a new connection is established to send data requests to the target cloud server, which may cause the target cloud server to malfunction.
In order to avoid the above problem, before a new connection needs to be established, the number of the connections currently used for the target cloud server may be determined, and then it may be determined whether the number exceeds a second threshold; the second threshold may be set according to practical situations, and the embodiment of the present invention is not limited thereto.
Step 404, when the number of the connections used by the current target cloud server is higher than a second threshold value, placing the data request into a waiting queue;
the waiting queue may refer to a preset cache region for caching a data request that cannot be sent to the target cloud server in time.
When the number of connections used for the target cloud server has exceeded the second threshold, it may indicate that the current target cloud server has no capability to re-receive and process new data requests; at this time, reestablishing a new connection may cause the target cloud server to crash, so that the data request may be placed in a waiting queue, and when a target connection returns to the preset connection pool, the returned target connection is adopted to send the data request to the target cloud server.
Step 405, when the number of connections currently used for the target cloud server is lower than a second threshold, establishing a new connection with the target cloud server.
When the number of connections currently used for the target cloud server is below a second threshold, it may indicate that the current target cloud server also has the capability of receiving and processing new data requests. At this point, a new connection with the target cloud server may continue to be established; and then sending the data request to the target cloud server by adopting the newly established new connection.
In the embodiment of the invention, the cooperative component system receives a data request, determines a target connection corresponding to the server identifier from a preset connection pool, sends the data request to the target cloud server by adopting the target connection, and judges whether the number of connections established for the target cloud server is higher than a second threshold value or not when the target connection corresponding to the server identifier does not exist in the preset connection pool; when the number of the connections aiming at the target cloud server is higher than a second threshold value, placing the data request into a waiting queue; and when the number of the connections for the target cloud server is lower than a second threshold value, establishing a new connection with the target cloud server, and sending the data request to the target cloud server by adopting the new connection. By the embodiment of the invention, whether to continue establishing the new connection is determined according to the number of the connections used by the current target cloud server, so that the problem that the cloud server is overloaded possibly due to the fact that the new connection is still established when the cloud server processes more data sent by the connection is solved.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 5, a schematic structural diagram of a data processing apparatus according to an embodiment of the present invention is shown, and is applied to a cooperative component system, where the cooperative component system provides a unified external service for a plurality of service systems that are docked, and each service system is deployed with a cloud server;
specifically, the following modules may be included:
a data receiving module 501, configured to receive a data request, where the data request includes a server identifier of a target cloud server;
a first sending module 502, configured to determine a target connection corresponding to the server identifier from a preset connection pool, and send the data request to a target cloud server by using the target connection; the preset connection pool stores a plurality of historical connections;
a second sending module 503, configured to establish a new connection with the target cloud server when there is no target connection corresponding to the server identifier in the preset connection pool, and send the data request to the target cloud server by using the new connection.
In one embodiment of the invention, the data request includes a user level, and the target connection includes a plurality of connections;
a first sending module 502, comprising:
the connection number judgment submodule is used for judging whether the number of the target connections is higher than a first threshold value or not;
the data request first sending submodule is used for sending the data request to the target cloud server by adopting any item label connection in the target connections when the number of the target connections is higher than a first threshold value;
and the data request second sending submodule is used for establishing new connection with the target cloud server when the number of the target connections is lower than the first threshold value and the user level is lower than the preset level.
In an embodiment of the invention, a plurality of historical connections are respectively provided with a connection identifier; the second sending module 503 includes:
the matching submodule is used for matching the server identifier with the connection identifiers in the historical connection;
and the target connection determining submodule is used for taking the historical connection corresponding to the connection identifier matched with the server identifier as the target connection.
In an embodiment of the present invention, the apparatus further includes:
the third sending module is used for judging whether the number of the connections used by the current target cloud server is higher than a second threshold value before establishing new connection with the target cloud server; when the number of the connections used by the current target cloud server is higher than a second threshold value, placing the data request into a waiting queue; when the number of connections currently used for the target cloud server is below a second threshold, establishing a new connection with the target cloud server.
In an embodiment of the present invention, the apparatus further includes:
the target connection returning module is used for judging whether the target connection is in an idle state or not after the data request is sent to the target cloud server by adopting the target connection; and when the target connection is in an idle state, returning the target connection to a preset connection pool.
In an embodiment of the present invention, the apparatus further includes:
the new connection storage module is used for judging whether the new connection is in an idle state or not after the data request is sent to the target cloud server by adopting the new connection; and when the new connection is in an idle state, storing the new connection into a preset connection pool according to the server identification.
In an embodiment of the present invention, the apparatus further includes:
and the service data receiving module is used for receiving service data returned by the target cloud server according to the data request.
In the embodiment of the invention, after receiving a data request corresponding to a server identifier comprising a target cloud server, a cooperative component system firstly determines a target connection corresponding to the server identifier from a preset connection pool storing a plurality of historical connections, and sends the data request to the target cloud server by adopting the target connection; and when the target connection corresponding to the server identification does not exist in the preset connection pool, establishing new connection with the target cloud server, and sending the data request to the target cloud server by adopting the new connection. According to the embodiment of the invention, the time for sending the data request of the request service to the corresponding cloud server is reduced, and the resource waste when the connection with the cloud server is repeatedly established is avoided.
The embodiment of the present invention further provides a server, which includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, and when the computer program is executed by the processor, the method for processing data as above is implemented.
The embodiment of the invention also provides a computer readable storage medium, a computer program is stored on the computer readable storage medium, and the computer program is used for realizing the data processing method when being executed by the processor.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. 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 terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, 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 terminal 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 terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The method and apparatus for data processing provided above are described in detail, and a specific example is applied herein to illustrate the principles and embodiments of the present invention, and the above description of the embodiment is only used to help understand the method and core ideas of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A data processing method is characterized in that the method is applied to a cooperative component system, the cooperative component system provides unified external services for a plurality of service systems which are in butt joint, and each service system is provided with a cloud server; the method comprises the following steps:
the cooperative component system receives a data request, wherein the data request comprises a server identification of a target cloud server;
determining a target connection corresponding to the server identification from a preset connection pool, and sending the data request to the target cloud server by adopting the target connection; the preset connection pool stores a plurality of historical connections;
and when the preset connection pool does not have the target connection corresponding to the server identification, establishing a new connection with the target cloud server, and sending the data request to the target cloud server by adopting the new connection.
2. The method of claim 1, wherein the data request includes a user level, the target connection includes a plurality of pieces;
the sending the data request to the target cloud server by using the target connection includes:
determining whether the number of target connections is above a first threshold;
when the number of the target connections is higher than a first threshold value, adopting any item label connection in a plurality of target connections to send the data request to the target cloud server;
and when the number of the target connections is lower than a first threshold value and the user level is lower than a preset level, establishing new connections with the target cloud server.
3. The method according to claim 1, wherein the plurality of historical connections are respectively provided with connection identifiers; the determining of the target connection corresponding to the server identifier from the preset connection pool includes:
matching the server identification with the connection identifications of the plurality of historical connections;
and taking the historical connection corresponding to the connection identification matched with the server identification as the target connection.
4. The method of claim 1, wherein prior to establishing the new connection with the target cloud server, the method further comprises:
determining whether a number of connections currently in use for the target cloud server is above a second threshold;
when the number of connections currently used for the target cloud server is higher than the second threshold value, placing the data request into a waiting queue;
establishing a new connection with the target cloud server when the number of connections currently used for the target cloud server is below the second threshold.
5. The method of claim 1, wherein after sending the data request to the target cloud server using the target connection, the method further comprises:
judging whether the target connection is in an idle state or not;
and when the target connection is in an idle state, returning the target connection to the preset connection pool.
6. The method of claim 1, wherein after sending the data request to the target cloud server using the new connection, the method further comprises:
judging whether the new connection is in an idle state or not;
and when the new connection is in an idle state, storing the new connection into the preset connection pool according to the server identification.
7. The method of claim 1, further comprising:
and receiving service data returned by the target cloud server according to the data request.
8. A data processing device is applied to a cooperative component system, the cooperative component system provides unified external services for a plurality of service systems which are in butt joint, and each service system is provided with a cloud server; the device comprises:
the data receiving module is used for receiving a data request, and the data request comprises a server identifier of a target cloud server;
the first sending module is used for determining a target connection corresponding to the server identifier from a preset connection pool and sending the data request to the target cloud server by adopting the target connection; the preset connection pool stores a plurality of historical connections;
and the second sending module is used for establishing new connection with the target cloud server when the target connection corresponding to the server identification does not exist in the preset connection pool, and sending the data request to the target cloud server by adopting the new connection.
9. A server comprising a processor, a memory and a computer program stored on the memory and capable of running on the processor, the computer program, when executed by the processor, implementing a method of data processing according to any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out a method of data processing according to any one of claims 1 to 7.
CN202110603895.8A 2021-05-31 2021-05-31 Data processing method and device Pending CN113467966A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110603895.8A CN113467966A (en) 2021-05-31 2021-05-31 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110603895.8A CN113467966A (en) 2021-05-31 2021-05-31 Data processing method and device

Publications (1)

Publication Number Publication Date
CN113467966A true CN113467966A (en) 2021-10-01

Family

ID=77871875

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110603895.8A Pending CN113467966A (en) 2021-05-31 2021-05-31 Data processing method and device

Country Status (1)

Country Link
CN (1) CN113467966A (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1972276A (en) * 2006-11-26 2007-05-30 华为技术有限公司 A management method and system for protocol access
CN101309233A (en) * 2008-06-04 2008-11-19 腾讯科技(深圳)有限公司 Method realizing TCP connection reusing in instant communication
CN103546571A (en) * 2013-10-29 2014-01-29 北京华胜天成科技股份有限公司 Platform-as-a-service (PaaS) realizing method and device
DE102013104383A1 (en) * 2013-04-30 2014-10-30 Deutsche Telekom Ag Method for limiting a connection number of communication links
US20150006726A1 (en) * 2013-06-28 2015-01-01 Oracle International Corporation System and method for cloud connection pool
CN105138693A (en) * 2015-09-18 2015-12-09 联动优势科技有限公司 Method and device for having access to databases
CN107291747A (en) * 2016-03-31 2017-10-24 北京优朋普乐科技有限公司 A kind of management method of database connection pool, apparatus and system
CN109818810A (en) * 2019-03-18 2019-05-28 深圳市网心科技有限公司 A kind of access server connection optimization method, access server and communication system
CN110971703A (en) * 2019-12-11 2020-04-07 腾讯科技(深圳)有限公司 Service request method, device, server and storage medium based on connection pool
CN111367983A (en) * 2020-03-10 2020-07-03 中国联合网络通信集团有限公司 Database access method, system, device and storage medium
CN111770157A (en) * 2020-06-24 2020-10-13 广东浪潮大数据研究有限公司 Business processing method and device, electronic equipment and storage medium
CN112383632A (en) * 2020-11-17 2021-02-19 珠海大横琴科技发展有限公司 Load balancing method and device
WO2021071032A1 (en) * 2019-10-09 2021-04-15 Samsung Electronics Co., Ltd. Device access control method and apparatus for internet of things

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1972276A (en) * 2006-11-26 2007-05-30 华为技术有限公司 A management method and system for protocol access
CN101309233A (en) * 2008-06-04 2008-11-19 腾讯科技(深圳)有限公司 Method realizing TCP connection reusing in instant communication
DE102013104383A1 (en) * 2013-04-30 2014-10-30 Deutsche Telekom Ag Method for limiting a connection number of communication links
US20150006726A1 (en) * 2013-06-28 2015-01-01 Oracle International Corporation System and method for cloud connection pool
CN103546571A (en) * 2013-10-29 2014-01-29 北京华胜天成科技股份有限公司 Platform-as-a-service (PaaS) realizing method and device
CN105138693A (en) * 2015-09-18 2015-12-09 联动优势科技有限公司 Method and device for having access to databases
CN107291747A (en) * 2016-03-31 2017-10-24 北京优朋普乐科技有限公司 A kind of management method of database connection pool, apparatus and system
CN109818810A (en) * 2019-03-18 2019-05-28 深圳市网心科技有限公司 A kind of access server connection optimization method, access server and communication system
WO2021071032A1 (en) * 2019-10-09 2021-04-15 Samsung Electronics Co., Ltd. Device access control method and apparatus for internet of things
CN110971703A (en) * 2019-12-11 2020-04-07 腾讯科技(深圳)有限公司 Service request method, device, server and storage medium based on connection pool
CN111367983A (en) * 2020-03-10 2020-07-03 中国联合网络通信集团有限公司 Database access method, system, device and storage medium
CN111770157A (en) * 2020-06-24 2020-10-13 广东浪潮大数据研究有限公司 Business processing method and device, electronic equipment and storage medium
CN112383632A (en) * 2020-11-17 2021-02-19 珠海大横琴科技发展有限公司 Load balancing method and device

Similar Documents

Publication Publication Date Title
CN102138156B (en) Persisting a group in an instant messaging application
EP2869545B1 (en) Method and device for distributing mobile attendant call
KR101182463B1 (en) Call group management using the session initiation protocol
CA3062580A1 (en) An enterprise group establishing method and computer device in an instant message system
US9813496B2 (en) Method and apparatus for collaborating in a work environment
CN101365119A (en) Video recording balance equalizing method used for network video monitoring system
CN111277481B (en) Method, device, equipment and storage medium for establishing VPN tunnel
CN109510758B (en) Session establishing method, terminal and system
CN101365120A (en) Data centralized management method for network video monitoring system
US20160140012A1 (en) Methods And Systems For Status Determination
CN101360129A (en) Mobile phone short message sending method for network video monitoring system
CN110750780B (en) User role permission fusion method, device and equipment based on multi-service system
CN113468552A (en) Data processing method and device
CN113360308A (en) Abnormal event processing method and device
KR20190039941A (en) Methods and apparatuses for centralized management of individuals or equipment based on instant messaging applications
CN103001989A (en) Parameter receiving method and system
CN113467668A (en) Data processing method and device
CN113467966A (en) Data processing method and device
CN113360307B (en) Data processing method and device
CN102447685A (en) Control method, server and system for IP multimedia subsystem (IMS)-based video monitoring nephoscope
CN113765745A (en) Service performance testing method and device, terminal equipment and storage medium
CN116260824A (en) Service data transmission method, system, storage medium and related equipment
CN113469842A (en) System operation and maintenance method and device
CN113360166A (en) Data processing method and device
CN112243102A (en) Notice notification method, device, terminal equipment and storage 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