Data recording method and device, equipment and medium

Through the multi-core processor in the data recording device, the method of sending messages to the first core and storing data to the first core is solved by solving the data recording complexity problem caused by the embedded operating system, and achieving more efficient data acquisition and Storage reduces system complexity.

CN118939594APending Publication Date: 2024-11-12TIANJIN JINHANG COMP TECH RES INST
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411062572.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-05
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

Existing data recording devices rely on embedded operating systems, resulting in long startup time, inability to record data effectively in the initial stage, and usually require multiple processors, resulting in complex systems and inconvenience to users.

Method used

Using a multi-core processor, sends a message to the first core through the second core, instructs it to start running, and collects data to store it in the preset period to avoid the first core from accessing the uninitialized shared area, and uses a multi-core processor to reduce the initialization. The phenomenon that data cannot be recorded in stages can maintain the real-time data collection and reduce system complexity.

Benefits of technology

It effectively reduces the complexity of the data recording system, avoids the use of embedded operating systems, improves the data recording efficiency in the initial stage, maintains real-time data collection, and facilitates user operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939594A_ABST
    Figure CN118939594A_ABST
Patent Text Reader

Abstract

The invention provides a data recording method and device, equipment and a medium, and relates to the technical field of data recording, and the method comprises the steps that a second core sends a first message to a first core so as to prompt the first core to start running, after the first core receives the first message, data collection is carried out in a preset period, and the collected data is stored in a sharing area, and the second core queries whether second information sent by the external equipment is received or not, if a second message used for indicating the second core to download the data in the first storage space to the second storage space is not received, the data in the sharing area is stored in the cache area, and then the data in the cache area is stored in the first storage space. And if the second message is received, storing the data in the first storage space into the second storage space. The method can reduce the complexity of a data recording system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data recording technology, and in particular to a data recording method, device, equipment and medium. Background Art

[0002] In the fields of aerospace, industrial control, etc., a lot of equipment is used. These devices need daily maintenance and troubleshooting. Daily maintenance and troubleshooting are based on a large amount of data. There are many types of data. Data recording devices are used to collect and record these data. The reliability and stability of data recording are crucial.

[0003] Most of the existing data recording devices rely on embedded operating systems. Since the embedded operating system takes a long time to start up, a lot of data cannot be effectively recorded in the initial stage. Existing data recording devices often need to use multiple processors to complete data collection and data recording. Therefore, in actual operation, the existing data recording system is very complicated, which brings inconvenience to users. Summary of the invention

[0004] The purpose of this application is to provide a data recording method, device, equipment and medium to reduce the complexity of the data recording system in order to solve the above problems.

[0005] In a first aspect, the present application provides a data recording method, the method comprising:

[0006] The second core sends a first message to the first core, where the first message is used to instruct the first core to start running;

[0007] After receiving the first message, the first core collects data at a preset period and stores the data in a shared area;

[0008] The second core queries whether the second information sent by the external device is received to obtain the first query result;

[0009] If the first query result indicates that the second core has not received the second message, the second core queries whether there is data in the shared area to obtain a second query result;

[0010] If the second query result indicates that there is data in the shared area, the second core stores the data in the shared area in the cache area, and stores the data in the cache area in the first storage space;

[0011] If the first query result indicates that the second core receives the second message, the second core downloads the data in the first storage space to the second storage space, and the second message is used to instruct the second core to download the data in the first storage space to the second storage space.

[0012] In some possible implementations, the shared area includes at least a message queue, and storing the data in the shared area includes:

[0013] The first core stores the data in a message queue, the first core and the second core share the message queue, a tail pointer and a head pointer are stored in the message queue, the head pointer indicates the starting position of the data in the message queue, and the tail pointer indicates the ending position of the data in the message queue.

[0014] In some possible implementations, the second core queries whether there is data in the shared area to obtain a second query result, including:

[0015] If the tail pointer and the head pointer in the message queue point to the same position, a second query result is obtained that there is no data in the shared area;

