Inventory change information processing method, electronic device, storage medium and program product

By receiving inventory change requests in the housekeeping industry and using thread local variables to pass information, the problem of improper scheduling of housekeeping personnel is solved, the reasons for inventory change are quickly traced, and the scheduling and scheduling of housekeeping personnel is optimized.

CN120374012APending Publication Date: 2025-07-25BEIJING 58 INFORMATION TTECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510458886.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-11
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

In the housekeeping industry, when assigning orders to housekeeping personnel based on schedule information, it is easy for domestic workers to be unable to accept orders or are suddenly occupied during their idle periods, resulting in improper dispatch.

Method used

By receiving inventory change requests, the target inventory change scenario is determined, and the thread-local variables are used to pass the call information of the primary key identifier and adapter to the child nodes, the child nodes control the identification information and inventory change information to the target database, decouple the execution process, and quickly trace the reasons for the inventory change.

Benefits of technology

It has achieved rapid and efficient tracing of the reasons for historical inventory changes, optimized the scheduling and scheduling of housekeeping personnel, and avoided the problem of improper scheduling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120374012A_ABST
    Figure CN120374012A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an inventory change information processing method, electronic equipment, a storage medium and a program product. In the embodiment of the invention, under the condition that any child node which causes inventory change and is contained in a target inventory change scene is monitored, a thread local variable is utilized to transmit a primary key identifier and calling information of a target adapter to the child node, so that the child node is controlled to call the target adapter according to the calling information; and storing the identification information of the child nodes, the corresponding inventory change information and the primary key identification in the target database in an associated manner to obtain inventory change detail information corresponding to the inventory change request. Therefore, information transmission, data storage and the execution process of the child node are decoupled by using the thread local variable, information transmission to other nodes except the child node is not needed, and the information of each node is stored in an associated manner based on the primary key identifier, so that the historical change reason of any inventory can be quickly and efficiently traced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to a method for processing inventory change information, an electronic device, a storage medium, and a program product. Background Art

[0002] In the domestic service field, from traditional service categories such as cleaning, cooking services, and home appliance repair, to diversified and professional service categories covering family health management, infant care, and elderly care today, the boundaries of the domestic service industry are constantly expanding.

[0003] While the domestic service industry is booming, with the high volume of domestic service orders during holidays, the peak transportation period correspondingly brings the problem of tight transportation capacity of domestic service personnel. Therefore, frequent scheduling of domestic service personnel has become the normal operation of some domestic service companies. Currently, the task scheduling of domestic service personnel is based on the scheduling information of domestic service personnel and the idle periods in the scheduling information.

[0004] However, in practical applications, it is found that when assigning order tasks to domestic service personnel according to the scheduling information, situations such as domestic service personnel being unable to accept orders or the originally idle periods being suddenly occupied are likely to occur. In order to better schedule tasks for domestic service personnel, it is necessary to timely and accurately understand the period information during which domestic service personnel can provide services and the relevant reasons for not being able to provide services. However, in the domestic service field, there is no relevant solution yet. Summary of the Invention

[0005] Embodiments of this application provide a method for processing inventory change information, an electronic device, a storage medium, and a program product, which can quickly and efficiently trace the reasons for changes in inventory information, so as to optimize work arrangements such as scheduling and dispatching domestic service personnel based on the reasons for changes in inventory information.

[0006] An embodiment of the present application provides a method for processing inventory change information, including: receiving an inventory change request and determining a target inventory change scenario corresponding to the inventory change request; where the target inventory change scenario belongs to any one of a plurality of predefined inventory change scenarios, and each inventory change scenario includes: a target master node for receiving business parameter information and a plurality of child nodes that affect the inventory information in the inventory change scenario. Each inventory change scenario is associated with an adapter, and the adapter exposes its call information to the target master node in the inventory change scenario it is associated with; providing the business parameter information in the inventory change request to the target master node in the target inventory change scenario, and controlling the target master node to call the target adapter according to the call information of the target adapter associated with the target inventory change scenario, and storing the identification information of the target master node and the business parameter information in the target database; the target database assigns a primary key identifier to the target master node and returns it to the target master node through the target adapter; when it is monitored that any child node in the target inventory change scenario occurs, based on the thread local variable, passing the primary key identifier and the call information of the target adapter to any child node, and controlling any child node to call the target adapter according to the call information of the target adapter, and associating and storing the identification information of any child node, the inventory change information corresponding to any child node with the primary key identifier in the target database, so as to obtain the inventory change detail information corresponding to the inventory change request.

[0007] An embodiment of the present application also provides an electronic device, including: a memory and a processor; the memory is used for storing a computer program; the processor is coupled with the memory and is used for executing the computer program to implement the steps in the above methods.

[0008] An embodiment of the present application also provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the processor is caused to implement the steps in the above methods.

[0009] An embodiment of the present application also provides a computer program product, and the computer program product includes computer programs / instructions. When the computer programs / instructions are executed by a processor, the processor is caused to be able to implement the steps in the above methods.

