A data caching method and device for an AGV vehicle-mounted system, and a storage medium

CN115905141BActive Publication Date: 2026-11-03GUANGDONG JATEN ROBOT & AUTOMATION
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211249499.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-12
Publication Date
2026-11-03
Estimated Expiration
2042-10-12

AI Technical Summary

Technical Problem

In existing technologies, data caching methods for AGV on-board systems suffer from problems such as complex operation and high hardware storage capacity requirements, or poor data readability and lack of reasonable organization.

Method used

A data caching method and device are provided. By obtaining an updated data group, calling the corresponding API function according to the data type, configuring the position index, cache depth threshold and counter, encapsulating the data group according to the data format, caching it in memory, and writing it to a file when necessary, the method distinguishes between A-class and B-class data for different processing.

Benefits of technology

It reduces the difficulty of data retrieval, improves data readability and analysis convenience, simplifies the operation process, and meets the data recording needs of AGV on-board systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115905141B_ABST
    Figure CN115905141B_ABST
Patent Text Reader

Abstract

The application discloses a data caching method and equipment for an AGV vehicle-mounted system and a storage medium, and the method is applied to the AGV vehicle-mounted system and comprises the following steps: obtaining an updated data group, calling a corresponding data caching API function according to the type of the data group, judging whether the data group has been cached, configuring a corresponding position index, a caching depth threshold and a counter for the data group if the data group has not been cached, encapsulating each data record in the data group according to a set data format according to the position index, and caching the encapsulated data group into a set data_group container, judging whether the caching depth of the data group reaches the caching depth threshold, and adding 1 to the counter if the caching depth does not reach the caching depth threshold, and judging whether the data record needs to be saved, and writing the cached data in the data_group container into a set file if the data record needs to be saved. The application greatly reduces the difficulty of data query and greatly improves the readability of data and the convenience of data analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data caching technology, and in particular to a data caching method, device, and storage medium for AGV on-board systems. Background Technology

[0002] Data logging is particularly important for AGV onboard control systems. It records the equipment status, logical data, and performance parameters in real time during system operation. By analyzing data log files, the causes of system anomalies can be investigated, the system's operating status and patterns can be understood, and changes in the external environment detected by onboard sensors can be analyzed. This allows for the implementation of relevant improvement measures, which is of great practical significance for daily system maintenance and future upgrades. The ultimate goal of data caching is to proactively trigger the generation of data logs when data is needed or when anomalies are detected during system operation, allowing the system to proactively generate fault logs.

[0003] Among existing technologies, common methods for caching data include: one is to cache data in real time in a database. This method requires the installation of an embedded database system, is relatively complex to operate, and has certain requirements for hardware storage capacity. Another common method is to cache data in text files, but its readability is poor, it is not convenient for querying and analysis, and it lacks a relatively reasonable data organization method. Summary of the Invention

[0004] The purpose of this invention is to provide a data caching method, device, and storage medium for AGV on-board systems, in order to solve one or more technical problems existing in the prior art, or at least provide a beneficial option or create conditions.

[0005] The solution to the technical problem of this invention is to provide a data caching method, device, and storage medium for an AGV on-board system.

[0006] According to an embodiment of a first aspect of the present invention, a data caching method for an AGV onboard system is provided, which is applied to the AGV onboard system and includes the following steps:

[0007] Get the updated data group, and call the corresponding data caching API function according to the data group's data type;

[0008] Determine whether the data group has been cached. If not, configure the corresponding location index, cache depth threshold, and counter for the data group.

[0009] Based on the location index, each data record in the data group is encapsulated according to the set data format, and the encapsulated data group is cached in the set data_group container;

[0010] Determine whether the cache depth of the data group has reached the cache depth threshold; if not, increment the counter by 1.

[0011] Determine whether data records need to be saved. If so, write the cached data in the set data_group container to the set file.

[0012] Furthermore, the step of obtaining the updated data group and, based on the data type of the data group, calling the corresponding data caching API function further includes:

[0013] Based on the frequency and cycle of data recording, the data is divided into Class A data and Class B data;

[0014] Get the updated data group. If the data type of the data group is the A-type data, then call the first data cache API function.

[0015] Get the updated data group. If the data group is of type B data, then call the second data cache API function.

[0016] Furthermore, when the data group is of type A data and is not cached, configuring the corresponding location index, cache depth threshold, and counter for the data group also includes:

[0017] The data set is also configured with corresponding dilution period intervals and dilution marker amounts;

[0018] The dilution marker is used to determine whether the data group needs to be diluted. If so, a data record is extracted from the data group according to the dilution period interval and stored in the set dilution data group. The set dilution data group is then cached in the set data_group container.

[0019] Furthermore, if not, configuring the corresponding location index, cache depth threshold, and counter for the data group further includes:

[0020] Determine whether the data group has been cached; if not, configure the corresponding group name for the data group.

[0021] Save the group name of the data group to the set dataname_group container.

[0022] Furthermore, determining whether the data group has been cached also includes:

[0023] If the data group is cached, then obtain the location index corresponding to the data group.

[0024] Furthermore, determining whether the cache depth of the data group has reached the cache depth threshold also includes:

[0025] When the cache depth of the data group reaches the cache depth threshold, the first data record in the data group in the set data_group container is cleared.

[0026] Furthermore, the step of writing the cached data in the designated data_group container to the designated file specifically includes:

[0027] Create a write file and set the filename and file path for the write file;

[0028] Based on the filename and file path, the cached data in the set data_group container is written to the write file.

[0029] Furthermore, the determination of whether data records need to be saved also includes:

[0030] When the data records no longer need to be saved, the updated data set is retrieved again.

[0031] According to a second aspect of the present invention, an electronic device is provided, comprising:

[0032] A memory for storing a program; a processor for executing the program stored in the memory, wherein when the processor executes the program stored in the memory, the processor is configured to execute a data caching method for an AGV on-board system as described in any one of the first aspects.

[0033] According to a third aspect of the present invention, a storage medium is provided, comprising: storing computer-executable instructions for performing a data caching method for an AGV on-board system as described in any one of the first aspects.

[0034] The beneficial effects of this invention are as follows: For updated data groups, based on the data group type and location index, the data groups are cached in the memory of the AGV onboard system according to a certain data format. When data records need to be saved, the cached data is written to a designated file, forming easily viewable data records. Compared with the existing technology of recording data through an embedded database, this invention greatly reduces the difficulty of data retrieval; compared with the relatively arbitrary method of recording data into text files, it greatly improves data readability and the convenience of data analysis. Attached Figure Description

[0035] Figure 1 This is a schematic flowchart of a data caching method for an AGV on-board system provided in an embodiment of the present invention;

[0036] Figure 2This is a schematic flowchart of a data caching method for an AGV on-board system provided in another embodiment of the present invention;

[0037] Figure 3 This is a schematic flowchart of a data caching method for an AGV on-board system provided in another embodiment of the present invention. Detailed Implementation

[0038] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and should not be construed as limiting the scope of the invention.

[0039] It should be noted that although functional modules are divided in the system diagram, in some cases, the steps shown or described may be executed in a different order than the module division or flowchart shown in the system. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0040] In the description of this invention, it should be noted that, unless otherwise explicitly defined, terms such as "setting," "installation," and "connection" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this invention in conjunction with the specific content of the technical solution.

[0041] According to an embodiment of the first aspect of the present invention, referring to Figure 1 In some embodiments of the present invention, a data caching method for an AGV onboard system includes the following steps:

[0042] S100: Retrieve the updated data group and, based on the data group's data type, call the corresponding data caching API function.

[0043] In this embodiment, during the AGV's operation, the onboard system acquires the AGV's running status and the changes in the external environment detected by the onboard sensors, thereby continuously generating new data records. Corresponding data groups are updated with new data records or new data groups are created. The system retrieves the updated data groups from the AGV's onboard system and, based on the data type of the updated data groups, calls the corresponding data caching API function.

[0044] API (Application Programming Interface) functions are predefined functions. In this embodiment, the API functions are interface functions used for data caching.

[0045] S200: Determine whether the data group has been cached. If not, configure the corresponding location index, cache depth threshold, and counter for the data group.

[0046] In this embodiment, it is determined whether the updated data group has already been cached. If the updated data group has not been cached, it is considered a new data group, and the relevant variables or parameters of this data group are initialized. Additionally, the corresponding position index, cache depth threshold, and counter are configured for this data group.

[0047] To facilitate caching, the recorded dataset needs to be divided into groups. To control the capacity of the data records, each group of cached data needs to specify a cache depth threshold, data_deep. Each group of data has a corresponding counter, which is used to record the number of cached records in that group. The corresponding counter is stored in the dataline_counter_group container.

