Service platform operation method, service platform and storage medium

By determining the target address based on the response time of each server address in the server cluster and processing service requests, the problem of uneven server pressure in the prior art is solved, and the timeliness of service platform for service requests is improved.

CN116095178BActive Publication Date: 2025-04-25GUANGDONG LEHUA HOME FURNISHING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211685225.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-27
Publication Date
2025-04-25
Estimated Expiration
2042-12-27

AI Technical Summary

Technical Problem

In a distributed system server cluster, the existing distribution server processing requests can easily lead to excessive pressure on servers with poor performance, while servers with good performance have redundant processing capabilities, resulting in the service platform being unable to respond to service requests in a timely manner.

Method used

When receiving a service request, the target address is determined based on the response time when each server address in the server cluster is accessed, and the corresponding server is called to process the service request. This method does not need to poll individual servers, relieves server pressure, and selects the server to process service requests based on the response time.

Benefits of technology

It effectively avoids excessive pressure on poor performance servers, and at the same time makes full use of servers with better performance to handle service requests, improving the timeliness of service request processing by the service platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116095178B_ABST
    Figure CN116095178B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for operating a service platform, a service platform and a storage medium. The method comprises: receiving a service request; determining a target address according to the response time when each server address among multiple server addresses corresponding to a server cluster is accessed; and calling a corresponding server in the server cluster according to the target address to process the service request. The present invention aims to improve the timeliness of the service platform in processing service requests.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an operation method of a service platform, a service platform and a storage medium. Background Art

[0002] In complex distributed systems, server clusters are often set up, and when a service request is received, one of the servers is assigned to respond to the request.

[0003] Among them, in the current process of allocating servers to handle requests, some methods poll each server in the cluster in a preset order to find a responsive server to handle the service request; some methods identify the server with fewer connected terminals in the cluster and assign the request to that server for processing. However, the configuration performance of different servers in the cluster varies. This allocation method easily causes a high pressure on servers with poor performance, and redundant processing capacity on servers with good performance, resulting in the problem that the service platform cannot respond to service requests in a timely manner. Summary of the invention

[0004] The main purpose of the present invention is to provide an operation method of a service platform, a service platform and a storage medium, aiming to improve the timeliness of the service platform in processing service requests.

[0005] To achieve the above object, the present invention provides a method for operating a service platform, and the method for operating the service platform comprises the following steps:

[0006] Receive service requests;

[0007] Determine the target address according to the response time when each server address among the multiple server addresses corresponding to the server cluster is accessed;

[0008] The corresponding server in the server cluster is called according to the target address to process the service request.

[0009] Optionally, the step of determining the target address according to the response time when each server address among the multiple server addresses corresponding to the server cluster is accessed includes:

[0010] Among the multiple server addresses, determine the server address corresponding to the minimum value of all the response times as the target address.

[0011] Optionally, before the step of receiving the service request, the step further includes:

[0012] Obtaining a service list, wherein the service list includes the multiple server addresses;

[0013] Sending access requests to each of the server addresses respectively, and receiving corresponding return information;

[0014] The time difference between the reception time of each of the returned information and the sending time of the corresponding access request is determined to obtain the response time corresponding to each of the server addresses.

[0015] Optionally, after the step of determining the time difference between the reception time of each of the returned information and the sending time of the corresponding access request, and obtaining the response time corresponding to each of the server addresses, the step further includes:

[0016] When the minimum value of all the response times is greater than a preset time threshold, a prompt message is output, where the prompt message is used to prompt the server to improve its performance.

[0017] Optionally, after the step of sending the access request to each of the server addresses respectively, the method further includes:

[0018] When the corresponding return information is not received, fault prompt information is output according to the corresponding server address.

[0019] Optionally, the step of calling a corresponding server in the server cluster to process the service request according to the target address includes:

[0020] Encapsulating the target address into the service request;

[0021] The service request is sent to the service interface of the server cluster to call the server corresponding to the target address to process the service request.

[0022] Optionally, the service request is used to request device data parsing and conversion.

[0023] Optionally, the service platform includes a configuration module and a gateway module, and the operation method of the service platform includes the following steps:

[0024] Receiving the service request through the gateway module;

[0025] Determine the target address by the configuration module according to the response time when each server address among the multiple server addresses corresponding to the server cluster is accessed;

[0026] The gateway module calls a corresponding server in the server cluster according to the target address to process the service request.

[0027] In addition, in order to achieve the above-mentioned purpose, the present application also proposes a service platform, which includes: a memory, a processor, and an operating program of the service platform stored in the memory and executable on the processor, and when the operating program of the service platform is executed by the processor, the steps of the operating method of the service platform as described in any of the above items are implemented.

[0028] In addition, in order to achieve the above-mentioned purpose, the present application also proposes a storage medium, on which an operating program of a service platform is stored. When the operating program of the service platform is executed by a processor, the steps of the operating method of the service platform as described in any of the above items are implemented.

[0029] The present invention proposes an operation method of a service platform. When receiving a service request, the method determines a target address according to the response time when each server address among multiple server addresses corresponding to a server cluster is accessed, and calls the corresponding server to process the service request according to the target address. In this process, there is no need to poll each server, which can effectively reduce the pressure on each server. The allocated server depends on its response time rather than the number of connected terminals. The response time can accurately reflect the processing performance of the corresponding server. Therefore, selecting a server to process the service request based on the response time is beneficial to avoiding excessive pressure on servers with poor performance, and is also beneficial to using servers with good performance to process service requests, which is beneficial for the service platform to quickly provide the required services to the client, thereby improving the timeliness of the service platform's processing of service requests. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A schematic diagram of the hardware structure involved in the operation of an embodiment of the service platform of the present invention;

[0031] Figure 2 This is a flow chart of an embodiment of an operation method of a service platform of the present invention;

[0032] Figure 3 A flow chart of another embodiment of the method for operating the service platform of the present invention;

[0033] Figure 4 A flow chart of another embodiment of the method for operating the service platform of the present invention;

[0034] Figure 5 The flowchart of another embodiment of the method for operating the service platform of the present invention is shown in FIG.

[0035] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0036] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0037] The embodiment of the present invention provides a service platform, which is a system for providing corresponding data services according to the requirements of a client.

[0038] In the embodiment of the present invention, refer to Figure 1The service platform includes a server cluster 2 and an operation device 1, and the operation device 1 is in communication with the server cluster 2. The operation device 1 is specifically used to receive a service request and distribute the service request to a corresponding server in the server cluster 2 for processing.

[0039] The server cluster 2 includes at least two servers, and both servers can be used to process service requests received by the service platform.

[0040] In this embodiment, different servers in the server cluster 2 are distributed in different regions. In other embodiments, different servers in the server cluster 2 may also be located in the same region.

[0041] In the embodiment of the present invention, refer to Figure 1 The operation device 1 of the service platform includes: a processor 1001 (such as a CPU), a memory 1002, a timer 1003, etc. The various components in the control device are connected via a communication bus. The memory 1002 can be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1002 can also be a storage device independent of the aforementioned processor 1001.

[0042] The operating device 1 may be provided with a gateway module 1004 and a configuration module 1005. The gateway module 1004 and the configuration module 1005 may be virtual modules in the system operated by the service platform, or the network module and / or the configuration module 1005 may be physical devices and may be distributed in different spaces.

[0043] The gateway module 1004 is specifically used to realize the network interconnection between the service platform and the client. The configuration module 1005 is specifically used to configure the information required in the server allocation process, such as server address information, the correlation relationship between server address and response time, etc.

[0044] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation of the device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0045] like Figure 1 As shown, the memory 1002 as a storage medium may include the operating program of the service platform. Figure 1 In the device shown, the processor 1001 can be used to call the operating program of the service platform stored in the memory 1002, and execute the relevant steps of the operating method of the service platform in the following embodiments.

[0046] The embodiment of the present invention also provides a method for operating a service platform, which is applied to the above service platform.

[0047] Reference Figure 2 , an embodiment of the operation method of the service platform of the present application is proposed. In this embodiment, the operation method of the service platform includes:

[0048] Step S10, receiving a service request;

