Data recording method, device, equipment, medium and product of embedded device
By automatically starting default data recording and writing data bidirectionally to the storage space after the embedded device is powered on, the problem of missing key monitoring data in abnormal situations is solved, and rich data recording and complete reporting are achieved under limited storage resources.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN SAFILI TECH CO LTD
- Filing Date
- 2025-08-13
- Publication Date
- 2026-08-04
AI Technical Summary
Embedded devices are prone to missing key monitoring data in abnormal situations such as no operation to start the record or accidental operation to stop the record, and cannot provide users with sufficient recorded data.
From the moment the embedded device is powered on, the data acquisition function is initiated, collecting default and formal record data and writing them into the storage space from different directions to generate a data report.
With limited storage resources, ensure the integrity and richness of key monitoring data, provide sufficient recorded data, generate rich data reports, and improve storage resource utilization and user experience.
Smart Images

Figure CN120994500B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data storage technology, and in particular to a data recording method, apparatus, device, medium and product for embedded devices. Background Technology
[0002] Embedded devices are a type of dedicated computer system designed to perform specific tasks and are typically embedded within larger devices or systems. Unlike general-purpose computers (such as PCs or smartphones), embedded devices are usually optimized for specific functions, emphasizing low power consumption, high reliability, and real-time performance.
[0003] Since embedded devices typically have limited storage resources, in order to conserve these limited resources, the embedded device will only start the data recording function when the user needs to record data. However, in abnormal situations such as not starting recording or accidentally stopping recording, the embedded device may miss key monitoring data and fail to provide the user with sufficient recorded data. Summary of the Invention
[0004] This application provides a data recording method, apparatus, device, medium, and product for embedded devices to solve the problems that embedded devices are prone to missing key monitoring data and cannot provide users with sufficient recorded data in abnormal situations such as no operation to start recording or accidental operation to stop recording.
[0005] A first aspect of this application provides a data recording method for an embedded device, comprising the following steps: starting from the power-on of the embedded device, activating the data acquisition function of the embedded device; when no user's data recording intention is detected or a user's intention to stop recording is detected, writing the first recorded data of the embedded device into the storage space of the embedded device in a first writing direction; if the user's data recording intention is detected, stopping the writing of the first recorded data, and responding to the data recording intention, writing the second recorded data of the embedded device into the storage space of the embedded device in a second writing direction, wherein the first writing direction and the second writing direction are different writing directions in the storage space; generating a data report based on the first recorded data and / or the second recorded data.
[0006] Optionally, the address area of the storage space includes a start address and a tail address. The first write direction starts writing from one of the start address and the tail address, and the second write direction starts writing from the other of the start address and the tail address.
[0007] Optionally, after the second recorded data of the embedded device is collected and written to the storage space of the embedded device in the second writing direction, the method includes: obtaining the storage address of the second recorded data in the storage space at the current moment; if the storage space of the second recorded data in the storage space at the current moment conflicts with the storage space of the first recorded data in the storage space, then deleting the first recorded data.
[0008] Optionally, if the storage space of the second record data in the storage space at the current moment conflicts with the storage space of the first record data in the storage space, the method includes: obtaining the first storage address of the first record data in the storage space at the stop time; obtaining the second storage address of the second record data in the storage space at the current moment; and determining the conflict between the storage spaces of the first record data and the second record data based on the first storage address and the second storage address.
[0009] Optionally, determining the conflict of storage space between the first record data and the second record data based on the first storage address and the second storage address includes: calculating the free space between the first storage address and the second storage address; if the free space is less than the safe space threshold, then determining the conflict of storage space between the first record data and the second record data.
[0010] Optionally, before determining the conflict of storage space based on the first storage address and the second storage address, the method further includes: obtaining the minimum operating space within the storage space; setting a safe space threshold according to the minimum operating space, wherein the safe space threshold is greater than the minimum operating space.
[0011] A second aspect of this application provides a data recording device for an embedded device, comprising: a default recording module, configured to initiate the data acquisition function of the embedded device upon power-on, and write the acquired first recorded data of the embedded device into the storage space of the embedded device in a first writing direction when no user data recording intention is detected or when a user's intention to stop recording is detected; a formal recording module, configured to stop writing the first recorded data if a user's data recording intention is detected, and in response to the data recording intention, write the acquired second recorded data of the embedded device into the storage space of the embedded device in a second writing direction, wherein the first writing direction and the second writing direction are different writing directions within the storage space; and a generation module, configured to generate a data report based on the first recorded data and / or the second recorded data.
[0012] A third aspect of this application provides an embedded device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the program to implement the data recording method of the embedded device described above.
[0013] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement the data recording method of the embedded device described above.
[0014] A fourth aspect of this application provides a computer program product having a computer program or instructions stored thereon, which, when executed, implements the data recording method of the embedded device described above.
[0015] Therefore, this application has at least the following beneficial effects: This application embodiment starts the data acquisition function of the embedded device from the moment it powers on. The first recorded data is the default recorded data, and the second recorded data is the formal recorded data. That is, the default recorded data function is automatically started after power-on. When the user's data recording intention is detected, the default recorded data is stopped and the formal recorded data is started. In the same storage space, the default recorded data and the formal recorded data are written from different directions in the storage space. In this way, by writing data bidirectionally in the same storage space, the default recorded data can still be saved under the limited storage resources of the embedded device, especially when the formal recorded data is not enough, and an independent data report can be generated. This provides as much data as possible. At the same time, the embedded device can also provide enough recorded data in abnormal situations such as no operation to start recording or accidental operation to stop recording, so as to avoid missing key monitoring data. In this way, by providing users with sufficient recorded data, richer data reports can be generated, and rich data recording can be achieved under limited storage resources. Thus, it solves the technical problems that embedded devices are prone to missing key monitoring data and cannot provide users with sufficient recorded data in abnormal situations such as no operation to start recording or accidental operation to stop recording.
[0016] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0017] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 This is a flowchart of a data recording method for an embedded device according to an embodiment of this application; Figure 2 Example diagrams are provided for an embedded device data recording apparatus according to embodiments of this application; Figure 3 This is a schematic diagram of the structure of an embedded device provided according to an embodiment of this application. Detailed Implementation
[0018] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0019] For embedded devices, if the user does not operate to start the embedded device, there will be no data when a data report is required; if the embedded device stops recording due to impact, squeezing or other actions during transportation, the embedded device will be unable to continue to provide subsequent data recording after it stops.
[0020] Therefore, embedded devices cannot provide effective, complete data reports for full-process monitoring in abnormal situations such as no operation start-up records or accidental operation stop records, leading to commercial disputes. To address this, this application embodiment, under the limited storage resources of embedded devices, especially when there is not enough formally recorded data, defaults to still saving recorded data and generating independent data reports, providing as much data as possible. At the same time, the embedded device can also provide sufficient recorded data in abnormal situations such as no operation start-up records or accidental operation stop records, improving the utilization rate of storage resources. Under the condition of limited storage resources, it effectively saves key monitoring data, enhances the intelligence of embedded devices, and improves the user experience.
[0021] The following description, with reference to the accompanying drawings, details a data recording method, apparatus, device, medium, and product for an embedded device according to embodiments of this application. Specifically, Figure 1 This is a flowchart illustrating a data recording method for an embedded device provided in an embodiment of this application.
[0022] like Figure 1 As shown, the data recording method of this embedded device includes the following steps: In step S101, starting from the power-on of the embedded device, the data acquisition function of the embedded device is started. When the user's data recording intention is not recognized or the user's intention to stop recording is recognized, the first recorded data of the embedded device is written to the storage space of the embedded device in the first writing direction.
[0023] In this embodiment of the application, the first recorded data can also be referred to as the default recorded data. The recording interval of the default recorded data is longer than that of the formal recorded data. For example, it can be set to one hour or two hours. The longer interval is to reduce power consumption and extend the time from factory to final report reading.
[0024] It is understood that the data acquisition function of the embedded device can be started from the moment the embedded device is powered on, or even from the moment it leaves the factory. If the user's intention to record data or the user's intention to stop recording is not recognized, that is, when the user does not operate or operates by mistake, the default recording data of the embedded device is collected. The address area of the storage space includes the start address and the end address. The first write direction starts writing from one of the start address and the end address. For example, if the address area of the storage space is [0x00000000 ~ 0x00055000), then the first write direction can start writing data from 0x00000000, that is, start recording from the low address. Of course, the first write direction can start writing data from 0x00055000, that is, start recording from the high address.
[0025] Therefore, in this embodiment of the application, the data acquisition function of the embedded device is started from the factory or from the start of operation, and the default recorded data of the embedded device is collected. This can prevent the storage space from being empty or missing key data when the user does not operate the embedded device or misoperates the embedded device and it stops, thereby effectively enriching the recorded data of the embedded device.
[0026] It should be noted that each time the user makes a configuration change, the default recording will be restarted. No user configuration is required; the default recording can be started at the factory to keep the data acquisition function of the embedded device uninterrupted and provide the user with as much recorded data as possible.
[0027] In step S102, if the user's data recording intention is detected, the writing of the first recorded data is stopped, and in response to the data recording intention, the collected second recorded data of the embedded device is written into the storage space of the embedded device in the second writing direction, wherein the first writing direction and the second writing direction are different in the storage space.
[0028] In this embodiment of the application, the second recorded data can also be referred to as formal recorded data, which is the record actively implemented by the user according to the product operation instructions. After the user clearly starts formal recording, the recording interval of formal recorded data is usually short, such as five minutes or six minutes. The interval is often determined by the user according to actual needs, which means there is a definite product usage time requirement to meet the product power consumption requirements.
[0029] It is understood that the embodiments of this application can stop writing default recording data when the user's data recording intention is recognized. That is, when the user operates the embedded device and needs to formally record data, the storage of default recording data is stopped and the storage of formal recording data begins. Default recording is stopped after formal recording data is started, avoiding the problem of low efficiency when default recording data and formal recording data are stored simultaneously. This not only provides more storage space for formal recording data but also improves the storage efficiency of formal recording data and reduces the occupation of related resources. The address area of the storage space includes a start address and a tail address. The first writing direction and the second writing direction have different writing directions in the storage space. If the first writing direction starts writing from the start address, then the second writing direction starts writing from the tail address; if the first writing direction starts writing from the tail address, then the second writing direction starts writing from the start address.
[0030] For example, if the address range of the storage space is [0x00000000 ~ 0x00055000), then the first write direction can start writing data from 0x00000000, that is, starting to record from the low address, and the second write direction can start writing data from 0x00055000, that is, starting to record from the high address; if the first write direction can start writing data from 0x00055000, that is, starting to record from the high address, then the second write direction can start writing data from 0x00000000, that is, starting to record from the low address.
[0031] Therefore, users can initiate formal recording through product operation. Upon startup, the device halts the default process, but data from the default recording period persists. For example, default recording data is stored from high to low address, while formal recording data is stored from low to high address. Here, "low" and "high" simply indicate a staggered approach, without specific limitations. By writing data bidirectionally to the same storage space, default recording data can still be preserved and independent data reports can be generated, even with limited storage resources on embedded devices, especially when formal recording data is not yet abundant. This maximizes the amount of data available, allowing for the simultaneous storage of both default and formal recording data, thus fully utilizing storage resources and improving storage efficiency.
[0032] In step S103, a data report is generated based on the first recorded data and / or the second recorded data.
[0033] It is understandable that when the amount of formally recorded data is insufficient, since the storage space contains default recorded data, even in abnormal situations such as the embedded device not starting recording or accidentally stopping recording, it can still automatically save key monitoring data and provide sufficient recorded data to generate a data report. In this case, the data report can be generated solely using the default recorded data, or it can be generated by combining the default recorded data and the formally recorded data. When the amount of formally recorded data is sufficient, the formally recorded data can provide effective data for generating a data report, and in this case, the data report can be generated solely using the formally recorded data. Therefore, this embodiment of the application, by writing recorded data bidirectionally to the same storage space, ensures that the formally recorded data is long enough to provide sufficient recorded data for the data report even when the formally recorded data is insufficient, thus improving the user experience.
[0034] It should be noted that after the formal recording data is recorded, if the embedded device stops recording due to accidental operation or other abnormal circumstances, this embodiment of the application automatically resumes the recording of the default recording data. At this time, the default recording data is written again according to the second writing direction of the formal recording data, that is, the recording data continues forward according to the second writing direction of the formal recording data to ensure the integrity of spatiotemporal data. The default recording data that continues to be recorded is recoverable data. When the user finds that the formal recording data has stopped midway, the recoverable data can be converted into "formal recording data" to generate a complete formal report. At this time, the original default recording data can be retained as diagnostic data. Thus, after the abnormal operation stops recording, the background will continue to record data and provide the data to be recorded later when needed, thereby realizing the recovery of data recording after the abnormal operation stops, avoiding the loss of key data, maintaining the integrity of the recorded data, and spatiotemporal data refers to the data from the start of recording after the abnormality to the time period when it is needed.
[0035] If the default recording duration from the recovery time is less than or equal to the duration threshold, and the user restarts the recording of formal data, the original formal data is rich in content, while the new default recording is relatively small. To avoid overwriting the original formal data, data can continue to be written in the second write direction. Conversely, if the actual recording duration of the default data from the recovery time exceeds the duration threshold, and the user restarts the recording of formal data, the default data is already substantial and may have begun to overwrite the original formal data. To ensure data richness and integrity, data can be written in the first write direction. The duration threshold is a critical value for the recording duration, used as a limit to distinguish the richness of default and formal data.
[0036] In this embodiment of the application, after the second recorded data of the embedded device is collected and written into the storage space of the embedded device in the second writing direction, the method includes: obtaining the storage address of the second recorded data in the storage space at the current moment; if the storage space of the second recorded data in the storage space at the current moment conflicts with the storage space of the first recorded data in the storage space, then the first recorded data is deleted.
[0037] It is understood that in the embodiments of this application, when there is a conflict between default record data and formal record data, since the formal record data is usually long enough and sufficient record data can be recorded, the value of the default record data is reduced. At this time, the default record data can be deleted to ensure the continuous recording of formal record data and provide storage space for formal record data.
[0038] In this embodiment of the application, if the storage space of the second record data in the storage space at the current moment conflicts with the storage space of the first record data in the storage space, the method includes: obtaining the first storage address of the first record data in the storage space at the stop time; obtaining the second storage address of the second record data in the storage space at the current moment; and determining the conflict between the storage spaces of the first record data and the second record data based on the first storage address and the second storage address.
[0039] It is understood that the embodiments of this application can obtain the first storage address at the time when the default record data stops, and obtain the second storage address of the second record data at the current time. The first storage address and the second storage address are used to determine whether there is a storage space conflict. If there is a storage space conflict, the default record number is deleted.
[0040] In this embodiment of the application, determining the conflict of storage space between the first record data and the second record data based on the first storage address and the second storage address includes: calculating the free space between the first storage address and the second storage address; if the free space is less than the safe space threshold, then determining the conflict of storage space between the first record data and the second record data.
[0041] Among them, the security space threshold refers to the critical value for judging whether the storage space is conflicting. In this application embodiment, the security space threshold is used as the setting address security interval. The security interval is to solve the problem of cross-region when different carriers erase the smallest block, and to avoid conflicts when deleting data.
[0042] It is understood that the free space in this application embodiment can be determined by the first storage address and the second storage address. The free space refers to the storage space between the default record data and the formal record data that has not yet been written. Since data writing usually has a certain operation space, the present application embodiment can determine whether the storage space conflicts by comparing the free space with the safe space threshold, which can ensure the complete recording of the formal record data.
[0043] In this embodiment of the application, before determining the conflict of storage space based on the first storage address and the second storage address, the method further includes: obtaining the minimum operating space within the storage space; setting a safe space threshold according to the minimum operating space, wherein the safe space threshold is greater than the minimum operating space.
[0044] Understandably, since data writing typically involves a certain amount of operating space, a safety space threshold greater than the minimum operating space can effectively prevent the accidental deletion of formal record data. For example, if the minimum operating space is 100, and the safety space threshold is set to 50, it is easy to accidentally delete formal record data. However, if the safety space threshold is set to 200, because at least one erase block boundary is maintained between data in different safety domains, the accidental deletion of formal record data is avoided. This ensures that formal record data is not affected when the default record data needs to be erased, while also ensuring data security in extreme situations (such as power outages).
[0045] According to the data recording method for embedded devices proposed in this application, the data acquisition function of the embedded device is started from the moment the embedded device is powered on. The first recorded data is the default recorded data, and the second recorded data is the formal recorded data. That is, the function of automatically starting the default recorded data is started after power-on. When the user's data recording intention is recognized, the default recorded data is stopped and the formal recorded data is started. In the same storage space, the default recorded data and the formal recorded data are written from different directions in the storage space. Thus, by writing data bidirectionally in the same storage space, the default recorded data can still be saved under the limited storage resources of the embedded device, especially when the formal recorded data is not enough, and an independent data report can be generated, providing as much data as possible. At the same time, the embedded device can also provide enough recorded data in abnormal situations such as no operation to start recording or accidental operation to stop recording, avoiding the omission of key monitoring data. In this way, by providing users with sufficient recorded data, richer data reports can be generated, achieving rich data recording under limited storage resources.
[0046] Next, the data recording apparatus for an embedded device according to an embodiment of this application is described with reference to the accompanying drawings.
[0047] Figure 2 This is a block diagram of the data recording device of the embedded device according to an embodiment of this application.
[0048] like Figure 2 As shown, the data recording device 10 of the embedded device includes: a default recording module 100, a formal recording module 200, and a generation module 300.
[0049] The default recording module 100 is used to start the data acquisition function of the embedded device from the moment the embedded device is powered on. When the user's data recording intention is not recognized or the user's intention to stop recording is recognized, the first recorded data of the embedded device is written to the storage space of the embedded device in a first writing direction. The formal recording module 200 is used to stop writing the first recorded data if the user's data recording intention is recognized, and respond to the data recording intention by writing the second recorded data of the embedded device to the storage space of the embedded device in a second writing direction. The first writing direction and the second writing direction are different from the writing direction in the storage space. The generation module 300 is used to generate a data report based on the first recorded data and / or the second recorded data.
[0050] It should be noted that the foregoing explanation of the data recording method embodiment for embedded devices also applies to the data recording device of the embedded device in this embodiment, and will not be repeated here.
[0051] According to the data recording device for an embedded device proposed in the embodiments of this application, the data acquisition function of the embedded device is started from the moment the embedded device is powered on. The first recorded data is the default recorded data, and the second recorded data is the formal recorded data. That is, the function of automatically starting the default recorded data after power-on is activated. When the user's data recording intention is detected, the default recorded data is stopped and the formal recorded data is started. In the same storage space, the default recorded data and the formal recorded data are written from different directions in the storage space. Thus, by writing data bidirectionally in the same storage space, the default recorded data can still be saved under the limited storage resources of the embedded device, especially when the formal recorded data is not enough, and an independent data report can be generated, providing as much data as possible. At the same time, the embedded device can also provide enough recorded data in abnormal situations such as no operation to start recording or accidental operation to stop recording, avoiding the omission of key monitoring data. In this way, by providing users with sufficient recorded data, richer data reports can be generated, achieving rich data recording under the condition of limited storage resources.
[0052] Figure 3 A schematic diagram of the structure of an embedded device provided in an embodiment of this application. The embedded device may include: The memory 301, the processor 302, and the computer program stored on the memory 301 and capable of running on the processor 302.
[0053] When the processor 302 executes the program, it implements the data recording method for the embedded device provided in the above embodiments.
[0054] Furthermore, embedded devices also include: Communication interface 303 is used for communication between memory 301 and processor 302.
[0055] The memory 301 is used to store computer programs that can run on the processor 302.
[0056] The memory 301 may include high-speed RAM (Random Access Memory) memory, and may also include non-volatile memory, such as at least one disk storage.
[0057] If the memory 301, processor 302, and communication interface 303 are implemented independently, then the communication interface 303, memory 301, and processor 302 can be interconnected via a bus to complete communication between them. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0058] Optionally, in a specific implementation, if the memory 301, processor 302, and communication interface 303 are integrated on a single chip, then the memory 301, processor 302, and communication interface 303 can communicate with each other through an internal interface.
[0059] Processor 302 may be a CPU (Central Processing Unit), an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of this application.
[0060] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described data recording method for an embedded device.
[0061] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement the data recording method of the embedded device described above.
[0062] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0063] Furthermore, 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 number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0064] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0065] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (FPGAs), field-programmable gate arrays (FPGAs), etc.
[0066] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
Claims
1. A data recording method for an embedded device, characterized in that, Includes the following steps: From the moment the embedded device is powered on, the data acquisition function of the embedded device is started. When the user's intention to record data is not recognized or the user's intention to stop recording is recognized, the first recorded data of the embedded device is written into the storage space of the embedded device in the first writing direction. If the user's data recording intention is detected, the writing of the first recorded data is stopped. In response to the data recording intention, the second recorded data collected by the embedded device is written into the storage space of the embedded device in the second writing direction. The first writing direction and the second writing direction are different from the writing direction in the storage space. The address area of the storage space includes a start address and a tail address. The first writing direction starts writing from one of the start address and the tail address, and the second writing direction starts writing from the other of the start address and the tail address. A data report is generated based on the first recorded data and / or the second recorded data.
2. The data recording method for an embedded device according to claim 1, characterized in that, After the second recorded data of the embedded device is collected and written into the storage space of the embedded device in the second writing direction, the process includes: Obtain the storage address of the second record data in the storage space at the current moment; If the storage space of the second record data in the storage space at the current moment conflicts with the storage space of the first record data in the storage space, then the first record data is deleted.
3. The data recording method for an embedded device according to claim 2, characterized in that, If the storage space of the second record data in the storage space at the current moment conflicts with the storage space of the first record data in the storage space, it includes: Obtain the first storage address of the first record data in the storage space at the stop time; Obtain the second storage address of the second record data in the storage space at the current moment; Based on the first storage address and the second storage address, a conflict in storage space between the first record data and the second record data is determined.
4. The data recording method for an embedded device according to claim 3, characterized in that, The step of determining the storage space conflict between the first record data and the second record data based on the first storage address and the second storage address includes: Calculate the free space between the first storage address and the second storage address; If the free space is less than the safe space threshold, then a conflict in storage space between the first recorded data and the second recorded data is determined.
5. The data recording method for an embedded device according to claim 4, characterized in that, Before determining the conflict of the storage space based on the first storage address and the second storage address, the method further includes: Obtain the minimum operating space within the storage space; The safety space threshold is set according to the minimum operating space, wherein the safety space threshold is greater than the minimum operating space.
6. A data recording device for an embedded device, characterized in that, include: The default recording module is used to start the data acquisition function of the embedded device from the moment the embedded device is powered on. When the user's data recording intention is not recognized or the user's intention to stop recording is recognized, the first recorded data of the embedded device is written to the storage space of the embedded device in the first writing direction. The formal recording module is used to stop writing the first recorded data if it detects the user's data recording intention, and respond to the data recording intention by writing the collected second recorded data of the embedded device into the storage space of the embedded device in a second writing direction. The first writing direction and the second writing direction are different from the writing direction in the storage space. The address area of the storage space includes a start address and a tail address. The first writing direction starts writing from one of the start address and the tail address, and the second writing direction starts writing from the other of the start address and the tail address. A generation module is used to generate a data report based on the first recorded data and / or the second recorded data.
7. An embedded device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the data recording method of the embedded device according to any one of claims 1-5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the data logging method of the embedded device according to any one of claims 1-5.
9. A computer program product having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed, they implement the data recording method of the embedded device according to any one of claims 1-5.