A cheating detection method and device for an electronic scale, an electronic device, and a storage medium

By generating an exhaustive traversal sequence to simulate key presses and parsing the response data, and combining this with a hash function to verify the consistency of weighing and display data, the problem of low efficiency in existing electronic scale anti-cheating technologies is solved, achieving efficient and accurate cheating detection.

CN120721200BActive Publication Date: 2026-07-14SHANDONG MEASUREMENT SCI RES INST +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANDONG MEASUREMENT SCI RES INST
Filing Date
2025-06-30
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing anti-cheating technologies for electronic scales are inefficient and struggle to prevent advanced cheating attempts, especially in commercial transactions where cheating is difficult to detect.

Method used

By acquiring the key command set of the electronic scale, an exhaustive traversal sequence is generated, key operations are simulated, response data is parsed, the correctness of the password combination is determined, and the consistency between the weighing and display data is verified through a hash function to identify cheating behavior.

Benefits of technology

It improves the efficiency and accuracy of electronic scale cheating detection, can automatically identify and prevent data tampering, reduce the risk of misjudgment, and enhance the flexibility and security of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120721200B_ABST
    Figure CN120721200B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of electronic scale, and particularly relates to a cheating detection method and device of an electronic scale, an electronic device and a storage medium, the method comprising: S1, obtaining a key instruction set; S2, generating an exhaustive traversal sequence covering multiple password combinations based on the key instruction set; S3, converting a password candidate list into a communication instruction sequence, and simulating key operation according to the communication instruction sequence; S4, obtaining response data corresponding to the password combinations, judging whether each password combination is correct based on the response data, and obtaining a verification result; S5, generating a detection operation log based on the operation time corresponding to the password combinations and the verification result; S6, generating a target control sequence based on a target password combination, and simulating key operation according to the target control sequence; under the human key operation, obtaining weighing data and display data, and judging whether cheating exists based on the weighing data and the display data. The present application improves the efficiency and accuracy of cheating detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electronic scale technology, and specifically to a method, device, electronic equipment, and storage medium for detecting cheating on electronic scales. Background Technology

[0002] With the development of technology and the increase in market demand, electronic scales have been widely used in various industries such as retail, logistics, and pharmaceuticals. Electronic scales are typically characterized by high precision and fast response to meet various needs for accurate measurement.

[0003] However, the widespread use of electronic scales also brings the risk of cheating, especially in commercial transactions. Unscrupulous individuals may manipulate weighing results to gain illicit profits. Cheating on electronic scales typically involves manipulating internal software or hardware settings to alter the scale's measurement parameters or output. One of the most common methods is activating a hidden cheating mode by entering a specific password or sequence of operations. Once activated, the displayed weighing data may not match the actual weight, such as by reducing or increasing the weight, thus affecting the fairness of the transaction. This password-protected cheating mode provides unscrupulous individuals with the opportunity to manipulate the scale while making the cheating difficult to detect.

[0004] Despite the availability of various electronic scales and corresponding security measures on the market, existing anti-cheating technologies still have many limitations. First, the security features of many electronic scales are insufficient to prevent advanced cheating attempts, such as password-based entry. Second, even when some electronic scales have cheat detection functions, these functions often require manual operation and monitoring, which is time-consuming, labor-intensive, and inefficient.

[0005] Therefore, there is an urgent need for a method to detect cheating on electronic scales. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention provides a method, device, electronic equipment, and storage medium for detecting cheating on electronic scales. These methods and devices can be used to prevent cheating on electronic scales, improving the efficiency and accuracy of cheating detection.

[0007] This invention is achieved through the following technical solution:

[0008] A method for detecting cheating on electronic scales is provided, comprising the following steps:

[0009] S1. Obtain the button instruction set, which includes the mode switching button and the confirmation button of the electronic scale;

[0010] S2. Based on the key instruction set, generate an exhaustive traversal sequence covering several password combinations. The exhaustive traversal sequence includes a password candidate list, and the password combination is the input password for the electronic scale to activate the cheating mode.

[0011] S3. Convert the candidate password list into a sequence of communication instructions, and simulate key presses according to the sequence of communication instructions to traverse each password combination included in the candidate password list.

[0012] S4. Obtain the response data corresponding to each password combination, and based on the response data, determine whether each password combination is correct and obtain the verification result, which includes whether the password is correct or incorrect.

[0013] S5. Generate a detection operation log based on the operation time and verification result corresponding to each password combination.

[0014] S6. Determine the target password combination corresponding to the target verification result in the detection operation log, and select the target password combination with the correct password as the target verification result.

[0015] Based on the target password combination, a target control sequence is generated, and key operations are simulated according to the target control sequence;

[0016] Under human button operation, the system acquires and displays weighing data, and determines whether cheating occurs based on the weighing and display data.

[0017] By employing the aforementioned technical solution, the key command set of the electronic scale is acquired, and an exhaustive traversal sequence containing multiple password combinations is generated based on this set. These password combinations are then converted into communication command sequences to simulate key presses, effectively traversing all possible passwords for the electronic scale. During this traversal, the response data corresponding to each password combination is acquired, and the correctness of the password is determined based on this data, accurately identifying the correct password for the electronic scale. Simultaneously, by recording the operation time and verification results of each password combination, a detection operation log is generated, providing crucial evidence for subsequent cheating behavior detection. Based on identifying the target password combination that enables the electronic scale's cheating mode, a correct target password combination is selected, and a target control sequence is generated based on this combination to simulate key presses. This allows for the collection of weighing and display data in cheating mode, and further, the consistency between the two is used to determine cheating behavior. This effectively identifies potential data tampering and display cheating issues that may occur during actual weighing, improving the authenticity and effectiveness of cheating detection. This method improves the detection efficiency and accuracy of cheating mode identification.

