Log data saving method, device, program product, medium and home appliance
By creating a log pool in the volatile memory of home appliances, filtering and saving log data, the problem of low log data writing efficiency under multi-threading is solved, achieving efficient log data management and secure storage, and improving the reliability of home appliances and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHU MATY AIR CONDITIONING EQUIP CO LTD
- Filing Date
- 2024-11-29
- Publication Date
- 2026-05-29
AI Technical Summary
When existing home appliances operate in a multi-threaded manner, the efficiency of writing log data is low, resulting in a high risk of log data loss.
Create a log pool in the volatile memory of home appliances, capture and filter important log data in real time, read and save it to non-volatile memory, mobile storage devices or cloud servers on a regular or quantitative basis, and ensure data integrity and security through device coding and short-range wireless communication.
It improves the writing speed of log data, reduces the risk of data loss, and enables timely recording and persistent storage of critical log data, thereby enhancing the reliability of home appliances and the user experience.
Smart Images

Figure CN122111316A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of home appliance and log data storage technology, and particularly relates to a log data storage method, device, program product, medium and home appliance. Background Technology
[0002] With the increasing intelligence of home appliances, the need for recording and debugging their operating status is growing, making the preservation of log data generated during operation crucial. Existing solutions typically write this log data directly to serial ports or non-volatile storage. However, when multiple threads operate simultaneously within a home appliance, the log data generated by each thread needs to be written sequentially, resulting in frequent and inefficient write operations. Especially with large volumes of log data, this writing method is highly susceptible to data loss. Therefore, reducing the risk of log data loss in home appliances is a pressing technical problem that needs to be solved. Summary of the Invention
[0003] Embodiments of this application provide a log data storage method, apparatus, computer program product, computer-readable storage medium, and home appliance, thereby reducing the risk of log data loss in home appliances to at least a certain extent.
[0004] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part by practice of this application.
[0005] According to a first aspect of the embodiments of this application, a log data storage method is provided, the method comprising: acquiring target log data of each business thread in a target home appliance during its operation; writing the target log data into a log pool, the log pool being a storage space pre-created in the volatile memory of the target home appliance; reading the target log data from the log pool and storing the target log data.
[0006] In some embodiments of this application, based on the foregoing scheme, obtaining target log data of each business thread in the target home appliance during operation includes: in response to the startup of each business thread in the target home appliance, listening to the log data of each business thread during operation; filtering the log data according to preset filtering conditions to obtain the target log data.
[0007] In some embodiments of this application, based on the foregoing scheme, writing the target log data into the log pool includes: determining whether the remaining storage space of the log pool is greater than or equal to the data volume of the target log data; if the remaining storage space is greater than or equal to the data volume, then writing the target log data into the log pool.
[0008] In some embodiments of this application, based on the foregoing scheme, reading the target log data from the log pool includes: reading the target log data from the log pool periodically or quantitatively.
[0009] In some embodiments of this application, based on the foregoing scheme, before saving the target log data, the method further includes: adding a setting character to the target log data, the setting character being used to identify the data category of the target log data.
[0010] In some embodiments of this application, based on the foregoing scheme, saving the target log data includes: moving the target log data to a mobile storage device for saving; and / or moving the target log data to the local non-volatile memory of the home appliance for saving; and / or uploading the target log data to a cloud server for saving.
[0011] In some embodiments of this application, based on the foregoing scheme, before uploading the target log data to the cloud server for storage, the method further includes: sending a device registration request to the cloud server so that the cloud server determines a target device code for the target home appliance based on the registration information of the target home appliance; receiving the target device code issued by the cloud server, wherein the target device code is used to be added to a set position of the target log data to identify that the target log data belongs to the target home appliance.
[0012] In some embodiments of this application, based on the foregoing scheme, the method further includes: if the network communication channel between the target home appliance and the cloud server is interrupted, the target log data is sent to other home appliances so that the other home appliances can upload the target log data to the cloud server.
[0013] In some embodiments of this application, based on the foregoing scheme, before sending the target log data to other home appliances, the method further includes: broadcasting pairing information via short-range wireless communication, so that the other home appliances establish a short-range wireless communication channel with the target home appliance based on the pairing information.
[0014] In some embodiments of this application, based on the foregoing scheme, sending the target log data to other home appliances so that the other home appliances can upload the target log data to the cloud server includes: sending the target device code of the target home appliance to the other home appliances so that the other home appliances can send the target device code to the cloud server for verification; if the target home appliance receives a confirmation message sent by the other home appliances, then sending the target log data to the other home appliances so that the other home appliances can upload the target log data to the cloud server, wherein the confirmation message is used to indicate that the target device code has passed the verification of the cloud server.
[0015] In some embodiments of this application, based on the foregoing scheme, the method further includes: after the other home appliances receive the target log data, the other home appliances add the target device code to a set position of the target log data and upload the target log data to the cloud server, so that the cloud server identifies and saves the target log data of the target device based on the target device code.
[0016] According to a second aspect of the embodiments of this application, a log data storage device is provided. The device includes: an acquisition unit for acquiring target log data of each business thread in a target home appliance during operation; a writing unit for writing the target log data into a log pool, wherein the log pool is a storage space pre-created in the volatile memory of the target home appliance; and a reading unit for reading the target log data from the log pool and storing the target log data.
[0017] According to a third aspect of the embodiments of this application, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium and adapted to be read and executed by a processor to cause a computer device having the processor to perform an operation as described in any of the first aspects above.
[0018] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided, the computer-readable storage medium storing at least one computer program instruction, the at least one computer program instruction being loaded and executed by a processor to perform the operation as described in any of the first aspects above.
[0019] According to a fifth aspect of the embodiments of this application, a home appliance is provided, the home appliance including one or more processors and one or more memories, the one or more memories storing at least one computer program instruction, the at least one computer program instruction being loaded and executed by the one or more processors to perform the operation as described in any of the first aspects above.
[0020] Based on the technical solution proposed in this application, by acquiring target log data from each business thread in the target home appliance during its operation and writing it into a log pool pre-created in the volatile memory of the home appliance, important information during the operation of the home appliance can be captured in real time, ensuring the recording of key log data in the home appliance. Since the log pool is located in volatile memory, the data writing speed is fast, enabling rapid response to the high-frequency log data generation needs of the home appliance and avoiding data loss due to frequent read / write operations or write delays. Furthermore, the process of reading and saving target log data from the log pool allows this log data to be persistently stored, providing a reliable data foundation for subsequent log data analysis. In summary, the technical solution proposed in this application, through efficient data capture, fast storage and writing, and flexible data preservation, can reduce the risk of log data loss in home appliances, achieve comprehensive monitoring and effective utilization of home appliance log data, and improve the reliability of home appliances and user experience.
[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0022] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:
[0023] Figure 1 An application scenario diagram of an embodiment of this application is shown;
[0024] Figure 2 A flowchart illustrating a log data saving method according to an embodiment of this application is shown;
[0025] Figure 3 A block diagram of a log data storage device according to an embodiment of this application is shown;
[0026] Figure 4 A schematic diagram of the structure of a household appliance according to an embodiment of this application is shown. Detailed Implementation
[0027] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0028] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.
[0029] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices. It should also be noted that, for the sake of simplicity, certain components in the drawings that do not affect the interpretation of the technical solution of this application have been appropriately omitted.
[0030] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily need to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0031] In the description of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the amount of data for the indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "multiple" means two or more.
[0032] It should be noted that the log data storage method proposed in this application can be applied to home appliances, such as air conditioners, refrigerators, washing machines, etc.
[0033] To enable those skilled in the art to better understand this application, firstly, in conjunction with Figure 1An application scenario in one embodiment of this application will be described.
[0034] See Figure 1 The diagram illustrates an application scenario of an embodiment of this application.
[0035] In such Figure 1 In the application scenario shown, an air conditioning unit 101a, air conditioning unit 101b, and air conditioning unit 101c may be included in a home. To record and debug the operating status of each air conditioning unit, it is necessary to save the log data generated during operation. In existing solutions, each air conditioning unit typically saves log data to a mobile storage device 103 or local non-volatile memory 102a, 102b, 102c via serial port A, or to a cloud server 104 via network communication C (e.g., via WiFi access to the internet). However, when multiple threads are working simultaneously in the air conditioning unit, the log data generated by each thread needs to be written sequentially, resulting in frequent and inefficient write operations. Especially when the log data volume is large, this writing method is prone to log data loss. Therefore, this application proposes a log data storage scheme to reduce the risk of log data loss in air conditioning units.
[0036] The implementation details of the technical solutions in the embodiments of this application are described in detail below:
[0037] Reference Figure 2 A flowchart illustrating a log data storage method according to an embodiment of this application is shown. In this application, the log data storage method can be executed by a device with computing processing capabilities. (Refer to...) Figure 2 As shown, this log data saving method includes at least steps 210 to 230, which are described in detail below:
[0038] In step 210, target log data of each business thread in the target home appliance during its operation is obtained.
[0039] In this application, the business thread in the home appliance can refer to the business thread used to implement various functions of the home appliance, such as business threads including voice module, TFT module, sensor module, WiFi module, Ble module (i.e., Bluetooth Low Energy module), etc.
[0040] In this application, the acquisition of target log data of each business thread in the target home appliance during operation can be performed according to the following steps 211 to 212:
[0041] Step 211: In response to the startup of each business thread in the target home appliance, listen to the log data of each business thread during its operation.
[0042] Step 212: Filter the log data according to preset filtering conditions to obtain the target log data.
[0043] It is understandable that when each business thread in the target home appliance starts running, it will generate a series of log data. Therefore, the initial log data can be obtained by listening to the running process of each business thread.
[0044] In this application, the log data may include, but is not limited to, the following:
[0045] I. Error Log Data: Records error information that occurs during thread execution. This includes exception capture, error code, and error description. This data is crucial for diagnosing and troubleshooting home appliances.
[0046] 2. Warning Log Data: Records potential risks or abnormal behaviors that may cause problems. For example, resource usage approaching the limit, unstable network connection, etc.
[0047] III. Information Log Data: Records normal system operation information. This typically includes thread start and stop times, successful configuration loading, connection establishment, etc. This data helps to understand the overall operating status of home appliances.
[0048] IV. Debug Log Data: Used during the development and testing phases, this data records detailed internal state changes and variable values. In production environments, this data is usually disabled or restricted to minimize its impact on performance.
[0049] V. Performance Log Data: Records thread performance metrics such as execution time, memory usage, and CPU usage. This data is very useful for optimizing the system performance and resource management of home appliances.
[0050] VI. User Operation Log Data: Records user interactions with the device, including user input and command execution. This data helps analyze user behavior and improve user experience.
[0051] In this application, after monitoring the log data of each business thread during its operation, this data can be further filtered to extract target log data of significant importance. Through preset filtering conditions, log data that meets the criteria can be automatically identified and extracted, thereby more efficiently supporting problem monitoring and diagnosis.
[0052] In this application, the preset filtering conditions can be flexibly configured to adapt to different data analysis needs. These conditions can be graded according to the importance of log data. For example, error log data, warning log data, and information log data are considered high-priority data because they are directly related to the stability and performance of home appliance systems. Therefore, these types of log data are defined as high-level data and are prioritized for filtering and processing. In contrast, debug log data and user operation log data can be defined as low-level data. These log data are mainly used for debugging and user behavior analysis during the development phase, and their priority is relatively low.
[0053] In this application, this hierarchical screening mechanism can not only effectively filter out unnecessary log data noise, but also ensure that key log data is processed and analyzed in a timely manner, thereby improving the efficiency of log data management, helping to quickly locate and solve potential problems of home appliances, and thus ensuring the efficient and stable operation of home appliances.
[0054] Continue to refer to Figure 2 In step 220, the target log data is written into a log pool, which is a storage space pre-created in the volatile memory of the target home appliance.
[0055] In this application, a storage space can be pre-created in the volatile memory of the target home appliance as a log pool for temporarily storing and managing target log data of each business thread during operation. This effectively allows for the temporary storage and management of target log data from each business thread. Specifically, the fast read / write characteristics of volatile memory can be utilized to ensure that log data can be written efficiently, thereby improving the real-time performance of the system. Furthermore, the log pool proposed in this application can avoid frequent read / write operations to non-volatile memory, thus reducing the risk of log data loss in the home appliance.
[0056] In this application, the step of writing the target log data into the log pool can be performed according to the following steps 221 to 222:
[0057] Step 221: Determine whether the remaining storage space of the log pool is greater than or equal to the amount of the target log data.
[0058] Step 222: If the remaining storage space is greater than or equal to the amount of data, then write the target log data into the log pool.
[0059] In this application, step 223 may also be performed:
[0060] Step 223: If the remaining storage space is less than the amount of data, then discard the target log data.
[0061] In this application, the remaining storage space of the log pool is determined to ensure that new target log data can be effectively stored. When the remaining storage space of the log pool is detected to be greater than or equal to the amount of target log data to be written, this data can be safely written to the log pool, ensuring the integrity and timeliness of the target log data and providing reliable data support for subsequent log data analysis. When the remaining storage space of the log pool is insufficient to accommodate new target log data, this data is discarded to prevent the log pool from crashing due to storage space overflow and losing other log data. This reduces the risk of log data loss in home appliances and achieves secure management of log data storage and processing.
[0062] Continue to refer to Figure 2 In step 230, the target log data is read from the log pool and saved.
[0063] In this application, the step of reading the target log data from the log pool can be performed according to the following step 231:
[0064] Step 231: Read the target log data from the log pool periodically or quantitatively.
[0065] In this application, by reading target log data from the log pool periodically or according to a preset data volume, data overflow in the log pool can be prevented, ensuring that key log data is processed and saved in a timely manner, thereby providing reliable data support for subsequent home appliance status analysis and fault diagnosis.
[0066] In this application, before saving the target log data, the following step 240 may also be performed:
[0067] Step 240: Add a setting character to the target log data. The setting character is used to identify the data category of the target log data.
[0068] In this application, adding specified characters to the target log data before saving it can significantly improve the efficiency of log data management and analysis. Specifically, by setting characters to identify the specific categories of log data, such as data level or data type, users can quickly locate and identify different categories of log data during subsequent analysis. For example, in the target log data, the set characters can be "ERROR" or "INFO" to distinguish between error log data and information log data. This makes the classification of log data more intuitive, and can greatly shorten data processing time and improve the accuracy and efficiency of log data analysis when performing data filtering, sorting, and retrieval during subsequent log data analysis.
[0069] In this application, the saving of the target log data can be performed according to at least one of the following steps: 250, 260, and 270.
[0070] Step 250: Move the target log data to a mobile storage device for storage.
[0071] In this application, the target log data is moved to a mobile storage device for storage, which can be achieved through a serial communication channel between the target home appliance and the mobile storage device. For example... Figure 1 As shown, air conditioning devices 101a, 101b, and 101c move target log data from the log pool to mobile storage device 103 via serial port A.
[0072] Step 260: Move the target log data to the local non-volatile memory of the home appliance for storage.
[0073] In this application, the target log data is moved to the local non-volatile memory of the home appliance for storage, which can be achieved through a serial communication channel between the target home appliance and the local non-volatile memory. For example... Figure 1 As shown, air conditioning devices 101a, 101b, and 101c respectively move target log data from the log pool to local non-volatile storage devices 102a, 102b, and 102c via serial port A.
[0074] Step 270: Upload the target log data to the cloud server for storage.
[0075] In this application, the target log data is uploaded to a cloud server for storage, which can be done through a network communication channel (such as an internet communication channel connected via WiFi) between the target home appliance and the cloud server. For example... Figure 1 As shown, air conditioning devices 101a, 101b, and 101c upload target log data from the log pool to the cloud server 104 via network communication channel C.
[0076] Based on the technical solution proposed in this application, by acquiring target log data from each business thread in the target home appliance during its operation and writing it into a log pool pre-created in the volatile memory of the home appliance, important information during the operation of the home appliance can be captured in real time, ensuring the recording of key log data in the home appliance. Since the log pool is located in volatile memory, the data writing speed is fast, enabling rapid response to the high-frequency log data generation needs of the home appliance and avoiding data loss due to frequent read / write operations or write delays. Furthermore, the process of reading and saving target log data from the log pool allows this log data to be persistently stored, providing a reliable data foundation for subsequent log data analysis. In summary, the technical solution proposed in this application, through efficient data capture, fast storage and writing, and flexible data preservation, can reduce the risk of log data loss in home appliances, achieve comprehensive monitoring and effective utilization of home appliance log data, and improve the reliability of home appliances and user experience.
[0077] In this application, before step 270 above, that is, before uploading the target log data to the cloud server for storage, the following steps 271 to 272 may also be performed:
[0078] Step 271: Send a device registration request to the cloud server so that the cloud server can determine the target device code for the target home appliance based on the registration information of the target home appliance.
[0079] Step 272: Receive the target device code sent by the cloud server. The target device code is used to be added to a set position in the target log data to identify that the target log data belongs to the target home appliance.
[0080] In this application, the accurate attribution and efficient management of log data can be ensured by registering and assigning codes to home appliances before uploading data to the cloud server. Specifically, before uploading target log data, the target home appliance first sends a registration request to the cloud server, so that the cloud server assigns a unique target device code to it based on the registration information of the target home appliance. This code can be used to identify the device and ensure that each log data can be accurately associated with the target home appliance.
[0081] Once the target home appliance receives this code, it can add it to the designated location in the target log data, ensuring the source of the target log data is clearly identifiable. The advantages are twofold: First, it ensures the accurate attribution of the target log data, enabling the cloud server to effectively identify and manage target log data from different home appliances. Second, by registering and assigning codes to home appliances before data upload, log data management efficiency is improved, reducing the risk of log data contamination. Furthermore, it enhances security during log data management, allowing only registered home appliances to upload log data and preventing unauthorized access. Overall, the home appliance registration and coding mechanism described in steps 271 to 272 enables efficient management and use of target log data, improving the overall reliability of log data management and user experience.
[0082] In this application, step 273 may also be performed:
[0083] Step 273: If the network communication channel between the target home appliance and the cloud server is interrupted (for example, the WiFi connection of the target home appliance drops), the target log data is sent to other home appliances so that the other home appliances can upload the target log data to the cloud server.
[0084] In this application, before sending the target log data to other home appliances, the following step 2731 may also be performed:
[0085] Step 2731: Broadcast pairing information via short-range wireless communication so that the other home appliances can establish a short-range wireless communication channel with the target home appliance based on the pairing information.
[0086] In this application, the short-range wireless communication method can be Bluetooth communication. Specifically, as... Figure 1As shown, firstly, the target home appliance (home appliance 101a) enters discoverable mode and broadcasts Bluetooth pairing information. Other home appliances (home appliances 101b and 101c) scan the channel to discover the pairing information. Then, the other home appliances initiate pairing requests, exchanging pairing keys to establish a secure connection with the target home appliance. After successfully pairing with other home appliances, the target home appliance establishes a short-range wireless communication channel B with them for data exchange and transmission. This allows the target home appliance to communicate with other home appliances even when its network is interrupted, enabling them to upload target log data to the cloud server 104.
[0087] Based on the technical solution in step 273 above, when the network communication channel between the target home appliance and the cloud server is interrupted, the target log data can be uploaded to other home appliances by sending the target log data, which can ensure the reliability and integrity of the target log data upload, improve the robustness of the home appliance in saving log data, and thus reduce the risk of log data loss in the home appliance.
[0088] In this application, the step of sending the target log data to other home appliances so that the other home appliances can upload the target log data to the cloud server can be performed according to the following steps 2732 to 2733:
[0089] Step 2732: Send the target device code of the target home appliance to the other home appliances, so that the other home appliances can send the target device code to the cloud server for verification.
[0090] Step 2733: If the target home appliance receives a confirmation message sent by the other home appliance, then the target log data is sent to the other home appliance so that the other home appliance can upload the target log data to the cloud server. The confirmation message is used to indicate that the target device code has passed the verification of the cloud server.
[0091] Based on steps 2732 and 2733 above, before uploading the target log data via other home appliances, the target device code is verified by the cloud server to ensure that only target log data from registered home appliances can be uploaded, thus ensuring the security of the entire log data upload process. Using other home appliances as intermediaries for target log data upload increases the flexibility and stability of data transmission, especially when the target device's network connection is unstable, ensuring log data upload and reducing the risk of log data loss from home appliances.
[0092] In this application, based on step 2733 above, the other household appliances can perform the following step 2734:
[0093] Step 2734: After the other home appliances receive the target log data, the other home appliances add the target device code to the set position of the target log data and upload the target log data to the cloud server, so that the cloud server can identify and save the target log data of the target device based on the target device code.
[0094] In this application, step 2734 offers the advantage of enhancing the accuracy and security of data management. When other home appliances receive the target log data, they add the target device code to the designated location within the target log data, ensuring that the target log data uploaded to the cloud server can be accurately identified and categorized. In this way, the cloud server can effectively identify and store log data based on the target device code, preventing confusion or loss of target log data from different home appliances, thereby improving the efficiency of log data management. Furthermore, it can further verify the legitimacy of the log data source, preventing unauthorized log data uploads and enhancing the security of log data management across all home appliances.
[0095] The following describes an apparatus embodiment of this application, which can be used to execute the log data saving method in the above embodiments of this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the log data saving method described above.
[0096] See Figure 3 The diagram shows a block diagram of a log data storage device according to an embodiment of this application.
[0097] like Figure 3 As shown, the log data storage device 300 according to an embodiment of this application includes: a storage unit acquisition unit 301, a writing unit 302, and a reading unit 303.
[0098] The acquisition unit 301 is used to acquire target log data of each business thread in the target home appliance during operation; the writing unit 302 is used to write the target log data into a log pool, which is a storage space pre-created in the volatile memory of the target home appliance; and the reading unit 303 is used to read the target log data from the log pool and save the target log data.
[0099] In some embodiments of this application, based on the foregoing scheme, the acquisition unit 301 is configured to: in response to the startup of each business thread in the target home appliance, listen to the log data of each business thread during operation; filter the log data according to preset filtering conditions to obtain the target log data.
[0100] In some embodiments of this application, based on the foregoing scheme, the writing unit 302 is configured to: determine whether the remaining storage space of the log pool is greater than or equal to the data volume of the target log data; if the remaining storage space is greater than or equal to the data volume, then write the target log data into the log pool.
[0101] In some embodiments of this application, based on the foregoing scheme, the reading unit 303 is configured to read the target log data from the log pool periodically or quantitatively.
[0102] In some embodiments of this application, based on the foregoing scheme, the apparatus further includes: an adding unit, configured to add a setting character to the target log data before saving the target log data, the setting character being used to identify the data category of the target log data.
[0103] In some embodiments of this application, based on the foregoing scheme, the reading unit 303 is configured to: move the target log data to a mobile storage device for storage; and / or move the target log data to a non-volatile memory local to the home appliance for storage; and / or upload the target log data to a cloud server for storage.
[0104] In some embodiments of this application, based on the foregoing scheme, the device further includes: a registration unit, configured to send a device registration request to the cloud server before uploading the target log data to the cloud server for storage, so that the cloud server determines a target device code for the target home appliance based on the registration information of the target home appliance; and receive the target device code issued by the cloud server, wherein the target device code is used to be added to a set position of the target log data to identify that the target log data belongs to the target home appliance.
[0105] In some embodiments of this application, based on the foregoing scheme, the device further includes: a sending unit, configured to send the target log data to other home appliances if the network communication channel between the target home appliance and the cloud server is interrupted, so that the other home appliances can upload the target log data to the cloud server.
[0106] In some embodiments of this application, based on the foregoing scheme, the device further includes: a pairing unit, configured to broadcast pairing information via short-range wireless communication before sending the target log data to other home appliances, so that the other home appliances establish a short-range wireless communication channel with the target home appliance based on the pairing information.
[0107] In some embodiments of this application, based on the foregoing scheme, the sending unit is configured to: send the target device code of the target home appliance to the other home appliances, so that the other home appliances can send the target device code to the cloud server for verification; if the target home appliance receives a confirmation message sent by the other home appliances, then send the target log data to the other home appliances, so that the other home appliances can upload the target log data to the cloud server, wherein the confirmation message is used to indicate that the target device code has passed the verification of the cloud server.
[0108] In some embodiments of this application, based on the foregoing scheme, after the other home appliances receive the target log data, the other home appliances add the target device code to a set position in the target log data and upload the target log data to the cloud server, so that the cloud server can identify and save the target log data of the target device based on the target device code.
[0109] Based on the same inventive concept, embodiments of this application provide a computer program product, the computer program product including computer instructions stored in a computer-readable storage medium and adapted to be read and executed by a processor, so as to cause a computer device having the processor to perform the operations performed by the log data saving method as described above.
[0110] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium storing at least one computer program instruction, which is loaded and executed by a processor to perform the operations performed by the log data saving method described above.
[0111] Based on the same inventive concept, this application also provides a household appliance, see reference. Figure 4 The diagram shows a structural schematic of a home appliance in an embodiment of this application. The home appliance includes one or more memories 404, one or more processors 402, and at least one computer program (computer program instruction) stored in the memory 404 and executable on the processor 402. When the processor 402 executes the computer program, it implements the log data saving method described above.
[0112] Among them, Figure 4 In this document, a bus architecture (represented by bus 400) is used. Bus 400 may include interconnects of buses and bridges of arbitrary data volume. Bus 400 links various circuits, including one or more processors represented by processor 402 and memory represented by memory 404. Bus 400 may also link various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. Bus interface 405 provides an interface between bus 400 and receiver 401 and transmitter 403. Receiver 401 and transmitter 403 may be the same element, i.e., a transceiver, providing a unit for communicating with various other devices over a transmission medium. Processor 402 is responsible for managing bus 400 and general processing, while memory 404 can be used to store data used by processor 402 during operation.
[0113] The functions described herein may be implemented in hardware, software executed by a processor, firmware, or any combination thereof. If implemented in software executed by a processor, the functions may be stored as one or more instructions or code on or transmitted via a computer-readable medium. Other embodiments and implementations are within the scope and spirit of this application and the appended claims. For example, due to the nature of software, the functions described above may be implemented using software executed by a processor, hardware, firmware, hardwired, or any combination thereof. Furthermore, the functional units may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit.
[0114] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0115] The units described as separate components may or may not be physically separate. Similarly, the components of the control device may or may not be physical units; they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0116] 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 medium. 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 storage medium 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 described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing computer program instructions, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0117] The above description is merely an embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for saving log data, characterized in that, The method includes: Obtain target log data of each business thread in the target home appliance during its operation; The target log data is written into a log pool, which is a storage space pre-created in the volatile memory of the target home appliance; Read the target log data from the log pool and save the target log data.
2. The method according to claim 1, characterized in that, The acquisition of target log data during the operation of each business thread in the target home appliance includes: In response to the startup of each business thread in the target home appliance, the log data of each business thread during its operation is monitored; The log data is filtered according to preset filtering conditions to obtain the target log data.
3. The method according to claim 1, characterized in that, The step of writing the target log data into the log pool includes: Determine whether the remaining storage space of the log pool is greater than or equal to the amount of the target log data; If the remaining storage space is greater than or equal to the amount of data, the target log data is written into the log pool.
4. The method according to claim 1, characterized in that, The step of reading the target log data from the log pool includes: The target log data is read from the log pool periodically or in fixed quantities.
5. The method according to claim 1, characterized in that, Before saving the target log data, the method further includes: Add a setting character to the target log data; the setting character is used to identify the data category of the target log data.
6. The method according to claim 1, characterized in that, The process of saving the target log data includes: Move the target log data to a removable storage device for storage; and / or Move the target log data to the local non-volatile memory of the home appliance for storage; and / or The target log data is uploaded to a cloud server for storage.
7. The method according to claim 1, characterized in that, Before uploading the target log data to the cloud server for storage, the method further includes: Send a device registration request to the cloud server so that the cloud server can determine the target device code for the target home appliance based on the registration information of the target home appliance; The system receives the target device code sent by the cloud server. The target device code is used to be added to a set position in the target log data to identify that the target log data belongs to the target home appliance.
8. The method according to claim 6, characterized in that, The method further includes: If the network communication channel between the target home appliance and the cloud server is interrupted, the target log data will be sent to other home appliances so that the other home appliances can upload the target log data to the cloud server.
9. The method according to claim 8, characterized in that, Before sending the target log data to other home appliances, the method further includes: Pairing information is broadcast via short-range wireless communication, enabling other home appliances to establish a short-range wireless communication channel with the target home appliance based on the pairing information.
10. The method according to claim 8, characterized in that, The step of sending the target log data to other home appliances, so that the other home appliances can upload the target log data to the cloud server, includes: The target device code of the target home appliance is sent to the other home appliances, so that the other home appliances can send the target device code to the cloud server for verification. If the target home appliance receives a confirmation message from the other home appliance, it sends the target log data to the other home appliance so that the other home appliance can upload the target log data to the cloud server. The confirmation message is used to indicate that the target device code has passed the verification of the cloud server.
11. The method according to claim 10, characterized in that, The method further includes: After the other home appliances receive the target log data, they add the target device code to a designated location in the target log data and upload the target log data to the cloud server, so that the cloud server can identify and save the target log data of the target device based on the target device code.
12. A log data storage device, characterized in that, The device includes: The acquisition unit is used to acquire target log data of each business thread in the target home appliance during its operation. A writing unit is used to write the target log data into a log pool, which is a storage space pre-created in the volatile memory of the target home appliance. The reading unit is used to read the target log data from the log pool and save the target log data.
13. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium and adapted to be read and executed by a processor to cause a computer device having the processor to perform the method as claimed in any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one piece of program code, which is loaded and executed by a processor to perform the operations performed by the method as described in any one of claims 1 to 11.
15. A household appliance, characterized in that, The home appliance includes one or more processors and one or more memories, wherein at least one piece of program code is stored in the one or more memories, and the at least one piece of program code is loaded and executed by the one or more processors to implement the method as claimed in any one of claims 1 to 11.