A request scheduling, processing method and device

Through intelligent routing and scheduling and dynamically updating configuration information, the time and risk problems caused by frequent online requests for enterprise information systems are solved, and efficient and safe configuration information updates are achieved.

CN112925636BActive Publication Date: 2024-10-18BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201911242125.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-12-06
Publication Date
2024-10-18
Estimated Expiration
2039-12-06

AI Technical Summary

Technical Problem

Enterprise information systems have frequent online requests, resulting in labor-intensive operations and a waste of time. There are also risks of misoperation and miswriting, resulting in higher risks.

Method used

By receiving configuration information requests from the application side, we build a distribution matrix, optimize the request distribution based on the server's processing time, and use the weight value of the configuration number and the whitelist to optimize the request queue, realize intelligent routing scheduling, and dynamically update configuration information.

Benefits of technology

It reduces the time and labor costs of the online process, reduces the risk of misoperation, improves the timely update and feedback efficiency of configuration information, and avoids delays in the release of important information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112925636B_ABST
    Figure CN112925636B_ABST
Patent Text Reader

Abstract

The present invention discloses a request scheduling, processing method and device, and relates to the field of computer technology. A specific implementation of the method includes: receiving a request for obtaining configuration information transmitted by an application end, and constructing a distribution matrix for the requests according to the number of requests and the number of servers; obtaining the first number of requests currently to be processed by each server and the processing time for a single request, and calculating the processing time for processing the request in each allocation method in combination with the number of requests; allocating the request to the corresponding server according to the allocation method with the shortest processing time, and then transmitting the configuration information received from the corresponding server to the application end. This implementation method can realize the rapid processing of requests and the efficient use of all servers through the request diversion of the intelligent routing module on the server end; assigning high priority to high-weighted configuration numbers to ensure that requests with higher priority can be processed first, so as to avoid affecting the release of important information when the request volume is large.
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 a request scheduling and processing method and device. Background Art

[0002] All enterprises rely on information systems. The update and upgrade of information systems is the most basic core business on a daily basis. It mainly includes the client and application sides. The application side is the service basis of the client to execute requests based on user needs.

[0003] The present invention is mainly aimed at the online modification of light logic, and light logic mainly involves the modification of configuration information, and does not involve or rarely involves the modification of code. In the process of implementing the present invention, the inventor found that the prior art has at least the following problems:

[0004] Requests for online release of enterprise information are relatively frequent, and each change requires the completion of the online process. The entire operation consumes a lot of manpower, wastes online and testing time, and considers that misoperation and miswriting will bring certain risks to the online release. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a request scheduling and processing method and device, which can at least solve the problem that the prior art is difficult to modify the application-side configuration information, is time-consuming, labor-intensive, and has high risks.

