Data dictionary processing method of optical storage system and computer program product

By configuring data dictionary files in multiple preset formats on the data server of the optical storage system, the problem of independent maintenance of the client in the optical storage system is solved, information consistency and efficient data management are achieved, and the system flexibility is improved. and response speed.

CN118939338AInactive Publication Date: 2024-11-12HAIER ENERGY TECHNOLOGY CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410983461.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-11-12
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the existing optical storage system, each client independently maintains the data dictionary library, resulting in difficulty in unified management and low information consistency and efficiency.

Method used

By configuring data dictionary files in multiple preset formats on the data server, the middleware constructs the target file path after receiving client requests, loads the corresponding data dictionary files one by one, and adjusts the file format and quantity according to the loading history to ensure multiple customers Obtain consistent information on the side, reduce maintenance burden, and improve flexibility and efficiency.

Benefits of technology

It realizes the consistency of information requests from multiple clients to the same dictionary directory, reduces the maintenance burden of each client, improves the flexibility of using data dictionaries and request efficiency, and improves the response compared to frequently requesting information from cloud databases. Speed ​​and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939338A_ABST
    Figure CN118939338A_ABST
Patent Text Reader

Abstract

The invention provides a data dictionary processing method of an optical storage system and a computer program product. The optical storage system comprises a data server, and a dictionary directory of the data server is configured to store data dictionary files in various preset formats. The data dictionary processing method comprises the following steps: receiving a data dictionary request from a client; constructing a plurality of target file paths according to the data dictionary request and the address of the dictionary directory, wherein each target file path corresponds to a preset format of one data dictionary file; trying to load the corresponding data dictionary files in the dictionary directory one by one according to the target file path; and if the data dictionary file is successfully loaded, returning the data dictionary file to the client. The clients can initiate requests to the same dictionary directory through the middleware, so that the consistency of the target information obtained by the plurality of clients is ensured. And each client does not need to independently maintain the dictionary database, so that unified management is facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of photovoltaic storage system construction, and in particular to a data dictionary processing method and a computer program product of a photovoltaic storage system. Background Art

[0002] As people's awareness of environmental protection increases, vigorously developing clean and renewable energy has become a global consensus. Photovoltaic storage technology is one of the technical solutions generated based on this background. Photovoltaic storage technology is mainly realized by using two core parts: photovoltaic equipment and energy storage equipment. Photovoltaic equipment is used to convert solar energy into electrical energy, while energy storage equipment is responsible for storing electrical energy for use by users. With the continuous promotion of photovoltaic storage technology and the development of technologies such as the Internet of Things, more and more household photovoltaic storage systems are beginning to appear.

[0003] The overall architecture of a home solar energy storage system usually establishes connections between various facilities and equipment such as energy storage equipment, household electrical appliances, and intelligent client devices, and configures a data dictionary library mapped from the information of various facilities and equipment, so that the client device can obtain various information related to the solar energy storage system through the data dictionary. However, since the current solar energy storage services are run on different clients and maintain independent data dictionary libraries, it is not convenient for unified management. Summary of the invention

[0004] An object of the present invention is to provide a data dictionary processing method and a computer program product for an optical storage system that can solve any of the above problems.

[0005] In particular, the present invention provides a data dictionary processing method for an optical storage system, the optical storage system comprising a data service end, a dictionary directory of the data service end being configured to store data dictionary files of a plurality of preset formats;

[0006] Wherein, the data dictionary processing method includes:

[0007] Receive data dictionary requests from clients;

[0008] Constructing a plurality of target file paths according to the data dictionary request and the address of the dictionary directory, each of the target file paths corresponding to a preset format of the data dictionary file;

[0009] Try to load the corresponding data dictionary files in the dictionary directory one by one according to the target file path;

[0010] If the loading is successful, the data dictionary file is returned to the client.

[0011] Optionally, the step of constructing multiple target file paths according to the data dictionary request and the address of the dictionary directory includes:

[0012] Check whether the data dictionary request has a logical name field and a file name field that meet preset requirements, wherein the file name field is the name of the data dictionary file requested by the data dictionary request, and the logical name field is the address of the data dictionary file in the dictionary directory;

[0013] If so, using the logical name field and the file name field to generate a relative path of the data dictionary file in the dictionary directory;

[0014] Converting the relative path into a complete path of the data dictionary file according to the address of the dictionary directory to obtain the target file path;

[0015] If not, output the first error prompt message.