[0010] In an embodiment of the present application, the control target master node calls the target adapter according to the call information of the target adapter associated with the target change scenario, stores the identification information and service parameter information of the target master node in the target database, and returns the primary key identification assigned by the target database to the target master node, so as to facilitate subsequent transmission of the primary key identification and the call information of the target adapter to any child node that causes inventory changes. Further, the use of thread local variables decouples the process of transmitting the primary key identification, the call information of the target adapter, and the process of storing data in the target database from the execution flow of the above-mentioned child nodes included in the target inventory change scenario, without affecting the execution flow of the above-mentioned child nodes, and there is no need to transmit information to other nodes other than the above-mentioned child nodes, such as nodes that do not cause inventory changes. Only when any child node that causes inventory changes included in the monitored scenario occurs, use thread local variables to transmit the primary key identification and the call information of the target adapter to the child node, so as to control the child node to call the target adapter according to the call information of the target adapter, and associate and store the identification information of the child node, the inventory change information corresponding to the any child node, and the primary key identification in the target database to obtain the inventory change detail information corresponding to the inventory change request, so as to quickly and efficiently trace the historical change reasons of any inventory, so as to optimize work arrangements such as scheduling and dispatching of domestic workers based on the change reasons of inventory information. Brief Description of the Drawings

[0011] The drawings described herein are used to provide a further understanding of the present application, and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application, and do not constitute an improper limitation to the present application. In the drawings:

[0012] Figure 1 It is a schematic flow chart of inventory change information provided by an exemplary embodiment of the present application;

[0013] Figure 2a It is a schematic diagram of the daily inventory of domestic helpers provided by an exemplary embodiment of the present application;

[0014] Figure 2b It is a schematic diagram of multiple inventories provided by an exemplary embodiment of the present application;

[0015] Figure 2c It is a schematic diagram of target inventory change information provided by an exemplary embodiment of the present application;

[0016] Figure 2d It is a schematic flow chart of another inventory change information provided by another exemplary embodiment of the present application;

[0017] Figure 3Schematic diagram of the structure of an electronic device provided by an exemplary embodiment of the present application. Detailed implementation manners

[0018] To make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with specific embodiments of the present application and the corresponding drawings. Apparently, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0019] It should be noted that in the case where the embodiments of the present application involve user information, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or reject. In addition, various models (including but not limited to language models or large models) involved in the present application comply with relevant laws and standards.

[0020] In addition, it should be noted that in the case where the embodiments of the present application involve user interaction operations or trigger operations, the user interaction operations or trigger operations involved in the embodiments of the present application include but are not limited to: interaction operations in various ways such as touch operations, gesture operations, voice operations, head movement operations, and eye movement operations; among them, touch operations include but are not limited to: click operations, double-click operations, long-press operations, slide operations, pinch operations, or mouse hover operations, etc. Slide operations include but are not limited to: linear slides, curved slides, etc.

[0021] Furthermore, it should be noted that in the case where the embodiments of the present application involve the jump between the first interface and the second interface, the jump methods involved in the embodiments of the present application include but are not limited to: directly jumping from the first interface to the second interface, first jumping from the first interface to the task interface and then jumping to the second interface when corresponding task operations are completed on the task interface; completing the corresponding task operations on the task interface includes but is not limited to: when the task interface is implemented as a game interface, completing game operations on the game interface; when the task interface is implemented as an identity authentication interface, completing identity authentication on the identity authentication interface; when the task interface is implemented as a recharge interface, completing recharge operations on the recharge interface; and so on.

[0022] When allocating order tasks to domestic workers according to the work schedule information, technical problems such as domestic workers being unable to accept orders or the originally idle time slots being suddenly occupied are likely to occur. In the embodiments of the present application, the control target master node calls the target adapter according to the call information of the target adapter associated with the target change scenario, stores the identification information and business parameter information of the target master node in the target database, and returns the primary key identification allocated by the target database to the target master node for subsequent transmission of the primary key identification and the call information of the target adapter to any child node that causes inventory changes. Further, the thread local variable is used to decouple the process of transmitting the primary key identification, the call information of the target adapter, and the process of storing data in the target database from the execution process of the above-mentioned child nodes included in the target inventory change scenario, which will not affect the execution process of the above-mentioned child nodes, and there is no need to transmit information to other nodes other than the above-mentioned child nodes, such as nodes that do not cause inventory changes. Only when any child node that causes inventory changes included in the monitored scenario occurs, the thread local variable is used to transmit the primary key identification and the call information of the target adapter to the child node to control the child node to call the target adapter according to the call information of the target adapter, and associate and store the identification information of the child node, the inventory change information corresponding to the any child node, and the primary key identification in the target database to obtain the inventory change detail information corresponding to the inventory change request, so as to quickly and efficiently trace the historical change reasons of any inventory, so as to optimize the work arrangements such as scheduling and dispatching of domestic workers based on the change reasons of inventory information.

[0023] The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0024] Figure 1 It is a schematic flowchart of a method for processing inventory change information provided by an exemplary embodiment of the present application. As Figure 1 shown, it includes:

[0025] 101. Receive an inventory change request and determine the target inventory change scenario corresponding to the inventory change request; wherein, the target inventory change scenario belongs to any one of a plurality of predefined inventory change scenarios, and each inventory change scenario includes: a target master node for receiving business parameter information and a plurality of child nodes that affect the inventory information in the inventory change scenario. Each inventory change scenario is associated with an adapter, and the adapter exposes its call information to the target master node in the inventory change scenario it is associated with.

[0026] 102. Provide the business parameter information in the inventory change request to the target master node in the target inventory change scenario, and control the target master node to call the target adapter according to the call information of the target adapter associated with the target inventory change scenario, and store the identification information and business parameter information of the target master node in the target database; the target database assigns a primary key identifier to the target master node and returns it to the target master node through the target adapter;

[0027] 103. When it is monitored that any child node in the target inventory change scenario occurs, based on the thread local variable, pass the primary key identifier and the call information of the target adapter to any child node, and control any child node to call the target adapter according to the call information of the target adapter, and store the identification information of any child node, the inventory change information corresponding to any child node and the primary key identifier in the target database in an associated manner to obtain the inventory change detail information corresponding to the inventory change request.