[0048] S300 encapsulates each data record in the data group according to the set data format based on the location index, and caches the encapsulated data group in the set data_group container.

[0049] In this embodiment, each data record in the data group is encapsulated according to the set data format based on the location index of the data group, and the encapsulated data group is cached, that is, the encapsulated data group is cached in the corresponding position of the set data_group container.

[0050] Each data group consists of several data records, and each data record consists of several data items. In this embodiment, the data format is as follows: each data item is separated by a tab, and each data record and each data group is separated by a newline character. To facilitate vertical and horizontal comparative analysis of the data, some parameter names of the data record are appended to the beginning of each data record, such as: the length of the data record, timestamp, serial number, and the current mileage value of the AGV. Through the above data format encapsulation processing, the data finally stored in the file will be more orderly and clear.

[0051] S400: Determine whether the cache depth of the data group has reached the cache depth threshold. If not, increment the counter by 1.

[0052] In this embodiment, after storing the data group, the cache depth of the data group is confirmed, and the cache depth is compared with the set cache depth threshold. When the cache depth is not equal to the set cache depth threshold, that is, when the capacity of the data stored in the data group is not full and the next data record can be stored, the counter is incremented by 1 to record the number of data records cached in the data group at this time.

[0053] S500 determines whether data records need to be saved. If so, it writes the cached data in the set data_group container to the set file.

[0054] In this embodiment, it is determined whether data recording needs to be saved, i.e., whether the AGV onboard system will be triggered to save data recording or whether the AGV onboard system has malfunctioned and needs to be saved urgently. When data recording needs to be saved, i.e., the AGV onboard system is triggered to save data recording or the AGV onboard system has malfunctioned and needs to be saved urgently, all cached data in the set data_group container is written to the set file.

[0055] It should be noted that in this invention, all containers refer to a data structure, such as an array, queue, or linked list.

[0056] In this invention, for updated data groups, the data groups are cached in the memory of the AGV onboard system according to a certain data format based on the data group type and location index. When data records need to be saved, the cached data is written to a designated file, forming easily viewable data records. Compared with the existing technology of recording data through an embedded database, this invention greatly reduces the difficulty of data retrieval; compared with the more casual method of recording data into text files, it greatly improves data readability and the convenience of data analysis.

[0057] In some embodiments of the present invention, S100 further includes:

[0058] S110, based on the frequency of data recording and the period of data change, divide the data into two categories: Category A data and Category B data.

[0059] In this embodiment, based on the frequency of data recording and the data change cycle in the AGV onboard system, the data is divided into two main data types. Type A data may change at any time within each data change cycle. It contains many data items, therefore it needs to be cached for each data change cycle. Generally, this data is cached only after processing all the real-time tasks of the entire system. This type of data constitutes the main body of the data records. Type A data can include speed data, positioning data, temperature data, etc.

[0060] Type B data consists of data that changes only under specific conditions, and therefore is cached only when those conditions occur. Type B data can include button trigger data, drive mechanism trigger data, and so on.

[0061] S120: Obtain the updated data group from the AGV onboard system. When the data type of the updated data group is Class A data, call the first data cache API function.

[0062] In this embodiment, the updated data group in the AGV on-board system is obtained. When the data type of the updated data group belongs to type A data, the first data caching API function suitable for type A data is called. That is, when the data records in the updated data group may change at any time during each data change cycle, and each data record in the data group has a large number of data items, the data in the data group can be considered to belong to type A data, that is, the data type of the data group can be considered to be type A data type.

[0063] For data of type A, the first data caching API function is invoked. The first data caching API function is named CacheDataA, and its parameter list includes: group name, data caching period, data caching mileage, dilution caching mileage, cache factor, and all data items to be recorded.

[0064] Therefore, in subsequent step S200, when configuring or initializing the relevant variables or parameters of the data group for class A data, the above variables or parameters can be initialized or configured. The depth of the non-diluted data record can be calculated from the data cache period, data cache mileage, and cache factor.

[0065] S130: Obtain the updated data group from the AGV onboard system. When the updated data group is of type B, call the second data cache API function.