[0016] Optionally, in the step of attempting to load corresponding data dictionary files in the dictionary directory one by one according to the target file path,

[0017] If all target file paths are not loaded into the corresponding data dictionary file, the second error prompt message is output;

[0018] If it is detected that loading of the corresponding data dictionary file is prohibited, a third error prompt message is output.

[0019] Optionally, the data dictionary processing method further includes:

[0020] Detecting the occurrence of the second error prompt information, recording historical information of the second error prompt information, where the historical information includes the occurrence time of the second error prompt information;

[0021] Check whether the time interval between this second error prompt message and the last second error prompt message is less than the preset time. If so, the preset counter counts up by one, and the preset counter is used to record the number of occurrences of the second error prompt message. If not, the count value of the preset counter is updated to 1.

[0022] When it is detected that the count value of the preset counter reaches a set threshold, update prompt information of the dictionary directory is output.

[0023] Optionally, the historical information also includes the file name of the data dictionary file that was not found, and the total number of second error prompt messages caused by the same data dictionary file;

[0024] The data dictionary processing method also includes:

[0025] When it is detected that the total number of second error prompt messages caused by the same data dictionary file reaches a preset value, an update prompt message of the dictionary directory is output.

[0026] Optionally, the step of receiving a data dictionary request from a client includes:

[0027] Detect whether the data dictionary request comes from a preset whitelist, if so, process the data dictionary request, if not, reject the data dictionary request.

[0028] Optionally, the step of attempting to load corresponding data dictionary files in the dictionary directory one by one according to the target file path includes: loading data dictionary files in a fixed order of preset formats, recording the preset format loaded first as the first format, and recording the preset format loaded last as the last format;

[0029] The data dictionary processing method also includes:

[0030] Recording the loading history of all data dictionary files in the dictionary directory;

[0031] The number of the data dictionary files in the first format and the last format in the dictionary directory is adjusted according to the loading history record.

[0032] Optionally, the step of adjusting the number of data dictionary files of each preset format in the dictionary directory according to the loading history records includes:

[0033] It is detected that the number of reads of the data dictionary file in the first format within a preset time is less than a preset number;

[0034] The format of the data dictionary file is converted into the final format.

[0035] Optionally, the step of adjusting the number of data dictionary files of each preset format in the dictionary directory according to the loading history records includes:

[0036] It is detected that the number of times the data dictionary file of the last-digit format is read within a set time exceeds a set number;

[0037] The format of the data dictionary file is converted to the first-order format.

[0038] Optionally, the data dictionary processing method further includes:

[0039] Record the loading time used for each successful loading of the data dictionary file;

[0040] It is detected that the sum of the loading durations within a preset time period exceeds a preset threshold and the number of data dictionary files of the first format loaded within the preset time period is less than a preset value;

[0041] Converting a preset number of data dictionary files in the first-digit format into the last-digit format;

[0042] The data dictionary file that has been loaded a number of times greater than a preset value within the preset time period is converted into the first-order format.

[0043] In another aspect, the present application also provides a computer program product, comprising:

[0044] A computer executable program, which, when executed by a processor, implements the data dictionary processing method for an optical storage system according to any one of the above items.

[0045] The data dictionary processing method and computer program product of the optical storage system of the present invention configure the dictionary directory of the data service end to store data dictionary files of multiple preset formats. After the middleware receives the data dictionary request from the client, multiple target file paths are constructed according to the data dictionary request and the address of the dictionary directory. Each target file path corresponds to a preset format of the data dictionary file. The corresponding data dictionary files are tried to be loaded in the dictionary directory one by one according to the target file path. If the loading is successful, the data dictionary file is returned to the client. On the one hand, multiple clients can initiate requests to the same dictionary directory via the middleware, ensuring the consistency of target information obtained by multiple clients. And each client no longer needs to maintain a dictionary library separately, which is convenient for unified management. On the other hand, data dictionary files of different preset formats are loaded through multiple target file paths, that is, as long as the data dictionary file is one of the preset formats, it can be loaded successfully, so that developers can use files of different preset formats to maintain and update the contents of the dictionary directory according to their own habits, which improves the flexibility of use. In addition, because the data dictionary of the optical storage system changes less frequently, setting a static dictionary directory can also ensure the accuracy of the data to a certain extent. Compared with frequently requesting information from the cloud database dictionary, this solution can improve the efficiency of requests and responses.