[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for requesting scheduling is provided, including:

[0007] Receive a request for obtaining configuration information transmitted by an application end, and construct a distribution matrix for the request according to the number of the request and the number of servers; wherein the distribution matrix is ​​composed of multiple distribution modes;

[0008] Obtaining a first number of requests currently to be processed by each server and a processing time for a single request, and calculating a processing time for processing the request in each allocation mode in combination with the number of requests;

[0009] The request is allocated to the corresponding server in accordance with the allocation method with the shortest processing time, and then the configuration information received from the corresponding server is transmitted to the application end.

[0010] Optionally, after the request for obtaining configuration information transmitted by the receiving application, it also includes: obtaining the configuration number in the request, determining the arrangement position of the request in the queue of requests to be allocated based on the weight value of the configuration number, and then extracting the requests whose arrangement positions are before the predetermined arrangement position for allocation processing.

[0011] Optionally, determining the arrangement position of the request in the queue of requests to be allocated further includes: if the configuration number is in a predetermined whitelist, arranging the request at the head position of the queue in the queue of requests to be allocated.

[0012] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for request processing is provided, comprising:

[0013] The server obtains a record number according to the configuration number; wherein the record number records the current version number of the configuration information, and the configuration information is stored in the server;

[0014] Determine whether the record number is the same as the latest record number in the request. If they are the same, then feed back a no-change flag to the application end; otherwise, feed back the configuration information to the application end.

[0015] Optionally, before the server acquires the record number according to the configuration number, the method further includes:

[0016] Using an information digest algorithm, the configuration number and the application number in the request are processed to obtain a token; wherein the application number is the number of the application program running on the communication entity;

[0017] If the token is consistent with the token in the request, the request is determined to be an authenticated request.

[0018] To achieve the above object, according to one aspect of an embodiment of the present invention, another request processing method is provided, including:

[0019] The application receives the configuration information fed back by the server to update the configuration information corresponding to the configuration number in the local memory; and

[0020] A request for obtaining configuration information transmitted by a client is received, configuration information is extracted from a local memory according to a configuration number in the request, and then the extracted configuration information is transmitted to the client.

[0021] Optionally, also include:

[0022] Transmitting the request for obtaining configuration information to the server according to a predetermined period; and / or

[0023] If the configuration information does not exist in the local memory, the request for obtaining the configuration information is transmitted to the server.

[0024] To achieve the above object, according to another aspect of an embodiment of the present invention, a request scheduling device is provided, comprising:

[0025] A request receiving module, used for receiving a request for obtaining configuration information transmitted by an application end, and constructing a distribution matrix for the request according to the number of the request and the number of servers; wherein the distribution matrix is ​​composed of a plurality of distribution modes;

[0026] A duration calculation module, used to obtain a first number of requests to be processed by each server and a processing time for a single request, and calculate a processing time for processing the request in each allocation mode in combination with the number of requests;

[0027] The request allocation module is used to allocate the request to the corresponding server in an allocation method with the shortest processing time, and then transmit the configuration information received from the corresponding server to the application end.

[0028] Optionally, the request receiving module is further used to: obtain the configuration number in the request, determine the arrangement position of the request in the request queue to be allocated according to the weight value of the configuration number, and then extract the requests whose arrangement positions are before the predetermined arrangement position for allocation processing.

[0029] Optionally, the request receiving module is further used to: if the configuration number is in a predetermined whitelist, arrange the request at the head of the queue of requests to be allocated.

[0030] To achieve the above object, according to another aspect of an embodiment of the present invention, a request processing device is provided, comprising:

[0031] A number acquisition module, used for the server to acquire a record number according to the configuration number; wherein the record number records the current version number of the configuration information, and the configuration information is stored in the server;

[0032] The number determination module is used to determine whether the record number is the same as the latest record number in the request. If they are the same, a flag indicating that no change is required is fed back to the application end; otherwise, the configuration information is fed back to the application end.

[0033] Optionally, a request authentication module is also included, which is used to:

[0034] Using an information digest algorithm, the configuration number and the application number in the request are processed to obtain a token; wherein the application number is the number of the application program running on the communication entity;

[0035] If the token is consistent with the token in the request, the request is determined to be an authenticated request.

[0036] To achieve the above object, according to another aspect of an embodiment of the present invention, another request processing device is provided, including:

[0037] An information updating module, used for the application end to receive the configuration information fed back by the server end, so as to update the configuration information corresponding to the configuration number in the local memory;

[0038] The information extraction module is used to receive a request for obtaining configuration information transmitted by a client, extract the configuration information from the local memory according to the configuration number in the request, and then transmit the extracted configuration information to the client.

[0039] Optionally, a request sending module is also included, which is used to:

[0040] Transmitting the request for obtaining configuration information to the server according to a predetermined period; and / or

[0041] If the configuration information does not exist in the local memory, the request for obtaining the configuration information is transmitted to the server.

[0042] To achieve the above objective, according to another aspect of an embodiment of the present invention, a request scheduling and processing electronic device is provided.

[0043] The electronic device of an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement any of the request scheduling and processing methods described above.

[0044] To achieve the above objectives, according to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, any of the request scheduling and processing methods described above is implemented.

[0045] According to the scheme provided by the present invention, one embodiment of the above invention has the following advantages or beneficial effects: when a user requests configuration information at the user end, it can be obtained from the local memory of the application end in priority. At this time, if the configuration information in the server end changes, the application end updates the configuration information in the application end memory based on its periodic acquisition or the server end periodically sends instructions to the application end, thereby dynamically realizing the update operation of the online configuration and achieving the function of dynamically updating data.

[0046] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0048] Figure 1 This is a schematic diagram of the main flow of a request scheduling method according to an embodiment of the present invention;

[0049] Figure 2 is a flowchart of a request processing method according to an embodiment of the present invention;

[0050] Figure 3 is a flowchart of another request processing method according to an embodiment of the present invention;

[0051] Figure 4 is a framework diagram of a specific request scheduling and processing according to an embodiment of the present invention;

[0052] Figure 5 is a schematic diagram of main modules of a request scheduling device according to an embodiment of the present invention;

[0053] Figure 6 is a schematic diagram of main modules of a request processing device according to an embodiment of the present invention;

[0054] Figure 7 is a schematic diagram of main modules of another request processing device according to an embodiment of the present invention;

[0055] Figure 8 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0056] Fig. 9 It is a schematic diagram of the structure of a computer system of a mobile device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0057] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0058] See also Figure 1 , which shows a main flow chart of a request scheduling method provided by an embodiment of the present invention, comprising the following steps:

[0059] S101: receiving a request for obtaining configuration information transmitted by an application, and constructing a distribution matrix for the request according to the number of the request and the number of servers; wherein the distribution matrix is ​​composed of multiple distribution modes;

