Data transmission method and device, data storage method and device, electronic equipment and medium
By setting up a first system between the monitoring system and the data acquisition device, collecting and transmitting data, and using the second data area cache area, the problem that the monitoring system cannot quickly collect and store data is solved, and rapid data storage and transmission are achieved , ensuring the authenticity and efficiency of the data.
Patent Information
- Application Number
- CN202411354107.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-01-14
AI Technical Summary
Existing monitoring systems cannot quickly collect and store data within 500ms, especially cannot meet the data acquisition and storage needs of 100ms or even faster.
By setting a first system between the monitoring system and the data acquisition device, data is collected periodically and written to the data area line by line in order of the acquisition time until the data area is full, it is transmitted in the form of a data packet, and the second data area is used to use the As a cache area, avoid waiting for writes and ensures quick completion of data storage.
Without occupying monitoring system resources, the data storage cycle is greatly shortened, and it can meet the data acquisition and storage needs of 100ms or even faster, and ensure the authenticity of the data through timestamps.
Smart Images

Figure CN119311218A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data transmission and data storage method, device, electronic device and medium. Background Art
[0002] With the development of science and technology, data collection requirements are becoming more and more precise. However, in order to save resources, the storage cycle of monitoring systems used for data collection is usually only 500ms at the fastest. The current monitoring system cannot meet the collection and storage of 100ms or even faster data. Summary of the invention
[0003] In view of this, the present application provides a data transmission and data storage method, device, electronic device and medium, which are used to at least partially solve the above technical problems.
[0004] In a first aspect, the present application provides a data transmission method, comprising:
[0005] Periodically collecting data from each device;
[0006] In the order of acquisition time, the data and corresponding marking information collected in each cycle are written into the unit rows of the first data area row by row until all the unit rows are filled; wherein the data and corresponding marking information of each device collected in each cycle are respectively written into the designated position of the corresponding unit row, and the first data area includes N unit rows, where N is determined according to the total data bits occupied by the data and corresponding marking information collected in each cycle;
[0007] After all the cell rows in the first data area are fully written, in response to receiving a data transmission instruction from the second system, the data in the first data area are transmitted to the second system in the form of data packets.
[0008] In a possible implementation, writing the data collected in each period and the corresponding mark information into the unit rows of the first data area row by row in the order of collection time until all the unit rows are filled further includes:
[0009] The data of each device collected in each cycle and the corresponding tag information are respectively converted into data of a preset data type; wherein the preset data type is determined according to the original data type of the first data area and the second system (320);
[0010] splicing the data of the preset data type corresponding to the same period in a preset splicing order to obtain a corresponding row of data; the preset splicing order is consistent with the arrangement order after the data and mark information of each device are written into the designated position of each unit row respectively;
[0011] According to the sequence of acquisition time, the row of data corresponding to each cycle is written into the unit rows of the first data area row by row until all the unit rows are fully written.
[0012] In a possible implementation, the preset data type is a byte data type.
[0013] In a possible implementation, the method further includes:
[0014] After all the cell rows of the first data area are fully written, the data collected in each cycle and the corresponding mark information are sequentially written into at least one second data area connected to the first data area in a data area-by-data area order according to the order of collection time, until when it is detected that the first data area enters a writable state, the data collected in each cycle and the corresponding mark information are cyclically written into the data area currently in a writing state in a sequence of collection time; wherein the at least one second data area is sequentially connected in communication in a sequence of order;
[0015] During the writing process, when it is detected that any data area enters a writable state, it is determined whether the subsequent data area connected thereto is in a non-writable state or in a writing state;
[0016] If the latter data area is in a non-writable state, transferring the data packet of the latter data area to the data area;
[0017] If the subsequent data area is in a writing state, after the subsequent data is fully written, the data packet of the subsequent data area is transmitted to this data area.
[0018] In a possible implementation manner, the marking information includes one or more of acquisition time marking information and production marking information.
[0019] In a possible implementation, the acquisition time mark information is a timestamp used to indicate the acquisition time; and the production mark information is a production batch number.
[0020] In a second aspect, the present application provides a data storage method, comprising:
[0021] Acquire a data packet from a first data area of the first system; the data packet includes N rows of data, wherein each row of data includes data indicating each device of the same cycle and corresponding tag information, and the data of each device and the tag information are respectively located at a specified position of each row of data;
[0022] Parsing the data packet to obtain data of each device corresponding to each set of tag information;
[0023] The data of each device corresponding to each set of tag information is stored.
[0024] In a possible implementation manner, the marking information includes one or more of acquisition time marking information and production marking information.
[0025] In a third aspect, the present application provides a data transmission device, including:
[0026] A first data area having N unit rows; wherein N is determined according to the total data bits occupied by the data collected in each cycle and the corresponding tag information;
[0027] A collection module, used for periodically collecting data from each device;
[0028] A writing module, used to write the data collected in each cycle and the corresponding marking information into the unit rows of the first data area row by row in the order of collection time until all the unit rows are filled; wherein the data and the corresponding marking information of each device collected in each cycle are respectively written into the designated position of the corresponding unit row;
[0029] The transmission module is used for transmitting the data in the first data area to the second system in the form of data packets in response to receiving a data transmission instruction from the second system after all the cell rows in the first data area are fully written.
[0030] In a fourth aspect, the present application provides a data storage device, comprising:
[0031] An acquisition module, configured to acquire a data packet from a first data area of a first system; wherein the data packet includes N lines of data, wherein each line of data includes data and tag information of each device located at a specified position;
[0032] A parsing module, used for parsing the data packet to obtain data of each device corresponding to each set of tag information;
[0033] The storage module is used to store the data of each device corresponding to each set of marking information.
[0034] In a fifth aspect, the present application provides a data collection system, comprising:
[0035] A first system, comprising the data transmission device according to the third aspect;
[0036] The second system comprises the data storage device described in the fourth aspect.
[0037] In a sixth aspect, the present application provides an electronic device, the electronic device comprising: a processor, a communication interface, a memory and a bus, the processor, the communication interface and the memory communicating with each other through the bus;
[0038] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the method described in any one of the first aspect and the second aspect.
[0039] In a seventh aspect, the present application provides a computer-readable storage medium, on which computer instructions are stored. When the computer instructions are executed by a processor, the processor executes the method described in any one of the first and second aspects.
[0040] In an embodiment of the present application, a first data area is provided, and the data collected in each cycle and the corresponding marking information are written into the unit rows of the first data area row by row in the order of the collection time until all the unit rows are filled. After all the unit rows of the first data area are filled, in response to receiving the data transmission instruction of the second system, the data in the first data area is transmitted to the second system in the form of a data packet for storage by the second system. This can meet the collection and storage of 100ms or even faster data, and can greatly shorten the data storage cycle without occupying the resources of the monitoring system. Furthermore, the second system may need to parse the data before storing it. In an embodiment of the present application, at least one second data area is provided as a cache area to reserve the parsing time for the data packet for the second system, avoid waiting for writing, and further shorten the data storage cycle. In addition, in an embodiment of the present application, a timestamp can be selected as the marking information to ensure the authenticity of the collected data. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a flow chart of a data transmission method according to an embodiment of the present application.
[0042] Figure 2 is a structural diagram of the first data area according to an embodiment of the present application.
[0043] Figure 3 It is a connection diagram between various data areas and the second system according to an embodiment of the present application.
[0044] Figure 4 It is a structural diagram of a data transmission device according to an embodiment of the present application.
[0045] Figure 5 It is a flow chart of a data storage method according to an embodiment of the present application.
[0046] Figure 6is a structural diagram of a data storage device according to an embodiment of the present application.
[0047] Figure 7 It is a structural diagram of a data acquisition system according to an embodiment of the present application.
[0048] Figure 8 is a structural diagram of an electronic device according to an embodiment of the present application.
[0049] List of reference numerals:
[0050] 200, first data area; 201, cell row;
[0051] 310, second data area; 320, second system;
[0052] 400, data transmission device; 410, acquisition module;
[0053] 420, writing module; 430, transmission module;
[0054] 600, data storage device; 610, acquisition module;
[0055] 620, parsing module; 630, storage module;
[0056] 700. Data acquisition system; 710. First system;
[0057] 800. electronic device; 802. processor;
[0058] 804, communication interface; 806, memory;
[0059] 808, bus; 810, program. DETAILED DESCRIPTION
[0060] Usually, data is collected directly from each device connected to the monitoring system. In the embodiment of the present application, a first system is set between the monitoring system (described as the "second system" below) and each device; data is collected and packaged by the first system, and the packaged data is transmitted to the second system, which can greatly shorten the data storage cycle without occupying the resources of the monitoring system. In order to make the purpose, technical solutions, and advantages of the present application clearer, the present application is further described in detail with reference to the accompanying drawings and embodiments. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other technical solutions obtained by ordinary technicians in this field belong to the scope of protection of the present application.
[0061] Figure 1 FIG. 2 shows a data transmission method according to an embodiment of the present application. Figure 1As shown, the method includes:
[0062] Step S110: periodically collect data from each device.
[0063] The device may be a manipulable or monitorable device, such as a sensor, a motor, a pump, a valve, a meter, a regulator, etc. The devices described in step S110 may be a combination of various manipulable or monitorable devices. In step S110, for example, data may be periodically collected from each device through an input / output interface that is communicatively connected to each device.
[0064] Step S120: writing the data collected in each cycle and the corresponding mark information into the unit rows of the first data area row by row in the order of collection time until all the unit rows are filled.
[0065] Specifically, the data and corresponding marking information of each device collected in each cycle are written into the designated position of the corresponding unit row 201, that is, "the data and corresponding marking information of each device collected in different cycles are written into different unit rows, and the data and corresponding marking information of each device collected in the same cycle are written into the designated position of the same unit row 201", such as Figure 2 As shown, the first data area 200 includes N unit rows 201, where N is determined according to the total data bits occupied by the data collected in each cycle and the corresponding mark information.
[0066] In actual applications, different application scenarios may use different device combinations. The embodiments of the present application can set the number of rows N and the number of data bits in each row of the unit row 201 of the first data area 200 as needed. Taking the original data type of the first data area 200 as byte type and capable of storing 8192 bytes of data as an example, first calculate the total number of bytes occupied by the data collected in each cycle and the corresponding tag information as M, then the number of bytes in each row of the unit row 201 of the first data area 200 can be set to M, and the number of rows N of the unit row 201 is equal to 8192 / M.
[0067] In addition, considering that the data types of the data and tag information collected from each device may be the same or different, or these data may match or not match the original data type of the first data area 200. For this reason, in the case where the data types of these data are different or these data do not match the original data type of the first data area 200, in the aforementioned step S120, before writing the data, it is necessary to convert the data and tag information of each device collected in each cycle into data of a preset data type so as to match the original data type of the first data area 200, and the original data type of the first data area 200 is the same as the original data type of the second system; then when writing the data, the converted data of the preset data type are written row by row to the cell row 201 of the first data area 200 in the order of the collection time until all the cell rows 201 are filled. Taking the original data type of the first data area 200 as byte data as an example, the data and corresponding tag information of each device collected in each cycle need to be converted into byte data before writing. It should be pointed out that the present application is not limited to the preset data type being determined according to the original data type of the first data area 200, and is not limited to the byte data type.
[0068] In some exemplary implementations, in the aforementioned step S120, before writing the data, the data of the preset data type corresponding to the same cycle may be spliced in a preset splicing order to obtain a corresponding row of data, and the preset splicing order is consistent with the arrangement order after the data and tag information of each device are written to the designated position of each unit row 201; then, when writing the data, the row of data corresponding to each cycle is written to the unit row 201 of the first data area 200 row by row in the order of the acquisition time until all the unit rows 201 are filled. In addition, in some other exemplary implementations, the aforementioned "splicing" operation may not be performed before writing the data, but the data of the preset data type corresponding to the same cycle may be written to the designated position of each unit row 201.
[0069] Step S130 : after all the cell rows 201 of the first data area 200 are fully written, in response to receiving a data transmission instruction from the second system 320 , the data in the first data area 200 are transmitted to the second system 320 in the form of data packets.
[0070] In actual applications, after receiving a data packet from the first data area 200, the second system 320 can directly store the data packet without parsing it, or can parse it first and then store it. For the latter, the parsing time of a data packet by the second system 320 may be greater than or much greater than the single full writing time of the first data area 200. Therefore, the method of this embodiment further includes the following steps:
[0071] After all the cell rows 201 of the first data area 200 are filled, the data collected in each cycle and the corresponding tag information are sequentially written into at least one second data area 310 connected to the first data area 200 in the order of the collection time (at least one second data area 310 is sequentially connected in communication in the order of the collection time, such as Figure 3 ), until it is detected that the first data area 200 enters the writable state, the data collected in each cycle and the corresponding collection time are cyclically written into the data area currently in the writing state in the order of the collection time; during the writing process, when it is detected that any data area enters the writable state, it is determined whether the subsequent data area connected to it is in the non-writable state or the writing state; if it is determined that the subsequent data area is in the non-writable state, the data packet of the subsequent data area is transmitted to the data area; if it is determined that the subsequent data area is in the writing state, after the subsequent data is full, the data packet of the subsequent data area is transmitted to the data area. As such, at least one second data area 310 is used as a data buffer area, which can reserve time for parsing data packets for the second system 320. In the present application, a data area enters the non-writable state after being filled or receiving a data packet transmitted by the subsequent data area, and a data area is in the writing state when data is being written.
[0072] Preferably, the second data area 310 includes the aforementioned N unit rows 201. Moreover, in practical applications, the required number of second data areas 310 can be set as needed, for example, the number of second data areas 310 can be selected appropriately according to the number N of unit rows 201, the parsing time of a data packet by the second system 320, etc.
[0073] In this embodiment, the marking information can be arbitrarily selected and set as needed. For example, it can include acquisition time marking information and / or production marking information. The acquisition time marking information is, for example but not limited to, a timestamp for indicating the acquisition time; the production marking information is, for example but not limited to, a production batch number.
[0074] It can be understood that the “data area” described in this embodiment is any form of storage unit that can temporarily cache data.
[0075] In order to implement the data transmission method of the above-mentioned embodiment, the embodiment of the present application further provides a data transmission device 400. Figure 4As shown, the device 400 includes a first data area 200, a collection module 410, a writing module 420 and a transmission module 430. It should be noted that since the device 400 embodiment is to implement the aforementioned method embodiment, each module in the device 400 is provided to implement each step of the aforementioned method, and therefore the present application is not limited to the following embodiments, and any device or module that can implement the aforementioned method should be included in the protection scope of the present application.
[0076] In this embodiment, the first data area 200 has N cell rows 201, where N is determined according to the total data bits occupied by the data collected in each cycle and the corresponding tag information. The acquisition module 410 is used to periodically collect data from each device. The writing module 420 is used to write the data collected in each cycle and the corresponding tag information into the cell rows 201 of the first data area 200 row by row in the order of the acquisition time until all the cell rows 201 are filled; wherein the data and the corresponding tag information of each device collected in each cycle are respectively written into the designated positions of the corresponding cell rows 201. The transmission module 430 is used to transmit the data in the first data area 200 to the second system 320 in the form of data packets in response to receiving a data transmission instruction from the second system 320 after all the cell rows 201 of the first data area 200 are filled.
[0077] In some exemplary implementations, the device 400 further includes at least one second data area 310. In addition, the writing module 420 is further used to: after all the cell rows 201 of the first data area 200 are fully written, the data collected in each cycle and the corresponding mark information are sequentially written to at least one second data area 310 connected to the first data area 200 in a data area-by-data area order according to the sequence of acquisition time, until when it is detected that the first data area 200 enters a writable state, the data collected in each cycle and the corresponding mark information are cyclically written to the data area currently in the writing state in a sequence of acquisition time; wherein the at least one second data area 310 is sequentially connected in communication in a sequence; during the writing process, when it is detected that any data area enters a writable state, it is determined whether the next data area connected thereto is in a non-writable state or a writing state; if the next data area is in a non-writable state, the data packet of the next data area is transmitted to the data area; if the next data area is in a writing state, after the next data area is fully written, the data packet of the next data area is transmitted to the data area.
[0078] It can be understood that since the data transmission device 400 of this embodiment is a corresponding device to the data transmission method of the aforementioned embodiment, all technical details in the data transmission method of the aforementioned embodiment are applicable to the data transmission device 400 of this embodiment. For the sake of simplicity, some details that are the same as the method of the aforementioned embodiment are omitted here.
[0079] Corresponding to the data transmission method of the aforementioned embodiment, an embodiment of the present application also provides a data storage method.
[0080] like Figure 5 As shown, the method includes:
[0081] Step S510: Obtain a data packet from the first data area 200 of the first system 710; the data packet includes N rows of data, wherein each row of data includes data indicating each device of the same cycle and corresponding marking information, and the data of each device and the marking information are respectively located at a specified position of each row of data. The marking information can be arbitrarily selected and set as needed. For example, it can include acquisition time marking information and / or production marking information. The acquisition time marking information is, for example but not limited to, a timestamp for indicating the acquisition time; the production marking information is, for example but not limited to, a production batch number.
[0082] Step S520: Parse the data packet to obtain data of each device corresponding to each set of tag information.
[0083] Step S530: storing the data of each device corresponding to each set of tag information.
[0084] In some exemplary implementations, step S530 may be further implemented as: using the tag information as an index to store the data of each device corresponding to each group of tag information; further, it may be stored in an Excel spreadsheet format, etc., and may be permanently preserved.
[0085] It can be understood that since the data storage method of this embodiment corresponds to the data transmission method of the aforementioned embodiment, all technical details in the data transmission method of the aforementioned embodiment are applicable to the data storage method of this embodiment. For the sake of simplicity, some details that are the same as those of the aforementioned embodiment are omitted here.
[0086] Similarly, in order to implement the data storage method of the aforementioned embodiment, the embodiment of the present application also provides a data storage device 600. Figure 6As shown, the device 600 includes an acquisition module 610, a parsing module 620 and a storage module 630. It should be noted that since the embodiment of the device 600 is to implement the aforementioned data storage method embodiment, each module in the device 600 is set to implement each step of the aforementioned data storage method, so the present application is not limited to the following embodiments, and any device or module that can implement the above method should be included in the protection scope of the present application.
[0087] In this embodiment, the acquisition module 610 is used to acquire a data packet from the first data area 200 of the first system 710; wherein the data packet includes N lines of data, wherein each line of data includes data and tag information of each device located at a specified position.
[0088] The marking information can be arbitrarily selected and set as needed. For example, it can include acquisition time marking information and / or production marking information. The acquisition time marking information is, for example but not limited to, a timestamp for indicating the acquisition time; the production marking information is, for example but not limited to, a production batch number.
[0089] Furthermore, in this embodiment, the parsing module 620 is used to parse the data packet to obtain the data of each device corresponding to each set of tag information. The storage module 630 is used to store the data of each device corresponding to each set of tag information.
[0090] In some exemplary implementations, the storage module 630 is further used to use the tag information as an index to store the data of each device corresponding to each group of tag information; further, it can be stored in an Excel spreadsheet format, etc., and can be permanently preserved.
[0091] It can be understood that since the device 600 of this embodiment is a corresponding device to the data storage method of the aforementioned embodiment, all technical details of the data storage method of the aforementioned embodiment are applicable to the device 600 of this embodiment. For the sake of simplicity, some details that are the same as the method of the aforementioned embodiment are omitted here.
[0092] In addition, the embodiment of the present application also provides a data acquisition system 700. Figure 7 As shown, the system 700 includes the data transmission device 400 of the aforementioned embodiment and the data storage device 600. It should be noted that since the system 700 includes the device 400 and the device 600 of the aforementioned embodiment, all technical details of the device 400 and the device 600 of the aforementioned embodiment are applicable to the system 700 of this embodiment, and for the sake of simplicity, some details of the device 400 and the device 600 of the aforementioned embodiment are omitted here.
[0093] in addition, Figure 8FIG. 8 is a schematic diagram of an electronic device 800 according to an embodiment of the present disclosure. It should be noted that the present embodiment does not limit the specific implementation of the electronic device 800. Figure 8 As shown, the electronic device 800 includes a processor 802 , a communications interface 804 , a memory 806 , and a bus 808 .
[0094] in:
[0095] The processor 802 , the communication interface 804 , and the memory 806 communicate with each other via a bus 808 .
[0096] The communication interface 804 is used to communicate with other electronic devices or servers.
[0097] The processor 802 is used to execute the program 810, and specifically can execute the relevant steps in the aforementioned method embodiments.
[0098] Specifically, the program 810 may include program codes, which include computer operation instructions.
[0099] The processor 802 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present disclosure. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or may be processors of different types, such as one or more CPUs and one or more ASICs.
[0100] The memory 806 is used to store the program 810. The memory 806 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0101] The program 810 may be specifically configured to enable the processor 802 to execute the method in any of the foregoing embodiments.
[0102] The specific implementation of each step in program 810 can refer to the corresponding description of the corresponding steps and units in the method of the aforementioned embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the aforementioned method embodiment, which will not be repeated here.
[0103] The present disclosure also provides a computer-readable storage medium storing instructions for causing a machine to execute the method embodiments described herein. Specifically, a system or device equipped with a storage medium may be provided, on which a software program code for implementing the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the system or device is enabled to read and execute the program code stored in the storage medium.
[0104] In this case, the program code itself read from the storage medium can realize the function of any one of the above embodiments, and thus the program code and the storage medium storing the program code constitute part of the present disclosure.
[0105] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.
[0106] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.
[0107] The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as a computer code originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a special-purpose processor or programmable or special-purpose hardware (such as an ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the method shown here, the execution of the code converts the general-purpose computer into a special-purpose computer for executing the method shown here.
[0108] It should be noted that not all steps and modules in the above-mentioned processes and system structure diagrams are necessary, and some steps or modules can be ignored according to actual needs. The execution order of each step is not fixed and can be adjusted as needed. The system structure described in the above-mentioned embodiments can be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or some components in multiple independent devices may be implemented together.
[0109] In the above embodiments, the hardware module can be implemented mechanically or electrically. For example, a hardware module can include permanent dedicated circuits or logic (such as special processor 802, FPGA or ASIC) to complete the corresponding operation. The hardware module can also include programmable logic or circuits (such as general processor 802 or other programmable processors 802), which can be temporarily set by software to complete the corresponding operation. The specific implementation (mechanical method, or dedicated permanent circuit, or temporarily set circuit) can be determined based on cost and time considerations.
[0110] It should be noted that in the claims and description of this patent, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one" do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0111] While the present disclosure has been shown and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present disclosure.
[0112] The present disclosure has been shown and described in detail above through the accompanying drawings and preferred embodiments. However, the present disclosure is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the code review methods in the above different embodiments can be combined to obtain more embodiments of the present disclosure, and these embodiments are also within the protection scope of the present disclosure.
Claims
1. A data transmission method, characterized in that: include: Periodically collecting data from each device; According to the order of acquisition time, the data and corresponding marking information collected in each cycle are written into the unit rows (201) of the first data area (200) row by row until all the unit rows (201) are filled; wherein the data and corresponding marking information of each device collected in each cycle are respectively written into the designated position of the corresponding unit row (201), and the first data area (200) includes N unit rows (201), and N is determined according to the total data bits occupied by the data and corresponding marking information collected in each cycle; After all the cell rows (201) of the first data area (200) are fully written, in response to receiving a data transmission instruction from the second system (320), the data in the first data area (200) are transmitted to the second system (320) in the form of data packets.
2. The method according to claim 1, characterized in that The method further comprises: writing the data collected in each cycle and the corresponding marking information into the unit rows (201) of the first data area (200) row by row in the order of the collection time until all the unit rows (201) are filled; The data of each device collected in each cycle and the corresponding tag information are respectively converted into data of a preset data type; wherein the preset data type is determined according to the original data types of the first data area (200) and the second system (320); splicing the data of the preset data type corresponding to the same cycle in a preset splicing order to obtain a corresponding row of data; the preset splicing order is consistent with the arrangement order after the data and the mark information of each device are written into the designated position of each unit row (201); According to the sequence of acquisition time, the row of data corresponding to each cycle is written row by row into the unit rows (201) of the first data area (200) until all the unit rows (201) are fully written.
3. The method according to claim 2, characterized in that The preset data type is a byte data type.
4. The method according to claim 1, characterized in that: The method further comprises: After all the unit rows (201) of the first data area (200) are fully written, the data collected in each cycle and the corresponding marking information are sequentially written into at least one second data area (310) connected to the first data area (200) in a data area-by-data area order according to the order of the collection time, until when it is detected that the first data area (200) has entered a writable state, the data collected in each cycle and the corresponding marking information are sequentially written into the data area currently in the writing state in a cyclic manner in a data area in a cyclic order according to the order of the collection time; wherein the at least one second data area (310) is sequentially connected in communication in a sequential order; During the writing process, when it is detected that any data area enters a writable state, it is determined whether the subsequent data area connected thereto is in a non-writable state or in a writing state; If the latter data area is in a non-writable state, transferring the data packet of the latter data area to the data area; If the latter data area is in a writing state, after the latter data area is fully written, the data packet of the latter data area is transmitted to the data area.
5. The method according to any one of claims 1 to 4, characterized in that The marking information includes collection time marking information and / or production marking information.
6. The method according to claim 5, characterized in that The acquisition time mark information is a timestamp used to indicate the acquisition time; the production mark information is a production batch number.
7. A data storage method, characterized in that: include: Acquire a data packet from a first data area (200); the data packet includes N rows of data, wherein each row of data includes data indicating each device in the same cycle and corresponding tag information, and the data of each device and the tag information are respectively located at a specified position of each row of data; Parsing the data packet to obtain data of each device corresponding to each set of tag information; The data of each device corresponding to each set of tag information is stored.
8. The method according to claim 7, characterized in that The marking information includes collection time marking information and / or production marking information.
9. A data transmission device, characterized in that: The data transmission device (400) comprises: A collection module (410), used for periodically collecting data from each device; A first data area (200) having N unit rows (201); wherein N is determined according to the total data bits occupied by the data collected in each cycle and the corresponding tag information; A writing module (420) is used to write the data collected in each cycle and the corresponding marking information into the unit rows (201) of the first data area (200) row by row according to the order of collection time until all the unit rows (201) are filled; wherein the data collected in each cycle for each device and the corresponding marking information are respectively written into the designated position of the corresponding unit row (201); A transmission module (430) is used to transmit the data in the first data area (200) to the second system (320) in the form of data packets in response to receiving a data transmission instruction from the second system (320) after all the cell rows (201) in the first data area (200) are fully written.
10. A data storage device, characterized in that: The data storage device (600) comprises: An acquisition module (610) is used to acquire a data packet from a first data area (200) of a first system (710); wherein the data packet includes N lines of data, wherein each line of data includes data and tag information of each device located at a specified position; A parsing module (620), configured to parse the data packet to obtain data of each device corresponding to each set of tag information; The storage module (630) is used to store the data of each device corresponding to each set of marking information.
11. A data acquisition system, characterized in that: The data acquisition system (700) comprises: A first system (710), comprising the data transmission device (400) according to claim 9; A second system (320) comprising the data storage device (600) as claimed in claim 10.
12. An electronic device, the electronic device (800) comprising: A processor (802), a communication interface (804), a memory (806) and a bus (808), wherein the processor (802), the communication interface (804) and the memory (806) communicate with each other via the bus (808); The memory (806) is used to store at least one executable instruction, and the executable instruction enables the processor (802) to perform an operation corresponding to the method as described in any one of claims 1 to 8.
13. A computer-readable storage medium having computer instructions stored thereon, wherein when the computer instructions are executed by a processor, the processor is caused to execute the method according to any one of claims 1 to 8.
Citation Information
Cited By
Method and device for high-speed data acquisition of upper computer based on Ethernet
CN120447430A