Method and apparatus for managing data in application, and device and medium

By managing data in the application using only one of string or object formats, combined with hash mapping and instantiation operations, the problem of excessive storage space requirements in existing technologies is solved, and efficient utilization of storage space is achieved.

WO2026044517A1PCT designated stage Publication Date: 2026-03-05BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/114939
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2026-03-05

AI Technical Summary

Technical Problem

Existing technologies have the problem of excessive storage space requirements when managing data in applications, especially when data items exist in both string and object formats, resulting in excessive storage resource overhead.

Method used

By receiving and managing raw data from the application, mixed data is obtained, which includes only data items represented in string or object format. The data format is dynamically converted using hash mapping and instantiation operations to reduce storage space requirements.

Benefits of technology

It effectively reduces the storage resource overhead of applications and reduces the storage space occupied, especially for complex data types, reducing storage space overhead from 3A to 2A.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024114939_05032026_PF_FP_ABST
    Figure CN2024114939_05032026_PF_FP_ABST
Patent Text Reader

Abstract

Provided are a method and apparatus for managing data in an application, and a device and a medium. The method comprises: receiving raw data in an application, wherein the raw data comprises the definition of at least one data item; and acquiring hybrid data associated with the at least one data item, wherein the hybrid data comprises a first data portion in a first format and a second data portion in a second format. Herein, the first format comprises either of a character string format and an object format, the second format comprises the other of the character string format and the object format, and for a data item among the at least one data item, the hybrid data comprises a data item expressed in the first format or a data item expressed in the second format. By using the exemplary implementations of the present disclosure, for a certain data item, the hybrid data comprises only a copy of the data item in one format. In this way, the storage resource overhead for loading relevant data of an application can be reduced to a certain extent, thereby improving the performance of the application.
Need to check novelty before this filing date? Find Prior Art

Description

Methods, apparatus, devices, and media for managing data in applications. Technical Field

[0001] Exemplary implementations of this disclosure generally relate to computer technology, and in particular to methods, apparatus, devices, and computer-readable storage media for managing data in applications. Background Technology

[0002] Applications can run on various types of electronic devices. These applications can include a variety of predefined data, which can be loaded into the electronic device's memory (e.g., RAM) to execute the application's functions. Applications can contain large amounts of data, which can consume significant amounts of storage space. Therefore, it is desirable to manage the data within the application more efficiently, thereby reducing the application's storage requirements.

[0003] Summary of the Invention

[0004] In a first aspect of this disclosure, a method for managing data in an application is provided. In this method, raw data from the application is received, the raw data including the definition of at least one data item. Mixed data associated with the at least one data item is obtained, the mixed data including a first data portion in a first format and a second data portion in a second format. Here, the first format includes either a string format or an object format, the second format includes the other of a string format and an object format, and for each data item in the at least one data item, the mixed data includes either a data item represented in the first format or a data item represented in the second format.

[0005] In a second aspect of this disclosure, an apparatus for managing data in an application is provided. The apparatus includes: a receiving module configured to receive raw data from the application, the raw data including the definition of at least one data item; and an acquiring module configured to acquire mixed data associated with the at least one data item, the mixed data including a first data portion in a first format and a second data portion in a second format. Here, the first format includes either a string format or an object format, and the second format includes the other of a string format and an object format. For each data item in the at least one data item, the mixed data includes either a data item represented in the first format or a data item represented in the second format.

[0006] In a third aspect of this disclosure, an electronic device is provided. The electronic device includes: at least one processing unit; and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions causing the electronic device to perform the method according to a first aspect of this disclosure when executed by the at least one processing unit.

[0007] In a fourth aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, causes the processor to implement the method according to a first aspect of this disclosure.

[0008] In a fifth aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method according to a first aspect of this disclosure.

[0009] It should be understood that the content described in this content section is not intended to limit the key or essential features of the implementation of this disclosure, nor is it intended to restrict the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0010] In the following detailed description, the above and other features, advantages, and aspects of the various implementations of this disclosure will become more apparent, taken in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals denote the same or similar elements, wherein:

[0011] Figure 1 shows a block diagram illustrating the relationships between various types of data in the application;

[0012] Figure 2 shows a block diagram of some implementations of this disclosure for managing data in an application;

[0013] Figure 3 shows a block diagram of a data item in the raw data according to some implementations of this disclosure;