[0060] S102: Obtain a first number of requests to be processed by each server and a processing time for a single request, and calculate a processing time for processing the request in each allocation mode in combination with the number of requests;

[0061] S103: Allocate the request to a corresponding server in accordance with an allocation method that minimizes processing time, and then transmit the configuration information received from the corresponding server to the application end.

[0062] For enterprise information systems, the number of requests can reach tens of thousands or hundreds of thousands. It is usually necessary to use a distributed server system to intelligently schedule requests, such as allocating requests to the server with the fastest current response speed, so as to improve request processing efficiency.

[0063] In the above implementation, for step S101, the server receives the request transmitted by the application. In order to avoid the situation where the transmission between the server and the application is too frequent and the transmission channel is over-occupied due to immediate processing of the request, the present invention adopts periodic sending. For example, the application sends all requests received from the client within 10s to the server at one time.

[0064] There are multiple servers set up in the server side, and requests are presented in the form of queues in each server. If there are 3 servers, the request queues to be processed by each server are obtained according to the server identification as follows:

[0065] Table 1 Server request queue

[0066]

[0067] Furthermore, the server may receive multiple requests at the same time. To ensure that important configuration information is updated in a timely manner on the application side and fed back to the client in a timely manner (see the following Figure 3 Description), intelligent routing scheduling can be performed in advance according to the configuration number (the number of the configuration file / information) and service dynamic settings to ensure that requests for important configuration numbers can be processed first.

[0068] Taking the configuration number as an example, the priority level setting is performed, for example, configuration number 1> configuration number 2> configuration number 3. For the request with configuration number 1, it can be directly placed at the head of the request queue, and the head request can be directly extracted for priority processing later. The priority level setting can also be performed according to the weight value of the configuration number, such as 0.5, 0.8.

[0069] Furthermore, for requests with configuration number 1, they can be sorted according to the time they are received. For example, if request 1 at 8:00 is after request 2 at 7:50, request 2 at 7:50 will be processed first.

[0070] In actual operation, requests are mainly sorted according to the configuration number priority set above. However, for some special cases, such as ordinary configuration numbers that are urgently online (i.e. configuration numbers with lower priority), they can be temporarily set as key update configuration numbers to accelerate the update of configuration information.

[0071] A whitelist can be created by developers in the priority settings of the server. When there are no special circumstances, the information in the whitelist can be empty, but for special circumstances, the whitelist stores the configuration number added by the developer.

[0072] Therefore, on the basis of the above-mentioned request sorting by configuration number priority, adjustments can also be made through the whitelist to arrange the requests with configuration numbers in the whitelist to the head of the queue for priority processing.

[0073] For steps S102 and S103, the requests sent from the application to the server are usually sent in batches, and the next batch of requests is usually processed only after the previous batch is processed. Therefore, one factor considered by the present invention for request scheduling is the duration of request processing, and the allocation method is determined by minimizing the duration.

[0074] Set the average processing time for a single request in a single server to: duration 服务器i ; where i represents the i-th server. The average processing time can be determined by analyzing the amount of tasks processed by server i within a predetermined historical time. For example, if 10 requests are processed within 5 minutes, the average processing time for each request is 30 seconds.

[0075] Taking Table 1 as an example, we can obtain the average processing time of each server for a single request:

[0076] Table 2 Average request processing time

[0077]

[0078] For the convenience of expression, all the parameters involved above, such as all requests received and server parameters, are expressed in the following table:

[0079] Parameters involved in Table 3

[0080]

[0081]

[0082] The present invention innovatively defines a single objective optimization function that minimizes the overall processing time:

[0083] Minimize:

[0084] Among them, task ij ∈[0,1], when task ij=1, it means that request j is assigned to server i. At this time, the number of requests waiting to be processed in server i = the sum of the number of requests in the original request queue (i.e., the first number) and the number of requests to be processed this time (1). ij =0, the opposite is true.

[0085] Suppose there are two requests, request 1 and request 2, and the optimal solution is to assign these two requests to server 1. The optimal solution expressed by mathematical expression is: task 11 =1 (request 1 is assigned to server 1), task 12 =1 (request 2 is assigned to server 1), and the rest of the values ​​are 0, such as task 21 =0, indicating that request 1 is not assigned to server 2.

[0086] Also taking the above two requests and three servers as an example, there are 3*3=9 ways to allocate these two requests to the servers; among these 9 ways, the requests may be allocated to the same server at the same time, or may be allocated to different servers.

[0087] The total processing time required for processing all requests in each allocation method is calculated based on the above formula. For example, request 1 is allocated to server 1 and request 2 is allocated to server 2:

[0088] 1) For server 1: task 11 =1, server 1 processes the request queue 服务器1 The processing time of request 1 is duration 服务器1 *(|Request Queue 服务器1 |+1)=30*(10+1)=330ms;