[0028] In some fields, the concept of inventory is involved. The definitions of inventory in different industries are different. Taking the domestic service industry as an example, the service period of domestic service personnel can be regarded as inventory. The service period refers to the time period during which domestic service personnel can provide services, that is, the inventory refers to the occupancy status (also known as service status) of domestic service personnel. In addition, the definitions of inventory for different time dimensions are also different. The time dimension can be, for example, one day, one week, one month, or even shorter or longer time, etc. Still taking the domestic service industry as an example, when the time dimension is one day, the inventory includes the daily inventory of domestic service personnel and the daily inventory of domestic service merchants. Among them, the daily inventory of domestic service personnel refers to whether domestic service personnel can provide services in each time period of a certain date (including the time periods when services can be provided and the time periods when services cannot be provided), that is, the inventory of domestic service personnel is an important basis for determining whether they can accept orders. Taking the minimum granularity of the daily inventory of domestic service personnel as half an hour as an example, then the daily inventory of a specific domestic service personnel on a certain date is the inventory of 48 half points within 24 hours. Usually, the daily inventory of domestic service personnel corresponds to an occupancy status. The occupancy status of the daily inventory of domestic service personnel mainly includes: idle, leave closed, merchant closed, order occupied, merchant reassignment, scheduled rest and not accepting orders, domestic service personnel rejecting orders, etc. The daily inventory of domestic service merchants refers to the total number of domestic service personnel available and the total number of domestic service personnel occupied under the name of a domestic service merchant in each time period of a certain date. The time period can be half an hour (or time half point), one hour, two hours, etc. When the time dimension is one week, the inventory includes the weekly inventory of domestic service personnel and the weekly inventory of domestic service merchants. The weekly inventory of domestic service personnel refers to whether domestic service personnel can provide services in each time period of a certain week, and the weekly inventory of domestic service merchants refers to the total number of domestic service personnel available and the total number of domestic service personnel occupied under the name of a domestic service merchant in a certain week. As Figure 2a The exemplary daily inventory of the domestic service aunt bound to XXX domestic service merchant in the figure.

[0029] Generally, inventory changes involve inventory change scenarios. Different fields may involve multiple inventory change scenarios, and the inventory change scenarios involved in the same field may also be different. In the embodiments of the present application, multiple inventory change scenarios involved in each field can be predefined, and multiple nodes (or called buried points) involved in each inventory change scenario can be predefined. Each inventory change scenario includes: a target master node for receiving business parameter information and multiple sub-nodes that affect the inventory information in the inventory change scenario. Among them, each node can be regarded as an execution action. Each inventory change scenario has a corresponding scenario identifier, and each node has its own node identifier. In each defined inventory change scenario, there are often multiple inventory change operations corresponding to it. These inventories are, for example, aunt daily inventory, aunt scheduling plan, aunt weekly inventory, aunt leave record, etc., Figure 2b The exemplary relevant information of aunt daily inventory, aunt scheduling plan, aunt weekly inventory, and aunt leave record is shown. Taking the addition of an aunt scheduling non-acceptance plan as an example, for the actions of aunt inventory change, there are adding a scheduling plan, changing the daily inventory time half-hour inventory status of the aunt daily inventory in the scheduling plan cycle time when it is in the leave closed, idle, or home service merchant closed state, correspondingly updating the home service merchant daily inventory under the changed aunt daily inventory time period (the number of aunts occupied in the corresponding time period + 1), changing the weekly inventory status of the aunt on the corresponding day of the week and time half-hour in the corresponding scheduling cycle plan, and the corresponding home service merchant weekly inventory. Therefore, these actions all need to be marked as sub-nodes of inventory change.

[0030] In the embodiments of the present application, when receiving an inventory change request, according to the inventory change request, the target inventory change scenario corresponding to the inventory change request can be determined. Among them, the inventory change request includes business parameter information. Taking the home service field as an example, if the inventory change request is that an order occupies and deducts the inventory of domestic workers, then the identification information of the order, the identification information of the placing user, and the order type can all be used as the business parameter information of this request. Based on this, determining the target inventory change scenario corresponding to the inventory change request includes: according to the inventory change request, determining the target field to which the inventory change request belongs; according to the target field, determining multiple candidate inventory change scenarios predefined for the target field; according to the business parameter information included in the inventory change request, determining the target inventory change scenario corresponding to the inventory change request from the multiple candidate inventory change scenarios.

[0031] In the embodiments of the present application, since the business parameter information involved in each inventory change scenario is different, an adapter can be configured for each inventory change scenario, that is, each inventory change scenario is associated with an adapter. The adapter exposes its call information to the target master node in the inventory change scenario it is associated with, and the call information is used to call the adapter associated with the corresponding inventory change scenario. The adapter is used to convert different parameter information in the associated inventory change scenario into a unified parameter format, so as to facilitate subsequent data storage and query.

[0032] In the embodiments of the present application, the business parameter information in the inventory change request can be provided to the target master node in the target inventory change scenario, and the target master node can be controlled to call the target adapter according to the call information of the target adapter associated with the target inventory change scenario, and the identification information and business parameter information of the target master node are associated and stored in the target database. During the process of associated storage, the target database will also assign a primary key identifier (mainId) to the target master node. The primary key identifier, identification information, and business parameter information of the target master node will be jointly associated and stored in the target database, so as to facilitate subsequent query of relevant information according to the primary key identifier of the target master node. During the process of controlling the target master node to call the target adapter according to the call information of the target adapter associated with the target inventory change scenario and associating and storing the identification information and business parameter information of the target master node in the target database, the target adapter can convert the identification information and business parameter information of the target master node into a unified format, so as to facilitate the storage of the identification information and business parameter information of the target master node and subsequent query. In addition, the primary key identifier assigned by the target database to the target master node can be returned to the target master node by the target adapter. When returning to the target master node, the format of the primary key identifier can also be converted according to actual needs into other formats required by users.