[0066] In this embodiment, the updated data group in the AGV on-board system is obtained. When the updated data group belongs to type B data, the second data caching API function suitable for type B data is called. That is, when the data recording frequency and data recording change cycle in the updated data group change slowly, and the data records in the data group are generated under specific conditions, the data in the data group can be considered to belong to type B data, that is, the data type of the data group can be considered to be the data type of type B data.

[0067] For data of type B, the second data caching API function is called, denoted as CacheDataB. The function's parameter list includes: group name, cache depth threshold, and all data items to be recorded. Therefore, in subsequent step S200, when configuring or initializing the relevant variables or parameters of the data group for type B data, these variables or parameters can be initialized or configured.

[0068] In this embodiment, considering the characteristics of data type A and data type B, the design of the data caching API functions called by the two types of data is slightly different. For data type B, only the group name of the data group, the cache depth threshold, and all data items that are to be recorded need to be provided.

[0069] Category A data has many items and needs to be cached once per period. The desired mileage or time period for data recording is specified, and the cache depth threshold can be calculated by combining the set mileage or time period with the cache period size. In addition to providing the data group name and all desired data items, the data cache period, data cache mileage, and cache factor are also required to calculate the relevant parameter values ​​for data recording depth.

[0070] In some embodiments of the present invention, S200 further includes the following when the updated data group has not been cached:

[0071] S210: If the updated data group has not been cached, then configure the corresponding group name for the data group.

[0072] S211, save the configured data group name to the set dataname_group container.

[0073] In this embodiment, it is determined whether the updated data group has been cached, that is, whether the corresponding data group name exists in the set dataname_group container. If the corresponding data group name does not exist in the container, it can be assumed that the updated data group has not been cached.

[0074] This allocates a space within the designated `dataname_group` container, configures the corresponding group name for this data group, stores the configured group name in the `dataname_group` container, and also configures the corresponding position index, cache depth threshold, and counter. The position index is unique.

[0075] To facilitate data caching, the dataset needs to be divided into groups. Each group has a designated group name, stored in a `dataname_group` container. Each name has a unique position index within the `dataname_group` container. To control the data record capacity, each cached group needs a specified cache depth threshold `data_deep`. Each group also has a corresponding counter to record the number of cached records, stored in a `dataline_counter_group` container. Each data group, stored in its designated `data_group` container, also has a unique position index within that container, identical to its position index within the `dataname_group` container.

[0076] In some embodiments of the present invention, in S200, determining whether the updated data group has been cached further includes:

[0077] S220: Determine whether the updated data group has been cached. If the updated data group has been cached, obtain the position index corresponding to the cached data group.

[0078] In this embodiment, it is determined whether the updated data group has already been cached. Specifically, it is checked whether the corresponding data group name exists in the `dataname_group` container. If the corresponding data group name exists in the container, it is considered that the updated data group has been cached, meaning that the corresponding group name, position index, cache depth threshold, and counter for this data group have been configured. Therefore, the position index within the `dataname_group` container is obtained.

[0079] Based on the location index obtained or configured at this time, a prerequisite can be set for caching the encapsulated data group into the set data_group container in the subsequent S300.

[0080] Reference Figure 2 In some embodiments of the present invention, in S400, after storing the data group, confirming the cache depth of the data group and comparing the cache depth with a set cache depth threshold further includes:

[0081] S410: When the cache depth equals the set cache depth threshold, the first data record in the set data_group container of that data group is cleared.

[0082] In this embodiment, after storing the data group, the cache depth of the data group is confirmed, and the cache depth is compared with the set cache depth threshold. When the cache depth is equal to the set cache depth threshold, that is, when the capacity of the data group is full and it is impossible to store the next data record, the first data record of the data group is removed to ensure that the set cache depth threshold is not exceeded.

[0083] Reference Figure 3 In some embodiments of the present invention, in S500, writing the cached data in the designated data_group container to the designated file specifically includes:

[0084] S510 creates a write file for writing cached data records, and sets the filename and path of the write file.

[0085] S511, based on the set file name and file path, writes the cached data stored in the set data_group container to the already set write file.

[0086] In this embodiment, it is determined whether it is necessary to save the data records in the AGV onboard system memory. Specifically, it is determined whether the AGV onboard system will be triggered to save data records or whether a malfunction occurs requiring emergency data saving. When data saving is necessary (either the AGV onboard system is triggered or a malfunction occurs requiring emergency data saving), a write file is created, its filename and path are set, and all cached data stored in the data_group container is written to the specified file based on the set filename and path.

