A data buffering reading method, a storage medium and an electronic device
Patent Information
- Application Number
- CN202411316335.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2044-09-20
AI Technical Summary
[0003]但是,通常数据处理系统通常同时担负着多种任务,如旅客身份确认、票务验证、安全筛查、入境/出境控制及辅助执法和反恐行动等任务,而这些任务的运行通常会耗费大量的系统资源,尤其是处理器算力
[0013] The identity information data in this invention includes two fixed-size strings, a header and a footer, with the header verification string being smaller. Furthermore, during identity verification, the available computing power A of the data processing system needs to be determined in advance. If it is less than a threshold, only the smaller header data is verified; if the header data is valid, subsequent verification proceeds. This asynchronous verification method avoids concentrated consumption of computing power and prevents system crashes. Additionally, if header data verification fails, the remaining identity information string read from the target buffer can be directly deleted, thus preventing Denial of Service (DoS) attacks and the resulting consumption of system resources.
Smart Images

Figure CN119166067B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing, and in particular to a method for reading a data buffer, a storage medium, and an electronic device. Background Technology
[0002] In modern travel, to maintain public safety, order, and improve travel efficiency, ticket verification mechanisms are typically implemented at airports, train stations, subway stations, and other transportation hubs. Especially at airports, early ticket verification allows passengers to obtain more travel information and enables the airport to more easily verify passenger details. The most common ticket verification method involves passengers placing their paper tickets, e-tickets, or ID cards on a reader, or scanning them using a QR code on their mobile phone, NFC technology, or even facial recognition technology. Once the system verifies the ticket information, the gate opens, allowing the passenger to pass.
[0003] However, data processing systems typically handle multiple tasks simultaneously, such as passenger identification, ticket verification, security screening, entry / exit control, and assisting law enforcement and counter-terrorism operations. These tasks usually consume significant system resources, especially processor computing power. During peak operating periods, insufficient available computing power may occur, leading to delays in passenger identification during ticket checks and potentially causing system crashes. Summary of the Invention
[0004] To address the aforementioned technical problems, the technical solution adopted by this invention is as follows:
[0005] According to one aspect of the present invention, a method for reading a data buffer is provided, the method comprising the following steps:
[0006] In response to the authentication request, obtain the current available computing power value A of the data processing system;
[0007] If A≤Y1, then only the header verification string stored in the target buffer is read, and the header verification string is parsed and verified for the first time; the size of the target buffer is equal to the size of one identity information data; the identity information data includes the header verification string and the identity information string, the header verification string is located before the identity information string, and the length of the header verification string is less than the length of the identity information string; Y1 is the preset available computing power threshold.
[0008] If the first parsing verification passes, the remaining identity information string is read from the target buffer, and the identity information string is parsed and verified a second time, and the data stored in the current target buffer is cleared.
[0009] If the second parsing verification fails, an alarm message will be generated.
[0010] According to a second aspect of the present invention, a non-transitory computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the above-described method for reading a data buffer.
[0011] According to a third aspect of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method for reading a data buffer.
[0012] The present invention has at least the following beneficial effects:
[0013] The identity information data in this invention includes two fixed-size strings, a header and a footer, with the header verification string being smaller. Furthermore, during identity verification, the available computing power A of the data processing system needs to be determined in advance. If it is less than a threshold, only the smaller header data is verified; if the header data is valid, subsequent verification proceeds. This asynchronous verification method avoids concentrated consumption of computing power and prevents system crashes. Additionally, if header data verification fails, the remaining identity information string read from the target buffer can be directly deleted, thus preventing Denial of Service (DoS) attacks and the resulting consumption of system resources.
[0014] In addition, the size of the target buffer used to store identity information data is the same as the size of a single identity information data point. Therefore, only one identity information point can be stored at a time, thus reducing the time identity information is retained during the verification process and consequently reducing the risk of theft. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a flowchart of a data buffer reading method provided in an embodiment of the present invention. Detailed Implementation
[0017] 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.
[0018] As one possible embodiment of the present invention, such as Figure 1 As shown, a method for reading a data buffer is also provided, the method including the following steps:
[0019] S100: In response to the authentication request, obtain the current available computing power value A of the data processing system.
[0020] In this embodiment, taking an airport ticket check-in scenario as an example, multiple turnstiles are typically equipped with devices for reading passenger identity information (i.e., identity information collection devices hereinafter referred to as such), such as ID card recognition devices, facial recognition devices, and corresponding QR code recognition devices. These devices can collect the corresponding passenger identity information. Then, these devices can combine their own device ID and other information with the passenger's identity information to generate corresponding identity information data. During the above operations, the local computing resources of the identity information collection devices can be used directly for processing.
[0021] Then, each identity information collection device sends the generated identity information data to a designated queue. The parsing and verification device (i.e., the data processing system, used to verify identity) then sequentially stores the identity information data from the queue into the target memory according to a first-in, first-out (FIFO) mechanism, awaiting subsequent verification. Using queues also helps to minimize the pressure on the data processing system caused by high concurrent requests.
[0022] Specifically, the header verification string in each identity information data segment can be a device identifier corresponding to the device acquiring the identity information data. The identity information string in each identity information data segment can be an encrypted string corresponding to the acquired ID card number. The header verification string and the identity information string are all of equal length. For example, the ID card number can be encrypted using the MD5 encryption algorithm to generate the corresponding encrypted string.
[0023] S200: If A ≤ Y1, then only the header verification string stored in the target buffer is read, and the header verification string is parsed and verified for the first time. The size of the target buffer is equal to the size of one identity information data. The identity information data includes the header verification string and the identity information string. The header verification string is located before the identity information string, and the length of the header verification string is less than the length of the identity information string. Y1 is a preset available computing power threshold. This value can be set according to the actual use case.
[0024] The available computing power of a data processing system can typically be determined using existing statistical methods, such as calculating the utilization rate of CPU and GPU cores, to obtain the current available computing power value A in real time. This value is then compared with Y1. This step allows for the parsing and verification of only a small portion of the identity information data when the current available computing power is low, thereby reducing the system's computing power consumption and lowering system pressure. Typically, the header verification string is much shorter than the identity information string, usually by 2-3 orders of magnitude; for example, the header verification string might be 10 characters long, while the identity information string might be 1000 characters long.
[0025] In addition, the first parsing and verification process can also be a low-computing operation. For example, when the header verification string is a device identifier (i.e., device ID), the first parsing and verification process can be to match the device ID with a pre-stored set of device IDs.
[0026] S300: If the first parsing verification passes, then read the remaining identity information string from the target buffer, perform a second parsing verification on the identity information string, and clear the data stored in the current target buffer.
[0027] S400: If the second parsing verification fails, an alarm message will be generated.
[0028] In this embodiment, to further reduce the computational burden on the system during parsing and verification, symmetric encryption can be used to obtain the encrypted string when encrypting the ID card number. Therefore, the data processing system can directly use the corresponding private key to quickly decrypt and obtain the corresponding ID card number during parsing. Then, this ID card number is used to match existing identity information in the order database.
[0029] If no matching order information is found, an error message will be generated, prompting the user to re-check their ticket. This avoids the identity information collection device failing to recognize the user's identity information.
[0030] Following S100, the method further includes:
[0031] S210: If A>Y1, then read all the identity information data stored in the target buffer, perform third-party parsing verification on the entire identity information data, and clear the data stored in the current target buffer.
[0032] S220: If the third parsing verification fails, an alarm message is generated. In this embodiment, the third parsing verification can be a combination of the first and second parsing verifications, except that the first and second parsing verifications can be performed simultaneously in the third parsing verification.
[0033] In this invention, the string in the target buffer is quickly cleared after verification is successful or fails, which can significantly shorten the retention time of identity information during the verification process and reduce the risk of identity information being stolen.
[0034] In another possible embodiment of the present invention, to improve the security of identity information data, the header verification string in each piece of identity information data can be a hash value combining the device ID corresponding to the device acquiring the identity information data and the Unix timestamp when the identity information collection was completed. The Unix timestamp represents the number of seconds. The device IDs stored by the identity information collection device and the parsing and verification device change once every preset period, and the method of changing the device IDs is the same. The preset period can be one day or several days.
[0035] Because the information verification process in this embodiment is highly correlated with time, a time synchronization mechanism is implemented between the identity information collection device and the parsing and verification device to ensure data consistency. For example, the Network Time Protocol (NTP) can be used to ensure time synchronization between the two devices. NTP is a protocol used to synchronize computer clocks in a distributed network environment. It uses UDP port 123 for communication and provides millisecond-level accuracy. The NTP client (which can be the identity information collection device) periodically requests time from the NTP server (which can be the server corresponding to the data processing system, i.e., the server corresponding to the parsing and verification device) and adjusts its local clock to maintain synchronization with the server's time.
[0036] The combination of the device ID and the Unix timestamp at the time of completion of identity information collection meets the following conditions:
[0037] S201: If the last digit of the Unix timestamp when the identity information collection is completed is odd, then append the device ID to the first character of the Unix timestamp.
[0038] S202: If the last digit of the Unix timestamp when the identity information collection is completed is even, then append the device ID to the last character of the Unix timestamp.
[0039] Unix timestamps are one of the most commonly used formats, representing the number of seconds (sometimes milliseconds or microseconds) since midnight, January 1, 1970 (UTC). A Unix timestamp is typically a long integer, such as 1689765105, representing seconds. For example, with device ID 123456, the combined information would be 1234561689765105.
[0040] The first analytical verification includes:
[0041] S203: Every second, the parsing and verification device generates verification information for each identity information collection device based on the current timestamp and the device ID corresponding to each identity information collection device. The parsing and verification device saves all verification information within the last 5 seconds. Since the time of the server corresponding to the identity information collection device and the data processing system is synchronized, and the method by which the parsing and verification device generates verification information is the same as the method by which the identity information collection device generates the header verification string, the newly collected header verification string will inevitably be present in all verification information within the last 5 seconds.
[0042] S204: Iterate through all the verification messages. If the header verification string is the same as any of the verification messages, then the first parsing verification passes.
[0043] Since generating and parsing the header verification string is a very fast process, usually completed within 1 second, and the identity information in the queue is also updated in a short time, in order to ensure that every recently verified header verification string has corresponding verification information, the parsing verification device will save all verification information within the last 5 seconds. This can also reduce the amount of data stored in the database and alleviate the storage pressure on the database.
[0044] In this embodiment, the header verification string changes over time, thereby reducing the pressure on the data processing system when identity information with externally forged header verification strings is used to launch a DoS attack. It also improves the confidentiality of the device ID, preventing information loss or tampering.
[0045] Furthermore, in this implementation, the identity information string in each identity information data is a string encrypted using the public key in asymmetric encryption after the corresponding identity information collection device collects the identity information. The parsing and verification device stores the private key for asymmetric encryption corresponding to each identity information collection device.
[0046] The second analytical verification includes:
[0047] S301: Decrypt the identity information string using the private key in the corresponding asymmetric encryption based on the device ID in the header verification string.
[0048] S302: Traverse the existing identity information in the order database. If no information matching the decrypted identity information is found, generate an alarm message.
[0049] Because asymmetric encryption offers higher security, this embodiment uses asymmetric encryption for both encryption and decryption of user identity information. This further enhances the security of user identity information.
[0050] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0051] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0052] In an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided.
[0053] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: entirely hardware implementations, entirely software implementations (including firmware, microcode, etc.), or implementations combining hardware and software aspects, collectively referred to herein as “circuits,” “modules,” or “systems.”
[0054] An electronic device according to this embodiment of the invention. The electronic device is merely an example and should not be construed as limiting the functionality or scope of the embodiments of the invention.
[0055] Electronic devices are manifested in the form of general-purpose computing devices. Components of an electronic device may include, but are not limited to: at least one processor, at least one memory, and buses connecting different system components (including memory and processor).
[0056] The memory stores program code that can be executed by a processor, causing the processor to perform the steps described in the "Exemplary Methods" section above, according to various exemplary embodiments of the present invention.
[0057] The storage may include readable media in the form of volatile storage, such as random access memory (RAM) and / or cache memory, and may further include read-only memory (ROM).
[0058] The storage may also include programs / utilities having a set (at least one) of program modules, including but not limited to: an operating system, one or more applications, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0059] A bus can represent one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus that uses any of the various bus architectures.
[0060] The electronic device can also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (e.g., routers, modems, etc.). This communication can be performed via input / output (I / O) interfaces. Furthermore, the electronic device can communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter. The network adapter communicates with other modules of the electronic device via a bus. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0061] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0062] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the present invention may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the present invention described in the "Exemplary Methods" section above.
[0063] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0064] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0065] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0066] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0067] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0068] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0069] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for reading a data buffer, characterized in that, The method includes the following steps: In response to the authentication request, obtain the current available computing power value A of the data processing system; A is the current idle rate of the CPU and GPU computing cores of the data processing system; If A≤Y1, then only the header verification string stored in the target buffer is read, and the header verification string is parsed and verified for the first time; the size of the target buffer is equal to the size of one identity information data; the identity information data includes the header verification string and the identity information string, the header verification string is located before the identity information string, and the length of the header verification string is less than that of the identity information string; Y1 is the preset available computing power threshold; If the first parsing verification passes, the remaining identity information string is read from the target buffer, the identity information string is parsed and verified a second time, and the data stored in the current target buffer is cleared. If the second parsing verification fails, an alarm message will be generated; If A>Y1, then read all the identity information data stored in the target buffer, perform third-party parsing verification on the entire identity information data, and clear the data stored in the current target buffer; If the third-party verification fails, an alarm message will be generated.
2. The method according to claim 1, characterized in that, The header verification string in each of the aforementioned identity information data is a device identifier corresponding to the device that obtained the identity information data; Each identity information string in the aforementioned identity information data is an encrypted string corresponding to the obtained ID card number; the length of each header verification string is equal, and the length of each identity information string is equal.
3. The method according to claim 1, characterized in that, The header verification string in each of the aforementioned identity information data is a hash value of the combination of the device ID corresponding to the device that acquired the identity information data and the Unix timestamp when the identity information collection was completed; the Unix timestamp is a timestamp representing the number of seconds. The combination of the device ID and the Unix timestamp at the time of completion of identity information collection meets the following conditions: If the last digit of the Unix timestamp when the identity information collection is completed is odd, then the device ID is appended to the first character of the Unix timestamp. If the last digit of the Unix timestamp when identity information collection is completed is even, then the device ID is appended to the last character of the Unix timestamp.
4. The method according to claim 3, characterized in that, A time synchronization mechanism is set between the identity information collection device and the parsing and verification device; the first parsing and verification includes: Every second, the parsing and verification device generates verification information for each identity information collection device based on the current timestamp and the device ID corresponding to each identity information collection device; the parsing and verification device saves all verification information within the last 5 seconds; Iterate through all the verification messages. If the header verification string is the same as any of the verification messages, then the first parsing verification passes.
5. The method according to claim 4, characterized in that, The device IDs stored by the identity information collection device and the parsing and verification device change once every preset period, and the method of changing the device IDs is the same.
6. The method according to claim 4, characterized in that, The identity information string in each of the aforementioned identity information data is a string encrypted using the public key in asymmetric encryption after the corresponding identity information collection device collects the identity information. The parsing and verification device stores the private key for asymmetric encryption corresponding to each identity information collection device.
7. The method according to claim 6, characterized in that, The second parsing verification includes: Based on the device ID in the header verification string, the identity information string is decrypted using the private key in the corresponding asymmetric encryption. Iterate through the existing identity information in the order database. If no information matching the decrypted identity information is found, generate an alarm message.
8. A non-transitory computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements a data buffer reading method as described in any one of claims 1 to 7.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements a data buffer reading method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Multi-level identity authentication method for Internet of Things system
CN113746632A
Identity verification method and device and electronic equipment
CN113792271A