[0014] Figures 4A to 4E illustrate block diagrams of the data conversion process between string and object formats according to some implementations of this disclosure;

[0015] Figure 5 shows a block diagram of the data in the heap of an application according to some implementations of this disclosure;

[0016] Figure 6 shows a flowchart of a method for managing data in an application according to some implementations of this disclosure;

[0017] Figure 7 shows a block diagram of an apparatus for managing data in an application according to some implementations of the present disclosure; and

[0018] Figure 8 shows a block diagram of a device capable of implementing various implementations of the present disclosure. Detailed Implementation

[0019] Implementations of this disclosure will now be described in more detail with reference to the accompanying drawings. While some implementations 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 implementations set forth herein. Rather, these implementations are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and implementations of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0020] In the description of the implementation methods disclosed herein, the term "comprising" and similar terms should be understood as open inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one implementation" or "the implementation" should be understood as "at least one implementation". The term "some implementations" should be understood as "at least some implementations". Other explicit and implicit definitions may also be included below. As used herein, the term "model" can represent the relationships between various data. For example, the aforementioned relationships can be obtained based on various currently known and / or future-developed technical solutions.

[0021] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.

[0022] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure through appropriate means in accordance with relevant laws and regulations, and user authorization should be obtained.

[0023] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.

[0024] As an optional but non-restrictive implementation, in response to a user's active request, a prompt message can be sent to the user, for example, via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose whether to "agree" or "disagree" to provide personal information to the electronic device.

[0025] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0026] The term "in response to" as used herein refers to a state in which a corresponding event occurs or a condition is satisfied. It will be understood that the timing of subsequent actions performed in response to such event or condition is not necessarily strongly correlated with the time when the event occurs or the condition is met. For example, in some cases, subsequent actions may be performed immediately upon the occurrence of the event or the fulfillment of the condition; while in others, they may be performed some time after the occurrence of the event or the fulfillment of the condition.

[0027] Example Environment

[0028] Applications may include a variety of predefined data, which can be loaded into the memory (e.g., RAM) of an electronic device to perform the functions of the application. Applications may include a large amount of data, which will occupy a significant amount of storage space. Referring to Figure 1, which describes an application environment according to some implementations of this disclosure, Figure 1 illustrates a block diagram 100 showing the relationships between various types of data in the application.

[0029] For ease of description, this disclosure will use an application running in an Android environment as an example to illustrate the specific process of managing data within the application. As shown in Figure 1, the application may include raw data 110, which can be defined in various formats. For example, data can be defined using JSON (JavaScript Object Notation). JSON is a lightweight data-interchange format that is easy for humans to read and write, and also easy for machines to parse and generate. JSON is a subset of JavaScript and includes keys and values.

[0030] In the Android environment, data items defined in JSON format can be loaded into the electronic device's storage (e.g., the heap in memory) and accessed. Specifically, raw data 110 can be converted into raw object 120 (e.g., JSONObject format), and then raw object 120 can be converted into data object 130, that is, object instances of the corresponding types are generated through instantiation operations. At this time, the heap may contain data items in multiple formats, such as raw data 110 in string format, raw object 120 in string format, and data object 130 in object format. This will result in a significant storage space overhead. Therefore, it is desirable to manage the data in the application in a more efficient way, thereby reducing the storage space requirements.

[0031] Overview of the management application

[0032] To at least partially address the shortcomings of the prior art, a method for managing data in an application is proposed according to an exemplary implementation of this disclosure. Referring to FIG2, which describes an outline of an exemplary implementation of this disclosure, FIG2 illustrates a block diagram 200 for managing data in an application according to some implementations of this disclosure. As shown in FIG2, raw data 110 from the application can be received, which may include the definition of at least one data item (e.g., data item 112). Subsequently, mixed data 230 associated with the at least one data item can be obtained.

[0033] Here, the mixed data 230 may include a first data portion 210 of a first format and a second data portion 220 of a second format. Specifically, the first format may include either a string format or an object format, and the second format may include the other of a string format and an object format. For at least one data item, the mixed data 230 includes either a data item represented in the first format or a data item represented in the second format. In other words, it includes only data items represented in one of the two formats.