[0033] In some alternative embodiments, the target master node includes an aspect implemented using Aspect-Oriented Programming (AOP) technology, which can be referred to as an AOP aspect. It is used to record the business parameter information in the inventory change requests corresponding to each inventory change scenario and the primary key identifiers assigned by the target database to each master node. Aspect-Oriented Programming is a programming paradigm used to separate cross-cutting concerns (such as logging, transaction management, security checks, etc.) from business logic to avoid mutual influence with business logic. In the embodiments of the present application, the business logic refers to the business link composed of each node in the target inventory change scenario. The business link corresponding to the target inventory change scenario may include: a main link and at least one asynchronous link, and the master node is the starting point of the main link.

[0034] In Java, AOP aspects are usually implemented through the Spring framework or AspectJ. Based on this, optionally, the business parameter information in the inventory change request is provided to the target master node in the target inventory change scenario, and the target master node is controlled to call the target adapter according to the call information of the target adapter associated with the target inventory change scenario, and the identification information and business parameter information of the target master node are stored in the target database, including: providing the business parameter information to the target master node for the target master node to record the identification information and business parameter information of the target master node in the aspect; and calling the target adapter according to the call information of the target adapter, obtaining the identification information and business parameter information of the target master node from the aspect, and storing the identification information and business parameter information of the target master node in the target database with the target master node as the storage dimension.

[0035] In some alternative embodiments, the target inventory change scenario involves multiple threads, including a first thread (main thread) and a second thread (asynchronous thread). Different threads are used to run nodes on different links. Among them, the first thread is used to run the master node and child nodes on the main link, and the second thread is used to run the child nodes on the asynchronous link. In addition, the child nodes running in the first thread can be nodes related to the inventory change of domestic workers, and the child nodes running in the second thread are nodes related to the inventory change of merchants, but the time dimension is not limited. That is to say, the inventory change in the first thread will cause the inventory change in the second thread.

[0036] It should be noted that the inventory change of domestic workers does not necessarily affect the inventory change of merchants. In the target inventory change scenario, first, the nodes in the main link are run in the first thread. During the running of the first thread, if a certain child node is executed and causes an inventory change of domestic workers, and the inventory change of domestic workers caused by this child node will affect the inventory change of merchants, then a second thread will be triggered to be created, and the asynchronous link will be run in the second thread to update and store the merchant inventory. That is to say, the first thread and the second thread have a running sequence. If the inventory change of domestic workers corresponding to the execution result of the first thread will cause the inventory change of merchants, then a second thread will be triggered to be created and run to complete the inventory change of merchants and the data storage of the inventory change in the second thread.

[0037] In some alternative embodiments, to facilitate the context passing of information within the same thread and avoid confusion in information passing between different threads, the information passing within the same thread can be decoupled from the nodes in the thread, and the information passing between different threads can be decoupled. To this end, a respective thread-local variable (ThreadLocal variable) can be set for each thread in the target inventory change scenario to pass information to each node in the thread through the ThreadLocal variable. In a multi-threaded environment, a ThreadLocal variable is a special variable that provides an independent copy of the variable for each thread that uses it. This means that each thread can access its own ThreadLocal variable without conflicting with or confusing the copies of other threads. ThreadLocal variables are typically used to store thread-local data, such as user sessions, transaction IDs, temporary calculation results, etc.

[0038] In the embodiments of the present application, first, the primary key identifier recorded by the AOP aspect at the target master node in the target inventory change scenario and the call information of the target adapter can be stored in the ThreadLocal variable corresponding to the main thread. When it is monitored that any child node in the target inventory change scenario occurs, the primary key identifier and the call information of the target adapter can be passed to any child node based on the ThreadLocal variable, and any child node can be controlled to call the target adapter according to the call information of the target adapter, and the identifier information of any child node, the inventory change information corresponding to any child node, and the primary key identifier can be associated and stored in the target database to obtain the inventory change details information corresponding to the inventory change request. Thus, a data table associated with the primary key identifier can be obtained in the target database, and the identifier information of each child node and the inventory change information corresponding to each child node are sequentially stored in the table. This data table is conducive to quickly tracing various inventory change information of domestic service merchants or domestic service personnel at various time periods. In addition, the relevant information of the nodes that do not generate inventory changes can also be stored in the target database in the above manner.

[0039] In some alternative embodiments, passing the primary key identifier and the call information of the target adapter to any child node based on the thread-local variable includes: if any child node runs on the first thread, obtaining the primary key identifier and the call information of the target adapter from the thread-local variable, where the first thread is the thread responsible for maintaining the first inventory information corresponding to the domestic service personnel in the target inventory change scenario, and the thread-local variable is a variable in the first thread; if any child node runs on the second thread, passing the primary key identifier and the call information of the target adapter in the thread-local variable to any child node through an asynchronous event, where the second thread is the thread responsible for maintaining the second inventory information corresponding to the merchant in the target inventory change scenario, and the asynchronous event can be an event event.

[0040] It should be noted that the merchant inventory also includes multiple different dimensions such as the merchant's daily inventory and weekly inventory. If the inventory change of a certain dimension of the domestic worker causes the inventory of multiple dimensions such as the merchant's daily inventory and weekly inventory to change, then each dimension of the merchant's inventory change process will correspond to its own thread. For example, if the inventory change of one dimension of the domestic worker causes the change of the merchant's daily inventory and weekly inventory, then the asynchronous link includes: the asynchronous link corresponding to the change of the merchant's daily inventory and the asynchronous link corresponding to the change of the merchant's weekly inventory, and each asynchronous link corresponds to its own second thread.