[0046] Based on the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will become more aware of the above and other objects, advantages and features of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Hereinafter, some specific embodiments of the present invention will be described in detail in an exemplary and non-limiting manner with reference to the accompanying drawings. The same reference numerals in the accompanying drawings indicate the same or similar components or parts. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the accompanying drawings:

[0048] Figure 1 is a schematic block diagram of a photovoltaic storage system according to an embodiment of the present invention;

[0049] Figure 2is a schematic flow chart of a data dictionary processing method of an optical storage system according to an embodiment of the present invention;

[0050] Figure 3 is a schematic flow chart of a step of constructing a target file path in a data dictionary processing method for an optical storage system according to an embodiment of the present invention;

[0051] Figure 4 is a schematic flow chart of a data dictionary processing method of an optical storage system according to another embodiment of the present invention;

[0052] Figure 5 is a schematic flow chart of a data dictionary processing method of an optical storage system according to yet another embodiment of the present invention;

[0053] Figure 6 is a schematic flow chart of a data dictionary processing method of an optical storage system according to yet another embodiment of the present invention;

[0054] Figure 7 is a schematic flow chart of a data dictionary processing method of an optical storage system according to yet another embodiment of the present invention;

[0055] Figure 8 is a schematic flow chart of a step of adjusting a data dictionary file format in a data dictionary processing method for an optical storage system according to an embodiment of the present invention;

[0056] Fig. 9 is a schematic flow chart of a step of adjusting a data dictionary file format in a data dictionary processing method for an optical storage system according to another embodiment of the present invention;

[0057] Fig.10 is a schematic flow chart of a data dictionary processing method of an optical storage system according to yet another embodiment of the present invention;

[0058] Fig.11 is a schematic block diagram of a computer program product according to an embodiment of the present invention. DETAILED DESCRIPTION

[0059] It should be understood by those skilled in the art that the embodiments described below are only some embodiments of the present invention, rather than all embodiments of the present invention, and these embodiments are intended to explain the technical principles of the present invention, rather than to limit the protection scope of the present invention. Based on the embodiments provided by the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should still fall within the protection scope of the present invention.

[0060] like Figure 1As shown, in one embodiment, the optical storage system 100 includes a data service end 110 and multiple clients 120. The data service end 110 is configured with a dictionary directory 111 and a middleware 112, and the middleware 112 is connected to the multiple clients 120. The dictionary directory 111 is a static dictionary library. The middleware 112 can receive a data dictionary request from the client 120, and respond to the data dictionary request of the client 120 by searching the corresponding data dictionary file in the dictionary directory 111.

[0061] The client 120 may be a mobile device, such as a smart device such as a mobile phone or a tablet, or a desktop computer, or other smart devices, such as a power distribution management device, a smart home appliance, and the like.

[0062] In addition, the dictionary directory 111 is a storage space for storing data dictionary files. In simple terms, the form of external display is a folder. The dictionary directory 111 is configured to store data dictionary files in multiple preset formats, that is, data dictionary files can be stored in the dictionary directory 111 in multiple preset formats.

[0063] Exemplarily, the preset formats include JS (JavaScript) format and JSON (JavaScript Object Notation) format. Files in JS format and JSON format are commonly used operation formats for developers, so JS format and JSON format are convenient for developers to operate and maintain, and the two formats are easy to convert.

[0064] like Figure 2 As shown, in one embodiment, the data dictionary processing method generally includes:

[0065] Step S201: Receive a data dictionary request from a client. Figure 1 As shown, specifically, the middleware 112 receives a request from the client 120 for a data dictionary file, for example, a data dictionary mapping energy storage device information, or a data dictionary mapping house information, and so on.

[0066] Step S202, construct multiple target file paths according to the data dictionary request and the address of the dictionary directory, each target file path corresponds to a preset format of a data dictionary file. Specifically, if there are several data dictionary files of preset formats stored in the dictionary directory, the same number of target file paths are constructed, and one target file path is used to load a data dictionary file of preset format.

[0067] Exemplarily, the preset formats in the dictionary directory are JS format and JSON format. Then two target file paths are constructed, one for loading the data dictionary file in JS format and the other for loading the data dictionary file in JSON format.

[0068] Reference Figure 3 As shown, this step specifically includes:

[0069] Step S301, check whether the data dictionary request has a logical name field and a file name field that meet the preset requirements, if yes, execute step S302, if no, execute step S304. The file name field is the name of the data dictionary file requested by the data dictionary request, and the logical name field is the address of the data dictionary file in the dictionary directory.

