CN110489474B - Data processing method, device, medium and electronic equipment - Google Patents

Data processing method, device, medium and electronic equipment Download PDF

Info

Publication number
CN110489474B
CN110489474B CN201910715752.9A CN201910715752A CN110489474B CN 110489474 B CN110489474 B CN 110489474B CN 201910715752 A CN201910715752 A CN 201910715752A CN 110489474 B CN110489474 B CN 110489474B
Authority
CN
China
Prior art keywords
database
request
protocol
body information
long connection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910715752.9A
Other languages
Chinese (zh)
Other versions
CN110489474A (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

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/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

Landscapes

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

Abstract

The present disclosure provides a data processing method, apparatus, medium, and electronic device. The method comprises the following steps: receiving a request message through a port of a first short connection; analyzing the request message to obtain a database instruction; judging whether a database long connection associated with the database instruction is included in a resource pool or not; if so, acquiring a first data result according to the long connection between the database instruction and the database; if not, establishing database long connection associated with the database instruction, and acquiring the first data result according to the database instruction and the database long connection; wherein the database long connection is a channel for exchanging data with a plurality of databases. The method and the device realize idempotent processing and meet the requirement of short connection under the FaaS architecture. The number of long connections of the database is reduced, and the resource reuse rate is improved. Flexible expandability enables users to realize the expansion capacity of bottom-layer resources in an imperceptible state.

Description

Data processing method, device, medium and electronic equipment
Technical Field
The present disclosure relates to the field of databases, and in particular, to a method, an apparatus, a medium, and an electronic device for data processing.
Background
Conventionally, a database long connection is established between a client (i.e., a Function in a FaaS architecture) and a database server, and a database processing instruction is sent through the database long connection when the database is to be processed.
Since the number of functions in the FaaS architecture is very large, in the case of large data, the functions are required to acquire data, and different databases may be docked at the bottom layer, thereby resulting in explosion of the number of long connections of the databases and resulting in degradation of system performance.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
An object of the present disclosure is to provide a data processing method, apparatus, medium, and electronic device, which can solve at least one of the above-mentioned technical problems. The specific scheme is as follows:
according to a specific embodiment of the present disclosure, in a first aspect, the present disclosure provides a data processing method, including:
receiving a request message through a port of a first short connection;
analyzing the request message to obtain a database instruction;
judging whether a database long connection associated with the database instruction is included in a resource pool or not;
if so, acquiring a first data result according to the long connection between the database instruction and the database;
if not, establishing database long connection associated with the database instruction, and acquiring the first data result according to the database instruction and the database long connection;
wherein the database long connection is a channel for exchanging data with a plurality of databases.
According to a second aspect, the present disclosure provides an apparatus for data processing, including:
a receiving unit, configured to receive a request message through a port of a first short connection;
the analysis unit is used for analyzing the request message and acquiring a database instruction;
the judging unit is used for judging whether a database long connection associated with the database instruction is included in a resource pool or not;
the first data result obtaining unit is used for obtaining a first data result according to the long connection between the database instruction and the database if the output result of the judging unit is 'yes';
a database long connection establishing unit, configured to establish a database long connection associated with the database instruction if the output result of the determining unit is "no", and obtain the first data result according to the database instruction and the database long connection;
wherein the database long connection is a channel for exchanging data with a plurality of databases.
According to a third aspect, the present disclosure provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of data processing according to any of the first aspects.
According to a fourth aspect thereof, the present disclosure provides an electronic device, comprising: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to carry out a method of data processing according to any one of the first aspect.
Compared with the prior art, the scheme of the embodiment of the disclosure at least has the following beneficial effects:
the present disclosure provides a data processing method, apparatus, medium, and electronic device. The method comprises the following steps: receiving a request message through a port of a first short connection; analyzing the request message to obtain a database instruction; judging whether a database long connection associated with the database instruction is included in a resource pool or not; if so, acquiring a first data result according to the long connection between the database instruction and the database; if not, establishing database long connection associated with the database instruction, and acquiring the first data result according to the database instruction and the database long connection; wherein the database long connection is a channel for exchanging data with a plurality of databases.
The method and the device realize idempotent processing and meet the requirement of short connection under the FaaS architecture. The number of long connections of the database is reduced, and the resource reuse rate is improved. Flexible expandability enables users to realize the expansion capacity of bottom-layer resources in an imperceptible state.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale. In the drawings:
fig. 1 is a schematic diagram showing a method of data processing in a conventional case;
FIG. 2 shows a schematic diagram of a method of data processing according to an embodiment of the present disclosure;
FIG. 3 shows a schematic diagram of a method of data processing according to an embodiment of the present disclosure;
FIG. 4 shows a flow diagram of a method of data processing according to an embodiment of the present disclosure;
FIG. 5 shows a block diagram of elements of an apparatus for data processing according to an embodiment of the present disclosure;
fig. 6 shows an electronic device connection structure schematic according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Alternative embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
A first embodiment, namely, an embodiment of a method of data processing, is provided for the present disclosure.
The embodiments of the present disclosure will be described in detail with reference to fig. 1, fig. 2 and fig. 3, wherein fig. 1 is a schematic diagram illustrating a conventional data processing method; FIG. 2 shows a schematic diagram of a method of data processing according to an embodiment of the present disclosure; FIG. 3 shows a schematic diagram of a method of data processing according to an embodiment of the present disclosure; FIG. 4 shows a flow diagram of a method of data processing according to an embodiment of the present disclosure.
Referring to fig. 4, step S401 receives a request message through a port of a first short connection.
The port is an outlet for communication between the equipment and the outside. The ports in the embodiments of the present disclosure are virtual ports, where a virtual port refers to a port inside a computer or inside a switch router, and the virtual port is invisible. For example, a hypertext Transfer Protocol (HTTP) proxy server is commonly used with the following ports: 80/8080/3128/8081/9098, respectively; the firewall security session conversion Protocol (abbreviated as SOCKS for short) proxy Protocol server commonly uses the following ports: 1080; the File Transfer Protocol (FTP) is commonly used as a port of a proxy server: 21; a common port of a Telnet (Telecommunications Network, abbreviated as Telnet) protocol proxy server is as follows: 23.
referring to fig. 1, conventionally, a database long connection is established between a remote terminal and a database server for processing a database, and a database processing instruction is sent through the database long connection. It may happen that a plurality of remote terminals establish their own dedicated database long connection with the database simultaneously for the same request message. Therefore, a large amount of resources of the database server are occupied, the system performance of the database server is seriously influenced, and the efficiency of the database server is reduced.
The disclosed embodiments are based on a method of generating an idempotent concept. The idempotency means that the effect of executing any number of times in a program is the same as the effect of executing one time.
A database long connection is a channel that exchanges data with multiple databases.
The long connection of the database is the information which is established in the memory at the data abstraction layer and is connected with the database. The long connection of the database is stored in the memory, so that the time of each connection can be shortened, and the data processing speed is improved.
Referring to fig. 2 and 3, the port receiving the request message through the first short connection does not obtain the database processing instruction through the database long connection, but establishes a data abstraction layer between the remote terminal and the database. And the data abstraction layer receives the request messages sent by each remote terminal through the port of the first short connection, classifies the request messages according to different request contents, establishes a database long connection between each type and the database, and acquires data results returned by the database through the corresponding database long connection. Therefore, the number of long connections of the database is reduced, and the resource reuse rate is improved.
The request message may be generated according to HTTP, or may be generated in an RPC call manner or a custom manner. The disclosed embodiments are not particularly limited.
The short connection is a stateless communication connection established between the remote terminal and the data abstraction layer, so that the resource occupancy rate can be reduced. The user experience is improved.
Optionally, the receiving a request message through a port of the first short connection includes the following steps:
step S401-1, receiving a request message sent by a first function through the port of the first short connection.
For example, for the FaaS architecture, a function of a process in the remote terminal sends a request message, and meanwhile, the remote terminal is in stateless communication connection with the data abstraction layer (for example, a User Datagram Protocol (UDP), or HTTP) is adopted); when the functions in the FaaS architecture are very many, the efficiency of the remote terminal process is not affected.
Step S402, analyzing the request message and obtaining a database instruction.
Typically, the request message includes protocol header information and protocol body information.
The protocol header information includes information of the communication protocol and information associated with the protocol body. For example, the protocol header information of the request message of HTTP includes: protocol type, target domain name and port, source domain name and port, uniform resource identifier, receivable data type, compression mode, language, connection mode.
The protocol body information includes the request content sent by the requester.
Since the request message is transmitted by encapsulating a plurality of different types of information in a message according to a preset format in the form of a communication protocol, the request message needs to be restored to information that can be directly utilized after the request message is received.
The analysis is to analyze the message according to a preset format and restore the information in the message.
The analyzing the request message to obtain the database instruction comprises the following steps:
step S402-1, acquiring protocol transmission rules according to the request message.
For example, the request message is a message encapsulated according to HTTP, and the protocol type obtained by the protocol header information of the request message is HTTP type, the protocol transmission rule of the request message is HTTP.
Step S402-2, the request message is analyzed based on the protocol transmission rule, and first protocol body information and first protocol header information are obtained.
And step S402-3, acquiring the request type and the request content according to the first protocol body information and a preset request body information rule.
The preset request body information rule is a preset rule for organizing protocol body information of the request message, so that the data abstraction layer can acquire correct information according to the preset request body information rule.
Since the first protocol body information includes multiple types of information, if the information is to be placed in a message, the information needs to be organized according to a preset request body information rule to generate the first protocol body information.
The first protocol body information in the embodiments of the present disclosure includes a request type and a request content. For example, if the request message is to query the database content, the request type is 1, and the request content includes: the method comprises the following steps of (1) inquiring fields, inquiring database names, table names corresponding to the database and constraint conditions; if the request message is inserted into the database content, the request type is 2, and the request content includes: inserting fields and field values, names of inserted databases, names of tables corresponding to the databases and constraint conditions; the request type for deletion is 3; the modified request type is 4.
Optionally, the obtaining the request type and the request content according to the first protocol body information and a preset request body information rule includes the following steps:
step S402-3-1, judging whether the format of the first protocol body information accords with the byte stream format.
The byte stream is composed of bytes and the character stream is composed of characters. A Java hash character consists of two bytes. Byte streams are the most basic, and all subclasses of InputStream and OutputStream are byte streams, primarily used for processing binary data. For example, a byte stream format, including: the JSON format.
And step S402-3-2, if yes, performing deserialization processing on the first protocol body information, and acquiring a request type and request content according to a preset request body information rule.
Deserialization is the process of converting the byte stream into information that the preset request body information rules can identify.
And step S402-4, acquiring the database instruction according to the request type and the request content.
The database instructions include processing instructions for a plurality of databases. Also, a plurality of instructions to the database are included. Such as batch instructions to a database.
Step S403, determining whether a resource pool includes a database long connection associated with the database instruction.
The long connection of the database is the information which is established in the memory at the data abstraction layer and is connected with the database. The long connection of the database is stored in the memory, so that the time of each connection can be shortened, and the data processing speed is improved.
A resource pool is a configuration mechanism and is a collection for storing long connections of a database. The resource pool organizes the database long connections together according to a preset sorting rule, and the database long connections are effectively managed. The speed of searching long connections of the database can be improved.
In a resource pool, the characteristics of the database instructions are associated with database long connections. For example, the queried database and the set of data tables in the database make up the features of the database instruction.
And S404, if yes, acquiring a first data result according to the database instruction and the database long connection.
The first data result is the data result that the database returned to the data abstraction layer according to the database instruction.
Step S405, if not, a database long connection associated with the database instruction is established, and the first data result is obtained according to the database instruction and the database long connection.
Optionally, after the database long connection associated with the database instruction is established, the method further includes the following steps:
and S405-1, storing the database long connection into the resource pool.
In order to ensure that the first data result can be correctly returned to the remote terminal sending the request message, optionally, the method further includes the following steps:
step S406, a first association relationship between the first protocol header information and the database long connection is established.
Because the database long connection is established according to or associated with the database instruction; and the database instruction is derived from the first protocol body information, so that the first protocol head information associated with the first protocol body information can establish a first association relation with the database long connection.
Step S407, obtaining the corresponding first protocol header information according to the first data result and the first association relationship.
For example, the first association relationship may be represented by a handle of the first data result, that is, the handle corresponds to the long connection of the database and further corresponds to the first protocol header information, and after the first data result is obtained, the first protocol header information may be obtained through the handle.
The purpose of the acquired first protocol header information is to acquire communication information of a corresponding remote terminal.
Step S408, generating a request response message according to the first protocol header information, the first data result, and a preset response body information rule.
The request response message is response information generated by the data abstraction layer according to the request of the request message. Typically, the request response message includes protocol header information and protocol body information.
The protocol header information includes information of the communication protocol and information associated with the protocol body. For example, the protocol header information of the request response message of HTTP includes: protocol type, response time, control buffer mode, byte stream identification, compression mode and connection mode.
The protocol body information includes response contents transmitted by the responder.
The preset response body information rule is a preset rule for organizing the protocol body information of the request response message according to the first data result. So that the remote terminal can acquire correct information according to the preset information rule of the response body.
The method specifically comprises the following steps:
step S408-1, second protocol body information is generated according to the first data result and a preset response body information rule.
Optionally, the method comprises the following steps:
step S408-1-1, judging whether the format of the first protocol body information accords with the byte stream format.
For example, a byte stream format, including: the JSON format.
And step S408-1-2, if so, processing the first data result according to a preset response body information rule to generate a second data result, and performing serialization processing on the second data result to acquire the second protocol body information.
The serialization process is a process of converting information (i.e., the second data result) generated according to the preset response body information rule into a byte stream.
Step S408-2, generating second protocol header information according to the second protocol body information and the first protocol header information.
Information of the communication protocol associated with the remote terminal that issued the request message, i.e., the second protocol header information, can be obtained from the first protocol header information. For example, the protocol header information of the request response message may be obtained from the protocol header information of the request message of HTTP, including: protocol type, source domain name and port, compression mode and connection mode.
Step S408-3, generating the request response message based on the second protocol header information and the second protocol body information.
After the data abstraction layer obtains the response information, the response information can be returned to the remote terminal.
Optionally, after generating a request response message according to the first protocol header information, the first data result, and a preset response body information rule, the method further includes the following steps:
step S409, establishing a second short connection associated with the request response message.
Since the first short connection automatically disconnects the connection with the data abstraction layer after the remote terminal has transmitted the request message, the data abstraction layer needs to reestablish a new short connection with the remote terminal when returning the request response message to the remote terminal, that is, the second short connection.
Step S410, sending the request response message through the port of the second short connection.
The embodiment of the disclosure realizes idempotent processing and meets the requirement of short connection under the FaaS architecture. The number of long connections of the database is reduced, and the resource reuse rate is improved. Flexible expandability enables users to realize the expansion capacity of bottom-layer resources in an imperceptible state.
Corresponding to the first embodiment provided by the present disclosure, the present disclosure also provides a second embodiment, that is, an apparatus for data processing. Since the second embodiment is basically similar to the first embodiment, the description is simple, and the relevant portions should be referred to the corresponding description of the first embodiment. The device embodiments described below are merely illustrative.
Fig. 4 shows an embodiment of a data processing apparatus provided by the present disclosure. Fig. 4 is a block diagram of units of a data processing apparatus according to an embodiment of the present disclosure.
Referring to fig. 4, the present disclosure provides a data processing apparatus, including: receiving section 501, analyzing section 502, determining section 503, acquiring first data result section 504, and establishing database long connection section 505.
A receiving unit 501, configured to receive a request message through a port of a first short connection;
an analyzing unit 502, configured to analyze the request message and obtain a database instruction;
a determining unit 503, configured to determine whether a database long connection associated with the database instruction is included in a resource pool;
a first data result obtaining unit 504, configured to obtain a first data result according to the database instruction and the database long connection if an output result of the determining unit is "yes";
a database long connection establishing unit 505, configured to establish a database long connection associated with the database instruction if the output result of the determining unit is "no", and obtain the first data result according to the database instruction and the database long connection;
wherein the database long connection is a channel for exchanging data with a plurality of databases.
Optionally, the database long connection establishing unit 505 further includes:
and storing the database long connection into the resource pool.
Optionally, the parsing unit 502 includes:
a protocol transmission rule obtaining subunit, configured to obtain a protocol transmission rule according to the request message;
the analysis subunit is used for analyzing the request message based on the protocol transmission rule to acquire first protocol body information;
the request obtaining subunit is used for obtaining a request type and request content according to the first protocol body information and a preset request body information rule;
and the sub-unit for obtaining the database instruction is used for obtaining the database instruction according to the request type and the request content.
Optionally, the obtaining request subunit includes:
the first judging subunit is used for judging whether the format of the first protocol body information conforms to the byte stream format or not;
and the deserializing subunit is used for performing deserializing processing on the first protocol body information if the output result of the first judging subunit is yes, and acquiring the request type and the request content according to a preset request body information rule.
Optionally, in the parsing subunit, the method further includes:
and the acquiring first protocol header information subunit is used for acquiring the first protocol header information of the request message.
Optionally, the apparatus further comprises:
and the first incidence relation establishing unit is used for establishing a first incidence relation between the first protocol header information and the database long connection.
Optionally, the apparatus further comprises:
a first protocol header information obtaining unit, configured to obtain corresponding first protocol header information according to the first data result and the first association relationship;
and the request response message generating unit is used for generating a request response message according to the first protocol header information, the first data result and a preset response body information rule.
Optionally, the generating a request response message unit includes:
a second protocol body information generating subunit, configured to generate second protocol body information according to the first data result and a preset response body information rule;
a second protocol header information generating subunit, configured to generate second protocol header information according to the second protocol body information and the first protocol header information;
a request response message generating subunit, configured to generate the request response message based on the second protocol header information and the second protocol body information.
Optionally, the generating the second protocol body information subunit includes:
the second judging subunit is used for judging whether the format of the first protocol body information conforms to the byte stream format or not;
and the serialization subunit is configured to, if the output result of the second judgment subunit is "yes", process the first data result according to a preset response body information rule to generate a second data result, and perform serialization processing on the second data result to obtain the second protocol body information.
Optionally, the apparatus further comprises:
a sending unit, configured to send the request response message.
Optionally, the sending unit includes:
a second short connection establishing subunit, configured to establish a second short connection associated with the request response message;
and the sending subunit is configured to send the request response message through the port of the second short connection.
Optionally, the receiving unit 501 includes:
and the function sending subunit is configured to receive, through the port of the first short connection, a request message sent by the first function.
The embodiment of the disclosure realizes idempotent processing and meets the requirement of short connection under the FaaS architecture. The number of long connections of the database is reduced, and the resource reuse rate is improved. Flexible expandability enables users to realize the expansion capacity of bottom-layer resources in an imperceptible state.
The third embodiment of the present disclosure provides an electronic device, which is used in a data processing method, and includes: at least one processor; and a memory in communication with the at least one processor and in long-term connection with the database; wherein the content of the first and second substances,
the memory stores instructions executable by the one processor to cause the at least one processor to perform the method of data processing according to the first embodiment.
The present disclosure provides a fourth embodiment, which is a computer storage medium for data processing, where the computer storage medium stores computer-executable instructions, and the computer-executable instructions can execute the method for data processing as described in the first embodiment.
Reference is now made to fig. 6, which is a block diagram illustrating an electronic device suitable for implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 3, the electronic device may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for processing by the electronic apparatus are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, the following devices may be connected to the I/O interface 605 at the database length: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While fig. 3 illustrates an electronic device having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical database long connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring at least two internet protocol addresses; sending a node evaluation request comprising the at least two internet protocol addresses to node evaluation equipment, wherein the node evaluation equipment selects the internet protocol addresses from the at least two internet protocol addresses and returns the internet protocol addresses; receiving an internet protocol address returned by the node evaluation equipment; wherein the obtained internet protocol address indicates an edge node in the content distribution network.
Alternatively, the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a node evaluation request comprising at least two internet protocol addresses; selecting an internet protocol address from the at least two internet protocol addresses; returning the selected internet protocol address; wherein the received internet protocol address indicates an edge node in the content distribution network.
Computer program code for carrying out processes of the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the database may be connected to an external computer (for example, through an Internet database using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and processing of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or processes, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical database long connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while the processes are depicted in a particular order, this should not be understood as requiring that such processes be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (8)

1. A method of data processing, comprising:
receiving a request message through a port of a first short connection;
analyzing the request message to obtain a database instruction;
judging whether a database long connection associated with the database instruction is included in a resource pool or not;
if so, acquiring a first data result according to the long connection between the database instruction and the database;
if not, establishing database long connection associated with the database instruction, and acquiring the first data result according to the database instruction and the database long connection;
wherein the database long connection is a channel for exchanging data with a plurality of databases;
wherein analyzing the request message to obtain a database instruction comprises:
acquiring a protocol transmission rule according to the request message;
analyzing the request message based on the protocol transmission rule to acquire first protocol body information;
acquiring a request type and request content according to the first protocol body information and a preset request body information rule;
acquiring the database instruction according to the request type and the request content;
the obtaining of the request type and the request content according to the first protocol body information and the preset request body information rule includes:
judging whether the format of the first protocol body information accords with the byte stream format or not;
and if so, performing deserialization processing on the first protocol body information, and acquiring a request type and request content according to a preset request body information rule.
2. The method of claim 1, further comprising, after the establishing the database long connection associated with the database instruction:
and storing the database long connection into the resource pool.
3. The method of claim 1, further comprising:
acquiring first protocol header information of the request message;
establishing a first incidence relation between the first protocol header information and the database long connection;
acquiring corresponding first protocol header information according to the first data result and the first incidence relation;
and generating a request response message according to the first protocol header information, the first data result and a preset response body information rule.
4. The method of claim 3, wherein generating second protocol body information according to the first data result and a predetermined response body information rule comprises:
judging whether the format of the first protocol body information accords with the byte stream format or not;
and if so, processing the first data result according to a preset response body information rule to generate a second data result, and performing serialization processing on the second data result to obtain the second protocol body information.
5. The method of claim 4, wherein after generating a request response message according to the first protocol header information, the first data result, and a preset response body information rule, the method further comprises:
establishing a second short connection associated with the request response message;
and sending the request response message through the port of the second short connection.
6. An apparatus for data processing, comprising:
a receiving unit, configured to receive a request message through a port of a first short connection;
the analysis unit is used for analyzing the request message and acquiring a database instruction;
the judging unit is used for judging whether a database long connection associated with the database instruction is included in a resource pool or not;
the first data result obtaining unit is used for obtaining a first data result according to the long connection between the database instruction and the database if the output result of the judging unit is 'yes';
a database long connection establishing unit, configured to establish a database long connection associated with the database instruction if the output result of the determining unit is "no", and obtain the first data result according to the database instruction and the database long connection;
wherein the database long connection is a channel for exchanging data with a plurality of databases;
the parsing unit 502 includes:
a protocol transmission rule obtaining subunit, configured to obtain a protocol transmission rule according to the request message;
the analysis subunit is used for analyzing the request message based on the protocol transmission rule to acquire first protocol body information;
the request obtaining subunit is used for obtaining a request type and request content according to the first protocol body information and a preset request body information rule;
a database instruction obtaining subunit, configured to obtain the database instruction according to the request type and the request content;
in the get request subunit, the method includes:
the first judging subunit is used for judging whether the format of the first protocol body information conforms to the byte stream format or not;
and the deserializing subunit is used for performing deserializing processing on the first protocol body information if the output result of the first judging subunit is yes, and acquiring the request type and the request content according to a preset request body information rule.
7. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method according to any one of claims 1 to 5.
8. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to carry out the method of any one of claims 1 to 5.
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 CN110489474A (en) 2019-11-22
CN110489474B true 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)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111614752B (en) * 2020-05-19 2022-08-30 北京百度网讯科技有限公司 Method and device for data transmission
CN111865970B (en) * 2020-07-17 2022-09-16 北京百度网讯科技有限公司 Method and apparatus for implementing interface idempotency
CN113645294B (en) * 2021-08-06 2022-08-26 腾讯科技(深圳)有限公司 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