[0018] Furthermore, in step S2, the sequence is exhaustively traversed, specifically including:

[0019] The password length is determined based on the key instruction set, and different password combinations are generated based on the password length to obtain a preliminary password candidate list. The preliminary password candidate list is then filtered according to preset password rules to obtain a password candidate list that conforms to the preset password rules. The preset password rules include three types of password rules: all-numeric combinations, mixed combinations of letters and numbers, and mixed combinations of symbols, letters, and numbers.

[0020] By determining the password length based on the keystroke command set and generating different password combinations based on the password length, a comprehensive preliminary password candidate list can be obtained. Then, filtering this preliminary password candidate list according to preset password rules can remove combinations that clearly violate password setting conventions, such as combinations consisting entirely of letters or symbols. This effectively reduces the number of brute-force passwords encountered without affecting the password coverage, thus improving detection efficiency.

[0021] Furthermore, in step S3, the candidate password list is converted into a sequence of communication instructions, specifically including:

[0022] Each password combination in the password candidate list is mapped to a corresponding key sequence. The key sequence consists of at least one of number keys, mode switching keys, and confirmation keys. According to the electronic scale communication protocol, the key sequence is converted into a corresponding communication command, a communication command sequence is generated, and the communication command sequence is sent to the electronic scale through the communication interface. The electronic scale communication protocol includes the mapping relationship between key sequences and communication commands.

[0023] Converting the candidate password list into a sequence of communication commands transforms key steps in the password detection process—password input and confirmation—into commands that the scale can directly recognize and execute. This avoids the instability and inconsistencies caused by manual operation, improving the automation level of the detection process. Simultaneously, by mapping passwords to standard key sequences and translating them into corresponding communication commands according to the scale's communication protocol, the generated command sequence ensures complete consistency with the scale's actual operation, improving detection accuracy. Furthermore, sending command sequences directly to the scale via the communication interface enables remote control and automated testing, eliminating the need for on-site manual operation and enhancing the flexibility and efficiency of the detection process.

[0024] Furthermore, in step S4, based on the response data, it is determined whether each password combination is correct to obtain the verification result, specifically including:

[0025] Parse the response data to extract key information related to password verification, including the response status code, response time, and response content.

[0026] Based on preset judgment rules, key information is used to determine whether each password combination is correct. The preset judgment rules include determining whether the response status code is a preset value, determining whether the response time exceeds a preset threshold, or determining whether the response content contains preset keywords.

[0027] If the response status code is determined to be the preset value, the response time is less than the preset threshold, and the response content contains the preset keywords, then the verification result is determined to be a correct password.

[0028] If the response status code is not the preset value, or the response time is greater than or equal to the preset threshold, or the response content does not contain the preset keywords, then the verification result is determined to be an incorrect password.

[0029] By analyzing the response data returned by the electronic scale and extracting key information directly related to password verification, such as the response status code, response time, and response content, the password verification result can be comprehensively evaluated. By setting preset judgment rules and comprehensively utilizing these three types of key information, the correct password can be accurately identified, effectively reducing the risk of false positives. For example, the status code alone is sometimes insufficient to distinguish between a correct and incorrect password, but combining the response time and content allows for a more accurate judgment. Furthermore, since different electronic scale models may use different response data formats, abstracting key information such as status codes, time, and content, and setting preset judgment rules, can improve the applicability of the method and reduce dependence on the electronic scale model.

[0030] Furthermore, in step S6, determining whether cheating has occurred specifically includes:

[0031] Acquire the output signal of the weighing sensor and analyze the output signal to obtain the weighing data;

[0032] A preset hash function is used to perform hash calculations on the time points corresponding to the weighing data and the weighing data to obtain the first verification value.

[0033] Acquire the display image of the electronic scale, parse the display image, and obtain the display data;

[0034] A preset hash function is used to perform hash calculations on the displayed data and the corresponding time points to obtain a second check value; then it is determined whether the first check value and the second check value are the same.

[0035] If the first checksum and the second checksum are the same, cheating is confirmed and a cheating alarm is triggered.

[0036] Acquire the display image of the electronic scale, parse the display image, and obtain the display data, specifically including:

[0037] The display cache data of the electronic scale's screen is obtained in real time through data connection; the display cache data is parsed to obtain the original display data; the original display data is post-processed to remove non-numeric characters and units to obtain the final display data.

[0038] By directly acquiring the display cache data inside the electronic scale through a data connection, real-time images of the scale's display screen can be quickly and reliably captured without relying on external camera equipment. By acquiring and parsing the output signal of the weighing sensor to obtain the weighing data, the actual weight value measured by the scale can be directly reflected. Comparing this objective data with the weight value displayed on the scale can detect potential discrepancies and anomalies. To prevent tampering with the weighing data during transmission and processing, a preset hash function can be used to calculate a hash value for verifying data integrity based on the weighing data and the corresponding time point. Similarly, by parsing and hashing the scale's display data, another hash value reflecting the integrity of the display data can be obtained. Comparing these two hash values, if they are inconsistent, it can be determined that there is a problem between the scale's displayed data and the actual weighing data, indicating cheating. This method, by introducing a hash function, can effectively verify the integrity and consistency of the scale's data without storing and transmitting the original sensitive data, significantly improving the detection rate of cheating. At the same time, since hash calculation is irreversible, it can effectively protect the confidentiality of the original data and improve the security of the detection process.