[0016] If the tail pointer and the head pointer in the message queue do not point to the same position, a second query result is obtained that there is data in the shared area.

[0017] In some possible implementations, storing the data in the shared area into a cache area includes:

[0018] The second core stores the data between the tail pointer and the head pointer in a cache area.

[0019] In some possible implementations, the data includes bus data, analog data and discrete data, the bus data is data transmitted by a bus, the analog data is data transmitted by an analog signal, and the discrete data is data transmitted by a discrete signal.

[0020] In a second aspect, the present application provides a data recording device, the device comprising: a first core and a second core;

[0021] The second core is used to send a first message to the first core, where the first message is used to instruct the first core to start running;

[0022] The first core is configured to collect data at a preset period and store the data in a shared area after receiving the first message;

[0023] The second core is used to query whether the second information sent by the external device is received to obtain a first query result; if the first query result indicates that the second core has not received the second message, query whether there is data in the shared area to obtain a second query result; if the second query result indicates that there is data in the shared area, store the data in the shared area in the cache area, and store the data in the cache area in the first storage space; if the first query result indicates that the second core has received the second message, download the data in the first storage space to the second storage space, and the second message is used to instruct the second core to download the data in the first storage space to the second storage space.

[0024] In some possible implementations, the shared area includes at least a message queue, and the first core is specifically used to store the data in the message queue. The first core and the second core share the message queue, and a tail pointer and a head pointer are stored on the message queue. The head pointer indicates the starting position of the data in the message queue, and the tail pointer indicates the ending position of the data in the message queue.

[0025] In some possible implementations, the second core is specifically used to obtain a second query result that there is no data in the shared area if the tail pointer and the head pointer in the message queue point to the same position; and to obtain a second query result that there is data in the shared area if the tail pointer and the head pointer in the message queue do not point to the same position.

[0026] In some possible implementations, the second core is specifically configured to store the data between the tail pointer and the head pointer into a cache area.

[0027] In some possible implementations, the data includes bus data, analog data and discrete data, the bus data is data transmitted by a bus, the analog data is data transmitted by an analog signal, and the discrete data is data transmitted by a discrete signal.

[0028] In a third aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described above when executing the computer program.

[0029] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the method described above when executed by a processor.

[0030] Compared with the prior art, the beneficial effects of the present application are as follows: in the present application, multiple cores of a multi-core processor respectively complete data collection and recording, and a shared area is set between the multiple cores. Specifically, the second core sends a first message to the first core to prompt the first core to start running. After receiving the first message, the first core collects data at a preset period and stores the collected data in the shared area. After receiving the first message, if the second core does not receive a second message for instructing the second core to download the data in the first storage space to the second storage space, the data in the shared area is stored in the cache area, and then the data in the cache area is stored in the first storage space. If the second message is received, the data in the first storage space is stored in the second storage space. On the one hand, since the first core has been in a waiting state before receiving the first message, the time for initializing the shared area is reserved for the second core, avoiding the first core from accessing the uninitialized shared area. On the other hand, the use of a multi-core processor avoids the use of an embedded operating system and reduces the phenomenon that data cannot be effectively recorded in the initial stage. In addition, the first core completes periodic data collection, and the second core completes data storage, which not only maintains the real-time nature of data collection, but also avoids the use of multiple processors, reduces the complexity of the data recording system, and facilitates user operation.

[0031] It should be understood that the description of technical features, technical solutions, beneficial effects or similar language in this application does not imply that all features and advantages can be realized in any single embodiment. On the contrary, it is understood that the description of features or beneficial effects means that specific technical features, technical solutions or beneficial effects are included in at least one embodiment. Therefore, the description of technical features, technical solutions or beneficial effects in this specification does not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions and beneficial effects described in the present embodiment can also be combined in any appropriate manner. Those skilled in the art will understand that the embodiment can be realized without one or more specific technical features, technical solutions or beneficial effects of a specific embodiment. In other embodiments, additional technical features and beneficial effects can also be identified in a specific embodiment that does not embody all embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solution in this embodiment, the drawings required for use in the description of the embodiment will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0033] Figure 1 A flowchart of a data recording method provided in an embodiment of the present application;