[0089] 2) For Server 2: task 22 =1, server 2 processes the request queue 服务器2 The processing time of request 2 is duration 服务器2 *(|Request Queue 服务器2 |+1)=33*(15+1)=528ms;

[0090] 3) For server 3: Processing request queue 服务器3 The processing time is duration 服务器3 *|Request Queue 服务器3 |=36*12=432ms;

[0091] 4) It can be obtained that the total time consumed to complete the processing of all requests is: 330+528+432=1290ms.

[0092] Repeat the above process to obtain the total time consumed by each allocation method to process all requests. Then, the allocation method with the smallest total time is used as the allocation method for this batch of requests, for example, request 1 is allocated to server 1 and request 2 is allocated to server 2.

[0093] The above formula can ensure that the overall server execution time is minimal, and the resulting vector task ij That is the final input result, which defines the business request j and its assigned server i, and will eventually place the request in the request queue of the assigned server i.

[0094] The method provided in the above embodiment can realize rapid processing of requests and efficient use of all servers through request diversion of the server-side intelligent routing module; high priority is given to high-weight configuration numbers to ensure that requests with higher priorities can be processed first to avoid affecting the release of important information when the request volume is large.

[0095] See also Figure 2 , shows a schematic diagram of a request processing method according to an embodiment of the present invention, including the following steps:

[0096] S201: receiving a request for obtaining configuration information transmitted by an application, and constructing a distribution matrix for the request according to the number of the request and the number of servers; wherein the distribution matrix is ​​composed of multiple distribution modes;

[0097] S202: Obtain a first number of requests to be processed by each server and a processing time for a single request, and calculate a processing time for processing the request in each allocation mode in combination with the number of requests;

[0098] S203: Allocate the request to a corresponding server according to an allocation method with the shortest processing time;

[0099] S204: The server processes the configuration number and the application number in the request using an information digest algorithm to obtain a token; wherein the application number is the number of the application program running on the communication entity;

[0100] S205: If the token is consistent with the token in the request, determine that the request is an authenticated request;

[0101] S206: Obtaining a record number according to the configuration number; wherein the record number records the current version number of the configuration information, and the configuration information is stored in the server;

[0102] S207: Determine whether the record number is the same as the latest record number in the request, and if they are the same, feedback a flag indicating that no change is required to the application end;

[0103] S208: Otherwise, the configuration information is fed back to the application end.

[0104] In the above embodiment, for steps S201 to S203, see Figure 1 The description of steps S101 to S103 is not repeated here.

[0105] In the above implementation, for steps S204 to S205, the server needs to perform authentication operations on the assigned requests, and only requests that meet the authentication requirements can be passed. If the authentication fails, failure information will be returned to the application end.

[0106] The request transmitted from the application to the server includes not only the configuration number, but also the record number, application name and its corresponding application number, token, user information, etc.; among which:

[0107] 1) The record number corresponds to the modification number of the configuration information (similar to the version number), and the record number of the configuration information on the application side is less than or equal to the current record number on the server side, for example, 1.1 < 1.2;

[0108] 2) Application number refers to the number of the application running on the communication entity. There is a corresponding relationship between the configuration number and the application number. For example, the application numbers of functional applications running in the same APP are different, such as 524 and 268.

[0109] In actual operation, the same function in the application may be split into multiple modules for processing. The configuration information of each module corresponds to a configuration number, so there is a many-to-one correspondence between the configuration number and the application number, for example, application number - configuration number 1, configuration number 2. The configuration information acquisition request transmitted by the client to the application end is the request generated after the user clicks on a configuration module, so the request directly carries the application number corresponding to the configuration module.

[0110] The server's authentication operation for the request is mainly to process the request with MD5 to obtain a token. Specifically, the configuration number and application number in the request are processed with MD5, and the obtained token is judged to be consistent with the token in the request. If they are consistent, it means that the requester or the R&D personnel have the authority to process the request and perform information configuration operations.

[0111] It should be noted that although requests can be authenticated and allocated through the server, when the number of requests is too large, authentication bottlenecks may easily occur, resulting in request allocation delays. The present invention allocates requests on the server side and performs operations on server authentication requests, and sets the authentication operation in the server, thereby effectively improving the request allocation speed and authentication efficiency.

[0112] For steps S206 to S208, after verifying the request and before returning the configuration information to the application, the server needs to determine whether the configuration information of the application is the latest version.

[0113] The judgment mainly involves determining whether the configuration information record number transmitted upstream is consistent with the configuration information record number in the request. If they are consistent, it indicates that the server has not changed the configuration information and the configuration information on the application side is the latest version. A flag (such as boolean) that does not need to be updated can be directly returned.