[0039] An electronic scale cheating detection device using an electronic scale cheating detection method includes an acquisition module and a processing module, wherein:

[0040] The acquisition module is used to acquire the key command set.

[0041] The processing module is used to generate an exhaustive traversal sequence covering multiple password combinations based on the key instruction set. The exhaustive traversal sequence includes a password candidate list, and the password combination is the input password for the electronic scale to activate the cheating mode.

[0042] The processing module is also used to convert the password candidate list into a sequence of communication instructions, and to simulate key operations according to the sequence of communication instructions in order to traverse the various password combinations included in the password candidate list.

[0043] The acquisition module is also used to acquire the response data corresponding to each password combination, and based on the response data, to determine whether each password combination is correct and to obtain the verification result, which includes whether the password is correct or incorrect.

[0044] The processing module is also used to generate detection operation logs based on the operation time and verification results corresponding to each password combination.

[0045] An electronic device using a cheat detection method for an electronic scale includes a processor, a memory, a user interface, and a network interface. The memory stores instructions, the user interface and the network interface are used for communication with other devices, and the processor executes the instructions stored in the memory containing the cheat detection method for the electronic scale.

[0046] A computer-readable storage medium storing instructions for a cheating detection method for an electronic scale. When the instructions are executed, the cheating detection method for the electronic scale is performed.

[0047] The beneficial effects of this invention are:

[0048] By acquiring the key command set of the electronic scale and generating an exhaustive traversal sequence containing multiple password combinations based on this set, and then converting these password combinations into communication command sequences to simulate key presses, all possible passwords for the electronic scale can be effectively traversed. During the traversal, by acquiring the response data corresponding to each password combination and determining the password's correctness based on this data, the correct password for the electronic scale can be accurately identified. Simultaneously, by recording the operation time and verification result of each password combination, a detection operation log is generated, providing crucial evidence for subsequent cheating detection. This method can be used to prevent cheating on electronic scales, improving the efficiency and accuracy of cheating detection. Attached Figure Description

[0049] Figure 1 This is a flowchart illustrating the present invention.

[0050] Figure 2 This is a schematic diagram of the cheating detection device for the electronic scale in this invention.

[0051] Figure 3 This is a schematic diagram of the structure of an electronic device according to the present invention.

[0052] 201. Acquisition module; 202. Processing module; 300. Electronic device; 301. Processor; 302. Communication bus; 303. User interface; 304. Network interface; 305. Memory. Detailed Implementation

[0053] To clearly illustrate the technical features of this solution, the following detailed implementation method will be used to explain the solution.

[0054] A method for detecting cheating on electronic scales, referring to Figure 1 This method is applied to a controller that executes a cheating detection program for an electronic scale. The method includes the following steps:

[0055] Step S1: Obtain the button instruction set, which includes the mode switching button and the confirmation button of the electronic scale.

[0056] In step S1, the controller first acquires the key instruction set of the electronic scale to be tested, which is the basis for subsequently generating the password candidate list and simulating key operations. The key instruction set contains specific information about the electronic scale's mode switching key and confirmation key, such as the numeric code of the mode switching key, the function code of the confirmation key, and the number keys.

[0057] To obtain the key command set, the controller can employ several methods. One method is to access a pre-set database of electronic scale features. This database records detailed parameters of mainstream electronic scale models on the market, including key command information such as mode switching keys and confirmation keys for each model. The controller can then query the database and retrieve the corresponding key command set based on the model of the electronic scale to be tested.

[0058] For example, assuming the scale to be tested is a scale of brand A, model B, the controller will search for the entry "brand A, model B" in the scale feature database and extract the recorded information such as the mode switching key code (e.g., "000" represents the mode switching key) and the confirmation key function code (e.g., "Enter" represents the confirmation key), to form the key instruction set for that model of scale.

[0059] However, there are numerous models of electronic scales, and the pre-built database of scale features may not cover all models. For electronic scale models not included in the database, the controller can prompt the user to manually select or input the corresponding button commands through a human-machine interface. For example, if the controller cannot find a button command set matching the model, it can display a schematic diagram of the electronic scale buttons and guide the user to click or input the location or name of the mode switch button and the confirmation button, thereby manually obtaining the button command set.

[0060] After obtaining the button command set, the controller can also update it to the electronic scale feature database. On the one hand, this can improve the model coverage of the electronic scale feature database; on the other hand, it can also improve data reliability by using crowdsourcing to verify and optimize the button command set of the same model of electronic scale using input from multiple users.

[0061] Step S2: Based on the key instruction set, generate an exhaustive traversal sequence covering multiple password combinations, including a list of password candidates.

[0062] In step S2, an exhaustive traversal sequence covering multiple password combinations is generated based on the key instruction set. Specifically, this includes: determining the password length based on the key instruction set, and generating different password combinations based on the password length to obtain a preliminary password candidate list; filtering the preliminary password candidate list according to preset password rules to obtain a password candidate list that conforms to the preset password rules. The preset password rules include three types of password rules: all-numeric combinations, mixed combinations of letters and numbers, and mixed combinations of symbols, letters, and numbers.