[0034] Figure 2A schematic diagram of the architecture of a multi-core processor provided in an embodiment of the present application;

[0035] Figure 3 A schematic diagram of the structure of a message queue provided in an embodiment of the present application;

[0036] Figure 4 A flowchart of another data recording method provided in an embodiment of the present application;

[0037] Figure 5 A schematic diagram of a data recording device provided in an embodiment of the present application;

[0038] Figure 6 A schematic diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] In order to enable those skilled in the art to better understand the technical solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings. The description in this section is only exemplary and explanatory and should not have any limiting effect on the protection scope of the present application. Specifically, the described embodiments are only embodiments of a part of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present application.

[0040] It should be noted that similar reference numerals and letters represent similar items in the following figures, so once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0041] In the aerospace field, a variety of equipment is used. In daily maintenance, a variety of data is needed to ensure safe and efficient operation of the equipment. These equipment need daily maintenance and troubleshooting, which are based on a large amount of data. Therefore, data recording devices are necessary, and the reliability and stability of data recording are also crucial.

[0042] Since data collection is real-time and data recording takes a certain amount of time, existing data recording devices rely on embedded operating systems. Since the embedded operating system takes a long time to start up, a lot of data cannot be effectively recorded in the initial stage. Most embedded operating systems, such as Tianmai and VxWorks, require high licensing fees. In addition, existing data recording devices often require multiple processors to complete data collection and recording. The system is complex, which brings many inconveniences to users.

[0043] In view of this, an embodiment of the present application provides a data recording method, in which multiple cores of a multi-core processor respectively complete data collection and recording, and a shared area is set between the multiple cores. Specifically, the second core sends a first message to the first core to prompt the first core to start running. After receiving the first message, the first core performs data collection at a preset period and stores the collected data in the shared area. After receiving the first message, if the second core does not receive a second message for instructing the second core to download the data in the first storage space to the second storage space, the data in the shared area is stored in the cache area, and then the data in the cache area is stored in the first storage space. If the second message is received, the data in the first storage space is stored in the second storage space. On the one hand, since the first core has been in a waiting state before receiving the first message, the time for initializing the shared area is reserved for the second core, avoiding the first core from accessing the uninitialized shared area. On the other hand, the use of a multi-core processor avoids the use of an embedded operating system and reduces the phenomenon that data cannot be effectively recorded in the initial stage. The first core completes periodic data collection and the second core completes data storage, which not only maintains the real-time nature of data collection, but also avoids the use of multiple processors, reduces the complexity of the data recording system, and facilitates user operation.

[0044] In order to make the technical solution of the present application clearer and easier to understand, a data recording method provided in an embodiment of the present application is introduced below.

[0045] like Figure 1 As shown, the figure is a flow chart of a data recording method provided in an embodiment of the present application, the method comprising the following steps:

[0046] S101. The second core sends a first message to the first core.

[0047] The first core and the second core are two cores of a multi-core processor. The embodiment of the present application takes a multi-core processor of model JFMQL15T485 as an example. In actual operation, a suitable multi-core processor can be selected as needed.

[0048] JFMQL15T485 is a fully programmable system-on-chip (PSoC) launched by Fudan Microelectronics. Figure 2 A schematic diagram of the architecture of a multi-core processor provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the JFMQL15T485 multi-core processor 200 includes a processing system 201, a programmable logic system 202, an on-chip memory 203, a non-volatile internal memory 204, a double data rate synchronous dynamic random access memory 205 (Double Data Rate Synchronous Dynamic Random Access Memory, DDR SDRAM), an embedded MultiMediaCard 206 (embedded MultiMediaCard, eMMC), a HI-6131 1553B protocol chip 207, an acquisition module 208, a first internal bus 209a, a second internal bus 209b, an embedded MultiMediaCard interface 210 (embedded Multimedia Card, eMMC), a serial peripheral interface bus 211 (Serial Peripheral Interface, spi), a local bus 212 (LOCAL BUS) and a network interface 213.