[0041] Further optionally, when any sub-node runs on the first thread, perform a change operation on the first inventory information according to any sub-node to generate inventory change information; when any sub-node runs on the second thread, perform a change operation on the second inventory information according to any sub-node to generate inventory change information; wherein, the change operation includes: at least one of an operation of initializing the service period, an operation of changing the service period status, and an operation of adjusting the scheduling information.

[0042] Further optionally, when any sub-node generates inventory change information, call the target adapter according to the call information of the target adapter, and based on the primary key identifier, send the inventory change information to the target database. The target database assigns a sub-key identifier to any sub-node and returns it to the target master node through the target adapter.

[0043] In some optional embodiments, the AOP aspect also records the execution result of the first thread or the second thread, and the aspect has a listening event. Then, during the running process of the first thread or the second thread, the listening event can be started to listen to the running result of the first thread or the second thread, and the running result is returned and recorded in the aspect.

[0044] Further optionally, the inventory change scenarios at least include: directly assigning an order to an aunt, adding a schedule, a merchant opening / closing working hours, an aunt taking a leave / canceling a leave.

[0045] Further optionally, the inventory change information can be queried through a query request, and the query request includes query conditions. Then, when receiving an inventory change information query request, the target inventory change information matching the query conditions can be obtained from the target database according to the query conditions, and the target inventory change information is output to the initiator of the query request for the initiator to view the target inventory change information (or snapshot), which is beneficial to quickly trace the inventory change information of various domestic service merchants or domestic workers in each time period. Figure 2c It is an exemplary diagram of the target inventory change information queried.

[0046] To facilitate the understanding of the technical solutions provided in the above embodiments, the following combines the scenario of directly assigning an order to an aunt occupying the aunt's inventory andFigure 2d Describe this solution in detail.

[0047] The external business system provides an order placement page. The order placement page can display multiple services. The services can be configured through the platform's Stock Keeping Unit (SKU). The services can be named in the form of "city + service skill + basic sales unit + various attributes, etc.". For example, Beijing daily cleaning - 2-hour cleaning and washing, Tianjin home appliance cleaning - central air-conditioning cleaning. After the C-end user places an order through the order placement page, a stock change request will be sent to the stock change system. The stock change request contains business parameter information. The business parameter information for this scenario can be the order placement time of the order, order identification information, service start time corresponding to the order, service end time, etc. After receiving the stock change request, the stock change system will create and run the first thread. The first thread executes the main node in the main link, that is, stores the main node identification information and business parameter information corresponding to this scenario in the AOP aspect at the main node, and controls the main node to call the adapter according to the call information of the adapter associated with this scenario, and sends the main node's identification information and business parameter information to the target database for storage. During the storage process, the target database will assign a primary key identifier (mainId) to the main node, and associate and store the main node's identification information and business parameter information with the mainId in the target database.

