Process selection method, device, equipment and computer readable storage medium
By maintaining unavailable process information and selecting available process calls, the process unavailability problem in the distributed server architecture caused by network jitter or hardware failure is solved, and the response timeliness and system reliability is improved.
Patent Information
- Application Number
- CN202010742818.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-29
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-07-29
AI Technical Summary
In application software based on distributed server architecture, network jitter or hardware failure of the physical machine where the called process is located causes the called process to be unavailable, and it is unable to respond to user requests in time, resulting in abnormal functions.
By maintaining unavailable process information, obtain unavailable process information according to the process type you need to call, determine alternative processes, and make calls after verifying that the target process is available, make sure to select an available process to avoid unavailability caused by network jitter or hardware failures. Condition.
It improves the timeliness of user request responses, reduces the occurrence of abnormal situations, and enhances the reliability and disaster recovery capabilities of the system.
Smart Images

Figure CN111858008B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a process selection method, device, equipment and computer-readable storage medium. Background Art
[0002] In some application software based on distributed server architecture, server processes are usually divided into different types according to their functions. Different types of processes are deployed on different physical machines or even in different regions according to the needs of actual application scenarios. For example, in game development based on distributed server architecture, server processes generally include game processes, login processes, database processes, combat processes, scene processes, chat processes, etc.
[0003] When a user requests a function, the process corresponding to the function needs to be called through the current process. For some occasions with high timeliness requirements, users hope to get timely responses. For example, for game application software, users are usually in the game process. When users need to fight, they need to call the battle process through the game process; when users need to switch game scenes, they need to call the scene process through the game process; when users need to chat, they need to call the chat process through the game process, etc. When entering a battle, switching game scenes, or chatting, users hope to get timely responses.
[0004] In the prior art, a process is usually randomly selected from the processes corresponding to the function for calling through the current process. When the called process and the current process are not on the same physical machine, the called process may become unavailable due to network jitter or hardware failure of the physical machine where the called process is located, resulting in failure to respond to user requests in a timely manner and functional abnormalities. Summary of the invention
[0005] The present invention provides a process selection method, device, equipment and computer-readable storage medium to solve the problem in the prior art that the called process is unavailable and cannot respond to user requests in time due to network jitter or hardware failure of the physical machine where the called process is located, resulting in functional abnormalities.
[0006] One aspect of the present invention is to provide a process selection method, comprising:
[0007] According to the type of the process to be called, obtaining unavailable process information of the type;
[0008] Determining an alternative process according to the unavailable process information;
[0009] A target process is selected from the candidate processes, and after verifying that the target process is available, the target process is called.
[0010] Another aspect of the present invention is to provide a process selection device, comprising:
[0011] An information maintenance module, used for obtaining unavailable process information of the type of process to be called according to the type of the process to be called;
[0012] The process selection module is used to: determine an alternative process according to the unavailable process information; select a target process from the alternative processes, and call the target process after verifying that the target process is available.
[0013] Another aspect of the present invention is to provide a process selection device, comprising:
[0014] A processor, a memory, and a computer program stored on the memory and executable on the processor;
[0015] Wherein, the processor implements the above-mentioned process selection method when running the computer program.
[0016] Another aspect of the present invention is to provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the process selection method described above is implemented.
[0017] The process selection method, apparatus, device and computer-readable storage medium provided by the present invention maintain unavailable process information for a type of process to record the information of unavailable processes in the type of process. When it is necessary to call the type of process, an alternative process is determined based on the unavailable process information of the type; a target process is selected from the alternative processes, and after verifying that the target process is available, the target process is called. An available process can be selected for calling, which can avoid calling an unavailable process that may be caused by network jitter or hardware failure of the physical machine where the called process is located, thereby improving the timeliness of user request response and reducing the occurrence of abnormal situations. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A flow chart of a process selection method provided in Embodiment 1 of the present invention;
[0019] Figure 2 A flow chart of a process selection method provided in Embodiment 2 of the present invention;
[0020] Figure 3 A schematic diagram of the structure of a process selection device provided in Embodiment 3 of the present invention;
[0021] Figure 4 This is a schematic diagram of the structure of a process selection device provided in Embodiment 5 of the present invention.
[0022] The above drawings have shown clear embodiments of the present invention, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present invention in any way, but to illustrate the concept of the present invention for those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0023] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0024] The terms "first", "second", etc. involved in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. In the description of the following embodiments, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.
[0025] A specific application scenario of the present invention is a game application software based on a distributed server architecture. The server process generally includes a game process, a login process, a database process, a battle process, and the like. After the user successfully logs in, he is usually in the game process. When the user needs to fight, the game process will randomly select a battle process to start the battle. When the currently selected battle process and the game process are not on the same physical machine, if there happens to be network jitter or hardware failure of the physical machine where the selected battle process is located, the game process will not be able to call the selected battle process normally, and will not be able to respond to the user in time, resulting in the user being unable to enter the battle, and the game will be stuck, which seriously affects the user experience.
[0026] When the user needs to switch game scenes, the game process will randomly call a scene process; when the user wants to chat, the game process will randomly call a chat process; there are other similar scenarios that may also have similar problems as mentioned above.
[0027] The process calling method provided by the present invention is intended to solve the above technical problems in the prior art.
[0028] The following specific embodiments are used to describe in detail the technical solutions of the present invention and how the technical solutions of the present application solve the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0029] Figure 1The flowchart of the process selection method provided in the first embodiment of the present invention. The embodiment of the present invention provides a process selection method to solve the problem in the prior art that the called process is unavailable and cannot respond to user requests in time due to network jitter or hardware failure of the physical machine where the called process is located, resulting in functional abnormalities.
[0030] The execution subject of the embodiment of the present invention may be a server, a computer device in a distributed file system, a terminal device, etc. For example, it may be a game running server or a terminal device, and the method of this embodiment can be implemented through the game process.
[0031] like Figure 1 As shown, the specific steps of this method are as follows:
[0032] Step S101: According to the type of the process to be called, obtain the unavailable process information of the type.
[0033] In this embodiment, for each type of process, unavailable process information may be maintained to record information of the unavailable process.
[0034] The unavailable process information includes at least: an unavailable process identifier and an unavailable timestamp. The unavailable process identifier may be a process name, etc., which is used to uniquely identify a process. If the unavailable process records the information of a certain process, it means that the process is recorded as an unavailable process.
[0035] In addition, the unavailable process information may also include other information of the unavailable process, which may be specifically set according to the actual application scenario, and is not specifically limited in this embodiment.
[0036] Step S102: Determine an alternative process according to the unavailable process information.
[0037] When a certain type of process needs to be called, unavailable process information of this type of process is first obtained, and then available processes are screened out as candidate processes based on the unavailable process information.
[0038] This step can be implemented in at least one of the following ways:
[0039] A possible implementation is: for this type of process, if the unavailable process information does not contain the information of the process, it means that the process does not belong to the unavailable process, and the process is added to the alternative process; if the unavailable process information contains the information of the process, it means that the process belongs to the unavailable process and cannot be used as an alternative process.
[0040] Another possible implementation is: for this type of process, if the unavailable process information does not contain the information of the process, it means that the process does not belong to the unavailable process, and the process is added to the alternative processes; if the unavailable process information contains the information of the process, the unavailable timestamp of the process is verified. If the unavailable timestamp of the process is very close to the current time, it means that the process is an unavailable process and cannot be used as an alternative process; if the unavailable timestamp of the process is far from the current time, then during the period since the last time the information of the process was added to the unavailable process information, the process is likely to have become an available process, and the process is added to the alternative processes at this time.
[0041] Step S103: Select a target process from the candidate processes, and after verifying that the target process is available, call the target process.
[0042] After determining the alternative processes, the processes in the alternative processes can be used as target processes in turn to verify the availability of the target processes. If it is determined that the target process is unavailable, the next process is selected as the new target process to verify the availability of the new target process. The target process is called when it is verified that the currently selected target process is available.
[0043] The embodiment of the present invention maintains unavailable process information for a type of process to record the information of unavailable processes in the type of process. When it is necessary to call the type of process, an alternative process is determined based on the unavailable process information of the type. A target process is selected from the alternative processes, and after verifying that the target process is available, the target process is called. An available process can be selected for calling, which can avoid calling an unavailable process that may be caused by network jitter or hardware failure of the physical machine where the called process is located, thereby improving the timeliness of the response to user requests and reducing the occurrence of abnormal situations.
[0044] Figure 2 A flow chart of a process selection method provided for the second embodiment of the present invention. Based on the above-mentioned embodiment 1, in this embodiment, an alternative process is determined according to the unavailable process information, including: according to the unavailable process information, if the first process does not belong to the unavailable process, the first process is added to the alternative process, and the first process is any one of the processes of this type. According to the unavailable process information, if it is determined that the first process belongs to the unavailable process, the interval duration between the current time and the unavailable timestamp of the first process is calculated; if the interval duration is greater than a preset threshold, the first process is added to the alternative process.
[0045] In this embodiment, a scenario in which a user successfully logs in to a game process in a game application software based on a distributed server architecture and needs to select a battle process to start a battle is taken as an example to describe in detail an implementation method of a process selection method. The process selection method provided in this embodiment can also be applied to other application scenarios. When applied to other application scenarios, it can be implemented in a similar manner to that in this embodiment, and this embodiment will not be described in detail one by one.
[0046] like Figure 2 As shown, the specific steps of this method are as follows:
[0047] Step S201: In response to a request for a certain function, determine the type of process to be called.
[0048] When a user's request for a certain function is received, in order to implement the function, the process corresponding to the function needs to be called. First, the type of process to be called is determined according to the requested function.
[0049] For example, in response to a game player's battle request, the process to be called is determined to be the battle process; in response to a game player's scene switching request, the process to be called is determined to be the scene process; in response to a game player's chat request, the process to be called is determined to be the chat process, and so on.
[0050] Step S202: According to the type of the process to be called, obtain the unavailable process information of the type.
[0051] In this embodiment, for each type of process, unavailable process information may be maintained to record information of the unavailable process.
[0052] The unavailable process information includes at least: an unavailable process identifier and an unavailable timestamp. The unavailable process identifier may be a process name, etc., which is used to uniquely identify a process. If the unavailable process records the information of a certain process, it means that the process is recorded as an unavailable process.
[0053] Exemplarily, the unavailable process information may be implemented in the form of an information list, or may also be implemented in the form of a database, a data file, etc., which is not specifically limited in this embodiment.
[0054] For example, for a battle process, an unavailable battle process information list can be maintained, which includes the name of the unavailable battle process and the unavailable timestamp. For example, InvalidBattle is used to represent the unavailable battle process information list, which can be implemented in the following list: InvalidBattle = {"battle3": timestamp 1; "battle5": timestamp 2...}.
[0055] In addition, the unavailable process information may also include other information of the unavailable process, which may be specifically set according to the actual application scenario, and is not specifically limited in this embodiment.
[0056] After obtaining the unavailable process information of this type, the following steps S203-S208 are performed to determine the candidate process according to the unavailable process information.
[0057] Step S203: traverse each process of this type and take the current process as the first process.
[0058] The first process may be any process of this type.
[0059] In this embodiment, all process information of the type of process may include information of all processes of the type. All process information may include a process identifier and process specific information. The process identifier may be a process name, and the process specific information may include at least a communication address, such as an IP address, a port number, etc.
[0060] Exemplarily, for a battle process, two battle process information lists may be maintained on the game process, one being a list of all battle process information and the other being a list of unavailable battle process information.
[0061] For example, AllBattle is used to represent the list of all battle process information, which can be implemented in the following way: AllBattle = {"battle0": (IP, port, ...), "battle1": (IP, port, ...) ...}. InvalidBattle is used to represent the list of invalid battle process information, which can be implemented in the following list: InvalidBattle = {"battle3": timestamp 1; "battle5": timestamp 2 ...}.
[0062] In this step, according to all process information of this type, each process of this type is traversed, the current process is taken as the first process, and steps S204-S208 are performed on the first process.
[0063] Exemplarily, each battle process in the entire battle process information list is traversed, and the currently traversed battle process is taken as the first process, and the following steps S204-S208 are processed.
[0064] Step S204: Determine whether the first process is an unavailable process according to the unavailable process information.
[0065] In this embodiment, if the unavailable process information does not include the information of the process, it means that the process does not belong to the unavailable process, and step S205 is executed to add the process to the candidate process;
[0066] If the unavailable process information contains the information of the process, it means that the process is an unavailable process, and step S206 is executed.
[0067] Exemplarily, for the battle process, based on the unavailable battle process information list, whether the unavailable battle process information list contains information of the first process; if the unavailable battle process information list contains information of the first process, it is determined that the first process belongs to an unavailable process; if the unavailable battle process information list does not contain information of the first process, it is determined that the first process does not belong to an unavailable process.
[0068] Step S205: If it is determined that the first process is not an unavailable process, the first process is added to the candidate processes.
[0069] Exemplarily, a candidate queue may be maintained, and if it is determined that the first process does not belong to the unavailable process, the first process may be added to the candidate queue.
[0070] After the first process is added to the candidate process, if all processes of this type are traversed, the traversal ends, and step S210 and subsequent steps are performed. If there are still processes of this type that have not been traversed, the traversal is not completed, and step S203 is continued to traverse other processes.
[0071] Step S206: If it is determined that the first process is an unavailable process, the interval between the current time and the unavailable timestamp of the first process is calculated.
[0072] In this embodiment, if the first process is an unavailable process, the current availability of the first process is further verified through the unavailable timestamp of the first process.
[0073] Step S207: determine whether the interval duration is greater than a preset threshold.
[0074] If the interval duration is greater than the preset threshold, it means that the first process may be an available process at present, and steps S208-S209 are executed.
[0075] If the interval is less than or equal to the preset threshold, if all processes of this type have been traversed, the traversal ends, and step S210 and subsequent steps are performed. If there are still processes of this type that have not been traversed, the traversal is not completed, and step S203 is continued to traverse other processes.
[0076] Among them, the preset threshold can be set according to the actual application scenario. For example, the preset threshold can be 1 minute, 2 minutes, 3 minutes, etc., which is not specifically limited in this embodiment.
[0077] Step S208: If the interval duration is greater than a preset threshold, the first process is added to the candidate processes.
[0078] If the interval duration is greater than a preset threshold, it indicates that the first process may be an available process currently, and the first process is added to the candidate processes.
[0079] Step S209: Delete the information of the first process in the unavailable process information.
[0080] This step is an optional step. When it is determined that the time interval between the unavailable timestamp of the process and the current time is greater than a preset threshold, the information of the process may be deleted from the unavailable process information.
[0081] After the first process is added to the candidate process, if all processes of this type are traversed, the traversal ends, and step S210 and subsequent steps are performed. If there are still processes of this type that have not been traversed, the traversal is not completed, and step S203 is continued to traverse other processes.
[0082] After the candidate processes are determined, a target process is selected from the candidate processes through steps S210-212, and after verifying that the target process is available, the target process is called.
[0083] Step S210: Select a process from the candidate processes as the second process, and verify whether the second process is available.
[0084] According to the verification result, if the second process is available, step S211 is executed.
[0085] According to the verification result, if the second process is not available, step S210 is executed.
[0086] In this embodiment, a feasible implementation method of this step is as follows:
[0087] A remote procedure call (RPC) request is sent to the second process; if a response from the second process is received, it is determined that the second process is available; if no response from the second process is received, it is determined that the second process is unavailable.
[0088] Specifically, the IP and port of the second process may be acquired from all process information, and an RPC request may be sent to the second process according to the IP and port of the second process.
[0089] In addition, in this embodiment, any method of detecting whether a process is online in the prior art (such as heartbeat detection, etc.) can be used to verify whether the second process is available, which will not be described in detail in this embodiment.
[0090] Step S211: If the second process is unavailable, use the current timestamp as the unavailable timestamp of the second process, and add the identifier of the second process and the unavailable timestamp to the unavailable process information.
[0091] If the second process is unavailable, this step adds the information of the second process to the unavailable process information, and executes step S210 and subsequent steps, selects the next process as the new second process, and verifies the availability of the new second process until the selected second process is available, takes the available second process as the target process, and calls the target process.
[0092] Step S212: If the second process is available, the second process is used as the target process and the target process is called.
[0093] The embodiment of the present invention maintains unavailable process information for a type of process to record the information of unavailable processes in the type of process. When it is necessary to call the type of process, an alternative process is determined according to the unavailable process information of the type. A target process is selected from the alternative processes, and after verifying that the target process is available, the target process is called. An available process can be selected for calling, which can avoid calling unavailable processes that may be caused by network jitter or hardware failure of the physical machine where the called process is located, thereby improving the timeliness of user request response, reducing the occurrence of abnormal situations, and having higher reliability. Furthermore, by introducing a preset time interval threshold when determining the alternative process, the abnormal process will be re-selected once it returns to normal, and has higher disaster tolerance.
[0094] Figure 3 This is a schematic diagram of the structure of the process selection device provided in the third embodiment of the present invention. The process selection device provided in the embodiment of the present invention can execute the processing flow provided in the process selection method embodiment. Figure 3 As shown, the process selection device 30 includes: an information maintenance module 301 and a process selection module 302.
[0095] Specifically, the information maintenance module 301 is used to obtain the unavailable process information of the type according to the type of the process that needs to be called.
[0096] The process selection module 302 is used to: determine an alternative process according to the unavailable process information; select a target process from the alternative processes, and call the target process after verifying that the target process is available.
[0097] The device provided in the embodiment of the present invention can be specifically used to execute the method embodiment provided in the above-mentioned embodiment 1, and the specific functions will not be repeated here.
[0098] The embodiment of the present invention maintains unavailable process information for a type of process to record the information of unavailable processes in the type of process. When the type of process needs to be called, an alternative process is determined according to the unavailable process information of the type. A target process is selected from the alternative processes, and after verifying that the target process is available, the target process is called. An available process can be selected for calling, thereby avoiding calling an unavailable process that may be caused by network jitter or hardware failure of the physical machine where the called process is located, thereby improving the timeliness of the response to user requests, reducing the occurrence of abnormal situations, and enhancing reliability.
[0099] On the basis of the above-mentioned embodiment 3, in this embodiment, the process selection module 302 is further used for:
[0100] According to the unavailable process information, if the first process does not belong to the unavailable process, the first process is added to the candidate processes, and the first process is any one of the processes of the type.
[0101] In a possible implementation, the unavailable process information includes an identifier of the unavailable process and an unavailable timestamp. The process selection module 302 is further configured to:
[0102] According to the unavailable process information, if it is determined that the first process is an unavailable process, the interval between the current time and the unavailable timestamp of the first process is calculated; if the interval is greater than a preset threshold, the first process is added to the candidate process.
[0103] In a possible implementation manner, the information maintenance module 301 is further configured to: if the interval duration is greater than a preset threshold, delete the information of the first process in the unavailable process information.
[0104] In a possible implementation, the process selection module 302 is further configured to:
[0105] Select one process from the candidate processes in turn as the second process, and verify whether the second process is available; if the second process is not available, select the next process as the new second process, and verify the availability of the new second process until the selected second process is available, take the available second process as the target process, and call the target process.
[0106] In a possible implementation manner, the information maintenance module 301 is further used to:
[0107] If the second process is unavailable, the current timestamp is used as the unavailable timestamp of the second process, and the identifier of the second process and the unavailable timestamp are added to the unavailable process information.
[0108] In a possible implementation, the process selection module 302 is further configured to:
[0109] A remote procedure call request is sent to the second process; if a response from the second process is received, it is determined that the second process is available; if no response from the second process is received, it is determined that the second process is unavailable.
[0110] In a possible implementation, the process selection module 302 is further configured to:
[0111] In response to a request for a function, a determination is made as to the type of process that needs to be invoked.
[0112] The device provided in the embodiment of the present invention can be specifically used to execute the method embodiment provided in the above-mentioned embodiment 2, and the specific functions will not be repeated here.
[0113] The embodiment of the present invention maintains unavailable process information for a type of process to record the information of unavailable processes in the type of process. When it is necessary to call the type of process, an alternative process is determined according to the unavailable process information of the type. A target process is selected from the alternative processes, and after verifying that the target process is available, the target process is called. An available process can be selected for calling, which can avoid calling unavailable processes that may be caused by network jitter or hardware failure of the physical machine where the called process is located, thereby improving the timeliness of user request response, reducing the occurrence of abnormal situations, and having higher reliability. Furthermore, by introducing a preset time interval threshold when determining the alternative process, the abnormal process will be re-selected once it returns to normal, and has higher disaster tolerance.
[0114] Figure 4 This is a schematic diagram of the structure of the process selection device provided in Embodiment 5 of the present invention. Figure 4 As shown, the device 100 includes: a processor 1001 , a memory 1002 , and a computer program stored in the memory 1002 and executable on the processor 1001 .
[0115] Among them, when the processor 1001 runs the computer program, it implements the process selection method provided by any of the above method embodiments.
[0116] The embodiment of the present invention maintains unavailable process information for a type of process to record the information of unavailable processes in the type of process. When the type of process needs to be called, an alternative process is determined based on the unavailable process information of the type. A target process is selected from the alternative processes, and after verifying that the target process is available, the target process is called. An available process can be selected for calling, which can avoid calling an unavailable process that may be caused by network jitter or hardware failure of the physical machine where the called process is located, thereby improving the timeliness of the response to user requests, reducing the occurrence of abnormal situations, and enhancing reliability.
[0117] In addition, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the process selection method provided by any of the above method embodiments is implemented.
[0118] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0119] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0120] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0121] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0122] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0123] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed by the present invention. The description and examples are to be considered exemplary only, and the true scope and spirit of the present invention is indicated by the following claims.
[0124] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A process selection method, characterized in that: Applied to the game process, including: In response to a user's request for a certain game function, determine the type of process to be called, obtain a list of all process information of the type and a list of unavailable process information, wherein the unavailable process information includes an identifier of the unavailable process and an unavailable timestamp; Traversing all process information lists of the type, taking the currently traversed process as the first process, and if the unavailable process information does not contain information of the first process and the first process does not belong to the unavailable process, adding the first process to the candidate processes, wherein the first process is any one of the processes of the type; If the unavailable process information includes the information of the first process, it is determined that the first process is an unavailable process, and the interval between the current time and the unavailable timestamp of the first process is calculated; If the interval duration is greater than a preset threshold, the first process is added to the candidate processes; one process is selected from the candidate processes in turn as the second process, and whether the second process is available is verified; If the second process is not available, selecting a next process as a new second process, and verifying the availability of the new second process, until the selected second process is available, taking the available second process as a target process, and calling the target process; After verifying the availability of the second process, the method further includes: If the second process is unavailable, the current timestamp is used as the unavailable timestamp of the second process, and the identifier of the second process and the unavailable timestamp are added to the unavailable process information.
2. The method according to claim 1, characterized in that The method further comprises: If the interval duration is greater than a preset threshold, the information of the first process in the unavailable process information is deleted.
3. The method according to claim 1, characterized in that The verifying the availability of the second process includes: Sending a remote procedure call request to the second process; If a response from the second process is received, determining that the second process is available; If no response from the second process is received, it is determined that the second process is unavailable.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: In response to a request for a function, a determination is made as to the type of process that needs to be invoked.
5. A process selection device, characterized in that: include: An information maintenance module, for responding to a user's request for a certain game function, determining the type of process to be called, obtaining a list of all process information of the type and a list of unavailable process information, wherein the unavailable process information includes an identifier of the unavailable process and an unavailable timestamp; Process selection module, used to: Traversing all process information lists of the type, taking the currently traversed process as the first process, and if the unavailable process information does not contain information of the first process and the first process does not belong to the unavailable process, adding the first process to the candidate processes, wherein the first process is any one of the processes of the type; If the unavailable process information includes the information of the first process, it is determined that the first process is an unavailable process, and the interval between the current time and the unavailable timestamp of the first process is calculated; If the interval duration is greater than a preset threshold, adding the first process to the candidate process; Select one process from the candidate processes in turn as the second process, and verify whether the second process is available; if the second process is not available, select the next process as the new second process, and verify the availability of the new second process, until the selected second process is available, take the available second process as the target process, and call the target process; The information maintenance module is also used for: If the second process is unavailable, the current timestamp is used as the unavailable timestamp of the second process, and the identifier of the second process and the unavailable timestamp are added to the unavailable process information.
6. A process selection device, characterized in that: include: A processor, a memory, and a computer program stored on the memory and executable on the processor; Wherein, when the processor runs the computer program, the method according to any one of claims 1 to 4 is implemented.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