[0049] Among them, the processing system 201 and the programmable logic system 202 are the core parts of the chip. The processing system 201 has four built-in high-performance CPU cores, including a first core 2011, a second core 2012, a third core 2013, and a fourth core 2014. The first core 2011, the second core 2012, the third core 2013, and the fourth core 2014 are the cores of the processing system 201 and are responsible for executing program codes, processing data and algorithms. The first core 2011, the second core 2012, the third core 2013, and the fourth core 2014 can run no more than four applications at the same time. The first core 2011, the second core 2012, the third core 2013, and the fourth core 2014 share external hardware device resources. The embodiment of the present application only uses the first core 2011 and the second core 2012. The programmable logic system 202 provides a high degree of flexibility and configurability, allowing users to program through hardware description languages ​​according to specific application requirements to implement customized hardware logic functions. The processing system 201 performs efficient data exchange and collaborative work with the programmable logic system 202. The processing system 201 is connected to a computer 215 via a network interface 213, and the computer 215 includes a local storage space 214.

[0050] The present application runs on two cores of a multi-core processor, the first core is used for data acquisition, and exchanges information with the HI-6131 1553B protocol chip 207 through the serial peripheral interface 211. Specifically, the HI-6131 1553B protocol chip 207 is configured as a monitoring terminal (Monitor Terminal, MT), collects bus data, and interacts with the acquisition module 208 through the local bus 212 to complete the acquisition of discrete data and analog data. The first core 2011 transfers the collected bus data, discrete data and analog data to the double-rate synchronous dynamic random access memory 205, and the second core 2012 is used to store the collected data, and interacts with the non-volatile storage medium through the embedded multimedia card interface 210 to complete the data writing. The embodiment of the present application adopts the embedded multimedia card 206 as the non-volatile storage medium. In actual operation, a suitable non-volatile storage medium can be selected as needed. In some examples, the external device may generate a second message, the acquisition module 208 may acquire the second message generated by the external device, and then transmit it to the processing system 201, and then the second core 2012 may query the second message.

[0051] In addition, the non-volatile internal memory 204 is used to store program codes. The non-volatile internal memory 204 interacts with the JFMQL15T485 multi-core processor 200 through the second internal bus 209b, and the double-rate synchronous dynamic random access memory 205 interacts with the JFMQL15T485 multi-core processor 200 through the first internal bus 209a.

[0052] In some embodiments, data includes at least bus data, analog data and discrete data. Bus data is data transmitted by a bus, for example, data transmitted by a command / response data bus. Analog data is data transmitted by analog signals, usually data acquired by sensors, for example, data acquired by voltage sensors, current sensors, and temperature sensors. Discrete data is data transmitted by discrete signals, usually a set of discrete state data, for example, 28V / open, ground / open, high voltage signals, etc. In actual operation, other types of data may also be included.

[0053] The first message is used to instruct the first core to start running, with the purpose of achieving synchronization between the first core and the second core. The embodiment of the present application uses soft interrupts to perform inter-core communication.

[0054] In some embodiments, before sending the first message, the second core first performs hardware initialization to facilitate subsequent operations. The hardware initialization of the first core includes initialization of the serial peripheral interface and the local bus, etc. In actual operation, the hardware initialization of the second core can be performed as needed.

[0055] S102: After receiving the first message, the first core collects data at a preset period and stores the data in a shared area.

[0056] The shared area refers to an internal storage area of ​​the computer that can be shared by the first core and the second core. The embodiment of the present application uses a double-rate synchronous dynamic random access memory to achieve high-speed access to data between the first core and the second core.

[0057] In order to ensure the real-time nature of data collection, periodic data collection is required and the collected data is stored in a shared area.

[0058] S103. The second core queries whether the second information sent by the external device is received, and obtains the first query result.

[0059] The second message is used to instruct the second core to download the data in the first storage space to the second storage space, the first storage space refers to the external storage space, and the second storage space refers to the local storage space of the computer.