[0034] For data item 112, which is a string represented in JSON format, the specific content of the string can be parsed to generate data item 212 or 222. It should be understood that for any given data item, the mixed data may only include the corresponding data item represented in the first format, or only include the corresponding data item represented in the second format. As shown in Figure 2, assuming the first data portion 210 of the mixed data 230 includes data item 212 represented in the first format, then the second data portion 220 does not include (as shown by the dashed line) data item 222 represented in the second format. Alternatively and / or additionally, assuming the second data portion 220 of the mixed data 230 includes data item 222 represented in the second format, then the first data portion 210 does not include data item 212 represented in the first format.

[0035] Using some implementations of this disclosure, the hybrid data 230 includes only a copy of the data item in one format. In this way, the storage space requirement of the hybrid data 230 can be reduced, thereby reducing the storage resource overhead of the application.

[0036] Detailed process of managing applications

[0037] Having described an overview of some implementations according to this disclosure, further details of some implementations according to this disclosure are described below with reference to the accompanying drawings. Figure 3 shows a block diagram 300 of data items in raw data according to some implementations of this disclosure. The raw data may include at least one data item; Figure 3 shows three data items by way of example only. Alternatively and / or additionally, the raw data 110 may include more or fewer data items.

[0038] As shown in Figure 3, the original data 110 is represented in JSON format and may include data items 310, 320, and 330. Data item 310 can represent a simple data item, in which case the key of the data item is "code" and the value is "0" (e.g., represented as an integer int). That is, data item 310 defines an integer variable "code", and the specific value of the variable is "0". Alternatively and / or additionally, the original data 110 may include other simple data items of other types (e.g., floating-point types, string types, array types, etc.).

[0039] Data item 320 can represent an object type. In this case, the key of this data item is "size", and the value is "x":800, "y":600. For example, data item 330 can represent a complex data item. The key of this data item is "data", and the value is another object "log" (i.e., sub-data item 340). The key of this other object is "log", and the value is the object: "val":"2024***","type":3,"vid":1.

[0040] It should be understood that although data item 330 includes only one sub-data item, in other definitions, a data item may include one or more levels of nested sub-data items. For example, sub-data item 340 may include another nested sub-object at a lower level, and that other nested sub-object may include a nested sub-object at an even lower level, and so on. Figure 3 merely shows an example of a data item; alternatively and / or additionally, other data items with different keys and values ​​may exist.

[0041] According to some implementations of this disclosure, the first format can be a string format and the second format can be an object format. Alternatively and / or additionally, the first and second formats can be interchanged, in which case the second format can be a string format and the first format can be an object format. For ease of description, the process of determining the mixed data 230 will be described below with the first format being a string format and the second format being an object format.

[0042] According to some implementations of this disclosure, based on the definition of at least one data item, a first data portion is obtained. The first data portion may include at least one data entry corresponding to the at least one data item. The data entry in the at least one data entry is represented in string format and includes a key and a value. A second data portion is then obtained, which is empty. See Figures 4A-4E for further details, which illustrate block diagrams 400A-400E of the data conversion process between string format and object format according to some implementations of this disclosure.

[0043] As shown in Figure 4A, a first data portion represented in string format 410 and a second data portion represented in object format 420 can be generated. Specifically, the original data 110 can be read and each data item can be extracted according to the definition of JSON. Data items in the original data can be converted to JSONObject format. For example, a LinkedHashMap can be used to represent them to determine the corresponding data entry. For example, data item 310 can be converted to data entry 412, where the key can represent "code" and the value can represent "0". Here, the value can be represented using JSONPrimitive format. Here, JSONPrimitive typically represents the primitive data type in the JSON data format. For another example, data item 320 can be converted to data entry 414, where the key can represent "size" and the value can represent: "x":800, "y":600.

[0044] In the initial stage, a first data portion represented in string format can be determined, and the second data portion can be empty. Utilizing some implementations of this disclosure, the mixed data 230 only includes string format and does not incur double the storage space overhead.

[0045] According to some implementations of this disclosure, in response to receiving a first access request for a data item from the application's business logic, a data object corresponding to the data item is obtained based on a data item corresponding to the data item in at least one data entry, the data object being represented in object format; the data object is stored in a second data portion; and the data item is removed from the first data portion.

[0046] As the application is used, the business logic within it can access defined data items. At this point, it's necessary to convert the data items from string format to object format to perform subsequent calculations. Specifically, assuming the business logic accesses data item 412, it can obtain the corresponding data object (e.g., data object 422). This data object 422 can then be added to the second data portion represented by object format 420, and data item 412 can be removed from the first data portion represented by string format (as shown by the dashed line). At this point, the mixed data 230 includes data item 414 represented by string format 410, etc., and data objects represented by object format 420.

