Server device and program
The server device balances load by associating client identifiers with priority and index values, enabling efficient distribution of processing requests across multiple servers, addressing inefficient processing in communication environments.
Patent Information
- Application Number
- JP2023015359
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2023-02-03
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2043-02-03
AI Technical Summary
In communication environments where client terminals send processing requests without specifying a server device, all connected server devices receive and process the request, leading to inefficient processing due to lack of load balancing and shared processing among multiple servers.
A server device equipped with a receiving, executing, generating, sharing, and determining means to associate client identifiers with priority and index values, allowing load-balanced distribution of processing requests across multiple servers based on current load status and random number indices.
Enables efficient load balancing and shared processing of requests among multiple server devices, optimizing resource utilization and reducing processing inefficiencies.
Smart Images

Figure 0007801270000001 
Figure 0007801270000002 
Figure 0007801270000003
Abstract
Description
[Technical Field]
[0001] The present invention relates to a server device and a program. [Background technology]
[0002] In recent years, with the spread of IoT (Internet of Things) technology, devices that can be connected to a network have become widespread. For example, it is becoming common for multiple client terminals, such as sensor devices and POS terminals, installed in a store to be connected to multiple server devices via a network.
[0003] Furthermore, there are conventional communication methods that allow data to be sent without specifying a destination, such as the DDS (Data Distribution Service) communication method. In a communication environment that uses such a communication method, a client terminal can request a server device to process data without specifying the server device, making it easy to add or remove client terminals or server devices.
[0004] However, in the above-mentioned communication environment, when a processing request is sent from a client terminal, all server devices connected to the same network receive the processing request, and the processing is executed by each server device. As a result, the processing cannot be shared among multiple server devices, resulting in the problem of inefficient processing. Summary of the Invention [Problem to be solved by the invention]
[0005] The problem to be solved by the present invention is to provide a server device and a program that are capable of dividing and processing processing requests from a plurality of client terminals among a plurality of server devices. [Means for solving the problem]
[0006] A server device according to an embodiment includes a receiving means, an executing means, a generating means, a sharing means, a determining means, and a controlling means. The receiving means receives a processing request from a client terminal connected via a network. The executing means executes processing related to the processing request. The generating means generates a dataset that associates a first identifier for identifying the client terminal, a priority according to the current load status of the server device, and an index value consisting of a random number. The sharing means shares the dataset generated by the generating means with datasets generated by other server devices so that they can be referenced mutually. The determining means determines a server device that will be responsible for the processing request from the client terminal based on the priority and the index value included in each of the datasets. If the server device determined by the determining means is the server device, the controlling means causes the executing means to execute processing related to the processing request. [Brief explanation of the drawings]
[0007] [Figure 1] FIG. 1 is a diagram illustrating an example of a data processing system according to an embodiment. [Figure 2] FIG. 2 is a diagram illustrating an example of a hardware configuration of a server device according to the embodiment. [Figure 3] FIG. 3 is a diagram illustrating an example of a functional configuration of the server device according to the embodiment. [Figure 4] FIG. 4 is a diagram for explaining an example of data processing in the data processing system according to the embodiment. [Figure 5] FIG. 5 is a diagram for explaining an example of data processing in the data processing system according to the embodiment. [Figure 6] FIG. 6 is a diagram for explaining an example of data processing in the data processing system according to the embodiment. [Figure 7] FIG. 7 is a flowchart illustrating an example of data processing executed by the server device according to the embodiment. [Figure 8] FIG. 8 is a diagram illustrating the operation of the server device according to the first modification. DETAILED DESCRIPTION OF THE INVENTION
[0008] The server device and the program according to the embodiment will be described below with reference to the drawings. In the embodiment described below, an example in which the server device and the program are applied to a system installed in a store such as a supermarket will be described, but the system to which the server device and the program are applied is not limited to this embodiment.
[0009] Fig. 1 is a diagram illustrating an example of a data processing system according to an embodiment. As shown in Fig. 1, the data processing system 1 includes a plurality of client devices 10 and a plurality of server devices 20. The client devices 10 and the server devices 20 are communicably connected via a wired or wireless network N.
[0010] It should be noted that the configuration of the data processing system 1 is not limited to the example in Fig. 1. The number of client devices 10 and server devices 20 can be increased or decreased as desired depending on, for example, changes in the system configuration.
[0011] The client device 10 is an example of a client terminal. The client device 10 is installed in a store. For example, the client device 10 is a sensor device such as an imaging device, and acquires data related to the store. As one example, the client device 10 is a surveillance camera installed in the store, and acquires image data of a predetermined area in the store. As another example, the client device 10 is a reading device that reads code symbols or discount labels attached to products, and acquires image data of the products to be read. As another example, the client device 10 is a product sales data processing device such as a POS terminal, and acquires data related to commercial transactions.
[0012] Furthermore, the client device 10 transmits the acquired data to the network N, thereby making a processing request for the data to the server device 20. Here, the client device 10 transmits the data processing request to the network N without specifying a destination (server device 20). Note that there is no particular restriction on the communication method used to transmit the processing request, and it is possible to use a known communication method such as a DDS communication method or a broadcast method, for example.
[0013] The server device 20 is an example of a server device. The server device 20 receives a processing request transmitted from the client device 10 and executes a predetermined process on the data of the processing request. Here, the multiple server devices 20 may constitute a cloud (cloud computing).
[0014] In the above-described data processing system 1, it is preferable that the server device 20 has a hardware configuration with higher processing power than the client device 10, such as a high-performance processor or a hardware configuration specialized for image processing. As a result, in the data processing system 1, the server device 20 can perform processes such as image processing and image recognition, which would otherwise impose a high processing load on the client device 10.
[0015] Next, we will explain the configuration of the main devices that make up the data processing system 1. Fig. 2 is a diagram showing an example of the hardware configuration of the server device 20. As shown in Fig. 2, the server device 20 includes a CPU (Central Processing Unit) 21, a ROM (Read Only Memory) 22, and a RAM (Random Access Memory) 23.
[0016] The CPU 21 is an example of a processor, and performs overall control of each unit of the server device 20. The ROM 22 stores various programs. The RAM 23 is a workspace where programs and various data are developed.
[0017] The CPU 21, ROM 22, and RAM 23 are connected via a bus or the like to constitute a computer-configured control unit 200. In the control unit 200, the CPU 21 loads a program stored in the storage unit 24 or the like into the RAM 23, and operates in accordance with the loaded program to execute various processes.
[0018] The server device 20 also includes a storage unit 24, a communication unit 25, and the like.
[0019] The storage unit 24 is an auxiliary storage device such as a flash memory, SSD, or HDD (Hard Disk Drive). The storage unit 24 stores various programs executable by the CPU 21 and various setting information. The storage unit 24 also stores a management table 241 for storing and managing the client devices 10 for which the server device 20 is responsible for processing. The data configuration of the management table 241 will be described later.
[0020] The communication unit 25 is a wired or wireless communication interface connectable to the network N. The communication unit 25 transmits and receives various data to and from the client device 10 and other server devices 20 connected to the network N.
[0021] Next, a description will be given of the functional configuration of the server device 20. Fig. 3 is a diagram showing an example of the functional configuration of the server device 20. As shown in Fig. 3, the server device 20 includes, as its functional configuration, a processing request receiving unit 201, a processing execution unit 202, and an execution control unit 203. Specifically, the control unit 200 (CPU 21) of the server device 20 executes a program stored in the ROM 22 or the storage unit 24 to realize the above-mentioned functional configuration.
[0022] In this embodiment, the functional configuration of the server device 20 is a software configuration realized by cooperation between the processor of the server device 20 and a program, but this is not limited to this, and the functional configuration may also be a hardware configuration in which part or all of the functional configuration is realized by a dedicated circuit or the like.
[0023] The processing request receiving unit 201 is an example of a receiving means. The processing request receiving unit 201 receives processing requests from the client device 10 connected to the network N. The processing request receiving unit 201 stores the received processing requests in a storage area secured in the RAM 23 or the storage unit 24. Here, the processing requests stored in the processing waiting memory are processing requests that have not yet been processed by the processing execution unit 202, which will be described later.
[0024] In addition to the data to be processed, the processing request includes or associates with an identifier (hereinafter also referred to as a client ID) that can identify the client device 10 that made the request. Here, the client ID is an example of a first identifier. The client ID can be, for example, an IP address or a host name.
[0025] The processing execution unit 202 is an example of an execution means. The processing execution unit 202 executes processing related to the processing request accepted by the processing request acceptance unit 201. Specifically, under the control of the execution control unit 203, the processing execution unit 202 reads the processing request to be executed from a storage area and executes a predetermined process on the data of the processing request.
[0026] Here, the content of the processing executed by the processing execution unit 202 is not particularly limited. For example, the processing execution unit 202 may recognize the state and behavior of a customer from data obtained by capturing images of the inside of a store by using a known technology such as image recognition technology. Furthermore, for example, the processing execution unit 202 may perform processing to detect marks such as discount stickers attached to products from data obtained by capturing images of the products by using a known technology such as image recognition technology, and recognize the discount amount indicated by the marks. Furthermore, for example, the processing execution unit 202 may perform processing to analyze the purchasing behavior of customers from data related to commercial transactions.
[0027] The process execution unit 202 also outputs the processing results of the process request to a predetermined output destination. The output destination of the processing results is not particularly limited, and may be configured to store the results in the storage unit 24, or to output the results to a display device or printer (not shown). For example, the process execution unit 202 may also be configured to transmit the processing results of the process request to the client device 10 that made the request.
[0028] The execution control unit 203 is an example of a generating means, a sharing means, a determining means, a control means, and an updating means. The execution control unit 203 determines the client device 10 for which the server device 20 is to handle processing by collaborating with other server devices 20. Then, when a processing request is received from the client device 10 for which the server device 20 is to handle processing, the execution control unit 203 causes the processing execution unit 202 to execute the processing related to the processing request.
[0029] Specifically, the execution control unit 203 uses the management table 241 to determine the client devices 10 that are to be managed by itself and the other server devices 20 in cooperation with the other server devices 20. An example of the operation of the execution control unit 203 will be described below with reference to Figures 4 to 6. Figures 4 to 6 are diagrams for explaining an example of data processing in the data processing system 1.
[0030] Here, the client devices 10 with client IDs 1 to 4 correspond to the four client devices 10 shown in FIG. 1. Also, the server devices 20 with server IDs 1 and 2 correspond to the two server devices 20 shown in FIG. 1. Here, the server ID is an identifier for identifying each server device 20, and is an example of a second identifier. The server ID may be, for example, an IP address or a host name. Also, the management table 241 shown in the figure shows an example of the data configuration of the management table 241 stored in the server devices 20 with server IDs 1 and 2.
[0031] In the following description, the client devices 10 with client IDs 1 to 4 will be represented by the client IDs 1 to 4, and the server devices 20 with server IDs 1 and 2 will be represented by the server IDs 1 and 2.
[0032] 4, when a processing request is sent from client ID: 1, the processing request receiving unit 201 receives the processing request in each of server IDs: 1 and 2. In each of server IDs: 1 and 2 that has received the processing request, the execution control unit 203 determines whether or not the requesting client ID: 1 is registered in the management table 241.
[0033] If client ID:1 is not registered in the management table 241, the execution control unit 203 generates a data set that associates the requesting client ID:1, the priority in its own server device 20, an index value consisting of a random number, and an update date and time indicating the date and time when the processing request was received, and registers it in the management table 241.
[0034] Here, the priority is set to a value according to the current load status of the server device 20. Specifically, the priority is set to a value according to the number of client devices 10 for which the server device 20 is responsible for processing, and the fewer the number of devices that the server device 20 is responsible for, the higher the priority is set. Fig. 4 shows an example in which the number of devices that each of server IDs: 1 and 2 is responsible for is 0, and the highest priority "1" is set.
[0035] The index value is used when the priority is the same between the server device 20 and another server device 20. Fig. 4 shows an example in which the index value of server ID: 1 is set to "001" and the index value of server ID: 2 is set to "999". Note that there is no particular restriction on the random number algorithm used to generate the index value, but it is preferable to generate random numbers with a number of digits that will prevent the server devices 20 from having the same value.
[0036] Next, the execution control unit 203 shares the management table 241 held by its own server device 20 with the management table 241 held by the other server device 20 so that they can be mutually referenced. Here, the sharing method is not particularly limited, and for example, the management table 241 may be transmitted and received between the server devices 20 so that they can be mutually referenced. Note that in this embodiment, the management table 241 is shared so that it can be referenced, but data sets generated by each of the server devices 20 may also be shared so that they can be mutually referenced.
[0037] Next, the execution control unit 203 determines which server device 20 should be in charge of the processing request for client ID: 1, based on the priority and index values set by itself and the other server devices 20. Specifically, the execution control units 203 of server IDs: 1 and 2 compare the priorities set by itself and the other server devices 20, and determine the server device 20 that should be in charge of processing client ID: 1 based on the comparison result (high or low priority). In Fig. 4, since both have the highest priority of "1", the execution control units 203 of server IDs: 1 and 2 determine which server device should be in charge of processing client ID: 1 based on the acquired index value.
[0038] Specifically, the execution control unit 203 of server ID: 1, 2 compares the index values set in its own server device 20 and the other server devices 20, and determines the server device 20 that will be in charge of processing the client ID based on the comparison result. For example, if it is predetermined that the server device 20 with the smallest index value is in charge, in FIG. 4, the index value of server ID: 1 is lower than the index value of server ID: 2, so server ID: 1 is in charge of processing client ID: 1. It is assumed that the rules for determining the server device to be in charge are common to each of the server devices 20.
[0039] In this case, the execution control unit 203 of server ID: 1 sets client ID: 1 as the client in charge of processing that is handled by its own server device 20. For example, the execution control unit 203 of server ID: 1 includes server ID: 1 of its own server device 20 in the data set of client ID: 1 and registers it in the management table 241, thereby setting it as the client in charge.
[0040] Furthermore, the execution control unit 203 of server ID: 2 sets client ID: 1 as a non-assigned client for which its own server device 20 is not responsible for processing. For example, the execution control unit 203 of server ID: 2 sets server ID: 1 as a non-assigned client by including it in the data set of client ID: 1 and registering it in the management table 241. In Fig. 4, the data set of the non-assigned client is indicated by hatching (the same applies to Figs. 5 and 6).
[0041] It should be noted that the method of setting the assigned client and non-assigned client is not limited to the above example. For example, the execution control unit 203 of server ID: 1 that is in charge of processing client ID: 1 may be configured to set the assigned client by storing a dataset related to client ID: 1 in the management table 241. Also, for example, the execution control unit 203 of server ID: 2 that is not in charge of processing client ID: 1 may be configured to set the non-assigned client by deleting a dataset related to client ID: 1 from the management table 241. Also, for example, a flag value that can identify assigned / non-assigned may be attached to the dataset to set whether the client is the assigned client for its own client device 10.
[0042] Furthermore, the execution control unit 203 of server ID: 1, which is in charge of processing client ID: 1, causes the processing execution unit 202 to execute the processing related to the processing request from client ID: 1. On the other hand, the execution control unit 203 of server ID: 2, which is not in charge of processing client ID: 1, prevents the processing execution unit 202 from executing the processing request from client ID: 1 by, for example, discarding the processing request.
[0043] Next, as shown in Fig. 5, when a processing request is sent from client ID: 2, the processing request receiving unit 201 of each of server IDs: 1 and 2 receives this processing request. At this time, it is assumed that the management tables 241 of server IDs: 1 and 2 are in the state shown in Fig. 4. Since neither client ID: 2 is registered, the execution control units 203 of server IDs: 1 and 2 execute the above-mentioned process related to the decision on who will be in charge.
[0044] Specifically, the execution control unit 203 of server IDs: 1 and 2 generates a data set that associates a priority according to the number of client devices 10 managed by its own server device 20 with an index value and an update date and time, and registers the data set in the management table 241. Here, for server ID: 1, one device with client ID: 1 is set as the managed client, so a priority of "2" is set. Also, for server device 20 of server ID: 2, there is no managed client, so a priority of "1" is set.
[0045] Next, the execution control units 203 of server IDs: 1 and 2 share the management table 241, compare the priorities set for themselves and the other server devices 20 for client ID: 2, and determine the server device 20 to be responsible based on the comparison results.
[0046] Here, assuming that the management table 241 for server IDs: 1 and 2 is in the state shown in Figure 5, the priority set for server ID: 2 is higher than the priority set for server ID: 1, so server ID: 2 will be responsible for processing client ID: 2.
[0047] In this case, the execution control unit 203 of server ID: 2 sets client ID: 2 as a client in charge of its own server device 20, as shown in Fig. 5. On the other hand, the execution control unit 203 of server ID: 1 sets client ID: 2 as a client not in charge of its own server device 20, as shown in Fig. 5.
[0048] Furthermore, the execution control unit 203 of server ID:2, which is in charge of processing client ID:2, causes the processing execution unit 202 to execute the processing related to the processing request from client ID:2. On the other hand, the execution control unit 203 of server ID:1, which is not in charge of processing client ID:2, prevents the processing execution unit 202 from executing the processing request from client ID:2 by, for example, discarding the processing request.
[0049] In this way, each time the execution control unit 203 receives a processing request from a new client device 10, it sets a priority and an index value according to the number of client devices 10 that its own server device 20 is responsible for. Then, the execution control unit 203 compares the priorities set for its own server device 20 and those set for the other server devices 20, and determines the server device 20 with the higher priority as the responsible server. Furthermore, if the priorities are the same, the execution control unit 203 determines one server device 20 as the responsible server based on the comparison result of the index values set for its own server device 20 and those set for the other server devices 20.
[0050] Through the above-described process for determining the assignment of clients, the server devices 20 are assigned client IDs of the client devices 10 they are responsible for according to their load conditions. For example, if the number of client devices 10 that each server device 20 is responsible for is zero, each server device 20 is assigned one client device 10 to be assigned to it. Also, for example, if, in the initial state, one server device 20 is responsible for five client devices 10 and the other server device 20 is responsible for zero client devices 10, new client devices 10 are assigned to the other server device 20 until the number of client devices 10 that the other server device 20 is responsible for reaches five. Therefore, the above configuration makes it possible to level the number of client devices 10 that multiple server devices 20 are responsible for.
[0051] 5, when processes are sequentially transmitted from client IDs 3 and 4, the server device 20 that will be in charge of client IDs 3 and 4 is determined by the above-described process related to the in-charge determination. Then, in the management table 241 stored in each of the server IDs 1 and 2, the client IDs of the client IDs 1 to 4 that the server device 20 is in charge of are stored, as shown in FIG. 6. Specifically, the client IDs of the client devices 10 that the server device 20 is in charge of processing are registered in the management table 241 in order of priority.
[0052] When the execution control unit 203 of the server IDs 1 and 2 receives a processing request from a client device 10 with a client ID registered in the management table 241, it determines based on the management table 241 whether the client is the one for which the server device 20 is responsible.
[0053] If the requesting client device 10 is the responsible client of its own server device 20, the execution control unit 203 causes the process execution unit 202 to execute the accepted processing request. If the requesting client device 10 is not the responsible client of its own server device 20, the execution control unit 203 suppresses execution by the process execution unit 202 by, for example, discarding the accepted processing request. Note that the execution control unit 203 updates the update date and time of the corresponding data entry to the date and time when the processing request was accepted, regardless of whether the requesting client device 10 is the responsible client or not.
[0054] Next, an example of data processing performed by the server device 20 will be described with reference to Fig. 7. Fig. 7 is a flowchart showing an example of data processing executed by the server device 20.
[0055] First, the processing request receiving unit 201 waits until it receives a processing request from the client device 10 (step S11; No). When the processing request receiving unit 201 receives a processing request (step S11; Yes), the process proceeds to step S12.
[0056] In step S12, the execution control unit 203 determines whether or not the client ID of the requesting client device 10 is registered in the management table 241. If it is determined that the client ID is not registered in the management table 241 (step S12; No), the execution control unit 203 sets a priority, a random number, etc. to determine the server device 20 in charge (step S13), and stores the data together with the client ID of the requesting client device 10 in the management table 241.
[0057] Next, the execution control unit 203 shares the management table 241 with the other server devices 20, and compares the priorities and index values set for the own server device 20 and the other server devices 20 (step S14). Here, the execution control unit 203 determines whether the priorities are the same, and if it determines that they are the same (step S15; Yes), the process proceeds to step S16. In step S16, the execution control unit 203 determines whether the index value set for the own server device 20 is lower than the index value set for the other server devices 20 (step S16).
[0058] If it is determined that the index value is lower than that of the other server device 20 (step S16; Yes), the execution control unit 203 sets the client ID of the requesting client device 10 as a client in charge of its own server device 20 (step S17), and proceeds to step S21. If it is determined that the index value of the other server device 20 is lower (step S16; No), the execution control unit 203 sets the client ID of the requesting client device 10 as a client not in charge of its own server device 20 (step S18), and proceeds to step S22.
[0059] Also, in step S15, if it is determined that the priorities are different (step S15; No), the execution control unit 203 determines whether the priority set in its own server device 20 is higher than the priority set in the other server device 20 (step S19).
[0060] If it is determined that the priority is higher than that of the other server device 20 (step S19; Yes), the execution control unit 203 sets the client ID of the requesting client device 10 as a client in charge of its own server device 20 (step S17), and then proceeds to step S21. If it is determined that the priority of the other server device 20 is higher (step S19; No), the execution control unit 203 sets the client ID of the requesting client device 10 as a client not in charge of its own server device 20 (step S18), and then proceeds to step S22.
[0061] Returning to step S12, if the executive control unit 203 determines that the client has been registered in the management table 241 (step S12; Yes), it determines whether the client is the one that the server device 20 is responsible for (step S20).
[0062] If the client is the responsible client (step S20; Yes), the execution control unit 203 controls the process execution unit 202 to execute the process related to the process request (step S21), and returns the process to step S11. On the other hand, if the client is not the responsible client (step S20; No), the execution control unit 203 discards the process request (step S22), and then returns the process to step S11.
[0063] As described above, when the server device 20 receives a processing request from a new client device 10, it generates a data set that associates the client ID, a priority according to the current load status of its own server device 20, and an index value consisting of a random number, and stores the data set in the management table 241. The server device 20 also mutually references the management table 241 and the management tables 241 of the other shared server devices 20, and determines the server device 20 that will be in charge of the processing request based on the priority and the index value. Then, if the server device determined by the determination means is its own server device 20, the server device 20 executes the processing related to the processing request.
[0064] As described above, the server device 20 of the present embodiment determines the server device 20 that will be in charge of a client device 10 by using priorities according to the current load conditions of the server device 20 itself and the other server devices 20 and index values that differ among the server devices 20. As a result, even if the load conditions of the server devices 20 are the same, it is possible to determine any one of the server devices 20 as the server device 10. Furthermore, if the load conditions of the server devices 20 are different, it is possible to level the number of client devices 10 that the multiple server devices 20 are in charge of. Therefore, even if the server device 20 receives processing requests from multiple client devices 10 in a communication environment such as a DDS communication system, the server device 20 can share and process the requests among the multiple server devices 20.
[0065] The above-described embodiment can be modified as needed by partially changing the configuration or functions of each of the above-described devices. Therefore, several modifications of the above-described embodiment will be described below as other embodiments. The following mainly focuses on differences from the above-described embodiment, and detailed descriptions of commonalities with the content already described will be omitted. The modifications described below may be implemented individually or in appropriate combination.
[0066] (Variation 1) In this modification, an example of the operation of the server device 20 when the number of client devices 10 connected to the network N changes will be described.
[0067] For example, there may be cases where a new client device 10 is added to the network N or an existing client device 10 is disconnected from the network N due to a change in the network configuration or the like. In the former case, the server device 20 in charge of the new client device 10 can be determined in a leveled manner among the multiple server devices 20 by the processing of the above-described embodiment. On the other hand, in the latter case, for example, the following processing can be performed on each server device 20 to maintain the allocation of the client devices in charge.
[0068] Specifically, when the execution control unit 203 of the server device 20 detects that an existing client device 10 has been disconnected from the network N, it determines whether or not the client device 10 is a client in charge of its own server device 20. If the client device 10 is a client in charge, the execution control unit 203 recalculates the priorities of the clients in charge registered in the management table 241 other than the client in charge that has been disconnected from the network N, thereby updating the management table 241 so that the priorities become consecutive numbers starting from 1.
[0069] Here, an example of the operation of the execution control unit 203 when the client device 10 is disconnected from the network N will be described with reference to Fig. 8. Fig. 8 is a diagram for explaining the operation of the server device 20 according to the first modification, and shows an example of the data configuration of the management table 241. Note that the management table 241 in Fig. 8 shows an example in which six client devices 10 with client IDs 1 to 6 are registered. Also, for the sake of convenience of explanation, it is assumed that all the client devices 10 are assigned clients, and the server IDs of the assigned server devices 20 are omitted.
[0070] 8, it is assumed that the client device 10 with client ID: 3 among the client IDs: 1 to 6 is disconnected from the network N. In this case, the execution control unit 203 increases the priority by 1 by subtracting 1 from the priority values of the client IDs: 4 to 6, which are set to priorities lower than that of the client ID: 3. As a result, the priorities of the clients in charge registered in the management table 241 become consecutive numbers starting from 1.
[0071] Furthermore, by performing the above processing, when a new client device 10 is connected to the network N, a priority can be set that reflects the load status of the server device 20, so that the server device 20 responsible for the client device 10 can be assigned in a leveled manner.
[0072] When the execution control unit 203 of each server device 20 detects that an existing client device 10 (for example, client ID: 3) has been disconnected from the network N, the execution control unit 203 may delete the data set related to the client device 10 from the management table 241. As a result, for example, when client ID: 3 is disconnected from the network N and then reconnected, the server device 20 in charge of client ID: 3 can be allocated in a leveled manner by processing similar to that of the above-described embodiment.
[0073] Note that the method for detecting that a client device 10 has been disconnected from the network N is not particularly limited, and various methods can be employed. For example, the control unit 200 may determine whether or not a client device 10 is disconnected from the network N by communicating with each of the client devices 10 stored in the management table 241 at regular intervals to confirm whether the client device 10 is still alive. Furthermore, for example, the control unit 200 may determine that a client device 10 is disconnected from the network N if a predetermined period has passed since the current date and time, based on the update date and time of the client device 10 stored in the management table 241.
[0074] (Variation 2) In the above-described first modification, an example of operation related to an increase or decrease in the number of client devices 10 has been described. In this modification, an example of operation when the number of server devices 20 is increased or decreased will be described.
[0075] For example, due to reasons such as a change in the network configuration, a new server device 20 may be added to the network N, or an existing server device 20 may be disconnected from the network N. In such cases, each of the server devices 20 connected to the network N can maintain the data processing system 1 by performing, for example, the following processing.
[0076] Specifically, when the execution control unit 203 of a server device 20 remaining in the network N detects that another server device 20 has been disconnected from the network N, the execution control unit 203 newly sets priorities and index values for the data sets related to the clients in charge of the other server device 20. Then, the execution control unit 203 performs the above-mentioned process related to the responsibility determination among the server devices 20 remaining in the network N, thereby redistributing the client devices 10 that were in charge of the server device 20 that was disconnected from the network N.
[0077] As a result, even after some of the server devices 20 are disconnected from the network N, the data processing system 1 can be maintained by the remaining server devices 20. Furthermore, if there are multiple remaining server devices 20, the number of client devices 10 handled by these server devices 20 can be leveled out.
[0078] Until the server device 20 in charge is determined, each of the remaining server devices 20 may execute the processing request from the client device 10 that was previously handled by the server device 20 that has been disconnected from the network N.
[0079] Note that the method for detecting that a server device 20 has been disconnected from the network N is not particularly limited, and various methods can be employed. For example, the execution control unit 203 may determine whether or not a server device 20 is disconnected from the network N by communicating with each of the server devices 20 stored in the management table 241 at regular intervals to confirm whether the server device 20 is still alive. Furthermore, for example, by sharing the processing status of processing requests between the server devices 20, a server device 20 that does not execute processing for a predetermined time despite receiving a processing request from a client that it is responsible for may be determined to be disconnected from the network N. In this case, even when each server device 20 receives a processing request from a client that it is not responsible for, it does not immediately discard the processing request but retains the processing request for a predetermined time.
[0080] Furthermore, when another server device 20 is added to the network, the execution control unit 203 of the existing server device 20 connected to the network N, for example, clears the management table 241 and reconstructs the management table 241. In this case, a responsible client can be determined among the server devices 20 including the newly added server device 20.
[0081] As another example of operation when another server device 20 is added to the network, each of the existing server devices 20 may share the management table 241 with the added server device 20, thereby notifying the relationship between the existing server device 20 and the responsible client. In this case, the newly added server device 20 will not have a responsible client until a new client device 10 is added, but each time a new client device 10 is added, the responsibility is assigned preferentially, so that the responsibility can be leveled from a medium- to long-term perspective.
[0082] Note that there is no particular limitation on the method for detecting that the server device 20 has been connected to the network N, and various methods can be adopted. For example, the connection of a new server device 20 may be detected by communication between the server devices 20 to notify each other of their existence or aliveness.
[0083] The programs executed by each device in the above-described embodiments are provided in a state where they are pre-installed in a ROM, a storage unit, etc. The programs executed by each device in the above-described embodiments may be provided by being recorded in an installable or executable format on a computer-readable recording medium such as a CD-ROM, a flexible disk (FD), a CD-R, or a digital versatile disk (DVD).
[0084] Furthermore, the programs executed by each device in the above-described embodiments may be stored on a computer connected to a network such as the Internet and provided by being downloaded via the network. Also, the programs executed by each device in the above-described embodiments may be provided or distributed via a network such as the Internet.
[0085] Although the embodiments of the present invention have been described above, these embodiments are presented as examples and are not intended to limit the scope of the invention. These novel embodiments and their modifications can be embodied in various other forms, and various omissions, substitutions, changes, and combinations can be made without departing from the spirit of the invention. These embodiments and their modifications are included within the scope and spirit of the invention, and are also included in the inventions and their equivalents as defined in the claims. [Explanation of symbols]
[0086] 1. Data Processing System 10 Client Device 20 Server device 200 control section 201 Processing Request Reception Department 202 Processing execution unit 203 Execution Control Unit 241 Management Table [Prior art documents] [Patent documents]
[0087] [Patent Document 1] Patent Publication No. 2021-051501
Claims
1. a receiving means for receiving a processing request from a client terminal connected to a network; an execution means for executing a process related to the processing request; a generating means for generating a data set that associates a first identifier for identifying the client terminal, a priority according to a current load status of the client terminal's own server device, and an index value consisting of a random number; a sharing means for sharing the data set generated by the generating means with a data set generated by another server device so that they can be referenced by each other; a determination means for determining a server device that will be in charge of a processing request from the client terminal based on the priority and the index value included in each of the data sets; a control means for causing the execution means to execute the process related to the process request when the server device determined by the determination means is the server device itself; A server device comprising:
2. the generating means generates a data set including a priority set according to the number of client terminals for which the server device is responsible for processing; The server device according to claim 1 .
3. the determining means stores a second identifier for identifying the server device in charge of the processing request in the data set related to the first identifier of the client terminal that transmitted the processing request; the control means, when receiving a processing request from a client terminal corresponding to the first identifier associated with the second identifier of the server device, causes the execution means to execute the processing related to the processing request; The server device according to claim 1 .
4. and an update means for, when a client terminal is disconnected from the network, increasing by one the priority of a data set that has a lower priority set than the priority associated with the first identifier of the client terminal, based on the priority associated with the first identifier of the client terminal. The server device according to claim 3 .
5. when another server device is disconnected from the network, the generation means regenerates the data set for each first identifier associated with the second identifier of the other server device; the determining means determines, among the server devices remaining on the network, a server device that will be in charge of processing requests from client terminals corresponding to each of the first identifiers, based on the data set regenerated by the generating means. The server device according to claim 3 .
6. The computer of the server device, A receiving means for receiving a processing request transmitted from a client terminal; a generating means for generating a data set that associates an identifier for identifying the client terminal, a priority according to the current load status of the server device, and an index value consisting of a random number; a sharing means for sharing the data set generated by the generating means with a data set generated by another server device so that they can be referenced by each other; a determination means for determining a server device that will be in charge of a processing request from the client terminal based on the priority and the index value included in each of the data sets; an execution means for executing the process related to the process request when the server device determined by the determination means is the server device itself; A program to make it function as such.
Citation Information
Patent Citations
Access control method and device
JP2002512411A
Load distributor and load distributing method
JP2004118629A
Information processing device, program and notifying method
JP2021051501A