[0063] Specifically, the controller generates an exhaustive traversal sequence covering various password combinations based on the acquired key press command set. The core of this exhaustive traversal sequence is the password candidate list, which encompasses all possible values ​​for the electronic scale's password. First, the controller determines the digit range of the electronic scale's password based on the key press command set. Typically, the password length for activating cheating mode on an electronic scale has a reasonable range—neither too short (making the password too simple) nor too long (making it difficult for the user to remember and input). The controller can determine the default password length, such as 4 digits, by considering factors such as the electronic scale's model and purpose. After determining the password length, the controller begins generating various different password combinations. This uses an exhaustive traversal sequence, listing all possible character combinations for a given number of digits. For example, if the password length is 4 digits and only numbers are considered, then the password combinations include all 10,000 possibilities from "0000" to "9999". If a mixture of letters and numbers is considered, the number of combinations becomes even larger. The controller recursively generates all permutations and combinations by iterating through the optional characters of each password, forming a preliminary password candidate list.

[0064] However, this initial list may contain a large number of invalid or weak passwords, such as combinations consisting entirely of 0s or consecutive number sequences like "1234". To improve detection efficiency, the controller also filters the initial list, eliminating combinations that do not conform to the password setting specifications. Several preset password rules are introduced here. These preset rules include three classic combination forms: all-numeric combinations, mixed alphanumeric combinations, and mixed combinations of symbols, letters, and numbers. All-numeric combinations require only numeric characters from 0 to 9; mixed alphanumeric combinations require the password to contain both numbers and uppercase and lowercase letters; and mixed combinations of symbols, letters, and numbers further require the inclusion of special symbols. In addition, there may be requirements regarding the quantity and position of each character; for example, mixed combinations must contain at least two numbers and two letters, and the first and last characters cannot both be numbers. The controller checks each password combination in the initial list against the preset password rules, filtering out combinations that do not meet the requirements, resulting in a candidate list of passwords that conform to the password setting specifications.

[0065] Step S3: Convert the password candidate list into a communication instruction sequence, and simulate key operations according to the communication instruction sequence to traverse each password combination included in the password candidate list.

[0066] The process of converting the password candidate list into a communication instruction sequence includes: mapping each password combination in the password candidate list to a corresponding key sequence, wherein the key sequence consists of at least one of numeric keys, mode switching keys, and confirmation keys; converting the key sequence into corresponding communication instructions according to the electronic scale communication protocol, thereby generating a communication instruction sequence, wherein the electronic scale communication protocol includes the mapping relationship between key sequences and communication instructions; and sending the communication instruction sequence to the electronic scale through the communication interface.

[0067] Specifically, the controller converts the password candidate list into communication commands that can be directly sent to the electronic scale, and iterates through each password combination in the password candidate list by simulating human key presses to test whether it is the correct password.

[0068] First, the controller maps the password combinations in the candidate password list to corresponding key sequences. This mapping process essentially converts the character form of the password into operational instructions that the scale can recognize. For example, for the password "123456", the key sequence is to press the number keys 1, 2, 3, 4, 5, and 6 in sequence. For the password "abc123", the key sequence might be to first press the mode switch key to switch to letter input mode, then press the letter keys a, b, and c in sequence, then switch back to number mode and press the number keys 1, 2, and 3. Regardless of the combination, the key sequence is represented by a combination of number keys, the mode switch key, and the confirmation key; the specific instructions for these keys are the previously acquired key instruction set.

[0069] After generating the key sequence, the controller further converts it into a command format for communication with the scale. This step requires adherence to the scale's communication protocol. The scale communication protocol defines the data exchange standard between the scale and external devices, including various key operations and their corresponding communication commands. The controller can obtain this protocol information from the scale's feature database.

[0070] For example, suppose the communication protocol of a certain model of electronic scale stipulates that pressing the number key 1 corresponds to the instruction "N1", pressing the mode switch key corresponds to the instruction "PW", and pressing the confirmation key corresponds to the instruction "OK". Then the key sequence "1-2-3-mode switch key-4-5-6-confirm key" will be converted into the communication instruction sequence "N1-N2-N3-PW-N4-N5-N6-OK".

[0071] The controller, following the above method, converts each password combination in the password candidate list into a corresponding communication command, forming a complete communication command sequence. This communication command sequence simulates the entire process of manually entering a password. By continuously sending key presses, the electronic scale enters the password verification process and attempts every possible password value.

[0072] After generating the communication command sequence, the controller sends these commands to the target scale via a physical or virtual communication interface. The communication interface can take various forms, such as wired interfaces like USB or serial ports, or wireless interfaces like WiFi or Bluetooth. The controller calls the corresponding communication interface API to send the key commands corresponding to each password combination to the scale sequentially, according to the command sequence, simulating a human key input process.

[0073] While sending communication commands, the controller also monitors the scale's response information in real time. After receiving each password combination, the scale returns an operation result, such as whether the password is correct or incorrect. By analyzing this response data, the controller can determine whether the current password combination is correct and thus find the actual password used to activate the cheating mode.

[0074] Step S4: Obtain the response data corresponding to each password combination, and based on the response data, determine whether each password combination is correct to obtain the verification result, which includes whether the password is correct or incorrect.

[0075] Based on the response data, the system determines whether each password combination is correct and obtains the verification result. Specifically, this includes: parsing the response data to extract key information related to password verification, including the response status code, response time, and response content; using preset judgment rules to determine whether each password combination is correct, including whether the response status code is a preset value, whether the response time exceeds a preset threshold, or whether the response content contains preset keywords; if the response status code is a preset value, the response time is less than the preset threshold, and the response content contains preset keywords, the verification result is determined to be a correct password; if the response status code is not a preset value, the response time is greater than or equal to the preset threshold, or the response content does not contain preset keywords, the verification result is determined to be an incorrect password.