[0048] Further, it will traverse the list of dispatched aunts and deduct the aunt's inventory, that is, execute each sub-node in the main link in sequence. The sub-nodes in the main link include: "Query whether the aunt has daily inventory on the current day", "Query which day of the week the order dispatch date corresponds to and query the aunt's weekly inventory", "Initialize the inbound inventory of the aunt's dispatch date from the weekly inventory", "Obtain the call information (adapter implementation class) and mainId of the adapter from the ThreadLocal variable of the current thread, and call the adapter to store the sub-node (identification information) of the initialized inventory of the aunt's dispatch date into the target database", "Record the sub-node (identification information) of the initialized aunt's daily inventory, and store this sub-node (identification information) into the target database according to the mainId. After storage, generate the aunt's daily inventory on the current day", "Verify whether the aunt's daily inventory is in an idle state during the dispatch time period", "The aunt's inventory has been occupied at the order dispatch time (then the deduction of the aunt's inventory fails and the execution ends), and an exception message is thrown", "If the aunt's inventory can be deducted, deduct the aunt's inventory during the dispatch time period", "According to the obtained merchant identification information bound by the aunt, send a message to update the corresponding merchant's daily inventory change in the merchant's daily inventory change message queue for the change in the aunt's daily inventory. Among them, the node of "If the aunt's inventory can be deducted, deduct the aunt's inventory during the dispatch time period" corresponds to the following execution steps (sub-nodes): "Obtain the call information of the corresponding adapter and the mainId from the ThreadLocal variable of the current thread, and call the storage interface corresponding to the corresponding adapter", "Record the sub-node that causes the change in the aunt's daily inventory into the target database, record the inventory records before and after the change in the aunt's inventory and the json data of the changed inventory records, and store these inventory records and the node that causes the change in the aunt's daily inventory into the target database", and the node of "If the aunt's inventory can be deducted, deduct the aunt's inventory during the dispatch time period" also corresponds to the following execution steps (sub-nodes): "Update the daily inventory status of the aunt at the corresponding time to order occupancy, record the order identification information and the identification information of the merchant bound by the aunt, and store these information into the target database".

[0049] The sub-nodes included in the asynchronous link include: "Process the message entity to obtain the mainId and adapter call information", "Store the mainId and adapter call information into the asynchronous thread local variable (ThreadLocal variable) corresponding to the asynchronous link", "Process the update of the merchant's daily inventory change (since the aunt's daily inventory has been occupied, the available number of aunts in the merchant's daily inventory at the corresponding time point should be reduced by 1)", "Obtain the adapter call information and the generated mainId from the current thread's ThreadLocal variable, and call the storage interface corresponding to the corresponding adapter", "Record the sub-node (identification information) that causes the merchant's daily inventory change, and store the sub-node (identification information) into the target database according to the mainId, and record the inventory record before the merchant's daily inventory change and the json data of the inventory record after the change", "Update the merchant's daily inventory".

[0050] Based on the above sub-nodes in the main link, the first thread executes the execution logic of each sub-node as follows: First, query whether the aunt has daily inventory on the current day. If it is found that the aunt has no daily inventory on the current day, then query which day of the week the order dispatch date corresponds to and query the aunt's weekly inventory. After that, initialize and generate the inventory for the aunt's dispatch date from the weekly inventory. After obtaining the inventory for the aunt's dispatch date, obtain the call information (adapter implementation class) and mainId of the adapter from the ThreadLocal variable of this thread, call the adapter, and store the sub-node (identification information) that initializes and generates the inventory for the aunt's dispatch date into the target database according to the mainId. After storage, generate the aunt's daily inventory on the current day. If it is found that the aunt has daily inventory on the current day, then verify whether the aunt's daily inventory is in an idle state during the dispatch time period. If the aunt's inventory is already occupied at the order dispatch time, the deduction of the aunt's inventory fails, the execution ends, and an exception message is thrown; if the aunt's inventory can be deducted, then deduct the aunt's inventory during the dispatch time period. Among them, "according to the obtained merchant identification information bound to the aunt, send a message to update the corresponding merchant's daily inventory change due to the change in the aunt's daily inventory to the merchant's daily inventory change message queue". Among them, if the aunt's inventory can be deducted, when deducting the aunt's inventory during the dispatch time period, the corresponding call information of the adapter and the mainId can be obtained from the ThreadLocal variable of the current thread, and the corresponding storage interface of the adapter can be called. Then, record the sub-node that causes the change in the aunt's daily inventory into the target database, record the json data of the inventory record before and after the change in the aunt's inventory, and store these inventory records and the node that causes the change in the aunt's daily inventory into the target database according to the mainId. In addition, the daily inventory status of the aunt at the corresponding time can be updated to order occupancy, record the order identification information and the identification information of the merchant bound to the aunt, and store these information into the target database according to the mainId. Further, according to the obtained merchant identification information bound to the aunt, send a message to update the corresponding merchant's daily inventory due to the change in the aunt's daily inventory. The message to update the corresponding merchant's daily inventory due to the change in the aunt's daily inventory can be sent to the merchant's daily inventory message queue through an event event. The event event contains a message entity, and the message entity encapsulates some parameters that affect the change in the merchant's daily inventory, such as the mainId, business parameter information, adapter call information, identification information of the aunt, order identification information, and the time of order occupancy.

[0051] It should be noted that since message asynchronous processing needs to cross threads, the main tracing point mainld and adapter call information of the current request need to be stuffed into the message parameter entity.

[0052] After the listening class of the message queue receives the above message in the message queue, it will create a second thread and execute each sub-node in the asynchronous link in the second thread. The execution logic is as follows: obtain the event event from the message queue, parse the message entity contained in the event event to obtain information such as mainId and adapter call information (obtain the required information according to actual needs), and then store the information such as mainId and adapter call information into the ThreadLocal variable of this thread. Further, process the update of the merchant's daily inventory change. That is, since the aunt's daily inventory has been occupied, the available aunt quantity of the merchant's daily inventory at the corresponding time point should be reduced by 1. Then, obtain the mainId and adapter call information from the ThreadLocal variable of this thread, call the storage interface corresponding to the corresponding adapter, and then record the sub-node (identification information) that causes the merchant's daily inventory change, and store the sub-node (identification information) into the target database according to the mainId. Record the inventory record before and after the merchant's daily inventory change in json data, and then update the merchant's daily inventory, and this ends here.

[0053] It should be noted that each thread has its own ThreadLocal variable, and the information stored in the ThreadLocal variable of the second thread is passed from the first thread. Whether in the first thread or the second thread, as long as any node or cause the inventory to change, the mainId and adapter call information will be obtained from the ThreadLocal variable of the thread where it is located, so as to call the corresponding adapter through the adapter call information, and store the inventory change corresponding to the node into the target database according to the mainId, so as to facilitate subsequent query of the change reason and the corresponding inventory. Of course, the identification information of the node where the inventory does not change can also be stored in the target database.

[0054] For the technical solutions provided in the above embodiments of the present application, the target master node controls the target adapter according to the call information of the target adapter associated with the target change scenario, stores the identification information and service parameter information of the target master node in the target database, and returns the primary key identification assigned by the target database to the target master node, so as to facilitate the subsequent transfer of the primary key identification and the call information of the target adapter to any child node that causes inventory changes. Further, the use of thread-local variables decouples the process of transferring the primary key identification, the call information of the target adapter, and the process of storing data in the target database from the execution flow of the above-mentioned child nodes included in the target inventory change scenario. There is no need to transfer information to other nodes other than the above-mentioned child nodes, such as nodes that do not cause inventory changes. Only when any child node that causes inventory changes included in the monitored scenario occurs, the primary key identification and the call information of the target adapter are transferred to the child node using thread-local variables, so as to control the child node to call the target adapter according to the call information of the target adapter, and associate and store the identification information of the child node, the inventory change information corresponding to the any child node, and the primary key identification in the target database, to obtain the inventory change detail information corresponding to the inventory change request, so as to quickly and efficiently trace the historical change reasons of any inventory, so as to optimize the work arrangements such as housekeeping staff scheduling and dispatching based on the change reasons of inventory information.

[0055] Figure 3 Schematic diagram of the structure of an electronic device provided by an exemplary embodiment of the present application. As Figure 3 shown, the electronic device includes: a memory 30a and a processor 30b; the memory 30b is used to store a computer program; the processor 30b is coupled to the memory 30a and is used to execute the computer program to implement the following steps:

[0056] Receive an inventory change request and determine the target inventory change scenario corresponding to the inventory change request; wherein, the target inventory change scenario belongs to any one of multiple predefined inventory change scenarios, and each inventory change scenario includes: a target main node for receiving business parameter information and multiple sub-nodes that affect the inventory information in the inventory change scenario. Each inventory change scenario is associated with an adapter, and the adapter exposes its call information to the target main node in the inventory change scenario it is associated with; Provide the business parameter information in the inventory change request to the target main node in the target inventory change scenario, and control the target main node to call the target adapter according to the call information of the target adapter associated with the target inventory change scenario, and store the identification information and business parameter information of the target main node in the target database; The target database assigns a primary key identifier to the target main node and returns it to the target main node through the target adapter; When it is monitored that any sub-node in the target inventory change scenario occurs, based on the thread local variable, pass the primary key identifier and the call information of the target adapter to any sub-node, and control any sub-node to call the target adapter according to the call information of the target adapter, and store the identification information of any sub-node, the inventory change information corresponding to any sub-node and the primary key identifier in the target database in an associated manner to obtain the inventory change detail information corresponding to the inventory change request.

[0057] In some alternative embodiments, the target main node includes an aspect implemented using aspect-oriented programming techniques; When the processor provides the business parameter information in the inventory change request to the target main node in the target inventory change scenario, and controls the target main node to call the target adapter according to the call information of the target adapter associated with the target inventory change scenario, and stores the identification information and business parameter information of the target main node in the target database, it is specifically used for: providing the business parameter information to the target main node for the target main node to record the identification information and business parameter information of the target main node in the aspect; and calling the target adapter according to the call information of the target adapter, obtaining the identification information and business parameter information of the target main node from the aspect, and storing the identification information and business parameter information of the target main node in the target database with the target main node as the storage dimension.

[0058] Optionally, when the processor passes the primary key identifier and the call information of the target adapter to any child node based on the thread-local variable, it specifically is used for: if any child node runs on the first thread, obtaining the primary key identifier and the call information of the target adapter from the thread-local variable, where the first thread is the thread responsible for maintaining the first inventory information corresponding to the domestic worker in the target inventory change scenario, and the thread-local variable is a variable in the first thread; if any child node runs on the second thread, passing the primary key identifier and the call information of the target adapter in the thread-local variable to any child node through an asynchronous event, where the second thread is the thread responsible for maintaining the second inventory information corresponding to the merchant in the target inventory change scenario.

[0059] Further optionally, when any child node runs on the first thread, the processor performs a change operation on the first inventory information according to any child node to generate inventory change information; when any child node runs on the second thread, the processor performs a change operation on the second inventory information according to any child node to generate inventory change information; where the change operation includes at least one of: an operation of initializing the service period, an operation of changing the service period status, and an operation of adjusting the scheduling information.

[0060] Further optionally, when any child node generates inventory change information, the processor calls the target adapter according to the call information of the target adapter, and based on the primary key information, sends the inventory change information to the target database, where the target database assigns a sub-key identifier to any child node and returns it to the target master node through the target adapter.

[0061] In some alternative embodiments, the aspect also records the execution result of the first thread or the second thread. The aspect has a listening event, and the processor is further used for: during the running of the first thread or the second thread, starting the listening event to monitor the running result of the first thread or the second thread, and recording the running result in the aspect.

[0062] Further optionally, the inventory change scenario at least includes: directly assigning an order to an aunt, adding a schedule, a merchant opening / closing working hours, and an aunt taking / canceling a leave.

[0063] Further optionally, the processor is further used for: receiving an inventory change information query request, where the query request includes query conditions; obtaining the target inventory change information corresponding to the query conditions in the target database according to the query conditions; and outputting the target inventory change information to the initiator of the query request for the initiator to view the target inventory change information.

[0064] Further, as Figure 3 shown, the server further includes other components such as a communication component 30c, a display 30d, a power supply component 30e, and an audio component 30f. Figure 3Only some components are schematically shown, which does not mean that the electronic device only includes Figure 3 the components shown.

[0065] The detailed implementation manners and beneficial effects of the electronic device provided in the embodiments of the present application have been described in detail in the foregoing embodiments, and will not be elaborated herein.

[0066] An exemplary embodiment of the present application further provides a computer-readable storage medium storing a computer program, which causes a processor to implement the steps in the foregoing method embodiments when the computer program is executed by the processor.

[0067] An exemplary embodiment of the present application further provides a computer program product, which includes a computer program / instructions, and causes a processor to be able to implement the steps in the foregoing method embodiments when the computer program / instructions are executed by the processor.

[0068] The above-mentioned memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0069] The above-mentioned communication component is configured to facilitate communication between the device where the communication component is located and other devices in a wired or wireless manner. The device where the communication component is located can access a wireless network based on a communication standard, such as 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel.