[0070] Specifically, the middleware communicates with the client through the HTTPS protocol (Hypertext Transfer Protocol Secure). The client's data dictionary request is in the form of a URL (Uniform Resource Locator), which is a URL. The logical name field and the file name field are recorded in the URL request. Exemplarily, the logical name field is identified by "logic" and the file name field is identified by "name", then the URL request has "logic=example&name=default", "example" is the logical name field, and "default" is the file name field.

[0071] Step S302, using the logical name field and the file name field to generate a relative path of the data dictionary file in the dictionary directory.

[0072] Exemplarily, the preset formats in the dictionary directory are JS format and JSON format. The folder name of the dictionary directory is "data", the logical name field is "example", and the file name field is "default", then two relative paths are generated, one relative path is ".. / data / example / default.js", and the other relative path is ".. / data / example / default.json", and ".. / " represents the parent directory of data.

[0073] Step S303, converting the relative path into a complete path of the data dictionary file according to the address of the dictionary directory to obtain the target file path. Specifically, after obtaining the relative path, the address path of the dictionary directory is used to convert the relative path to obtain the complete path of the data dictionary file. Thus, a complete path corresponding to each preset format can be obtained.

[0074] Combined with the above, for example, the “.. / ” before “data” is completed. The address of the dictionary directory has been deployed when configuring the data server, and can be directly read.

[0075] Step S304: outputting a first error prompt message. Specifically, when the data dictionary request does not have a logical name field or a file name field that meets the requirements, the first error prompt message is output to prompt that the data dictionary request lacks necessary parameters.

[0076] Exemplarily, the first error prompt information may be outputting an error status code, such as a set error code "400", and / or outputting a text message prompt, such as "missing required query parameters".

[0077] Step S203, try to load the corresponding data dictionary files in the dictionary directory one by one according to the target file path. After constructing the target file path corresponding to each preset format, the data dictionary files can be loaded one by one according to the target file path.

[0078] Step S204, if the loading is successful, the data dictionary file is returned to the client. Specifically, after the data dictionary file is successfully loaded according to a certain target file path, the loaded data dictionary file can be returned to the client. Even if there is a target file path that has not been used, it will no longer be used, that is, the client's data dictionary request is completed.

[0079] In the scheme of this embodiment, by configuring the dictionary directory of the data server to store data dictionary files in multiple preset formats, after the middleware receives a data dictionary request from the client, multiple target file paths are constructed according to the data dictionary request and the address of the dictionary directory, each target file path corresponds to a preset format of the data dictionary file, and the corresponding data dictionary files are attempted to be loaded in the dictionary directory one by one according to the target file path. If the loading is successful, the data dictionary file is returned to the client.

[0080] On the one hand, multiple clients can initiate requests to the same dictionary directory through the middleware, ensuring the consistency of target information obtained by multiple clients. And each client no longer needs to maintain a dictionary library separately, which facilitates unified management. On the other hand, data dictionary files of different preset formats are loaded through multiple target file paths. In other words, as long as the data dictionary file is in one of the preset formats, it can be loaded successfully, so that developers can use files of different preset formats according to their own habits to maintain and update the contents of the dictionary directory, which improves the flexibility of use. In addition, because the data dictionary of the optical storage system changes less frequently, setting a static dictionary directory can also ensure the accuracy of the data to a certain extent. Compared with frequently requesting information from the cloud database dictionary, this solution can improve the efficiency of requests and responses.

[0081] In addition, by configuring the logical name field and file name field in the data dictionary request, and using the logical name field and file name field to build the target file path, that is, classifying and storing the data dictionary files in the dictionary directory, it helps to reduce the search scope when loading the target file path, thereby helping to improve loading efficiency.

[0082] like Figure 4 As shown, in one embodiment, in the step of trying to load the corresponding data dictionary file in the dictionary directory one by one according to the target file path, if all target file paths are not loaded into the corresponding data dictionary file, a second error prompt message is output; if it is detected that loading of the corresponding data dictionary file is prohibited, a third error prompt message is output.

[0083] Specifically, the data dictionary processing method generally includes:

[0084] Step S401 , attempting to load corresponding data dictionary files in the dictionary directory one by one according to the target file path.

[0085] Step S402, whether it is detected that the corresponding data dictionary file is prohibited from loading, if so, execute step S403, if not, execute step S404. Specifically, in some cases, the data dictionary file may not be loaded, such as no permission, server failure, etc. This step is to check whether there is a situation where the data dictionary file cannot be loaded.