[0076] Specifically, the controller determines whether each password combination is correct based on the response data returned by the electronic scale. The key to this determination process lies in the parsing and analysis of the response data. First, the controller extracts information directly related to password verification from the electronic scale's response data. This key information mainly includes three aspects: the response status code, the response time, and the response content.

[0077] The response status code is a preset value used to indicate the electronic scale's feedback result on the password input. For example, status code 200 might indicate a correct password, 401 an incorrect password, and 403 a password that has been locked. The controller can quickly determine whether the password has been successfully verified by checking the status code.

[0078] Response time refers to the time it takes for the electronic scale to return response data. Typically, the time required to verify a correct password differs from the time required to verify an incorrect password. Verification of a correct password may be quick, while an incorrect password may trigger additional delays or retry mechanisms, significantly increasing the response time. By setting a reasonable preset threshold, the controller can determine the correctness of the password based on the response time.

[0079] The response content consists of detailed information returned by the scale, such as operation prompts and error descriptions. For example, after verifying the correct password, the scale may return a "Password correct" message; while an incorrect password may return a "Password incorrect, please re-enter" warning. The controller can further confirm the password verification result by searching for preset keywords in the response content.

[0080] After the controller extracts these three key pieces of information from the response data, it can use preset judgment rules to evaluate the correctness of the password. The preset judgment rules essentially compare the response status code, response time, and corresponding content with the expected result.

[0081] For example, suppose the electronic scale is configured such that status code 200 indicates a correct password, a response time of less than 1 second indicates successful verification, and the response content containing the keyword "YES" indicates access to the system. Then, when the controller receives a status code of 200, a response time of 0.5 seconds, and the content "YES," it can determine that the current password is correct. Conversely, if the status code is 401, the response time exceeds 1 second, or the content is "NO," it indicates that the current password verification has failed.

[0082] The controller performs this evaluation process for each password combination in the candidate list, ultimately obtaining a complete list of verification results. This list records the verification result for each password combination, i.e., whether the password is correct or incorrect.

[0083] It is important to note that different models of electronic scales may use different response data formats and judgment criteria. Therefore, when setting the key information extraction method and judgment rules, the controller can utilize relevant information in the electronic scale feature database to determine the corresponding data parsing scheme for each model of electronic scale, ensuring the accuracy of the judgment.

[0084] Step S5: Generate a detection operation log based on the operation time and verification result corresponding to each password combination.

[0085] The controller generates a unique identifier for each password combination. This identifier can be composed of multiple attributes such as the password's value, length, and type. For example, for a 6-digit numeric password "123456", its identifier could be "123456-6-N", indicating that the password value is 123456, the length is 6 digits, and the type is numeric (N). The identifier is used to facilitate quick location and indexing of specific password combinations in the log.

[0086] Next, the controller records the operation timestamp for each password combination. The operation timestamp includes two key nodes: the time the password command was sent and the time the electronic scale's response was received. These timestamps can be accurate to the millisecond level to reflect the detailed password verification process. For example, "2023-05-20 15:30:00.123" indicates that the password command was sent at 15:30:00.123 on May 20, 2023. In addition to the operation timestamp, the controller also records the final verification result for each password combination, i.e., the verification result obtained in step S4. This result can be a binary "password correct" or "password incorrect," or a more detailed status description, such as "password incorrect, 2 attempts remaining." The verification result is the core content of the log, directly reflecting the success or failure of the password detection.

[0087] With the identification code, operation timestamp, and verification result, the controller can organize this information into structured log entries according to a preset log format. The log format can be plain text or standardized data formats such as JSON or XML. The controller converts each password combination in the password candidate list into such a log entry, arranging them in chronological or password order to form a complete detection operation log. This log can be output to the console in real time, written to a file, or uploaded to the log controller for subsequent analysis and archiving.

[0088] Step S6: Determine the target password combination corresponding to the target verification result in the detection operation log. The verification result of the target verification result is that the password is correct. Based on the target password combination, generate a target control sequence and simulate key operation according to the target control sequence. Under human key operation, acquire weighing data and display data, and determine whether there is cheating behavior based on the weighing data and display data.

[0089] Specifically, the controller filters log entries from the detection operation log that show a "password correct" verification result. After determining the target password, the controller converts it into a series of control commands to simulate manual operation of the electronic scale. This process is similar to step S3, mapping the password to a key sequence and then converting it into communication commands recognizable by the electronic scale. However, unlike S3, the control commands here also include weighing operations. The controller will immediately send a weighing command after successful password verification, controlling the electronic scale to perform the actual weighing operation. The weighing command can be a fixed weight value (e.g., 1 kg) or a weight range (e.g., between 0.5 and 1.5 kg). By changing the parameters of the weighing command, the controller can test the electronic scale's display and data output at different weights.

[0090] After sending a weighing command, the controller acquires the weighing data and display data from the electronic scale. The weighing data is the sensor reading inside the electronic scale, reflecting the actual weight applied to the weighing pan; while the display data is the weight value shown on the electronic scale screen, which is the result of internal processing. Under normal circumstances, these two data should be consistent, meaning the electronic scale's display matches the actual weight.

[0091] However, if the scale is being cheated, the weighing and display data may become abnormal. For example, in cheating mode, the scale may display a higher weight value. The controller can detect these cheating behaviors by comparing the weighing and display data. If the difference between the two data exceeds a preset weight threshold (e.g., 0.1 kg), the scale can be suspected of cheating.