[0047] Using some implementations of this disclosure, since data entry 412 has been removed from the mixed data 230, the storage space occupied by data entry 412 will be released, and the overall storage space of the mixed data 230 will remain approximately unchanged. Compared to existing technical solutions that require maintaining two copies of both string and object formats simultaneously, the storage space occupied by the mixed data 230 will be significantly reduced.

[0048] According to some implementations of this disclosure, during the process of obtaining the first data portion, the name and data value of the data item are obtained from the definition of the data item; and the key of the data entry is set based on the name, and the value of the data entry is set based on the data value. Specifically, the name and data value of the data item can be extracted according to the JSON definition. For example, a comma "," can be used to separate two data items, and a colon ":" can be used to separate the name and value. In this case, the part before the colon can be used as the name, and the part after the colon can be used as the data value. Similar operations can be performed for each data item to obtain the data entry corresponding to each data item. Using some implementations of this disclosure, the name and data value can be extracted in a simple and efficient way to generate the corresponding data entry.

[0049] According to some implementations of this disclosure, during the process of obtaining a data object, the name of the data object can be determined based on the key of the data entry, and the instance of the data object can be determined based on the value of the data entry. Continuing the example above, the key and value of data entry 412 are "code" and "0" respectively. An instance of the corresponding data object can then be generated through an instantiation operation. Specifically, corresponding storage space can be allocated in the application's heap to store the instance. Subsequently, the application's business logic can access the instance to perform subsequent computational operations.

[0050] According to some implementations of this disclosure, the object format can be stored as a hash map, and the instances have a type specified by definition. For example, assuming that "0" in data entry 412 is represented by an integer, an instance represented by an integer can be generated, and the name of this instance is "code". In this way, corresponding instances can be generated according to the desired format, thereby achieving the desired functionality of the application.

[0051] Similar object data can be created for other data items in a similar manner, as described in more detail in Figure 4C. Figure 4C shows a block diagram 400C of the data conversion process between string format and object format according to some implementations of this disclosure. As shown in Figure 4C, in response to receiving an access request for data entry 414, data object 424 can be created and data entry 414 can be deleted (as shown by the dashed line). At this time, the data object 424 is named "size" and the instance is of type Object, and includes: "x":800, "y":600. At this time, variables x and y can have types defined in the original data, such as integers.

[0052] Alternatively and / or additionally, during application startup, all data items can be loaded into the heap by default to form string-formatted data entries, and then each data entry can be converted into its corresponding data object. This method allows for pre-fetching of data objects, thereby improving the speed of accessing them.

[0053] The process of converting from string format 410 to object format 420 has been described. Alternatively and / or additionally, a reverse conversion can be performed, i.e., converting from object format 420 to string format 410. In this case, the first format and the second format can be interchanged, and the first data portion and the second data portion are also interchanged accordingly.

[0054] According to some implementations of this disclosure, the first format is an object format, and the second format is a string format. Further, in response to receiving a second access request for a data item from the application's business logic, based on the data object corresponding to the data item in the first data section, a data entry corresponding to the data item is obtained, the data entry being represented in string format; the data entry is written to the second section; and the data object is removed from the first section.

[0055] Specifically, if the application's business logic requires access to the original string format, a reverse conversion process can be performed. In this case, data object 424 in Figure 4C will be converted to data entry 414. During the conversion process, the instantiated data object can be converted to string format. For example, the name "size" of the data object can be converted to the string "size", and the variables x (value 800) and y (value 600) in the data object can be converted to the strings: "x":800, "y":600. At this point, the corresponding data entry 414 can be generated, that is, the key is "size", and the values ​​are: "x":800, "y":600. Furthermore, the corresponding data entry can be written to the string format data portion, and the corresponding data object can be deleted from the object format data portion.

[0056] Referring to Figure 4D for further details, which illustrates a block diagram 400D of the data conversion process between string format and object format according to some implementations of this disclosure. At this time, the data portion of object format 420 only includes data object 422, and the data portion of string format 410 includes data item 414, etc. Similarly, data object 422 can be converted into corresponding data item 412. Figure 4E illustrates a block diagram 400E of the data conversion process between string format and object format according to some implementations of this disclosure. At this time, the data portion of object format 420 is empty, and the data portion of string format 410 includes data items 412, 414, etc.