[0070] The above-mentioned display includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of touch or swipe actions, but also detect the duration and pressure associated with the touch or swipe operations.

[0071] The above-mentioned power supply component provides power for various components of the device where the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device where the power supply component is located.

[0072] The above-mentioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), which is configured to receive external audio signals when the device where the audio component is located is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in a memory or transmitted via a communication component. In some embodiments, the audio component further includes a speaker for outputting audio signals.

[0073] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to be able to implement the steps in the above method embodiments. Among them, the computer-readable storage medium can be implemented by volatile or non-volatile or a combination thereof, and can be removable or non-removable. Examples of computer-readable storage media include, but are not limited to, Phase-change Random Access Memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read-Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), flash memory or other memory technologies, Compact Disc Read-Only Memory (CD-ROM), Digital Video Disc (DVD) or other optical storage, magnetic cassette tapes, magnetic disk storage or other magnetic storage devices or any other non-transmission medium

[0074] Accordingly, an embodiment of the present application further provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, the processor is enabled to implement each step in the above method embodiment. It should be understood that each process or the combination of multiple processes in the above method flow can be implemented by the computer program or instructions. In addition, these computer programs or instructions can be applied to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices, so that the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices can be used as devices to implement the corresponding functions in the above method embodiment.

[0075] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover a non-exclusive inclusion, such that a process, method, commodity or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, commodity or device including the element.