[0049] The service request is specifically an instruction issued by a client connected to the service platform to request the server to provide it with a target data service.

[0050] In this embodiment, the service request is used to request device data analysis and conversion, that is, the client sends a service request to the service platform so that the service platform analyzes and converts its data according to its needs.

[0051] Step S20, determining the target address according to the response time when each server address among the multiple server addresses corresponding to the server cluster is accessed;

[0052] A server cluster is specifically a collection of servers used to provide target data services required by a client for a service request.

[0053] The multiple server addresses are a collection of access addresses corresponding to all servers in the server cluster.

[0054] The response time here may specifically be a parameter obtained by testing each server before the current moment. Alternatively, the hardware configuration information of each server may be obtained at the current moment, and the response time here may be determined according to the performance represented by the hardware configuration information.

[0055] Each server address corresponds to an access time, and one of the multiple server addresses can be determined as the target address according to the multiple access times.

[0056] Among them, the association relationship between different server addresses and corresponding response times can be established in advance. Based on this, the server address corresponding to the response time that meets the preset screening conditions in the association relationship can be used as the target address. Specifically, the size relationship between each response time can be determined, and the target time among multiple response times can be determined based on the size relationship, and the server address associated with the target time can be used as the target address. Alternatively, the difference between each response time and the set response time can be determined, and the target time among multiple response times can be determined based on the size relationship between each difference, and the server address associated with the target time can be used as the target address.

[0057] Step S30: calling a corresponding server in the server cluster to process the service request according to the target address.

[0058] Specifically, when the server corresponding to the target address is called, it provides the target data service corresponding to the service request to the client that sends the service request.

[0059] An embodiment of the present invention proposes an operation method of a service platform. When receiving a service request, the method determines a target address according to the response time when each server address among multiple server addresses corresponding to a server cluster is accessed, and calls the corresponding server to process the service request according to the target address. In this process, there is no need to poll each server, which can effectively reduce the pressure on each server. In addition, the allocated server depends on its response time rather than the number of connected terminals. The response time can accurately reflect the processing performance of the corresponding server. Therefore, selecting a server to process the service request based on the response time is beneficial to avoiding excessive pressure on servers with poor performance, and is also beneficial to using servers with good performance to process service requests, which is beneficial for the service platform to quickly provide the required services to the client, thereby improving the timeliness of the service platform's processing of service requests.

[0060] Further, based on the above embodiment, another embodiment of the operation method of the service platform of the present application is proposed. Figure 3 , step S20 comprises:

[0061] Step S21, among the multiple server addresses, determine the server address corresponding to the minimum value of all the response times as the target address.

[0062] Specifically, any two response times among all the response times may be compared, the minimum value here may be determined according to the comparison result, and the server address associated with the minimum value may be used as the target address.

[0063] In this embodiment, through the above method, the server with the fastest response can provide the target data service corresponding to the service request to the client, which is conducive to improving the server's response speed to the service request, so as to further improve the timeliness of the service platform's processing of the service request.

[0064] In other embodiments, a set of all server addresses whose response time is less than a preset response time may be determined from multiple server addresses, and one of them may be randomly selected from the set or selected according to preset parameters (for example, the region information of the server corresponding to each server address in the set or the type of service provided by the server corresponding to each server address in the set, etc.) as the target address.

[0065] In other embodiments, the server address corresponding to the response time with the smallest time difference with the set response time corresponding to the service request can also be determined as the target address among multiple server addresses. Different service requests correspond to different set response times. Based on this, it is beneficial to accurately match the response efficiency of the server with the service request, improve the timeliness of service request processing, and ensure the effective use of the performance of each server in the server cluster.

[0066] Further, based on any of the above embodiments, another embodiment of the operation method of the service platform of this application is proposed. Figure 4 , before step S10, it also includes:

[0067] Step S01, obtaining a service list, wherein the service list includes the multiple server addresses;

[0068] Specifically, the service list can be obtained by reading configuration parameters of the server cluster pre-stored in the system.

[0069] Step S02, sending access requests to each of the server addresses respectively, and receiving corresponding return information;