[0057] It should be understood that although only the process for generating simple data objects has been shown above, complex data types including nested sub-data items can be handled in a similar manner, alternatively and / or additionally. According to some implementations of this disclosure, during the retrieval of a data item, the value of the data item can be determined based on sub-data items, the value including the sub-data items associated with the sub-data item. Utilizing some implementations of this disclosure allows the definition of data items involving complex structures (e.g., nested structures) within an application, thereby supporting the application in performing complex tasks.

[0058] Specifically, for data item 330 shown in Figure 3, the names and data values ​​of each sub-data item included in this data item can be obtained iteratively, and corresponding data entries can be generated. At this time, the key of the data entry can be represented as "data", and the value can be represented as another data entry. The key of this other data entry can be represented as "log", and the value can be represented as: "val":"2024***","type":3,"vid":1. In other words, the value at this time corresponds to a data entry of the object type.

[0059] It should be understood that the above description uses data item 330 as an example to illustrate the case of including a nested sub-data item. A data item may include multiple nested sub-data items at the same level. In this case, each sub-data item can be processed in a similar manner to generate a data item with multiple sub-data entries. Alternatively and / or additionally, a data item may include multiple nested sub-data items at different levels. In this case, each sub-data item can be processed in a similar manner to generate a data item with more levels of sub-data entries. Using some implementations of this disclosure, defined data items can be loaded into the heap in a simple and efficient manner, thereby supporting subsequent processing by the application.

[0060] Furthermore, during the process of obtaining instances of data objects, sub-instances of the sub-data objects can be obtained based on sub-data entries, and sub-instances can be added to the existing instances. Continuing with data item 330 as an example, a data object named "data" can be generated, and a corresponding sub-instance can be created based on the sub-data entry "log". This sub-instance can be named "log", and its content is of object type, containing three variables: a string variable "val" (value 2024***), and integer variables "type" (value 3) and "vid" (value 1). Using some implementation methods disclosed herein, instances of the defined data objects can be generated in the heap in a simple and efficient manner, thereby supporting subsequent processing by the application.

[0061] It should be understood that for data objects with complex structures, a process similar to that described above can be used to convert them into string format. For example, a depth-first approach can be used to find the sub-data object with a maximum depth N, and this sub-data object can be converted into a corresponding sub-data entry (depth N). Further, one or more sub-data objects at the previous depth can be processed to generate the corresponding sub-data object (depth N-1). Sub-data objects with smaller depths can be processed iteratively until the data object at the root (depth 1) position is determined.

[0062] Specifically, the instance "log" of the data object can be converted into a corresponding sub-data entry (depth 2, key can be "log", and value can be "val":"2024***","type":3,"vid":1). The root data entry can be further determined, with key "data" and value being the determined sub-data entry at depth 2. Using some implementations of this disclosure, conversion between string and object formats can be performed simply and efficiently, ensuring that mixed data does not consume excessive storage space during application runtime.

[0063] According to some implementations of this disclosure, the hybrid object is stored in the heap of the memory of the device used to execute the application. See Figure 5 for further details, which shows a block diagram 500 of the data in the heap of an application according to some implementations of this disclosure. During application execution, raw data 110 can be loaded into the heap 510 of the memory of the electronic device executing the application, and then hybrid data 530 (including data in both string format 410 and object format 420) can be generated based on the raw data 110.

[0064] For the original data 110 shown in Figure 3, data item 310 is converted into data entry 512 in string format, data item 514 in string format, and so on. Subsequently, as the application's business logic accesses each data item 310, 320, etc., data entries 512, 514, etc., can be converted into data objects 522, 524, etc. in object format 420. At this point, for a single data item, the heap 510 only contains a single data item in string format or object format; that is, it only contains data entries in string format or data objects in object format.

[0065] Assuming the storage space occupied by the original data 110 is A, the storage space occupied by the mixed data is also approximately A, and the storage space occupied by the heap 510 is approximately 2A. However, in existing technical solutions, the heap 510 stores data items in both string format 410 and object format 420, resulting in a storage space occupied by the heap 510 of approximately 3A. Using some implementation methods of this disclosure, the storage space overhead occupied by the application can be significantly reduced, i.e., from 3A to 2A.

