A method and system for managing warehouse information
By dynamically adjusting the weighting coefficient of service instances, the problem of insufficient scalability and maintainability in the face of large amounts of data and complex scenarios is solved, and more efficient and accurate warehouse information management is achieved.
Patent Information
- Application Number
- CN202210206022.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-28
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2042-02-28
AI Technical Summary
When traditional warehouse management systems face large amounts of data and complex scenarios, they lack scalability and maintainability, resulting in low management efficiency and accuracy.
The warehouse information is managed based on dynamic adjustment of the weighting coefficient of the service instance. The specific steps include receiving user requests, determining the target warehouse function service, obtaining the operating status indicator value and basic indicator value of the service instance, dynamically adjusting the weight coefficient, calculating the requested allocation indicator value, and distributing the user request to the target service instance for processing.
It improves the efficiency and accuracy of warehouse information management, optimizes the scalability and maintainability of the warehouse management system, and can better adapt to complex warehouse scenarios.
Smart Images

Figure CN114612037B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to computer technology, and in particular, to a method and a system for managing warehouse information. Background Art
[0002] With the continuous development of enterprise scale, the types and quantities of materials managed in the warehouse are increasing, and the frequency of inbound and outbound is surging. Warehouse management operations have become very complex and diversified. The traditional manual warehouse operation mode and data collection method are difficult to meet the requirements of rapid and accurate warehouse management, seriously affecting the operation efficiency of enterprises and becoming a major obstacle restricting the development of enterprises.
[0003] In the prior art, the warehouse manages warehouse information through the combination of multiple departments, and manages the information by combining computer input and manual verification; in addition, during the process of storing data in the computer, a single server node is usually used to process warehouse data. Although some enterprises have adopted information technology to improve management efficiency, limited by the traditional C / S (Client-Server) solution, it is difficult to expand and is unable to cope in scenarios where the data scale is getting larger and larger.
[0004] In the process of implementing the present invention, the inventor found that the prior art has the following defects: the scale of warehouse data is getting larger and larger, resulting in the inability of the traditional C / S solution to be applicable to more complex warehouse scenarios. Summary of the Invention
[0005] Embodiments of the present invention provide a method and a system for managing warehouse information, so as to provide a new method for managing warehouse information based on dynamically adjusting the weighted coefficient of service instances, improving the efficiency and accuracy of warehouse information management, and optimizing the scalability and maintainability of the warehouse management system.
[0006] In a first aspect, embodiments of the present invention provide a method for managing warehouse information, where the method includes:
[0007] Receiving a user request, and determining a target warehouse function service corresponding to the user request according to the warehouse identification code and request information in the user request; where the target warehouse function service includes a plurality of available service instances;
[0008] Obtaining the running state index values and preset basic index values corresponding to each service instance, and determining a weight coefficient allocation scheme corresponding to each service instance according to the numerical differences between the running state index values;
[0009] Calculating a request allocation index value corresponding to each service instance according to the running state index value, basic index value, and weight coefficient allocation scheme of each service instance;
[0010] Allocate metric values according to the requests of each service instance, determine the target service instance among each service instance, and distribute the user request to the target service instance for request processing.
[0011] In a second aspect, an embodiment of the present invention further provides a warehouse management system, which includes:
[0012] A warehouse gateway, configured to receive a user request, send the user request to a warehouse service registration center; receive a processing result feedback by the warehouse service registration center according to the user request, and perform user feedback on the processing result;
[0013] A warehouse service registration center, configured to implement the warehouse information management method as described in any embodiment of the present invention;
[0014] A fuse, configured to receive information of a target service instance in an unavailable state, send an inspection signal to the target service instance, and determine the state of the target service instance; if it is determined that the state of the target service instance is available, modify the state flag of the target service instance to available.
[0015] In the embodiment of the present invention, by receiving a user request, and according to the warehouse identification code and request information in the user request, determine the target warehouse function service corresponding to the user request; wherein, the target warehouse function service includes multiple available service instances; obtain the running state metric values and preset basic metric values corresponding to each service instance, and according to the numerical differences between the running state metric values, determine the weight coefficient allocation scheme corresponding to each service instance; according to the running state metric values, basic metric values and weight coefficient allocation scheme of each service instance, calculate the request allocation metric value corresponding to each service instance; according to the request allocation metric value of each service instance, determine the target service instance among each service instance, and distribute the user request to the target service instance for request processing, which solves the problems that the scalability, maintainability, management efficiency and accuracy of the traditional warehouse management system are poor due to the increasing scale of warehouse data in the prior art, provides a new method for managing warehouse information based on dynamically adjusting the weighted coefficient of service instances, improves the management efficiency and accuracy of warehouse information, and optimizes the scalability and maintainability of the warehouse management system. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a flowchart of a method for managing warehouse information provided in Embodiment 1 of the present invention;
[0017] Figure 2 It is a flowchart of another method for managing warehouse information provided in Embodiment 2 of the present invention;
[0018] Figure 3 It is a schematic structural diagram of a warehouse management system provided in Embodiment 3 of the present invention;
[0019] Figure 4 It is a schematic structural diagram of a management device for warehouse information provided in Embodiment 4 of the present invention;
[0020] Figure 5 It is a schematic structural diagram of an electronic device provided in Embodiment 5 of the present invention. Detailed implementation manners
[0021] The following further elaborates on the embodiments of the present invention in conjunction with the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the embodiments of the present invention, rather than limiting the embodiments of the present invention. Additionally, it should be noted that for the sake of description, only parts related to the embodiments of the present invention rather than all structures are shown in the drawings.
[0022] Embodiment 1
[0023] Figure 1 It is a flowchart of a method for managing warehouse information provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation of managing warehouse information. This method can be executed by a warehouse management system, which can be implemented in software and / or hardware and integrated in a service cluster. Specifically, referring to Figure 1 , the method specifically includes the following steps:
[0024] S110. Receive a user request, and determine a target warehouse function service corresponding to the user request according to the warehouse identification code and request information in the user request; wherein, the target warehouse function service includes multiple available service instances.
[0025] Among them, the user request may refer to the information sent when the user requests to view information about items in the warehouse. The warehouse identification code may refer to the identity identifier of the warehouse. The request information may refer to the specific content of the user request. The request information may be data including warehouse information and the request content. For example, request the remaining quantity of XX items in the XX warehouse in XX region. The target warehouse function service may refer to an instance cluster that can provide specified services for users, that is, the warehouse function service may include multiple available service instances. A service instance may refer to a specific target for implementing the function service. For example, a specific hardware device or a specific application program.
[0026] In this embodiment, the warehouse function service corresponding to the user request can be determined as the target warehouse function service according to the warehouse identification code and request information in the received user request.
[0027] S120. Obtain the running status index values corresponding to each service instance and the preset basic index values, and determine the weight coefficient allocation scheme corresponding to each service instance according to the numerical differences between the running status index values.
[0028] Among them, the running state index value can refer to the parameter value that can measure the running state of each service instance. The running state index value of each service instance can be obtained by calculating according to the current running state information of each service instance. Among them, the current running state information can include the current remaining rates of the CPU, memory, and storage of the service instance. Specifically, the running state index value of each service instance can be calculated according to calculated, where K i represents the running state index value of each service instance, i represents the natural number identification serial number of each service instance, a represents the CPU remaining rate, b represents the memory remaining rate, c represents the storage remaining rate, p 1 represents the ratio of the total remaining amount of the CPUs of multiple service instances to the total amount of the CPUs of multiple service instances, p 2 represents the ratio of the total remaining amount of the memories of multiple service instances to the total amount of the memories of multiple service instances, p 3 represents the ratio of the total remaining amount of the storages of multiple service instances to the total amount of the storages of multiple service instances.
[0029] The preset basic index value can refer to the basic parameter value that measures the running state of each service instance.
[0030] The weight coefficient can include the first weight coefficient corresponding to the running state index value in each service instance and the second weight coefficient corresponding to the preset basic index value.
[0031] In this embodiment, the running state index value and the preset basic index value corresponding to each service instance can be obtained, and according to the numerical difference between the running state index values of each service instance, a corresponding weight coefficient allocation scheme can be determined for each service instance respectively.
[0032] Optionally, and according to the numerical difference between the running state index values, determining the weight coefficient allocation scheme corresponding to each service instance may include:
[0033] Sort the service instances in descending order according to the running state index value, and sequentially obtain the service instances after the first service instance in the sorting result as the current processing service instance; use the first service instance and the current service instance as the first comparison service instance and the current comparison service instance respectively; calculate the ratio between the two running state index values corresponding to the first comparison service instance and the current comparison service instance; according to the ratio, determine the weight coefficient allocation scheme corresponding to the current processing service instance; return to execute sequentially obtaining the service instances after the first service instance in the sorting result as the current processing service instance until the weight coefficient allocation scheme corresponding to each service instance is determined.
[0034] Multiple service instances of the target warehouse function service can be sorted in descending order according to the operation status index values. According to the sorting result, a corresponding weight coefficient allocation scheme is determined for each service instance. Specifically, the service instances after the first service instance in the sorting result are sequentially used as the currently processed service instances, so as to compare the first service instance with the currently processed service instance, calculate the ratio between the two corresponding operation status index values, and determine a corresponding weight coefficient allocation scheme for the currently processed service instance according to this ratio until the weight coefficient allocation schemes corresponding to each service instance are determined.
[0035] Among them, determining the weight coefficient allocation scheme corresponding to the currently processed service instance according to the ratio may include: when the ratio is greater than a preset threshold, reducing the first weight coefficient of the operation status index value of the first comparison service instance to the first multiple of the original value, and keeping the first weight coefficient of the operation status index value of the currently compared service instance unchanged; reducing the second weight coefficient of the preset basic index value of the first comparison service instance to the second multiple of the original value, and increasing the second weight coefficient of the preset basic index value of the currently compared service instance to the third multiple of the original value.
[0036] Among them, the preset threshold may refer to the lower limit value of the ratio between the operation status index values of two comparison service instances.
[0037] The operation status index value and the basic index value of each service instance may have the same original value of the first weight coefficient and the original value of the second weight coefficient. When the ratio is greater than the preset threshold, corresponding weight coefficient adjustment operations may be performed on the first comparison service instance and the currently compared service instance. Specifically, the first weight coefficient of the operation status index value of the first comparison service instance may be reduced to the first multiple of the original value, and the first weight coefficient of the operation status index value of the currently compared service instance may be kept unchanged; the second weight coefficient of the preset basic index value of the first comparison service instance may be reduced to the second multiple of the original value, and the second weight coefficient of the preset basic index value of the currently compared service instance may be increased to the third multiple of the original value.
[0038] The advantage of such a setting is that by dynamically adjusting the weight coefficient of each service instance, the balance degree among multiple service instances corresponding to the target warehouse function service can be balanced, the working pressure of the target warehouse function service can be reduced, and a service instance with higher working efficiency can be allocated for user requests.
[0039] S130. Calculate the request allocation index value corresponding to each service instance according to the operation status index value, the basic index value, and the weight coefficient allocation scheme of each service instance.
[0040] Among them, the request allocation index value may refer to the parameter value for measuring the final allocation method of each service instance.
[0041] In this embodiment, the weighted sum of the running state metric values and the basic metric values of each service instance can be calculated to obtain the request allocation metric value corresponding to each service instance. Specifically, according to I = αK i +βW, the request allocation metric value of each service instance is calculated. Wherein, I represents the request allocation metric value of each service instance, α represents the first weight coefficient corresponding to the running state metric value, W represents the preset basic metric value of the service instance, and β represents the second weight coefficient corresponding to the preset basic metric value.
[0042] S140. Determine a target service instance among the service instances according to the request allocation metric values of the service instances, and distribute the user request to the target service instance for request processing.
[0043] Among them, the target service instance may refer to a specific service instance selected from multiple service instances corresponding to the target warehouse function service for processing the current user request.
[0044] In this embodiment, according to the request allocation metric values of the service instances, the service instance with the largest request allocation metric value can be determined as the target service instance for processing the current user request, and the received user request is distributed to the target service instance for processing.
[0045] In an alternative implementation manner of this embodiment, distributing the user request to the target service instance for request processing may include:
[0046] Verify whether the target service instance is currently in an available state. If so, distribute the user request to the target service instance for request processing; if not, mark the target service instance as an unavailable state, and determine a new target service instance among the service instances according to the request allocation metric values of the service instances; return to execute the operation of verifying whether the target service instance is currently in an available state until a target service instance in an available state is determined.
[0047] Specifically, before distributing the user request to the target service instance for request processing, it can be verified whether the target service instance is currently in an available state. If it is in an available state, the user request can be distributed to the target service instance for processing; if it is in an unavailable state, the target service instance can be marked as an unavailable state, and according to the order of the request allocation metric values of the service instances, the next service instance with the largest request allocation metric value is determined as the new target service instance, and return to verify whether the new target service instance is currently in an available state until a target service instance in an available state is determined, and the user request is distributed to the target service instance in an available state for request processing.
[0048] The advantage of such a setting is that by verifying the available or unavailable status of the target service instance, it is possible to avoid distributing user requests to service instances in an unavailable state, thereby avoiding delays in processing user requests.
[0049] In the technical solution of the embodiment of the present invention, by receiving a user request and determining a target warehouse function service corresponding to the user request according to the warehouse identification code and request information in the user request; wherein, the target warehouse function service includes multiple available service instances; obtaining the running status index values and preset basic index values corresponding to each service instance, and determining a weight coefficient allocation scheme corresponding to each service instance according to the numerical differences between the running status index values; calculating a request allocation index value corresponding to each service instance according to the running status index values, basic index values and weight coefficient allocation scheme of each service instance; determining a target service instance among each service instance according to the request allocation index value of each service instance, and distributing the user request to the target service instance for request processing, which solves the problems in the prior art that the data scale of the warehouse is getting larger and larger, resulting in poor scalability and maintainability of the traditional warehouse management system, as well as low management efficiency and accuracy, provides a new method for managing warehouse information based on dynamically adjusting the weighted coefficients of service instances, improves the efficiency and accuracy of warehouse information management, and optimizes the scalability and maintainability of the warehouse management system.
[0050] On the basis of the above embodiments, after marking the target service instance as unavailable, it may further include: sending the target service instance in the unavailable state to a fuse, so that the fuse periodically modifies the status marking of the service instance that resumes to an available state.
[0051] The advantage of such a setting is that the fuse can be used to check the service instances in the unavailable state and timely modify them to the available state, avoiding waste of service instance resources.
[0052] Embodiment 2
[0053] Figure 2 It is a flowchart of another method for managing warehouse information provided by the second embodiment of the present invention. This embodiment further adds operations on the basis of the above technical solutions, and the technical solutions in this embodiment can be combined with each optional solution in one or more of the above embodiments. Refer to Figure 2 and the method may include the following steps:
[0054] S210. Receive a user request, and determine a target warehouse function service corresponding to the user request according to the warehouse identification code and request information in the user request; wherein, the target warehouse function service includes multiple available service instances.
[0055] S220. Obtain the running status metric values and preset basic metric values corresponding to each service instance, and determine the weight coefficient allocation scheme corresponding to each service instance according to the numerical differences among the running status metric values.
[0056] S230. Calculate the request allocation metric values corresponding to each service instance according to the running status metric values, basic metric values, and weight coefficient allocation scheme of each service instance.
[0057] S240. Determine the target service instance among each service instance according to the request allocation metric values of each service instance, and distribute the user request to the target service instance for request processing.
[0058] S250. Every preset request processing time interval, obtain the number of currently available service instances corresponding to each warehouse function service.
[0059] Among them, the preset request processing time interval may refer to the time period for processing user requests.
[0060] Specifically, every preset request processing time interval, the number of currently available service instances corresponding to each warehouse function service can be obtained.
[0061] S260. Calculate the target service instance number of each warehouse function service in the current processing time interval according to the number of each service instance and the request processing completion information of each warehouse function service in the previous request processing time interval.
[0062] Among them, the previous request processing time interval may be a time interval among multiple request processing time intervals that is before the current processing time interval. The request processing completion information may include the number of user requests, the average request length of all user requests, and the longest processing result of all user requests. The target service instance number may refer to the number of available service instances in the current processing time interval.
[0063] In this embodiment, the number of current service instances corresponding to the current processing function service can be obtained; in the previous first time interval, according to the number of user requests, the average request length of all user requests, the longest processing result of all user requests, and the maximum value of user configuration instances, calculate the number of service instances in the previous first time interval.
[0064] Among them, it can be based on Calculate the number of service instances S required to process user requests in the previous first time interval. Among them, t quest represents the number of user requests, len quest represents the average request length of all user requests, len responseRepresents the longest processing result of all user requests, and γ represents a user-configurable coefficient. Thus, P = Min{S, u max} can be used to obtain the number of service instances P in the previous first time interval, where u max represents the maximum value of user-configured instances.
[0065] Further, if the current number of service instances is less than the number of service instances in the previous first time interval, then within the current first time interval, calculate the difference between the number of service instances in the previous first time interval and the current number of service instances; within the preset unit time of the current first time interval, determine the number of service instances to be added and run per preset unit time according to the instance number and cycle time corresponding to the difference; and gradually increase the number of service instances within the current first time interval according to the number of service instances to be added and run per preset unit time.
[0066] If the current number of service instances is not less than the number of service instances in the previous first time interval, then within the current second time interval, calculate the number of service instances corresponding to multiple first time intervals respectively; where the second time interval includes at least one first time interval. If the number of service instances is less than the current number of service instances, then after the current second time interval ends, adjust the current number of service instances to the number of service instances corresponding to the first time interval closest to the current time.
[0067] When the number of user requests in the current third time interval is greater than a natural multiple value of the number of user requests in the previous third time interval, determine the number of service instances in the previous first time interval as the number of service instances in the current third time interval; where the duration of the first time interval is greater than the duration of the third time interval.
[0068] The advantage of such a setting is that by adjusting the number of service instances, the processing capacity during the logistics peak period can be improved.
[0069] S270. Adjust the service instances of each warehouse function service according to each of the target service instance numbers.
[0070] The technical solution of the embodiment of the present invention processes a user request by determining a target service instance for the user request. Every preset request processing time interval, it obtains the number of currently available service instances corresponding to each warehouse function service respectively; according to the number of each service instance and the request processing completion information of each warehouse function service in the previous request processing time interval, it calculates the target service instance number of each warehouse function service in the current processing time interval; and adjusts the service instances of each warehouse function service according to the number of each target service instance, solving the problem that the scalability and maintainability of the traditional warehouse management system are poor and the management efficiency and accuracy are low due to the increasing scale of warehouse data in the prior art, providing a new method for managing warehouse information based on dynamically adjusting the weighted coefficient of service instances, improving the efficiency and accuracy of warehouse information management, and optimizing the scalability and maintainability of the warehouse management system.
[0071] Embodiment III
[0072] Figure 3 FIG. is a schematic structural diagram of a warehouse management system provided in Embodiment III of the present invention. This system can execute the warehouse information management method involved in each of the above embodiments. Referring to Figure 3 , this system may include: a warehouse gateway 310, a warehouse service registration center 320, and a fuse 330. Among them:
[0073] The warehouse gateway 310 is used to receive a user request, send the user request to the warehouse service registration center; receive the processing result fed back by the warehouse service registration center according to the user request, and perform user feedback on the processing result;
[0074] The warehouse service registration center 320 is used to implement the warehouse information management method described in any embodiment of the present invention;
[0075] The fuse 330 is used to receive information of a target service instance in an unavailable state, send an inspection signal to the target service instance to determine the state of the target service instance; if it is determined that the state of the target service instance is available, modify the state flag of the target service instance to available.
[0076] Optionally, the fuse can be specifically used to: receive information of a target service instance in an unavailable state; within a preset inspection time interval, send inspection signals to the target service instance according to a preset inspection time interval, and when it is detected that the target service instance is in an available state, modify the status flag of the target service instance to available; after the preset inspection time interval, if the target service instance is still in an unavailable state, calculate the time interval for sending the next inspection signal according to the current number of user requests; send inspection signals to the target service instance according to the time interval until the status flag of the target service instance is modified to available. The advantage of such a setting is that it can avoid a large number of inspection signals in the warehouse management system in a short period of time, occupying system resources.
[0077] Among them, the preset inspection time interval can refer to the most recent time period when the fuse sends inspection signals. The preset inspection time interval can refer to the time interval for sending inspection signals within the preset inspection time interval.
[0078] Specifically, it can be based on Calculate the time interval T for sending the next inspection signal, where q represents the number of requests.
[0079] Embodiment 4
[0080] Figure 4 FIG. 15 is a schematic structural diagram of a warehouse information management device provided in Embodiment 4 of the present invention. This device can execute the warehouse information management method involved in the above-mentioned embodiments. Referring to Figure 4 , this device may include: a target warehouse function service determination module 410, a weight coefficient allocation scheme determination module 420, a request allocation index value calculation module 430, and a user request processing module 440. Among them:
[0081] The target warehouse function service determination module 410 is configured to receive a user request and determine a target warehouse function service corresponding to the user request according to the warehouse identification code and request information in the user request; among them, the target warehouse function service includes multiple available service instances;
[0082] The weight coefficient allocation scheme determination module 420 is configured to obtain the operation status index values and preset basic index values corresponding to each service instance, and determine the weight coefficient allocation scheme corresponding to each service instance according to the numerical differences between the operation status index values;
[0083] The request allocation index value calculation module 430 is configured to calculate the request allocation index values corresponding to each service instance according to the operation status index values, basic index values, and weight coefficient allocation scheme of each service instance;
[0084] A user request processing module 440, configured to determine a target service instance among service instances according to request allocation metric values of each service instance, and distribute the user request to the target service instance for request processing.
[0085] In the technical solution of the embodiment of the present invention, by receiving a user request, and determining a target warehouse function service corresponding to the user request according to a warehouse identification code and request information in the user request; wherein the target warehouse function service includes a plurality of available service instances; obtaining operation status metric values and preset basic metric values corresponding to each service instance, and determining a weight coefficient allocation scheme corresponding to each service instance according to numerical differences between the operation status metric values; calculating request allocation metric values corresponding to each service instance according to the operation status metric values, basic metric values and weight coefficient allocation scheme of each service instance; determining a target service instance among each service instance according to the request allocation metric values of each service instance, and distributing the user request to the target service instance for request processing, which solves the problems in the prior art that the data scale of the warehouse is getting larger and larger, resulting in poor scalability and maintainability of the traditional warehouse management system, and low management efficiency and accuracy, provides a new method for managing warehouse information based on dynamically adjusting the weighted coefficients of service instances, improves the efficiency and accuracy of warehouse information management, and optimizes the scalability and maintainability of the warehouse management system.
[0086] In the above device, optionally, the weight coefficient allocation scheme determination module 420 may specifically be configured to:
[0087] Obtain the current operation status information of each service instance, where the current operation status information includes the current remaining rates of the central processing unit CPU, memory, and storage.
[0088] Calculate operation status metric values corresponding to each service instance according to the current operation status information.
[0089] In the above device, optionally, the weight coefficient allocation scheme determination module 420 may further include:
[0090] A current processing service instance acquisition unit, configured to sort each service instance in descending order of operation status metric values, and sequentially obtain service instances after the first service instance in the sorting result as current processing service instances.
[0091] A comparison service instance determination unit, configured to use the first service instance and the current service instance as a first comparison service instance and a current comparison service instance respectively.
[0092] A ratio calculation module, configured to calculate a ratio between two operation status metric values corresponding to the first comparison service instance and the current comparison service instance.
[0093] The weight coefficient allocation scheme determination unit for the current service instance is configured to determine the weight coefficient allocation scheme corresponding to the current processing service instance according to the ratio;
[0094] The weight coefficient allocation scheme determination unit for each service instance is configured to return the service instance after the first service instance in the obtained sorting result in sequence as the current processing service instance until the weight coefficient allocation schemes corresponding to each service instance are determined.
[0095] In the above device, optionally, the weight coefficient allocation scheme determination unit for the current service instance may specifically be configured to:
[0096] When the ratio is greater than the preset threshold, reduce the first weight coefficient of the operation status index value of the first comparison service instance to the first multiple of the original value, and keep the first weight coefficient of the operation status index value of the current comparison service instance unchanged;
[0097] Reduce the second weight coefficient of the preset basic index value of the first comparison service instance to the second multiple of the original value, and increase the second weight coefficient of the preset basic index value of the current comparison service instance to the third multiple of the original value.
[0098] In the above device, optionally, the user request processing module 440 may specifically be configured to:
[0099] Verify whether the target service instance is currently in an available state. If so, distribute the user request to the target service instance for request processing;
[0100] If not, mark the target service instance as an unavailable state, and determine a new target service instance among the service instances according to the request allocation index values of each service instance;
[0101] Return to execute the operation of verifying whether the target service instance is currently in an available state until a target service instance in an available state is determined.
[0102] In the above device, optionally, it further includes a service instance status marking modification module, which is configured to, after marking the target service instance as an unavailable state:
[0103] Send the target service instance in the unavailable state to the fuse, so that the fuse periodically modifies the status marking of the service instance that resumes to an available state.
[0104] In the above device, optionally, it further includes a service instance adjustment module, which may include:
[0105] The currently available service instance quantity acquisition unit is configured to acquire the currently available service instance quantities corresponding to respective warehouse function services at intervals of a preset request processing time period;
[0106] The target service instance quantity calculation unit is configured to calculate the target service instance quantities of respective warehouse function services in the current processing time period according to the respective service instance quantities and the request processing completion information of respective warehouse function services in the previous request processing time period;
[0107] The service instance adjustment unit is configured to adjust the service instances of respective warehouse function services according to the respective target service instance quantities.
[0108] In the above device, optionally, the target service instance quantity calculation unit may include:
[0109] The current service instance quantity acquisition subunit is configured to acquire the current service instance quantity corresponding to the current processing function service;
[0110] The service instance quantity calculation subunit for the previous first time period is configured to calculate the service instance quantity in the previous first time period according to the user request quantity, the average user request length, the longest processing result, and the configured instance maximum value within the previous first time period;
[0111] The first target service instance quantity adjustment subunit is configured to, if the current service instance quantity is less than the service instance quantity in the previous first time period, adjust the first target service instance quantity according to a first rule within the current first time period.
[0112] In the above device, optionally, the first target service instance quantity adjustment subunit may specifically be configured to:
[0113] Calculate the difference between the service instance quantity corresponding to the previous first time period and the current service instance quantity;
[0114] Within a preset unit time of the current first time period, determine the number of service instances to be added for operation per preset unit time according to the instance number corresponding to the difference and the cycle time;
[0115] Gradually increase the service instance quantity within the current first time period according to the number of service instances to be added for operation per preset unit time.
[0116] The warehouse information management device provided by an embodiment of the present invention can execute the warehouse information management method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.
[0117] Embodiment Five
[0118] Figure 5 The following is a schematic structural diagram of an electronic device provided in Embodiment 5 of the present invention. As Figure 5 shown, the device includes a processor 510, a memory 520, an input device 530, and an output device 540. The number of processors 510 in the device may be one or more. Figure 5 Here, one processor 510 is taken as an example. The processor 510, the memory 520, the input device 530, and the output device 540 in the device may be connected through a bus or other means. Figure 5 Here, connection through a bus is taken as an example.
[0119] The memory 520, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the warehouse information management method in the embodiments of the present invention (for example, the target warehouse function service determination module 410, the weight coefficient allocation scheme determination module 420, the request allocation index value calculation module 430, and the user request processing module 440 in the warehouse information management device). The processor 510 executes various functional applications and data processing of the device by running the software programs, instructions, and modules stored in the memory 520, that is, implements the above-mentioned warehouse information management method. The method may include:
[0120] Receiving a user request, and determining a target warehouse function service corresponding to the user request according to the warehouse identification code and the request information in the user request; wherein, the target warehouse function service includes multiple available service instances;
[0121] Obtaining the running state index values and preset basic index values corresponding to each service instance, and determining a weight coefficient allocation scheme corresponding to each service instance according to the numerical differences between the running state index values;
[0122] Calculating a request allocation index value corresponding to each service instance according to the running state index values, the basic index values, and the weight coefficient allocation scheme of each service instance;
[0123] Determining a target service instance among each service instance according to the request allocation index values of each service instance, and distributing the user request to the target service instance for request processing.
[0124] The memory 520 may mainly include a program storage area and a data storage area. Among them, the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 520 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some instances, the memory 520 may further include a memory remotely provided with respect to the processor 510, and these remote memories may be connected to the device through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0125] The input device 530 can be used to receive input digital or character information, and generate key signal inputs related to the user settings and function controls of the device. The output device 540 may include a display device such as a display screen.
[0126] Embodiment Six
[0127] Embodiment Six of the present invention also provides a computer-readable storage medium, on which a computer program is stored. The computer program, when executed by a processor, is used to execute a method for managing warehouse information, and the method may include:
[0128] Receiving a user request, and determining a target warehouse function service corresponding to the user request according to the warehouse identification code and request information in the user request; wherein, the target warehouse function service includes a plurality of available service instances;
[0129] Obtaining the operation status index values corresponding to each service instance and the preset basic index values, and determining the weight coefficient allocation scheme corresponding to each service instance according to the numerical differences between the operation status index values;
[0130] Calculating the request allocation index values corresponding to each service instance according to the operation status index values, basic index values, and weight coefficient allocation scheme of each service instance;
[0131] Determining a target service instance among each service instance according to the request allocation index values of each service instance, and distributing the user request to the target service instance for request processing.
[0132] Certainly, for a computer-readable storage medium provided by an embodiment of the present invention, on which a computer program is stored, the computer program is not limited to the method operations as described above, and may also execute related operations in the method for managing warehouse information provided by any embodiment of the present invention.
[0133] From the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software and necessary general hardware. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as a floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk or optical disc of a computer, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present invention.
[0134] It should be noted that in the embodiments of the above warehouse information management device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the present invention.
[0135] Note that the above is only the preferred embodiment of the present invention and the applied technical principle. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described here, and various obvious changes, re-adjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for managing warehouse information, characterized in that, it includes: Receiving a user request, and determining a target warehouse function service corresponding to the user request according to the warehouse identification code and request information in the user request; wherein, the target warehouse function service includes multiple available service instances; Obtaining the running state index values and preset basic index values corresponding to each service instance, and determining the weight coefficient allocation scheme corresponding to each service instance according to the numerical differences between the running state index values; including: sorting each of the service instances in descending order of the running state index values, and sequentially obtaining the service instances after the first service instance in the sorting result as the currently processed service instance; taking the first service instance and the currently processed service instance as the first comparison service instance and the current comparison service instance respectively; calculating the ratio between the two running state index values corresponding to the first comparison service instance and the current comparison service instance; when the ratio is greater than a preset threshold, reducing the first weight coefficient of the running state index value of the first comparison service instance to the first multiple of the original value, and keeping the first weight coefficient of the running state index value of the current comparison service instance unchanged; reducing the second weight coefficient of the preset basic index value of the first comparison service instance to the second multiple of the original value, and increasing the second weight coefficient of the preset basic index value of the current comparison service instance to the third multiple of the original value; returning to execute sequentially obtaining the service instances after the first service instance in the sorting result as the currently processed service instance until the weight coefficient allocation scheme corresponding to each service instance is determined; Calculate the request allocation index values corresponding to each service instance according to the running status index values, basic index values, and weight coefficient allocation schemes of each service instance, including: according to I = αK i + βW to calculate the request allocation index value of each service instance; where I represents the request allocation index value of each service instance, α represents the first weight coefficient corresponding to the running status index value, K i represents the running status index value of service instance i, W represents the preset basic index value of the service instance, and β represents the second weight coefficient corresponding to the preset basic index value; Determining a target service instance among each service instance according to the request allocation index value of each service instance, and distributing the user request to the target service instance for request processing.
2. The method according to claim 1, characterized in that, obtaining the running state index values corresponding to each service instance includes: Obtaining the current running state information of each service instance, wherein the current running state information includes the current remaining rates of the central processing unit CPU, memory, and storage; Calculating the running state index values corresponding to each service instance according to each of the current running state information.
3. The method according to claim 1 or 2, characterized in that, distributing the user request to the target service instance for request processing includes: Verifying whether the target service instance is currently in an available state. If so, distributing the user request to the target service instance for request processing; If not, marking the target service instance as an unavailable state, and determining a new target service instance among each service instance according to the request allocation index value of each service instance; Returning to execute the operation of verifying whether the target service instance is currently in an available state until a target service instance in an available state is determined.
4. The method according to claim 3, characterized in that, after marking the target service instance as an unavailable state, it further includes: Send the target service instance in the unavailable state to the fuse so that the fuse can periodically modify the status label of the service instance that has resumed the available state.
5. The method according to claim 1 or 2, wherein, the method further includes: Obtain the number of currently available service instances corresponding to each warehouse function service at intervals of a preset request processing time interval; Calculate the target service instance number of each warehouse function service in the current processing time interval according to the number of each service instance and the request processing completion information of each warehouse function service in the previous request processing time interval; Adjust the service instances of each warehouse function service according to the number of each target service instance.
6. The method according to claim 5, wherein, Calculating the target service instance number of each warehouse function service in the current processing time interval according to the number of each service instance and the request processing completion information of each warehouse function service in the previous request processing time interval includes: Obtain the number of current service instances corresponding to the current processing function service; In the previous first time interval, calculate the number of service instances in the previous first time interval according to the number of user requests, the average length of user requests, the longest processing result, and the maximum value of the configured instance; If the number of current service instances is less than the number of service instances in the previous first time interval, then in the current first time interval, adjust the number of first target service instances according to the first rule.
7. The method according to claim 6, wherein, Adjusting the number of first target service instances according to the first rule in the current first time interval includes: Calculate the difference between the number of service instances corresponding to the previous first time interval and the number of current service instances; Within the preset unit time of the current first time interval, determine the number of service instances to be added and run per preset unit time according to the number of instances corresponding to the difference and the cycle time; Gradually increase the number of service instances in the current first time interval according to the number of service instances to be added and run per preset unit time.
8. A warehouse management system, wherein, it includes: A warehouse gateway for receiving user requests and sending the user requests to the warehouse service registration center; Receiving the processing result feedback by the warehouse service registration center according to the user request, and performing user feedback on the processing result; A warehouse service registration center for implementing the management method of warehouse information as described in any one of claims 1-7; A fuse for receiving information of a target service instance in an unavailable state, and sending an inspection signal to the target service instance to determine the status of the target service instance; If it is determined that the status of the target service instance is available, modify the status label of the target service instance to available.
9. The system according to claim 8, wherein, the fuse is specifically used for: Receiving information of a target service instance in an unavailable state; Within a preset inspection time interval, send an inspection signal to the target service instance according to a preset inspection time interval. When it is detected that the target service instance is in an available state, modify the status flag of the target service instance to available; After the preset inspection time interval, if the target service instance is still in an unavailable state, calculate the time interval for sending the next inspection signal according to the current number of user requests; Send an inspection signal to the target service instance according to the time interval until the status flag of the target service instance is modified to available.
Citation Information
Patent Citations
Calling method and device of distributed system, terminal equipment and server
CN111597041A
Request allocation method and device thereof, electronic equipment and readable storage medium
CN112449005A