Also Published As

Publication number Publication date
CN110489474A (en) 2019-11-22

Similar Documents

Publication Publication Date Title
CN110489474B (en) Data processing method, device, medium and electronic equipment
CN112311656B (en) Message aggregation and display method and device, electronic equipment and computer readable medium
CN112637287B (en) Load balancing method and equipment
CN110781373B (en) List updating method and device, readable medium and electronic equipment
CN110177047B (en) Message sending method, device, electronic equipment and computer readable storage medium
CN113254105B (en) Resource processing method and device, storage medium and electronic equipment
CN110545472B (en) Video data processing method and device, electronic equipment and computer readable medium
CN110909521A (en) Synchronous processing method and device for online document information and electronic equipment
CN111209306A (en) Business logic judgment method and device, electronic equipment and storage medium
CN111930709A (en) Data storage method and device, electronic equipment and computer readable medium
CN110996372B (en) Message routing method, device and system and electronic equipment
CN113162836B (en) Virtual local area network communication method and device, cloud server, medium and electronic equipment
CN116743785A (en) Cloud network data storage method, device, equipment and medium based on fog calculation
CN115102992B (en) Data publishing method and device, electronic equipment and computer readable medium
CN111262907A (en) Service instance access method and device and electronic equipment
CN114490718A (en) Data output method, data output device, electronic equipment and computer readable medium
CN112149019A (en) Method, apparatus, electronic device, and computer-readable medium for displaying information
CN115225586B (en) Data packet transmitting method, device, equipment and computer readable storage medium
CN112311840A (en) Multi-terminal data synchronization method, device, equipment and medium
CN111399730A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN110807114A (en) Method, device, terminal and storage medium for picture display
CN110730251A (en) Method, device, medium and electronic equipment for analyzing domain name
CN113157365B (en) Program running method, program running device, electronic equipment and computer readable medium
CN110855767B (en) Method, device, equipment and storage medium for responding operation request
CN111404890B (en) Flow data detection method, system, storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
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