[0066] It should be understood that although caching-based technologies have been developed to reduce storage space overhead, these technologies are only suitable for reducing storage space for simple constant data items (e.g., integers, strings, floating-point numbers), and are not suitable for complex data types (e.g., complex data types including nested data). In this case, the more complex data types defined in the original data 110, the greater the amount of storage space saved. In one scenario, assuming all data items in the original data 110 are complex types, the storage space overhead can be reduced from 3A to 2A. In other scenarios, assuming some data items in the original data 110 are complex types, the storage space overhead can be reduced to a value between 2A and 3A.

[0067] It should be understood that although the above example uses an application running in an Android environment to describe the specific process of managing data within an application, alternatively and / or additionally, the application can be run in other application environments, such as iOS and / or other environments. In this case, other types of classes may be involved during execution. Data entries in string format and data objects in object format can be created according to the classes supported in other environments, based on the process described above, thereby reducing memory resource overhead.

[0068] Using some implementations of this disclosure, for at least one data item, the mixed data includes: a data item represented in a first format or a data item represented in a second format. In this way, the storage resource overhead for loading application-related data can be reduced to some extent, thereby improving application performance.

[0069] Example process

[0070] Figure 6 illustrates a flowchart of a method 600 for managing data in an application according to some implementations of this disclosure. At block 610, raw data from the application is received, the raw data including the definition of at least one data item. At block 620, mixed data associated with at least one data item is obtained, the mixed data including a first data portion in a first format and a second data portion in a second format. Here, the first format includes either a string format or an object format, and the second format includes the other of a string format and an object format. For each data item in the at least one data item, the mixed data includes either a data item represented in the first format or a data item represented in the second format.

[0071] According to some implementations of this disclosure, the first format is a string format, the second format is an object format, and obtaining mixed data includes: obtaining a first data portion based on the definition of at least one data item, the first data portion including at least one data entry corresponding to at least one data item, the data entry in the at least one data entry being represented in string format and including a key and a value; and obtaining a second data portion, the second data portion being empty.

[0072] According to some implementations of this disclosure, the method 600 further includes: in response to receiving a first access request for a data item from business logic of an application, obtaining a data object corresponding to the data item based on a data item corresponding to the data item in at least one data entry, the data object being represented in object format; storing the data object in a second data portion; and removing the data item from the first data portion.

[0073] According to some implementations of this disclosure, obtaining the first data part includes: obtaining the name and data value of the data item from the definition of the data item; and setting the key of the data entry based on the name, and setting the value of the data entry based on the data value.

[0074] According to some implementations of this disclosure, obtaining a data object includes: determining the name of the data object based on the key of the data entry; and determining the instance of the data object based on the value of the data entry.

[0075] According to some implementations of this disclosure, the object format is stored in the form of a hash map, and the instance has a type specified by definition.

[0076] According to some implementations of this disclosure, the data item is a complex data type, and the value of the complex data type includes nested sub-data items. Obtaining a data item includes: determining the value of the data item based on the sub-data items, the value including the sub-data items associated with the sub-data items.

[0077] According to some implementations of this disclosure, obtaining an instance of a data object includes: obtaining a sub-instance of a sub-data object based on a sub-data entry; and adding a sub-instance to an instance.

[0078] According to some implementations of this disclosure, the first format is an object format, the second format is a string format, and method 600 further includes: in response to receiving a second access request for a data item from the application's business logic, obtaining a data entry corresponding to the data item based on the data object corresponding to the data item in the first data portion, the data entry being represented in string format; writing the data entry to the second portion; and removing the data object from the first portion.

[0079] According to some implementations of this disclosure, the hybrid object is stored in the heap of the memory of the device used to execute the application.

[0080] Example devices and equipment

[0081] Figure 7 shows a block diagram of an apparatus 700 for managing data in an application according to some implementations of the present disclosure. The apparatus 700 includes: a receiving module 710 configured to receive raw data from the application, the raw data including the definition of at least one data item; and an acquiring module 720 configured to acquire mixed data associated with at least one data item, the mixed data including a first data portion in a first format and a second data portion in a second format, wherein the first format includes either a string format or an object format, and the second format includes the other of a string format and an object format. For each data item in the at least one data item, the mixed data includes either a data item represented in the first format or a data item represented in the second format.

[0082] According to some implementations of this disclosure, the first format is a string format, the second format is an object format, and the acquisition module 720 is further configured to: acquire a first data portion based on the definition of at least one data item, the first data portion including at least one data entry corresponding to at least one data item, the data entry in the at least one data entry being represented in string format and including a key and a value; and acquire a second data portion, the second data portion being empty.