[0114] However, if the record numbers are inconsistent, it means that the configuration information on the application side is different from the configuration information on the server side, and the configuration information on the server side is the latest version of the configuration information. The server calls the update module, obtains the configuration information from the middleware system (such as Redis) and returns it to the application side to achieve information synchronization.

[0115] Subsequent requests from the user side for configuration information from the application side can be obtained directly from the application side without going through the server side, thereby reducing the service pressure on the server side (see the subsequent Figure 3 describe).

[0116] Furthermore, the middleware system only acts as an information cache module on the server side to provide convenient and fast data acquisition. It will only obtain data from the storage module when the configuration information is not found in the middleware system. The storage module stores all record information, including configuration information, update information, personnel authentication information, etc.

[0117] After the R&D side obtains the latest configuration information from the server, it can add, delete, and modify it, and send it to the server with various updated parameters. The server will synchronize the modified latest configuration information to the storage module. The storage module will then update the configuration information of the middleware system to maintain the consistency of the stored information.

[0118] The method provided in the above embodiment performs request authentication through the server in the service end to determine whether the request is authorized to be processed, and then determines whether the configuration information of the application end is the latest version through record coding comparison, thereby realizing the update / retention of the configuration information of the application end.

[0119] See also Figure 3 , shows a schematic flow chart of another request processing method according to an embodiment of the present invention, comprising the following steps:

[0120] S301: receiving a request for obtaining configuration information transmitted by an application, and constructing a distribution matrix for the request according to the number of the request and the number of servers; wherein the distribution matrix is ​​composed of multiple distribution modes;

[0121] S302: Obtain a first number of requests to be processed by each server and a processing time for a single request, and calculate a processing time for processing the request in each allocation mode in combination with the number of requests;

[0122] S303: allocating the request to a corresponding server according to an allocation method with the shortest processing time, and then transmitting the configuration information received from the corresponding server to the application end;

[0123] S304: The application receives the configuration information fed back by the server to update the configuration information corresponding to the configuration number in the local memory;

[0124] S305: Receive a request for obtaining configuration information transmitted by the client, extract configuration information from the local memory according to the configuration number in the request, and transmit the extracted configuration information to the client.

[0125] In the above embodiment, for steps S301 to S303, see Figure 1 The description of steps S101 to S103 is not repeated here.

[0126] In the above implementation, for step S304, the consumer accesses the website / page on the client, and the client generates a request for obtaining configuration information in response to the user's operation and sends it to the application; wherein the client is used to support consumer-oriented interactive services and UI interface displays, such as search, order, and image reading.

[0127] The application side is used to provide services to the client side and handle the acquisition and update of various configuration information. When the application side receives the configuration information acquisition request transmitted by the client side, it can directly obtain it from the memory / JVM (Java Virtual Machine) without connecting to the server side, thereby reducing the service pressure on the server side.

[0128] In addition, the configuration information consists of two parts. One part is the system internal configuration information (such as spring container configuration), which can be loaded automatically when the system starts; the other part is stored in the memory / JVM of the application side and corresponds to the configuration number. Therefore, the application side will eventually obtain the configuration information through the configuration number for the same request.

[0129] Some configuration information changes frequently, such as advertising slogans during promotions. Although the application can store it locally, the configuration information stored may not be the latest version. Therefore, the present invention sets a timer worker on the application to send a request to the server to obtain configuration information according to a predetermined period, or the server sends an update instruction to the application after the configuration information is updated, so as to realize the dynamic update of the configuration information in the local memory / JVM.

[0130] However, when the query in the application memory does not exist (mainly when the application is started for the first time), or the worker starts to update the configuration and there is no corresponding configuration information, the application can transmit a request for obtaining the configuration information to the server to obtain the configuration information from the server and forward it to the user, avoiding the problem of information acquisition delay.

[0131] In addition, in actual operation, there may be network anomalies that cause the server to fail to return configuration information. At this time, you can execute a wait or request resend operation to eventually obtain the latest configuration information from the server. After receiving the configuration information, the application will overwrite and update the configuration information in the local memory.

[0132] In the method provided in the above embodiment, the application side obtains configuration information from the server side based on the worker periodically to update the information. Subsequently, the configuration information required by the user side can be extracted from the local memory first. If the local memory does not have it, the remote server side is called to obtain it, thereby realizing the acquisition of the latest configuration information.

[0133] See also Figure 4 , which shows a framework diagram of a specific request scheduling and processing method provided by an embodiment of the present invention, including the following steps:

[0134] 1. Application side: used to serve the client, in response to the configuration module clicked by the user on the client, generates / receives a configuration information acquisition request, and then:

[0135] First, in the local memory / JVM, the configuration information is obtained based on the configuration number in the request. For details, see 1. The local container obtains the cached configuration information; also related: 4. The timer periodically obtains the latest configuration information from the server, and then 3. Local loading updates the configuration information.

