Data reading and writing method and device, storage medium and electronic device
By using the power supply system of the transportation equipment to write data during the target driving state and performing synchronous operation during low-speed driving, the problem of abnormal power loss during data reading and writing of bus advertising machines is solved, reducing system complexity and cost and improving the reliability of data reading and writing.
Patent Information
- Application Number
- CN202211736558.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2042-12-30
AI Technical Summary
In existing technologies, the problem of abnormal power loss during data reading and writing of bus advertising machines increases the complexity of the power supply system. Existing solutions, such as introducing backup power supplies, increase additional overhead and system complexity.
By acquiring the status of the transportation equipment, a write command is sent to the data read/write system when the target driving state is reached. Data is written using the power supply system of the transportation equipment, and a synchronization operation is performed when the speed is low to avoid abnormal power outages.
Without adding power supply equipment, it effectively avoids abnormal power outages during data reading and writing, reduces system complexity and equipment costs, and improves the reliability of data reading and writing.
Smart Images

Figure CN116010304B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of communications, and in particular, to a data read-write method and device, a storage medium and an electronic device. BACKGROUND
[0002] With the rapid development of economy and the improvement of material living standards, more and more entertainment facilities and entertainment devices are widely used in life, greatly enriching people's lives. For example, playing multimedia information in vehicles, ships and other transportation equipment can greatly enrich people's travel life. The following will take a bus as an example for illustration:
[0003] As the main body of the business of enriching the entertainment and cultural life in the vehicle, the main function of the bus advertising machine is to receive multimedia data from the service end of the information publishing system, realize video or advertising playing, so that people can watch movies, news, etc. even on the journey.
[0004] In related technologies, the power supply of most bus advertising machines is provided by the power supply system of the bus, which is controlled by the key of the driver. Therefore, there is a common problem of abnormal power-off during data writing, which leads to abnormal data. To solve this problem, the existing technology uses a backup power supply to complete the power supply of the device. However, this method not only increases the cost, but also increases the complexity of the system in terms of the life and charging management of the backup power supply.
[0005] To solve the problem of abnormal power-off during data read-write process in related technologies, an effective solution has not been proposed. SUMMARY
[0006] Embodiments of the present application provide a data read-write method and device, a storage medium and an electronic device to at least solve the problem of additional increase in the complexity of the power supply system caused by the solution to abnormal power-off during data read-write process in related technologies.
[0007] According to an embodiment of the present application, a data read-write method is provided, comprising: obtaining the state of a transportation equipment; in a case where it is determined that the transportation equipment is in a target driving state, sending a write command to a write data module included in a data read-write system, wherein the data read-write system includes a buffer module for buffering downloaded data, the write command is used to instruct the write data module to read the downloaded target data from the buffer module and write the read target data into a target memory included in the data read-write system; wherein the data read-write system is powered by the power supply system of the transportation equipment.
[0008] In one example embodiment, after the control module controls the write data module to write the read target data into the target memory included in the data read-write system, the method further comprises: sending a stop write command to the write data module after determining that the transportation equipment is in a low-speed driving state from the target driving state, wherein the stop write command is used to instruct the write data module to perform a target synchronization operation to synchronize all the first data included in the target data into the target memory in a case that it is determined that the first data has not been written into the target memory; wherein the driving speed of the transportation equipment in the low-speed driving state is less than the driving speed in the target driving state.
[0009] In one example embodiment, the stop write command is further used to instruct the write data module to perform a target synchronization operation in a case that it is determined that the target data has been written into the target memory.
[0010] In one example embodiment, the target synchronization operation comprises a synchronization operation performed by calling a sync function.
[0011] In one example embodiment, before sending the write command to the write data module included in the data read-write system, the method further comprises: determining to download the target data according to information published on a target platform; and sending a download command to a download module included in the data read-write system, wherein the download command is used to instruct the download module to download the target data from the target platform into the buffer module.
[0012] According to another embodiment of the present application, a data read-write device is provided, comprising: an acquisition unit configured to acquire a state of a transportation equipment; and a first sending unit configured to send a write command to a write data module included in a data read-write system in a case that it is determined that the transportation equipment is in a target driving state, wherein the data read-write system includes a buffer module configured to buffer downloaded data, and the write command is used to instruct the write data module to read downloaded target data from the buffer module and write the read target data into a target memory included in the data read-write system; wherein the data read-write system is powered by a power supply system of the transportation equipment.
[0013] According to another embodiment of the present application, a data read-write system is further provided, comprising: a control module, wherein the control module comprises the above-mentioned data read-write device; the write data module, wherein the write data module is connected with the control module; the buffer module, wherein the buffer module is connected with the write data module; and the target memory, wherein the target memory is connected with the write data module.
[0014] In one example embodiment, the system further comprises a downloading module, wherein the downloading module is connected with the control module, and is configured to receive a downloading command sent by the control module, and download the target data from the target platform into the buffering module based on the downloading command; wherein the downloading command is sent by the control module in a case that the target data is determined to be downloaded according to the information published on the target platform.
[0015] In one example embodiment, the system further comprises a global positioning system (GPS) module, wherein the GPS module is located in the transportation device, and is connected with the control module, and the control module is configured to determine the state of the transportation device based on the information reported by the GPS module.
[0016] According to still another embodiment of the present application, a computer readable storage medium is further provided, and the computer readable storage medium stores a computer program, wherein the computer program is configured to execute the steps in any of the method embodiments when running.
[0017] According to still another embodiment of the present application, an electronic device is further provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to execute the steps in any of the method embodiments.
[0018] By the present application, by acquiring the state of the transportation device, and then sending a writing command to a writing data module included in a data reading and writing system in a case that the transportation device is determined to be in a target driving state, wherein the data reading and writing system comprises a buffering module for buffering downloaded data, the writing command is configured to instruct the writing data module to read the downloaded target data from the buffering module, and write the read target data into a target memory included in the data reading and writing system; wherein the data reading and writing system is powered by a power supply system of the transportation device. By the method in the present application, the writing data module can be controlled to read and write data based on the state of the transportation device without changing the power supply state, effectively avoiding the problem of abnormal power failure in the data reading and writing process, solving the problem that in the related art, other devices need to be additionally introduced to solve the problem of abnormal power failure in the data reading and writing process, thereby increasing the complexity of the power supply system, and achieving the effects of reducing the complexity of the system and the cost of the device, and improving the reliability of data reading and writing. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 is a hardware structure block diagram of a mobile terminal of a data reading and writing method according to an embodiment of the present application;
[0020] Figure 2 is a flowchart of a data reading and writing method according to an embodiment of the present application;
[0021] Figure 3 is a schematic diagram of an overall structure of a data read-write system according to an embodiment of the present application;
[0022] Figure 4 is a flowchart of download control according to an embodiment of the present application;
[0023] Figure 5 is a flowchart of download control according to an embodiment of the present application;
[0024] Figure 6 is a structural block diagram of a data read-write device according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] Hereinafter, embodiments of the present application will be described in detail with reference to the accompanying drawings and in conjunction with embodiments.
[0026] It should be noted that the terms "first", "second", and the like in the description of the present application and the claims and the above-described accompanying drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence.
[0027] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking the case of running on a mobile terminal, Figure 1 is a hardware structural block diagram of a mobile terminal of a data read-write method according to an embodiment of the present application. As shown in Figure 1 , the mobile terminal can include one or more (only one is shown in Figure 1 ) processors 102 (the processor 102 can include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned mobile terminal can further include a transmission device 106 for communication function and an input and output device 108. Those skilled in the art can understand that Figure 1 the structure shown is only schematic, which does not limit the structure of the above-mentioned mobile terminal. For example, the mobile terminal can further include more or less components than those shown in Figure 1 , or have a different configuration from that shown in Figure 1 .
[0028] The memory 104 can be used to store computer programs, such as software programs of application software and modules, such as a computer program corresponding to the data read-write method in the embodiments of the present application. The processor 102 can execute various functions and data processing, i.e., implement the above method, by running the computer programs stored in the memory 104. The memory 104 can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 104 can further include a memory remotely arranged with respect to the processor 102, which can be connected to the mobile terminal through a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0029] The transmission device 106 is used to receive or send data via a network. Specific examples of the above network can include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet in a wireless manner.
[0030] In the embodiments, a data read-write method is provided, Figure 2 The flowchart of the data read-write method according to the embodiments of the present application is shown in FIG. 1, which includes the following steps: Figure 2
[0031] In step S102, the state of the transportation equipment is acquired.
[0032] In step S104, in a case where it is determined that the transportation equipment is in a target driving state, a write command is sent to a write data module included in a data read-write system, wherein the data read-write system includes a buffer module for buffering downloaded data, the write command is used to instruct the write data module to read the downloaded target data from the buffer module and write the read target data into a target memory included in the data read-write system; and wherein the data read-write system is powered by a power supply system of the transportation equipment.
[0033] The above operations can be performed by a control device, or a control unit or a control module in the control device, or a processor with control capability, or other processing devices or processing units with similar processing capability, etc.
[0034] In the above embodiment, the state of the transportation device includes, but is not limited to, a normal driving state (i.e., a driving state exceeding a certain driving speed, for example, a speed exceeding 5 km / h, or a speed exceeding 10 km / h, etc.), a low-speed driving state (i.e., a driving state less than a certain driving speed, for example, a speed less than 5 km / h, or a speed less than 3 km / h, etc.), and the like, wherein the low-speed driving state can also include a stop driving state (i.e., a state with a driving speed of 0), and in this embodiment, the target driving state is generally a normal driving state, or the target driving state can be a transition state from a low-speed driving state to a normal driving state, or the target driving state can also include a transition state from a stop driving state to a low-speed driving state and then to a normal driving state. That is, the target driving state mentioned in this embodiment can be a fixed state, or can be a transition state. The present application does not limit this, as long as it is a state that can represent that the vehicle has no parking trend (in a state with a parking trend, the driver can turn off the engine after parking, so that the power supply system cannot continue to supply power to the data reading and writing system).
[0035] In addition, in order to avoid excessive memory occupation, in the process of writing target data into the target memory by the data writing module, the data stored in the buffer module that has been written into the target memory can be deleted, so as to free up more cache space to store subsequent downloaded data.
[0036] In the above embodiment, the data writing module and the buffer module can be multiple, and then the multiple data modules and the multiple buffer modules can be connected one by one to perform the data reading and writing process, so as to improve the efficiency of data reading and writing. In addition, the target memory can also be multiple, and then in the case that a certain target memory has no storage space, the data can be written into other target memory that still has storage space. Of course, the unimportant data included in the target memory that is full of space can also be deleted to release the space, so as to facilitate subsequent writing of target data. It should be noted that the above data writing module, the above buffer module, and the above target memory are only exemplary embodiments, and the data writing module, the buffer module, and the target memory are not limited to the above examples.
[0037] In the above embodiment, by acquiring the state of the transportation equipment, and then in the case where it is determined that the transportation equipment is in the target driving state, a write command is sent to a write data module included in the data read-write system, wherein the data read-write system includes a buffer module for buffering downloaded data, the write command is used to instruct the write data module to read the downloaded target data from the buffer module, and write the read target data into a target memory included in the data read-write system; wherein the data read-write system is powered by the power supply system of the transportation equipment. By using the method in the present application, the write data module can be controlled to read and write data based on the state of the transportation equipment without changing the power supply state, effectively avoiding the problem of abnormal power failure during data read-write process, solving the problem of additional introduction of other equipment to increase the complexity of the power supply system when solving the problem of abnormal power failure during data read-write process in related technology, and achieving the effects of reducing system complexity and equipment cost and improving data read-write reliability.
[0038] In one exemplary embodiment, after controlling the write data module to write the read target data into the target memory included in the data read-write system, the method further comprises: in the case where it is determined that the transportation equipment is transferred from the target driving state to a low-speed driving state, a stop write command is sent to the write data module, wherein the stop write command is used to instruct the write data module to perform a target synchronization operation to synchronize all the first data included in the target data to the target memory in the case where it is determined that the first data has not been written into the target memory. In this embodiment, in the case where it is determined that the transportation equipment is transferred from the normal driving state to the low-speed driving state (or the stop driving state), the control management module (i.e. the above-mentioned control module) can first determine whether the target data write operation of the write data module has stopped, and in the case where it is determined that the target data write operation of the write data module has not stopped, a stop write command is sent to the write data module, and the write data module will immediately stop performing the target data write operation after receiving the stop write command. Of course, in the case where it is determined that the target data write operation of the write data module has stopped, it means that the write data module has written all the contents to be stored into the target memory, and in this case, there is no need to send a stop write command to the write data module.
[0039] In the above embodiment, the speed measurement module can be used to determine the state of the transportation device. For example, when the transportation device is in a normal driving state, if the current speed of the transportation device obtained by the speed measurement module is less than a first predetermined speed threshold (e.g., 5 km / h, 5.5 km / h, 6 km / h, etc.), it is considered that the driving state of the transportation device has changed and enters a low-speed running state. Conversely, if the transportation device is in a low-speed driving state, when the current speed of the transportation device rises to a second predetermined speed threshold (e.g., 20 km / h, 21 km / h, 22 km / h, etc.), it is considered that the transportation device enters a normal driving state. It should be noted that the above first predetermined speed threshold and the above second predetermined speed threshold are only an example embodiment, and the first predetermined speed threshold and the second predetermined speed threshold are not limited to the above examples. In addition, the first predetermined speed threshold and the second predetermined speed threshold can be adjusted according to actual application.
[0040] In the above embodiment, when the write data module receives a stop writing command and the target data is not completely written into the target memory, the write data module feeds back the current target data writing state to the control management module. After receiving the feedback, the control management module records the target data writing state information. The target data writing state information is recorded to further ensure that the recorded target data has been written into the target memory.
[0041] In the above embodiment, the target data includes a plurality of first data. In the case where the plurality of first data needs to be written into the target memory, the plurality of first data can be written into the target memory in sequence, or the first data with higher priority or greater weight can be written into the target memory first, or the plurality of first data can be written into the target memory simultaneously. It should be noted that the above first data is only an example embodiment, and the first data is not limited to the above examples.
[0042] In one example embodiment, the stop writing command is also used to instruct the write data module to perform a target synchronization operation when it is determined that the target data has been completely written into the target memory. In this embodiment, when the write data module receives a stop writing command, the first data included in the target data has been written into the target memory, and the target synchronization operation can also be performed. The target synchronization operation is performed to ensure that the first data is completely written into the target memory, thereby further improving the reliability of data writing.
[0043] In one example embodiment, the target synchronization operation includes a synchronization operation performed by calling a sync function. In this embodiment, in addition to the synchronization operation performed by calling the sync function, a synchronization operation performed by calling a function having similar function to the sync function can also be called.
[0044] In one example embodiment, before sending a write command to a write data module included in the data read-write system, the method further includes: determining the target data to be downloaded according to the information published on the target platform; and sending a download command to a download module included in the data read-write system, wherein the download command is used to instruct the download module to download the target data from the target platform to the buffer module. In this embodiment, the target platform can be a publishing platform (i.e. information publishing platform), and of course can also be a platform having similar function to the publishing platform. The information published on the target platform can include multiple types of information, such as movie information, news information, advertisement information, etc. Therefore, the target data to be downloaded can include multiple types of target data, and the multiple types of target data can be downloaded simultaneously, or any target data included in the multiple types of target data can be downloaded randomly, or the target data with higher priority or greater weight can be downloaded preferentially according to the priority or weight of the multiple types of target data. It should be noted that the above examples of the target data are only example embodiments, and the target data is not limited to the above examples.
[0045] Obviously, the above described embodiments are only part of the embodiments of the present application, not all the embodiments.
[0046] The present application will be described in detail below with reference to specific embodiments:
[0047] In the specific embodiments of the present application, a data read-write system is also provided, Figure 3 is a schematic diagram of the overall structure of a data read-write system according to the specific embodiments of the present application, as Figure 3 shown, mainly includes a write data module, a data download module, a control management module (corresponding to the above control module), a speed measurement module, a data buffer unit (corresponding to the above buffer module), and the like.
[0048] 1. Data download module
[0049] Receives the download data command executed by the control management module, and downloads the media data from the publishing platform (corresponding to the above target platform) to the data buffer area.
[0050] 2. Control management module
[0051] 1) The control management module determines the resource to be downloaded according to the published information on the publishing platform, and controls the data download module to download.
[0052] 2) By obtaining the speed data of the speed measurement module, it is determined whether the vehicle is in normal driving state, if the driving state changes (i.e. the driving state changes to normal driving state), a control command is sent to the data writing module to perform data writing control.
[0053] 3) By obtaining the file writing state information fed back by the writing module unit, the file writing state is recorded, and it is controlled whether the data downloading module starts downloading the next file.
[0054] 3、Writing data module
[0055] 1) The writing data module is responsible for reading data from the buffer zone (corresponding to the above-mentioned buffer module) and writing data to the storage unit (corresponding to the above-mentioned target memory).
[0056] 2) It is responsible for receiving the command of the control management module, when receiving the stop writing command, it executes the sync action (corresponding to the above-mentioned target synchronization operation) to directly flush the data to the storage unit; when receiving the start writing command, it re-starts writing data.
[0057] 3) The current writing data state is fed back to the control management unit.
[0058] 4、Data buffer unit
[0059] The data buffer unit is responsible for buffering the downloaded data to the memory.
[0060] 5、Speed measurement module
[0061] Used for obtaining the driving speed of the bus.
[0062] The following specifically describes the download control and writing data control involved in the specific embodiments of the present application:
[0063] Figure 4 is the flow chart of the download control according to the specific embodiments of the present application, as shown in Figure 4 , the flow chart includes the following steps:
[0064] S402, start;
[0065] S404, first judgment, the control module judges whether there is still an undownloaded media file;
[0066] S406, in the case that the first judgment result is yes, the control module initiates a command of downloading a certain media file;
[0067] S408, the downloading module downloads data to the buffer zone;
[0068] S410, the write data module reads data (corresponding to the above-mentioned target data) from the buffer and writes to the storage unit;
[0069] S412, a second judgment is made to determine whether the entire media file writing is completed. If the result of the second judgment is no, step S410 is executed;
[0070] S414, if the result of the second judgment is yes, the write data module performs a sync operation to flush the data to the disk and notifies the control management module, and then step S404 is executed;
[0071] S416, if the result of the first judgment is no, the process ends.
[0072] It is also necessary to note that the control management module determines whether there is an undownloaded media file; the control management module sends a command to the download module to execute a specific media file downloading task; the download module downloads data from the information publishing platform and places the data in the data buffer unit; the write data module reads data from the buffer and writes to the storage unit; the write data module performs a sync operation to flush the file content to the storage unit after completing the downloading of a complete data, and notifies the control management module; the control management unit receives the write completion message and continues to determine whether all the downloading is completed, and if not, continues to execute steps S404 to S412.
[0073] Figure 5 is a flowchart of the download control according to an embodiment of the present application, as shown in Figure 5 , the flowchart includes the following steps:
[0074] S502, start;
[0075] S504, read the speed information in real time;
[0076] S506, determine whether the vehicle is in a normal driving state according to the current speed;
[0077] S508, make a first judgment to determine whether the vehicle is still in a normal driving state according to the real-time speed information;
[0078] S510, if the result of the first judgment is yes, make a second judgment to determine whether the write data module is stopped;
[0079] S512, if the result of the second judgment is no, the process ends;
[0080] S514, if the result of the second judgment is yes, control the data module to restart data writing. Then, step S512 is executed;
[0081] S516, in the case that the first determination result is yes, a third determination is performed to determine whether the write data module stops writing. Further, in the case that the third determination result is yes, step S512 is performed;
[0082] S518, in the case that the third determination result is no, the data is synchronized to the storage device by performing sync, and the writing is stopped. Further, step S512 is performed.
[0083] It should be further noted that the control management module acquires speed data from the module in real time; the control management module determines the driving state of the current bus through the speed value, and if the driving state changes, the data write module is notified; the data module stops the current data write operation upon receiving the stop write command, and performs the sync action to flush the data to the storage unit; the data module re-starts reading data from the buffer and performing the data write action upon receiving the start write command.
[0084] Those skilled in the art can clearly understand the method according to the above-mentioned embodiments can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present application or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes a plurality of instructions for making a terminal device (which can be a mobile phone, computer, server, or network device, etc.) execute the method described in each embodiment of the present application.
[0085] In the present embodiment, a data read-write device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware is also possible and is contemplated.
[0086] Figure 6 is a structural block diagram of the data read-write device according to the embodiment of the present application, as shown in Figure 6 The device includes:
[0087] The acquisition unit 62 is configured to acquire the state of the transportation device.
[0088] The first sending unit 64 is configured to send a write command to a write data module included in the data read-write system, in a case where it is determined that the transportation device is in the target driving state, wherein the data read-write system includes a buffer module configured to buffer downloaded data, and the write command is configured to instruct the write data module to read the downloaded target data from the buffer module and write the read target data into a target memory included in the data read-write system.
[0089] In this embodiment, the data read-write system is powered by a power supply system of the transportation device.
[0090] In one example embodiment, the apparatus described above further includes:
[0091] The second sending unit is configured to send a stop write command to the write data module after controlling the write data module to write the read target data into the target memory included in the data read-write system, in a case where it is determined that the transportation device is in a low-speed driving state from the target driving state, wherein the stop write command is configured to instruct the write data module to perform a target synchronization operation to synchronize all first data included in the target data to the target memory, in a case where it is determined that the first data has not been written into the target memory; and wherein the driving speed of the transportation device in the low-speed driving state is less than the driving speed in the target driving state.
[0092] In one example embodiment, the stop write command is further configured to instruct the write data module to perform a target synchronization operation in a case where it is determined that the target data has been written into the target memory.
[0093] In one example embodiment, the target synchronization operation includes a synchronization operation performed by calling a sync function.
[0094] In one example embodiment, the apparatus described above further includes:
[0095] The determining unit is configured to determine to download the target data according to information published on a target platform, before sending the write command to the write data module included in the data read-write system.
[0096] The third sending unit is configured to send a download command to a download module included in the data read-write system, wherein the download command is configured to instruct the download module to download the target data from the target platform to the buffer module.
[0097] In this embodiment, a data read-write system is also provided, including:
[0098] The control module includes the data read-write apparatus described above.
[0099] The write data module, wherein the write data module is connected with the control module.
[0100] The buffer module, wherein the buffer module is connected with the write data module.
[0101] The target memory, wherein the target memory is connected with the write data module.
[0102] In an example embodiment, the system further comprises:
[0103] The download module, wherein the download module is connected with the control module, and is configured to receive a download command sent by the control module, and download the target data from the target platform into the buffer module based on the download command; wherein the download command is sent by the control module in a case that the control module determines to download the target data according to information published on the target platform.
[0104] In an example embodiment, the system further comprises:
[0105] The global positioning system (GPS) module, wherein the GPS module is located in the transportation device, and is connected with the control module, and the control module is configured to determine the state of the transportation device based on information reported by the GPS module.
[0106] It should be noted that the above-mentioned modules can be implemented by software or hardware, and for the latter, the following implementation manners can be used, but are not limited thereto: the above-mentioned modules are located in the same processor; or the above-mentioned modules are located in different processors in any combination.
[0107] Embodiments of the present application also provide a computer readable storage medium, which stores a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
[0108] In an example embodiment, the computer readable storage medium can include, but is not limited to: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.
[0109] Embodiments of the present application also provide an electronic device, which comprises a memory and a processor, the memory stores a computer program, and the processor is configured to execute the computer program to perform the steps in any of the above method embodiments.
[0110] In one example embodiment, the electronic device described above can further include a transmission device connected to the processor and an input / output device connected to the processor.
[0111] The specific examples in the present embodiment can refer to the examples described in the above embodiments and exemplary implementation, which will not be repeated here.
[0112] By the data read-write method provided by the present application, the speed data is acquired by the speed measurement module to determine the current vehicle driving state, so as to control the data read-write operation, which can effectively avoid the abnormal power-off condition in the data writing process, thereby improving the data writing reliability, without the need of adding a backup battery (i.e. a backup power supply), reducing the equipment cost and system complexity.
[0113] Obviously, those skilled in the art should understand that the modules or steps of the present application described above can be realized by general computing devices, which can be concentrated on a single computing device or distributed on a network composed of multiple computing devices, which can be realized by program codes executable by the computing devices, so that they can be stored in storage devices and executed by the computing devices, and in some cases, the steps shown or described can be executed in different order, or they can be manufactured into individual integrated circuit modules, or multiple modules or steps can be manufactured into a single integrated circuit module. Thus, the present application is not limited to any particular combination of hardware and software.
[0114] The above only describes the preferred embodiments of the present application and is not used to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A data read / write method, characterized in that, include: Obtain the status of transportation equipment; When it is determined that the transportation equipment is in the target driving state, a write command is sent to the write data module included in the data read and write system. The data read and write system includes a buffer module for caching downloaded data. The write command is used to instruct the write data module to read the downloaded target data from the buffer module and write the read target data into the target memory included in the data read and write system. The data reading and writing system is powered by the power supply system of the transportation equipment. When the write data module receives a stop write command and the target data has not been completely written to the target memory, the write data module feeds back the current write status information of the target data to the control module in the data read and write system, so that the control module will record the write status information. The stop write command is used to instruct the write data module to perform a target synchronization operation to synchronize all the first data to the target memory if it determines that the first data included in the target data has not been written to the target memory.
2. The method according to claim 1, characterized in that, After controlling the write data module to write the read target data into the target memory included in the data read / write system, the method further includes: Once it is determined that the transportation equipment has switched from the target driving state to a low-speed driving state, the stop writing command is sent to the write data module. The transportation equipment travels at a lower speed in the low-speed driving state than it travels at the target driving state.
3. The method according to claim 2, characterized in that, The stop write command is also used to instruct the write data module to perform the target synchronization operation after determining that all the target data has been written into the target memory.
4. The method according to claim 2 or 3, characterized in that, The target synchronization operation includes synchronization operations performed by calling the sync function.
5. The method according to claim 1, characterized in that, Before sending a write command to the write data module included in the data read / write system, the method further includes: Based on the information published on the target platform, it is determined that the target data needs to be downloaded; A download command is sent to the download module included in the data read / write system, wherein the download command is used to instruct the download module to download the target data from the target platform to the buffer module.
6. A data read / write device, characterized in that, include: The acquisition unit is used to acquire the status of transportation equipment; The first sending unit is configured to send a write command to the write data module included in the data read and write system when it is determined that the transportation equipment is in the target driving state. The data read and write system includes a buffer module for caching downloaded data. The write command is configured to instruct the write data module to read the downloaded target data from the buffer module and write the read target data into the target memory included in the data read and write system. The data reading and writing system is powered by the power supply system of the transportation equipment. The device is further configured to, when the write data module receives a stop write command and the target data has not been completely written to the target memory, have the write data module feed back the current write status information of the target data to the control module in the data read / write system, so that the control module records the write status information. The stop write command is used to instruct the write data module to perform a target synchronization operation to synchronize all the first data to the target memory if it determines that the first data included in the target data has not been written to the target memory.
7. A data read / write system, characterized in that, include: A control module, wherein the control module includes the data read / write device as described in claim 6; The write data module is connected to the control module. The buffer module is connected to the write data module; The target memory, wherein the target memory is connected to the write data module.
8. The system according to claim 7, characterized in that, The system also includes: A download module, wherein the download module is connected to the control module, and is used to receive a download command sent by the control module, and download the target data from the target platform to the buffer module based on the download command; The download command is sent by the control module after determining that the target data needs to be downloaded based on information published on the target platform.
9. The system according to claim 7, characterized in that, The system also includes: A Global Positioning System (GPS) module is located within the transportation equipment and connected to the control module, which determines the status of the transportation equipment based on information reported by the GPS module.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of claims 1 to 5.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 5.
Citation Information
Patent Citations
Flameout judgment method and device, vehicle-mounted system and storage media
CN110588547A
Data writing method and device and hard disk equipment
CN114003176A