[0083] According to some implementations of this disclosure, the acquisition module 720 is further configured to: in response to receiving a first access request for a data item from the application's business logic, acquire a data object corresponding to the data item based on a data item corresponding to the data item in at least one data entry, the data object being represented in object format; store the data object in a second data portion; and remove the data item from the first data portion.

[0084] According to some implementations of this disclosure, the acquisition module 720 is further configured to: acquire the name and data value of the data item from the definition of the data item; and set the key of the data entry based on the name and set the value of the data entry based on the data value.

[0085] According to some implementations of this disclosure, the acquisition module 720 is further configured to determine the name of the data object based on the key of the data entry; and to determine the instance of the data object based on the value of the data entry.

[0086] According to some implementations of this disclosure, the object format is stored in the form of a hash map, and the instance has a type specified by definition.

[0087] According to some implementations of this disclosure, the data item is a complex data type, the value of the complex data type includes nested sub-data items, and the acquisition module is further configured to: determine the value of the data entry based on the sub-data items, the value including the sub-data items associated with the sub-data items.

[0088] According to some implementations of this disclosure, the acquisition module 720 is further configured to: acquire a sub-instance of a sub-data object based on a sub-data entry; and add a sub-instance to an instance.

[0089] According to some implementations of this disclosure, the first format is an object format, the second format is a string format, and the acquisition module 720 is further configured to: in response to receiving a second access request for a data item from the application's business logic, acquire a data entry corresponding to the data item based on the data object corresponding to the data item in the first data part, the data entry being represented in string format; write the data entry to the second part; and remove the data object from the first part.

[0090] According to some implementations of this disclosure, the hybrid object is stored in the heap of the memory of the device used to execute the application.

[0091] Figure 8 shows a block diagram of a device 800 capable of implementing various implementations of the present disclosure. It should be understood that the computing device 800 shown in Figure 8 is merely exemplary and should not constitute any limitation on the functionality and scope of the implementations described herein. The computing device 800 shown in Figure 8 can be used to implement the methods described above.

[0092] As shown in Figure 8, the computing device 800 is in the form of a general-purpose computing device. Components of the computing device 800 may include, but are not limited to, one or more processors or processing units 810, memory 820, storage devices 830, one or more communication units 840, one or more input devices 850, and one or more output devices 860. The processing unit 810 may be a physical or virtual processor and is capable of performing various processes according to programs stored in memory 820. In a multiprocessor system, multiple processing units execute computer-executable instructions in parallel to improve the parallel processing capability of the computing device 800.

[0093] Computing device 800 typically includes multiple computer storage media. Such media can be any available media accessible to computing device 800, including but not limited to volatile and non-volatile media, removable and non-removable media. Memory 820 can be volatile memory (e.g., registers, cache, random access memory (RAM)), non-volatile memory (e.g., read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. Storage device 830 can be removable or non-removable media and can include machine-readable media, such as flash drives, disks, or any other media that can be used to store information and / or data (e.g., training data for training) and can be accessed within computing device 800.

[0094] The computing device 800 may further include additional removable / non-removable, volatile / non-volatile storage media. Although not shown in FIG8, disk drives for reading from or writing to removable, non-volatile disks (e.g., "floppy disks") and optical disk drives for reading from or writing to removable, non-volatile optical disks may be provided. In these cases, each drive may be connected to a bus (not shown) via one or more data media interfaces. The memory 820 may include a computer program product 825 having one or more program modules configured to perform various methods or actions of various implementations of the present disclosure.

[0095] The communication unit 840 enables communication with other computing devices via a communication medium. Additionally, the components of the computing device 800 can function as a single computing cluster or multiple computing machines capable of communicating via communication connections. Therefore, the computing device 800 can operate in a networked environment using logical connections to one or more other servers, networked personal computers (PCs), or another network node.

[0096] Input device 850 can be one or more input devices, such as a mouse, keyboard, trackball, etc. Output device 860 can be one or more output devices, such as a monitor, speaker, printer, etc. Computing device 800 can also communicate as needed with one or more external devices (not shown) via communication unit 840. These external devices, such as storage devices, display devices, etc., can communicate with one or more devices that enable user interaction with computing device 800, or with any device (e.g., network card, modem, etc.) that enables computing device 800 to communicate with one or more other computing devices. Such communication can be performed via input / output (I / O) interfaces (not shown).

[0097] According to exemplary implementations of this disclosure, a computer-readable storage medium is provided that stores computer-executable instructions thereon, wherein the computer-executable instructions are executed by a processor to implement the methods described above. According to exemplary implementations of this disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, which are executed by a processor to implement the methods described above. According to exemplary implementations of this disclosure, a computer program product is provided that stores a computer program thereon, which, when executed by a processor, implements the methods described above.

[0098] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, devices, and computer program products implemented according to this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0099] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0100] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions that execute on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0101] 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 an instruction, which contains one or more executable instructions for implementing the specified logical function. 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 consecutive 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, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0102] Various implementations of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed implementations. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described implementations. The terminology used herein is chosen to best explain the principles, practical applications, or improvements to technology in the market, or to enable others skilled in the art to understand the various implementations disclosed herein.