[0136] If the local query does not exist, the configuration information acquisition request is transmitted to the server. For details, see 2. Fixed task remote call business configuration information.

[0137] 2. The server side includes the application side-process transmission module, intelligent scheduling module, upgrade and update module, server-process transmission module and R&D side-update configuration, etc.; among them:

[0138] 1) Transmission module: Both the application and the server need to use this module to request and transmit data. It is a unified interface provided by the automatic equipment system to the outside world, and can provide various communication methods (HTTP / SOAP / SOCKET, etc.) to facilitate business communication between the two ends.

[0139] 2) Intelligent scheduling module, including priority request unit, scheduling calculation unit and monitoring queue unit, among which:

[0140] ① Priority request unit, which stores the priority level and whitelist of configuration numbers;

[0141] ② Scheduling calculation unit, used to calculate the overall request processing time and perform request scheduling;

[0142] ③ The monitoring queue unit is used to monitor the production and consumption speed of the request queue in the server and provide real-time feedback to the scheduling calculation unit:

[0143] i. Maintain a queue of requests waiting to be processed on each server, such as the request queue 服务器1 ;

[0144] ii. Real-time feedback of the processing time of the request queue to the scheduling calculation unit to achieve reasonable allocation of requests;

[0145] ii. Rely on a dedicated server to implement request monitoring, such as an independent monitoring server.

[0146] 3) Upgrade and update module, including verification unit, update unit, acquisition unit and storage unit, wherein:

[0147] ① Verification unit, used by the server to authenticate the request and determine whether it has the authority to process the request. If not, it returns the authentication failure information to the application;

[0148] ② Update unit, used by the server to compare the latest record number in the request with the record number in the server (both correspond to the configuration number). If they are inconsistent, the configuration information is extracted and returned to the application for configuration information update;

[0149] ③ Acquisition unit, used to obtain the latest configuration information from Redis or receive the modified configuration information transmitted by the R&D side;

[0150] ④ Storage unit, used to store configuration information and synchronize updates to cache databases such as Redis.

[0151] 4) R&D side - update configuration: Provide R&D personnel with the interface and implementation of update configuration, which is divided into three units:

[0152] ① Modify basic configuration information: Developers update the content corresponding to the configuration number and verify the format to reduce the risk of misoperation during online operation; for example, Xml format;

[0153] ②Configuration priority setting: For some common configuration numbers that are urgently launched, they can be temporarily set as key update configuration numbers and stored in the whitelist to achieve rapid update;

[0154] ③Configuration update instructions: Each time the configuration is updated, the updated content must be accompanied by an update instruction to facilitate subsequent content tracing.

[0155] According to the method provided in the embodiment of the present invention, when a user requests configuration information at the user end, the configuration information can be obtained preferentially from the local memory of the application end. At this time, if the configuration information in the server end changes, the application end updates the configuration information in the application end memory based on its periodic acquisition or the server end periodically sends instructions to the application end, thereby dynamically realizing the update operation of the online configuration and achieving the function of dynamically updating data.

[0156] See also Figure 5 , shows a schematic diagram of main modules of a request scheduling device 500 provided in an embodiment of the present invention, including:

[0157] The request receiving module 501 is used to receive a request for obtaining configuration information transmitted by the application end, and to construct a distribution matrix for the request according to the number of the request and the number of servers; wherein the distribution matrix is ​​composed of multiple distribution modes;

[0158] The duration calculation module 502 is used to obtain the first number of requests to be processed by each server and the processing time of a single request, and calculate the processing time of each allocation method to process the request in combination with the number of requests;

[0159] The request allocation module 503 is used to allocate the request to the corresponding server in an allocation manner with the shortest processing time, and then transmit the configuration information received from the corresponding server to the application end.

[0160] In the implementation device of the present invention, the request receiving module 501 is also used for:

[0161] The configuration number in the request is obtained, and the arrangement position of the request in the queue of requests to be allocated is determined according to the weight value of the configuration number, and then the requests whose arrangement positions are before the predetermined arrangement positions are extracted for allocation processing.

[0162] In the implementation device of the present invention, the request receiving module 501 is also used for:

[0163] If the configuration number is in the predetermined white list, the request is arranged at the head of the queue of requests to be allocated.

[0164] See also Figure 6 , which shows a schematic diagram of main modules of a request processing device 600 provided in an embodiment of the present invention, including:

[0165] The number acquisition module 601 is used for the server to acquire the record number according to the configuration number; wherein the record number records the current version number of the configuration information, and the configuration information is stored in the server;

[0166] The number determination module 602 is used to determine whether the record number is the same as the latest record number in the request. If they are the same, a no-change flag is fed back to the application end; otherwise, the configuration information is fed back to the application end.

[0167] The implementation device of the present invention also includes a request authentication module 603 (not shown in the figure), which is used to:

[0168] Using an information digest algorithm, the configuration number and the application number in the request are processed to obtain a token; wherein the application number is the number of the application program running on the communication entity;

[0169] If the token is consistent with the token in the request, the request is determined to be an authenticated request.

[0170] See also Figure 7 , shows a schematic diagram of main modules of another request processing device 700 provided by an embodiment of the present invention, including:

[0171] The information updating module 701 is used for the application end to receive the configuration information fed back by the server end, so as to update the configuration information corresponding to the configuration number in the local memory;

[0172] The information extraction module 702 is used to receive a request for obtaining configuration information transmitted by a client, extract configuration information from a local memory according to a configuration number in the request, and then transmit the extracted configuration information to the client.

[0173] The implementation device of the present invention further includes a request sending module 703 (not shown in the figure), which is used to:

[0174] According to a predetermined period, the request for obtaining the configuration information is transmitted to the server; and / or if the configuration information does not exist in the local memory, the request for obtaining the configuration information is transmitted to the server.

[0175] In addition, the specific implementation content of the device described in the embodiment of the present invention has been described in detail in the method described above, so the repeated content will not be described again here.

[0176] The device provided by the embodiment of the present invention has at least the following beneficial effects:

[0177] 1) Realize intelligent diversion and scheduling control of requests, and give priority to updating important configuration information to avoid delays in the release of important information when the number of requests is large; and R&D personnel can set the configuration number level according to actual needs, which has setting flexibility;

[0178] 2) Decouple the online configuration parameters from the system function code modification, monitor the configuration format, and reduce the risks caused by online misoperation;

[0179] 3) Through information interaction between the application side and the service side, the server, and the R&D side, the periodic update of configuration information on the application side is realized;

[0180] 4) When the client requests configuration information, it can be obtained directly from the application, which improves the efficiency of obtaining configuration information, reduces the risk and time of going online, and eliminates the need for frequent testing and re-releasing of applications.

[0181] Figure 8 An exemplary system architecture 800 is shown in which embodiments of the present invention may be applied.

[0182] like Figure 8 As shown, the system architecture 800 may include terminal devices 801, 802, 803, a network 804 and a server 805 (just an example). The network 804 is used to provide a medium for communication links between the terminal devices 801, 802, 803 and the server 805. The network 804 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0183] The user can use the terminal devices 801, 802, 803 to interact with the server 805 through the network 804 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 801, 802, 803.

[0184] The terminal devices 801 , 802 , and 803 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0185] The server 805 may be a server that provides various services, such as a background management server that provides support for shopping websites browsed by users using the terminal devices 801 , 802 , and 803 (only as an example).

[0186] It should be noted that the method provided in the embodiment of the present invention is generally executed by the server 805 , and accordingly, the device is generally set in the server 805 .

[0187] It should be understood that Figure 8 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0188] Reference below Fig. 9 , which shows a schematic diagram of the structure of a computer system 900 of a terminal device suitable for implementing an embodiment of the present invention. Fig. 9 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0189] like Fig. 9 As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the system 900 are also stored. The CPU 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0190] The following components are connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage section 908 as needed.

[0191] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the central processing unit (CPU) 901, the above-mentioned functions defined in the system of the present invention are executed.

[0192] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0193] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0194] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes a request receiving module, a duration calculation module, and a request allocation module. The names of these modules do not constitute a limitation on the modules themselves in some cases, for example, the request allocation module may also be described as a "module for allocating requests to servers".

[0195] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:

[0196] Receive a request for obtaining configuration information transmitted by an application end, and construct a distribution matrix for the request according to the number of the request and the number of servers; wherein the distribution matrix is ​​composed of multiple distribution modes;

[0197] Obtaining a first number of requests currently to be processed by each server and a processing time for a single request, and calculating a processing time for processing the request in each allocation mode in combination with the number of requests;

[0198] The request is allocated to the corresponding server in accordance with the allocation method with the shortest processing time, and then the configuration information received from the corresponding server is transmitted to the application end.

[0199] According to the technical solution of the embodiment of the present invention, a method for intelligently updating enterprise configuration information is provided, which has at least the following beneficial effects compared with the prior art:

[0200] 1) Realize intelligent diversion and scheduling control of requests, and give priority to updating important configuration information to avoid delays in the release of important information when the number of requests is large; and R&D personnel can set the configuration number level according to actual needs, which has setting flexibility;

[0201] 2) Decouple the online configuration parameters from the system function code modification, monitor the configuration format, and reduce the risk of online misoperation;

[0202] 3) Through information interaction between the application side and the service side, the server, and the R&D side, the periodic update of configuration information on the application side is realized;

[0203] 4) When the client requests configuration information, it can be obtained directly from the application, which improves the efficiency of obtaining configuration information, reduces the risk and time of going online, and eliminates the need for frequent testing and re-releasing of applications.