[0076] The above are only embodiments of the present application and are not used to limit the present application. For those skilled in the art, the present application may have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.

Claims

1. A method for processing inventory change information, characterized in that Including: Receiving an inventory change request and determining a target inventory change scenario corresponding to the inventory change request; wherein, the target inventory change scenario belongs to any one of a plurality of predefined inventory change scenarios, and each inventory change scenario includes: a target main node for receiving business parameter information and a plurality of sub-nodes that affect the inventory information in the inventory change scenario. Each inventory change scenario is associated with an adapter, and the adapter exposes its call information to the target main node in the inventory change scenario it is associated with; Providing the business parameter information in the inventory change request to the target main node in the target inventory change scenario, and controlling the target main node to call the target adapter according to the call information of the target adapter associated with the target inventory change scenario, and storing the identification information of the target main node and the business parameter information into a target database; the target database assigns a primary key identification to the target main node and returns it to the target main node through the target adapter; When it is monitored that any sub-node in the target inventory change scenario occurs, transmitting the primary key identification and the call information of the target adapter to the any sub-node based on a thread local variable, and controlling the any sub-node to call the target adapter according to the call information of the target adapter, and associating and storing the identification information of the any sub-node, the inventory change information corresponding to the any sub-node and the primary key identification into the target database, so as to obtain the inventory change detail information corresponding to the inventory change request.

2. The method according to claim 1, characterized in that, The target main node includes an aspect implemented by using aspect-oriented programming technology; Providing the business parameter information in the inventory change request to the target main node in the target inventory change scenario, and controlling the target main node to call the target adapter according to the call information of the target adapter associated with the target inventory change scenario, and storing the identification information of the target main node and the business parameter information into a target database, including: Providing the business parameter information to the target main node for the target main node to record the identification information of the target main node and the business parameter information into the aspect; and Calling the target adapter according to the call information of the target adapter, obtaining the identification information of the target main node and the business parameter information from the aspect, and storing the identification information of the target main node and the business parameter information into the target database with the target main node as the storage dimension.

3. The method according to claim 2, wherein Transmitting the primary key identification and the call information of the target adapter to the any sub-node based on a thread local variable, including: If the any sub-node runs on a first thread, obtaining the primary key identification and the call information of the target adapter from the thread local variable, where the first thread is a thread responsible for maintaining the first inventory information corresponding to the domestic worker in the target inventory change scenario, and the thread local variable is a variable in the first thread; If any of the child nodes runs on a second thread, the primary key identifier and the call information of the target adapter in the thread local variable are passed to the any child node through an asynchronous event, and the second thread is a thread responsible for maintaining the second inventory information corresponding to the merchant in the target inventory change scenario.

4. The method according to claim 3, characterized in that It further includes: In the case where any of the child nodes runs on a first thread, perform a change operation on the first inventory information according to the any child node to generate the inventory change information; In the case where any of the child nodes runs on a second thread, perform a change operation on the second inventory information according to the any child node to generate the inventory change information; Wherein, the change operation includes at least one of an operation of initializing a service period, an operation of changing a service period status, and an operation of adjusting a work schedule.

5. The method according to claim 4, wherein It further includes: In the case where any of the child nodes generates the inventory change information, call the target adapter according to the call information of the target adapter, and based on the primary key information, store the inventory change information into the target database, and the target database assigns a sub-key identifier to the any child node and returns it to the target master node through the target adapter.

6. The method according to claim 3, characterized in that, The aspect also records the execution result of the first thread or the second thread, the aspect has a listening event, and the method further includes: During the running of the first thread or the second thread, start the listening event to listen to the running result of the first thread or the second thread, and record the running result in the aspect.

7. The method according to any one of claims 1-6, characterized in that, The inventory change scenario at least includes: directly assigning an aunt for an order, adding a work schedule, a merchant opening / closing working hours, an aunt taking / canceling a leave.

8. The method according to any one of claims 1 to 6, characterized in that It further includes: Receive an inventory change information query request, and the query request includes a query condition; Obtain the target inventory change information corresponding to the query condition in the target database according to the query condition; Output the target inventory change information to the initiator of the query request for the initiator to view the target inventory change information.

9. An electronic device, characterized in that, It includes: A memory and a processor; The memory is used for storing a computer program; the processor is coupled with the memory and is used for executing the computer program to implement the steps in the method according to any one of claims 1-8.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, the processor is caused to implement the steps in the method according to any one of claims 1-8.

11. A computer program product, characterized in that, The computer program product includes computer programs / instructions, and when the computer programs / instructions are executed by the processor, the processor is caused to be able to implement the steps in the method according to any one of claims 1 / 8.