Claims

1. A method for managing data in an application, comprising: Receive raw data from the application, the raw data including the definition of at least one data item; as well as Acquire mixed data associated with the at least one data item, the mixed data comprising a first data portion in a first format and a second data portion in a second format. The first format includes either a string format or an object format, and the second format includes the other of the string format and the object format. For the data item in the at least one data item, the mixed data includes: the data item represented in the first format or the data item represented in the second format.

2. The method according to claim 1, wherein the first format is the string format, the second format is the object format, and obtaining the mixed data includes: Based on the definition of the at least one data item, the first data portion is obtained, the first data portion including at least one data entry corresponding to the at least one data item, the data entry in the at least one data entry being represented in the string format and including a key and a value; as well as Obtain the second data portion, which is empty.

3. The method according to claim 2, further comprising: In response to receiving a first access request for the data item from the application's business logic, a data object corresponding to the data item is obtained based on the data item corresponding to the data item in the at least one data item, and the data object is represented in the object format; Store the data object in the second data portion; as well as Remove the data entry from the first data section.

4. The method according to claim 3, wherein obtaining the first data portion comprises: Obtain the name and data value of the data item from its definition; as well as The key of the data entry is set based on the name, and the value of the data entry is set based on the data value.

5. The method according to claim 4, wherein obtaining the data object comprises: Based on the key of the data entry, determine the name of the data object; as well as An instance of the data object is determined based on the value of the data entry.

6. The method of claim 5, wherein the object format is stored in a hash mapping manner, and the instance has a type specified by the definition.

7. The method of claim 5, wherein the data item is a complex data type, and the value of the complex data type includes nested sub-data items, wherein obtaining the data item includes: Based on the sub-data item, the value of the data entry is determined, the value including the sub-data entry associated with the sub-data item.

8. The method of claim 7, wherein obtaining the instance of the data object comprises: Based on the sub-data entry, obtain a sub-instance of the sub-data object; as well as Add the child instance to the instance.

9. The method according to claim 1, wherein the first format is an object format, the second format is a string format, and the method further comprises: In response to receiving a second access request for the data item from the application's business logic, a data entry corresponding to the data item is obtained based on the data object in the first data portion, the data entry being represented in the string format; Write the data entry into the second part; as well as Remove the data object from the first part.

10. The method of claim 1, wherein the hybrid object is stored in a heap of the memory of the device used to execute the application.

11. An apparatus for managing data in an application, comprising: A receiving module is configured to receive raw data in the application, the raw data including the definition of at least one data item; as well as An acquisition module is configured to acquire mixed data associated with the at least one data item, the mixed data including a first data portion in a first format and a second data portion in a second format, wherein the first format includes either a string format or an object format, and the second format includes the other of the string format and the object format. For a data item among the at least one data item, the mixed data includes: the data item represented in the first format or the data item represented in the second format.

12. An electronic device, comprising: At least one processing unit; as well as At least one memory, coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions causing the electronic device to perform the method according to any one of claims 1 to 10 when executed by the at least one processing unit.

13. A computer-readable storage medium having a computer program stored thereon, the computer program causing the processor to implement the method according to any one of claims 1 to 10 when executed by a processor.

14. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Data conversion method and device and storage medium

    CN114020965A

  • Data processing method and device, electronic equipment and readable storage medium

    CN117493443A

  • Method and system for customizing and converting storage format of vector database

    CN117667932A

  • Data format conversion method and device, server, medium and computer program

    CN118194826A

  • Efficient indexing for querying arrays in databases

    US20210357373A1