[0060] The first core is in a waiting state before receiving a first message from the second core indicating that the first core can start running. After receiving the first message indicating that the first core starts running, the first core queries whether the second message is received to obtain a first query result. The purpose is to avoid resource conflicts caused by the operations of storing data in the shared area to the first storage space and downloading data in the first storage space to the second storage space at the same time. The embodiment of the present application performs data transmission and downloading through the File Transfer Protocol (FTP), and users can select the data to be downloaded according to their needs.

[0061] S104. If the first query result indicates that the second core has not received the second message, the second core queries whether there is data in the shared area to obtain a second query result.

[0062] If the second message for instructing the second core to download the data in the first storage space to the second storage space is not received, it is queried whether there is any collected data in the shared area, so as to store the data in the shared area to the first storage space.

[0063] S105. If the second query result indicates that there is data in the shared area, the second core stores the data in the shared area into the cache area, and stores the data in the cache area into the first storage space.

[0064] The first storage space is an external storage space. Specifically, the first storage space uses a non-volatile storage medium. When there is data in the shared area, the data in the shared area is stored in the cache area, and then the data in the cache area is stored in the non-volatile storage medium so that the data can be used for equipment fault analysis, etc. The purpose of introducing the cache area is to reduce frequent access to the storage area to improve data transmission performance.

[0065] For example, the embedded multimedia card 206 may be used as a non-volatile storage medium to store the collected data.

[0066] S106: If the first query result indicates that the second core has received the second message, the second core downloads the data in the first storage space to the second storage space.

[0067] If the second core receives a second message for instructing the second core to download the data in the external storage space to the local storage space, the second core downloads the data in the external storage space to the local storage space for use in troubleshooting of the device, etc.

[0068] In some embodiments, the second core needs to perform hardware initialization before querying whether the second information is received in order to perform subsequent data storage operations, such as initialization of the shared area, initialization of the embedded multimedia card 206, network-related initialization, and mounting initialization of the embedded multimedia card file system.

[0069] In some embodiments, the shared area includes at least a message queue, the first core stores data in the message queue, the first core and the second core share the message queue, and the message queue stores a tail pointer and a head pointer, the head pointer indicates the starting position of the data in the message queue, and the tail pointer indicates the ending position of the data in the message queue.

[0070] In some embodiments, if the tail pointer and the head pointer in the message queue point to the same position, there is data in the shared area; if the tail pointer and the head pointer in the message queue do not point to the same position, there is no data in the shared area.

[0071] In some embodiments, the second core stores data between the tail pointer and the head pointer in the first storage space.

[0072] Specifically, the embodiment of the present application adopts a 1GB DDR SDRAM, and opens a 512MB+1MB-512MB+100MB message queue in the free area of ​​the DDR SDRAM as a shared area for the first core and the second core. Figure 3 A schematic diagram of the structure of a message queue provided in an embodiment of the present application, such as Figure 3As shown, the tail pointer and head pointer of the message queue can be stored in the space of 512MB-512MB+1MB, wherein the head pointer points to the starting position of the data, and the tail pointer points to the ending position of the data. In order to avoid storage overflow, the embodiment of the present application adopts a circular message queue, that is, the tail pointer and the head pointer move cyclically in the message queue. When the first core collects the data, the collected data is stored in the message queue, and the tail pointer is moved at the same time. After the second core confirms that there is no task to store the data in the embedded multimedia card into the local storage space, it queries that the tail pointer and the head pointer of the message queue do not point to the same position, and then takes out the data between the tail pointer and the head pointer, stores it in the cache area, and points the head pointer to the tail pointer, and then stores the data in the cache area into the embedded multimedia card. If the second core receives the task to store the data in the embedded multimedia card into the local storage space, it executes the task to store the data in the embedded multimedia card into the local storage space.

[0073] In order to make the technical solution of the present application clearer and easier to understand, the complete embodiment provided by the embodiment of the present application is introduced below in conjunction with the accompanying drawings. Figure 4 A flowchart of another data recording method provided in an embodiment of the present application.