[0204] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A request scheduling method, It is characterized in that include: Receive a request for obtaining configuration information transmitted by an application; wherein, obtain a configuration number in the request, determine the arrangement position of the request in the request queue to be allocated according to the weight value of the configuration number, and then extract the request whose arrangement position is before the predetermined arrangement position for allocation processing; set the priority level of the configuration number in advance, and sort the requests according to the reception time when the configuration numbers have the same priority level; for the configuration number with a lower original priority level, temporarily set it as a key update configuration number; According to the number of the requests and the number of servers, a distribution matrix for the requests is constructed; wherein the distribution matrix is ​​composed of multiple distribution modes; Obtaining the first number of pending requests currently on each server and the processing time for a single request, and calculating the processing time for processing all requests in each allocation method in combination with the number of requests; wherein all requests include the first number of pending requests on each server and requests transmitted by the application end; The request is allocated to the corresponding server in accordance with the allocation method with the shortest processing time, and then the configuration information received from the corresponding server is transmitted to the application end.

2. The method according to claim 1, It is characterized in that The determining of the arrangement position of the request in the queue of requests to be allocated further includes: If the configuration number is in the predetermined white list, the request is arranged at the head of the queue of requests to be allocated.

3. A request processing method, It is characterized in that include: Using the request scheduling method according to any one of claims 1 to 2, the request is allocated to the corresponding server; as well as The server obtains a record number according to the configuration number; wherein the record number records the current version number of the configuration information, and the configuration information is stored in the server; Determine whether the record number is the same as the latest record number in the request. If they are the same, then feed back a no-change flag to the application end; otherwise, feed back the configuration information to the application end.

4. The method according to claim 3, It is characterized in that Before the server acquires the record number according to the configuration number, the method further includes: Using an information digest algorithm, the configuration number and the application number in the request are processed to obtain a token; wherein the application number is the number of the application program running on the communication entity; If the token is consistent with the token in the request, the request is determined to be an authenticated request.

5. A request processing method, It is characterized in that include: Using the request scheduling method described in any one of claims 1 to 2, the configuration information received from the corresponding server is transmitted to the application end; as well as The application receives the configuration information fed back by the server to update the configuration information corresponding to the configuration number in the local memory; as well as A request for obtaining configuration information transmitted by a client is received, configuration information is extracted from a local memory according to a configuration number in the request, and then the extracted configuration information is transmitted to the client.

6. The method according to claim 5, It is characterized in that Also includes: Transmitting the request for obtaining configuration information to the server according to a predetermined period; and / or If the configuration information does not exist in the local memory, the request for obtaining the configuration information is transmitted to the server.

7. A request scheduling device, It is characterized in that include: A request receiving module is used to receive a request for obtaining configuration information transmitted by an application end; wherein, the configuration number in the request is obtained, and the arrangement position of the request in the request queue to be allocated is determined according to the weight value of the configuration number, and then the request whose arrangement position is before the predetermined arrangement position is extracted for allocation processing; the configuration numbers are prioritized in advance, and the requests are sorted according to the reception time when the configuration numbers have the same priority level; for the configuration numbers with lower original priority levels, they can be temporarily set as the key update configuration numbers; According to the number of the requests and the number of servers, a distribution matrix for the requests is constructed; wherein the distribution matrix is ​​composed of multiple distribution modes; A duration calculation module, used to obtain the first number of pending requests currently on each server and the processing duration of a single request, and calculate the processing duration of all requests for each allocation method in combination with the number of requests; wherein all requests include the first number of pending requests on each server and requests transmitted by the application end; The request allocation module is used to allocate the request to the corresponding server in an allocation method with the shortest processing time, and then transmit the configuration information received from the corresponding server to the application end.

8. A request processing device, It is characterized in that include: A number acquisition module, used for the server to acquire a record number according to the configuration number; wherein the record number records the current version number of the configuration information, and the configuration information is stored in the server; using the request scheduling device according to claim 7, the request is allocated to the corresponding server; The number determination module is used to determine whether the record number is the same as the latest record number in the request. If they are the same, a flag indicating that no change is required is fed back to the application end; otherwise, the configuration information is fed back to the application end.

9. A request processing device, It is characterized in that include: An information update module, used for the application end to receive the configuration information fed back by the server end, so as to update the configuration information corresponding to the configuration number in the local memory; wherein, the configuration information received from the corresponding server is transmitted to the application end by using the request scheduling device according to claim 7; The information extraction module is used to receive a request for obtaining configuration information transmitted by a client, extract the configuration information from the local memory according to the configuration number in the request, and then transmit the extracted configuration information to the client.

10. An electronic device, It is characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

11. A computer readable medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Task scheduling method and device

    CN107783831A

  • A server load balancing method and a device which are dynamically adjusted

    CN109104500A