[0086] Step S403, outputting a third error prompt message. Specifically, that is, when the corresponding data dictionary file is prohibited from loading, the third error prompt message is output. Exemplarily, the third error prompt message may be outputting an error status code, such as the set error code "500", and / or outputting a text message prompt, such as "Server internal error".

[0087] Furthermore, when outputting a text message prompt, it may be provided with a preset format of an error. For example, the preset formats in the dictionary directory are JS format and JSON format, and the text message prompt may be, for example, "Server internal error JS" or "Server internal error JSON".

[0088] Step S404, whether the data dictionary file is successfully loaded, if yes, execute step S405, if no, execute step S406. Specifically, when trying to load the corresponding data dictionary file in the dictionary directory using each target file path, detect whether the data dictionary file is successfully loaded.

[0089] Step S405, returning the data dictionary file to the client. After the data dictionary file is successfully loaded, the loaded data dictionary file can be returned to the client, and the current request work is ended.

[0090] Step S406, whether all target file paths have been loaded, if yes, execute step S407, if no, continue to use the next target file path, or continue to execute step S401. Specifically, whether all constructed target file paths have been used.

[0091] Step S407, output the second error prompt information. Specifically, that is, when the target file paths are loaded and the corresponding data dictionary files are not recorded, the second error prompt information is output. Exemplarily, the third error prompt information can be outputting an error status code, such as the set error code "404", and / or outputting a text message prompt, such as "failed to read the file content, the file resource does not exist".

[0092] In the scheme of this embodiment, in the step of trying to load the corresponding data dictionary file in the dictionary directory according to the target file path one by one, if all the target file paths are not loaded into the corresponding data dictionary file, a second error prompt message is output; if it is detected that loading of the corresponding data dictionary file is prohibited, a third error prompt message is output, that is, corresponding error prompt messages are output according to various errors that may occur in the process of loading the data dictionary file, thereby returning clear error messages, so that the client can promptly identify the problem and improve the user experience.

[0093] like Figure 5 As shown, in one embodiment, the step of receiving a data dictionary request from a client includes: detecting whether the data dictionary request comes from a preset whitelist, if so, processing the data dictionary request, if not, rejecting the data dictionary request.

[0094] Specifically, the data dictionary processing method generally includes:

[0095] Step S501, detect whether the data dictionary request comes from a preset whitelist, if yes, execute step S502, if no, execute step S503. Specifically, the middleware pre-configures a whitelist, and after receiving the data dictionary request from the client, detects whether it comes from a client in the whitelist.

[0096] Step S502, processing the data dictionary request. Specifically, if the data dictionary request comes from a preset whitelist, the subsequent steps of constructing a target file path and loading a data dictionary file are executed.

[0097] Step S503: reject the data dictionary request. Specifically, if the data dictionary request is not from a client in the preset whitelist, the data dictionary request is rejected, and the data dictionary request is not processed or responded to.

[0098] In the scheme of this embodiment, by detecting whether the data dictionary request comes from a preset whitelist, if all target file paths are not loaded into the corresponding data dictionary file, the data dictionary request is processed when the data dictionary request comes from the preset whitelist, thereby improving system security.

[0099] like Figure 6 As shown, in one embodiment, the data dictionary processing method generally includes:

[0100] Step S601, detecting the occurrence of a second error prompt message, recording the history information of the second error prompt message, the history information including the occurrence time of the second error prompt message, that is, after outputting the second error prompt message, the middleware records the time when the second error prompt message is output this time.

[0101] Step S602, check whether the time interval between the second error prompt information of this time and the second error prompt information of the last time is less than the preset time, if so, execute step S604, if not, execute step S603. Because the time of occurrence of each second error prompt information is recorded, after the second error prompt information appears once, the time interval between the second error prompt information of this time and the second error prompt information of the last time can be calculated, and the time interval can be compared with the preset time value.

[0102] Step S603, update the count value of the preset counter to 1. The preset counter is used to record the number of occurrences of the second error prompt information, that is, if the time interval between the second error prompt information this time and the last second error prompt information is greater than or equal to the preset time, the count value of the preset counter is updated to 1, in other words, start counting again.

[0103] Step S604: the preset counter counts up by 1. If the time interval between the second error prompt information this time and the second error prompt information last time is less than the preset time, the preset counter counts up by 1.