[0087] Reference Figure 3 In some embodiments of the present invention, in S500, determining whether to save data records, i.e., determining whether to trigger the generation of data records or fault records, further includes:

[0088] S520: When it is no longer necessary to save data records, the updated data group is retrieved again.

[0089] In this embodiment, when data recording is not required, when the AGV onboard system is not triggered to save data recording, or when the AGV onboard system does not malfunction, the updated data set is retrieved again. That is, when data recording is not required, the updated data set is retrieved again, and the process returns to S100 to cache the new data set again. This cyclical caching of data recordings helps in troubleshooting system anomalies, understanding the system's operating status and patterns, and analyzing changes in the external environment detected by the onboard sensors, thereby enabling the implementation of relevant improvement measures.

[0090] In practical work, to troubleshoot problems in vehicle systems, in addition to analyzing Class A data within the most recent period or mileage since the anomaly occurred, it is also necessary to analyze Class A data from even earlier periods. Therefore, to expand the caching depth of Class A data, this invention does not simply meet the requirement by increasing the recording duration or mileage of Class A data, but instead uses a sparse data approach to achieve this function.

[0091] In some embodiments of the present invention, in S200, when it is known that the data type of the data group belongs to class A data and the data group has not yet been cached, configuring the corresponding position index, the corresponding cache depth threshold, and the corresponding counter for the data group further includes:

[0092] S230, when it is known that the data group belongs to class A data and the data group has not been cached, the corresponding dilution period interval and the corresponding dilution mark amount are also configured for the data group.

[0093] In this embodiment, updated data groups in the AGV onboard system are obtained. When the updated data group is of type A data, the first data caching API function is called. It is determined whether the data group belonging to type A data has been cached. If the data group has not been cached, the corresponding dilution period interval and the corresponding dilution mark amount are configured for the data group.

[0094] S231, determine whether the data group needs to be diluted by the dilution mark amount. If so, extract a data record from the data group according to the dilution period interval, store the data record in the set dilution data group, and cache the set dilution data group in the set data_group container.

[0095] In this embodiment, based on the configured dilution marker amount, it is determined whether the data group is of type A and whether the data group needs to be diluted. When the data group belonging to type A needs to be diluted, a data record is extracted from the data group belonging to type A according to the configured dilution period interval. This data record is stored in the data group whose name contains the character "dilution", that is, stored in the set dilution data group. The set dilution data group is then cached in the corresponding position in the set data_group container.

[0096] For example, a normal cache cycle is 50ms, with a cache distance of 25 meters. You can set the data dilution cycle to cache every 500ms, with a cache distance of 500 meters. After this dilution, if 20 data records were originally cached per second, only 2 need to be cached now; if 500 data records were originally cached when the AGV travels 25 meters, only 50 data records need to be cached now; for data groups of the same depth, the diluted data group can cache an additional 450 data records, meaning it can cache data over a distance of 225 meters, while the non-diluted data group gradually removes previously cached data. In comparison, the diluted array has its advantages.

[0097] By using the above method, the A-type data cached in each period is diluted and additionally cached, which increases the time span and mileage span of the data in the diluted data group, making it easier to trace data records from earlier times.

[0098] In some embodiments of the present invention, for data of type A:

[0099] Retrieve the updated data group from the AGV onboard system. When the updated data group is of type A, call the first data cache API function.

[0100] Determine if the data group for the updated Class A data has already been cached. If not, configure the data group with the corresponding group name, position index, cache depth threshold, counter, dilution interval, and dilution tag amount. Then, save the configured group name to the designated `dataname_group` container.

[0101] The need for dilution of a data set is determined by the dilution marker amount. When a data set needs to be diluted, a data record is extracted from the data set according to the dilution period interval, and the data record is stored in the designated dilution data set.

[0102] The set dilution data group is cached in the set data_group container;

[0103] Based on the location index corresponding to the data group, each data record in the data group is encapsulated according to the set data format, and the encapsulated data group is cached in the set data_group container;

[0104] When the cache depth of a data group has not reached the cache depth threshold, increment the counter by 1;

[0105] When data records need to be saved, all cached data records in the designated data_group container are written to the designated file.

[0106] In this embodiment, for data of type A, the first data caching API function is called. The name of the first data caching API function is CacheDataA. The parameter list of the first data caching API function includes: group name, data caching period, data caching mileage, dilution caching mileage, caching factor, and all data items that are to be recorded.