[0092] In one possible implementation, under manual button operation, weighing data and display data are acquired, and based on the weighing data and display data, it is determined whether cheating has occurred. Specifically, this includes: acquiring the output signal of the weighing sensor and parsing the output signal to obtain weighing data; performing a hash calculation on the weighing data and the corresponding time point using a preset hash function to obtain a first verification value; acquiring the display image of the electronic scale and parsing the display image to obtain display data; performing a hash calculation on the display data and the corresponding time point using a preset hash function to obtain a second verification value; determining whether the first verification value and the second verification value are the same; if it is determined that the first verification value and the second verification value are the same, then it is determined that cheating has occurred and a cheating alarm is triggered.

[0093] Specifically, the controller establishes a data connection with the weighing sensor of the electronic scale to obtain the sensor's real-time output signal. This connection can be wired, such as RS232 or USB, or wireless, such as Bluetooth or Wi-Fi. The controller reads the output signal from the sensor through a preset communication protocol and converts it into a standard weighing data format, such as net weight, tare weight, and stability indicator. The weighing data obtained in this step reflects the actual weight value measured by the electronic scale.

[0094] Next, the controller performs integrity verification on the weighing data. Since weighing data may be tampered with during transmission and storage, the controller uses a hash algorithm to verify data consistency. A hash algorithm is a function that maps data of arbitrary length to a fixed-length checksum; common examples include MD5 and SHA. The controller first concatenates the weighing data and its corresponding time point (e.g., a millisecond-level timestamp) into a string, then calculates a fixed-length hash value using a preset hash function—this is the first checksum. This checksum can be considered the "digital fingerprint" of the weighing data; any change to the original data will result in a completely different checksum. Simultaneously, the controller also acquires the data displayed on the scale's screen. The displayed data reflects the weight value shown to the user by the scale. Similar to the weighing data, the controller also performs hash verification on the displayed data. The controller concatenates the displayed data and its corresponding time point into a string, then calculates a second checksum using the same preset hash function. This checksum can also be considered the "digital fingerprint" of the displayed data.

[0095] Next, the controller compares the first and second checksums. Under normal circumstances, since the weighing data and the displayed data are consistent, their hash checksums should also be the same. However, if the scale is being cheated, such as by manually modifying the displayed data or tampering with the weighing data, the two checksums will become inconsistent. For example, suppose the actual weight of the scale is 1.00 kg, but the display shows 1.50 kg. In this case, the hash value of the weighing data might be "ABC123", while the hash value of the displayed data might be "XYZ789". By comparing these two different hash values, the controller can detect the discrepancy between the scale's display and the actual weight, thus determining that cheating has occurred. Once the controller confirms that the first and second checksums are different, it can trigger a cheating alarm. Alarm methods may include sending a notification to regulatory authorities, displaying a warning message on the scale, or locking the scale's access.

[0096] In one possible implementation, the process of acquiring the display image of the electronic scale and parsing the display image to obtain display data includes: acquiring the display cache data of the electronic scale's display screen in real time via a data connection; parsing the display cache data to obtain the original display data; and post-processing the original display data to obtain the final display data, wherein the post-processing includes removing non-numeric characters and units.

[0097] Specifically, the controller establishes a data connection with the display controller of the electronic scale. The display controller is a key component of the electronic scale, responsible for converting weighing data into a display image and controlling the refresh of the display screen. The controller can connect to the display controller via interfaces such as serial port, parallel port, and USB, and exchange data using specific communication protocols.

[0098] After establishing a connection, the controller reads display buffer data from the display controller. The image buffer is a block of memory within the display controller used to store the image data currently displayed on the screen. This data is typically organized in a specific format, such as RGB565 or RGB888. The controller can obtain image data by sending a read command, specifying the starting address and length of the buffer. Upon receiving the display buffer data, the controller parses it and extracts the display data. This process can be divided into two steps: image decoding and character recognition.

[0099] Image decoding converts the cached data into standard image formats such as BMP and PNG. The controller determines the appropriate decoding algorithm based on the color format and pixel arrangement used by the display controller. For example, in RGB565 format, each two bytes represent one pixel; the first 5 bits of the high byte are the red component, the first 5 bits of the low byte are the blue component, and the middle 6 bits are the green component. The controller extracts these color components and arranges them in row-major order to obtain a complete image file.

[0100] Character recognition is the process of extracting numbers and characters from an image. A controller can use Optical Character Recognition (OCR) algorithms to perform image binarization, character segmentation, and feature extraction. The extracted features are then matched against a preset character model to obtain the recognition result. The preset character model can use existing OCR libraries such as Tesseract and OpenCV.

[0101] After image decoding and character recognition, the controller obtains a raw display data string, such as "1.23kg". However, this string may contain non-numeric characters and units, which is inconvenient for subsequent processing and comparison. Therefore, the controller also performs post-processing on the raw string to obtain display data in a standard format. Post-processing mainly includes two steps: removing non-numeric characters and removing units. Removing non-numeric characters involves replacing all non-numeric characters in the string, such as decimal points and minus signs, with empty characters or deleting them directly. For example, "1.23" will be processed as "123". Removing units involves deleting characters representing units in the string, such as "kg" and "lb". For example, "1.23kg" will be processed as "1.23". After post-processing, the controller finally obtains a pure numeric display data string, such as "1.23". This string can be directly converted to a floating-point number or an integer for subsequent hash calculations and comparisons.

