CN110489474A - A kind of method, apparatus of data processing, medium and electronic equipment - Google Patents

A kind of method, apparatus of data processing, medium and electronic equipment Download PDF

Info

Publication number
CN110489474A
CN110489474A CN201910715752.9A CN201910715752A CN110489474A CN 110489474 A CN110489474 A CN 110489474A CN 201910715752 A CN201910715752 A CN 201910715752A CN 110489474 A CN110489474 A CN 110489474A
Authority
CN
China
Prior art keywords
database
long connection
request
information
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910715752.9A
Other languages
Chinese (zh)
Other versions
CN110489474B (en
Inventor
雷磊
梁俊仁
丁之卓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Douyin Vision Co Ltd
Douyin Vision Beijing Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910715752.9A priority Critical patent/CN110489474B/en
Publication of CN110489474A publication Critical patent/CN110489474A/en
Application granted granted Critical
Publication of CN110489474B publication Critical patent/CN110489474B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • 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/547Remote procedure calls [RPC]; Web services

Abstract

Present disclose provides a kind of method, apparatus of data processing, medium and electronic equipments.The described method includes: the port by the first short connection receives request message;The request message is parsed, database instruction is obtained;Judge in resource pool whether to include the long connection of database associated with the database instruction;If so, obtaining the first data result according to the database instruction and the long connection of the database;If it is not, then establishing the long connection of database associated with the database instruction, and first data result is obtained according to the database instruction and the long connection of the database;Wherein, the long connection of the database is the channel that data are exchanged with multiple databases.The disclosure realizes idempotence processing, is suitble to the requirement of the short connection under FaaS framework.The quantity for reducing the long connection of database, improves resource multiplex rate.Neatly dilatancy makes user realize underlying resource scalable appearance in the state of unaware.

Description

A kind of method, apparatus of data processing, medium and electronic equipment
Technical field
This disclosure relates to database field, in particular to a kind of method, apparatus of data processing, medium and electronics Equipment.
Background technique
Under conventional situation, it is desirable to handle database and have to (service (full name in English Function in function from client As a Service, abbreviation FaaS) be some function under framework) establish that database is long to be connected with database service end, and lead to It crosses the long connection of the database and sends database processing instruction.
Since the function in FaaS framework is very more, in the case where big data, need function obtain data, bottom can Different databases can be docked, the long connection quantity explosion of database is will lead to as a result, system performance is caused to decline.
Summary of the invention
The Summary is provided so that with brief form introduction design, these designs will be in specific implementation below Mode part is described in detail.The Summary is not intended to identify the key feature of claimed technical solution or must Feature is wanted, is intended to be used to limit the range of the technical solution of required protection.
The method, apparatus for being designed to provide a kind of data processing, medium and the electronic equipment of the disclosure, are able to solve State at least one technical problem mentioned.Concrete scheme is as follows:
According to the specific embodiment of the disclosure, in a first aspect, the disclosure provides a kind of method of data processing, comprising:
Request message is received by the port of the first short connection;
The request message is parsed, database instruction is obtained;
Judge in resource pool whether to include the long connection of database associated with the database instruction;
If so, obtaining the first data result according to the database instruction and the long connection of the database;
If it is not, then establishing the long connection of database associated with the database instruction, and according to the database instruction First data result is obtained with the long connection of the database;
Wherein, the long connection of the database is the channel that data are exchanged with multiple databases.
According to the specific embodiment of the disclosure, second aspect, the disclosure provides a kind of device of data processing, comprising:
Receiving unit, for receiving request message by the port of the first short connection;
Resolution unit obtains database instruction for parsing the request message;
Judging unit, for judging in resource pool whether to include the long company of database associated with the database instruction It connects;
The first data result unit is obtained, if the output result for the judging unit is "Yes", according to the number The first data result is obtained according to library instruction and the long connection of the database;
Establish the long connection unit of database, if for the judging unit output result be "No", establish with it is described The long connection of the associated database of database instruction, and according to the database instruction and the long connection acquisition of the database First data result;
Wherein, the long connection of the database is the channel that data are exchanged with multiple databases.
According to the specific embodiment of the disclosure, the third aspect, the disclosure provides a kind of computer readable storage medium, On be stored with computer program, when described program is executed by processor realize as described in any one of first aspect data processing side Method.
According to the specific embodiment of the disclosure, fourth aspect, the disclosure provides a kind of electronic equipment, comprising: one or Multiple processors;Storage device, for storing one or more programs, when one or more of programs are by one or more When a processor executes, so that one or more of processors realize the side of the data processing as described in any one of first aspect Method.
The above scheme of the embodiment of the present disclosure compared with prior art, at least has the advantages that
Present disclose provides a kind of method, apparatus of data processing, medium and electronic equipments.The described method includes: passing through The port of first short connection receives request message;The request message is parsed, database instruction is obtained;Judge in resource pool whether Including the long connection of database associated with the database instruction;If so, according to the database instruction and the data The long connection in library obtains the first data result;If it is not, then establishing the long connection of database associated with the database instruction, and root First data result is obtained according to the database instruction and the long connection of the database;Wherein, the long connection of the database It is the channel that data are exchanged with multiple databases.
The disclosure realizes idempotence processing, is suitble to the requirement of the short connection under FaaS framework.Reduce the long company of database The quantity connect improves resource multiplex rate.Neatly dilatancy makes user realize that underlying resource is scalable in the state of unaware Hold.
Detailed description of the invention
In conjunction with attached drawing and refer to following specific embodiments, the above and other feature, advantage of each embodiment of the disclosure and Aspect will be apparent.In attached drawing, the same or similar appended drawing reference indicates the same or similar element.It should manage Solution attached drawing is schematically that original part and element are not necessarily drawn to scale.In the accompanying drawings:
Fig. 1 shows the schematic diagram of the method for data processing under conventional situation;
Fig. 2 shows the schematic diagrames according to the method for the data processing of the embodiment of the present disclosure;
Fig. 3 shows the schematic diagram of the method for the data processing according to the embodiment of the present disclosure;
Fig. 4 shows the flow chart of the method for the data processing according to the embodiment of the present disclosure;
Fig. 5 shows the unit block diagram of the device of the data processing according to the embodiment of the present disclosure;
Fig. 6 shows electronic equipment attachment structure schematic diagram according to an embodiment of the present disclosure.
Specific embodiment
Embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the certain of the disclosure in attached drawing Embodiment, it should be understood that, the disclosure can be realized by various forms, and should not be construed as being limited to this In the embodiment that illustrates, providing these embodiments on the contrary is in order to more thorough and be fully understood by the disclosure.It should be understood that It is that being given for example only property of the accompanying drawings and embodiments effect of the disclosure is not intended to limit the protection scope of the disclosure.
It should be appreciated that each step recorded in disclosed method embodiment can execute in a different order, And/or parallel execution.In addition, method implementation may include additional step and/or omit the step of execution is shown.This public affairs The range opened is not limited in this respect.
Terms used herein " comprising " and its deformation are that opening includes, i.e., " including but not limited to ".Term "based" It is " being based at least partially on ".Term " one embodiment " expression " at least one embodiment ";Term " another embodiment " indicates " at least one other embodiment ";Term " some embodiments " expression " at least some embodiments ".The correlation of other terms is fixed Justice provides in will be described below.
It is noted that the concepts such as " first " that refers in the disclosure, " second " are only used for different devices, module or list Member distinguishes, and is not intended to limit the sequence or relation of interdependence of function performed by these devices, module or unit.
It is noted that referred in the disclosure "one", the modification of " multiple " be schematically and not restrictive this field It will be appreciated by the skilled person that being otherwise construed as " one or more " unless clearly indicate otherwise in context.
The being merely to illustrate property of title of the message or information that are interacted between multiple devices in disclosure embodiment Purpose, and be not used to limit the range of these message or information.
The alternative embodiment of the disclosure is described in detail with reference to the accompanying drawing.
To the first embodiment that the disclosure provides, i.e., a kind of embodiment of the method for data processing.
The embodiment of the present disclosure is described in detail below with reference to Fig. 1, Fig. 2 and Fig. 3, wherein Fig. 1 shows conventional situation The schematic diagram of the method for lower data processing;Fig. 2 shows the schematic diagrames according to the method for the data processing of the embodiment of the present disclosure;Figure 3 show the schematic diagram of the method for the data processing according to the embodiment of the present disclosure;Fig. 4 shows the number according to the embodiment of the present disclosure According to the flow chart of the method for processing.
Shown in Figure 4, step S401 receives request message by the port of the first short connection.
Port is the outlet of equipment and extraneous Communication.Port described in the embodiment of the present disclosure is virtual port, the void Quasi- port refers to the port in computer-internal or switch router, and virtual port is invisible.For example, hypertext transfer protocol (full name in English Hyper Text Transfer Protocol, abbreviation HTTP) proxy server well known port are as follows: 80/8080/ 3128/8081/9098;Firewall security session translation-protocol (full name in English Protocol for sessions traversal Across firewall securely, abbreviation SOCKS) agency agreement server well known port are as follows: 1080;File Transfer Protocol (full name in English File Transfer Protocol, abbreviation FTP) proxy server well known port are as follows: 21;Telnet (full name in English Telecommunications Network, abbreviation Telnet) protocol proxy server well known port are as follows: 23.
It is shown in Figure 1, traditionally, it is desirable to which handling database must be by remote terminal and database service end The long connection of database is established, and database processing instruction is sent by the long connection of the database.It is likely to occur multiple remote terminals The same request message is connected with the dedicated database length of Database oneself simultaneously.Thus the service of mass data library is occupied The resource at end seriously affects the system performance at database service end, reduces the efficiency at database service end.
The embodiment of the present disclosure is based on method caused by idempotence thought.The idempotence refers to arbitrarily repeatedly to be held in a program It is influenced caused by row identical as the influence once executed.
The long connection of database is the channel that data are exchanged with multiple databases.
The long connection of database is exactly the information connecting with database established in memory in data abstraction layer.By database Long connection saves can reduce the time connected every time in memory, improve the speed of data processing.
It refers to shown in Fig. 2 and Fig. 3, the port for passing through the first short connection receives request message, not by number Database processing instruction is obtained according to the long connection in library, but establishes a data abstraction layer between remote terminal and database. The request message that each remote terminal is sent is received by the port of the first short connection by data abstraction layer, respectively according in request Hold it is different request message is classified, one database of each type and Database is long to be connected, and passes through corresponding number The data result that database returns is obtained according to the long connection in library.To reduce the quantity of the long connection of database, it is multiple to improve resource With rate.
Request message can be according to HTTP generation, be also possible to mode that the mode that RPC is called generates or customized It generates.The embodiment of the present disclosure is not particularly limited.
The short connection is exactly the stateless communication connection established between remote terminal and data abstraction layer, so as to subtract Few resources occupation rate.Improve user experience.
Optionally, the port for passing through the first short connection receives request message, comprising the following steps:
Step S401-1 receives the request message that first function is sent by the port of the described first short connection.
For example, issuing request message, while remote terminal and number by the function of process in remote terminal for FaaS framework According to being stateless communication connection between level of abstraction (such as using User Datagram Protocol (full name in English User Datagram Protocol, abbreviation UDP) or HTTP);When the function in FaaS framework is very more, remote terminal process will not be influenced Efficiency.
Step S402 parses the request message, obtains database instruction.
In general, request message includes protocol header information and protocol entity information.
Protocol header information includes the information and information associated with protocol entity of communications protocol.For example, the request of HTTP disappears The protocol header information of breath includes: protocol type, target domain name and port, source domain name and port, uniform resource identifier, can receive Data type, compress mode, language, connection type.
Protocol entity information includes the request content that requesting party sends.
Since request message is to be sealed a variety of different types of information according to preset format in the form of a kind of communications protocol It is transmitted in a message, therefore, needing for request message to be reduced into after receiving request message directly to utilize Information.
The parsing is exactly message to be analyzed according to preset format, and the information in message is restored.
The parsing request message, obtains database instruction, comprising the following steps:
Step S402-1 obtains agreement transmission rule according to the request message.
For example, request message is the message encapsulated according to HTTP, pass through the protocol header acquisition of information protocol class of request message Type is HTTP type, then the agreement transmission rule of request message is HTTP.
Step S402-2 parses the request message based on the agreement transmission rule, obtain the first protocol entity information and First protocol header information.
Step S402-3 according to the first protocol entity information and default request body rule information acquisition request type and is asked Seek content.
Default request body rule information is exactly the preset rules of the protocol entity information of organizing-request message, so as to data abstraction Layer can obtain correct information according to default request body rule information.
Due to including a plurality of types of information in the first protocol entity information, if these information are placed on a message In, it needs to organize together these information according to default request body rule information, generates the first protocol entity information.
The first protocol entity information includes request type and request content in the embodiment of the present disclosure.For example, if request message It is inquiry data-base content, then request type is 1, and request content includes: the field of inquiry, the database-name of inquiry, data The corresponding table name in library and constraint condition;If request message is to be inserted into data-base content, request type 2, in request Appearance includes: insertion field and field value, the database-name of insertion, the corresponding table name of database and constraint condition;It deletes Request type be 3;The request type of modification is 4.
Optionally, described according to the first protocol entity information and default request body rule information acquisition request type and to ask Seek content, comprising the following steps:
Step S402-3-1, judges whether the format of the first protocol entity information meets bytestream format.
Byte stream is made of byte, and character stream is made of character.Character is made of two bytes in Java.Word Throttling is that the subclass of most basic, all InputStream and OutputStream are all byte streams, is used primarily in processing two Binary data.For example, bytestream format, comprising: JSON format.
Step S402-3-2 if so, carrying out unserializing processing to the first protocol entity information, and is asked according to default Ask body rule information acquisition request type and request content.
Unserializing processing is exactly that byte stream is converted into the process of the default request identifiable information of body rule information.
Step S402-4 obtains the database instruction according to the request type and the request content.
The database instruction includes the process instruction to multiple databases.It meanwhile also including a plurality of finger to database It enables.For example, to the processing batch instruction of database.
Whether step S403 judges in resource pool to include the long connection of database associated with the database instruction.
The long connection of database is exactly the information connecting with database established in memory in data abstraction layer.By database Long connection saves can reduce the time connected every time in memory, improve the speed of data processing.
And resource pool is exactly a kind of configuration mechanism, is the set for saving the long connection of database.Resource pool connects database length It connects according to predetermined order regular weaves together, the long connection of database is effectively managed.It is long that searching database can be improved The speed of connection.
In resource pool, the feature of the database instruction is associated with the long connection of database.For example, the database of inquiry The feature of database instruction is constituted with the set of the tables of data in database.
Step S404, if so, obtaining the first data result according to the database instruction and the long connection of the database.
First data result i.e. database root return to the data result of data abstraction layer according to database instruction.
Step S405, if it is not, then establishing the long connection of database associated with the database instruction, and according to the number First data result is obtained according to library instruction and the long connection of the database.
It optionally, further include following step after the long connection of foundation database associated with the database instruction It is rapid:
The long connection of the database is saved in the resource pool by step S405-1.
In order to guarantee that the first data result can be returned to correctly to the remote terminal for sending request message, optionally, The method also includes following steps:
Step S406 establishes the first incidence relation between the first protocol header information and the long connection of the database.
Since the long connection of database is to be established according to database instruction or associated with the database instruction;And data Library command source is in the first protocol entity information, and therefore, the first protocol header information associated with the first protocol entity information can be with The first incidence relation is established in the long connection of database.
Step S407 obtains corresponding first agreement according to first data result and first incidence relation Head information.
For example, the first incidence relation can be indicated with the handle of the first data result, that is, the handle corresponds to The long connection of database, further corresponds to the first protocol header information, can be with by the handle after obtaining the first data result Obtain the first protocol header information.
The purpose of the first protocol header information obtained seeks to obtain the communication information of corresponding remote terminal.
Step S408, according to the first protocol header information, first data result and default response body rule information Generate request response.
The request response is the response message that data abstraction layer is generated according to the request of request message.In general, asking Seeking response message includes protocol header information and protocol entity information.
Protocol header information includes the information and information associated with protocol entity of communications protocol.For example, the request of HTTP is rung The protocol header information for answering message includes: protocol type, response time, control cache way, byte traffic identifier, compress mode and company Connect mode.
Protocol entity information includes the response contents that responder sends.
Default response body rule information is exactly the protocol entity information according to the first data result organizing-request response message Preset rules.So that remote terminal can obtain correct information according to default response body rule information.
Specifically includes the following steps:
Step S408-1 generates second protocol body letter according to first data result and default response body rule information Breath.
Optionally, comprising the following steps:
Step S408-1-1, judges whether the format of the first protocol entity information meets bytestream format.
For example, bytestream format, comprising: JSON format.
Step S408-1-2, if so, being handled according to default response body rule information first data result The second data result is generated, and processing is serialized to second data result and obtains the second protocol body information.
Serializing processing is exactly information (i.e. the second data result) conversion that will be generated according to default response body rule information At the process of byte stream.
Step S408-2 generates second protocol head letter according to the second protocol body information and the first protocol header information Breath.
The available communications protocol associated with the remote terminal of request message is issued from the first protocol header information Information, that is, second protocol head information.For example, from the protocol header information of the request message of HTTP can acquisition request response disappear The protocol header information of breath, comprising: protocol type, source domain name and port, compress mode and connection type.
Step S408-3 generates the request response based on the second protocol head information and the second protocol body information Message.
After data abstraction layer obtains response message, response message can be returned into remote terminal.
Optionally, described according to the first protocol header information, first data result and default response body information It is further comprising the steps of after rule generates request response:
Step S409 establishes the second short connection associated with the request response.
Since the first short remote terminal that is connected to has transmitted the connection that can be disconnected automatically after request message with data abstraction layer Therefore relationship when data abstraction layer returns to request response to remote terminal, need to re-establish new short company with remote terminal It connects, that is, the second short connection.
Step S410 sends the request response by the port of the described second short connection.
The embodiment of the present disclosure realizes idempotence processing, is suitble to the requirement of the short connection under FaaS framework.Reduce data The quantity of the long connection in library, improves resource multiplex rate.Neatly dilatancy makes user realize that bottom provides in the state of unaware The scalable appearance in source.
Corresponding with the first embodiment that the disclosure provides, the disclosure additionally provides second embodiment, i.e., at a kind of data The device of reason.Since second embodiment is substantially similar to first embodiment, so describing fairly simple, relevant part please join See the corresponding explanation of first embodiment.Installation practice described below is only schematical.
Fig. 4 shows a kind of embodiment of the device of data processing of disclosure offer.Fig. 4 provides for the embodiment of the present disclosure Data processing device unit block diagram.
Shown in Figure 4, the disclosure provides a kind of device of data processing, comprising: receiving unit 501, resolution unit 502, judging unit 503 obtains the first data result unit 504, establishes the long connection unit 505 of database.
Receiving unit 501, for receiving request message by the port of the first short connection;
Resolution unit 502 obtains database instruction for parsing the request message;
Judging unit 503, for judging in resource pool whether to include that database associated with the database instruction is long Connection;
The first data result unit 504 is obtained, if the output result for the judging unit is "Yes", according to Database instruction and the long connection of the database obtain the first data result;
The long connection unit 505 of database is established, if the output result for the judging unit is "No", foundation and institute The long connection of the associated database of database instruction is stated, and institute is obtained according to the database instruction and the long connection of the database State the first data result;
Wherein, the long connection of the database is the channel that data are exchanged with multiple databases.
Optionally, it is established in the long connection unit 505 of database described, further includes:
The long connection of the database is saved in the resource pool.
Optionally, in the resolution unit 502, comprising:
Agreement transmission rule subelement is obtained, for obtaining agreement transmission rule according to the request message;
Parsing subunit obtains the first protocol entity letter for parsing the request message based on the agreement transmission rule Breath;
Acquisition request subelement, for according to the first protocol entity information and default request body rule information acquisition request Type and request content;
Database instruction subelement is obtained, for obtaining the database according to the request type and the request content Instruction.
Optionally, in the acquisition request subelement, comprising:
First judgment sub-unit, for judging whether the format of the first protocol entity information meets bytestream format;
Unserializing subelement, if the output result for first judgment sub-unit is "Yes", to described first Protocol entity information carries out unserializing processing, and according to default request body rule information acquisition request type and request content.
Optionally, in the parsing subunit, further includes:
The first protocol header information sub-elements are obtained, for obtaining the first protocol header information of the request message.
Optionally, in said device further include:
The first incidence relation unit is established, for establishing between the first protocol header information and the long connection of the database The first incidence relation.
Optionally, in said device further include:
The first protocol header information unit is obtained, for obtaining according to first data result and first incidence relation The corresponding first protocol header information;
Request response unit is generated, for according to the first protocol header information, first data result and pre- If responding body rule information generates request response.
Optionally, in the generation request response unit, comprising:
Second protocol body information sub-elements are generated, for according to first data result and default response body rule information Generate second protocol body information;
Second protocol head information sub-elements are generated, for believing according to the second protocol body information and first protocol header Breath generates second protocol head information;
Request response subelement is generated, for being based on the second protocol head information and the second protocol body information Generate the request response.
Optionally, in the generation second protocol body information sub-elements, comprising:
Second judgment sub-unit, for judging whether the format of the first protocol entity information meets bytestream format;
Subelement is serialized, if the output result for second judgment sub-unit is "Yes", according to default response Body rule information carries out processing to first data result and generates the second data result, and to the second data result sequence Change processing and obtains the second protocol body information.
Optionally, in said device further include:
Transmission unit, for sending the request response.
Optionally, in the transmission unit, comprising:
The second short connection subelement is established, for establishing the second short connection associated with the request response;
Transmission sub-unit, for sending the request response by the port of the described second short connection.
Optionally, in the receiving unit 501, comprising:
Function transmission sub-unit receives the request that first function is sent for the port by the described first short connection and disappears Breath.
The embodiment of the present disclosure realizes idempotence processing, is suitble to the requirement of the short connection under FaaS framework.Reduce data The quantity of the long connection in library, improves resource multiplex rate.Neatly dilatancy makes user realize that bottom provides in the state of unaware The scalable appearance in source.
The embodiment of the present disclosure provides 3rd embodiment, i.e. a kind of electronic equipment, the method which is used for data processing, The electronic equipment, comprising: at least one processor;And connected at least one described processor communication database length Memory;Wherein,
The memory is stored with the instruction that can be executed by one processor, and described instruction is by described at least one It manages device to execute, so that the method that at least one described processor is able to carry out data processing as in the first embodiment.
The embodiment of the present disclosure provides fourth embodiment, i.e., a kind of computer storage medium of data processing, the calculating Machine storage medium is stored with computer executable instructions, the executable number as described in the first embodiment of the computer executable instructions According to the method for processing.
Shown in Figure 6 below, it illustrates the structures for the electronic equipment for being suitable for being used to realize the embodiment of the present disclosure to show It is intended to.Terminal device in the embodiment of the present disclosure can include but is not limited to such as mobile phone, laptop, digital broadcasting Receiver, PDA (personal digital assistant), PAD (tablet computer), PMP (portable media player), car-mounted terminal (such as Vehicle mounted guidance terminal) etc. mobile terminal and such as number TV, desktop computer etc. fixed terminal.Shown in Fig. 3 Electronic equipment is only an example, should not function to the embodiment of the present disclosure and use scope bring any restrictions.
As shown in figure 3, electronic equipment may include processing unit (such as central processing unit, graphics processor etc.) 601, Random access storage device can be loaded into according to the program being stored in read-only memory (ROM) 602 or from storage device 608 (RAM) program in 603 and execute various movements appropriate and processing.In RAM 603, it is also stored with electronic equipment processing institute The various programs and data needed.Processing unit 601, ROM 602 and RAM 603 are connected with each other by bus 604.Input/defeated Also database length is connected to bus 604 to (I/O) interface 605 out.
In general, following device can with database length be connected to I/O interface 605: including such as touch screen, touch tablet, keyboard, The input unit 606 of mouse, camera, microphone, accelerometer, gyroscope etc.;Including such as liquid crystal display (LCD), raise The output device 607 of sound device, vibrator etc.;Storage device 608 including such as tape, hard disk etc.;And communication device 609. Communication device 609 can permit electronic equipment and wirelessly or non-wirelessly be communicated with other equipment to exchange data.Although Fig. 3 is shown Electronic equipment with various devices, it should be understood that be not required for implementing or having all devices shown.It can be with Alternatively implement or have more or fewer devices.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising being carried on non-transient computer can The computer program on medium is read, which includes the program code for method shown in execution flow chart.At this In the embodiment of sample, which can be downloaded and installed from network by communication device 609, or be filled from storage It sets 608 to be mounted, or is mounted from ROM 602.When the computer program is executed by processing unit 601, the disclosure is executed The above-mentioned function of being limited in the method for embodiment.
It should be noted that the above-mentioned computer-readable medium of the disclosure can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electric database of one or more conducting wires long Connection, portable computer diskette, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type are programmable only Read memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic storage Device or above-mentioned any appropriate combination.In the disclosure, computer readable storage medium, which can be, any include or deposits The tangible medium of program is stored up, which can be commanded execution system, device or device use or in connection.And In the disclosure, computer-readable signal media may include in a base band or the data as the propagation of carrier wave a part are believed Number, wherein carrying computer-readable program code.The data-signal of this propagation can take various forms, including but not It is limited to electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit For by the use of instruction execution system, device or device or program in connection.It is wrapped on computer-readable medium The program code contained can transmit with any suitable medium, including but not limited to: electric wire, optical cable, RF (radio frequency) etc., or Above-mentioned any appropriate combination.
In some embodiments, client, server can use such as HTTP (HyperText Transfer Protocol, hypertext transfer protocol) etc the network protocols of any currently known or following research and development communicated, and can To be interconnected with the digital data communications (for example, communication network) of arbitrary form or medium.The example of communication network includes local area network (" LAN "), wide area network (" WAN "), Internet (for example, internet) and ad-hoc network are (for example, the end-to-end net of ad hoc Network) and any currently known or following research and development network.
Above-mentioned computer-readable medium can be included in above-mentioned electronic equipment;It is also possible to individualism, and not It is fitted into the electronic equipment.
Above-mentioned computer-readable medium carries one or more program, when said one or multiple programs are by the electricity When sub- equipment executes, so that the electronic equipment: obtaining at least two internet protocol addresses;Send to Node evaluation equipment includes institute State the Node evaluation request of at least two internet protocol addresses, wherein the Node evaluation equipment is internet from described at least two In protocol address, chooses internet protocol address and return;Receive the internet protocol address that the Node evaluation equipment returns;Its In, the fringe node in acquired internet protocol address instruction content distributing network.
Alternatively, above-mentioned computer-readable medium carries one or more program, when said one or multiple programs When being executed by the electronic equipment, so that the electronic equipment: receiving the Node evaluation including at least two internet protocol addresses and request; From at least two internet protocol address, internet protocol address is chosen;Return to the internet protocol address selected;Wherein, The fringe node in internet protocol address instruction content distributing network received.
The calculating of the processing for executing the disclosure can be write with one or more programming languages or combinations thereof Machine program code, above procedure design language include but is not limited to object oriented program language-such as Java, Smalltalk, C++ further include conventional procedural programming language-such as " C " language or similar program design language Speech.Program code can be executed fully on the user computer, partly be executed on the user computer, as an independence Software package execute, part on the user computer part execute on the remote computer or completely in remote computer or It is executed on server.In situations involving remote computers, remote computer can pass through the network of any kind --- packet It includes local area network (LAN) or wide area network (WAN)-database length is connected to subscriber computer, alternatively, can be connected to database length Outer computer (such as being connected using ISP by the way that internet database is long).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the disclosure, method and computer journey Architectural framework in the cards, function and the processing of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding The dedicated hardware based system of function or processing as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in unit involved in the embodiment of the present disclosure can be realized by way of software, can also be by hard The mode of part is realized.Wherein, the title of unit does not constitute the restriction to the unit itself under certain conditions, for example, the One acquiring unit is also described as " obtaining the unit of at least two internet protocol addresses ".
Function described herein can be executed at least partly by one or more hardware logic components.Example Such as, without limitation, the hardware logic component for the exemplary type that can be used include: field programmable gate array (FPGA), specially With integrated circuit (ASIC), Application Specific Standard Product (ASSP), system on chip (SOC), complex programmable logic equipment (CPLD) etc. Deng.
In the context of the disclosure, machine readable media can be tangible medium, may include or is stored for The program that instruction execution system, device or equipment are used or is used in combination with instruction execution system, device or equipment.Machine can Reading medium can be machine-readable signal medium or machine-readable storage medium.Machine readable media can include but is not limited to electricity Son, magnetic, optical, electromagnetism, infrared or semiconductor system, device or equipment or above content any conjunction Suitable combination.The more specific example of machine readable storage medium will include line based on one or more the long connection in electric data library, Portable computer diskette, hard disk, random access memory (RAM), read-only memory (ROM), the read-only storage of erasable programmable Device (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage Any appropriate combination of equipment or above content.
Above description is only the preferred embodiment of the disclosure and the explanation to institute's application technology principle.Those skilled in the art Member is it should be appreciated that the open scope involved in the disclosure, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from design disclosed above, it is carried out by above-mentioned technical characteristic or its equivalent feature Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed in the disclosure Can technical characteristic replaced mutually and the technical solution that is formed.
Although this is not construed as requiring these processing with institute in addition, depicting each processing using certain order The certain order that shows executes in sequential order to execute.Under certain environment, multitask and parallel processing may be advantageous 's.Similarly, although containing several specific implementation details in being discussed above, these are not construed as to this public affairs The limitation for the range opened.Certain features described in the context of individual embodiment can also be realized in combination single real It applies in example.On the contrary, the various features described in the context of single embodiment can also be individually or with any suitable The mode of sub-portfolio is realized in various embodiments.
Although having used specific to this theme of the language description of structure feature and/or method logical action, answer When understanding that theme defined in the appended claims is not necessarily limited to special characteristic described above or movement.On on the contrary, Special characteristic described in face and movement are only to realize the exemplary forms of claims.

Claims (10)

1. a kind of method of data processing characterized by comprising
Request message is received by the port of the first short connection;
The request message is parsed, database instruction is obtained;
Judge in resource pool whether to include the long connection of database associated with the database instruction;
If so, obtaining the first data result according to the database instruction and the long connection of the database;
If it is not, then establishing the long connection of database associated with the database instruction, and according to the database instruction and institute It states the long connection of database and obtains first data result;
Wherein, the long connection of the database is the channel that data are exchanged with multiple databases.
2. the method according to claim 1, wherein establishing number associated with the database instruction described After the long connection in library, further includes:
The long connection of the database is saved in the resource pool.
3. database instruction is obtained the method according to claim 1, wherein described parse the request message, Include:
Agreement transmission rule is obtained according to the request message;
The request message is parsed based on the agreement transmission rule, obtains the first protocol entity information;
According to the first protocol entity information and default request body rule information acquisition request type and request content;
The database instruction is obtained according to the request type and the request content.
4. according to the method described in claim 3, it is characterized in that, described according to the first protocol entity information and default request Body rule information acquisition request type and request content, comprising:
Judge whether the format of the first protocol entity information meets bytestream format;
If so, carrying out unserializing processing to the first protocol entity information, and obtained according to default request body rule information Request type and request content.
5. according to the method described in claim 3, it is characterized in that, the method also includes:
Obtain the first protocol header information of the request message;
Establish the first incidence relation between the first protocol header information and the long connection of the database;
The corresponding first protocol header information is obtained according to first data result and first incidence relation;
Request response is generated according to the first protocol header information, first data result and default response body rule information to disappear Breath.
6. according to the method described in claim 5, it is characterized in that, described according to first data result and default response body Rule information generates second protocol body information, comprising:
Judge whether the format of the first protocol entity information meets bytestream format;
If so, carrying out processing to first data result according to default response body rule information generates the second data result, And processing is serialized to second data result and obtains the second protocol body information.
7. according to the method described in claim 6, it is characterized in that, it is described according to the first protocol header information, described After one data result and default response body rule information generate request response, further includes:
Establish the second short connection associated with the request response;
The request response is sent by the port of the described second short connection.
8. a kind of device of data processing characterized by comprising
Receiving unit, for receiving request message by the port of the first short connection;
Resolution unit obtains database instruction for parsing the request message;
Judging unit, for judging in resource pool whether to include the long connection of database associated with the database instruction;
The first data result unit is obtained, if the output result for the judging unit is "Yes", according to the database Instruction and the long connection of the database obtain the first data result;
The long connection unit of database is established, if the output result for the judging unit is "No", is established and the data Library instructs the long connection of associated database, and obtains described first according to the database instruction and the long connection of the database Data result;
Wherein, the long connection of the database is the channel that data are exchanged with multiple databases.
9. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that described program is by processor The method as described in any one of claims 1 to 7 is realized when execution.
10. a kind of electronic equipment characterized by comprising
One or more processors;
Storage device, for storing one or more programs, when one or more of programs are by one or more of processing When device executes, so that one or more of processors realize the method as described in any one of claims 1 to 7.
CN201910715752.9A 2019-08-05 2019-08-05 Data processing method, device, medium and electronic equipment Active CN110489474B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910715752.9A CN110489474B (en) 2019-08-05 2019-08-05 Data processing method, device, medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910715752.9A CN110489474B (en) 2019-08-05 2019-08-05 Data processing method, device, medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN110489474A true CN110489474A (en) 2019-11-22
CN110489474B CN110489474B (en) 2022-04-22

Family

ID=68549392

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910715752.9A Active CN110489474B (en) 2019-08-05 2019-08-05 Data processing method, device, medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110489474B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111614752A (en) * 2020-05-19 2020-09-01 北京百度网讯科技有限公司 Method and device for data transmission
CN111865970A (en) * 2020-07-17 2020-10-30 北京百度网讯科技有限公司 Method and apparatus for implementing interface idempotency
CN113645294A (en) * 2021-08-06 2021-11-12 腾讯科技(深圳)有限公司 Message acquisition method and device, computer equipment and message transmission system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1987864A (en) * 2006-12-31 2007-06-27 中国建设银行股份有限公司 Method and system for access data base
CN103634298A (en) * 2013-11-14 2014-03-12 北京奇虎科技有限公司 Database connection processing method and device
CN105718599A (en) * 2016-03-07 2016-06-29 深圳前海微众银行股份有限公司 Method and device for analyzing database access data packet
CN108664613A (en) * 2018-05-11 2018-10-16 中国平安人寿保险股份有限公司 Data query method, apparatus, computer equipment and storage medium
CN108733787A (en) * 2018-05-11 2018-11-02 中国平安人寿保险股份有限公司 Database operation method, device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1987864A (en) * 2006-12-31 2007-06-27 中国建设银行股份有限公司 Method and system for access data base
CN103634298A (en) * 2013-11-14 2014-03-12 北京奇虎科技有限公司 Database connection processing method and device
CN105718599A (en) * 2016-03-07 2016-06-29 深圳前海微众银行股份有限公司 Method and device for analyzing database access data packet
CN108664613A (en) * 2018-05-11 2018-10-16 中国平安人寿保险股份有限公司 Data query method, apparatus, computer equipment and storage medium
CN108733787A (en) * 2018-05-11 2018-11-02 中国平安人寿保险股份有限公司 Database operation method, device, electronic equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111614752A (en) * 2020-05-19 2020-09-01 北京百度网讯科技有限公司 Method and device for data transmission
CN111865970A (en) * 2020-07-17 2020-10-30 北京百度网讯科技有限公司 Method and apparatus for implementing interface idempotency
CN113645294A (en) * 2021-08-06 2021-11-12 腾讯科技(深圳)有限公司 Message acquisition method and device, computer equipment and message transmission system

Also Published As

Publication number Publication date
CN110489474B (en) 2022-04-22

Similar Documents

Publication Publication Date Title
CN110149388B (en) Method, device and equipment for connecting HTTPDNS (hypertext transport protocol version transport protocol DNS) server
CN110457144A (en) A kind of method, apparatus that realizing front end applications, medium and equipment
CN110489474A (en) A kind of method, apparatus of data processing, medium and electronic equipment
CN110753089B (en) Method, device, medium and electronic equipment for managing client
CN108494860A (en) WEB accesses system, WEB access methods and device for client
CN109714332A (en) The method for converting protocol and device parsed based on Thrift and syntax tree
CN108494817A (en) Data transmission method, relevant apparatus and system
CN110519379A (en) Request processing method and equipment based on micro services
CN110489323A (en) Visual RPC API adjustment method, device, medium and equipment
CN110275723A (en) Obtain method, apparatus, electronic equipment and the readable medium of resource
CN111930709B (en) Data storage method, apparatus, electronic device, and computer readable medium
CN110209315A (en) The display methods of character, device, electronic equipment and storage medium in user interface
CN110378743A (en) Invitation method, terminal device, server and the medium of application program
CN110536149A (en) Message display method, device, readable medium and electronic equipment
CN112202744B (en) Multi-system data communication method and device
CN108696899A (en) Sip message transmits and method of reseptance and transmission and reception device
CN110493318A (en) Processing method, device, medium and the equipment of HTTP request information
CN110377273A (en) A kind of method, apparatus of data processing, medium and electronic equipment
CN113438628A (en) Method and device for data interaction
CN108306953A (en) A kind of strong compatible real time push method presented for Internet of Things application data
WO2022057727A1 (en) Network quality determination method and apparatus, electronic device and readable storage medium
CN110275736A (en) Obtain operation data method, apparatus, equipment and the readable medium of application program
CN110764983A (en) Test method, device, medium and electronic equipment
CN107222365B (en) Data processing method and device and server
CN109194706A (en) Internet resources dial testing method and terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee before: Tiktok vision (Beijing) Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

CP01 Change in the name or title of a patent holder