[0107] If the corresponding data group name does not exist in the configured `dataname_group` container, it is assumed that the updated data group has not yet been cached. Therefore, a space is allocated in the configured `dataname_group` container to configure the group name for the data group. The configured group name is stored in this container, and a corresponding position index, cache depth threshold, and counter are configured for the data group. The position index is unique.

[0108] Based on the configured dilution flag, determine whether a data group is of type A and whether it needs to be diluted. When a data group belonging to type A needs to be diluted, extract one data record from the data group belonging to type A according to the configured dilution period interval, store this data record in the data group whose name contains the character "dilution", and cache it in the corresponding position in the set data_group container.

[0109] Obtain the location index of the data group belonging to class A. Encapsulate each data record in the data group according to the defined data format, and save the encapsulated data group. Since the location index used in the defined `data_group` container and the defined `dataname_group` container is consistent, obtain the location index of the data group belonging to class A. Based on the obtained location index, cache the encapsulated data group in the corresponding location of the `data_group` container.

[0110] After storing the data group, confirm the cache depth of the data group and compare it with the set cache depth threshold. When the cache depth is not equal to the set cache depth threshold, that is, the capacity of the data group is not full and the next data record can be stored, then increment the counter by 1 to record the number of data records cached in the data group at this time.

[0111] Determine whether data records need to be saved, i.e., whether a data record or fault record will be generated. If data records need to be saved, i.e., when a data record is generated due to a trigger or fault, write all cached data in the designated data_group container to the designated file.

[0112] In some embodiments of the present invention, for type B data:

[0113] Retrieve the updated data group from the AGV onboard system. When the updated data group is of type B, call the second data cache API function.

[0114] Determine if the updated data group has already been cached. If not, configure the corresponding group name, position index, cache depth threshold, and counter for the data group. Save the configured group name to the designated `dataname_group` container.

[0115] Based on the location index corresponding to the data group, each data record in the data group is encapsulated according to the set data format, and the encapsulated data group is cached in the set data_group container;

[0116] When the cache depth of a data group has not reached the cache depth threshold, increment the counter by 1;

[0117] When data records need to be saved, all cached data records in the designated data_group container are written to the designated file.

[0118] In this embodiment, the updated data group in the vehicle system is obtained. When the updated data group belongs to type B data, the second data cache API function suitable for type B data is called.

[0119] If the corresponding data group name does not exist in the configured `dataname_group` container, it is assumed that the updated data group has not yet been cached. Therefore, a space is allocated in the configured `dataname_group` container to configure the group name for the data group. The configured group name is stored in this container, and a corresponding position index, cache depth threshold, and counter are configured for the data group. The position index is unique.

[0120] Obtain the location index of the data group belonging to data type B. Encapsulate each data record in the data group according to the defined data format, and save the encapsulated data group. Since the location index used in the defined `data_group` container and the defined `dataname_group` container is consistent, obtain the location index of the data group belonging to data type B. Based on the obtained location index, cache the encapsulated data group in the corresponding location within the defined `data_group` container.

[0121] After storing the data group, confirm the cache depth of the data group and compare it with the set cache depth threshold. When the cache depth is not equal to the set cache depth threshold, that is, the capacity of the data group is not full and the next data record can be stored, then increment the counter by 1 to record the number of data records cached in the data group at this time.

[0122] Determine whether data records need to be saved, i.e., whether a data record or fault record will be generated. If data records need to be saved, i.e., when a data record is generated due to a trigger or fault, write all cached data in the designated data_group container to the designated file.

[0123] For updated data sets, based on the data type and location index, the data sets are cached in the AGV onboard system's memory according to a specific data format. When data records need to be saved, the cached data is written to a designated file, forming easily viewable data records. Compared to existing methods of recording data using embedded databases, this invention significantly reduces the difficulty of data retrieval; compared to the more casual method of recording data to text files, it greatly improves data readability and the convenience of data analysis.

[0124] According to an embodiment of a second aspect of the present invention, an electronic device includes: a memory for storing a program; and a processor for executing the program stored in the memory, wherein when the processor executes the program stored in the memory, the processor is configured to execute a data caching method for an AGV on-board system according to the first aspect.

[0125] The processor and memory can be connected via a bus or other means.