[0102] Reference Figure 2 This application also provides a cheating detection device for electronic scales. The device is a server, comprising an acquisition module 201 and a processing module 202. The acquisition module 201 acquires a set of key commands, including the mode switching key and confirmation key of the electronic scale. The processing module 202 generates an exhaustive traversal sequence covering multiple password combinations based on the key command set, including a password candidate list. The processing module 202 further converts the password candidate list into a communication command sequence and simulates key operations according to the communication command sequence to traverse each password combination included in the password candidate list. The acquisition module 201 acquires response data corresponding to each password combination and, based on the response data, determines whether each password combination is correct, obtaining a verification result, including correct and incorrect passwords. The processing module 202 also generates a detection operation log based on the operation time and verification result corresponding to each password combination.

[0103] In one possible implementation, the processing module 202 generates an exhaustive traversal sequence covering multiple password combinations based on the key instruction set. Specifically, the processing module 202 determines the password length based on the key instruction set and generates different password combinations based on the password length to obtain a preliminary password candidate list. The processing module 202 filters the preliminary password candidate list according to preset password rules to obtain a password candidate list that conforms to the preset password rules. The preset password rules include three types of password rules: all-numeric combinations, mixed combinations of letters and numbers, and mixed combinations of symbols, letters, and numbers.

[0104] In one possible implementation, the processing module 202 converts the password candidate list into a communication instruction sequence, specifically including: the processing module 202 mapping each password combination in the password candidate list to a corresponding key sequence, the key sequence consisting of at least one of numeric keys, mode switching keys, and confirmation keys; the processing module 202 converting the key sequence into corresponding communication instructions according to the electronic scale communication protocol, generating a communication instruction sequence, the electronic scale communication protocol including the mapping relationship between key sequences and communication instructions; and the processing module 202 sending the communication instruction sequence to the electronic scale through the communication interface.

[0105] In one possible implementation, the processing module 202 determines whether each password combination is correct based on the response data to obtain a verification result. Specifically, the processing module 202 parses the response data and extracts key information related to password verification. The key information includes the response status code, response time, and response content. The processing module 202 uses the key information to determine whether each password combination is correct based on preset judgment rules. The preset judgment rules include determining whether the response status code is a preset value, determining whether the response time exceeds a preset threshold, or determining whether the response content contains preset keywords. If the processing module 202 determines that the response status code is a preset value, the response time is less than the preset threshold, and the response content contains preset keywords, then the verification result is determined to be a correct password. If the processing module 202 determines that the response status code is not a preset value, or the response time is greater than or equal to the preset threshold, or the response content does not contain preset keywords, then the verification result is determined to be an incorrect password.

[0106] In one possible implementation, after the processing module 202 generates a detection operation log based on the operation time and verification result corresponding to each password combination, the method further includes: the processing module 202 determining the target password combination corresponding to the target verification result in the detection operation log, wherein the verification result of the target verification result is a correct password; the processing module 202 generating a target control sequence based on the target password combination, and simulating key operations according to the target control sequence; and the processing module 202 acquiring weighing data and display data under human key operation, and determining whether cheating behavior exists based on the weighing data and display data.

[0107] In one possible implementation, the processing module 202 acquires weighing data and display data under manual button operation, and determines whether cheating behavior exists based on the weighing data and display data. Specifically, this includes: the acquisition module 201 acquires the output signal of the weighing sensor and parses the output signal to obtain weighing data; the processing module 202 uses a preset hash function to perform hash calculation on the weighing data and the time point corresponding to the weighing data to obtain a first verification value; the acquisition module 201 acquires the display image of the electronic scale and parses the display image to obtain display data; the processing module 202 uses a preset hash function to perform hash calculation on the display data and the time point corresponding to the display data to obtain a second verification value; the processing module 202 determines whether the first verification value and the second verification value are the same; if the processing module 202 determines that the first verification value and the second verification value are the same, it determines that cheating behavior exists and triggers a cheating alarm.

[0108] In one possible implementation, the acquisition module 201 acquires the display image of the electronic scale and parses the display image to obtain display data. Specifically, the acquisition module 201 acquires the display cache data of the electronic scale's display screen in real time through a data connection; the processing module 202 parses the display cache data to obtain the original display data; and the processing module 202 performs post-processing on the original display data to obtain the display data. The post-processing includes removing non-numeric characters and units.

[0109] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0110] This application also provides an electronic device. (See reference...) Figure 3 The electronic device 300 may include: at least one processor 301, at least one network interface 304, a user interface 303, a memory 305, and at least one communication bus 302.

[0111] The communication bus 302 is used to enable communication between these components.

[0112] The user interface 303 may include a display screen and a camera. Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.

[0113] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).

[0114] The processor 301 may include one or more processing cores. The processor 301 connects to various parts of the server using various interfaces and lines, and performs various server functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 305, and by calling data stored in the memory 305. Optionally, the processor 301 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 301 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 301 and may be implemented as a separate chip.

[0115] The memory 305 may include random access memory (RAM) or read-only memory. Optionally, the memory 305 may include a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 305 may also be at least one storage device located remotely from the aforementioned processor 301. (Refer to...) Figure 3 The memory 305, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an application program for a cheating detection method for an electronic scale.

[0116] exist Figure 3In the illustrated electronic device 300, the user interface 303 is mainly used to provide an input interface for the user and acquire user input data; while the processor 301 can be used to call an application program stored in the memory 305 for a cheating detection method of an electronic scale. When executed by one or more processors 301, the electronic device 300 performs one or more of the methods described in the above embodiments. It should be noted that, for the foregoing method embodiments, for the sake of simplicity, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0117] This application also provides a computer-readable storage medium storing instructions. When executed by one or more processors 301, these instructions cause an electronic device 300 to perform one or more of the methods described in the above embodiments.