[0104] Step S605: Detect that the count value of the preset counter reaches the set threshold, and output the update prompt information of the dictionary directory. If the count value of the preset counter reaches the set threshold, it means that the second error prompt information appears frequently and the dictionary directory needs to be updated, so the update prompt information is output to prompt the administrator to update the dictionary directory.

[0105] In the scheme of the present embodiment, by recording the time of occurrence of the second error prompt information when the occurrence of the second error prompt information is detected, and when the time interval between the current second error prompt information and the previous second error prompt information is less than the preset time, the preset counter used to record the number of occurrences of the second error prompt information is increased by one, and after detecting that the count value of the preset counter reaches the set threshold, the update prompt information of the dictionary directory is output, so that when the frequency of occurrence of the second error prompt information is high, the management personnel can be reminded in time to update the dictionary directory to ensure the normal use of the optical storage system.

[0106] In addition, the historical information may also include the file name of the data dictionary file that was not found, and the total number of second error prompt messages caused by the same data dictionary file. When it is detected that the total number of second error prompt messages caused by the same data dictionary file reaches a preset value, the update prompt message of the dictionary directory is output. Thus, when a data dictionary file is frequently used but the dictionary directory does not have it, the dictionary directory is updated in time to adapt to the usage habits of the client.

[0107] In addition, a statistical information table can be pre-configured. After recording the historical information of the second error prompt information, the historical information of the second error prompt information can be updated to the statistical information table for regular inspection by managers, so that managers can decide whether to update the dictionary directory as needed, thereby improving flexibility of use.

[0108] like Figure 7 As shown, in one embodiment, the step of trying to load the corresponding data dictionary files in the dictionary directory one by one according to the target file path includes: loading the data dictionary files in a fixed order of preset formats, recording the preset format loaded first as the first format, and recording the preset format loaded last as the last format. Exemplarily, the preset formats in the dictionary directory are JS format and JSON format. Two target file paths are constructed during loading, one for searching for JS format files and the other for searching for JSON format files. Each time a data dictionary request is processed, the JS format file is first tried to be loaded, and if it is not found, the JSON format file is searched. The first format is the JS format, and the last format is the JSON format.

[0109] Reference Figure 7 Specifically, the data dictionary processing method generally includes:

[0110] Step S701, record the loading history of all data dictionary files in the dictionary directory. Specifically, the loading history includes the formatted file names of the loaded data dictionary files.

[0111] Step S702, adjusting the number of the data dictionary files in the first format and the last format in the dictionary directory according to the loading history records.

[0112] Reference Figure 8 As shown, in one embodiment, this step generally includes:

[0113] Step S801: It is detected that the number of reads of a data dictionary file in a first format within a preset time is less than a preset number, that is, it is detected that the reading frequency of a data dictionary file in a first format is low.

[0114] Step S802, convert the format of the data dictionary file into the last format. Convert the first format data dictionary file that has been read less than the preset number of times within the preset time into the last format. In this way, the data dictionary file with a higher frequency of use can be loaded faster during the first loading, thereby improving the loading efficiency.

[0115] Reference Fig. 9 As shown, in one embodiment, this step generally includes:

[0116] Step S901: It is detected that the number of times a data dictionary file of the last format is read within a set time exceeds a set number. Specifically, it is detected that the reading frequency of a data dictionary file of the last format is high.

[0117] Step S902, converting the format of the data dictionary file to the first format. Converting the last format data dictionary file that has been read more than the set number of times within the set time to the first format, so that the data dictionary file with a higher frequency of use can be loaded faster, improving the overall loading efficiency.

[0118] Specifically, by flexibly converting the data dictionary file in the first format and the last format according to the loading history, it helps to make the data dictionary files with higher usage frequency be loaded first and the data dictionary files with lower usage frequency be loaded last, thereby improving the overall loading efficiency.

[0119] like Fig.10 As shown, in one embodiment, the data dictionary processing method generally includes:

[0120] Step S1001, recording the loading time taken for each successful loading of the data dictionary file. Specifically, after each successful loading of the data dictionary file, the total time from receiving the request to returning the result is recorded.

[0121] Step S1002, it is detected that the sum of the loading time in the preset time period exceeds the preset threshold and the number of data dictionary files in the first format loaded in the preset time period is less than the preset value. Specifically, that is, the sum of the loading time is checked regularly. For example, the preset time period can be a week, then the sum of the loading time in a week and the number of data dictionary files in the first format loaded can be checked every other day, or the sum of the loading time in a week and the number of data dictionary files in the first format loaded can be checked every three days, etc. When it is detected that the sum of the loading time in the preset time period exceeds the preset threshold and the number of data dictionary files in the first format loaded in the preset time period is less than the preset value, it means that the loading of the first format has consumed too much unnecessary time.

