Information storage method and device, information query method and device, electronic equipment and storage medium
By caching the mapping between version information and class information in a key-value storage system, the resource consumption problem caused by repeated calls between systems in client-side metric degradation analysis is solved, achieving more efficient querying and stability.
Patent Information
- Application Number
- CN202411140715.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2026-03-03
AI Technical Summary
In the process of analyzing client-side metrics degradation, existing technologies require repeated calls between different systems, leading to increased resource consumption and reduced system stability.
By caching version information of version increments and the mapping information from class information to component information corresponding to code version identifiers in the key-value storage system, the number of calls between systems is reduced, and query efficiency is improved by utilizing local caching and key-value caching systems.
This improved system stability, reduced resource consumption, and enhanced the accuracy of data queries and the efficiency of troubleshooting.
Smart Images

Figure CN121597253A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to data processing technology, and more particularly to information storage, information retrieval methods, apparatus, electronic devices, and storage media. Background Technology
[0002] Client-side metrics are key factors in measuring software product performance and user experience. Deterioration in client-side metrics may be caused by code changes. Each update and iteration of the application involves corresponding code changes, which may include changes to the component information to which the code belongs.
[0003] To improve client stability, it is necessary to analyze client performance degradation. Currently, the analysis process requires repeated calls between different systems, which increases resource consumption and reduces system stability. Summary of the Invention
[0004] This disclosure provides information storage, information retrieval methods, devices, electronic devices, and storage media, which solve the problems of resource consumption and poor stability caused by repeated calls between systems during the process of analyzing client-side indicator degradation.
[0005] In a first aspect, embodiments of this disclosure provide an information storage method, including:
[0006] When there is a version increment in the application, the version information corresponding to the version increment is cached in the key-value storage system;
[0007] Download the incremental file corresponding to the version information;
[0008] The mapping information from class information to component information corresponding to the code version identifier in the incremental file is stored in the key-value storage system.
[0009] Secondly, this disclosure also provides an information query method, including:
[0010] Obtain a component query request, which includes the application's application identifier information, the application's version information, and class information;
[0011] Determine the code version identifier corresponding to the application identifier information and the version information;
[0012] Based on the application identifier and code version identifier, query the component information corresponding to the class information.
[0013] Thirdly, embodiments of this disclosure also provide an information storage device, including:
[0014] The caching module is used to cache the version information corresponding to the version increment in the key-value storage system when there is a version increment in the application.
[0015] The download module is used to download the incremental file corresponding to the version information;
[0016] The storage module is used to store the mapping information from class information to component information corresponding to the code version identifier in the incremental file into the key-value storage system.
[0017] Fourthly, embodiments of this disclosure also provide an information query device, including:
[0018] The acquisition module is used to acquire component query requests, which include application identification information, version information, and class information of the application.
[0019] The determination module is used to determine the code version identifier corresponding to the application identifier information and the version information;
[0020] The query module is used to query the component information corresponding to the class information based on the application identifier information and the code version identifier.
[0021] Fifthly, embodiments of this disclosure provide an electronic device, the electronic device comprising:
[0022] One or more processing devices;
[0023] Storage device for storing one or more programs.
[0024] When the one or more programs are executed by the one or more processing devices, the one or more processing devices perform the methods provided in the embodiments of this disclosure.
[0025] Sixthly, this disclosure provides a storage medium for computer-executable instructions, which, when executed by a computer processor, are used to perform the methods provided in the embodiments of this disclosure.
[0026] In this embodiment of the disclosure, by storing version information of incremental files and mapping information from class information to component information corresponding to code version identifiers within incremental files in a key-value storage system, it is convenient to find the component information in the key-value storage system through the degraded class information during the analysis of client metric degradation. This eliminates the need for repeated calls in multiple systems and can be achieved through the key-value storage system, thereby improving system stability and reducing resource consumption. Attached Figure Description
[0027] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0028] Figure 1 This is a flowchart illustrating an information storage method provided in an embodiment of this disclosure;
[0029] Figure 2 This is a schematic diagram of a system call process provided in an embodiment of this disclosure;
[0030] Figure 3 This is a schematic diagram of the result of a communication system provided in an embodiment of this disclosure;
[0031] Figure 4 This is a flowchart illustrating another information storage method provided in this disclosure embodiment;
[0032] Figure 5 This is a schematic diagram of another information storage process provided in an embodiment of this disclosure;
[0033] Figure 6a This is a schematic diagram of an information query process provided in an embodiment of this disclosure;
[0034] Figure 6b This is a schematic diagram of another information query process provided in this embodiment of the disclosure;
[0035] Figure 7 This is a schematic diagram of an information storage device structure provided in an embodiment of this disclosure;
[0036] Figure 8 This is a schematic diagram of the structure of an information query device provided in an embodiment of this disclosure;
[0037] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0038] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0039] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0040] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0041] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0042] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0043] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0044] Figure 1 This is a flowchart illustrating an information storage method provided in an embodiment of the present disclosure. This embodiment is applicable to the situation where storage is performed after a new version of software is released. The method can be executed by an information storage device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, such as a mobile terminal, a PC, or a server.
[0045] With the rapid development of short videos, the requirements for application stability and usability are becoming increasingly stringent. Each application update and iteration involves corresponding code changes, which include changes to component information. A component can be considered a collection of code snippets or modules, and a component may contain multiple code snippets. Each line of code has a corresponding code owner, a unique commit identifier (also known as a code version identifier), etc. Modifying a line of code will also change the component. Component information can be considered as information associated with the component, such as the component name.
[0046] Submitting unique identifiers is helpful for version control and change tracking of code. Each commit has a unique identifier, making it easy to view the code's modification history and evolution. For example, if a previously introduced vulnerability is discovered later in the project, submitting a unique identifier allows tracing back to the specific modified version, thus enabling analysis of the root cause of the problem.
[0047] To provide complete support and analysis for optimizing client stability, it is necessary to build multi-type abnormal data storage at the site where degradation scenarios occur. This provides a data foundation for subsequent degradation analysis and troubleshooting, which can then drive optimization or problem-solving. This involves the construction of code component information storage. Currently, when this system (hereinafter referred to as System A) calls the downstream interface to obtain the corresponding code component information of the downstream system (hereinafter referred to as System B), it requires additional high time consumption and does not meet the existing filtering requirements. If it is necessary to filter the component information to which a certain version and code segment belong, it is necessary to call the System B interface multiple times for aggregation calculation. Under such a load of processing thousands of requests per second, the link requires a large input / output (IO) cost, which increases the system's machine resource consumption and link time consumption, and reduces the stability of the entire system.
[0048] Figure 2 This is a schematic diagram of a system call process provided in an embodiment of this disclosure. See also: Figure 2 In determining the component information to which a certain code segment belongs in a specific version, if the code segment corresponds to changes in multiple versions, it may correspond to multiple files, such as file 1 and file 2. System A retrieves data for file 1 from System B through its Application Programming Interface (API). System B's API iterates through the component information to which the code belongs between itself and System A's API. System A then retrieves data for file 2 from System B and iterates through the component information to which the code belongs. Files 1 and 2 can describe the changed components. The system searches for the corresponding component information in either file 1 or file 2 based on the changed code segment. During the component information determination process, System A needs to call System B multiple times, increasing system resource consumption and latency, and reducing the overall system stability.
[0049] This disclosure addresses the problem that system A has difficulty obtaining code component information of system B using low latency and high availability methods, and designs a component caching system. Figure 3This is a schematic diagram illustrating the result of a communication system provided in an embodiment of this disclosure. This disclosure is applied to a server. When system A queries component information, it can obtain component information from the cache system based on the code. The cache system periodically pulls newly released versions from system B, parses the returned data, and stores it. The electronic device executing the information storage method of this disclosure can integrate a cache system, which includes a local cache and a key-value cache system.
[0050] The caching system can cache data from at least the most recent version to ensure the accuracy of data queries, guaranteeing that clients with different versions can accurately retrieve the component to which the code belongs. A key-value (KV) in-memory storage model can be selected based on the data storage capacity. Since a query rate of k queries per second (QPS) is required, a local cache on a single machine is introduced to address the issue of retrieving information about frequently executed components (such as code frequently executed during program execution). During a query, the caching system first checks the local cache; if the data is not found there, it checks the local cache again. If the data is found, it is returned and asynchronously written to the local cache, resolving the issue of concurrent access. This disclosure employs a local cache based on Least Recently Used (LRU), with the stored information distributed across each deployed server.
[0051] By pre-caching component information and using local caching to solve query-related issues, the time required to retrieve component information corresponding to code versions that may affect stability is reduced, while availability is guaranteed. By solving this problem, the efficiency of data output, problem investigation, and progress is improved.
[0052] Before describing the various embodiments of this disclosure in detail, the terms used in this disclosure are explained as follows:
[0053] Application identification information (application ID, i.e., app ID): a unique identifier for a specific application, for example: app_id_1.
[0054] Code version identifier (unique commit identifier, such as short commit id): This refers to the commit information of a certain release, which is a unique identifier for that version, such as: abc_commit_id.
[0055] Version information (e.g., version number / update version code): a unique identifier for each released version, for example: 2688888.
[0056] Class information (such as the class name indicating which code snippet was committed): Code class name (a specific name given to a defined class when writing code), for example: com.aaa.bbb.ccc.
[0057] Component information (code components, such as component name): includes the name of the component to which a certain code belongs, for example: com.xxx.yyy.zzz; in Python, for example, math, requests, etc.
[0058] "math" can be considered a built-in module that provides many functions and constants related to mathematical operations, such as trigonometric functions, exponential functions, and logarithmic functions. "requests" is a commonly used HTTP request library used to send various types of HTTP requests and process responses.
[0059] The information storage method provided in this disclosure is as follows: Figure 1 As shown, the method includes:
[0060] S110. If there is a version increment in the application, cache the version information corresponding to the version increment in the key-value storage system.
[0061] Version increment can be considered as the existence of a new version of an application. For example, if system B has a new version relative to the cache system, such as the addition of new application features, improvements to existing features, or bug fixes, the version information can be considered as the information associated with the version increment, such as the version number. For instance, if software upgrades from version 1.0 to 1.1, the version increment could be the version number 1.1.
[0062] A key-value storage system can be considered a system that stores and manages data in the form of key-value pairs. Here, the "key" is an identifier used to uniquely identify the data, while the "value" is the data content associated with that key.
[0063] This step caches the version information of the application's version increment in a key-value store. When caching version information, it can be stored as a value in the key-value store, where the corresponding key can include the application identifier and code version identifier for the version increment.
[0064] In one embodiment, when there is a version increment in the application, the application identifier information corresponding to the version increment and the code version identifier corresponding to the version increment are used as the keys in the key-value pair, and the version information corresponding to the version increment is used as the value, and stored in the key-value storage system to realize the caching of the version information of the version increment.
[0065] In one embodiment, when there is a version increment in the application, the version information corresponding to the version increment is cached in a key-value store system, including:
[0066] When there is a version increment in the application, the application identifier information corresponding to the version increment and the code version identifier corresponding to the version increment are used as the key in the key-value pair, and the version information corresponding to the version increment and the write status indicating that writing is in progress are used as the value in the key-value pair, and stored in the key-value storage system.
[0067] When the incremental write of the version is completed, the write status indicating that the write is in progress will be updated to the write status indicating that the write is completed.
[0068] The write status can be considered as the state of writing incremental data to a key-value storage system, including in progress or write completed.
[0069] When a new version is released, version information and the write status representing the data writing process can be written to the key-value storage system, such as storing the write status as a value in the key-value storage system.
[0070] This embodiment sets a write status to facilitate the management of data writing, and prevents duplicate code version identifiers from being read from the file.
[0071] Once the incremental data write is complete, such as when the mapping relationship has been written, the write status in the key-value storage system can be changed from "in progress" to "written complete".
[0072] S120. Download the incremental file corresponding to the version information.
[0073] Incremental files can be considered files corresponding to version increments, such as newly added files in a caching system. Incremental files can also be files containing detailed information about code commits, including code for adding new features, improving existing features, or fixing vulnerabilities. Incremental files often include mappings from multiple classes to components.
[0074] When there are version increments in the application, this operation can download the increment files concurrently and store them in a key-value storage system.
[0075] S130. The mapping information from class information to component information corresponding to the code version identifier in the incremental file is stored in the key-value storage system.
[0076] Code version identifiers can be used to identify different versions of code. Class information can be considered as information related to a class. For example, the class name can be a name used to distinguish different classes.
[0077] When there are version increments in the application, files are downloaded concurrently to obtain the mapping of class information to components.
[0078] In one embodiment, the mapping from class information to component information corresponding to each code version identifier within the incremental file is traversed. This mapping is then stored as key-value pairs in a key-value store system.
[0079] This operation parses the file and stores the mapping relationship between class information and component information in the file as key-value pairs in a key-value storage system. This makes it easier to query the component information to which the class information belongs when querying based on class information later.
[0080] In one embodiment, storing the mapping information from class information to component information corresponding to the code version identifier in the incremental file to the key-value storage system includes:
[0081] Use the application identifier, code version identifier, and class information corresponding to the incremental file as the target key;
[0082] The component information to which the class information in the target key belongs is used as the target value of the target key;
[0083] The target key and the target value are stored in the key-value storage system as key-value pairs.
[0084] The target key can be considered as the key in the storage mapping process, and the target value can be considered as the value in the storage mapping process.
[0085] In this embodiment, during the process of storing the mapping from class information corresponding to each code version identifier to component information, application identifier, code version identifier, and class information are used as target keys. The application identifier identifies the application, the code version identifier represents the commit information of the code release, and the class information identifies the corresponding code segment. In determining the component information to which a code segment of a certain version belongs, the class information corresponding to the code segment can be used for lookup.
[0086] In this embodiment, during the process of storing the mapping from class information to component information corresponding to each code version identifier, the component information to which the class information belongs in the target key is used as the target value, so that the corresponding target value can be retrieved through the target key in the subsequent query process, thereby realizing the query of the component information based on the class information.
[0087] The technical solution of this disclosure, by storing version information of incremental files and mapping information from class information to component information corresponding to code version identifiers in incremental files in a key-value storage system, facilitates the retrieval of component information in the key-value storage system through the degraded class information during the analysis of client metric degradation. This eliminates the need for repeated calls in multiple systems and can be achieved through the key-value storage system, thereby improving system stability and reducing resource consumption.
[0088] Figure 4This is a flowchart illustrating another information storage method provided in this disclosure. This embodiment details the caching operation. See [link to relevant documentation]. Figure 4 The information storage method includes the following steps:
[0089] S410. Send an incremental query request, which is a request to query whether there is a version increment in the data storage system.
[0090] An incremental query request can be considered as a case of performing a version incremental query.
[0091] A data storage system can be considered a system that stores data, such as system B. A data storage system can also store new versions of software, such as incremental files.
[0092] In this operation, the caching system sends an incremental query request to the data storage system, requesting the version increment in the data storage system relative to the caching system.
[0093] S420. Obtain the response result corresponding to the incremental query request.
[0094] The response result can be the result transmitted from the data storage system to the caching system based on an incremental query request. For example, it could represent information about a new version in the data storage system. The content of the response result is not limited, as long as it represents the new version.
[0095] In one embodiment, the response result includes first application identification information and first version information transmitted by the data storage system. The first application identification information can be considered as information used to identify the application transmitted by the data storage system in response to an incremental query request. The first version information can be considered as version information of a new version transmitted by the data storage system in response to an incremental query request. The first application identification information and the first version information are used to characterize a specific version of a specific application.
[0096] S430. The response result is compared with the data stored in the key-value storage system to obtain the comparison result.
[0097] Data stored in a key-value storage system can be considered as data associated with an application stored through that system. The comparison result can be considered as an indication of whether a version increment has occurred.
[0098] This operation compares the response results with the data stored in the key-value storage system to determine if a new version exists. The specific comparison methods and the content included in the response results are determined accordingly.
[0099] In one embodiment, the data stored in the key-value storage system includes second application identification information and second version information.
[0100] The second application identifier can be used to identify the application to which the data stored in the key-value storage system belongs. The second version information can be considered as the version information stored in the key-value storage system.
[0101] In the process of comparing the response results with the key-value storage system, it can be determined whether the first application identification information is included in the second application identification information and whether the first version information is included in the second identification information. If so, it is considered that the first application identification information and the first version information correspond to a non-version increment, and the comparison result can indicate that the application does not have a version increment; otherwise, it can be considered that the first application identification information and the first version information correspond to a version increment, and the comparison result can indicate that the application has a version increment.
[0102] S440. If the comparison result indicates that the application has a version increment, cache the version information corresponding to the version increment in the key-value storage system.
[0103] If the comparison results indicate the existence of a version increment, the version information of the version increment can be cached to enable data updates in the key-value storage system.
[0104] S450. Download the incremental file corresponding to the version information.
[0105] S460. The mapping information from class information to component information corresponding to the code version identifier in the incremental file is stored in the key-value storage system.
[0106] This embodiment determines whether a version increment exists by interacting with the data storage system, and caches the version information if a version increment exists. By sending incremental query requests, the data in the key-value storage system is updated periodically or in real-time to ensure the accuracy of the data within the key-value storage system.
[0107] The following is an exemplary description of the information storage method provided in this disclosure, which can realize the pre-caching of component information. Figure 5 This is a schematic diagram of another information storage process provided in an embodiment of this disclosure, see [link to relevant documentation]. Figure 5 Information storage specifically includes the following operations:
[0108] 1. Periodically pull the release interface, check the cache to determine if a new version has been released; if not, continue the loop. This may involve sending an incremental query request; obtaining the response result corresponding to the incremental query request; performing incremental logic verification to determine if an incremental release exists, such as comparing the response result with the data stored in the key-value storage system to obtain a comparison result, and using the comparison result to determine if a new version has been released.
[0109] In one example, incremental logic validation is performed using the following key-value pairs to achieve version deduplication. During the query, the code version identifier is retrieved: the key is set to the application identifier and version information, and the value is set to the code version identifier to determine if a new version exists. When determining if a new version exists, the key is compared. If the key returned by the data storage system does not exist in the cache system, then a version increment is considered to exist. Even if the value is not found (e.g., it does not exist in the cache system), and a failure is returned, a version increment is still considered to exist.
[0110] A code version identifier is set as a value to allow retrieval of code changes within the corresponding commit based on the code version identifier; the code version identifier is associated with the code. The value in a key-value pair can be a mapping structure, such as a map. Alternatively, the value can be a hash type. Hash types store data as a collection of key-value pairs in a key-value storage system, where both the key and value can be strings.
[0111] 2. If a new version is released, it will be incrementally written to the key-value storage system in batches, and the version information and the writing status of the version data (initialized to in progress) will be cached, such as setting the value to be written.
[0112] In one example, the application identification information and the code version identifier corresponding to the version increment are used as keys, and the version information is used as the value. The value can include multiple version information entries, displayed in a list format. Furthermore, the value may include write status to ensure that duplicate code version identifiers are not read from the file.
[0113] 3. Begin concurrent file downloads, such as incremental files, to obtain class information, such as the mapping from class name (class_name) to component information, such as the mapping from component name (component name). Iterate through individual file information, storing each code version identifier, such as the mapping from class name to component name for the shortcommit ID. Use a pipeline to write to the key-value store (i.e., when performing data write operations to the key-value store, use pipeline technology to send multiple write commands to the key-value store at once). This achieves the goal of obtaining class names, component names, and other information from files and writing them in batches to the key-value store, i.e., parsing key-value pairs and storing them in the key-value store. Execute a set number of write commands at a time, with the Time To Live (TTL) spread out within a set range of days to ensure data accuracy.
[0114] In one example, during the process of writing the mapping to the key-value store, application identification information, code version identification, and class information are used as keys, and component information is used as values. Application identification information, code version identification, and class information can also be used as keys during queries to facilitate retrieving the corresponding values.
[0115] 4. Write the flag indicating successful data acquisition for this version. That is, when the incremental write of the version is completed, update the write status from indicating write in progress to indicating write completion.
[0116] In one example, in step 2, the write status corresponding to the application identification information and the code version identification key corresponding to the version increment is updated to write complete.
[0117] During batch writing, if memory usage exceeds a set threshold, subsequent writes can be interrupted, and writing will be triggered again during the next release interface polling.
[0118] Figure 6a This is a schematic flowchart illustrating an information query process provided by an embodiment of this disclosure. This embodiment is applicable to situations involving component information queries, such as querying information about components to which a certain version of code might affect stability. This method can be executed by an information storage device, which can be implemented in software and / or hardware, optionally through an electronic device, such as a mobile terminal, PC, or server. For details not covered in this embodiment, please refer to the above embodiments; further elaboration is not required here.
[0119] like Figure 6a As shown, the information storage method includes the following steps:
[0120] S610. Obtain a component query request, wherein the component query request includes the application identifier information of the application, the version information of the application, and the class information.
[0121] A component query request can be considered as a request to query information about the corresponding component.
[0122] This operation can obtain the component query request transmitted by the client. The application identification information and version information included in the component query request can be used to determine the code version identifier to be queried. In this embodiment, it is used to determine the component information to which the class information belongs.
[0123] S620. Determine the code version identifier corresponding to the application identifier information and the version information.
[0124] This operation can determine the code version identifier corresponding to the application identifier information and version information based on the mapping relationship, so as to realize the query of the component information mentioned in the class information at the code level.
[0125] S630. Based on the application identifier information and code version identifier, query the component information corresponding to the class information.
[0126] Once the code version identifier is determined, the application identifier, code version identifier, and class information can be used as keys to retrieve the component information corresponding to the class information from the cache system.
[0127] When performing this search, you can first search the local cache. If the result is not found, you can search the key-value store system.
[0128] This embodiment achieves the lookup of the component information to which the class information belongs through a component query request, without the need for multiple system calls. The lookup of the component information to which the class information belongs is only implemented in the cache system, which reduces resource consumption and improves system stability.
[0129] Based on the above embodiments, modified embodiments of the above embodiments are proposed. It should be noted that, in order to keep the description brief, only the differences from the above embodiments are described in the modified embodiments.
[0130] In one embodiment, querying the component information corresponding to the class information based on the application identifier information and the code version identifier includes:
[0131] Retrieve the component information corresponding to the application identifier, the code version identifier, and the class information from the local cache;
[0132] If retrieval fails, retrieve the application identifier, code version identifier, and component information corresponding to the class information from the key-value storage system.
[0133] In the process of finding component information, the system first searches for key-value pairs with application identifier, code version identifier, and class information as keys in the local cache. If the search fails, it searches for key-value pairs with application identifier, code version identifier, and class information as keys in the key-value storage system. If the search is successful, the value of the matching key-value pair is used as the component information corresponding to the class information.
[0134] In one embodiment, the information query method further includes:
[0135] If the application identifier, the code version identifier, and the component information corresponding to the class information are obtained from the key-value storage system, the obtained data is stored in the local cache; otherwise, an indication of failure to obtain the data is stored in the key-value storage system.
[0136] In this embodiment, after obtaining component information from the key-value storage system, the obtained data is stored in a local cache so that subsequent queries can retrieve it from the local cache. If the component information is not obtained from the key-value storage system, the application identifier, the code version identifier, and the component information corresponding to the class information are used as keys, and a string indicating a failed query is used as the value to write to the key-value storage system so that results can be quickly returned after subsequent queries.
[0137] Figure 6b This is a schematic diagram of another information query process provided in this embodiment of the disclosure. See also... Figure 6b The component information query method includes the following steps:
[0138] 1. Obtain the component query request and determine the code version identifier based on the application identifier information and version information.
[0139] Based on the application identifier (app_id) and version information (update_version_code) carried in the component query request, retrieve the code version identifier.
[0140] 2. If the code version identifier can be obtained, it proves that this version of the data is stored.
[0141] 3. If the code version identifier is obtained, append it to the key to retrieve component information from the local cache; if the code version identifier is not obtained, the operation ends.
[0142] Retrieve component information from the local machine's cache, and return the result if found. During retrieval, the code version and class information can be appended to the key of the application identifier information to facilitate retrieving component information from the local cache based on the appended key.
[0143] 4. If the information cannot be obtained from the local cache, retrieve the component information from the key-value store system, determine whether it can be obtained from the key-value store system, and if it is, asynchronously write the data from the key-value store system to the local cache and return the result.
[0144] 5. If the result cannot be obtained, write a flag with a value of -1 and discard the query request for that component. Subsequent checks of the flag will then directly return the result.
[0145] In one example, the keys are application identification information, code version identification, and class information, and the value is -1, which indicates that the retrieval failed.
[0146] Figure 7 This is a schematic diagram of an information storage device structure provided in an embodiment of this disclosure. The information storage device can be integrated into an electronic device, such as... Figure 7 As shown, the information storage device includes:
[0147] The caching module 710 is used to cache the version information corresponding to the version increment in the key-value storage system when there is a version increment in the application.
[0148] Download module 720 is used to download the incremental file corresponding to the version information;
[0149] Storage module 730 is used to store the mapping information from class information to component information corresponding to the code version identifier in the incremental file to the key-value storage system.
[0150] The technical solution provided in this disclosure, by storing version information of incremental files and mapping information from class information to component information corresponding to code version identifiers within incremental files in a key-value storage system, facilitates the retrieval of component information in the key-value storage system through the degraded class information during the analysis of client metric degradation. This eliminates the need for repeated calls across multiple systems and can be achieved solely through the key-value storage system, thereby improving system stability and reducing resource consumption.
[0151] The information storage device provided in this disclosure can execute the information storage method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of executing the method.
[0152] In one embodiment, the cache module 710 is specifically used for:
[0153] Send an incremental query request, which is a request to query whether there is a version increment in the data storage system;
[0154] Obtain the response result corresponding to the incremental query request;
[0155] The comparison result is obtained by comparing the response result with the data stored in the key-value storage system;
[0156] If the comparison result indicates that the application has a version increment, the version information corresponding to the version increment is cached in the key-value storage system.
[0157] In one embodiment, the response result includes first application identification information and first version information transmitted by the data storage system; the data stored by the key-value storage system includes second application identification information and second version information.
[0158] In one embodiment, the storage module 730 is specifically used for:
[0159] Use the application identifier, code version identifier, and class information corresponding to the incremental file as the target key;
[0160] The component information to which the class information in the target key belongs is used as the target value of the target key;
[0161] The target key and the target value are stored in the key-value storage system as key-value pairs.
[0162] In one embodiment, the cache module 710 is specifically used for:
[0163] When there is a version increment in the application, the application identifier information corresponding to the version increment and the code version identifier corresponding to the version increment are used as the key in the key-value pair, and the version information corresponding to the version increment and the write status indicating that writing is in progress are used as the value in the key-value pair, and stored in the key-value storage system.
[0164] When the incremental write of the version is completed, the write status indicating that the write is in progress will be updated to the write status indicating that the write is completed.
[0165] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this disclosure.
[0166] Figure 8 This is a schematic diagram of an information query device provided in an embodiment of this disclosure. The information query device can be integrated into an electronic device, such as... Figure 8 As shown, the information query device includes:
[0167] The acquisition module 810 is used to acquire a component query request, which includes the application identifier information of the application, the version information of the application, and the class information of the application.
[0168] The determining module 820 is used to determine the code version identifier corresponding to the application identifier information and the version information;
[0169] The query module 830 is used to query the component information corresponding to the class information based on the application identifier information and the code version identifier.
[0170] The technical solution provided in this disclosure realizes the search for the component information to which the class information belongs through a component query request. This eliminates the need for multiple system calls and only requires caching the system to search for the component information to which the class information belongs, thereby reducing resource consumption and improving system stability.
[0171] The information storage device provided in this disclosure can execute the information storage method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of executing the method.
[0172] In one embodiment, the query module 830 is specifically used for:
[0173] Retrieve the component information corresponding to the application identifier, the code version identifier, and the class information from the local cache;
[0174] If retrieval fails, retrieve the application identifier, code version identifier, and component information corresponding to the class information from the key-value storage system.
[0175] In one embodiment, the information query device further includes a storage module for:
[0176] If the application identifier, the code version identifier, and the component information corresponding to the class information are obtained from the key-value storage system, the obtained data is stored in the local cache; otherwise, an indication of failure to obtain the data is stored in the key-value storage system.
[0177] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Refer to the following... Figure 9 It illustrates an electronic device suitable for implementing embodiments of the present disclosure (e.g., Figure 9 A structural diagram of the terminal device or server in the 900.
[0178] Electronic devices 900 include:
[0179] One or more processing devices 901;
[0180] Storage device 908, for storing one or more programs,
[0181] When the one or more programs are executed by the one or more processing devices 901, the one or more processing devices 901 implement the methods provided in this disclosure.
[0182] The terminal devices in this disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (e.g., vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 9 The electronic device 900 shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0183] like Figure 9As shown, the electronic device 900 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the electronic device 900. The processing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An edit / output (I / O) interface 905 is also connected to the bus 904.
[0184] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows electronic device 900 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 9 An electronic device 900 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0185] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by a processing device 901, it performs the functions defined in the methods of embodiments of this disclosure.
[0186] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0187] The electronic device provided in this embodiment belongs to the same inventive concept as the information storage method and information retrieval method provided in the above embodiments. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0188] This disclosure provides a computer storage medium storing a computer program thereon, which, when executed by a processor, implements the information storage method and information query method provided in the above embodiments.
[0189] It should be noted that the computer-readable medium described above in this disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination thereof.
[0190] The computer storage medium may be a storage medium for computer-executable instructions, which, when executed by a computer processor, are used to perform the methods provided in this disclosure.
[0191] Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0192] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0193] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0194] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: cache version information corresponding to the version increment in a key-value storage system when there is a version increment in the application;
[0195] Download the incremental file corresponding to the version information;
[0196] The mapping information from class information to component information corresponding to the code version identifier in the incremental file is stored in the key-value storage system.
[0197] Alternatively, the aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: obtain a component query request, the component query request including application identification information of the application, version information of the application, and class information;
[0198] Determine the code version identifier corresponding to the application identifier information and the version information;
[0199] Based on the application identifier and code version identifier, query the component information corresponding to the class information.
[0200] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0201] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0202] The modules or units described in the embodiments of this disclosure can be implemented in software or hardware. The names of modules or units do not necessarily limit the specific unit; for example, an acquisition module can also be described as a "component query request acquisition module".
[0203] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0204] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0205] According to one or more embodiments of this disclosure, [Example 1] provides an information storage method, including:
[0206] When there is a version increment in the application, the version information corresponding to the version increment is cached in the key-value storage system;
[0207] Download the incremental file corresponding to the version information;
[0208] The mapping information from class information to component information corresponding to the code version identifier in the incremental file is stored in the key-value storage system.
[0209] According to one or more embodiments of this disclosure, [Example 2] provides the method described in Example 1, which, when there is a version increment in the application, caches the version information corresponding to the version increment in a key-value storage system, including:
[0210] Send an incremental query request, which is a request to query whether there is a version increment in the data storage system;
[0211] Obtain the response result corresponding to the incremental query request;
[0212] The comparison result is obtained by comparing the response result with the data stored in the key-value storage system;
[0213] If the comparison result indicates that the application has a version increment, the version information corresponding to the version increment is cached in the key-value storage system.
[0214] According to one or more embodiments of this disclosure, [Example 3] provides the method described in Example 2, wherein the response result includes first application identification information and first version information transmitted by the data storage system; the data stored in the key-value storage system includes second application identification information and second version information.
[0215] According to one or more embodiments of this disclosure, [Example 4] provides the method described in Example 1, wherein storing the mapping information from class information to component information corresponding to the code version identifier in the incremental file to the key-value storage system includes:
[0216] Use the application identifier, code version identifier, and class information corresponding to the incremental file as the target key;
[0217] The component information to which the class information in the target key belongs is used as the target value of the target key;
[0218] The target key and the target value are stored in the key-value storage system as key-value pairs.
[0219] According to one or more embodiments of this disclosure, [Example 5] provides the method described in Example 1, which, when there is a version increment in the application, caches the version information corresponding to the version increment in a key-value storage system, including:
[0220] When there is a version increment in the application, the application identifier information corresponding to the version increment and the code version identifier corresponding to the version increment are used as the key in the key-value pair, and the version information corresponding to the version increment and the write status indicating that writing is in progress are used as the value in the key-value pair, and stored in the key-value storage system.
[0221] When the incremental write of the version is completed, the write status indicating that the write is in progress will be updated to the write status indicating that the write is completed.
[0222] According to one or more embodiments of this disclosure, [Example 6] provides an information query method, including:
[0223] Obtain a component query request, which includes the application's application identifier information, the application's version information, and class information;
[0224] Determine the code version identifier corresponding to the application identifier information and the version information;
[0225] Based on the application identifier and code version identifier, query the component information corresponding to the class information.
[0226] According to one or more embodiments of this disclosure, [Example 7] provides the method described in Example 6, wherein querying the component information corresponding to the class information based on the application identifier information and the code version identifier includes:
[0227] Retrieve the component information corresponding to the application identifier, the code version identifier, and the class information from the local cache;
[0228] If retrieval fails, retrieve the application identifier, code version identifier, and component information corresponding to the class information from the key-value storage system.
[0229] According to one or more embodiments of this disclosure, [Example 8] provides the method described in Example 7, further comprising:
[0230] If the application identifier, the code version identifier, and the component information corresponding to the class information are obtained from the key-value storage system, the obtained data is stored in the local cache; otherwise, an indication of failure to obtain the data is stored in the key-value storage system.
[0231] According to one or more embodiments of this disclosure, [Example 9] provides an information storage device, including:
[0232] The caching module is used to cache the version information corresponding to the version increment in the key-value storage system when there is a version increment in the application.
[0233] The download module is used to download the incremental file corresponding to the version information;
[0234] The storage module is used to store the mapping information from class information to component information corresponding to the code version identifier in the incremental file into the key-value storage system.
[0235] According to one or more embodiments of this disclosure, [Example 10] provides an information query device, including:
[0236] The acquisition module is used to acquire component query requests, which include application identification information, version information, and class information of the application.
[0237] The determination module is used to determine the code version identifier corresponding to the application identifier information and the version information;
[0238] The query module is used to query the component information corresponding to the class information based on the application identifier information and the code version identifier.
[0239] According to one or more embodiments of this disclosure, [Example 11] an electronic device is provided, the electronic device comprising:
[0240] One or more processing devices;
[0241] Storage device for storing one or more programs.
[0242] When the one or more programs are executed by the one or more processing devices, the one or more processing devices perform the method as described in any of Examples 1-8.
[0243] According to one or more embodiments of this disclosure, [Example 12] provides a storage medium containing computer-executable instructions that, when executed by a computer processor, are used to perform the method described in any of Examples 1-8.
[0244] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0245] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0246] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. An information storage method, characterized in that, include: When there is a version increment in the application, the version information corresponding to the version increment is cached in the key-value storage system; Download the incremental file corresponding to the version information; The mapping information from class information to component information corresponding to the code version identifier in the incremental file is stored in the key-value storage system.
2. The method according to claim 1, characterized in that, When there is a version increment in the application, the version information corresponding to the version increment is cached in the key-value store system, including: Send an incremental query request, which is a request to query whether there is a version increment in the data storage system; Obtain the response result corresponding to the incremental query request; The comparison result is obtained by comparing the response result with the data stored in the key-value storage system; If the comparison result indicates that the application has a version increment, the version information corresponding to the version increment is cached in the key-value storage system.
3. The method according to claim 2, characterized in that, The response result includes the first application identifier information and the first version information transmitted by the data storage system; the data stored by the key-value storage system includes the second application identifier information and the second version information.
4. The method according to claim 1, characterized in that, The step of storing the mapping information from class information to component information corresponding to the code version identifier in the incremental file to the key-value storage system includes: Use the application identifier, code version identifier, and class information corresponding to the incremental file as the target key; The component information to which the class information in the target key belongs is used as the target value of the target key; The target key and the target value are stored in the key-value storage system as key-value pairs.
5. The method according to claim 1, characterized in that, When there is a version increment in the application, the version information corresponding to the version increment is cached in the key-value store system, including: When there is a version increment in the application, the application identifier information corresponding to the version increment and the code version identifier corresponding to the version increment are used as the key in the key-value pair, and the version information corresponding to the version increment and the write status indicating that writing is in progress are used as the value in the key-value pair, and stored in the key-value storage system. When the incremental write of the version is completed, the write status indicating that the write is in progress will be updated to the write status indicating that the write is completed.
6. An information retrieval method, characterized in that, include: Obtain a component query request, which includes the application's application identifier information, the application's version information, and class information; Determine the code version identifier corresponding to the application identifier information and the version information; Based on the application identifier and code version identifier, query the component information corresponding to the class information.
7. The method according to claim 6, characterized in that, The step of querying the component information corresponding to the class information based on the application identifier information and code version identifier includes: Retrieve the component information corresponding to the application identifier, the code version identifier, and the class information from the local cache; If retrieval fails, retrieve the application identifier, code version identifier, and component information corresponding to the class information from the key-value storage system.
8. The method according to claim 7, characterized in that, Also includes: If the application identifier, the code version identifier, and the component information corresponding to the class information are obtained from the key-value storage system, the obtained data is stored in the local cache. Otherwise, the indication of failure to retrieve the information will be stored in the key-value storage system.
9. An information storage device, characterized in that, include: The caching module is used to cache the version information corresponding to the version increment in the key-value storage system when there is a version increment in the application. The download module is used to download the incremental file corresponding to the version information; The storage module is used to store the mapping information from class information to component information corresponding to the code version identifier in the incremental file into the key-value storage system.
10. An information query device, characterized in that, include: The acquisition module is used to acquire component query requests, which include application identification information, version information, and class information of the application. The determination module is used to determine the code version identifier corresponding to the application identifier information and the version information; The query module is used to query the component information corresponding to the class information based on the application identifier information and the code version identifier.
11. An electronic device, characterized in that, The electronic device includes: One or more processing devices; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processing devices, the one or more processing devices perform the method as described in any one of claims 1-8.
12. A storage medium comprising computer-executable instructions, which, when executed by a computer processor, are used to perform the method as described in any one of claims 1-8.