[0118] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0119] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, portable hard drives, magnetic disks, or optical disks.

[0120] Of course, the above description is not limited to the examples above. Technical features not described in this invention can be implemented by or using existing technology, and will not be repeated here. The above embodiments and drawings are only used to illustrate the technical solutions of this invention and are not intended to limit this invention. This invention has been described in detail with reference to preferred embodiments. Those skilled in the art should understand that any changes, modifications, additions or substitutions made by those skilled in the art within the scope of this invention do not depart from the spirit of this invention and should also fall within the scope of protection of the claims of this invention.

Claims

1. A method for detecting cheating on an electronic scale, characterized in that: Includes the following steps: S1. Obtain the button instruction set, which includes the mode switching button and the confirmation button of the electronic scale; S2. Based on the key instruction set, generate an exhaustive traversal sequence covering several password combinations. The exhaustive traversal sequence includes a password candidate list, and the password combination is the input password for the electronic scale to activate the cheating mode. The exhaustive traversal sequence specifically includes: The password length is determined based on the key instruction set, and different password combinations are generated based on the password length to obtain a preliminary password candidate list. The preliminary password candidate list is then filtered according to preset password rules to obtain a password candidate list that conforms to the preset password rules. The preset password rules include three types of password rules: all-numeric combinations, mixed combinations of letters and numbers, and mixed combinations of symbols, letters, and numbers. S3. Convert the candidate password list into a sequence of communication instructions, and simulate key presses according to the sequence of communication instructions to traverse each password combination included in the candidate password list. S4. Obtain the response data corresponding to each password combination, and based on the response data, determine whether each password combination is correct to obtain the verification result. The verification result includes whether the password is correct or incorrect. Specifically, the verification result includes: Parse the response data to extract key information related to password verification, including the response status code, response time, and response content. Based on preset judgment rules, key information is used to determine whether each password combination is correct. The preset judgment rules include determining whether the response status code is a preset value, determining whether the response time exceeds a preset threshold, or determining whether the response content contains preset keywords. If the response status code is determined to be the preset value, the response time is less than the preset threshold, and the response content contains the preset keywords, then the verification result is determined to be a correct password. If the response status code is not the preset value, or the response time is greater than or equal to the preset threshold, or the response content does not contain the preset keywords, then the verification result is determined to be an incorrect password. S5. Generate a detection operation log based on the operation time and verification result corresponding to each password combination; S6. Determine the target password combination corresponding to the target verification result in the detection operation log, and select the target password combination with the correct password as the target verification result. Based on the target password combination, a target control sequence is generated, and key operations are simulated according to the target control sequence; Under human button operation, weighing and display data are acquired, and based on the weighing and display data, it is determined whether cheating has occurred; the determination of whether cheating has occurred specifically includes: Acquire the output signal of the weighing sensor and analyze the output signal to obtain the weighing data; A preset hash function is used to perform hash calculations on the time points corresponding to the weighing data and the weighing data to obtain the first verification value. Acquire the display image of the electronic scale, parse the display image, and obtain the display data; A preset hash function is used to perform hash calculations on the displayed data and the corresponding time points to obtain a second check value; then it is determined whether the first check value and the second check value are the same. If the first checksum and the second checksum are the same, cheating is confirmed and a cheating alarm is triggered.

2. The cheating detection method for electronic scales according to claim 1, characterized in that: In step S3, the candidate password list is converted into a sequence of communication instructions, specifically including: Each password combination in the password candidate list is mapped to a corresponding key sequence. The key sequence consists of at least one of number keys, mode switching keys, and confirmation keys. According to the electronic scale communication protocol, the key sequence is converted into a corresponding communication command, a communication command sequence is generated, and the communication command sequence is sent to the electronic scale through the communication interface. The electronic scale communication protocol includes the mapping relationship between key sequences and communication commands.

3. The cheating detection method for electronic scales according to claim 1, characterized in that: Acquire the display image of the electronic scale, parse the display image, and obtain the display data, specifically including: The display cache data of the electronic scale's screen is obtained in real time through data connection; the display cache data is parsed to obtain the original display data; the original display data is post-processed to remove non-numeric characters and units to obtain the final display data.

4. An electronic scale cheating detection device using the cheating detection method of any one of claims 1 to 3, characterized in that: It includes an acquisition module and a processing module, wherein: The acquisition module is used to acquire the key command set. The processing module is used to generate an exhaustive traversal sequence covering multiple password combinations based on the key instruction set. The exhaustive traversal sequence includes a password candidate list, and the password combination is the input password for the electronic scale to activate the cheating mode. The processing module is also used to convert the password candidate list into a sequence of communication instructions, and to simulate key operations according to the sequence of communication instructions in order to traverse the various password combinations included in the password candidate list. The acquisition module is also used to acquire the response data corresponding to each password combination, and based on the response data, to determine whether each password combination is correct and to obtain the verification result, which includes whether the password is correct or incorrect. The processing module is also used to generate detection operation logs based on the operation time and verification results corresponding to each password combination.

5. An electronic device using the cheating detection method of the electronic scale according to any one of claims 1 to 3, characterized in that: It includes a processor, memory, user interface, and network interface. The memory is used to store instructions, the user interface and network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory, which contain the cheating detection method for the electronic scale.

6. A computer-readable storage medium storing instructions for a cheating detection method of an electronic scale as described in any one of claims 1 to 3.