Self-service weighing and settlement system and method for cafeteria
By collecting weight data to identify impact events, using a multilayer perceptron classifier to distinguish event types and dynamically matching stable waiting times, the problem of invalid waiting caused by weight impacts in self-service weighing systems is solved, improving weighing accuracy and system efficiency, and reducing customer waiting time.
Patent Information
- Application Number
- CN202511306665.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-12
- Publication Date
- 2026-01-16
AI Technical Summary
Existing self-service weighing and payment systems suffer from excessively long invalid waiting times due to the impact of weight when customers place their trays or add containers. Furthermore, they cannot intelligently distinguish between the impact of container placement and actual food retrieval actions, which affects the system's throughput efficiency and customer experience.
By collecting weight data on a weighing platform, impact events are identified, and time-domain, frequency-domain, and energy distribution features are extracted. A multilayer perceptron classifier is used to distinguish event types, and a stabilization waiting time is dynamically matched according to the event type. Combined with secondary stability verification, the weight data stability is ensured.
It significantly reduced the time spent waiting for unused items, improved the system's throughput efficiency during peak hours, reduced customer lag, and enhanced weighing accuracy and smoothness.
Smart Images

Figure CN121354259A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of self-service weighing and settlement technology, specifically to a self-service weighing and settlement system and method for self-service restaurants. Background Technology
[0002] Current self-service weighing and checkout systems rely on high-precision sensors to measure changes in the total weight of the tray in real time to calculate the weight of the food to be picked up. When a customer places a tray for the first time or adds an empty container to the weighing station, a significant, non-food weight impact occurs. The system must wait for this weight reading to stabilize completely, typically taking 1-3 seconds, before confirming the initial weight and initiating effective weighing. Although this forced waiting time is short, it accumulates significantly during peak hours, reducing system throughput and causing a sense of lag for customers. Current solutions mainly rely on simple delays or basic filtering algorithms, failing to intelligently distinguish between the container placement impact and the actual food pickup action, resulting in invalid waiting time being mechanically added to the process. Optimizing the dynamic response and stability determination of this brief moment is of practical significance for improving overall smoothness. Summary of the Invention
[0003] To address the shortcomings of existing technologies, this invention provides a self-service weighing and settlement system and method for self-service restaurants. It solves the problem that existing technologies rely on simple delay waiting or basic filtering algorithms, which fail to intelligently distinguish between container placement impacts and actual food picking actions, resulting in invalid waiting time.
[0004] To achieve the above objectives, the present invention provides the following technical solution: a self-service weighing and settlement method for a self-service restaurant, the method comprising: S1. When the weight changes on the weighing platform, the data acquisition module is triggered to continuously acquire the weight data output by the weight sensor at a preset sampling frequency, generating the original weight data time series. S2. Perform impact event identification on the original weight data time series. When the amplitude change of the original weight data time series exceeds the preset trigger threshold, extract the data within the time period of the change as the impact event weight data series. S3. Call the impact event feature extraction model to perform dynamic feature analysis on the impact event weight data sequence, and generate an impact event feature vector characterizing the physical characteristics of the impact event, wherein the impact event feature vector includes a time domain feature set, a frequency domain feature set, and an energy distribution feature set; S4. Input the impact event feature vector into a pre-trained transient stable classifier to perform event type inference and generate corresponding event type labels. The transient stable classifier is built based on a multilayer perceptron architecture. The event type label set includes initial plate placement event, empty container addition event, small portion food picking event, and large portion food picking event. S5. Based on the event type label, call the dynamic stable time decision module to determine the dynamic stable waiting time, wherein the dynamic stable time decision module stores a mapping table between event types and stable waiting times; S6. After the dynamic stabilization waiting time ends, record the current weight value as the new baseline weight and switch the system to the effective weighing state to calculate the net weight of the food to be added later.
[0005] Further, the step of identifying impact events in the original weight data time series, whereby when the amplitude change of the original weight data time series exceeds a preset trigger threshold, involves extracting data within that time period as the impact event weight data series, including: Set a first weight change rate threshold and a second weight change rate threshold; The original weight data time series is subjected to first-order difference processing to obtain the weight change rate series; When the absolute value of the weight change rate sequence first exceeds the first weight change rate threshold, the current time point is recorded as the start timestamp of the impact event. When the absolute value of the weight change rate sequence falls below the second weight change rate threshold for the first time after reaching its peak and remains below it for a preset duration, the current time point is recorded as the end timestamp of the impact event. The raw weight data between the start time stamp and the end time stamp of the impact event is extracted to form the weight data sequence of the impact event.
[0006] Furthermore, the step of invoking the impact event feature extraction model to perform dynamic feature analysis on the impact event weight data sequence, generating an impact event feature vector characterizing the physical properties of the impact event, includes: Time-domain analysis is performed on the weight data sequence of the impact event to extract the time-domain feature set, which includes the impact peak value, impact duration, mean weight after stabilization, root mean square value, kurtosis coefficient and peak factor. A fast Fourier transform is performed on the impact event weight data sequence to extract the frequency domain feature set, which includes the main frequency amplitude, the spectral centroid frequency, the spectral energy entropy, and the harmonic component ratio. Wavelet packet transform processing is performed on the impact event weight data sequence to extract the energy distribution feature set, which includes preset low-frequency subband energy proportion, mid-frequency subband energy proportion and high-frequency subband energy proportion; The time-domain feature set, frequency-domain feature set, and energy distribution feature set are combined to form the impact event feature vector.
[0007] Further, the step of inputting the impact event feature vector into a pre-trained transient stable classifier for event type inference and generating corresponding event type labels includes: Construct a multilayer perceptron network structure comprising an input layer, multiple hidden layers, and an output layer, wherein the number of neurons in the output layer is the same as the number of categories in the event type label set; The impact event feature vector is input into the input layer; The input features are nonlinearly transformed and mapped to a high dimension through the multiple hidden layers, and the hidden layers use modified linear units as activation functions. The output layer uses the Softmax function to calculate the probability distribution for each event type. Select the event type with the highest probability value in the probability distribution as the event type label output; The transient stable classifier is obtained by supervised learning training using a manually collected dataset containing a large number of pre-labeled event types.
[0008] Further, the step of invoking the dynamic stable time decision module to determine the dynamic stable waiting time based on the event type label includes: Establish a mapping table between the event types and stable waiting times, wherein a first stable waiting time is configured for the initial plate placement event, a second stable waiting time is configured for the empty container addition event, a third stable waiting time is configured for the small portion food picking event, and a fourth stable waiting time is configured for the large portion food picking event. The first stable waiting time and the second stable waiting time are greater than the third stable waiting time and the fourth stable waiting time; The fourth stable waiting time is greater than the third stable waiting time; Based on the event type label output by the transient stability classifier, the corresponding stable waiting time is retrieved from the mapping table and output as the dynamic stability waiting time.
[0009] Further, the step of performing wavelet packet transform processing on the impact event weight data sequence to extract the energy distribution feature set includes: The db5 wavelet basis function was used to perform a 4-level wavelet packet decomposition on the impact event weight data sequence to generate wavelet packet coefficients for 16 terminal nodes. Calculate the energy of the wavelet packet coefficients for each of the 16 terminal nodes; The sum of the energies of the first four terminal nodes is defined as the low-frequency subband energy, the sum of the energies of the fifth to tenth terminal nodes is defined as the mid-frequency subband energy, and the sum of the energies of the eleventh to sixteenth terminal nodes is defined as the high-frequency subband energy. Calculate the percentage of the low-frequency subband energy, mid-frequency subband energy, and high-frequency subband energy to the total energy, and use these percentages as the low-frequency subband energy percentage, mid-frequency subband energy percentage, and high-frequency subband energy percentage, respectively.
[0010] Furthermore, the transient stable classifier is obtained through supervised learning training using a manually collected dataset containing a large number of pre-labeled event types, including: In the experimental environment, by repeatedly placing different types and weights of plates and bowls, and picking up different amounts of food, the corresponding impact event weight data sequence was collected. Each collected impact event weight data sequence was manually labeled and given a true event type label. The labeled dataset is divided into a training set, a validation set, and a test set; The weight parameters of the multilayer perceptron network are iteratively optimized on the training set using the Adam optimizer and the cross-entropy loss function. The model's performance during training is evaluated and hyperparameters are adjusted using the validation set until the model's classification accuracy on the validation set reaches a preset standard.
[0011] Furthermore, the first stable waiting time, the second stable waiting time, the third stable waiting time, and the fourth stable waiting time are determined based on historical data statistical analysis, including: For each event type, a large number of impact event weight data sequence samples are extracted from historical datasets; For each sample, the time from the start timestamp of the impact event to the weight reading entering a steady state is calculated. The steady state is defined as the standard deviation of the weight value within a preset time window being less than a preset stability threshold. Perform statistical analysis on the duration of all samples of the same event type, and calculate their mean and standard deviation; The sum of the mean and twice the standard deviation, multiplied by a safety factor, is used as the stable waiting time corresponding to this event type and configured in the mapping table.
[0012] Furthermore, the method also includes: After the dynamic stabilization waiting time has ended, the secondary stabilization verification procedure is initiated. The secondary stability verification procedure continuously monitors weight data during the subsequent verification time window; Calculate the standard deviation of the weight data within the verification time window; If the standard deviation is less than the preset final stability threshold, the system is confirmed to be stable, and the operation of recording a new reference weight is performed. If the standard deviation is greater than or equal to the final stability threshold, the system is determined to be unstable, and an exception handling process is triggered. The exception handling process includes extending the waiting time or issuing an operation prompt to the user.
[0013] The present invention also provides a self-service weighing and settlement system for a self-service restaurant, characterized in that it includes a processor and a memory, the memory and the processor being connected, the memory being used to store programs, instructions and code, and the processor being used to execute the programs, instructions and code in the memory to implement the self-service weighing and settlement method for a self-service restaurant as described above. Beneficial effects
[0014] This invention collects weight data and identifies impact events, extracting time-domain, frequency-domain, and energy distribution features. Combined with a multilayer perceptron classifier, it accurately distinguishes event types such as initial plate placement, empty container addition, small-portion food retrieval, and large-portion food retrieval. Then, it dynamically matches stable waiting times based on event type, avoiding mechanical waiting. Simultaneously, secondary stability verification ensures stable weight data, improving weighing accuracy. This solution significantly reduces invalid waiting time, improves system throughput during peak hours, reduces customer operational lag, and makes the self-service weighing and checkout process smoother and more efficient. Attached Figure Description
[0015] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] Please see Figure 1 This invention provides a self-service weighing and payment method for self-service restaurants, the method comprising: S1. When the weight changes on the weighing platform, the data acquisition module is triggered to continuously acquire the weight data output by the weight sensor at a preset sampling frequency, generating the original weight data time series. S2. Perform impact event identification on the original weight data time series. When the amplitude change of the original weight data time series exceeds the preset trigger threshold, extract the data within the time period of the change as the impact event weight data series. S3. Call the impact event feature extraction model to perform dynamic feature analysis on the impact event weight data sequence, and generate impact event feature vectors that characterize the physical properties of the impact event. The impact event feature vectors include time domain feature sets, frequency domain feature sets and energy distribution feature sets. S4. Input the impact event feature vector into a pre-trained transient stable classifier to perform event type inference and generate corresponding event type labels. The transient stable classifier is built based on a multilayer perceptron architecture. The event type label set includes initial plate placement event, empty container addition event, small portion food picking event, and large portion food picking event. S5. Based on the event type label, call the dynamic stable time decision module to determine the dynamic stable waiting time. The dynamic stable time decision module stores a mapping table between event types and stable waiting times. S6. After the dynamic stabilization waiting time ends, record the current weight value as the new baseline weight and switch the system to the effective weighing state to calculate the net weight of the food to be added later.
[0018] Specifically, in practical applications, when a customer places their tray on the weighing platform, the weight on the platform changes, triggering the data acquisition module. The preset sampling frequency can be set to a higher frequency, such as 50Hz, which allows for more detailed capture of subtle weight changes, resulting in a more accurate reflection of the weight's change over time in the generated raw weight data time series.
[0019] When identifying impact events on the time series of raw weight data, the preset trigger threshold can be set according to the common weight change range in the actual scenario, such as 50 grams. When the weight change exceeds this value, it is considered that an impact event may have occurred, and the data for the corresponding time period is extracted.
[0020] By using an impact event feature extraction model for analysis, the characteristics of impact events can be mined from multiple dimensions, resulting in impact event feature vectors containing rich information. Inputting this feature vector into a transient stable classifier allows the classifier to accurately distinguish different event types, such as accurately determining whether it is the initial placement of a plate or the taking of a small portion of food.
[0021] The dynamic stabilization waiting time is then determined based on the event type, avoiding mechanical, fixed waiting. For example, for events involving picking up small portions of food, the waiting time can be set to be shorter. This allows the system to quickly enter an effective weighing state after the dynamic stabilization waiting time has elapsed, effectively reducing invalid waiting time, improving the system's throughput efficiency during peak hours, and alleviating customer lag.
[0022] This invention further proposes to identify impact events from raw weight data time series. When the amplitude change of the raw weight data time series exceeds a preset trigger threshold, data within that time period of change is extracted as the impact event weight data series, including: Set a first weight change rate threshold and a second weight change rate threshold; The original weight data time series is subjected to first-order difference processing to obtain the weight change rate series; When the absolute value of the weight change rate sequence first exceeds the first weight change rate threshold, the current time point is recorded as the start timestamp of the impact event. When the absolute value of the weight change rate sequence falls below the second weight change rate threshold for the first time after reaching its peak and remains below it for a preset duration, the current time point is recorded as the end timestamp of the impact event. The raw weight data between the start and end timestamps of the impact event is extracted to form the impact event weight data sequence.
[0023] Specifically, when setting the first weight change rate threshold and the second weight change rate threshold, for example, the first weight change rate threshold is set to 100 g / s and the second weight change rate threshold is set to 10 g / s, this can better distinguish between the beginning and the stable state of an impact event.
[0024] The original weight data time series is subjected to first-order differencing to obtain the weight change rate series, and the calculation formula is as follows: , in, This represents the rate of weight change at time k, expressed in grams per second. and These represent the weight data at the k-th and (k-1)-th time points, respectively, in grams. and These represent the times at the k-th and (k-1)-th moments, respectively, in seconds.
[0025] When the absolute value of the weight change rate sequence first exceeds the first weight change rate threshold, i.e. When the speed is measured in grams per second, the time point at that moment is recorded as the start timestamp of the impact event.
[0026] When the absolute value of the weight change rate sequence falls below the second weight change rate threshold for the first time after reaching its peak, that is... The data is recorded in grams per second, and for a preset duration such as 0.2 seconds, the current time point is recorded as the end timestamp of the impact event.
[0027] By extracting the weight data sequence of an impact event in this way, the entire impact event process can be accurately captured, providing an accurate data foundation for subsequent feature extraction and event type identification, and improving the accuracy of impact event identification.
[0028] This invention further proposes to use an impact event feature extraction model to perform dynamic feature analysis on the weight data sequence of impact events, generating impact event feature vectors characterizing the physical properties of the impact event, including: Time-domain analysis was performed on the weight data sequence of impact events to extract a time-domain feature set, which includes the impact peak value, impact duration, mean weight after stabilization, root mean square value, kurtosis coefficient, and peak factor. Fast Fourier Transform is performed on the impact event weight data sequence to extract the frequency domain feature set, which includes the main frequency amplitude, the spectral centroid frequency, the spectral energy entropy, and the harmonic component ratio. Wavelet packet transform is performed on the impact event weight data sequence to extract the energy distribution feature set, which includes the preset low-frequency subband energy ratio, mid-frequency subband energy ratio and high-frequency subband energy ratio. The time-domain feature set, frequency-domain feature set, and energy distribution feature set are combined to form the impact event feature vector.
[0029] Specifically, when performing time-domain analysis on the weight data sequence of an impact event, the impact peak value is the maximum weight value in the sequence; the impact duration is the difference between the end timestamp and the start timestamp of the impact event; and the average weight after stabilization is the average weight data over a period of time after the end of the impact event, for example, the average value is calculated by taking the data within 0.5 seconds after the end of the impact event.
[0030] The formula for calculating the root mean square value is: , in, Represents the root mean square value; It is the number of data points in the impact event weight data sequence; It is the weight value of the i-th data point.
[0031] The formula for calculating the kurtosis coefficient is: , in, Indicates the kurtosis coefficient; It is the mean of the weight data series; It is the standard deviation of the weight data series.
[0032] The formula for calculating the peak factor is: , in, Indicates the peak factor; It is the maximum value in the impact event weight data sequence.
[0033] After performing a Fast Fourier Transform on the weight data sequence of the impact event, the dominant frequency amplitude is the amplitude corresponding to the frequency with the highest energy in the spectrum; the centroid frequency of the spectrum reflects the concentration of spectral energy; the spectral energy entropy is used to describe the complexity of the spectrum; and the harmonic component ratio is the ratio of the energy of each harmonic to the energy of the fundamental wave.
[0034] By extracting these multi-domain features and combining them into impact event feature vectors, the physical characteristics of impact events can be comprehensively characterized, providing strong support for subsequent accurate event type reasoning and improving the accuracy of event identification.
[0035] This invention further proposes inputting the feature vector of an impact event into a pre-trained transient stable classifier for event type inference, generating corresponding event type labels, including: Construct a multilayer perceptron network structure that includes an input layer, multiple hidden layers, and an output layer, wherein the number of neurons in the output layer is the same as the number of categories in the event type label set; Input the impact event feature vector into the input layer; The input features are nonlinearly transformed and mapped to high dimensions through multiple hidden layers, with the hidden layers using modified linear units as activation functions. The Softmax function is used in the output layer to calculate the probability distribution of each event type. Select the event type with the highest probability value in the probability distribution as the event type label to output; The transient stable classifier is obtained through supervised learning training using a manually collected dataset containing a large number of pre-labeled event types.
[0036] Specifically, when constructing a multilayer perceptron network structure, for example, the number of neurons in the input layer is the same as the dimension of the impact event feature vector. If the feature vector has 20 dimensions, then the input layer has 20 neurons; the hidden layer can be set to 2 layers, with 32 neurons in the first layer and 16 neurons in the second layer; the number of neurons in the output layer is 4, corresponding to 4 event type labels.
[0037] The hidden layer uses the modified linear unit as the activation function, and its function expression is: , in, It is the input to the hidden layer neurons.
[0038] The output layer uses the Softmax function to calculate the probability distribution of each event type, as shown in the formula: , in, It is the input of the j-th neuron in the output layer; This represents the probability of the j-th event type.
[0039] When training a transient stable classifier, the manually collected dataset can be obtained by simulating the operations of different customers, such as inviting people of different ages to perform multiple operations of placing plates, adding empty containers, and picking up food.
[0040] By using such a multilayer perceptron network for event type reasoning, the nonlinear relationship between feature vectors and event types can be fully explored, the probability distribution of each event type can be accurately calculated, and the correct event type label can be output, thereby improving the accuracy of event type recognition and enabling the system to better distinguish different operation events.
[0041] This invention further proposes determining the dynamic stable waiting time by invoking a dynamic stable time decision module based on event type labels, including: Establish a mapping table between event types and stable waiting times, where a first stable waiting time is configured for the initial plate placement event, a second stable waiting time is configured for the empty container addition event, a third stable waiting time is configured for the small portion food picking event, and a fourth stable waiting time is configured for the large portion food picking event. The first and second stable waiting times are greater than the third and fourth stable waiting times; The fourth stable waiting time is greater than the third stable waiting time; Based on the event type label output by the transient stability classifier, the corresponding stable waiting time is retrieved from the mapping table and output as the dynamic stable waiting time.
[0042] Specifically, when establishing the mapping table between event types and stable waiting times, for example, the first stable waiting time is set to 2 seconds, the second stable waiting time is set to 1.8 seconds, the third stable waiting time is set to 0.5 seconds, and the fourth stable waiting time is set to 1 second.
[0043] This setup is because the initial plate placement and empty container addition events generate a larger impact, requiring a longer time for weight stabilization, while the food picking events have a relatively smaller impact and a shorter stabilization time. Furthermore, picking up large portions of food takes slightly longer to stabilize than picking up small portions.
[0044] After the transient stable classifier outputs the event type label, the dynamic stable time decision module can quickly retrieve the corresponding waiting time from the mapping table.
[0045] By dynamically determining the waiting time based on the event type, this method avoids invalid waiting caused by using the same waiting time for all events, thus improving the system's response speed and operating efficiency.
[0046] This invention further proposes wavelet packet transform processing of impact event weight data sequences to extract energy distribution feature sets, including: The db5 wavelet basis function was used to perform a 4-level wavelet packet decomposition on the impact event weight data sequence, generating wavelet packet coefficients for 16 terminal nodes. Calculate the energy of the wavelet packet coefficients for each of the 16 terminal nodes; The sum of the energies of the first four terminal nodes is defined as the low-frequency subband energy, the sum of the energies of the fifth to tenth terminal nodes is defined as the mid-frequency subband energy, and the sum of the energies of the eleventh to sixteenth terminal nodes is defined as the high-frequency subband energy. Calculate the percentage of low-frequency subband energy, mid-frequency subband energy, and high-frequency subband energy in the total energy, and use these percentages as the proportions of low-frequency subband energy, mid-frequency subband energy, and high-frequency subband energy, respectively.
[0047] Specifically, the db5 wavelet basis function was selected to perform a 4-level wavelet packet decomposition on the impact event weight data sequence, and the 16 terminal nodes obtained after decomposition correspond to different frequency ranges.
[0048] The energy calculation formula for the wavelet packet coefficients of each terminal node is as follows: , in, This represents the energy of the m-th terminal node; It is the number of wavelet packet coefficients of the m-th terminal node; It is the coefficient of the nth wavelet packet of the mth terminal node.
[0049] The total energy is the sum of the energies of the 16 terminal nodes, that is: , The formula for calculating the energy proportion of low-frequency subbands is: , The formula for calculating the energy proportion of the intermediate frequency sub-band is: , The formula for calculating the energy percentage of high-frequency subbands is: , in, , , These represent the energy percentages of the low-frequency, mid-frequency, and high-frequency sub-bands, respectively.
[0050] Through wavelet packet transform processing and energy calculation, the energy distribution of different frequency sub-bands can be accurately obtained. These energy distribution features can effectively distinguish different types of impact events. For example, the initial plate placement event may have a higher energy proportion in the low-frequency sub-band, while the small food picking event may have a higher energy proportion in the high-frequency sub-band, thereby improving the effectiveness of feature extraction.
[0051] This invention further proposes a transient stable classifier, which is obtained through supervised learning training using a manually collected dataset containing a large number of pre-labeled event types, including: In the experimental environment, by repeatedly placing different types and weights of plates and bowls, and picking up different amounts of food, the corresponding impact event weight data sequence was collected. Each collected impact event weight data sequence was manually labeled and given a true event type label. The labeled dataset is divided into a training set, a validation set, and a test set; The Adam optimizer and cross-entropy loss function are used to iteratively optimize the weight parameters of the multilayer perceptron network on the training set. The model's performance during training is evaluated and hyperparameters are adjusted using the validation set until the model's classification accuracy on the validation set reaches the preset standard.
[0052] Specifically, when collecting data in the experimental environment, various common plates and bowls can be prepared, with weights ranging from 100 grams to 500 grams. Different types of food such as rice and vegetables can be selected. Small portions can be set from 10 grams to 50 grams, and large portions from 50 grams to 200 grams. By repeating the operation multiple times, a rich sequence of impact event weight data can be obtained.
[0053] When manually labeling the collected data, professionals determine the event type corresponding to each sequence based on the actual operation.
[0054] When dividing the labeled dataset, for example, it can be divided into training set, validation set and test set in a ratio of 7:2:1.
[0055] The cross-entropy loss function used is as follows: , in, This represents the cross-entropy loss value; It is the number of training samples; It is the true label of the j-th event type of the i-th sample, and its value is 0 or 1; It is the true label of the j-th event type of the i-th sample, and its value is 0 or 1; It is the predicted probability of the j-th event type for the i-th sample.
[0056] The Adam optimizer optimizes network weight parameters by adaptively adjusting the learning rate. During training, the model performance is evaluated periodically using a validation set, for example, every 10 epochs. Based on the evaluation results, hyperparameters such as the learning rate and the number of hidden layer neurons are adjusted until the model's classification accuracy on the validation set reaches a preset standard, such as above 90%.
[0057] This training method can produce a transiently stable classifier with strong generalization ability and accurate classification, providing a reliable guarantee for subsequent accurate event type reasoning.
[0058] This invention further proposes that the first stable waiting time, the second stable waiting time, the third stable waiting time, and the fourth stable waiting time are determined based on historical data statistical analysis, including: For each event type, a large number of impact event weight data sequence samples are extracted from historical datasets; For each sample, calculate the time from the start timestamp of the impact event to the weight reading entering a steady state. The steady state is defined as the standard deviation of the weight value within a preset time window being less than a preset stability threshold. Perform statistical analysis on the duration of all samples of the same event type, and calculate their mean and standard deviation; The sum of the mean and twice the standard deviation, multiplied by a safety factor, is used as the stable waiting time corresponding to this event type and configured in the mapping table.
[0059] Specifically, when extracting samples for each event type, for example, extracting 1,000 impact event weight data sequence samples from the historical dataset for the initial plate placement event.
[0060] When calculating the time from the start of the impact event to stabilization for each sample, the preset time window can be set to 0.3 seconds, and the preset stabilization threshold can be set to 2 grams. That is, when the standard deviation of the weight value within 0.3 seconds is less than 2 grams, the weight is considered to have entered a stable state.
[0061] For the sample time length of the same event type, calculate the mean. and standard deviation All units are seconds.
[0062] The safety factor can be set according to the actual situation, for example, 1.2.
[0063] The formula for calculating the steady-state waiting time is: , in, Indicates the stable waiting time; This represents the safety factor.
[0064] For example, for the initial plate placement event, the calculated mean is 1.5 seconds and the standard deviation is 0.2 seconds. Therefore, the steady-state waiting time is... The time in seconds can be configured as the first stable waiting time.
[0065] By determining the waiting time based on historical data statistical analysis, the set waiting time can ensure weight stability without being too long and causing invalid waiting, thus improving the rationality and accuracy of the waiting time setting.
[0066] This invention further proposes a secondary stability verification procedure, including: After the dynamic stabilization waiting period ends, the secondary stabilization verification procedure is initiated. The secondary stability verification procedure continuously monitors weight data during the subsequent verification time window; Calculate the standard deviation of the weight data within the validation time window; If the standard deviation is less than the preset final stability threshold, the system is confirmed to be stable, and the operation of recording a new reference weight is performed. If the standard deviation is greater than or equal to the final stability threshold, the system is determined to be unstable, triggering an exception handling process. The exception handling process includes extending the waiting time or issuing an operation prompt to the user.
[0067] Specifically, after the dynamic stabilization waiting time ends, a secondary stabilization verification procedure is initiated. The verification time window can be set to 0.4 seconds, during which weight data is continuously monitored.
[0068] The standard deviation of weight data within the validation time window is calculated using the following formula: , in, Indicates standard deviation; It is the number of weight data points within the verification time window; It is the i-th weight data point; It is the mean of the weight data within the verification time window.
[0069] The preset final stability threshold can be set to 1.5 grams. When the calculated standard deviation is less than 1.5 grams, the system is confirmed to be stable, and the operation of recording a new baseline weight is performed.
[0070] If the standard deviation is greater than or equal to 1.5 grams, the system is determined to be unstable, triggering an abnormal handling process. For example, the waiting time may be extended by 0.5 seconds, or a prompt may be sent to the user on the display screen of the weighing platform to "Please wait for the weight to stabilize".
[0071] The secondary stability verification procedure further ensures that the system is in a stable state when recording the baseline weight, improving the accuracy of weight measurement and reducing settlement errors caused by weight instability.
[0072] The present invention further proposes a self-service weighing and settlement system for a self-service restaurant, including a processor and a memory, the memory and the processor being connected, the memory being used to store programs, instructions and code, and the processor being used to execute the programs, instructions and code in the memory to implement any of the above-mentioned self-service weighing and settlement methods for a self-service restaurant.
[0073] Specifically, in this self-service weighing and settlement system for self-service restaurants, the processor can be a common central processing unit, such as a processor based on ARM or x86 architecture, which has strong data processing capabilities and can quickly execute various calculations and logical judgments.
[0074] The memory can include random access memory and read-only memory. Random access memory is used to temporarily store data and intermediate results generated during processor operation, while read-only memory is used to store fixed code such as the system's startup program.
[0075] When the system is running, the processor reads and executes relevant programs from the memory. For example, when the weight on the weighing platform changes, the processor controls the data acquisition module to collect data at a preset frequency, processes and analyzes the raw data, identifies impact events, extracts feature vectors, performs event type inference through a transient stability classifier, determines the dynamic stability waiting time, and records the new benchmark weight after the waiting time ends.
[0076] The system can implement the above-mentioned self-service weighing and settlement method. By intelligently distinguishing different event types and dynamically adjusting the stable waiting time, it reduces invalid waiting, improves the system's operating efficiency and user experience, and makes the self-service weighing and settlement process smoother.
[0077] In summary, this invention collects weight data and identifies impact events, extracting time-domain, frequency-domain, and energy distribution features. Combined with a multilayer perceptron classifier, it accurately distinguishes event types such as initial plate placement, empty container addition, and the taking of small and large portions of food. Then, it dynamically matches stable waiting times based on event type, avoiding mechanical waiting. Simultaneously, secondary stability verification ensures stable weight data, improving weighing accuracy. This solution significantly reduces invalid waiting time, improves system throughput during peak hours, reduces customer operational lag, and makes the self-service weighing and checkout process smoother and more efficient.
[0078] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0079] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A self-service weighing settlement method for a buffet restaurant, characterized by, The method comprises: S1, when the weight change occurs on the weighing table, triggering the data acquisition module to continuously acquire the weight data output by the weight sensor at a preset sampling frequency to generate an original weight data time sequence; S2, performing impact event identification on the original weight data time sequence, and when the amplitude change of the original weight data time sequence exceeds a preset trigger threshold, intercepting the data in the change time period as an impact event weight data sequence; S3, calling an impact event feature extraction model to perform dynamic feature analysis on the impact event weight data sequence to generate an impact event feature vector representing the physical characteristics of the impact event, wherein the impact event feature vector comprises a time domain feature set, a frequency domain feature set, and an energy distribution feature set; S4, inputting the impact event feature vector into a pre-trained transient stability classifier for event type reasoning to generate a corresponding event type label, wherein the transient stability classifier is constructed based on a multi-layer perception architecture, and the event type label set comprises an initial dish placement event, an empty container addition event, a small portion food picking event, and a large portion food picking event; S5, according to the event type label, calling a dynamic stability time decision module to determine a dynamic stability waiting time, wherein the dynamic stability time decision module stores a mapping relationship table of event type and stability waiting time; S6, after the dynamic stability waiting time ends, recording the current weight value as a new reference weight, and switching the system to an effective weighing state to calculate the net weight of the subsequent added food.
2. The self-service weighing settlement method for a buffet restaurant according to claim 1, characterized in that, The impact event identification on the original weight data time sequence, when the amplitude change of the original weight data time sequence exceeds a preset trigger threshold, intercepting the data in the change time period as an impact event weight data sequence, comprises: setting a first weight change rate threshold and a second weight change rate threshold; performing first-order difference processing on the original weight data time sequence to obtain a weight change rate sequence; when the absolute value of the weight change rate sequence first exceeds the first weight change rate threshold, recording the current time point as an impact event start timestamp; when the absolute value of the weight change rate sequence first falls below the second weight change rate threshold after reaching a peak value and lasts for a preset time length, recording the current time point as an impact event end timestamp; intercepting the original weight data between the impact event start timestamp and the impact event end timestamp to constitute the impact event weight data sequence.
3. The self-service weighing settlement method for a buffet restaurant according to claim 1, characterized by, The calling of the impact event feature extraction model to perform dynamic feature analysis on the impact event weight data sequence to generate an impact event feature vector representing the physical characteristics of the impact event comprises: performing time domain analysis on the impact event weight data sequence to extract the time domain feature set, which comprises an impact peak value, an impact duration, a stable weight mean value, a root mean square value, a kurtosis coefficient, and a peak factor; performing fast Fourier transform on the impact event weight data sequence to extract the frequency domain feature set, the frequency domain feature set including a main frequency amplitude, a spectral centroid frequency, a spectral energy entropy, and a harmonic component ratio; performing wavelet packet transform processing on the impact event weight data sequence to extract the energy distribution feature set, the energy distribution feature set including a preset low-frequency sub-band energy ratio, a medium-frequency sub-band energy ratio, and a high-frequency sub-band energy ratio; combining the time domain feature set, the frequency domain feature set, and the energy distribution feature set into the impact event feature vector.
4. The self-service weighing settlement method for a buffet restaurant according to claim 1, wherein The inputting of the impact event feature vector into the pre-trained transient stability classifier for event type reasoning to generate a corresponding event type label includes: constructing a multi-layer perceptron network structure including an input layer, multiple hidden layers, and an output layer, wherein the number of neurons of the output layer is the same as the number of categories of the event type label set; inputting the impact event feature vector into the input layer; performing nonlinear transformation and high-dimensional mapping of the input features through the multiple hidden layers, the hidden layers using a rectified linear unit as an activation function; calculating the probability distribution of each event type at the output layer using a Softmax function; selecting the event type with the maximum probability value in the probability distribution as the event type label output; The transient stability classifier is obtained through supervised learning training using a large amount of artificially collected data set containing pre-labeled event types.
5. The self-service weighing settlement method for a buffet restaurant according to claim 1, wherein The determination of the dynamic stability waiting time according to the event type label includes: establishing a mapping relationship table between the event type and the stability waiting time, wherein a first stability waiting time is configured for the initial dish placement event, a second stability waiting time is configured for the empty container addition event, a third stability waiting time is configured for the small-portion food picking event, and a fourth stability waiting time is configured for the large-portion food picking event; The first stability waiting time and the second stability waiting time are greater than the third stability waiting time and the fourth stability waiting time; The fourth stability waiting time is greater than the third stability waiting time; According to the event type label output by the transient stability classifier, the corresponding stability waiting time is retrieved and output from the mapping relationship table as the dynamic stability waiting time.
6. The self-service weighing settlement method for a buffet restaurant according to claim 3, wherein The wavelet packet transform processing on the impact event weight data sequence to extract the energy distribution feature set includes: selecting a db5 wavelet basis function to perform 4-layer wavelet packet decomposition on the impact event weight data sequence to generate 16 terminal node wavelet packet coefficients; calculating the energy of the wavelet packet coefficients of each node in the 16 terminal nodes; defining the energy sum of the first four terminal nodes as the low-frequency sub-band energy, the energy sum of the fifth to tenth terminal nodes as the medium-frequency sub-band energy, and the energy sum of the eleventh to sixteenth terminal nodes as the high-frequency sub-band energy; The percentages of the low-frequency sub-band energy, the medium-frequency sub-band energy and the high-frequency sub-band energy in the total energy are calculated as the low-frequency sub-band energy percentage, the medium-frequency sub-band energy percentage and the high-frequency sub-band energy percentage.
7. The self-service weighing settlement method for a buffet restaurant according to claim 4, characterized by, The transient stability classifier is obtained by supervised learning training using a large number of artificially collected data sets containing pre-labeled event types, including: In an experimental environment, different types and weights of dishes, bowls and different quantities of dishes are repeatedly placed and picked up to collect corresponding impact event weight data sequences; Each impact event weight data sequence collected is manually labeled to give it a real event type label; The labeled data set is divided into a training set, a validation set and a test set; The Adam optimizer and the cross-entropy loss function are used to iteratively optimize the weight parameters of the multi-layer perceptron network on the training set; The performance of the model during training is evaluated using the validation set and the hyperparameters are adjusted until the classification accuracy of the model on the validation set reaches the preset standard.
8. The self-service weighing settlement method for a buffet restaurant according to claim 5, wherein The first stable waiting time, the second stable waiting time, the third stable waiting time and the fourth stable waiting time are determined based on historical data statistical analysis, including: For each event type, a large number of impact event weight data sequence samples are extracted from the historical data set; For each sample, calculate the length of time from the impact event start timestamp to the time when the weight reading enters a stable state, where the stable state is defined as the standard deviation of the weight value within a preset time window being less than a preset stable threshold; Statistical analysis is performed on the time length of all samples of the same event type to calculate the mean and standard deviation; The sum of the mean and twice the standard deviation is multiplied by a safety factor to obtain the stable waiting time corresponding to the event type, which is configured in the mapping relationship table.
9. The self-service weighing settlement method for a buffet restaurant according to claim 1, wherein, The method further comprises: After the end of the dynamic stable waiting time, a secondary stability verification program is started; The secondary stability verification program continuously monitors the weight data within a subsequent verification time window; The standard deviation of the weight data within the verification time window is calculated; If the standard deviation is less than a preset final stability threshold, the system is confirmed to be stable, and the operation of recording a new reference weight is performed; If the standard deviation is greater than or equal to the final stability threshold, the system is determined to be unstable, triggering an exception handling process, which includes extending the waiting time or issuing an operation prompt to the user.
10. A self-service weighing settlement system for a buffet restaurant, characterized by, A processor and a memory are included, the memory and the processor are connected, the memory is used to store programs, instructions and codes, and the processor is used to execute the programs, instructions and codes in the memory to realize the self-service weighing settlement method for a buffet restaurant according to any one of claims 1-9.