[0126] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs, such as the data caching method for an AGV on-board system described in the embodiments of the present invention. The processor implements a data caching method for an AGV on-board system according to the first aspect of the present invention by running the non-transitory software program and instructions stored in the memory.

[0127] The memory may include a program storage area and a data storage area. The program storage area may store the operating system and application programs required for at least one function. The data storage area may store the data caching method described above for the AGV onboard system. Furthermore, the memory may include high-speed random access memory and non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0128] The non-transient software program and instructions required to implement the above-described terminal selection method are stored in memory. When executed by one or more processors, they perform a data caching method for an AGV on-board system according to the first aspect of the present invention.

[0129] According to an embodiment of a third aspect of the present invention, the present invention also provides a storage medium storing computer-executable instructions for executing a data caching method for an AGV on-board system according to the first aspect.

[0130] Those skilled in the art will understand that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically include computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

[0131] The preferred embodiments of the present invention have been described in detail above, but the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention, and these equivalent modifications or substitutions are all included within the scope defined by the claims of this application.

Claims

1. A data caching method for an AGV onboard system, characterized in that, Applications in AGV on-board systems include: Get the updated data group, and call the corresponding data caching API function according to the data group's data type; Determine whether the data group has been cached. If not, initialize the relevant variables of the data group, and configure the corresponding position index, cache depth threshold and counter for the data group. The counter is used to record the number of cached entries in the data group. Based on the location index, each data record in the data group is encapsulated according to the set data format, and the encapsulated data group is cached in the set data_group container; Determine whether the cache depth of the data group has reached the cache depth threshold; if not, increment the counter by 1. Determine whether data records need to be saved. If so, write the cached data in the set data_group container to the set file. Each data group consists of several data records, and each data record consists of several data items. The data is encapsulated according to the set data format, with each data item separated by a tab character, and each data record and each data group separated by a newline character. Each data record is appended with the corresponding parameter name of the data record at the beginning. When the data group is of type A and is not cached, configuring the corresponding location index, cache depth threshold, and counter for the data group also includes: The data set is also configured with corresponding dilution period intervals and dilution marker amounts; The dilution marker is used to determine whether the data group needs to be diluted. If so, a data record is extracted from the data group according to the dilution period interval and stored in the set dilution data group. The set dilution data group is then cached in the set data_group container. The step of obtaining the updated data group, and calling the corresponding data caching API function according to the data group's data type, further includes: Based on the frequency and cycle of data recording, the data is divided into Class A data and Class B data; Get the updated data group. If the data type of the data group is the A-type data, then call the first data cache API function. Get the updated data group. If the data type of the data group is the B type data, then call the second data cache API function. If not, configuring the corresponding location index, cache depth threshold, and counter for the data group further includes: Determine whether the data group has been cached; if not, configure the corresponding group name for the data group. Save the group name of the data group to the set dataname_group container.

2. The data caching method for an AGV on-board system according to claim 1, characterized in that, The step of determining whether the data group has been cached also includes: If the data group is cached, then obtain the location index corresponding to the data group.

3. A data caching method for an AGV onboard system according to claim 1, characterized in that, The step of determining whether the cache depth of the data group has reached the cache depth threshold also includes: When the cache depth of the data group reaches the cache depth threshold, the first data record in the data group in the set data_group container is cleared.

4. A data caching method for an AGV onboard system according to claim 1, characterized in that, The process of writing the cached data in the designated data_group container to the designated file specifically includes: Create a write file and set the filename and file path for the write file; Based on the filename and file path, the cached data in the set data_group container is written to the write file.

5. A data caching method for an AGV onboard system according to claim 1, characterized in that, The determination of whether data records need to be saved also includes: When the data records no longer need to be saved, the updated data set is retrieved again.

6. An electronic device, characterized in that, include: Memory, used to store programs; A processor is configured to execute a program stored in the memory, wherein when the processor executes the program stored in the memory, the processor is configured to perform a data caching method for an AGV on-board system as described in any one of claims 1 to 5.

7. A storage medium, characterized in that, include: The system stores computer-executable instructions for performing a data caching method for an AGV onboard system as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Disconnection data buffering method and device and electronic equipment

    CN112988070A

  • Wind turbine generator vibration data processing system and data dilution method

    CN114323642A

  • File receiving method and device, storage medium and terminal

    CN114721830A