Business processing method, device, computer equipment and storage medium
By dynamically adjusting the number of instructions pulled from the server based on the online job failure rate of the previous day, the problem of low data utilization in the traditional method is solved and efficient resource utilization is achieved in the event of network failure.
Patent Information
- Application Number
- CN202011088709.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-13
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2040-10-13
AI Technical Summary
When the network between the client and the server is unavailable, the traditional method of pre-pulling all instructions results in low data utilization and serious waste of resources, especially because the client's working hours are not fixed and the probability of network failure is low.
The number of pulls is determined based on the online job failure rate of the previous day, the instruction set is pulled from the server in advance, and the next instruction is obtained for processing based on the instruction number when a network failure occurs, and the number of instructions pulled is dynamically adjusted.
It improves data utilization, reduces resource waste, ensures that instructions can be effectively processed when a network failure occurs, and avoids idle resources.
Smart Images

Figure CN114422594B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a business processing method, apparatus, computer equipment and storage medium. Background Art
[0002] With the development of Internet technology, the server-client model has penetrated into all walks of life. In the process of business processing, the client generally needs to make corresponding actions based on the information of the server. However, the network between the client and the server may be unavailable due to various reasons. When the network is unavailable, the client cannot receive information from the server, which usually causes the client to stop working. Traditionally, in order to ensure normal operation when the network is unavailable, all instructions from the server are usually pulled to the client in advance, and the client processes the pre-pull instructions when the network is unavailable.
[0003] However, since the working hours of the client are not fixed and the probability of the network between the client and the server being unavailable is very low, the traditional full-pull processing method results in a very low utilization rate of the data pulled in advance, resulting in a waste of resources. Summary of the invention
[0004] Based on this, it is necessary to provide a business processing method, device, computer equipment and storage medium that can improve utilization and reduce resource waste in response to the above technical problems.
[0005] A service processing method, characterized in that the method comprises:
[0006] When the communication network with the server fails, obtain the instruction set cached locally; the instruction set is obtained by pulling instructions from the server in advance according to the pull quantity determined by the online job failure rate of the previous day;
[0007] Determine the instruction number of the last online job when the communication network with the server fails;
[0008] The next instruction is obtained from the instruction set according to the number for processing.
[0009] In one embodiment, the determination of the pull quantity includes:
[0010] Count the total number of online requests to the server and the number of successful requests in the previous day;
[0011] Calculate the online job failure rate of the previous day based on the total number of requests and the number of successful requests;
[0012] The number of pulls for the day is determined based on the online job failure rate of the previous day.
[0013] In one embodiment, the calculating the online job failure rate of the previous day according to the total number of requests and the number of successful requests includes:
[0014] Calculate the ratio of the number of successful requests to the total number of requests to obtain the online job success rate;
[0015] An online operation failure rate is determined according to the online operation success rate.
[0016] In one embodiment, determining the number of pulls for the current day based on the online job failure rate of the previous day includes:
[0017] Get the total number of instructions on the server;
[0018] The online job failure rate is multiplied by the total number of instructions to obtain the pull quantity.
[0019] In one embodiment, according to pulling the quantity, pulling instructions from the server in advance to obtain an instruction set includes:
[0020] According to the numbers of the instructions on the server, the instruction corresponding to the first number is used as the pull start point, and the instruction corresponding to the last number is used as the pull end point;
[0021] Pulling is performed from the pulling starting point to the pulling end point to obtain instructions equal to the pulled quantity to form an instruction set.
[0022] In one embodiment, according to the pull quantity, the instructions are pulled from the server in advance to obtain an instruction set, including:
[0023] According to the numbers of the instructions on the server, the instruction corresponding to the last number is used as the pull start point, and the instruction corresponding to the first number is used as the pull end point;
[0024] Pulling is performed from the pulling starting point to the pulling end point to obtain instructions equal to the pulled quantity to form an instruction set.
[0025] In one embodiment, obtaining the next instruction from the instruction set according to the serial number for processing includes:
[0026] Taking the number as a matching number, determining from the instruction set an instruction whose number is after the matching number;
[0027] From the instructions whose numbers are after the matching number, obtain the instruction whose number is closest to the matching number as the next instruction for processing;
[0028] The number of the current next instruction is used as the matching number, and the step of determining the instruction whose number is after the matching number from the instruction set is returned until all instructions in the instruction set are processed.
[0029] A service processing device, comprising:
[0030] An acquisition module, used to acquire a locally cached instruction set when a communication network with the server fails; the instruction set is obtained by pre-pulling instructions from the server according to a pull quantity determined by the online job failure rate of the previous day;
[0031] A determination module, used to determine the number of the last online operation instruction when the communication network with the server fails;
[0032] A processing module is used to obtain a next instruction from the instruction set according to the number for processing.
[0033] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above-mentioned business processing methods when executing the computer program.
[0034] A computer-readable storage medium stores a computer program, which implements the steps of any one of the above-mentioned business processing methods when executed by a processor.
[0035] The above-mentioned business processing method, device, computer equipment and storage medium obtain the instruction set cached locally when the communication network with the server fails; and determine the number of the last online job instruction when the communication network with the server fails; and then obtain the next instruction from the instruction set according to the number for processing. Since the instruction set is obtained by pulling instructions from the server in advance according to the pull quantity determined by the online job failure rate of the previous day, the method can form instruction sets of different sizes on different clients. When the online job failure rate is higher, the number of instructions pulled in advance will be more, and conversely, when the online job failure rate is lower, the number of instructions pulled in advance will be less. The number of instructions pulled is adjusted dynamically through the behavior of the client, so that the utilization rate of the pulled data can be effectively improved and resource waste can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 An application environment diagram of a business processing method in an embodiment;
[0037] Figure 2 A flowchart of a business processing method in an embodiment;
[0038] Figure 3A schematic diagram of a flow chart of a method for determining a pull quantity in one embodiment;
[0039] Figure 4 is a structural block diagram of a service processing device in an embodiment;
[0040] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0042] The business processing method provided in this application can be applied to Figure 1 In the application environment shown. Among them, the client 102 communicates with the server 104 through the network. When the communication network between the client 102 and the server 104 fails, the client 102 obtains the instruction set cached locally; the instruction set is obtained by pulling instructions from the server 104 in advance according to the pull quantity determined by the online job failure rate of the previous day; the client 102 determines the number of the last online job instruction when the communication network with the server 104 fails; the client 102 obtains the next instruction from the instruction set according to the number for processing. Among them, the client 102 can be but is not limited to various personal computers, laptops, smart phones, tablets and portable wearable devices, and the server 104 can be implemented with an independent server or a server cluster composed of multiple servers.
[0043] In one embodiment, Figure 2 As shown, a business processing method is provided, which is applied to Figure 1 The following steps are used as an example to illustrate the client:
[0044] Step S202, when the communication network with the server fails, obtain the instruction set cached locally; the instruction set is obtained by pulling instructions from the server in advance according to the pull quantity determined by the online job failure rate of the previous day.
[0045] Among them, communication network failure refers to the state in which the network cannot provide normal services or reduces the service quality due to hardware problems, software vulnerabilities, virus intrusion, etc. Instruction set is a set of multiple instructions. Online job success rate refers to the success rate of the job when the client and the server have no communication network failure. Pull quantity refers to the number of instructions that need to be pulled.
[0046] Specifically, after the client is started, the instructions are pulled from the server according to the number of pulls determined in advance based on the online job failure rate of the previous day to form an instruction set and cached locally. When the network between the client and the server is available, the online job mode will be used preferentially between the client and the server for business processing. That is, each time the client will first obtain an instruction from the server, and then perform the job according to the instruction. When the communication network between the client and the server fails, the client and the server are temporarily unable to perform online operations due to the network failure. Therefore, in order to ensure normal processing, the client obtains the pre-cached instruction set from the local to perform the operation. It should be understood that in order to ensure the success of the operation, while pulling the instruction, the client will synchronously pull the data required to process the instruction and cache it locally.
[0047] The same number of instructions are pulled according to the number of pulls determined by the online job failure rate of the previous day. When the online job failure rate is higher, the number of instructions pulled in advance will be higher. Conversely, when the online job failure rate is lower, the number of instructions pulled in advance will be lower. The number of pulls is adjusted dynamically through the client's behavior, which can effectively improve the utilization rate of the pulled data and reduce resource waste.
[0048] Step S204, determining the instruction number of the last online operation when the communication network with the server fails.
[0049] Among them, the number is a number used to uniquely identify and distinguish the processing order of each instruction before and after. Since the instructions to be processed usually have a fixed processing order based on the time of generating the request. That is, the instructions generated first are processed first, and the instructions generated later are processed later. Therefore, in order to ensure the original processing order of the instructions, the instructions are preferably numbered according to the original processing order of the instructions. The last online job instruction refers to the last instruction processed in the online job mode when the network fails. For example, when the client successfully requests instruction A from the server and the network fails, the number of instruction A is the number of the last online job instruction. If the client processes the business corresponding to instruction A and continues to send an online job request to the server but has not successfully requested the next instruction, the network fails. At this time, the last instruction requested for the online job is still instruction A.
[0050] Specifically, in order to ensure the original processing order of the instructions, the client and the server will perform operations in an orderly manner according to the number sequence. Therefore, after determining that the communication network between the client and the server fails, the client can obtain the last online operation instruction. Because the last online operation instruction is the last instruction processed in the online operation mode. Then the client determines the number of the last online operation instruction based on the number carried by the instruction.
[0051] Step S206, obtaining the next instruction from the instruction set according to the number for processing.
[0052] Among them, the next instruction is the instruction to be processed next according to the order of numbers. In order to ensure that the instructions can be processed sequentially according to their original order, the number of the next instruction obtained from the instruction set should be the next number closest to the current number among all the numbers after the current number.
[0053] In one embodiment, step S206 includes: using the number as the matching number, and determining the instruction whose number is after the matching number from the instruction set; obtaining the instruction whose number is closest to the matching number from the instructions whose number is after the matching number as the next instruction for processing; using the number currently serving as the next instruction as the matching number, and returning to the step of determining the instruction whose number is after the matching number from the instruction set, until all instructions in the instruction set are processed.
[0054] Among them, the instructions after the matching number are different according to the numbering rules. When the numbers are from small to large to indicate the order of instruction processing, the numbers after the matching number should be larger than the matching number. When the numbers are from small to large to indicate the order of instruction processing, the numbers after the matching number should be smaller than the matching number.
[0055] Specifically, the number of the instruction of the last online job is used as the matching number. According to the number of the instruction, the instruction after the matching number is matched from the instruction set. For example, assuming that the numbering rule is to number from small to large in chronological order, then assuming that the number of the instruction of the last online job is 2, when the numbers of the instructions in the instruction set are 1, 2, 3, and 5, the instructions after the matching number 2 include the instructions corresponding to numbers 3 and 5, and the number closest to the matching number 2 is number 3, then the instruction corresponding to number 3 is the next instruction. Similarly, when the numbers of the instructions in the instruction set are 1, 2, 5, and 8, the next instruction obtained at this time should be the instruction corresponding to number 5 at that time. When the numbers of the instructions in the instruction receiving are 5, 8, 10, and 11, the next instruction obtained at this time should be the instruction corresponding to number 5 at that time.
[0056] Furthermore, when an instruction is obtained from the local instruction set as the next instruction and the processing is completed, the next instruction can be obtained from the instruction set in the same way until all the instructions in the instruction set have been processed, thereby realizing the continued processing in offline mode after the network failure. That is, the number corresponding to the instruction as the next instruction is used as the matching number. Then return to the step of determining the instruction whose number is after the matching number from the instruction set until all the instructions in the instruction set are processed. For example, the instruction corresponding to number 3 is obtained from the instruction set as the next instruction with matching number 2 for the first time, and then the next instruction is obtained with number 3 as the matching number. Among them, the processed instructions include not only the instructions processed by the offline job, but also the instructions processed by the online job request. That is, when the number of the last instruction of the online job is 2, if the instruction set includes the instruction with number 1, the instruction corresponding to number 1 is also processed by the online job.
[0057] The above-mentioned business processing method obtains a locally cached instruction set when the communication network with the server fails; and determines the number of the last online job instruction when the communication network with the server fails; and then obtains the next instruction from the instruction set according to the number for processing. Since the instruction set is obtained by pulling instructions from the server in advance based on the pull quantity determined by the online job failure rate of the previous day, instruction sets of different sizes can be formed on different clients. When the online job failure rate is higher, the number of instructions pulled in advance will be more, and conversely, when the online job failure rate is lower, the number of instructions pulled in advance will be less. By dynamically adjusting the number of pulls through the behavior of the client, the utilization rate of the pulled data can be effectively improved, reducing resource waste.
[0058] In one embodiment, Figure 3 As shown, the method for determining the pull quantity includes the following steps:
[0059] Step S302, counting the total number of online requests for instructions to the server and the number of successful requests in the previous day.
[0060] The total number of requests refers to the total number of requests that the client sends to the server in online operation mode, and the number of successful requests refers to the number of successful online operation requests initiated by the client to the server.
[0061] Specifically, after the client is started, the total number of requests and the number of successes are initialized. For example, the total number of initialized requests C2 = 0, and the number of successful initializations C1 = 0. When the client initiates a job request to the online server, C2 is incremented by 1, C2 = C2 + 1. If the client successfully requests the job, C1 is incremented by 1, C1 = C1 + 1. If the job request fails, no additional processing is performed.
[0062] Step S304, calculating the online job failure rate of the previous day according to the total number of requests and the number of successful requests.
[0063] The online job failure rate is used to indicate the probability of failure of the online job mode.
[0064] Specifically, after the total number of requests and the number of successful requests are counted, the online job success rate can be calculated based on the total number of requests and the number of successful requests. Furthermore, the online job failure rate can be obtained based on the online job success rate.
[0065] In one embodiment, step S304 includes: calculating the ratio of the number of successful requests to the total number of requests to obtain an online job success rate; and determining an online job failure rate according to the online job success rate.
[0066] Specifically, the ratio S=C1 / C2 of the number of successful requests C1 to the total number of requests C2 is calculated to obtain the online job success rate S. The online job failure rate is determined according to the online job success rate, that is, the online job failure rate P=1-S.
[0067] Step S306, determining the pull quantity for the current day according to the online job failure rate of the previous day.
[0068] The pull quantity refers to the total number of request instructions that need to be pre-pulled from the server.
[0069] Specifically, the total number of instructions on the server is obtained, and the number of pulls for the next day is calculated based on the total number of instructions and the online job failure rate of the previous day.
[0070] In one embodiment, step S306 includes: obtaining the total number of instructions on the server; and multiplying the online job failure rate by the total number of instructions to obtain the pull number.
[0071] The total number of instructions on the server side can be configured according to actual needs, for example, the total number of instructions C=10000.
[0072] Specifically, the total number of instructions in the service order is obtained, and then the online job failure rate P is multiplied by the total number of instructions C to obtain the pull number N. That is, N=C*P.
[0073] In this embodiment, the online job failure rate is determined by the online job success rate of the client and the server, and the pull quantity is then calculated based on the online job failure rate, thereby realizing statistics and analysis of the client's online behavior. The pull quantity can be dynamically adjusted according to the client's online behavior, thereby improving utilization and reducing resource consumption.
[0074] In one embodiment, based on the pull quantity, instructions are pulled from the server in advance to obtain an instruction set, including: based on the numbers of each instruction in the server, the instruction corresponding to the first number is used as the pull starting point, and the instruction corresponding to the last number is used as the pull end point; pulling from the pull starting point to the pull end point to obtain an instruction set consisting of instructions equal to the pull quantity.
[0075] Among them, the first number and the last number are the first number and the last number determined from the numbers according to the numbering rules. For example, when the instructions are numbered from small to large in the order of the time of instruction generation, that is, the earlier the instruction is processed, the smaller the number, and the operation is also performed from small to large. Then, the first number is the number with the smallest number, and the last number is the number with the largest number. Conversely, the numbering is sorted from large to small according to the time sequence, that is, the earlier the instruction is processed, the larger the number, and the operation is performed from small to large. Then, the first number is the number with the largest number, and the last number is the number with the smallest number.
[0076] Specifically, no matter which numbering rule is used, when pulling instructions from the server according to the pull quantity, the client uses the instruction corresponding to the first number as the pull starting point and the instruction corresponding to the last number as the pull end point. Then, pull from the server from the pull starting point to the pull end point to obtain instructions equal to the pull quantity to form an instruction set. For example, assume that the instructions on the server include instruction 1, instruction 2, instruction 3, ..., instruction 10 in order of number. When the online job failure rate is 30%, that is, pulling from instruction 1 to instruction 3, the instruction set includes instruction 1, instruction 2, and instruction 3.
[0077] When the network between the client and the server fails, if the online job request ends before the client requests instruction 3, assuming it is instruction 2, then after the failure, the client can still obtain instruction 3 from the instruction set for processing, thereby ensuring that all instructions pulled to the client are processed, so as to achieve 100% utilization of pulled data as much as possible and reduce resource waste. If the online request ends after the client requests instruction 3, at this time, since the instructions in the instruction set and the data corresponding to the instructions have been used in the online job mode, the utilization rate is also 100%.
[0078] In another embodiment, based on the pull quantity, instructions are pulled from the server in advance to obtain an instruction set, including: based on the numbers of each instruction in the server, the instruction corresponding to the last number is used as the pull starting point, and the instruction corresponding to the first number is used as the pull end point; pulling from the pull starting point to the pull end point to obtain an instruction set consisting of instructions equal to the pull quantity.
[0079] Specifically, no matter in online or offline operation mode, the instructions processed by the job request are processed in sequence. In other words, the probability of a large difference in failure between the same client and server two days apart is small. Therefore, when the online job failure rate of the previous day is calculated based on the online job situation of the previous day, the node that is likely to fail when the client performs online operation today can be known based on the failure rate of the previous day. Then, using this node to pull the number can not only ensure the utilization rate of the pulled number but also ensure that as many instructions as possible are processed offline after the failure.
[0080] Therefore, this embodiment uses the instruction corresponding to the last number as the starting point for pulling, and the instruction corresponding to the first number as the end point for pulling. That is, it is assumed that the instructions on the server include instruction 1, instruction 2, instruction 3, ..., instruction 10 in order of number. When the online job failure rate is 30%, the pull is from instruction 10 to instruction 8, and the instruction set includes instructions 8, instruction 9, and instruction 10. Because the failure rate of the previous day was 30%, that is, the client online job was able to process instruction 7 the previous day. So there is a high probability that the online job can also process instruction 7 today. Therefore, starting from instruction 7, all instructions that may fail in online job requests are pre-pulled to the client cache. When the client fails to process the online request to 7 today, it can continue to process after instruction 7 through the offline mode. Even if the online job does not request instruction 7 today, when the next instruction is obtained by number, it can be processed from instruction 8, thereby not only ensuring the utilization rate of the pulled data, but also increasing the probability of completing the processing of all 10 instructions.
[0081] In one embodiment, the service processing method is described in detail with the online operation process of the client, including the following steps:
[0082] S1, the client application app is started, the pull quantity determined on the previous day is obtained, and today's instructions are pulled according to the pull quantity on the previous day and stored locally to obtain an instruction set. Similarly, in order to make the job successful, the data corresponding to the instructions can be pulled and stored locally at the same time. The pull instruction can be pulled from the first instruction to the last instruction, or from the last instruction to the first instruction.
[0083] S2, the client initiates an online job request to the server.
[0084] S3, increase the total number of requests C2 by 1, C2=C2+1.
[0085] S4, if the online job request succeeds, C1 is increased by 1, C1 = C1 + 1. If the online job request fails, no additional processing is performed.
[0086] S5, recalculate the client online job success rate: S = C1 / C2.
[0087] S6, recalculate the proportion of the client pulling server instructions in advance (ie, the online job failure rate): P = 1-S.
[0088] S7, recalculate the number of instructions that the client pulls from the server in advance (i.e., the number of pulls): N = C*P
[0089] S8, continuously repeating S2 to S7 until the client application app exits.
[0090] S9, using the finally calculated pull quantity as the pull quantity for tomorrow's pull instruction.
[0091] It should be understood that although Figure 2-3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-3 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0092] In one embodiment, Figure 4 As shown, a service processing device is provided, including: an acquisition module 402, a determination module 404 and a processing module 406, wherein:
[0093] The acquisition module 402 is used to acquire the instruction set cached locally when the communication network with the server fails; the instruction set is obtained by pre-pulling instructions from the server according to the pull quantity determined by the online job failure rate of the previous day.
[0094] The determination module 404 is used to determine the number of the last online operation instruction when the communication network with the server fails.
[0095] The processing module 406 is used to obtain the next instruction from the instruction set according to the serial number for processing.
[0096] In one embodiment, the business processing device also includes a statistical module for counting the total number of online requests for instructions to the server and the number of successful requests on the previous day; calculating the online job failure rate of the previous day based on the total number of requests and the number of successful requests; and determining the number of pulls on the current day based on the online job failure rate of the previous day.
[0097] In one embodiment, the statistical module is further used to calculate the ratio of the number of successful requests to the total number of requests to obtain the online job success rate; and determine the online job failure rate based on the online job success rate.
[0098] In one embodiment, the statistics module is also used to obtain the total number of instructions on the server side; and multiply the online job failure rate by the total number of instructions to obtain the pull number.
[0099] In one embodiment, the business processing device also includes a pulling module, which is used to use the instruction corresponding to the first number as the pulling starting point and the instruction corresponding to the last number as the pulling end point according to the numbers of each instruction in the server; pulling from the pulling starting point to the pulling end point to obtain an instruction set consisting of instructions equal to the number of pulls.
[0100] In one embodiment, the pulling module is also used to use the instruction corresponding to the last number as the pulling starting point and the instruction corresponding to the first number as the pulling end point according to the numbers of each instruction in the server; pulling is performed from the pulling starting point to the pulling end point to obtain an instruction set consisting of instructions equal to the number of instructions pulled.
[0101] In one embodiment, the processing module 406 is also used to use the number as the matching number, determine the instruction whose number is after the matching number from the instruction set; obtain the instruction whose number is closest to the matching number from the instructions whose number is after the matching number as the next instruction for processing; use the number currently serving as the next instruction as the matching number, and return to the step of determining the instruction whose number is after the matching number from the instruction set, until all instructions in the instruction set are processed.
[0102] For the specific definition of the business processing device, please refer to the definition of the business processing method above, which will not be repeated here. Each module in the above-mentioned business processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0103] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a business processing method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0104] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0105] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0106] When the communication network with the server fails, obtain the instruction set cached locally; the instruction set is obtained by pulling instructions from the server in advance according to the pull quantity determined by the online job failure rate of the previous day;
[0107] Determine the instruction number of the last online job when the communication network with the server fails;
[0108] Get the next instruction from the instruction set according to the number for processing.
[0109] In one embodiment, when the processor executes the computer program, the following steps are also implemented: counting the total number of online requests for instructions to the server and the number of successful requests on the previous day; calculating the online job failure rate on the previous day based on the total number of requests and the number of successful requests; and determining the number of pulls on the current day based on the online job failure rate on the previous day.
[0110] In one embodiment, when the processor executes the computer program, the following steps are also implemented: calculating the ratio of the number of successful requests to the total number of requests to obtain the online job success rate; and determining the online job failure rate according to the online job success rate.
[0111] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining the total number of instructions on the server; multiplying the online job failure rate by the total number of instructions to obtain the pull number.
[0112] In one embodiment, when the processor executes the computer program, the following steps are also implemented: according to the numbers of each instruction in the server, the instruction corresponding to the first number is used as the pulling starting point, and the instruction corresponding to the last number is used as the pulling end point; pulling is performed from the pulling starting point to the pulling end point to obtain an instruction set consisting of instructions equal to the number of instructions pulled.
[0113] In one embodiment, when the processor executes the computer program, the following steps are also implemented: according to the numbers of each instruction in the server, the instruction corresponding to the last number is used as the pulling starting point, and the instruction corresponding to the first number is used as the pulling end point; pulling is performed from the pulling starting point to the pulling end point to obtain an instruction set consisting of instructions equal to the number of instructions pulled.
[0114] In one embodiment, when the processor executes the computer program, the following steps are also implemented: using the number as the matching number, determining the instruction whose number is after the matching number from the instruction set; obtaining the instruction whose number is closest to the matching number from the instructions whose number is after the matching number as the next instruction for processing; using the number currently being the next instruction as the matching number, returning to the step of determining the instruction whose number is after the matching number from the instruction set, until all instructions in the instruction set are processed.
[0115] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0116] When the communication network with the server fails, obtain the instruction set cached locally; the instruction set is obtained by pulling instructions from the server in advance according to the pull quantity determined by the online job failure rate of the previous day;
[0117] Determine the instruction number of the last online job when the communication network with the server fails;
[0118] Get the next instruction from the instruction set according to the number for processing.
[0119] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: counting the total number of online requests for instructions to the server and the number of successful requests on the previous day; calculating the online job failure rate on the previous day based on the total number of requests and the number of successful requests; and determining the number of pulls on the current day based on the online job failure rate on the previous day.
[0120] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: calculating the ratio of the number of successful requests to the total number of requests to obtain the online job success rate; and determining the online job failure rate based on the online job success rate.
[0121] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining the total number of instructions on the server; multiplying the online job failure rate by the total number of instructions to obtain the pull number.
[0122] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: according to the numbers of each instruction in the server, the instruction corresponding to the first number is used as the pulling starting point, and the instruction corresponding to the last number is used as the pulling end point; pulling is performed from the pulling starting point to the pulling end point to obtain an instruction set consisting of instructions equal to the number of instructions pulled.
[0123] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: according to the numbers of each instruction in the server, the instruction corresponding to the last number is used as the pulling starting point, and the instruction corresponding to the first number is used as the pulling end point; pulling is performed from the pulling starting point to the pulling end point to obtain an instruction set consisting of instructions equal to the number of instructions pulled.
[0124] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: using the number as the matching number, determining the instruction whose number is after the matching number from the instruction set; obtaining the instruction whose number is closest to the matching number from the instructions whose number is after the matching number as the next instruction for processing; using the number currently being the next instruction as the matching number, returning to the step of determining the instruction whose number is after the matching number from the instruction set, until all instructions in the instruction set are processed.
[0125] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0126] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0127] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A business processing method, It is characterized in that The method comprises: According to the numbers of the instructions in the server, the instruction corresponding to the first number is used as the pull starting point, and the instruction corresponding to the last number is used as the pull end point, or the instruction corresponding to the last number is used as the pull starting point, and the instruction corresponding to the first number is used as the pull end point; Pulling from the pull starting point to the pull end point, obtaining instructions equal to the pulled number to form an instruction set, and caching the instruction set locally; When the communication network with the server fails, obtaining the instruction set cached locally; Determine the instruction number of the last online job when the communication network with the server fails; Obtaining the next instruction from the instruction set according to the number for processing; The determination of the pull quantity includes: Count the total number of online requests to the server and the number of successful requests in the previous day; Calculate the online job failure rate of the previous day based on the total number of requests and the number of successful requests; Get the total number of instructions on the server; The online job failure rate is multiplied by the total number of instructions to obtain the pull quantity.
2. The method according to claim 1, It is characterized in that The calculating the online job failure rate of the previous day according to the total number of requests and the number of successful requests includes: Calculate the ratio of the number of successful requests to the total number of requests to obtain the online job success rate; An online operation failure rate is determined according to the online operation success rate.
3. The method according to claim 1, It is characterized in that The obtaining a next instruction from the instruction set according to the number for processing includes: Taking the number as a matching number, determining from the instruction set an instruction whose number is after the matching number; From the instructions whose numbers are after the matching number, obtain the instruction whose number is closest to the matching number as the next instruction for processing; The number of the current next instruction is used as the matching number, and the step of determining the instruction whose number is after the matching number from the instruction set is returned until all instructions in the instruction set are processed.
4. The method according to claim 1, It is characterized in that The first number is the number that is first in the sequence determined from the numbers according to the numbering rule, and the last number is the number that is last in the sequence determined from the numbers according to the numbering rule.
5. A business processing device, It is characterized in that The device comprises: A statistics module is used to count the total number of online requests for instructions from the server and the number of successful requests on the previous day, calculate the online job failure rate on the previous day based on the total number of requests and the number of successful requests, obtain the total number of instructions on the server, and multiply the online job failure rate by the total number of instructions to obtain the pull quantity; A pulling module is used to, according to the numbers of the instructions in the server, use the instruction corresponding to the first number as the pulling starting point and the instruction corresponding to the last number as the pulling end point, or use the instruction corresponding to the last number as the pulling starting point and the instruction corresponding to the first number as the pulling end point, pull from the pulling starting point to the pulling end point, obtain an instruction set consisting of instructions equal to the pulled number, and cache the instruction set locally; An acquisition module, used for acquiring the instruction set cached locally when the communication network with the server fails; A determination module, used to determine the number of the last online operation instruction when the communication network with the server fails; A processing module is used to obtain a next instruction from the instruction set according to the number for processing.
6. The device according to claim 5, It is characterized in that The statistical module is further used to calculate the ratio of the number of successful requests to the total number of requests to obtain an online job success rate, and determine an online job failure rate based on the online job success rate.
7. The device according to claim 5, It is characterized in that The processing module is also used to use the number as the matching number, determine the instruction whose number is after the matching number from the instruction set, obtain the instruction whose number is closest to the matching number from the instructions whose number is after the matching number as the next instruction for processing, use the number currently serving as the next instruction as the matching number, and return to the step of determining the instruction whose number is after the matching number from the instruction set, until all instructions in the instruction set are processed.
8. The device according to claim 5, It is characterized in that The first number is the number that is first in the sequence determined from the numbers according to the numbering rule, and the last number is the number that is last in the sequence determined from the numbers according to the numbering rule.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