[0122] Step S1003, converting a preset number of first-order format data dictionary files into last-order formats. For example, 30% of the first-order format data dictionary files that are loaded the least times in a preset time period may be converted into last-order formats, that is, the first-order format data dictionary files are sorted according to the number of times they are loaded in a preset time period, and the last 30% of the first-order format data dictionary files are converted into last-order formats.

[0123] Step S1004, converting the data dictionary files loaded more times than a preset value in the preset time period into the first format, that is, converting some data dictionary files loaded more times in the preset time period into the first format.

[0124] In the scheme of the present embodiment, by recording the loading time taken for each successful loading of the data dictionary file, when it is detected that the total loading time within the preset time period exceeds the preset threshold and the number of data dictionary files in the first format loaded within the preset time period is less than the preset value, the preset number of data dictionary files in the first format are converted to the last format, and the data dictionary files that have been loaded more than a set number of times within the preset time period are converted to the first format. In this way, when the loading of the first format consumes too much unnecessary time, the format structure of the data dictionary file is adjusted, so that the data dictionary files with a higher loading frequency within the preset time period are converted to the first format, and some data dictionary files in the first format with a lower loading frequency within the preset time period are converted to the last format, thereby improving the overall loading efficiency.

[0125] This embodiment also provides a computer program product. Fig.11 1 is a schematic diagram of a computer program product 10 according to an embodiment of the present invention. The computer program product 10 includes a computer executable program 11, and when the computer executable program 11 is executed by the processor 20, any of the above-mentioned methods for processing database historical data can be implemented.

[0126] Specifically, the computer executable program 11 for performing the operations of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, computer instructions, computer-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages.

[0127] The processor 20 may be a single-core processor, a multi-core processor, a computing cluster, or any number of other configurations. The processor 20 may be connected to an I / O interface (input / output interface) suitable for connecting a computer device to one or more I / O devices (input / output devices) via a system interconnect (e.g., PCI, PCI-Express, etc.). The I / O devices may include, for example, a keyboard and a pointing device, wherein the pointing device may include a touchpad or a touch screen, etc. The I / O devices may be built-in components of the computer device, or may be devices externally connected to the computing device.

[0128] Processor 20 can also be linked to a display interface suitable for connecting a computer device to a display device through a system interconnection. A display device can include a display screen as a built-in component of a computer device. A display device can also include a computer monitor, a television or a projector, etc., which are externally connected to a computer device. In addition, a network interface controller (NIC) can be suitable for connecting a computer device to a network through a system interconnection. In some embodiments, NIC can use any suitable interface or protocol (such as an Internet small computer system interface, etc.) to transmit data. The network can be a cellular network, a radio network, a wide area network (WAN), a local area network (LAN) or the Internet, etc. A remote device can be connected to a computing device through a network.

[0129] It should be noted that, in the description of the present invention, each functional module can be a physical module composed of multiple structures, components or electronic components, or a virtual module composed of multiple programs; each functional module can be a module that exists independently of each other, or a module divided according to the function of an integral module. It should be understood by those skilled in the art that, under the premise of being able to implement the technical solution described in the present invention, the composition, implementation and positional relationship of each functional module will not deviate from the technical principle of the present invention no matter how it changes, and therefore should fall within the protection scope of the present invention.

[0130] It should be noted that the logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or equipment (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or equipment and execute instructions), or used in combination with these instruction execution systems, devices or equipment.

[0131] The flow chart provided by the present embodiment is not intended to indicate that the operation of the method will be performed in any particular order, or that all operations of the method are included in all every case. In addition, the method may include additional operations. Within the scope of the technical thinking provided by the present embodiment method, additional changes may be made to the above method.

[0132] At this point, those skilled in the art should recognize that, although multiple exemplary embodiments of the present invention have been shown and described in detail herein, many other variations or modifications that conform to the principles of the present invention can still be directly determined or derived based on the content disclosed in the present invention without departing from the spirit and scope of the present invention. Therefore, the scope of the present invention should be understood and recognized as covering all these other variations or modifications.

Claims

