WO2017045537A1 - 一种分布式系统中请求的处理方法以及装置 - Google Patents
一种分布式系统中请求的处理方法以及装置 Download PDFInfo
- Publication number
- WO2017045537A1 WO2017045537A1 PCT/CN2016/097997 CN2016097997W WO2017045537A1 WO 2017045537 A1 WO2017045537 A1 WO 2017045537A1 CN 2016097997 W CN2016097997 W CN 2016097997W WO 2017045537 A1 WO2017045537 A1 WO 2017045537A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- request
- sub
- distributed system
- processing
- service request
- 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.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/566—Grouping or aggregating service requests, e.g. for unified processing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/40—Network security protocols
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/567—Integrating service provisioning from a plurality of service providers
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5038—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
Definitions
- the present application relates to the field of distributed system technologies, and in particular, to a processing method for a request in a distributed system.
- the application also relates to a processing device for requesting in a distributed system.
- a user-initiated service request often cannot directly obtain an implementation object, and needs to perform collaborative processing on the user's service request through multiple intermediate service components, and finally completes the operation.
- a user's simple write request for a file may require intermediate service components such as scheduling, communication, indexing, and distributed storage to complete a file write operation.
- intermediate service components are generally deployed in The different processes of the server and the different software components are due to the complexity of the distributed system, which makes the performance analysis of the distributed system more difficult.
- the processing method of the request in the distributed system includes: sampling a user request received by each server in the distributed system; generating a corresponding identifier for the user request sampled by each server, the identifier
- the variable is passed to the current thread as a variable
- the tracking interface is injected into the running process of each server in the distributed system, and when the process runs to the tracking interface, if the current process is detected,
- the identifier is associated with the related information of the function indicated by the tracking interface and generates a log; the generated logs are respectively summarized according to the corresponding identifier.
- the processing method of the request in the distributed system obtains the user request as a sample from the distributed system in a sampling manner, and passes the abnormal request that affects the performance of the sample (especially the request for processing timeout, that is, Slow request) analysis to improve the performance of distributed systems, low efficiency, and flaws.
- slow requests are relatively small compared to all requests.
- the sampling rate is low, generally one thousandth or even lower, so it is captured by sampling.
- Slow request ratio Less, the effect on the performance improvement of the distributed system is small; and the slow request is analyzed by collecting the log, and the adjustment made to the distributed system according to the analysis result of the slow request needs to wait for the next iteration period (log analysis period)
- the iteration cycle is generally at the minute level (5-10 minutes), and the efficiency is low; in addition, many distributed systems applied to cloud services require capturing each slow request, which is requested in the distributed system provided by the prior art. The processing method cannot be satisfied and there are defects.
- the present application provides a processing method for a request in a distributed system to solve the problems of low efficiency and drawbacks existing in the prior art.
- the application also relates to a processing device for requesting in a distributed system.
- the application provides a processing method for a request in a distributed system, including:
- the execution record of the sub-request associated with the service request corresponding to the sub-request is summarized, and an execution record of the service request is generated and returned to the requester.
- the generating an execution record of the sub-request includes:
- the summarizing the execution record of the sub-request associated with the service request corresponding to the sub-request, and generating the execution record of the service request and returning to the requesting party specifically:
- a summary of the execution record of the business request is returned to the requestor.
- the calling link includes:
- a summary of the execution record of the business request is returned to the requestor.
- the service request is split into at least one and the service.
- the service request is split into at least one and the service.
- the dimension participating in the data operation when processing according to the service request in the distributed system splitting the service request into at least one sub-request step associated with the service request, and executing in the Before the sub-request is distributed to the corresponding processing unit in the distributed system for performing the processing step, the following steps are performed:
- the sub-request is distributed to a corresponding processing unit in the distributed system for processing, and specifically includes:
- a summary of the execution record of the service request is recorded in a log corresponding to the service request.
- the dimensions include:
- the association between the service request and the sub-request is determined according to an association between an identifier of the service request and an identifier of the sub-request.
- the processing unit is composed of at least one server in the distributed system.
- At least one of the following information is recorded in the execution record:
- the identifier the identity of the server participating in the processing, the processing time, the name of the function called, the time the function was called And related information generated at the time of the call.
- At least one of the following information is recorded in the summary of the execution record:
- the identifier The identifier, the identity of the server participating in the processing, and the processing time.
- the exception log records an exception information generated when the function is called.
- the application also provides a processing device for requesting in a distributed system, comprising:
- a service request receiving unit configured to receive a service request initiated by the requesting party
- a service request splitting unit configured to split the service request into at least one sub-request associated with the service request according to a dimension involved in the data operation when the service request is processed in the distributed system
- a sub-request distribution unit configured to distribute the sub-request to a corresponding processing unit in the distributed system for processing
- a sub-request judging unit configured to determine whether a processing time of the sub-request exceeds a preset time threshold of each processing unit in the distributed system
- the execution record generating unit is configured to generate an execution record of the subrequest
- the execution record summary feedback unit is configured to summarize an execution record of the sub-request associated with the service request corresponding to the sub-request, and generate an execution record of the service request to be returned to the requesting party.
- the execution record generating unit specifically includes:
- sub-request execution record generation sub-unit for generating an execution record of the sub-request
- a sub-requesting exception logging sub-unit for recording an execution record of the sub-request into an exception log corresponding to each of the sub-requests
- a sub-request digest extraction sub-unit for extracting a summary of execution records of the sub-request is a sub-request digest extraction sub-unit for extracting a summary of execution records of the sub-request.
- the performing record summary feedback unit specifically includes:
- sub-request summary summary sub-unit configured to summarize a summary of execution records of the sub-requests involved in the invocation link of the service request corresponding to the sub-request
- a service request summary generation subunit configured to generate a summary of an execution record of the service request
- the service request summary returns a subunit for returning a summary of the execution record of the service request to the requestor.
- the following unit is performed:
- a sub-request execution record generating unit configured to generate an execution record of the sub-request
- a sub-request summary extracting unit configured to extract a summary of an execution record of the sub-request
- sub-request summary summary unit for summarizing summaries of execution records of the sub-requests
- a service request summary generating unit configured to generate a summary of an execution record of the service request
- a service request summary return unit is configured to return a summary of the execution record of the service request to the requester.
- the processing device requested in the distributed system includes:
- a service request identifier generating unit is configured to generate an identifier corresponding to the service request uniquely.
- the processing device requested in the distributed system includes:
- a sub-request identifier generating unit configured to generate an identifier corresponding to each of the sub-requests.
- the sub-request distribution unit specifically includes:
- a sub-request distribution sub-unit configured to separately send the sub-request to a pre-set, and the sub-request in the distributed according to a dimension of the data operation involved in processing the sub-request in the distributed system
- the processing unit corresponding to the dimension participating in the data operation when processing in the system.
- the method for processing a request in a distributed system includes: receiving a service request initiated by a requester; and participating in a data operation dimension in processing in the distributed system according to the service request, splitting the service request into at least one The service requests the associated sub-request; the sub-request is distributed to a corresponding processing unit in the distributed system for processing; and it is determined whether the processing time of the sub-request exceeds a preset of the processing unit in the distributed system a time threshold; if yes, generating an execution record of the sub-request; summarizing an execution record of the sub-request associated with the service request corresponding to the sub-request, and generating an execution record of the service request to be returned to the requesting party.
- the processing method of the request in the distributed system sets a corresponding time threshold for the processing unit in the distributed system, and filters out the sub-request with the processing time exceeding the corresponding time threshold by the time threshold in the processing unit, that is, the slow request.
- the processing of the slow request is more comprehensive and more efficient. At the same time, the processing efficiency of the distributed system is improved.
- FIG. 1 is a process flow diagram of an embodiment of a processing method of a request in a distributed system provided by the present application
- FIG. 2 is a schematic diagram of an embodiment of a processing device requested in a distributed system provided by the present application.
- the present application provides a processing method for a request in a distributed system, and the present application further provides a processing device for requesting in a distributed system, which is described in detail below with reference to the accompanying drawings of the embodiments provided herein, and Each step is explained.
- the processing method for requesting in a distributed system is as follows:
- FIG. 1 there is shown a process flow diagram of an embodiment of a processing method of a request in a distributed system provided by the present application. Furthermore, the relationship between the various steps of the processing method embodiment of the request in the distributed system is determined according to FIG.
- Step S101 Receive a service request initiated by the requesting party.
- the requesting party refers to a user of a distributed system, such as a user who uses or rents an Open Structured Data Service (OTS).
- Open Structured Data Service is a multi-tenant cloud service that provides cloud services to users. Rent a business.
- the service request refers to a user-initiated user request in a distributed system.
- a service request involves more types of data operations
- when the service request is processed in a distributed system it may be split into multiple sub-requests, which are respectively processed by corresponding processing units in the distributed system. For example, if the service request involves data reading, it is processed by a processing unit dedicated to data reading in the distributed system; and if the service request involves data writing, data query, and data deletion, the operation is performed in a distributed system. When processed, it is split into three sub-requests, which are processed by processing units for data writing, data query, and data deletion in the distributed system.
- processing unit in the distributed system is composed of servers in a distributed system, and each subsystem includes at least one server.
- each service request has a unique corresponding identifier, such as for each service request With a unique corresponding ID.
- sub-requests also have respective corresponding identifiers, such as respectively assigning IDs for sub-requests.
- sub-requests are obtained by splitting according to service requests. Therefore, there is an association relationship between service requests and sub-requests.
- the association between the service request and the sub-request is determined according to an association relationship between an identifier of the service request and an identifier of the sub-request. For example, if the ID corresponding to the service request is 201508070024, the ID corresponding to the sub-request associated with the service request may be set to 201508070001_1, 201508070001_2, . . . , 201508070001_x, or 20150807000101, 20150807000102, . . . , 201508070001x.
- the time threshold is used to filter the slow request in the distributed system.
- the processing time is exceeded.
- the pre-set time threshold then the service request or the sub-request is determined to be a slow request, and vice versa.
- the step is performed, that is, after receiving the service request initiated by the requesting party, performing the step of generating an identifier corresponding to the service request uniquely.
- Step S102 Participate in a dimension of the data operation according to the service request in the distributed system, and split the service request into at least one sub-request associated with the service request.
- the dimension of the service request participating in the data operation when processed in the distributed system refers to the type of data operation involved when the service request is processed in the distributed system.
- the dimensions include: data reading, data writing, data query, and data deletion; in a specific implementation, the dimension may also include other types of data operations, which are not limited herein.
- the service request is split into at least one sub-request associated with the service request, and the sub-request is distributed by the system.
- the corresponding processing unit in the process is processed.
- the step of generating an identifier corresponding to each of the sub-requests is performed.
- Step S103 distributing the sub-request to a corresponding processing unit in the distributed system for processing.
- the processing unit is set according to the dimension of the data operation when the service request is processed in the distributed system, for example, the service request participates in processing in the distributed system.
- Data operations dimensions such as data reading, data writing, data query, and data deletion are set in a distributed system for processing processing units involving data reading, data writing, data query, and data deletion;
- step S102 in the distributed system, the service request is distributed according to the service request.
- the dimension involved in the data operation during processing is split into at least one sub-request associated with the service request;
- the dimensions of the two are consistent with each other, that is, the service request is split according to the processing unit in the distributed system, and split into at least one sub-request for processing in the corresponding processing unit.
- a sub-request corresponding to each type of service request may be generated.
- the sub-request is distributed to a corresponding processing unit in the distributed system for processing.
- the sub-requests are respectively sent to the pre-set and the sub-requests are processed in the distributed system when the sub-requests are processed in the distributed system.
- the processing unit corresponding to the dimension of the data operation.
- Step S104 Determine whether the processing time of the sub-request exceeds a preset time threshold of the processing unit in the distributed system.
- a corresponding time threshold is preset for each processing unit in the distributed system.
- the time threshold is a time threshold set in advance for a processing unit in a distributed system.
- the sub-request associated with the service request is processed by each processing unit of the distributed system, once the processing time of the sub-request in any one of the processing units of the distributed system exceeds a preset time threshold of the processing unit, The subrequest is determined to be a slow request, and vice versa.
- a corresponding time threshold may be preset for each server in the processing unit.
- the processing request associated with the sub-request of the server exceeds the preset time threshold of the server, the service request or the The subrequest is determined to be a slow request, and vice versa.
- a time threshold set in advance for the processing unit in the distributed system may be dynamically adjusted.
- Step S105 generating an execution record of the subrequest.
- step S104 it is determined whether the processing time of the sub-request exceeds the preset time threshold of the processing unit in the distributed system, that is, the determination is
- the subrequest is a slow request.
- an execution record of the slow request ie, the subrequest
- the service request association corresponding to the slow request is summarized.
- An execution record of the child request, and an execution record of the generated business request is returned to the requester.
- the execution record refers to the detailed information when executed in a distributed system.
- the execution record records at least one piece of information: an identifier, an identifier of a server participating in the processing, a processing time, a function name of the call, a time of calling the function, and related information generated when the call is made.
- execution information of a subrequest in a distributed system is:
- 201508070001_1 refers to the identifier (ID) of the sub-request
- A1, a2, a3, refer to an identifier (ID) of a server participating in processing the sub-request in the distributed system;
- 1s, 2s, 1s refers to the time taken to process the servers at a1, a2, and a3 respectively;
- Read() refers to the name of the function being called
- Xx:xx:xx refers to the time point when the function is called
- Xxxx is the result of a function call, that is, the related information generated when the function is called.
- the step specifically includes the following three sub-steps:
- any slow request has its own corresponding exception log.
- the abnormality log is used to record an execution record of a slow request.
- the exception log records an exception information generated when the function is called, such as an exception log of the JAVA function.
- the performance loss when performing corresponding data processing in the distributed system can be reduced; on the other hand, the distribution can be reduced.
- At least one piece of information is recorded in the summary of the execution record: an identifier, an identifier of a server participating in the processing, and a processing time.
- the summary of the execution record of the extracted subrequest is:
- 201508070001_1 refers to the identifier (ID) of the sub-request
- A1, a2, a3, refer to an identifier (ID) of a server participating in processing the sub-request in the distributed system;
- 1s, 2s, and 1s refer to the length of time spent on processing at the a1, a2, and a3 servers.
- other information in the execution record may also be used as a digest, as long as it can be ensured that the slow request can be located by the digest or the reason for the slow request can be analyzed.
- Step S106 the execution record of the sub-request associated with the service request corresponding to the sub-request is summarized, and an execution record of the service request is generated and returned to the requesting party.
- the execution record of all the sub-requests associated with the service request corresponding to the slow request is summarized, and the execution record of the service request is returned to the requesting party.
- the requesting party may perform the record according to the execution record. Troubleshoot the problem and determine whether it is a code problem, a network problem, or a distributed system problem. If it is a distributed system problem, you can get a corresponding solution by feeding back to the administrator of the distributed system.
- any one of the sub-requests in the distributed system is determined to be a slow request
- the execution record of all the sub-requests associated with the service request corresponding to the slow request is summarized, and an execution record of the service request is generated and returned to the The requesting party is very helpful in analyzing and locating the slow request by the requesting party.
- step S105 based on the summary of the execution record of the sub-request, preferably, the step specifically includes the following three sub-steps:
- the role of the invoking link is to determine the location of the sub-request associated with the service request in the distributed system, thereby acting as a "location".
- the calling link refers to a sequential combination of all servers in the distributed system that participate in processing the service request associated sub-request.
- sub-request A there are two sub-requests for a service request: sub-request A and sub-request B.
- sub-request A When sub-request A is processed in a distributed system, the servers participating in processing the request A have a1, a2, and a3, and sub-request A Distributed
- the calling link in the system (the sequential combination of all the servers participating in the processing of the sub-request) is: a1->a2->a3, or (a1, a2, a3); correspondingly, the sub-request B is in the distributed system
- the processing link is: c1->c2->c3, or (c1, c2, c3); the calling link of the service request is: a1->a2->a3, c1->c2->c3, or (a1) , a2, a3; c1, c2, c3).
- the step is executed, that is, after generating the digest of the execution record of the service request, performing a sub-step of recording the summary of the execution record of the service request to the log corresponding to the service request.
- any one of the sub-requests in the distributed system is determined to be a slow request, the summary of the execution record of the sub-request involved in the invocation link of the service request corresponding to the slow request is summarized, and an execution record of the service request is generated. And returned to the requestor.
- step S104 if it is determined whether the processing time of the sub-request exceeds a time threshold set by each of the processing units in the distributed system, the determination result is no, that is, the sub-request Instead of a slow request, perform the following steps:
- a summary of the execution record of the business request is returned to the requestor.
- the summary of the execution record of the service request may also be summarized and generated according to the calling link of the service request.
- the sub-request is not a slow request, except the above steps.
- other processing may be performed on the sub-request or the service request, or no processing is performed, which is not limited thereto.
- the processing method of the request in the distributed system sets a corresponding time threshold for the processing unit in the distributed system, and filters out the processing time beyond the corresponding time threshold by using the time threshold in the processing unit.
- the request that is, the slow request, captures all the slow requests in the distributed system, and the execution records of each slow request are recorded in the corresponding exception logs, and are not missed, and the execution record of the service request is recorded to the corresponding In the log, the information collected for slow requests is more complete, and the analysis of the location and cause of slow requests Provided convenience; in addition, according to the execution record of the sub-request, the execution record of the service request is obtained, and the execution record of the service request is returned to the requesting party, and the processing of the slow request is more comprehensive and more efficient, and the distributed system is improved. Processing efficiency.
- the processing device requested in a distributed system provided by the present application is implemented as follows:
- a processing method for a request in a distributed system is provided.
- the present application further provides a processing device for requesting in a distributed system, which will be described below with reference to the accompanying drawings.
- FIG. 2 there is shown a schematic diagram of an embodiment of a processing device requested in a distributed system provided by the present application.
- the application provides a processing device for requesting in a distributed system, including:
- the service request receiving unit 201 is configured to receive a service request initiated by the requesting party;
- the service request splitting unit 202 is configured to split the service request into at least one sub-request associated with the service request according to the dimension of the data operation participating in processing in the distributed system according to the service request;
- a sub-request distribution unit 203 configured to distribute the sub-request to a corresponding processing unit in the distributed system for processing
- the sub-request judging unit 204 is configured to determine whether the processing time of the sub-request exceeds a preset time threshold of each of the processing units in the distributed system;
- the execution record generating unit 205 is configured to generate an execution record of the subrequest
- the execution record summary feedback unit 206 is configured to summarize execution records of the sub-requests associated with the service request corresponding to the sub-request, and generate an execution record of the service request to be returned to the requesting party.
- the execution record generating unit 205 specifically includes:
- sub-request execution record generation sub-unit for generating an execution record of the sub-request
- a sub-requesting exception logging sub-unit for recording an execution record of the sub-request into an exception log corresponding to each of the sub-requests
- a sub-request digest extraction sub-unit for extracting a summary of execution records of the sub-request is a sub-request digest extraction sub-unit for extracting a summary of execution records of the sub-request.
- the execution record summary feedback unit 206 specifically includes:
- sub-request summary summary sub-unit configured to summarize a summary of execution records of the sub-requests involved in the invocation link of the service request corresponding to the sub-request
- a service request summary generation subunit configured to generate a summary of an execution record of the service request
- the service request summary returns a subunit for returning a summary of the execution record of the service request to the requestor.
- the calling link includes:
- a sub-request execution record generating unit configured to generate an execution record of the sub-request
- a sub-request summary extracting unit configured to extract a summary of an execution record of the sub-request
- sub-request summary summary unit for summarizing summaries of execution records of the sub-requests
- a service request summary generating unit configured to generate a summary of an execution record of the service request
- a service request summary return unit is configured to return a summary of the execution record of the service request to the requester.
- the processing device requested in the distributed system includes:
- a service request identifier generating unit is configured to generate an identifier corresponding to the service request uniquely.
- the processing device requested in the distributed system includes:
- a sub-request identifier generating unit configured to generate an identifier corresponding to each of the sub-requests.
- the sub-request distribution unit 203 specifically includes:
- a sub-request distribution sub-unit configured to separately send the sub-request to a pre-set, and the sub-request in the distributed according to a dimension of the data operation involved in processing the sub-request in the distributed system
- the processing unit corresponding to the dimension participating in the data operation when processing in the system.
- the processing device requested in the distributed system includes:
- the record recording log unit is configured to record a summary of the execution record of the service request into a log corresponding to the service request.
- the dimensions include:
- the association between the service request and the sub-request is determined according to an association between an identifier of the service request and an identifier of the sub-request.
- the processing unit is composed of at least one server in the distributed system.
- At least one of the following information is recorded in the execution record:
- the identifier the identity of the server participating in the processing, the processing time, the name of the function being called, the time the function was called, and related information generated at the time of the call.
- At least one of the following information is recorded in the summary of the execution record:
- the identifier The identifier, the identity of the server participating in the processing, and the processing time.
- the exception log records an exception information generated when the function is called.
- a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
- processors CPUs
- input/output interfaces network interfaces
- memory volatile and non-volatile memory
- the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
- RAM random access memory
- ROM read only memory
- Memory is an example of a computer readable medium.
- Computer readable media including both permanent and non-persistent, removable and non-removable media may be implemented by any method or technology.
- the information can be computer readable instructions, data structures, modules of programs, or other data.
- Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
- computer readable media does not include non-transitory computer readable media, such as modulated data signals and carrier waves.
- embodiments of the present application can be provided as a method, system, or computer program product.
- the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment in combination of software and hardware.
- the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Computer And Data Communications (AREA)
Abstract
本申请公开了一种分布式系统中请求的处理方法以及装置,该方法包括:接收请求方发起的业务请求;按照该业务请求在分布式系统中处理时参与数据操作的维度,将该业务请求拆分为至少一个与该业务请求相关联的子请求;将所述子请求分发至所述分布式系统中的相应处理单元进行处理;判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预设的时间阈值;若是,生成所述子请求的执行记录;汇总该子请求对应的业务请求关联的子请求的执行记录,生成该业务请求的执行记录返回给所述请求方。所述分布式系统中请求的处理方法,对慢请求的处理更加全面,效率更高,同时提升了分布式系统的处理效率。
Description
本申请要求2015年09月14日递交的申请号为201510582405.5、发明名称为“一种分布式系统中请求的处理方法以及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及分布式系统技术领域,具体涉及一种分布式系统中请求的处理方法。本申请同时涉及一种分布式系统中请求的处理装置。
随着计算机技术和网络技术的不断发展,分布式系统架构的应用越来越广泛。在分布式系统中,用户发起的服务请求往往不能直接获得实现对象,需要经过多个中间服务构件对用户的服务请求进行协同处理,并最终完成操作。比如在现有的云计算平台中,用户简单的一次写文件的访问请求,可能需要经过调度、通信、索引以及分布式存储等中间服务构件,才能完成写文件操作,这些中间服务构件一般部署在服务器的不同进程上,并且由不同的软件构成,正是由于分布式系统的复杂性,导致对分布式系统的性能分析的难度较大。
目前,现有技术提供的分布式系统中请求的处理方法,包括:对分布式系统中各服务器接收到的用户请求进行采样;对各服务器采样到的用户请求生成对应的标识符,所述标识符在所述用户请求调用线程时会作为变量被传递到当前线程中;预先对分布式系统中各服务器运行的进程注入跟踪接口,当进程运行到该跟踪接口时,若检测到当前该进程包含用户请求对应的标识符,则将所述标识符和跟踪接口所指示的函数的相关信息对应并生成日志;将生成的日志按照所对应的标识符分别进行汇总。
上述现有技术提供的分布式系统中请求的处理方法存在明显的缺陷。
上述现有技术提供的分布式系统中请求的处理方法,以采样的方式从分布式系统中获取用户请求作为样本,通过对样本中影响其性能的异常请求(尤其是处理时间超时的请求,即慢请求)进行分析,以提高分布式系统的性能,效率较低,且存在缺陷。
在分布式系统中,慢请求相比全部请求而言,是比较少的,采样为了减少对性能的影响,采样率较低,一般是千分之一甚至更低,因此通过采样的方式捕捉到的慢请求比
较少,对分布式系统性能提升的作用很小;并通过收集日志的方式来分析慢请求,根据慢请求的分析结果对分布式系统做出的调整需要等待下一个迭代周期(日志分析周期)才能生效,迭代周期一般在分钟级别(5-10分钟),效率低;此外,许多应用于云服务的分布式系统中,要求捕捉每个慢请求,现有技术提供的分布式系统中请求的处理方法无法满足,存在缺陷。
发明内容
本申请提供一种分布式系统中请求的处理方法,以解决现有技术的存在的效率较低和存在缺陷的问题。
本申请同时涉及一种分布式系统中请求的处理装置。
本申请提供一种分布式系统中请求的处理方法,包括:
接收请求方发起的业务请求;
按照该业务请求在分布式系统中处理时参与数据操作的维度,将该业务请求拆分为至少一个与该业务请求相关联的子请求;
将所述子请求分发至所述分布式系统中的相应处理单元进行处理;
判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预设的时间阈值;
若是,生成所述子请求的执行记录;
汇总该子请求对应的业务请求关联的子请求的执行记录,生成该业务请求的执行记录返回给所述请求方。
可选的,所述生成所述子请求的执行记录,具体包括:
生成所述子请求的执行记录;
将所述子请求的执行记录记录到所述子请求各自对应的异常日志中;
提取所述子请求的执行记录的摘要。
可选的,所述汇总该子请求对应的业务请求关联的子请求的执行记录,生成该业务请求的执行记录返回给所述请求方,具体包括:
汇总该子请求对应的业务请求的调用链路涉及的子请求的执行记录的摘要;
生成该业务请求的执行记录的摘要;
将该业务请求的执行记录的摘要返回给所述请求方。
可选的,所述调用链路包括:
所述分布式系统中、参与处理该业务请求关联子请求的所有服务器的顺序组合。
可选的,若所述判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预设的时间阈值步骤的判断结果为否,执行下述步骤:
生成所述子请求的执行记录;
提取所述子请求的执行记录的摘要;
汇总所述子请求的执行记录的摘要;
生成该业务请求的执行记录的摘要;
将该业务请求的执行记录的摘要返回给所述请求方。
可选的,所述接收请求方发起的业务请求步骤执行之后,并在所述按照该业务请求在分布式系统中处理时参与数据操作的维度,将该业务请求拆分为至少一个与该业务请求相关联的子请求步骤执行之前,执行下述步骤:
生成该业务请求唯一对应的标识符。
可选的,所述按照该业务请求在分布式系统中处理时参与数据操作的维度,将该业务请求拆分为至少一个与该业务请求相关联的子请求步骤执行之后,并在所述将所述子请求分发至所述分布式系统中的相应处理单元进行处理步骤执行之前,执行下述步骤:
生成所述子请求各自对应的标识符。
可选的,所述将所述子请求分发至所述分布式系统中的相应处理单元进行处理,具体包括:
按照所述子请求在所述分布式系统中处理时参与数据操作的维度,分别将所述子请求发送至预先设置的、与所述子请求在所述分布式系统中处理时参与数据操作的维度对应的处理单元。
可选的,所述生成该业务请求的执行记录的摘要子步骤执行之后,执行下述子步骤:
将该业务请求的执行记录的摘要记录到该业务请求对应的日志中。
可选的,所述维度包括:
数据读取、数据写入、数据查询和数据删除。
可选的,该业务请求和所述子请求的关联,根据该业务请求的标识符和所述子请求的标识符之间的关联关系确定。
可选的,所述处理单元由所述分布式系统中的至少一台服务器组成。
可选的,所述执行记录中记录有下述至少一项信息:
标识符、参与处理的服务器的标识、处理时间、调用的函数名称、调用函数的时间
和调用时产生的相关信息。
可选的,所述执行记录的摘要中记录有下述至少一项信息:
标识符、参与处理的服务器的标识、处理时间。
可选的,所述异常日志中记录有调用函数时产生的异常信息。
本申请还提供一种分布式系统中请求的处理装置,包括:
业务请求接收单元,用于接收请求方发起的业务请求;
业务请求拆分单元,用于按照该业务请求在分布式系统中处理时参与数据操作的维度,将该业务请求拆分为至少一个与该业务请求相关联的子请求;
子请求分发单元,用于将所述子请求分发至所述分布式系统中的相应处理单元进行处理;
子请求判断单元,用于判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预设的时间阈值;
若是,则进入执行记录生成单元;
所述执行记录生成单元,用于生成所述子请求的执行记录;
执行记录汇总反馈单元,用于汇总该子请求对应的业务请求关联的子请求的执行记录,生成该业务请求的执行记录返回给所述请求方。
可选的,所述执行记录生成单元,具体包括:
子请求执行记录生成子单元,用于生成所述子请求的执行记录;
子请求异常日志记录子单元,用于将所述子请求的执行记录记录到所述子请求各自对应的异常日志中;
子请求摘要提取子单元,用于提取所述子请求的执行记录的摘要。
可选的,所述执行记录汇总反馈单元,具体包括:
子请求摘要汇总子单元,用于汇总该子请求对应的业务请求的调用链路涉及的子请求的执行记录的摘要;
业务请求摘要生成子单元,用于生成该业务请求的执行记录的摘要;
业务请求摘要返回子单元,用于将该业务请求的执行记录的摘要返回给所述请求方。
可选的,若所述子请求判断单元的判断结果为否,则进行下述单元:
子请求执行记录生成单元,用于生成所述子请求的执行记录;
子请求摘要提取单元,用于提取所述子请求的执行记录的摘要;
子请求摘要汇总单元,用于汇总所述子请求的执行记录的摘要;
业务请求摘要生成单元,用于生成该业务请求的执行记录的摘要;
业务请求摘要返回单元,用于将该业务请求的执行记录的摘要返回给所述请求方。
可选的,所述分布式系统中请求的处理装置,包括:
业务请求标识符生成单元,用于生成该业务请求唯一对应的标识符。
可选的,所述分布式系统中请求的处理装置,包括:
子请求标识符生成单元,用于生成所述子请求各自对应的标识符。
可选的,所述子请求分发单元,具体包括:
子请求分发子单元,用于按照所述子请求在所述分布式系统中处理时参与数据操作的维度,分别将所述子请求发送至预先设置的、与所述子请求在所述分布式系统中处理时参与数据操作的维度对应的处理单元。
与现有技术相比,本申请具有以下优点:
本申请提供的分布式系统中请求的处理方法,包括:接收请求方发起的业务请求;按照该业务请求在分布式系统中处理时参与数据操作的维度,将该业务请求拆分为至少一个与该业务请求相关联的子请求;将所述子请求分发至所述分布式系统中的相应处理单元进行处理;判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预设的时间阈值;若是,生成所述子请求的执行记录;汇总该子请求对应的业务请求关联的子请求的执行记录,生成该业务请求的执行记录返回给所述请求方。
本申请提供的分布式系统中请求的处理方法,预先针对分布式系统中的处理单元设置相应的时间阈值,通过处理单元中的时间阈值筛选出处理时间超出对应时间阈值的子请求,即慢请求,从而捕捉到分布式系统中所有的慢请求,并且根据子请求的执行记录汇总获得业务请求的执行记录,将业务请求的执行记录返回给请求方,对慢请求的处理更加全面,效率更高,同时提升了分布式系统的处理效率。
附图1是本申请提供的一种分布式系统中请求的处理方法实施例的处理流程图;
附图2是本申请提供的一种分布式系统中请求的处理装置实施例的示意图。
在下面的描述中阐述了很多具体细节以便于充分理解本申请。但是本申请能够以很多不同于在此描述的其他方式来实施,本领域技术人员可以在不违背本申请内涵的情况
下做类似推广,因此本申请不受下面公开的具体实施的限制。
本申请提供一种分布式系统中请求的处理方法,本申请还提供一种分布式系统中请求的处理装置,以下分别结合本申请提供的实施例的附图逐一进行详细说明,并且对方法的各个步骤进行说明。
本申请提供的一种分布式系统中请求的处理方法实施例如下:
参照附图1,其示出了本申请提供的一种分布式系统中请求的处理方法实施例的处理流程图。此外,所述分布式系统中请求的处理方法实施例的各个步骤之间的关系,请根据附图1确定。
步骤S101,接收请求方发起的业务请求。
对于分布式系统,影响其性能的一个重要因素是其中异常请求的数目,尤其是慢请求的数目,一旦分布式系统中的慢请求数目过多,则会导致分布式系统的处理性能大大降低,为提高分布式系统的处理效率,需要分析分布式系统中慢请求存在的原因,但由于分布式系统的复杂性,慢请求的追踪和定位的难度较大。在这种情况下,采用本申请提供的分布式系统中请求的处理方法,在充分考虑分布式系统自身特性的基础上,通过设置时间阈值,捕捉分布式系统中的所有慢请求,并通过慢请求的执行记录,可以准确的定位慢请求,从而分析慢请求发生的原因,实时做出相应处理,提高分布式系统的处理效率。
所述请求方,是指分布式系统的用户,比如使用或者租用开放结构化数据服务(OTS)的用户,开放结构化数据服务(OTS)是一种多租户云服务,向用户提供云服务的租用业务。所述业务请求,是指分布式系统中的用户发起的用户请求。
一般而言,在分布式系统中,有多个子系统,每一个子系统作为一个处理单元,处理单元用于处理业务请求。如果一个业务请求涉及的数据操作的类型比较多,该业务请求在分布式系统中进行处理时,可能被拆分为多个子请求,分别由分布式系统中的相应处理单元进行相应处理。比如业务请求涉及数据读取,则由分布式系统中专门用于数据读取的处理单元进行处理;再比如业务请求涉及数据写入、数据查询和数据删除等操作,则在分布式系统中进行处理时,被拆分为3个子请求,分别由分布式系统中用于数据写入、数据查询和数据删除的处理单元进行处理。
需要说明的是,所述分布式系统中的处理单元,是由分布式系统中的服务器组成,每个子系统包含至少一台服务器。
在具体实施时,每个业务请求都具有唯一对应的标识符,比如针对每个业务请求分
配唯一对应的ID。
相应的,所述子请求同样具有各自对应的标识符,比如针对子请求分别分配ID。
在分布式系统中,子请求都是根据业务请求拆分获得的,因此,业务请求与子请求之间具有关联关系。优选的,所述业务请求和所述子请求的关联,根据该业务请求的标识符和所述子请求的标识符之间的关联关系确定。比如业务请求对应的ID是201508070024,则与该业务请求关联的子请求对应的ID可以设置为201508070001_1、201508070001_2、···、201508070001_x,或者20150807000101、20150807000102、···、201508070001x。
所述时间阈值,是用于筛选分布式系统中慢请求的筛选依据,所述业务请求或者所述子请求在分布式系统中进行处理时,一旦该业务请求或者该子请求在的处理时间超出预先设置的时间阈值,则该业务请求或者该子请求被确定为是慢请求,反之。
优选的,在本步骤执行之后,即接收到请求方发起的业务请求之后,执行生成所述业务请求唯一对应的标识符步骤。
步骤S102,按照该业务请求在分布式系统中处理时参与数据操作的维度,将该业务请求拆分为至少一个与该业务请求相关联的子请求。
在分布式系统中,所述业务请求在分布式系统中处理时参与数据操作的维度,是指所述业务请求在分布式系统中处理时参与数据操作类型。优选的,所述维度包括:数据读取、数据写入、数据查询和数据删除;在具体实施时,所述维度还可以包括其他数据操作的类型,在此不做限定。
本步骤中,按照所述业务请求在分布式系统中处理时参与数据操作的维度,将所述业务请求拆分为至少一个与该业务请求相关联的子请求,所述子请求由分布式系统中的相应处理单元进行处理。
优选的,在本步骤执行之后,即将所述业务请求拆分为至少一个与所述业务请求相关联的子请求之后,执行生成所述子请求各自对应的标识符步骤。
步骤S103,将所述子请求分发至所述分布式系统中的相应处理单元进行处理。
根据上述步骤S101可知,在分布式系统中,所述处理单元是按照所述业务请求在分布式系统中处理时参与数据操作的维度设置的,比如所述业务请求在分布式系统中处理时参与数据操作的维度有数据读取、数据写入、数据查询和数据删除,则在分布式系统中设置用于处理涉及数据读取、数据写入、数据查询和数据删除的处理单元;
根据上述步骤S102可知,在分布式系统中,所述业务请求是按照该业务请求在分布
式系统中处理时参与数据操作的维度拆分为至少一个与该业务请求相关联的子请求;
由此可知,上述二者的维度是相互一致的,即业务请求是根据分布式系统中的处理单元进行拆分的,拆分为至少一个子请求在相应处理单元进行处理。
在具体实施时,对于一些较为特殊的业务请求,在分布式系统中进行处理时仅仅涉及一种数据操作的维度,则生成该类业务请求各自对应的一个子请求即可。
本实施例中,将所述子请求分发至所述分布式系统中的相应处理单元进行处理。
优选的,按照所述子请求在所述分布式系统中处理时参与数据操作的维度,分别将所述子请求发送至预先设置的、与所述子请求在所述分布式系统中处理时参与数据操作的维度对应的处理单元。
步骤S104,判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预设的时间阈值。
本实施例中,为了将分布式系统中的所有慢请求都筛选出来,预先针对分布式系统中的每个处理单元,各自预设了相应的时间阈值。
所述时间阈值是针对分布式系统中的处理单元预先设置的时间阈值。相应的,对于业务请求关联的子请求,在分布式系统的各个处理单元进行处理时,一旦该子请求在分布式系统的任意一个处理单元的处理时间超出该处理单元预先设置的时间阈值,则该子请求被确定为是慢请求,反之。
在具体实施时,还可以针对处理单元中的各个服务器预先设置相应的时间阈值,当业务请求关联的子请求在任意一个服务器的处理时间超出该服务器预先设置的时间阈值,则该业务请求或者该子请求被确定为是慢请求,反之。
此外,在具体实施时,针对所述分布式系统中的处理单元预先设置的时间阈值,可以进行动态调整。
本实施例中,判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预先设置的时间阈值;
若是,则执行下述步骤S105和步骤S106。
步骤S105,生成所述子请求的执行记录。
本步骤和下述步骤S105得以实施的前提是,上述步骤S104中,判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预设的时间阈值的判断结果为是,即判定所述子请求是慢请求。本实施例中,针对分布式系统中的慢请求,结合本步骤和下述步骤S105,生成慢请求(即:子请求)的执行记录,汇总慢请求对应的业务请求关联
的子请求的执行记录,生成该业务请求的执行记录返回给所述请求方。
所述执行记录,是指在分布式系统中执行时的细节信息。优选的,所述执行记录中记录有下述至少一项信息:标识符、参与处理的服务器的标识、处理时间、调用的函数名称、调用函数的时间和调用时产生的相关信息。
例如分布式系统中子请求的执行信息为:
201508070001_1;
a1、a2、a3;
1s、2s、1s;
read();
xx:xx:xx;
xxxx。
其中,201508070001_1,是指该子请求的标识符(ID);
a1、a2、a3,是指分布式系统中参与处理该子请求的服务器的标识符(ID);
1s、2s、1s,是指分别在a1,a2,a3服务器进行处理所耗时长;
read(),是指调用的函数名称;
xx:xx:xx,是指调用函数时的时间点;
xxxx,是指函数调用的结果,即函数调用时产生的相关信息。
在具体实施时,所述执行记录中还可以记录有上述信息之外的其他信息,在此不做限定。
优选的,在具体实施时,本步骤具体包括下述3个子步骤:
1)生成所述子请求的执行记录;
即生成上述所述慢请求(即:子请求)的执行记录。
2)将所述子请求的执行记录记录到所述子请求各自对应的异常日志中;
在分布式系统中,任意一个慢请求,都有各自对应的异常日志。所述异常日志,用于记录慢请求的执行记录。
优选的,所述异常日志中记录有调用函数时产生的异常信息,比如JAVA函数的异常日志。
3)提取所述子请求的执行记录的摘要。
在分布式系统中,通过提取慢请求的执行记录的摘要,相比执行记录,一方面,可以降低在分布式系统中进行相应数据处理时的性能损耗;另一方面,还可以减少在分布
式系统与请求方之间传输时占用的网络带宽。
优选的,所述执行记录的摘要中记录有下述至少一项信息:标识符、参与处理的服务器的标识、处理时间。
例如提取出的子请求的执行记录的摘要为:
201508070001_1;
a1、a2、a3;
1s、2s、1s。
其中,201508070001_1,是指该子请求的标识符(ID);
a1、a2、a3,是指分布式系统中参与处理该子请求的服务器的标识符(ID);
1s、2s、1s,是指分别在a1,a2,a3服务器进行处理所耗时长。
在具体实施时,还可以以所述执行记录中的其他信息作为摘要,只要能够确保通过摘要能够定位慢请求或者分析慢请求产生的原因即可。
步骤S106,汇总该子请求对应的业务请求关联的子请求的执行记录,生成该业务请求的执行记录返回给所述请求方。
本步骤中,汇总慢请求对应的业务请求关联的所有子请求的执行记录,生成该业务请求的执行记录返回给所述请求方,请求方接收到业务请求的执行记录之后,可以根据执行记录自行排查问题,确定是代码问题、网络问题还是分布式系统问题,如果是分布式系统的问题,可以通过向分布式系统的管理员反馈获得相应解决方法。
本实施例中,如果分布式系统中的任意一个子请求被判定为是慢请求,则汇总慢请求对应的业务请求关联的所有子请求的执行记录,生成该业务请求的执行记录返回给所述请求方,对请求方分析和定位所述慢请求很有帮助,
在上述步骤S105中,提取出所述子请求的执行记录的摘要的基础上,优选的,本步骤具体包括下述3个子步骤:
1)汇总该子请求对应的业务请求的调用链路涉及的子请求的执行记录的摘要;
所述调用链路的作用在于确定业务请求关联的子请求在分布式系统中的位置,在此起到“定位”作用。
优选的,所述调用链路,是指所述分布式系统中、参与处理所述业务请求关联子请求的所有服务器的顺序组合。
比如某业务请求的子请求有两个:子请求A和子请求B,其中,子请求A在分布式系统中进行处理时,参与处理该请求A的服务器有a1、a2和a3,则子请求A在分布式
系统中的调用链路(参与处理该子请求的所有服务器的顺序组合)为:a1->a2->a3,或者(a1,a2,a3);相应的,子请求B在分布式系统中的处理链路为:c1->c2->c3,或者(c1,c2,c3);该业务请求的调用链路为:a1->a2->a3、c1->c2->c3,或者(a1,a2,a3;c1,c2,c3)。
2)生成该业务请求的执行记录的摘要;
优选的,在本步骤执行之后,即生成该业务请求的执行记录的摘要之后,执行将该业务请求的执行记录的摘要记录到该业务请求对应的日志中子步骤。
3)将该业务请求的执行记录的摘要返回给所述请求方。
即:如果分布式系统中的任意一个子请求被判定为是慢请求,则汇总该慢请求对应的业务请求的调用链路涉及的子请求的执行记录的摘要,生成该业务请求的执行记录,并返回给所述请求方。
优选的,在具体实施时,在上述步骤S104中,若判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预先设置的时间阈值的判断结果为否,即所述子请求不是慢请求,执行下述步骤:
生成所述子请求的执行记录;
提取所述子请求的执行记录的摘要;
汇总所述子请求的执行记录的摘要;
生成该业务请求的执行记录的摘要;
将该业务请求的执行记录的摘要返回给所述请求方。
在具体实施时,还可以根据该业务请求的调用链路来汇总并生成该业务请求的执行记录的摘要。
此外,在具体实施时,若判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预先设置的时间阈值的判断结果为否,即所述子请求不是慢请求,除上述步骤之外,还可以针对所述子请求或者所述业务请求做其他处理,或者不作任何处理,对此不做限定。
综上所述,本申请提供的分布式系统中请求的处理方法,预先针对分布式系统中的处理单元设置相应的时间阈值,通过处理单元中的时间阈值筛选出处理时间超出对应时间阈值的子请求,即慢请求,从而捕捉到分布式系统中所有的慢请求,每个慢请求的执行记录都被记录到各自对应的异常日志中,不会遗漏,并且业务请求的执行记录被记录到对应的日志中,针对慢请求收集的信息更加完整,为慢请求的定位和产生原因的分析
提供了方便;此外,根据子请求的执行记录汇总获得业务请求的执行记录,将业务请求的执行记录返回给请求方,对慢请求的处理更加全面,效率更高,同时提升了分布式系统的处理效率。
本申请提供的一种分布式系统中请求的处理装置实施例如下:
在上述的实施例中,提供了一种分布式系统中请求的处理方法,与之相对应的,本申请还提供了一种分布式系统中请求的处理装置,下面结合附图进行说明。
参照附图2,其示出了本申请提供的一种分布式系统中请求的处理装置实施例的示意图。
由于装置实施例基本相似于方法实施例,所以描述得比较简单,相关的部分请参见上述提供的方法实施例的对应说明即可。下述描述的装置实施例仅仅是示意性的。
本申请提供一种分布式系统中请求的处理装置,包括:
业务请求接收单元201,用于接收请求方发起的业务请求;
业务请求拆分单元202,用于按照该业务请求在分布式系统中处理时参与数据操作的维度,将该业务请求拆分为至少一个与该业务请求相关联的子请求;
子请求分发单元203,用于将所述子请求分发至所述分布式系统中的相应处理单元进行处理;
子请求判断单元204,用于判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预设的时间阈值;
若是,则进入执行记录生成单元205;
所述执行记录生成单元205,用于生成所述子请求的执行记录;
执行记录汇总反馈单元206,用于汇总该子请求对应的业务请求关联的子请求的执行记录,生成该业务请求的执行记录返回给所述请求方。
可选的,所述执行记录生成单元205,具体包括:
子请求执行记录生成子单元,用于生成所述子请求的执行记录;
子请求异常日志记录子单元,用于将所述子请求的执行记录记录到所述子请求各自对应的异常日志中;
子请求摘要提取子单元,用于提取所述子请求的执行记录的摘要。
可选的,所述执行记录汇总反馈单元206,具体包括:
子请求摘要汇总子单元,用于汇总该子请求对应的业务请求的调用链路涉及的子请求的执行记录的摘要;
业务请求摘要生成子单元,用于生成该业务请求的执行记录的摘要;
业务请求摘要返回子单元,用于将该业务请求的执行记录的摘要返回给所述请求方。
可选的,所述调用链路包括:
所述分布式系统中、参与处理该业务请求关联子请求的所有服务器的顺序组合。
可选的,若所述子请求判断单元204的判断结果为否,进入下述单元:
子请求执行记录生成单元,用于生成所述子请求的执行记录;
子请求摘要提取单元,用于提取所述子请求的执行记录的摘要;
子请求摘要汇总单元,用于汇总所述子请求的执行记录的摘要;
业务请求摘要生成单元,用于生成该业务请求的执行记录的摘要;
业务请求摘要返回单元,用于将该业务请求的执行记录的摘要返回给所述请求方。
可选的,所述分布式系统中请求的处理装置,包括:
业务请求标识符生成单元,用于生成该业务请求唯一对应的标识符。
可选的,所述分布式系统中请求的处理装置,包括:
子请求标识符生成单元,用于生成所述子请求各自对应的标识符。
可选的,所述子请求分发单元203,具体包括:
子请求分发子单元,用于按照所述子请求在所述分布式系统中处理时参与数据操作的维度,分别将所述子请求发送至预先设置的、与所述子请求在所述分布式系统中处理时参与数据操作的维度对应的处理单元。
可选的,所述分布式系统中请求的处理装置,包括:
执行记录记录日志单元,用于将该业务请求的执行记录的摘要记录到该业务请求对应的日志中。
可选的,所述维度包括:
数据读取、数据写入、数据查询和数据删除。
可选的,该业务请求和所述子请求的关联,根据该业务请求的标识符和所述子请求的标识符之间的关联关系确定。
可选的,所述处理单元由所述分布式系统中的至少一台服务器组成。
可选的,所述执行记录中记录有下述至少一项信息:
标识符、参与处理的服务器的标识、处理时间、调用的函数名称、调用函数的时间和调用时产生的相关信息。
可选的,所述执行记录的摘要中记录有下述至少一项信息:
标识符、参与处理的服务器的标识、处理时间。
可选的,所述异常日志中记录有调用函数时产生的异常信息。
本申请虽然以较佳实施例公开如上,但其并不是用来限定本申请,任何本领域技术人员在不脱离本申请的精神和范围内,都可以做出可能的变动和修改,因此本申请的保护范围应当以本申请权利要求所界定的范围为准。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
1、计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
2、本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
Claims (22)
- 一种分布式系统中请求的处理方法,其特征在于,包括:接收请求方发起的业务请求;按照该业务请求在分布式系统中处理时参与数据操作的维度,将该业务请求拆分为至少一个与该业务请求相关联的子请求;将所述子请求分发至所述分布式系统中的相应处理单元进行处理;判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预设的时间阈值;若是,生成所述子请求的执行记录;汇总该子请求对应的业务请求关联的子请求的执行记录,生成该业务请求的执行记录返回给所述请求方。
- 根据权利要求1所述的分布式系统中请求的处理方法,其特征在于,所述生成所述子请求的执行记录,具体包括:生成所述子请求的执行记录;将所述子请求的执行记录记录到所述子请求各自对应的异常日志中;提取所述子请求的执行记录的摘要。
- 根据权利要求2所述的分布式系统中请求的处理方法,其特征在于,所述汇总该子请求对应的业务请求关联的子请求的执行记录,生成该业务请求的执行记录返回给所述请求方,具体包括:汇总该子请求对应的业务请求的调用链路涉及的子请求的执行记录的摘要;生成该业务请求的执行记录的摘要;将该业务请求的执行记录的摘要返回给所述请求方。
- 根据权利要求3所述的分布式系统中请求的处理方法,其特征在于,所述调用链路包括:所述分布式系统中、参与处理该业务请求关联子请求的所有服务器的顺序组合。
- 根据权利要求1所述的分布式系统中请求的处理方法,其特征在于,若所述判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预设的时间阈值步骤的判断结果为否,执行下述步骤:生成所述子请求的执行记录;提取所述子请求的执行记录的摘要;汇总所述子请求的执行记录的摘要;生成该业务请求的执行记录的摘要;将该业务请求的执行记录的摘要返回给所述请求方。
- 根据权利要求1所述的分布式系统中请求的处理方法,其特征在于,所述接收请求方发起的业务请求步骤执行之后,并在所述按照该业务请求在分布式系统中处理时参与数据操作的维度,将该业务请求拆分为至少一个与该业务请求相关联的子请求步骤执行之前,执行下述步骤:生成该业务请求唯一对应的标识符。
- 根据权利要求1所述的分布式系统中请求的处理方法,其特征在于,所述按照该业务请求在分布式系统中处理时参与数据操作的维度,将该业务请求拆分为至少一个与该业务请求相关联的子请求步骤执行之后,并在所述将所述子请求分发至所述分布式系统中的相应处理单元进行处理步骤执行之前,执行下述步骤:生成所述子请求各自对应的标识符。
- 根据权利要求1所述的分布式系统中请求的处理方法,其特征在于,所述将所述子请求分发至所述分布式系统中的相应处理单元进行处理,具体包括:按照所述子请求在所述分布式系统中处理时参与数据操作的维度,分别将所述子请求发送至预先设置的、与所述子请求在所述分布式系统中处理时参与数据操作的维度对应的处理单元。
- 根据权利要求3或5所述的分布式系统中请求的处理方法,其特征在于,所述生成该业务请求的执行记录的摘要子步骤执行之后,执行下述子步骤:将该业务请求的执行记录的摘要记录到该业务请求对应的日志中。
- 根据权利要求1所述的分布式系统中请求的处理方法,其特征在于,所述维度包括:数据读取、数据写入、数据查询和数据删除。
- 根据权利要求1所述的分布式系统中请求的处理方法,其特征在于,该业务请求和所述子请求的关联,根据该业务请求的标识符和所述子请求的标识符之间的关联关系确定。
- 根据权利要求1所述的分布式系统中请求的处理方法,其特征在于,所述处理单元由所述分布式系统中的至少一台服务器组成。
- 根据权利要求1所述的分布式系统中请求的处理方法,其特征在于,所述执行 记录中记录有下述至少一项信息:标识符、参与处理的服务器的标识、处理时间、调用的函数名称、调用函数的时间和调用时产生的相关信息。
- 根据权利要求2、3或5所述的分布式系统中请求的处理方法,其特征在于,所述执行记录的摘要中记录有下述至少一项信息:标识符、参与处理的服务器的标识、处理时间。
- 根据权利要求2所述的分布式系统中请求的处理方法,其特征在于,所述异常日志中记录有调用函数时产生的异常信息。
- 一种分布式系统中请求的处理装置,其特征在于,包括:业务请求接收单元,用于接收请求方发起的业务请求;业务请求拆分单元,用于按照该业务请求在分布式系统中处理时参与数据操作的维度,将该业务请求拆分为至少一个与该业务请求相关联的子请求;子请求分发单元,用于将所述子请求分发至所述分布式系统中的相应处理单元进行处理;子请求判断单元,用于判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预设的时间阈值;若是,则进入执行记录生成单元;所述执行记录生成单元,用于生成所述子请求的执行记录;执行记录汇总反馈单元,用于汇总该子请求对应的业务请求关联的子请求的执行记录,生成该业务请求的执行记录返回给所述请求方。
- 根据权利要求16所述的分布式系统中请求的处理装置,其特征在于,所述执行记录生成单元,具体包括:子请求执行记录生成子单元,用于生成所述子请求的执行记录;子请求异常日志记录子单元,用于将所述子请求的执行记录记录到所述子请求各自对应的异常日志中;子请求摘要提取子单元,用于提取所述子请求的执行记录的摘要。
- 根据权利要求17所述的分布式系统中请求的处理装置,其特征在于,所述执行记录汇总反馈单元,具体包括:子请求摘要汇总子单元,用于汇总该子请求对应的业务请求的调用链路涉及的子请求的执行记录的摘要;业务请求摘要生成子单元,用于生成该业务请求的执行记录的摘要;业务请求摘要返回子单元,用于将该业务请求的执行记录的摘要返回给所述请求方。
- 根据权利要求16所述的分布式系统中请求的处理装置,其特征在于,若所述子请求判断单元的判断结果为否,则进行下述单元:子请求执行记录生成单元,用于生成所述子请求的执行记录;子请求摘要提取单元,用于提取所述子请求的执行记录的摘要;子请求摘要汇总单元,用于汇总所述子请求的执行记录的摘要;业务请求摘要生成单元,用于生成该业务请求的执行记录的摘要;业务请求摘要返回单元,用于将该业务请求的执行记录的摘要返回给所述请求方。
- 根据权利要求16所述的分布式系统中请求的处理装置,其特征在于,包括:业务请求标识符生成单元,用于生成该业务请求唯一对应的标识符。
- 根据权利要求16所述的分布式系统中请求的处理装置,其特征在于,包括:子请求标识符生成单元,用于生成所述子请求各自对应的标识符。
- 根据权利要求16所述的分布式系统中请求的处理装置,其特征在于,所述子请求分发单元,具体包括:子请求分发子单元,用于按照所述子请求在所述分布式系统中处理时参与数据操作的维度,分别将所述子请求发送至预先设置的、与所述子请求在所述分布式系统中处理时参与数据操作的维度对应的处理单元。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510582405.5A CN106534242B (zh) | 2015-09-14 | 2015-09-14 | 一种分布式系统中请求的处理方法以及装置 |
| CN201510582405.5 | 2015-09-14 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2017045537A1 true WO2017045537A1 (zh) | 2017-03-23 |
Family
ID=58288636
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2016/097997 Ceased WO2017045537A1 (zh) | 2015-09-14 | 2016-09-05 | 一种分布式系统中请求的处理方法以及装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN106534242B (zh) |
| WO (1) | WO2017045537A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111143151A (zh) * | 2018-11-02 | 2020-05-12 | 菜鸟智能物流控股有限公司 | 业务监控方法、装置以及电子设备 |
Families Citing this family (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108737473B (zh) * | 2017-04-20 | 2019-12-20 | 贵州白山云科技股份有限公司 | 一种数据处理方法、装置及系统 |
| CN109218041B (zh) * | 2017-06-29 | 2022-03-11 | 北京京东尚科信息技术有限公司 | 用于服务器系统的请求处理方法和装置 |
| CN107977300A (zh) * | 2017-11-07 | 2018-05-01 | 山东中创软件商用中间件股份有限公司 | 一种请求追踪方法及装置 |
| CN108171488B (zh) * | 2017-11-28 | 2021-06-01 | 创新先进技术有限公司 | 数据处理方法、装置和系统 |
| CN110888780A (zh) * | 2019-11-19 | 2020-03-17 | 泰康保险集团股份有限公司 | 应用监控方法、装置、设备及存储介质 |
| CN111049916A (zh) * | 2019-12-18 | 2020-04-21 | 腾讯云计算(北京)有限责任公司 | 一种控制方法、装置、代理服务器及存储介质 |
| EP3961397B1 (en) * | 2020-08-24 | 2025-10-01 | Hitachi Energy Ltd | Remote procedure call between entities in a service bus communication system |
| CN117294757B (zh) * | 2023-11-27 | 2024-02-20 | 山东省计算中心(国家超级计算济南中心) | 基于区块链的复杂业务拆分执行方法、系统、设备及介质 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101997851A (zh) * | 2009-08-17 | 2011-03-30 | 中兴通讯股份有限公司 | 访问服务端的目录的方法、客户端、服务端及系统 |
| US20130085895A1 (en) * | 2011-09-30 | 2013-04-04 | Oracle International Corporation | High throughput global order promising system |
| CN103838632A (zh) * | 2012-11-21 | 2014-06-04 | 阿里巴巴集团控股有限公司 | 数据查询方法及装置 |
| CN104571957A (zh) * | 2014-12-29 | 2015-04-29 | 成都致云科技有限公司 | 一种数据读取方法及组装装置 |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| AU2007307684A1 (en) * | 2006-10-11 | 2008-04-17 | Quartex, Division Of Primex, Inc. | Traceable record generation system and method using wireless networks |
| CN103699340B (zh) * | 2013-12-16 | 2016-12-07 | 华为数字技术(苏州)有限公司 | 一种请求处理方法及设备 |
-
2015
- 2015-09-14 CN CN201510582405.5A patent/CN106534242B/zh active Active
-
2016
- 2016-09-05 WO PCT/CN2016/097997 patent/WO2017045537A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101997851A (zh) * | 2009-08-17 | 2011-03-30 | 中兴通讯股份有限公司 | 访问服务端的目录的方法、客户端、服务端及系统 |
| US20130085895A1 (en) * | 2011-09-30 | 2013-04-04 | Oracle International Corporation | High throughput global order promising system |
| CN103838632A (zh) * | 2012-11-21 | 2014-06-04 | 阿里巴巴集团控股有限公司 | 数据查询方法及装置 |
| CN104571957A (zh) * | 2014-12-29 | 2015-04-29 | 成都致云科技有限公司 | 一种数据读取方法及组装装置 |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111143151A (zh) * | 2018-11-02 | 2020-05-12 | 菜鸟智能物流控股有限公司 | 业务监控方法、装置以及电子设备 |
| CN111143151B (zh) * | 2018-11-02 | 2023-11-17 | 菜鸟智能物流控股有限公司 | 业务监控方法、装置以及电子设备 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN106534242B (zh) | 2019-11-29 |
| CN106534242A (zh) | 2017-03-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN106534242B (zh) | 一种分布式系统中请求的处理方法以及装置 | |
| TWI564732B (zh) | A method and apparatus for monitoring user requests to run in a decentralized system | |
| CN106202235B (zh) | 一种数据处理方法及装置 | |
| WO2020238066A1 (zh) | 一种软件的压力测试方法、装置、存储介质和服务器 | |
| US9684534B2 (en) | Monitoring and modifying allocated computing resources | |
| WO2016206567A1 (zh) | 分布式流计算系统、方法和装置 | |
| CN106155812A (zh) | 一种对虚拟主机的资源管理的方法、装置、系统及电子设备 | |
| CN104144142A (zh) | 一种Web漏洞挖掘方法及系统 | |
| CN111177193A (zh) | 一种基于Flink的日志流式处理方法及系统 | |
| US11171846B1 (en) | Log throttling | |
| CN108259207B (zh) | 流量统计方法、客户端、服务器及系统 | |
| CN108966041B (zh) | 一种音视频播放埋点方法、装置、设备、计算机可读存储介质 | |
| CN115580607A (zh) | 彩票系统链路监控方法、装置及系统 | |
| CN106649000B (zh) | 实时处理引擎的故障恢复方法及相应的服务器 | |
| CN102339305B (zh) | 基于偏序关系日志的数据库集群故障恢复方法 | |
| CN112395591A (zh) | 改密方法及系统 | |
| CN116107781A (zh) | 日志追踪方法、装置、电子设备、及计算机程序产品 | |
| CN105095310B (zh) | 数据处理方法、第一服务器、第二服务器和数据处理系统 | |
| CN109389271B (zh) | 应用性能管理方法及系统 | |
| CN108959497A (zh) | 分布式文件系统日志处理方法、装置、设备及存储介质 | |
| CN112783754B (zh) | 一种对页面进行测试的方法和装置 | |
| US9633061B2 (en) | Methods for determining event counts based on time-sampled data | |
| Zhou et al. | A runtime verification based trace-oriented monitoring framework for cloud systems | |
| CN106161066A (zh) | 一种日志采集方法及服务器 | |
| CN117724931A (zh) | 请求的处理方法及装置、存储介质和电子设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16845651 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 16845651 Country of ref document: EP Kind code of ref document: A1 |