[0070] The return information is information that the server corresponding to the server address feeds back and returns based on the received return request after receiving the access request.

[0071] Step S03: determine the time difference between the reception time of each of the returned information and the sending time of the corresponding access request, and obtain the response time corresponding to each of the server addresses.

[0072] Specifically, the calculation result obtained by subtracting the sending time from the receiving time is used as the time difference here.

[0073] The server address and its corresponding response time can be stored in the cache space in the form of a key-value pair. Based on this, during the execution of step S20, the response time corresponding to each server address can be determined based on the multiple key-value pairs stored in the cache space.

[0074] After step S03, the process may return to step S01 after a preset time interval. During the process of cyclic execution of steps S01 to S03, step S10 is executed.

[0075] In this embodiment, access testing is performed in the above manner to obtain the accurate access time when each server is accessed, ensuring that after the service request is subsequently received, the service request can be accurately allocated to the corresponding server based on the correspondence between the access time and the server address, so as to further improve the timeliness of the service platform in processing service requests.

[0076] Further, based on the above embodiment, another embodiment of the operation method of the service platform of this application is proposed. Figure 5 , after step S03, further comprising:

[0077] Step S04: when the minimum value of all the response times is greater than a preset time threshold, output a prompt message, wherein the prompt message is used to prompt to improve the performance of the server.

[0078] The prompt information may be output by a prompt device in the service platform that is independent of the server cluster, may be output by a prompt device in the server cluster, or may be output by each server in each server cluster.

[0079] The prompt information can be output in the form of text, image, sound or light.

[0080] The prompt information may prompt to improve the performance of all servers in the server cluster. Alternatively, the server corresponding to the response time greater than the set time threshold (the set time threshold is greater than the preset time threshold) among all the response times may be determined as the target server, and the prompt information may prompt to improve the performance of the target server.

[0081] In this embodiment, the response time detection of each server can not only be applied to server allocation to effectively improve the response speed of the service platform to service requests, but also serve as a basis for server performance bottlenecks. If the minimum response time of the server cluster is too large, a prompt message is output to ensure that the performance of the servers in the server cluster can effectively guarantee the satisfaction of service needs, which is conducive to further improving the timeliness of the service platform's processing of server requests.

[0082] Further, based on the above embodiment, another embodiment of the operation method of the service platform of the present application is proposed. In this embodiment, after the step of sending access requests to each of the server addresses respectively, it also includes: when the corresponding return information is not received, outputting fault prompt information according to the corresponding server address.

[0083] Specifically, an access request is sent to a first server address among multiple server addresses, but no return information is detected within a preset time period, and it can be determined that no return information is received. Based on this, fault prompt information is output according to the first server address.

[0084] When no response information is received after an access request is sent, the server is considered to be down.

[0085] Fault prompt information can be output in the form of text, image, sound or light.

[0086] The fault prompt information may be output by the server corresponding to the first server address, or may be output by a prompt device independent of the server cluster.

[0087] Specifically, the fault prompt information may be sent to the first server address so that the server corresponding to the first server address outputs the fault prompt information. Alternatively, the fault prompt information including the first server address may be generated and a prompt device independent of the server cluster may be controlled to output the fault prompt information.

[0088] In this embodiment, through the above method, in addition to realizing the response time detection of each server for server allocation, self-checking can also be realized for each server in the server cluster, thereby effectively improving the response speed of the service platform to service requests while ensuring the normal operation of each server.

[0089] Further, based on the above embodiment, another embodiment of the operation method of the service platform of the present application is proposed. Step S30 includes: encapsulating the target address into the service request; sending the service request to the service interface of the server cluster to call the server corresponding to the target address to process the service request.

[0090] The service interface is specifically a unified data interface for all servers in the server cluster.

[0091] In this embodiment, the target address is encapsulated into a service request and sent to the service interface of the server cluster to call the corresponding server to process the service request, which is beneficial to improve the accuracy of the server being called to provide the server, thereby ensuring that the client's needs are accurately met.

[0092] Further, based on any of the above embodiments, another embodiment of the operation method of the service platform of the present application is proposed. In this embodiment, the service platform includes a configuration module and a gateway module, and the operation method of the service platform includes the following steps:

