CN108052615B - Access request processing method, device, medium and electronic equipment - Google Patents

Access request processing method, device, medium and electronic equipment Download PDF

Info

Publication number
CN108052615B
CN108052615B CN201711344627.9A CN201711344627A CN108052615B CN 108052615 B CN108052615 B CN 108052615B CN 201711344627 A CN201711344627 A CN 201711344627A CN 108052615 B CN108052615 B CN 108052615B
Authority
CN
China
Prior art keywords
access request
source channel
target server
determining
channel
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
CN201711344627.9A
Other languages
Chinese (zh)
Other versions
CN108052615A (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.)
Taikang Insurance Group Co Ltd
Taikang Online Property Insurance Co Ltd
Original Assignee
Taikang Insurance Group Co Ltd
Taikang Online Property Insurance 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 Taikang Insurance Group Co Ltd, Taikang Online Property Insurance Co Ltd filed Critical Taikang Insurance Group Co Ltd
Priority to CN201711344627.9A priority Critical patent/CN108052615B/en
Publication of CN108052615A publication Critical patent/CN108052615A/en
Application granted granted Critical
Publication of CN108052615B publication Critical patent/CN108052615B/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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/08Insurance

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Development Economics (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Computing Systems (AREA)
  • Economics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a processing method, a device, a medium and electronic equipment of an access request, wherein the processing method of the access request comprises the following steps: if an access request is received, determining a source channel of the access request; determining a target server corresponding to the source channel according to the source channel; sending the access request to the target server so that the target server schedules a database associated with the target server to respond to the access request. The technical scheme of the embodiment of the invention solves the problem of high concurrency pressure caused by the fact that a single server and a database respond to access requests of all channels, can improve the expandability of the system and is beneficial to reducing the implementation cost of business logic.

Description

Access request processing method, device, medium and electronic equipment
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a medium, and an electronic device for processing an access request.
Background
With the development of computer and network technologies, the access volume of websites increases rapidly, and further, the load of servers and databases is large. For example, for car insurance business, since the insurance channel is not limited to a PC (personal computer) end, but also a wechat end, a WAP (Wireless Application Protocol) end, an APP (Application) end, and other third party platforms become channels for facilitating the insurance of users, the storage and access of mass data cause a relatively high load on a database with the increase of business scale, and the processes of insurance, renewal and the like become inconvenient and fast, which has severely restricted the development and growth of business.
In order to solve the problem of high concurrency pressure of a single database, a database splitting strategy is provided in the related art to split the original dependence on one database into the dependence on a plurality of databases, but in the method, a database splitting routing rule needs to be configured in a server, if the databases need to be increased, code logic on each server needs to be changed to adjust the routing rule, and the expandability is poor.
Therefore, how to improve the scalability of the system on the premise of avoiding the great concurrency pressure of a single database is an urgent technical problem to be solved.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present invention and therefore may include information that does not constitute prior art known to a person of ordinary skill in the art.
Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, a medium, and an electronic device for processing an access request, so as to solve, at least to a certain extent, a problem of poor scalability caused by a current library partitioning policy.
Additional features and advantages of the invention will be set forth in the detailed description which follows, or may be learned by practice of the invention.
According to a first aspect of the embodiments of the present invention, there is provided a method for processing an access request, including: if an access request is received, determining a source channel of the access request; determining a target server corresponding to the source channel according to the source channel; sending the access request to the target server so that the target server schedules a database associated with the target server to respond to the access request.
In some embodiments of the present invention, based on the foregoing solution, determining, according to the source channel, a target server corresponding to the source channel includes: acquiring a corresponding relation between a channel and a server; and determining a target server corresponding to the source channel based on the corresponding relation between the channel and the server.
In some embodiments of the present invention, based on the foregoing solution, determining a target server corresponding to the source channel based on the correspondence between the channels and servers includes: if the number of the servers corresponding to the source channel is one, taking the server corresponding to the source channel as the target server; and if the number of the servers corresponding to the source channel is multiple, selecting one server from the multiple servers corresponding to the source channel as the target server in a load balancing mode.
In some embodiments of the present invention, based on the foregoing solution, the method for processing an access request further includes: if a new channel needs to be added, establishing a corresponding relation between the new channel and a server set for the new channel; and storing the established corresponding relation.
In some embodiments of the present invention, based on the foregoing solution, databases associated with servers corresponding to different channels are different.
In some embodiments of the present invention, based on the foregoing solution, determining a source channel of the access request includes: extracting the value of a specified field in the access request; and determining a source channel of the access request according to the value of the specified field.
In some embodiments of the present invention, based on the foregoing solution, determining a source channel of the access request includes: transmitting the access request to a predetermined Lua script so as to determine a source channel of the access request through the predetermined Lua script; and receiving a determination result returned by the predetermined Lua script.
According to a second aspect of the embodiments of the present invention, there is provided an apparatus for processing an access request, including: the device comprises a first determining unit, a second determining unit and a third determining unit, wherein the first determining unit is used for determining a source channel of an access request when the access request is received; the second determining unit is used for determining a target server corresponding to the source channel according to the source channel; and the sending unit is used for sending the access request to the target server so that the target server schedules the database associated with the target server to respond to the access request.
According to a third aspect of embodiments of the present invention, there is provided a computer-readable medium, on which a computer program is stored, which when executed by a processor, implements the method for processing an access request as described in the first aspect of the embodiments above.
According to a fourth aspect of embodiments of the present invention, there is provided an electronic apparatus, including: 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 implement a method of processing an access request as described in the first aspect of the embodiments above.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the technical solutions provided by some embodiments of the present invention, a target server corresponding to a source channel of an access request is determined according to the source channel, and the access request is sent to the target server, so that the target server schedules a database associated with the target server to respond to the access request, and each channel has a server and a database corresponding to the channel, and further, the access requests from each channel can be processed separately, thereby solving the problem of high concurrency pressure caused by a single server and a database responding to access requests of all channels. Meanwhile, each channel is provided with a server and a database corresponding to the channel, so that when a new channel needs to be added, only the corresponding server and the corresponding database need to be added for the channel, the existing server and the existing database do not need to be adjusted, the expandability of the system is improved, and the realization cost of business logic is favorably reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 schematically illustrates an architecture diagram of a vehicle insurance system according to one embodiment of the invention;
FIG. 2 schematically illustrates a flow diagram of a method of processing an access request according to one embodiment of the invention;
FIG. 3 schematically shows a flowchart of a processing procedure of step S204 shown in FIG. 2;
FIG. 4 schematically illustrates an architecture diagram of a vehicle insurance system according to another embodiment of the invention;
FIG. 5 is a schematic diagram illustrating the execution sequence of various configuration instructions in a Lua Nginx module, according to an embodiment of the invention;
FIG. 6 schematically shows a block diagram of an apparatus for processing an access request according to an embodiment of the present invention;
FIG. 7 illustrates a schematic structural diagram of a computer system suitable for use with the electronic device to implement an embodiment of the invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations or operations have not been shown or described in detail to avoid obscuring aspects of the invention.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
In order to solve the problem that the concurrent pressure of a single database is high at present, a scheme of horizontally splitting the database is provided in the embodiment of the invention, and the scheme is also called as 'sub-database'. The horizontal segmentation database needs to select a field as a segmentation basis and a mark field, for example, user _ id can be used as a distinguishing field. Based on this, there are mainly the following three banking modes:
a first database dividing mode:
and performing library division based on number segment partitions, wherein the number segment partitions divide the user _ id into a plurality of intervals, each interval corresponds to one database, for example, data with the user _ id of 1-1000 corresponds to the database 1, data with the user _ id of 1001-2000 corresponds to the database 2, and the like. The advantage of this kind of banking approach is that data can be migrated partially, but there is a problem of uneven data distribution.
A second library dividing mode:
the mapping relation between the user _ id and the database is separately stored in a database (recorded as database x), the database x is queried once when the database is accessed every time so as to obtain the specific database information needing to be accessed, and then the required query operation is carried out. The database partitioning method has the advantages of strong flexibility and capability of flexibly setting the data stored in each database, but the database x needs to be queried before each query, so the query performance is greatly reduced.
A third library division mode:
hash operation is performed on the user _ id, and then a certain number (for example, if a database is divided into 4 databases, the number 4 can be used) is used to perform a modulo operation on the hash value of the user _ id, that is, the user _ id% 4, so that four operations are possible each time: the result is 1, and corresponds to the database 1; the result is 2, and corresponds to the database 2; the result is 3, and corresponds to the database 3; the result is 0, and corresponds to the database 4. The database allocation method III can evenly allocate data to 4 databases, but data migration is troublesome, and data cannot be allocated according to the performance of a machine.
For the third library dividing mode, in a specific application scenario of the invention, for the car insurance system, in order to reduce the concurrent pressure of a single database and ensure that the underwriting process is more convenient and rapid, the underwriting process is divided from the core system and placed in the internet service area. As shown in fig. 1, the entire car insurance system includes: the system comprises a service system 101, a car insurance internet service area 102 and an internet area database 103, wherein the internet area database 103 stores data by using 4 MySQL databases in a hash modeling and partitioning sub-base mode. In the service system 101, a user may initiate an access request through various channels, such as a PC channel, a WeChat channel, a WAP channel, an APP channel, and other third party channels. After the vehicle insurance internet service area 102 receives the access request, the Nginx server allocates a Tomcat server to the access request, then performs modulus extraction on data according to the last bit of the user IP address and splits the data into different databases, and then splits the original dependence on one database into the dependence on 4 databases, that is, the 4 databases bear pressure at the same time, so that the throughput of the system can be improved.
Although the database partitioning method in the above embodiment of the present invention can reduce the concurrency pressure of a single database, the routing rule of the database partitioning is written in the code, and if the database needs to be added, the code on each server needs to be changed, which results in poor expandability.
Based on this, the following solution is proposed in the embodiment of the present invention.
Fig. 2 schematically shows a flowchart of a processing method of an access request according to an embodiment of the present invention, and an execution subject of the processing method of the access request may be a device having a route distribution function, such as an Nginx server.
Referring to fig. 2, a method for processing an access request according to an embodiment of the present invention includes step S202, step S204, and step S206. The individual steps are explained in detail below:
in step S202, if an access request is received, a source channel of the access request is determined.
In one embodiment of the present invention, step S202 includes: and extracting the value of a specified field in the access request, and determining a source channel of the access request according to the value of the specified field. Optionally, the specified field may be a "User-Agent" field in the access request, and a source channel of the access request may be determined according to a value of the field, where the source channel may be a PC end, a WeChat end, a WAP end, an APP end, or another third-party channel.
In one embodiment of the present invention, the access request may be transmitted to a predetermined Lua script, so as to determine a source channel of the access request through the predetermined Lua script. The embodiment enables the Lua script to be conveniently edited to flexibly adjust the strategy for determining the source channel of the access request by using the Lua script.
With continued reference to fig. 2, in step S204, according to the source channel, a target server corresponding to the source channel is determined.
In one embodiment of the present invention, referring to fig. 3, step S204 includes:
step S2042, acquiring the corresponding relation between the channels and the server.
In the embodiment of the invention, the correspondence relationship between the channels and the servers is used for indicating which servers the access requests from the various channels should be processed by. When a new channel is added, a corresponding relationship between the new channel and a server set for the new channel can be established, and the established corresponding relationship is stored. Optionally, there may be one or more servers corresponding to a channel, and the specific number may be determined according to the number of access requests from the channel.
Step S2044, determining a target server corresponding to the source channel based on the correspondence between the channels and servers.
In one embodiment of the present invention, step S2044 includes: if the number of the servers corresponding to the source channel is one, taking the server corresponding to the source channel as the target server; and if the number of the servers corresponding to the source channel is multiple, selecting one server from the multiple servers corresponding to the source channel as the target server in a load balancing mode.
In this embodiment, when there are multiple servers corresponding to the source channels, one server is selected from the multiple servers as the target server in a load balancing manner, so that load pressure among the multiple servers can be balanced, and the phenomenon that a single server is overloaded to affect processing performance is avoided.
With continued reference to fig. 2, in step S206, the access request is sent to the target server, so that the target server schedules the database associated with the target server to respond to the access request.
In an embodiment of the invention, databases associated with servers corresponding to different channels are different, so that data corresponding to each channel can be independently stored, and meanwhile, each database only needs to respond to access requests of the corresponding channel, so that the response rate of the database can be improved. Optionally, in other embodiments of the present invention, databases associated with servers corresponding to different channels may partially overlap or completely overlap, that is, servers corresponding to different channels may share a database.
The technical scheme of the embodiment shown in fig. 2 enables each channel to have the corresponding server and database, so that the access requests from each channel can be processed separately, and the problem of high concurrency pressure caused by the fact that a single server and database respond to the access requests of all channels is solved. Meanwhile, each channel is provided with a server and a database corresponding to the channel, so that when a new channel needs to be added, only the corresponding server and the corresponding database need to be added for the channel, the existing server and the existing database do not need to be adjusted, the expandability of the system is improved, and the realization cost of business logic is favorably reduced.
In a specific application scenario of the present invention, taking a car insurance system as an example, referring to fig. 4, in order to reduce concurrent pressure of a single database and ensure that an underwriting process is more convenient and faster, the underwriting process is split from a core system and placed in an internet service area, the whole car insurance system includes: business system 401, car insurance internet service area 402 and internet area database 403.
In service system 401, a user may initiate an access request through various channels, such as a PC channel, a wechat channel, a WAP channel, an APP channel, and other third party channels. After the car insurance internet service area 402 receives the access request, the Lua script judges the source channel of the access request, and returns the result to the Nginx server, the Nginx server selects the corresponding Tomcat server to route the access request according to the source channel of the access request, and the Tomcat server receiving the access request schedules the associated MySQL database in the internet area database 403 to respond to the access request.
In the embodiment shown in fig. 4, the insurance process of the vehicle insurance system adopts a route distribution policy that the Nginx server combines with the Lua script, specifically, a source channel of the access request is judged in the Lua script, then an API (Application Programming Interface) type of the access request is returned, and the Nginx server routes the access request according to different return results, so as to distribute the access request to different servers according to different channels, and each server binds to one Mysql database, so that the access requests from different channels can access the databases corresponding to different servers. If a new channel needs to be added, only a server and a corresponding database need to be added for the new channel, and the Lua script and the Nginx configuration need to be modified, and codes on other servers do not need to be modified.
In an embodiment of the present invention, the above-mentioned Nginx server and Lua script may be used as a Lua Nginx module, which provides a configuration instruction and a Nginx API, where the Nginx API is used to access a Nginx variable in the Lua script, and call a function provided by the Nginx to obtain a judgment result returned by the Lua script; configuration instructions are for use in Nginx, each configuration instruction having a context of use (i.e., context). The execution sequence of each configuration instruction is shown in fig. 5, and mainly includes the following four stages:
s1: initialization Phase (Initialization Phase)
init _ by _ lua instruction: when the Nginx master process runs the specified Lua script when loading the Nginx configuration file, it is typically used to register the Lua global variables or to preload the Lua module at server startup.
init _ worker _ by _ lua instruction: the specified Lua script is called when each Nginx worker process starts.
S2: request address Rewrite/Access Phase
ssl _ certificate _ by _ lua instruction: a ssl (Secure Sockets Layer) certificate is configured.
set _ by _ lua instruction: and (3) transmitting the parameters into a specified Lua script code to execute, and obtaining a return value into res (a file for storing data).
The rewrite _ by _ lua instruction: as the processing of the request address rewriting stage, a Lua script is specified for the execution of each request.
access _ by _ lua instruction: and calling the Lua script for processing in an access phase for each request, wherein the Lua script is mainly used for access control and most variables can be collected.
S3: content Phase
content _ by _ lua instruction: mainly used for generating content (content) and outputting HTTP response.
The balance _ by _ lua instruction: the instruction will run the Lua script as an upstream balancer at any upstream entity defined by the upstream configuration block.
The header _ filter _ by _ lua instruction: generally, it is used only for setting cookies (data stored locally), Headers (HTTP header information), and the like.
body _ filter _ by _ lua instruction: it is typically called multiple times in a single request because this is to implement "streaming out" based on HTTP 1.1chunked encoding.
S4: log module processing Phase (Log Phase)
log _ by _ lua instruction: the Lua source code is linked in the log request processing stage and always runs at the end of the request, and is used for subsequent operations of the request, such as statistical data in a shared memory.
The following describes an embodiment of the apparatus of the present invention, which can be used to execute the above-mentioned processing method of the access request of the present invention.
Fig. 6 schematically shows a block diagram of an apparatus for processing an access request according to an embodiment of the present invention.
Referring to fig. 6, an apparatus 600 for processing an access request according to an embodiment of the present invention includes: a first determining unit 602, a second determining unit 604 and a transmitting unit 606.
The first determining unit 602 is configured to, when an access request is received, determine a source channel of the access request; the second determining unit 604 is configured to determine, according to the source channel, a target server corresponding to the source channel; the sending unit 606 is configured to send the access request to the target server, so that the target server schedules a database associated with the target server to respond to the access request.
In some embodiments of the present invention, based on the foregoing scheme, the second determining unit 604 is configured to: acquiring a corresponding relation between a channel and a server; and determining a target server corresponding to the source channel based on the corresponding relation between the channel and the server.
In some embodiments of the present invention, based on the foregoing scheme, the second determining unit 604 is configured to: if the number of the servers corresponding to the source channel is one, taking the server corresponding to the source channel as the target server; and if the number of the servers corresponding to the source channel is multiple, selecting one server from the multiple servers corresponding to the source channel as the target server in a load balancing mode.
In some embodiments of the present invention, based on the foregoing solution, the apparatus 600 for processing an access request further includes: a relationship establishing unit and a storage unit.
The relation establishing unit is used for establishing a corresponding relation between a new channel and a server set for the new channel if the new channel needs to be added; the storage unit is used for storing the established corresponding relation.
In some embodiments of the present invention, based on the foregoing solution, databases associated with servers corresponding to different channels are different.
In some embodiments of the present invention, based on the foregoing solution, the first determining unit 602 is configured to: extracting the value of a specified field in the access request; and determining a source channel of the access request according to the value of the specified field.
In some embodiments of the present invention, based on the foregoing solution, the first determining unit 602 is configured to: transmitting the access request to a predetermined Lua script so as to determine a source channel of the access request through the predetermined Lua script; and receiving a determination result returned by the predetermined Lua script.
For details that are not disclosed in the embodiments of the apparatus of the present invention, reference is made to the above-described embodiments of processing an access request of the present invention for details that are not disclosed in the embodiments of the apparatus of the present invention, since each functional module of the apparatus of processing an access request of the present invention corresponds to a step of the above-described exemplary embodiment of the method of processing an access request.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use with the electronic device implementing an embodiment of the present invention. The computer system 700 of the electronic device shown in fig. 7 is only an example, and should not bring any limitation to the function and the scope of use of the embodiments of the present invention.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for system operation are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to an embodiment of the present invention, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the invention include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program executes the above-described functions defined in the system of the present application when executed by the Central Processing Unit (CPU) 701.
It should be noted that the computer readable medium shown in the present invention 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 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 invention, 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 the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, 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: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. 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 or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; 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 implement the method for processing an access request as described in the above embodiments.
For example, the electronic device may implement the following as shown in fig. 2: step S202, if an access request is received, determining a source channel of the access request; step S204, determining a target server corresponding to the source channel according to the source channel; step S206, sending the access request to the target server, so that the target server schedules the database associated with the target server to respond to the access request.
As another example, the electronic device may implement the steps shown in fig. 3.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the invention. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiment of the present invention.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (9)

1. A method for processing an access request, comprising:
if an access request is received, determining a source channel of the access request, wherein determining the source channel of the access request comprises: extracting the value of a designated field in the access request, and determining a source channel of the access request according to the value of the designated field, wherein the designated field comprises a User-Agent field in the access request, and the source channel comprises a PC (personal computer) end, a WeChat end, a WAP (Wireless application) end, an APP (application) end or other third-party channels;
determining a target server corresponding to the source channel according to the source channel;
sending the access request to the target server so that the target server schedules a database associated with the target server to respond to the access request.
2. The method for processing the access request according to claim 1, wherein determining the target server corresponding to the source channel according to the source channel comprises:
acquiring a corresponding relation between a channel and a server;
and determining a target server corresponding to the source channel based on the corresponding relation between the channel and the server.
3. The method for processing the access request according to claim 2, wherein determining the target server corresponding to the source channel based on the correspondence between the channels and the servers comprises:
if the number of the servers corresponding to the source channel is one, taking the server corresponding to the source channel as the target server;
and if the number of the servers corresponding to the source channel is multiple, selecting one server from the multiple servers corresponding to the source channel as the target server in a load balancing mode.
4. The method for processing the access request according to claim 1, further comprising:
if a new channel needs to be added, establishing a corresponding relation between the new channel and a server set for the new channel;
and storing the established corresponding relation.
5. The method of claim 1, wherein the databases associated with the servers corresponding to different channels are different.
6. The method for processing the access request according to any one of claims 1 to 5, wherein determining a source channel of the access request comprises:
transmitting the access request to a predetermined Lua script so as to determine a source channel of the access request through the predetermined Lua script;
and receiving a determination result returned by the predetermined Lua script.
7. An apparatus for processing an access request, comprising:
the device comprises a first determining unit, a second determining unit and a third determining unit, wherein the first determining unit is used for determining a source channel of an access request when the access request is received;
the first determination unit is further configured to: extracting the value of a designated field in the access request, and determining a source channel of the access request according to the value of the designated field, wherein the designated field comprises a User-Agent field in the access request, and the source channel comprises a PC (personal computer) end, a WeChat end, a WAP (Wireless application) end, an APP (application) end or other third-party channels;
the second determining unit is used for determining a target server corresponding to the source channel according to the source channel;
and the sending unit is used for sending the access request to the target server so that the target server schedules the database associated with the target server to respond to the access request.
8. A computer-readable medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method of processing an access request according to any one of claims 1 to 6.
9. 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 processing an access request according to any one of claims 1 to 6.
CN201711344627.9A 2017-12-15 2017-12-15 Access request processing method, device, medium and electronic equipment Active CN108052615B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711344627.9A CN108052615B (en) 2017-12-15 2017-12-15 Access request processing method, device, medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711344627.9A CN108052615B (en) 2017-12-15 2017-12-15 Access request processing method, device, medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN108052615A CN108052615A (en) 2018-05-18
CN108052615B true CN108052615B (en) 2021-12-21

Family

ID=62132965

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711344627.9A Active CN108052615B (en) 2017-12-15 2017-12-15 Access request processing method, device, medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN108052615B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117284A (en) * 2018-07-20 2019-01-01 深圳乐信软件技术有限公司 Processing method, device, equipment and the storage medium of solicited message
CN110046036A (en) * 2018-12-25 2019-07-23 阿里巴巴集团控股有限公司 A kind of operation requests distribution method, device and equipment
CN111510733A (en) * 2019-01-30 2020-08-07 北京奇虎科技有限公司 Channel scheduling method, server and system
CN110324403A (en) * 2019-05-23 2019-10-11 平安科技(深圳)有限公司 Dynamic divides library method for routing, device, server and storage medium
CN110324407B (en) * 2019-06-04 2021-03-02 贝壳找房(北京)科技有限公司 Access control method and device for background server and storage medium
CN112100092B (en) * 2019-06-18 2024-05-24 北京京东尚科信息技术有限公司 Information caching method, device, equipment and medium
CN110351350B (en) * 2019-06-28 2022-09-06 北京你财富计算机科技有限公司 Client request processing method and system based on multi-server docking and electronic equipment
CN110519380B (en) * 2019-08-29 2022-06-21 北京旷视科技有限公司 Data access method and device, storage medium and electronic equipment
CN110717818A (en) * 2019-08-30 2020-01-21 深圳壹账通智能科技有限公司 Method, device and storage medium for managing credit data based on big data
CN111224873B (en) * 2020-01-20 2021-01-01 厦门靠谱云股份有限公司 Nginx route distribution type-based micro front-end system and development and deployment methods thereof
CN112102068A (en) * 2020-09-16 2020-12-18 中国建设银行股份有限公司 ETC business handling method and system
CN112169341B (en) * 2020-09-29 2022-02-25 苏州亿歌网络科技有限公司 Game data processing method, device, equipment and storage medium
CN117473070B (en) * 2023-12-27 2024-04-02 深圳星网信通科技股份有限公司 Multi-channel application method of intelligent robot, intelligent robot and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302640A (en) * 2016-07-27 2017-01-04 乐视控股(北京)有限公司 Data request processing method and device
CN106453452A (en) * 2015-08-07 2017-02-22 百度在线网络技术(北京)有限公司 Data access request processing method and server used for processing data access request

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106453452A (en) * 2015-08-07 2017-02-22 百度在线网络技术(北京)有限公司 Data access request processing method and server used for processing data access request
CN106302640A (en) * 2016-07-27 2017-01-04 乐视控股(北京)有限公司 Data request processing method and device

Also Published As

Publication number Publication date
CN108052615A (en) 2018-05-18

Similar Documents

Publication Publication Date Title
CN108052615B (en) Access request processing method, device, medium and electronic equipment
JP7127010B2 (en) Resource allocation methods, apparatus, electronic equipment, computer readable media and computer programs
CN107343045B (en) Cloud computing system and cloud computing method and device for controlling server
US10572285B2 (en) Method and apparatus for elastically scaling virtual machine cluster
CN110750436B (en) Layered testing method and device, computer readable medium and electronic equipment
US20190199785A1 (en) Determining server level availability and resource allocations based on workload level availability requirements
CN107729570B (en) Data migration method and device for server
CN110708212B (en) Method and device for tracking call link in distributed system
CN107835181B (en) Authority management method, device and medium of server cluster and electronic equipment
US9787761B2 (en) Allocating physical nodes for processes in an execution plan
CN105227489A (en) A kind of bandwidth management method and electronic equipment
WO2016101799A1 (en) Service allocation method and device based on distributed system
WO2023174013A1 (en) Video memory allocation method and apparatus, and medium and electronic device
CN115033340A (en) Host selection method and related device
CN110083341A (en) A kind of front end development platform, front end development approach and page display method
US20210089504A1 (en) Database upgrade in a distributed database cluster
CN109729110B (en) Method, apparatus and computer readable medium for managing dedicated processing resources
CN110489356B (en) Information processing method, information processing device, electronic equipment and storage medium
CN109842665B (en) Task processing method and device for task allocation server
CN113391882B (en) Virtual machine memory management method and device, storage medium and electronic equipment
CN114237902A (en) Service deployment method and device, electronic equipment and computer readable medium
CN110247802B (en) Resource configuration method and device for cloud service single-machine environment
CN110633142B (en) Block chain consensus method, management node, electronic device, and storage medium
CN109547552B (en) API request processing method and device, storage medium and electronic equipment
CN115176452A (en) Method and system for data management in a communication network

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
CP03 Change of name, title or address

Address after: Floor 36, Zheshang Building, No. 718 Jianshe Avenue, Jiang'an District, Wuhan, Hubei 430019

Patentee after: TK.CN INSURANCE Co.,Ltd.

Patentee after: TAIKANG INSURANCE GROUP Co.,Ltd.

Address before: 156 fuxingmennei street, Xicheng District, Beijing 100031

Patentee before: TAIKANG INSURANCE GROUP Co.,Ltd.

Patentee before: TK.CN INSURANCE Co.,Ltd.

CP03 Change of name, title or address