Local Record Storage Method, Smart Lock, and Readable Medium
By using local record storage methods in smart locks, the storage data is generated and uploaded pointer data is adjusted, and the problem of inefficient local recording and uploading mechanism of smart lock running data is solved, efficient data storage and uploading is achieved, and the data analysis process is simplified.
Patent Information
- Application Number
- CN202111333386.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-11
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2041-11-11
AI Technical Summary
The local recording and uploading mechanism of the running data of existing smart locks is not efficient enough, and duplicate data is often uploaded, resulting in difficulty in data analysis.
A local record storage method is provided, by acquiring local record data to generate storage data, write it to a storage area, adjusting the upload pointer data to achieve accurate determination of the location of the data to be uploaded. The method includes the writing storage step and the upload step to ensure that the data is not uploaded repeatedly when stored locally.
It realizes efficient local record storage, avoids repeated data uploads, simplifies the data upload process, and improves the efficiency of data analysis.
Smart Images

Figure CN114036075B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data storage, and particularly to a local record storage method, an intelligent lock, and a readable medium. Background Art
[0002] During the operation of many smart home devices, a large amount of operation data will be generated. Most of these data need to be uploaded to a cloud platform or a server for storage and analysis of the operation data.
[0003] Intelligent locks have now entered thousands of households. Since they are related to home security, the analysis of the operation data and operation status of intelligent locks is particularly important. However, at present, the local recording and uploading mechanisms of the operation data of intelligent locks are not efficient enough, and some duplicate data are often uploaded, causing difficulties in data analysis. Summary of the Invention
[0004] In view of the deficiencies of the above-mentioned prior art, one of the objectives of the present invention is to provide a local record storage method, which can provide an efficient local record storage mechanism, ensure convenient local storage, and ensure that the accurate location of the un-uploaded data can be found when uploading is required.
[0005] Another objective of the present invention is to provide an intelligent lock.
[0006] Another objective of the present invention is to provide a computer-readable medium.
[0007] To achieve the above objectives, the present invention adopts the following technical solutions:
[0008] On the one hand, the present invention provides a local record storage method, including a writing and storage step:
[0009] Obtain local record data and generate storage data; the storage data includes a record ID, a reporting flag, and data content;
[0010] Write the storage data into a storage area, and adjust the upload pointer data to determine the accurate location of the storage data to be uploaded according to the upload pointer data; the upload pointer data includes an upload record ID representing the record ID of the last un-uploaded data, a start address representing the storage address of the first un-uploaded data, and an end address representing the next storage address of the last un-uploaded data.
[0011] Further, in the local record storage method, the adjustment of the upload pointer data specifically includes:
[0012] When storing data, store the data to be stored at the end address, update the upload record ID in the upload pointer data to the record ID of the currently obtained stored data, and then update the end address in the upload pointer data to the next address in the storage area; in the upload pointer data, if the updated end address is the same as the start address, update the start address to the next address in the storage area.
[0013] Further, the local record storage method further includes an upload step:
[0014] Send an upload instruction to the service terminal; the upload instruction includes the record ID of the stored data in the start address recorded by the upload pointer data;
[0015] After receiving the return instruction from the service terminal, start from the start address recorded by the upload pointer data and upload the stored data; for each uploaded stored data, update the start address of the upload pointer data to the next address in the storage area until the start address is equal to the end address.
[0016] Further, for the local record storage method, specifically uploading a stored data includes:
[0017] Transmit the stored data at the start address to the service terminal;
[0018] After receiving the feedback result of successful upload, modify the reporting flag of the stored data at the start address to uploaded, and then change the start address to the next data address.
[0019] Further, for the local record storage method, the service terminal obtains the device information of the uploading device according to the upload operation, and the device information includes the working status, working records, and device settings;
[0020] The mobile terminal obtains the device information of the uploading device through the service terminal.
[0021] Further, for the local record storage method, the data content is obtained by encrypting the local record data.
[0022] Further, for the local record storage method, the local record data is stored through a write-back operation to obtain the stored data; where the write-back operation specifically includes:
[0023] Obtain the data volume of the cached data; the cached data includes one or more local record data;
[0024] When the data volume is greater than or equal to a predetermined value, merge the cached data to generate the stored data.
[0025] On the other hand, the present invention provides an intelligent lock using any of the aforementioned local record storage methods, including:
[0026] An acquisition module for acquiring local record data;
[0027] An upload module for uploading stored data;
[0028] A processing module for generating stored data based on the local record data; the stored data includes a record ID, a reporting flag, and data content; writing the stored data into a storage area and adjusting the upload pointer data to determine the accurate location of the stored data to be uploaded according to the upload pointer data; the upload pointer data includes an upload record ID representing the record ID of the last un-uploaded data, a start address representing the storage address of the first un-uploaded data, and an end address representing the next storage address of the last un-uploaded data.
[0029] On the other hand, the present invention provides an intelligent lock, including:
[0030] A memory storing a computer program;
[0031] A processor, wherein the computer program, when executed by the processor, implements any of the aforementioned local record storage methods.
[0032] On the other hand, the present invention provides a computer-readable medium storing a computer program, and the computer program, when executed by a processor, implements any of the aforementioned local record storage methods.
[0033] Compared with the prior art, the local record storage method, intelligent lock, and readable medium provided by the present invention have the following beneficial effects:
[0034] Using the local record storage method provided by the present invention, first, after obtaining the local record data, stored data is generated through preprocessing, and then the stored data is written into the storage area in a write-back manner. While writing, the upload pointer data is adjusted to achieve local storage of the local record data, and at the same time, accurately locate the accurate location of the stored data that has not been uploaded, which is convenient for quickly finding the accurate location when the stored data needs to be uploaded later, with simple operation and no duplicate upload of data.
[0035] Using the upload step provided in this embodiment, as long as the upload record ID is obtained, the corresponding start address and end address can be obtained through the upload pointer data, and the data between the start address and the end address is executed for the upload operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 is a flowchart of the write storage step in the local record storage method provided by the present invention;
[0037] Figure 2 It is a flowchart of the upload step in the local record storage method provided by the present invention;
[0038] Figure 3 It is a structural block diagram of the intelligent lock provided by the present invention;
[0039] Figure 4 It is a structural block diagram of an implementation manner of the intelligent lock provided by the present invention. Detailed implementation manners
[0040] To make the objectives, technical solutions and effects of the present invention clearer and more definite, the following further describes the present invention in detail with reference to the accompanying drawings and by way of examples. It should be understood that the specific examples described herein are only used to explain the present invention and are not used to limit the present invention.
[0041] Those skilled in the art should understand that the foregoing general description and the following detailed description are exemplary and illustrative specific embodiments of the present invention and are not intended to limit the present invention.
[0042] As used herein, the term "comprising", "including" or any other variant thereof is intended to cover a non-exclusive inclusion, such that a process or method including a list of steps does not include only those steps but may include other steps not expressly listed or inherent to such process or method. Similarly, one or more devices or subsystems, elements or structures or components starting with "comprising... one" do not, without more limitations, preclude the presence of other devices or other subsystems or other elements or other structures or other components or other devices or other subsystems or other elements or other structures or other components. Throughout the specification, the appearances of the phrases "in one embodiment", "in another embodiment" and similar language may or may not all refer to the same embodiment.
[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present invention pertains.
[0044] The present invention provides a local record storage method, which is applied to smart homes, especially smart locks.
[0045] The smart lock has a main control module, a storage module, and a WiFi module; wherein, the main control module is used to implement the operation logic control of the smart lock and realize business functions; the storage module is used to store relevant operation records to ensure that local records are effectively saved whether the smart lock is online or offline; the WiFi module is a data communication module used to communicate with a server or a cloud platform to realize data interaction.
[0046] The local record storage method provided by the present invention is mainly applied to perform local storage in the storage module when the main control module generates new operation data, which is convenient for subsequent uploading to the server or platform, and at the same time, data duplication during the uploading process can be avoided.
[0047] In a specific application, the intelligent lock uploads local records to the server or cloud platform, and the server or cloud platform will send the local records to the mobile terminal according to the system settings, so as to facilitate the user to view the operation data of the intelligent lock and remotely control the intelligent lock through the mobile terminal.
[0048] The local record storage method includes a writing and storage step:
[0049] Obtain local record data and generate storage data; the storage data includes a record ID, a reporting flag, and data content; generally, the storage data is obtained by preprocessing the local record data, and the preprocessing operations include encrypting and compressing the data, etc., to enhance the security, non-volatility, and reduce the storage space of the local record data when stored, and convert the local record data into storage data. In this embodiment, the preprocessing operations are not limited, and those skilled in the art can select appropriate encryption methods, compression methods, etc. to preprocess the local record data.
[0050] Furthermore, in some embodiments, the present invention provides a storage format for the storage data, specifically:
[0051] Record ID Reporting flag Content (encrypted) Verification
[0052] Record ID: an integer of int type or long type, depending on the requirements.
[0053] Reporting flag: 0: not uploaded; 1: uploaded.
[0054] Content: the local record data, which is the local record data after the write-back operation in this embodiment.
[0055] Furthermore, as a preferred solution, in this embodiment, the data content is obtained by encrypting the local record data. Those skilled in the art can select an appropriate encryption method to perform the encryption of the content. Encrypting the content can prevent the content from being leaked.
[0056] Verification: perform a sum check from the record ID to the content to ensure the integrity of the data content.
[0057] The preprocessing operation is to generate stored data with the storage format from the local record data through preprocessing. For the specific method of performing preprocessing, well-known techniques in the art can be used, and those skilled in the art can select according to requirements.
[0058] Write the stored data into the storage area, and adjust the upload pointer data to determine the accurate position of the stored data to be uploaded according to the upload pointer data; the upload pointer data includes an upload record ID representing the record ID of the last un-uploaded data, a start address representing the storage address of the first un-uploaded data, and an end address representing the next storage address of the last un-uploaded data. In the writing storage step provided by the present invention, as long as stored data is generated, the stored data is written into the storage area. The upload pointer data is used to quickly obtain the accurate storage address for starting the upload during the upload operation, which is convenient and fast. Specifically, as long as the upload operation is executed, data is uploaded starting from the start address without more operations. Specifically, one piece of the un-uploaded data is one piece of the un-uploaded stored data.
[0059] Further, in some embodiments, the upload pointer data has a predetermined storage structure, specifically:
[0060] Upload record ID Starting address Ending address Verification
[0061] Upload record ID: an integer of int type or long type, depending on requirements.
[0062] Start address: the start address of the current record.
[0063] End address: the end address of the current record.
[0064] Checksum: perform a sum check on the record ID to the end address to ensure the integrity of the data pointer content.
[0065] Using the local record storage method provided by the invention, first, after obtaining the local record data, generate stored data through preprocessing, and then use the write-back method to write the stored data into the storage area. While writing, adjust the upload pointer data to realize the local storage of the local record data, and at the same time accurately locate the accurate position of the stored data that has not been uploaded, which is convenient for quickly finding the accurate position when the storage needs to be uploaded later, with simple operation and no duplicate upload of data.
[0066] Further, as a preferred solution, in this embodiment, the adjustment of the upload pointer data specifically includes:
[0067] When storing data, store the stored data at the end address, update the upload record ID in the upload pointer data to the record ID of the currently obtained stored data, and then update the end address in the upload pointer data to the next address in the storage area; in the upload pointer data, if the updated end address is the same as the start address, update the start address to the next address in the storage area.
[0068] When there is stored data to be stored, store the stored data in the end address, and then add the end address to the next data address. For example, before storage, the end address is 50. When storing, store the stored data at 50, and then change the end address to 51. Ensure that in the upload pointer data, the data before the end address (excluding the end address), including the start address, is unuploaded data. During the storage process, the start address cannot be equal to the end address. If they are equal, it means that the record has not been stored, or the storage space is too small for rewriting, which may cause the previous storage records to disappear; therefore, during the storage process, when the updated end address is equal to the start address, also add the start address to the next data address to retain the latest record. At this time, the data at the start address before the change is not uploaded, that is, one unuploaded data is lost.
[0069] Further, as a preferred solution, in this embodiment, it further includes an upload step:
[0070] Send an upload instruction to the service terminal; the upload instruction includes the record ID of the stored data in the start address recorded by the upload pointer data; specifically, the upload instruction can be obtained by sending through a server or a cloud platform, or can be obtained by the smart home triggering the upload instruction at regular intervals. As long as the upload instruction is obtained, obtain the record ID to facilitate the next step of operation.
[0071] After receiving the upload instruction, the service terminal feedbacks a return instruction containing the record ID.
[0072] After receiving the return instruction from the service terminal, start uploading the stored data from the start address recorded by the upload pointer data; for each uploaded stored data, update the start address of the upload pointer data to the next address in the storage area until the start address is equal to the end address.
[0073] When the start address is different from the end address, obtain the reporting flag of the stored data at the start address; when the start address is the same as the end address, there is no data to be uploaded on this record ID, and feedback the parameter of no need to upload.
[0074] When it is determined that the reported flag indicates not uploaded, an upload operation is performed on the stored data between the start address and the end address. In this embodiment, the reported flag is distinguished by 0 and 1. Among them, when the reported flag is 0, it means that the stored data has not been uploaded or has not been fully uploaded. When the reported flag is 1, it means that the stored data has been uploaded successfully.
[0075] When it is determined that the reported flag is uploaded, the start address is changed to the next storage address in the storage area.
[0076] Using the upload steps provided in this embodiment, as long as the record ID is obtained, the corresponding start address and end address can be obtained through the upload pointer data, and the data between the start address and the end address is uploaded.
[0077] Further, as a preferred solution, in this embodiment, uploading a stored data specifically includes:
[0078] Transfer the stored data at the start address to the service terminal; the service terminal includes a server and a cloud platform.
[0079] After receiving the feedback result of successful upload, modify the reported flag of the stored data at the start address to uploaded, and then change the start address to the next data address.
[0080] When it is detected that the start address and the end address of the current record are different and there is no record reported, check whether the reported flag of the start address data content is 1. When it is 1, it means that the record has been uploaded. At this time, the start address is incremented to the next address (note the handling when the address is out of bounds), the end address remains unchanged, and the data storage pointer moves down until the start address is equal to the end address.
[0081] Further, in some embodiments, the process of modifying the reported flag of the stored data in the upload step includes an online mode and an offline mode.
[0082] The online mode is as follows: In the online case, the main control module sends an online instruction (including the record ID) to the service terminal. The service terminal returns an instruction that also includes the record ID. The main control module finds the corresponding record position according to the record ID and sets the corresponding reported flag to 1, indicating that the record has been uploaded.
[0083] The offline mode is as follows: In the offline case, the main control module saves the record information to the storage module. When the intelligent lock device reconnects to the network, the main control module sends an offline instruction (including the record ID) to the server. The server returns an instruction that also includes the record ID. The main control finds the corresponding record position according to the record ID and sets the corresponding reported flag to 1, indicating that the record has been uploaded.
[0084] Further, as a preferred solution, in this embodiment, the service terminal obtains the device information of the uploading device according to the uploading operation, and the device information includes the working status, working records, and device settings;
[0085] The mobile terminal obtains the device information of the uploading device through the service terminal.
[0086] Further, as a preferred solution, in this embodiment, the local record data is stored through a write-back operation to obtain the stored data; wherein the write-back operation specifically includes:
[0087] Obtain the data volume of the cached data; the cached data includes one or more local record data;
[0088] When the data volume is greater than or equal to a predetermined value, the cached data is merged to generate the stored data.
[0089] The present invention also provides an intelligent lock using the local record storage method described in any of the foregoing embodiments, including:
[0090] An acquisition module for acquiring local record data;
[0091] An upload module for uploading stored data; preferably, the upload module is a WiFi module,
[0092] A processing module for generating stored data based on the local record data; the stored data includes a record ID, a reporting flag, and data content; writing the stored data into a storage area and adjusting the upload pointer data to determine the accurate position of the stored data to be uploaded according to the upload pointer data; the upload pointer data includes an upload record ID representing the record ID of the last un-uploaded data, a start address representing the storage address of the first un-uploaded data, and an end address representing the next storage address of the last un-uploaded data.
[0093] The intelligent lock has a main control module, a storage module, and a WiFi module; wherein, the main control module is used to implement the operation logic control of the intelligent lock and realize service functions; the storage module is used to store relevant operation records to ensure that local records are effectively saved whether the intelligent lock is online or offline; the WiFi module is a data communication module for communicating with a server or a cloud platform to realize data interaction.
[0094] Further, as a preferred solution, in this embodiment, the acquisition module is further used to acquire an upload instruction; the upload instruction includes a record ID.
[0095] The processing module is further configured to obtain the start address and the end address corresponding to the record ID through the uploaded pointer data; when the start address is different from the end address, obtain the reporting flag of the stored data at the start address; when it is determined that the reporting flag indicates not uploaded, perform an upload operation on the stored data between the start address and the end address by driving the upload module.
[0096] Further, as a preferred solution, in this embodiment, when the upload module performs the upload operation, it specifically includes:
[0097] Transmit the stored data at the start address to the service terminal;
[0098] After receiving the feedback result of successful upload, change the start address to the next data address until the start address is equal to the end address; when the start address is the same as the end address, modify the reporting flag of the stored data corresponding to the record ID to uploaded.
[0099] The present invention also provides an intelligent lock, including:
[0100] A memory storing a computer program;
[0101] A processor, when the computer program is executed by the processor, implements the local record storage method described in any of the foregoing embodiments.
[0102] The present invention also provides a computer-readable medium storing a computer program, and when the computer program is executed by a processor, implements the local record storage method described in any of the foregoing embodiments.
[0103] More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.
[0104] In the present application, a computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. And in the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which computer-readable program code is carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
[0105] It will be understood that those of ordinary skill in the art can make equivalent substitutions or changes according to the technical solutions of the present invention and its inventive concept, and all such changes or substitutions should fall within the protection scope of the appended claims of the present invention.
Claims
1. A local record storage method, characterized in that, Including a writing and storing step: Obtain local record data and generate stored data; the stored data includes a record ID, a reporting flag, and data content; Write the stored data into a storage area, and adjust the upload pointer data to determine the accurate position of the stored data to be uploaded according to the upload pointer data; the upload pointer data includes an upload record ID representing the record ID of the last un-uploaded data, a start address representing the storage address of the first un-uploaded data, and an end address representing the next storage address of the last un-uploaded data. Among them, the adjustment of the upload pointer data specifically includes: When storing data, store the stored data at the end address, update the upload record ID in the upload pointer data to the record ID of the currently obtained stored data, and then update the end address in the upload pointer data to the next address of the storage area; in the upload pointer data, if the updated end address is the same as the start address, update the start address to the next address of the storage area.
2. The local record storage method according to claim 1, wherein Also including an upload step: Send an upload instruction to the service terminal; the upload instruction includes the record ID of the stored data in the start address recorded by the upload pointer data; After receiving the return instruction from the service terminal, start uploading the stored data from the start address recorded by the upload pointer data; where for each uploaded stored data, update the start address of the upload pointer data to the next address of the storage area until the start address is equal to the end address.
3. The local record storage method according to claim 2, wherein Specifically, uploading a stored data includes: Transmit the stored data at the start address to the service terminal; After receiving the feedback result of successful upload, modify the reporting flag of the stored data at the start address to "uploaded", and then change the start address to the next data address.
4. The local record storage method according to claim 3, wherein The service terminal obtains the device information of the upload device according to the upload operation, and the device information includes a working state, a working record, and device settings; The mobile terminal obtains the device information of the upload device through the service terminal.
5. The local record storage method according to claim 1, characterized in that The data content is obtained by encrypting the local record data.
6. The local record storage method according to claim 1, wherein Store the local record data through a write-back operation to obtain the stored data; Among them, the write-back operation specifically includes: Obtain the data volume of the cached data; the cached data includes one or more local record data; When the data volume is greater than or equal to a predetermined value, merge the cached data to generate the stored data.
7. An intelligent lock using the local record storage method according to any one of claims 1 to 6, characterized in that, Including: An obtaining module, used to obtain local record data; An uploading module, used to upload stored data; A processing module, used to generate stored data based on the local record data; The stored data includes a record ID, a reporting flag, and data content; Write the stored data into the storage area and adjust the upload pointer data to determine the exact location of the stored data to be uploaded according to the upload pointer data; the upload pointer data includes an upload record ID representing the record ID of the last un-uploaded data, a start address representing the storage address of the first un-uploaded data, and an end address representing the next storage address of the last un-uploaded data. Specifically, the adjustment of the upload pointer data includes: when storing data, store the data at the end address, update the upload record ID in the upload pointer data to the record ID of the currently obtained stored data, and then update the end address in the upload pointer data to the next address of the storage area; in the upload pointer data, if the updated end address is the same as the start address, update the start address to the next address of the storage area.
8. A computer device, characterized in that, It includes: a memory storing a computer program; a processor, where the computer program, when executed by the processor, implements the local record storage method according to any one of claims 1 to 6.
9. A computer-readable medium, characterized in that, storing a computer program, where the computer program, when executed by the processor, implements the local record storage method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method for uploading recorded information of intelligent door lock
CN109215190A
Data transmission device and method, data processing device and method, computer equipment and storage medium
CN113051197A