[0093] Receiving the service request through the gateway module;

[0094] Determine, by the configuration module, a target address among a plurality of server addresses corresponding to the server cluster according to a response time when each server in the server cluster is accessed;

[0095] The gateway module calls the corresponding server according to the target address to process the service request.

[0096] Specifically, the association between different server addresses and response times (such as the multiple key-value pairs mentioned above) can be saved in the cache space. After receiving the service request, the gateway module sends a query instruction of the above target address to the configuration module. The configuration module sends the query instruction to the cache space so that the cache space determines the target address based on the stored association relationship. The configuration module sends the received target address to the gateway module. After receiving the target address, the gateway module encapsulates it into the service request and sends it to the service interface of the server cluster.

[0097] In this embodiment, through the cooperation of the gateway module and the configuration module, the service platform can realize accurate allocation of servers for processing service requests, which is beneficial to further improve the timeliness of the service platform in processing service area requests.

[0098] In addition, an embodiment of the present invention further proposes a storage medium on which an operating program of a service platform is stored. When the operating program of the service platform is executed by a processor, the relevant steps of any embodiment of the operating method of the service platform as described above are implemented.

[0099] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0100] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0101] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, service platform, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0102] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for operating a service platform, characterized in that: The operation method of the service platform comprises the following steps: Receive service requests; Determine the target address according to the response time when each of the multiple server addresses corresponding to the server cluster is accessed, the step of determining the target address according to the response time when each of the multiple server addresses corresponding to the server cluster is accessed comprises: determining the server address corresponding to the response time with the smallest time difference with the set response time corresponding to the service request from the multiple server addresses as the target address, and different service requests correspond to different set response times; Calling a corresponding server in the server cluster to process the service request according to the target address; The method further comprises: Obtaining a service list, wherein the service list includes the multiple server addresses; Sending access requests to each of the server addresses respectively, and receiving corresponding return information; Determine the time difference between the reception time of each of the returned information and the sending time of the corresponding access request, and obtain the response time corresponding to each of the server addresses; The step of obtaining the service list is returned to be executed at a preset time interval, and the step of receiving the service request is executed during the process of obtaining the service list, sending the access request, receiving the return information, and obtaining the response time.

2. The method for operating the service platform according to claim 1, characterized in that: After the step of determining the time difference between the reception time of each of the returned information and the sending time of the corresponding access request, and obtaining the response time corresponding to each of the server addresses, the method further includes: When the minimum value of all the response times is greater than a preset time threshold, a prompt message is output, where the prompt message is used to prompt the server to improve its performance.

3. The method for operating the service platform according to claim 1, characterized in that: After the step of sending the access request to each of the server addresses respectively, the method further includes: When the corresponding return information is not received, fault prompt information is output according to the corresponding server address.

4. The method for operating the service platform according to claim 1, characterized in that: The step of calling the corresponding server in the server cluster to process the service request according to the target address includes: Encapsulating the target address into the service request; The service request is sent to the service interface of the server cluster to call the server corresponding to the target address to process the service request.

5. The method for operating the service platform according to claim 1, characterized in that: The service request is used to request device data parsing and conversion.

6. The method for operating the service platform according to any one of claims 1 to 5, characterized in that: The service platform includes a configuration module and a gateway module, and the operation method of the service platform includes the following steps: Receiving the service request through the gateway module; Determine the target address by the configuration module according to the response time when each server address among the multiple server addresses corresponding to the server cluster is accessed; The gateway module calls a corresponding server in the server cluster according to the target address to process the service request.

7. A service platform, characterized in that: The service platform includes: a memory, a processor, and an operating program of the service platform stored in the memory and executable on the processor. When the operating program of the service platform is executed by the processor, the steps of the operating method of the service platform as described in any one of claims 1 to 6 are implemented.

8. A storage medium, characterized in that: The storage medium stores an operating program of the service platform, and when the operating program of the service platform is executed by the processor, the steps of the operating method of the service platform as described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Cluster scheduling method and device

    CN109766189A

  • Server scheduling method and device

    CN112749009A