[0074] S201, the second core performs hardware initialization.

[0075] S202: The second core sends a first message to the first core.

[0076] S203: Whether the first core receives the first message.

[0077] If the first core receives the first message, step S204 is executed; if the first core does not receive the first message, the waiting continues.

[0078] S204: The first core performs hardware initialization.

[0079] S205: Whether the time interval from the last data collection of the first core is more than 10 ms.

[0080] If the time interval from the last data collection of the first core is 10 ms, step S206 is executed; if the time interval from the last data collection of the first core is less than 10 ms, the waiting continues.

[0081] S206: The first core collects data and stores the data in a message queue.

[0082] S207: The first core updates the direction of the tail pointer of the message queue.

[0083] S208: Whether the second core receives the second message.

[0084] If the second core receives the second message, step S211 is executed; if the second core does not receive the second message, step S209 is executed.

[0085] S209: The second core finds out that the tail pointer and the head pointer of the message queue do not point to the same position.

[0086] S210: The second core stores the data between the tail pointer and the head pointer in the message queue into a cache area.

[0087] S211. The second core stores the data in the cache area into the first storage space.

[0088] S212: The second core downloads the data in the first storage space to the second storage space.

[0089] Among them, step 201-step 202 is executed by the second core, step S203-step S207 is executed by the first core to complete periodic data collection, and step S208-step S211 is executed to complete data recording. The specific execution process has been described in detail in the above embodiment, and for the sake of brevity, it will not be repeated here.

[0090] Combination of the above Figure 1 , Figure 2 , Figure 3 and Figure 4 The data recording method provided in the embodiment of the present application is introduced in detail. The data recording device, electronic device and computer-readable storage medium provided in the embodiment of the present application will be introduced in conjunction with the accompanying drawings.

[0091] like Figure 5 As shown, the figure is a schematic diagram of a data recording device provided by an embodiment of the present application, the device comprising: a first core 501 and a second core 502;

[0092] The second core 502 is used to send a first message to the first core 501, where the first message is used to instruct the first core 501 to start running;

[0093] The first core 501 is configured to collect data at a preset period and store the data in a shared area after receiving the first message;

[0094] The second core 502 is used to query whether the second information sent by the external device is received to obtain a first query result; if the first query result indicates that the second core 502 has not received the second message, it queries whether there is data in the shared area to obtain a second query result; if the second query result indicates that there is data in the shared area, the data in the shared area is stored in the cache area, and the data in the cache area is stored in the first storage space; if the first query result indicates that the second core 502 has received the second message, the data in the first storage space is downloaded to the second storage space, and the second message is used to instruct the second core 502 to download the data in the first storage space to the second storage space.

[0095] In some embodiments, the shared area includes at least a message queue, and the first core 501 is specifically used to store the data in the message queue. The first core 501 and the second core 502 share the message queue. The message queue stores a tail pointer and a head pointer. The head pointer indicates the starting position of the data in the message queue, and the tail pointer indicates the ending position of the data in the message queue.

[0096] In some embodiments, the second core 502 is specifically used to obtain a second query result that there is no data in the shared area if the tail pointer and the head pointer in the message queue point to the same position; if the tail pointer and the head pointer in the message queue do not point to the same position, obtain a second query result that there is data in the shared area.

[0097] In some embodiments, the second core 502 is specifically configured to store the data between the tail pointer and the head pointer into a cache area.

[0098] In some embodiments, the data includes bus data, analog data and discrete data, the bus data is data transmitted by a bus, the analog data is data transmitted by analog signals, and the discrete data is data transmitted by discrete signals.

[0099] The data recording device provided in the embodiment of the present application may correspond to executing the data recording method described in the embodiment of the present application, and the above functions of each module of the device correspond to implementing Figure 1 For the sake of brevity, the corresponding process of the method shown will not be repeated here.