1. A data dictionary processing method for an optical storage system, the optical storage system comprising a data service end, wherein a dictionary directory of the data service end is configured to store data dictionary files of multiple preset formats; in, The data dictionary processing method comprises: Receive data dictionary requests from clients; Constructing a plurality of target file paths according to the data dictionary request and the address of the dictionary directory, each of the target file paths corresponding to a preset format of the data dictionary file; Try to load the corresponding data dictionary files in the dictionary directory one by one according to the target file path; If the loading is successful, the data dictionary file is returned to the client.

2. The data dictionary processing method of the optical storage system according to claim 1, in, The step of constructing multiple target file paths according to the data dictionary request and the address of the dictionary directory comprises: Check whether the data dictionary request has a logical name field and a file name field that meet preset requirements, wherein the file name field is the name of the data dictionary file requested by the data dictionary request, and the logical name field is the address of the data dictionary file in the dictionary directory; If so, using the logical name field and the file name field to generate a relative path of the data dictionary file in the dictionary directory; Converting the relative path into a complete path of the data dictionary file according to the address of the dictionary directory to obtain the target file path; If not, output the first error prompt message.

3. The data dictionary processing method of the optical storage system according to claim 1, in, In the step of attempting to load corresponding data dictionary files in the dictionary directory one by one according to the target file path, If all target file paths are not loaded into the corresponding data dictionary file, the second error prompt message is output; If it is detected that loading of the corresponding data dictionary file is prohibited, a third error prompt message is output.

4. The data dictionary processing method of the optical storage system according to claim 3, in, The data dictionary processing method also includes: Detecting the occurrence of the second error prompt information, recording historical information of the second error prompt information, where the historical information includes the occurrence time of the second error prompt information; Check whether the time interval between this second error prompt message and the last second error prompt message is less than the preset time. If so, add one to the preset counter, which is used to record the number of occurrences of the second error prompt message. If not, update the count value of the preset counter to 1. When it is detected that the count value of the preset counter reaches a set threshold, update prompt information of the dictionary directory is output.

5. The data dictionary processing method of the optical storage system according to claim 4, in, The historical information also includes the file name of the data dictionary file that was not found, and the total number of second error prompt messages caused by the same data dictionary file; The data dictionary processing method also includes: When it is detected that the total number of second error prompt messages caused by the same data dictionary file reaches a preset value, an update prompt message of the dictionary directory is output.

6. The data dictionary processing method of the optical storage system according to claim 1, in, The step of receiving a data dictionary request from a client includes: Detect whether the data dictionary request comes from a preset whitelist, if so, process the data dictionary request, if not, reject the data dictionary request.

7. The data dictionary processing method of the optical storage system according to claim 1, in, The step of attempting to load the corresponding data dictionary files in the dictionary directory one by one according to the target file path comprises: loading the data dictionary files in a fixed order of preset formats, recording the preset format loaded first as the first format, and recording the preset format loaded last as the last format; The data dictionary processing method also includes: Recording the loading history of all data dictionary files in the dictionary directory; The number of the data dictionary files in the first format and the last format in the dictionary directory is adjusted according to the loading history record.

8. The data dictionary processing method of the optical storage system according to claim 7, in, The step of adjusting the number of data dictionary files of each preset format in the dictionary directory according to the loading history records comprises: It is detected that the number of reads of the data dictionary file in the first format within a preset time is less than a preset number; The format of the data dictionary file is converted into the final format.

9. The data dictionary processing method of the optical storage system according to claim 7, in, The step of adjusting the number of data dictionary files of each preset format in the dictionary directory according to the loading history records comprises: It is detected that the number of times the data dictionary file of the last-digit format is read within a set time exceeds a set number; The format of the data dictionary file is converted to the first-order format.

10. The data dictionary processing method of the optical storage system according to claim 7, in, The data dictionary processing method also includes: Record the loading time used for each successful loading of the data dictionary file; It is detected that the sum of the loading durations within a preset time period exceeds a preset threshold and the number of data dictionary files of the first format loaded within the preset time period is less than a preset value; Converting a preset number of data dictionary files in the first-digit format into the last-digit format; The data dictionary file that has been loaded a number of times greater than a preset value within the preset time period is converted into the first-order format.

11. A computer program product, include: A computer executable program, which, when executed by a processor, implements the data dictionary processing method of an optical storage system according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • URL redirection method, device, and system

    CN104065736A

  • Optimization method of directory level quota of distributed file system

    CN107908751A

  • File access method and file access system

    CN109376133A

  • Associated dictionary data retrieval method and related component

    CN117874082A