[0100] like Figure 6 As shown, this figure is a schematic diagram of a computing device provided in an embodiment of the present application, such as Figure 6As shown, computing device 400 includes bus 701, processor 702, communication interface 703 and memory 704. Processor 702, memory 704 and communication interface 703 communicate with each other via bus 701.

[0101] The bus 701 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0102] The processor 702 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0103] The communication interface 703 is used for communicating with the outside.

[0104] The memory 704 may include a volatile memory, such as a random access memory (RAM). The memory 704 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0105] The memory 704 stores executable codes, and the processor 702 executes the executable codes to perform the aforementioned data recording method.

[0106] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned data recording method.

[0107] The embodiment of the present application further provides a computer program product, which includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part.

[0108] The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer or data center to another website, computer or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0109] When the computer program product is executed by a computer, the computer executes any of the aforementioned data recording methods. The computer program product may be a software installation package, and when any of the aforementioned data recording methods is required, the computer program product may be downloaded and executed on the computer.

[0110] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.

[0111] The above description is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application.

Claims

1. A data recording method, characterized in that: The method comprises: The second core sends a first message to the first core, where the first message is used to instruct the first core to start running; After receiving the first message, the first core collects data at a preset period and stores the data in a shared area; The second core queries whether the second information sent by the external device is received to obtain the first query result; If the first query result indicates that the second core has not received the second message, the second core queries whether there is data in the shared area to obtain a second query result; If the second query result indicates that there is data in the shared area, the second core stores the data in the shared area in the cache area, and stores the data in the cache area in the first storage space; If the first query result indicates that the second core receives the second message, the second core downloads the data in the first storage space to the second storage space, and the second message is used to instruct the second core to download the data in the first storage space to the second storage space.

2. The method according to claim 1, characterized in that The shared area at least includes a message queue, and storing the data in the shared area includes: The first core stores the data in a message queue, the first core and the second core share the message queue, a tail pointer and a head pointer are stored in the message queue, the head pointer indicates the starting position of the data in the message queue, and the tail pointer indicates the ending position of the data in the message queue.

3. The method according to claim 2, characterized in that The second core queries whether there is data in the shared area, and obtains a second query result, including: If the tail pointer and the head pointer in the message queue point to the same position, a second query result is obtained that there is no data in the shared area; If the tail pointer and the head pointer in the message queue do not point to the same position, a second query result is obtained that there is data in the shared area.

4. The method according to claim 2, characterized in that: The storing the data in the shared area into the cache area comprises: The second core stores the data between the tail pointer and the head pointer in a cache area.

5. The method according to claim 1, characterized in that The data includes bus data, analog data and discrete data. The bus data is data transmitted by a bus, the analog data is data transmitted by analog signals, and the discrete data is data transmitted by discrete signals.

6. A data recording device, characterized in that: The device comprises: a first core and a second core; The second core is used to send a first message to the first core, where the first message is used to instruct the first core to start running; The first core is configured to collect data at a preset period and store the data in a shared area after receiving the first message; The second core is used to query whether the second information sent by the external device is received to obtain a first query result; if the first query result indicates that the second core has not received the second message, query whether there is data in the shared area to obtain a second query result; if the second query result indicates that there is data in the shared area, store the data in the shared area in the cache area, and store the data in the cache area in the first storage space; if the first query result indicates that the second core has received the second message, download the data in the first storage space to the second storage space, and the second message is used to instruct the second core to download the data in the first storage space to the second storage space.

7. The device according to claim 6, characterized in that The shared area at least includes a message queue. The first core is specifically used to store the data in the message queue. The first core and the second core share the message queue. A tail pointer and a head pointer are stored on the message queue. The head pointer indicates the starting position of the data in the message queue, and the tail pointer indicates the ending position of the data in the message queue.

8. The device according to claim 7, characterized in that The second core is specifically used to obtain a second query result that there is no data in the shared area if the tail pointer and the head pointer in the message queue point to the same position, and to obtain a second query result that there is data in the shared area if the tail pointer and the head pointer in the message queue do not point to the same position.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Cited By

  • Data storage and sending method and device and Internet of Things system

    CN119629140A