Serialization method and device of service data, electronic equipment, storage medium and program product

By traversing the data syntax tree of business data, determining the encoding rules of each tree structure layer and performing transformation, the problem of non-serialization in existing technologies is solved, and data serialization and deserialization under hierarchical relationships are realized.

CN122240682APending Publication Date: 2026-06-19RICHFIT INFORMATION TECH +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
RICHFIT INFORMATION TECH
Filing Date
2024-12-17
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing technologies cannot serialize data based on hierarchical relationships when business data has been defined.

Method used

By traversing the data syntax tree corresponding to the business data, the encoding rules of each tree structure layer are determined, and the business sub-data is transformed according to these rules to finally determine the serialization result of the business data.

Benefits of technology

It enables data serialization based on the defined hierarchical relationship of business data, ensuring data consistency and integrity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122240682A_ABST
    Figure CN122240682A_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, electronic device, storage medium, and program product for serializing business data. The method includes: upon receiving a serialization instruction, traversing the data syntax tree corresponding to the business data, determining the encoding rules corresponding to each tree structure layer in the data syntax tree, wherein the business syntax tree indicates the hierarchical relationship between multiple business sub-data; converting the business sub-data according to the encoding rules corresponding to the tree structure layer to which each business sub-data belongs, obtaining sub-conversion results corresponding to each of the converted business sub-data; and determining the serialization result corresponding to the business data based on all sub-conversion results. This method achieves the effect of serializing data according to the data hierarchy when the business data has a defined hierarchical relationship.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and more particularly to a method, apparatus, electronic device, storage medium, and program product for serializing business data. Background Technology

[0002] With the rapid development of information technology, enterprise information systems are becoming increasingly complex and diverse, placing higher demands on data management and processing. Especially in model-driven system design, how to efficiently define, store, transmit, and use model metadata has become a key issue. Abstract syntax trees (APIs), as a high-level data structure, are widely used in compiler design and model-driven engineering because they can clearly represent the structure of a program. However, in practical applications, APIs need to interact with persistent storage mechanisms such as databases, which requires the system to be able to efficiently convert between API structures and database storage structures.

[0003] While current serialization algorithms can meet basic data exchange needs to some extent, they often fall short when faced with complex business scenarios and customized model structures. These algorithms may fail to accurately represent concepts in specific domains or may not meet real-time performance requirements.

[0004] There is an urgent need to address the problem in related fields where data cannot be serialized based on hierarchical relationships when business data is defined hierarchically. Summary of the Invention

[0005] This application provides a method, apparatus, electronic device, storage medium, and program product for serializing business data, which can achieve the effect of serializing data according to the data hierarchy when the business data has a defined hierarchical relationship.

[0006] In a first aspect, embodiments of this application provide a method for serializing business data, comprising: upon receiving a serialization instruction, traversing a data syntax tree corresponding to the business data, determining the encoding rules corresponding to each tree structure layer in the data syntax tree, wherein the business syntax tree is used to indicate the hierarchical relationship between multiple business sub-data; converting the business sub-data according to the encoding rules corresponding to the tree structure layer to which each business sub-data belongs, to obtain sub-conversion results corresponding to the multiple business sub-data after conversion; and determining the serialization result corresponding to the business data based on all sub-conversion results.

[0007] In one possible implementation, each child node in the data syntax tree is traversed, and the set of tree structure layers corresponding to the data syntax tree is determined according to the upstream and downstream relationships between child nodes. The set of tree structure layers includes: multiple tree structure layers, multiple level labels, and a first mapping relationship between the multiple tree structure layers and the multiple level labels. A query instruction is sent to the cache center according to the multiple level labels carried by the set of tree structure layers, and the query result is obtained from the cache center. The cache center stores a second mapping relationship between preset level labels, preset encoding rules, and the preset level labels and preset encoding rules. The encoding rule corresponding to each tree structure layer is determined according to the encoding rule carried by the query result.

[0008] In one possible implementation, upon receiving a deserialization instruction, it is determined whether the target object has uploaded differential data based on the business data, wherein the differential data carries at least differential text structure data; if the target object has not uploaded differential data, it is determined that the encoding rules are reverse-executed based on the text structure data carried in the serialization result to obtain the deserialization result corresponding to the serialization result, wherein the deserialization result carries database structure data.

[0009] In one possible implementation, if the target object has uploaded differential data, the differential text structure data is merged with the text structure data carried in the serialization result to obtain the target data; the encoding rules are executed in reverse based on the target data to obtain the deserialization result corresponding to the target data, wherein the deserialization result carries database structure data.

[0010] In one possible implementation, if the query result carries multiple preset encoding rules, the preset level tags corresponding to the multiple preset encoding rules are determined to obtain a preset level tag set; the preset level tag set is matched with the multiple level tags carried by the tree structure layer set to obtain a matching result; and the encoding rule corresponding to each tree structure layer is determined according to the matching result.

[0011] In one possible implementation, if the matching result indicates that there exists a preset level label in the preset level label set that matches the level label carried by the tree structure layer set, the preset encoding rule corresponding to the matching preset level label is determined as the encoding rule corresponding to the tree structure layer.

[0012] In one possible implementation, if the matching result indicates that there is no preset level tag in the preset level tag set that matches the level tag carried by the tree structure level set, an update reminder is sent to the target object, and the update reminder carries at least the preset level tag to be updated.

[0013] Secondly, embodiments of this application provide a business data serialization device, comprising: a determining module, configured to determine, based on the drilling tool's operating parameters, a target monitoring device for retrieving monitoring data corresponding to the operating state according to preset monitoring rules, wherein the monitoring rules include at least: a preset operating state, a preset monitoring device, and a mapping relationship between the preset operating state and the preset monitoring device; an acquiring module, configured to acquire the target monitoring results of the target drilling monitoring device within a preset time period; and an early warning module, configured to initiate an abnormality early warning upon receiving a payment request report indicating an abnormality in the drilling process corresponding to the drilling tool.

[0014] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;

[0015] The memory stores computer-executed instructions;

[0016] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.

[0017] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.

[0018] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.

[0019] The business data serialization method, apparatus, electronic device, storage medium, and program product provided in this application embodiment traverse a data syntax tree used to indicate the hierarchical relationship between multiple business sub-data to determine the encoding rules corresponding to each tree structure layer in the data syntax tree. These encoding rules define how to convert the data of that layer into a transmittable format such as a byte stream or string. Based on the encoding rules corresponding to the tree structure layer to which each business sub-data belongs, these business sub-data are converted separately. This step yields sub-conversion results corresponding to each of the converted business sub-data. Finally, based on all sub-conversion results, the system determines the serialization result corresponding to the business data. This method achieves the effect of serializing data according to the data hierarchy when the business data has a defined hierarchical relationship. Attached Figure Description

[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0021] Figure 1 A schematic diagram illustrating the scenario of serializing the business data provided in this application;

[0022] Figure 2 A flowchart illustrating the serialization method for the business data provided in this application;

[0023] Figure 3 The flowchart for defining the encoding rules provided in this application;

[0024] Figure 4 A schematic diagram of the data merging process provided for this application;

[0025] Figure 5 A schematic diagram of the structure of the serialization device for the business data provided in this application;

[0026] Figure 6 A schematic diagram of the structure of the serialization device for the business data provided in this application.

[0027] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0028] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0029] First, let me explain the terms used in this application:

[0030] Serialization: Serialization refers to the process of converting data structures or objects into a storable or transmittable format. After serialization, data can be written to files, sent over a network, or stored in a database.

[0031] Deserialization: Deserialization is the reverse process of serialization, that is, restoring serialized data back into the original data structure or object.

[0032] Figure 1 A schematic diagram illustrating the scenario of serializing business data provided in this application, such as... Figure 1 As shown, the specific application scenario of this application is that enterprises model based on business data and then convert the data into a form that is easy to store and transmit.

[0033] In related fields, serialization conversion can only be performed based on a single encoding rule corresponding to the business data.

[0034] Based on the above scenarios, it can be seen that in the existing technology, when the business data has a defined hierarchical relationship, it is impossible to complete the data serialization according to the data hierarchy.

[0035] The serialization of business data provided in this application solves the problem that data serialization cannot be completed based on the hierarchical relationship when the business data has a defined hierarchical relationship. This is achieved by traversing the data syntax tree corresponding to the business data upon receiving a serialization instruction, determining the encoding rules corresponding to each tree structure layer in the data syntax tree (where the business syntax tree indicates the hierarchical relationship between multiple business sub-data), and then converting the business sub-data according to the encoding rules corresponding to the tree structure layer to which each business sub-data belongs, thereby obtaining the sub-conversion results corresponding to the converted business sub-data. Finally, the serialization result corresponding to the business data is determined based on all the sub-conversion results.

[0036] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0037] Figure 2 A flowchart illustrating the serialization method for business data provided in this application is shown below. Figure 2 As shown, the method includes:

[0038] S201. Upon receiving a serialization instruction, traverse the data syntax tree corresponding to the business data to determine the encoding rules corresponding to each tree structure layer in the data syntax tree, wherein the business syntax tree is used to indicate the hierarchical relationship between multiple business sub-data.

[0039] Optionally, the system first constructs a data syntax tree based on business requirements. This tree structure is used to represent the hierarchical relationships of business data and the data types at each level.

[0040] During the traversal of the data syntax tree, the system determines the corresponding encoding rules for each layer of the tree structure. These encoding rules define how to convert the data at that layer into a transmittable format (such as a byte stream or string).

[0041] It should be noted that the encoding rules are defined in advance, such as... Figure 3 As shown, Figure 3 The flowchart for defining the encoding rules provided in this application is as follows:

[0042] Custom data structure: First, a suitable data structure needs to be designed based on business requirements;

[0043] Abstract Syntax Tree Node Data Definition: In many cases, data can be organized into a tree structure, where each node represents a part or attribute of the data. Defining a tree node means determining the data type of each node and how it relates to other nodes;

[0044] Defining the actual data structure for storage: Once the logical data structure is established, the next step is to define how to implement it in physical storage. Optionally, this involves choosing a database schema, table structure, or file format, etc.

[0045] Serialization encoding rule definition: In order for data to be transmitted or stored between different systems, a way needs to be defined to convert the data structure into a standard format (such as JSON, XML). This requires the formulation of serialization encoding rules.

[0046] Custom structure and encoding rule registration: Finally, these custom data structures and encoding rules need to be registered with the system so that the system knows how to handle these specific data types.

[0047] Optionally, the encoding rules uniformly inherit from a base class. Custom encoding rules need to implement the base class and override the corresponding serialization methods. When adding a new custom data node, it inherits the root node's default encoding rules (encoding rules for common attributes), and replaces and supplements the encoding rules according to the actual defined data type. The serialization algorithm provides a unified encoding registration and discovery cache, registering each custom data type and its corresponding custom encoding rule in the cache for use.

[0048] S202. The business sub-data is transformed according to the encoding rules corresponding to the tree structure layer to which each business sub-data belongs, to obtain the sub-transformation results corresponding to the transformation of the multiple business sub-data respectively.

[0049] For each node (i.e., business sub-data) in the data syntax tree, the system transforms it according to the encoding rules of the tree structure layer to which that node belongs. After transformation, each business sub-data generates a corresponding sub-transformation result. These results form the basis for the subsequent serialization process.

[0050] S203. Determine the serialization result corresponding to the business data based on all sub-conversion results.

[0051] The system integrates all collected sub-transformation results into a unified serialized result. This result is a complete representation containing all business sub-data transformation information. Finally, the system outputs this serialized result, which can be used for storage, transmission, or further processing.

[0052] Optionally, the entity performing the above steps can be a data format conversion system running on a computer.

[0053] In one possible implementation, each child node in the data syntax tree is traversed, and the set of tree structure layers corresponding to the data syntax tree is determined according to the upstream and downstream relationships between child nodes. The set of tree structure layers includes: multiple tree structure layers, multiple level labels, and a first mapping relationship between the multiple tree structure layers and the multiple level labels. A query instruction is sent to the cache center according to the multiple level labels carried by the set of tree structure layers, and the query result is obtained from the cache center. The cache center stores a second mapping relationship between preset level labels, preset encoding rules, and the preset level labels and preset encoding rules. The encoding rule corresponding to each tree structure layer is determined according to the encoding rule carried by the query result.

[0054] In other words, during the traversal, the system determines the set of tree structure layers corresponding to the data syntax tree based on the upstream and downstream relationships between child nodes. This set includes multiple tree structure layers (representing different levels of the tree), multiple level labels (used to identify each level), and a first mapping relationship between multiple tree structure layers and multiple level labels (explaining the correspondence between each level and its label).

[0055] Next, the system will send a query command to the cache center based on the multiple level labels carried by the tree structure layer set. The cache center is a place that stores preset information, including preset level labels, preset encoding rules, and a second mapping relationship between preset level labels and preset encoding rules.

[0056] After receiving a query command, the cache center will search for preset encoding rules that match the provided hierarchical tags and return these encoding rules as query results to the system.

[0057] Finally, the system determines the encoding rules for each tree structure layer based on the encoding rules carried in the query results. This gives each level of data a clear encoding method, facilitating subsequent processing and transmission. The mapping process from the abstract data structure (data syntax tree) to specific encoding rules, aided by a caching center, enables efficient encoding rule querying and application.

[0058] In one possible implementation, upon receiving a deserialization instruction, it is determined whether the target object has uploaded differential data based on the business data, wherein the differential data carries at least differential text structure data; if the target object has not uploaded differential data, it is determined that the encoding rules are reverse-executed based on the text structure data carried in the serialization result to obtain the deserialization result corresponding to the serialization result, wherein the deserialization result carries database structure data.

[0059] The system first receives a deserialization instruction, which means that the previously serialized data needs to be converted back to its original form or an operable format. The system checks whether the target object has uploaded differential data. This differential data must at least carry differential text structure data. If the target object has not uploaded differential data, the system will reverse-engineer the encoding rules based on the text structure data carried in the serialization result. This means the system will use the opposite rules to those used during serialization to decode the data, thus obtaining the deserialized result corresponding to the serialized result. By reversing the encoding rules, the system generates a deserialized result.

[0060] This result carries database structure data, i.e., the original business data structure, which can be further processed or used to restore the original business state. The entire process ensures that even without discrepancies, the system can accurately restore the original business data structure according to the encoding rules used during serialization. This is crucial for maintaining data consistency and integrity.

[0061] It should be noted that the serialization result carries text structure data, which is a data format that can be written to a file, sent to a network, or stored in a database.

[0062] In one possible implementation, if the target object has uploaded differential data, the differential text structure data is merged with the text structure data carried in the serialization result to obtain the target data; the encoding rules are executed in reverse based on the target data to obtain the deserialization result corresponding to the target data, wherein the deserialization result carries database structure data.

[0063] If the target object has already uploaded differential data, the system will merge this differential text structure data with the text structure data carried in the serialization result. This step is to ensure that all changes are taken into account, thus obtaining a complete target dataset.

[0064] It's important to note that to adapt to different business scenarios, the original business data will no longer meet business needs if it's not updated. Therefore, users can upload new business data based on the requirements of different business scenarios. This new business data is the difference between the original and the new data. Based on the merged target data, the system will reverse-execute the encoding rules. This means the system will use the opposite rules to those used during serialization to decode the data, thus obtaining the deserialization result corresponding to the target data. By reversing the encoding rules, the system generates a deserialization result. This result carries the database structure data, i.e., the original business data structure, which can be further processed or used to restore the original business state.

[0065] The entire process ensures that even in the presence of discrepancies, the system can accurately revert to the business data structure that includes all changes. This is crucial for maintaining data consistency and integrity.

[0066] In an optional implementation, the aforementioned business data can be model data, and the merging of model data can be as follows: Figure 4 As shown, Figure 4 The data merging flowchart provided for this application is as follows:

[0067] First, determine the basic model metadata. Based on the basic model metadata, define the database structure data and text structure data to obtain the model data.

[0068] The process begins by determining the metadata of the difference model, defining the database structure data and text structure data based on this metadata, and obtaining the model difference data. By traversing the child nodes (JSON nodes) of the model data and the model difference data, the encoding rules are found based on the registration information corresponding to the JSON nodes. After obtaining the encoding rules, they are executed in reverse to achieve deserialization. The deserialized data is then converted into node data of an abstract syntax tree. Finally, the deserialized base data and difference data are merged into a complete abstract syntax tree.

[0069] Optionally, custom data types can be defined. The overall model metadata is implemented using an abstract syntax tree. Defining a new data type is actually defining a new data node in the abstract syntax tree. Class objects are defined according to actual needs, inheriting from the base class (the basic node data type that extracts and wraps the common attributes of all data types in the abstract syntax tree node). The specific data structure type is distinguished by overriding a type field in the base class, and the custom data type attributes are described. The corresponding basic node methods are implemented to complete the customization of the data type, and at the same time, the data structure definition of the database table structure for storage is completed.

[0070] Serialization: During serialization, the overall abstract syntax tree structure is traversed, the encoding rules corresponding to each data node type are read from the cache, and the corresponding encoding rules are used for serialization, ultimately transforming it into a serialized result.

[0071] Deserialization: During deserialization, the algorithm traverses the serialized result data structure, finds the encoding rules corresponding to the data nodes in the algorithm's encoding registry, and uses the encoding rules to perform reverse conversion to obtain the deserialized basic data and difference data.

[0072] After deserialization, the base data and difference data need to be merged and assembled into a complete abstract syntax tree according to specific business requirements. Taking a data modeling project used for algorithm adaptation as an example, the base data describes the initial model structure, while the difference data records a series of additions, deletions, and modifications to the model as requirements change. During data merging, the deserialized structure is based on the base data, and the difference data is used to add, modify, and delete attribute values ​​for each node in the base data.

[0073] During the deserialization process, the deserialization algorithm can dynamically infer the data type based on the registration extension of the encoding rules, and use a caching mechanism to store the type data, avoiding repeated parsing of the same type of data and accelerating the deserialization process.

[0074] In one possible implementation, if the query result carries multiple preset encoding rules, the preset level tags corresponding to the multiple preset encoding rules are determined to obtain a preset level tag set; the preset level tag set is matched with the multiple level tags carried by the tree structure layer set to obtain a matching result; and the encoding rule corresponding to each tree structure layer is determined according to the matching result.

[0075] After receiving a query command, the cache center searches for preset encoding rules that match the provided hierarchical labels and returns these encoding rules as query results to the system. Finally, the system determines the encoding rules corresponding to each tree structure layer based on the encoding rules carried in the query results. In this way, the data at each level has a clear encoding method, facilitating subsequent processing and transmission.

[0076] In one possible implementation, if the matching result indicates that a preset level tag exists in the preset level tag set that matches the level tags carried by the tree structure layer set, the preset encoding rule corresponding to the matching preset level tag is determined as the encoding rule corresponding to the corresponding tree structure layer. That is, by querying the cache center, the preset encoding rule matching the current level tag is obtained for subsequent encoding rule application.

[0077] In one possible implementation, if the matching result indicates that there is no preset level tag in the preset level tag set that matches the level tag carried by the tree structure level set, an update reminder is sent to the target object, and the update reminder carries at least the preset level tag to be updated.

[0078] If, in the query results, no matching preset level label is found in the preset level label set that corresponds to the level label carried by the tree structure level set, an update notification is sent to the target object, carrying at least the preset level label to be updated. This step ensures that when certain level labels do not have matching preset coding rules, relevant parties are promptly notified to update or adjust them, thus guaranteeing the integrity and accuracy of the data processing flow.

[0079] The business data serialization method provided in this application, upon receiving a serialization instruction, traverses the data syntax tree corresponding to the business data to determine the encoding rules corresponding to each tree structure layer in the data syntax tree, wherein the business syntax tree is used to indicate the hierarchical relationship between multiple business sub-data; the business sub-data is converted according to the encoding rules corresponding to the tree structure layer to which each business sub-data belongs, to obtain the sub-conversion results corresponding to the multiple business sub-data after conversion; and the serialization result corresponding to the business data is determined based on all sub-conversion results. This technical means solves the problem that when the business data has a defined hierarchical relationship, it is impossible to complete the data serialization according to the data hierarchy.

[0080] Figure 5 A schematic diagram of the structure of the serialization device for business data provided in this application is shown below. Figure 5 As shown, the business data serialization device 50 provided in this embodiment includes:

[0081] The traversal module 501 is used to traverse the data syntax tree corresponding to the business data when a serialization instruction is received, and determine the encoding rules corresponding to each tree structure layer in the data syntax tree, wherein the business syntax tree is used to indicate the hierarchical relationship between multiple business sub-data.

[0082] The conversion module 502 is used to convert the business sub-data according to the encoding rules corresponding to the tree structure layer to which each business sub-data belongs, and to obtain the sub-conversion results corresponding to the conversion of the multiple business sub-data respectively.

[0083] The determination module 503 is used to determine the serialization result corresponding to the business data based on all sub-conversion results.

[0084] In one possible implementation, the traversal module 501 is used to traverse each child node in the data syntax tree, determine the set of tree structure layers corresponding to the data syntax tree based on the upstream and downstream relationships between child nodes, wherein the set of tree structure layers includes: multiple tree structure layers, multiple level labels, and a first mapping relationship between the multiple tree structure layers and the multiple level labels; issue a query instruction to the cache center based on the multiple level labels carried by the set of tree structure layers, and obtain the query result fed back by the cache center; wherein the cache center stores a preset level label, a preset encoding rule, and a second mapping relationship between the preset level label and the preset encoding rule; and determine the encoding rule corresponding to each tree structure layer based on the encoding rule carried by the query result.

[0085] In one possible implementation, the apparatus further includes: a deserialization module (not shown in the figure), configured to, upon receiving a deserialization instruction, determine whether the target object has uploaded differential data based on the business data, wherein the differential data carries at least differential text structure data; if the target object has not uploaded differential data, then determine to reverse execute the encoding rules based on the text structure data carried in the serialization result to obtain the deserialization result corresponding to the serialization result, wherein the deserialization result carries database structure data.

[0086] In one possible implementation, the deserialization module is further configured to: if the target object has uploaded differential data, merge the differential text structure data with the text structure data carried in the serialization result to obtain target data; and reverse execute the encoding rules based on the target data to obtain the deserialization result corresponding to the target data, wherein the deserialization result carries database structure data.

[0087] In one possible implementation, the deserialization module is further configured to: if the query result carries multiple preset encoding rules, determine the preset level tags corresponding to the multiple preset encoding rules respectively, and obtain a preset level tag set; match the preset level tag set with the multiple level tags carried by the tree structure layer set to obtain a matching result; and determine the encoding rule corresponding to each tree structure layer based on the matching result.

[0088] In one possible implementation, the deserialization module is further configured to, when the matching result indicates that there exists a preset level tag in the preset level tag set that matches the level tag carried by the tree structure layer set, determine the preset encoding rule corresponding to the matching preset level tag as the encoding rule corresponding to the corresponding tree structure layer.

[0089] In one possible implementation, the deserialization module is further configured to, when the matching result indicates that there is no preset level tag in the preset level tag set that matches the level tag carried by the tree structure layer set, send an update reminder to the target object, wherein the update reminder carries at least the preset level tag to be updated.

[0090] The business data serialization device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0091] Figure 6 A schematic diagram of the structure of the serialization device for the business data provided in this application. (See attached diagram.) Figure 6 As shown, the electronic device 60 provided in this embodiment includes at least one processor 601 and a memory 602. Optionally, the device 60 further includes a communication component 603. The processor 601, memory 602, and communication component 603 are connected via a bus.

[0092] In a specific implementation, at least one processor 601 executes computer execution instructions stored in memory 602, causing at least one processor 601 to perform the above-described method.

[0093] The specific implementation process of processor 601 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0094] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0095] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.

[0096] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0097] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0098] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0099] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0100] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0101] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0102] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0103] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0104] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0105] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0106] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A method for serializing business data, characterized in that, include: Upon receiving a serialization instruction, the data syntax tree corresponding to the business data is traversed to determine the encoding rules corresponding to each tree structure layer in the data syntax tree. The business syntax tree is used to indicate the hierarchical relationship between multiple business sub-data. The business sub-data is transformed according to the encoding rules corresponding to the tree structure layer to which each business sub-data belongs, so as to obtain the sub-transformation results corresponding to the transformation of the multiple business sub-data respectively; The serialization result corresponding to the business data is determined based on all sub-conversion results.

2. The method according to claim 1, characterized in that, Traverse the data syntax tree corresponding to the business data to determine the encoding rules corresponding to each tree structure layer in the data syntax tree, including: Traverse each child node in the data syntax tree and determine the set of tree structure layers corresponding to the data syntax tree based on the upstream and downstream relationships between child nodes. The set of tree structure layers includes: multiple tree structure layers, multiple level labels, and a first mapping relationship between multiple tree structure layers and multiple level labels. A query command is sent to the cache center based on the multiple level labels carried by the tree structure layer set, and the query result is obtained from the cache center; wherein, the cache center stores a preset level label, a preset encoding rule, and a second mapping relationship between the preset level label and the preset encoding rule; The encoding rules corresponding to each tree structure layer are determined based on the encoding rules carried by the query results.

3. The method according to claim 2, characterized in that, The encoding rules for each tree structure layer are determined based on the encoding rules carried by the query results, including: If the query result carries multiple preset encoding rules, determine the preset level tags corresponding to the multiple preset encoding rules respectively, and obtain a preset level tag set; The preset hierarchical tag set is matched with multiple hierarchical tags carried by the tree structure layer set to obtain the matching result; The encoding rules for each tree structure layer are determined based on the matching results.

4. The method according to claim 3, characterized in that, The encoding rules for each tree structure layer are determined based on the matching results, including: If the matching result indicates that there is a preset level tag in the preset level tag set that matches the level tag carried by the tree structure layer set, then the preset encoding rule corresponding to the matching preset level tag is determined as the encoding rule corresponding to the tree structure layer.

5. The method according to claim 3, characterized in that, The method further includes: If the matching result indicates that there is no preset level tag in the preset level tag set that matches the level tag carried by the tree structure level set, an update reminder is sent to the target object, and the update reminder carries at least the preset level tag to be updated.

6. The method according to any one of claims 1-5, characterized in that, After determining the serialization result corresponding to the business data based on all sub-conversion results, the method further includes: Upon receiving a deserialization instruction, it is determined whether the target object has uploaded differential data based on the business data, wherein the differential data carries at least differential text structure data; If the target object has not uploaded any difference data, then the encoding rules are reversed based on the text structure data carried in the serialization result to obtain the deserialization result corresponding to the serialization result, wherein the deserialization result carries database structure data.

7. The method according to claim 6, characterized in that, The method further includes: If the target object has uploaded difference data, then the difference text structure data is merged with the text structure data carried in the serialization result to obtain the target data; The encoding rules are executed in reverse based on the target data to obtain the deserialization result corresponding to the target data, wherein the deserialization result carries database structure data.

8. A serialization device for business data, characterized in that, include: The traversal module is used to traverse the data syntax tree corresponding to the business data when a serialization instruction is received, and to determine the encoding rules corresponding to each tree structure layer in the data syntax tree. The business syntax tree is used to indicate the hierarchical relationship between multiple business sub-data. The conversion module is used to convert the business sub-data according to the encoding rules corresponding to the tree structure layer to which each business sub-data belongs, and to obtain the sub-conversion results corresponding to the conversion of the multiple business sub-data respectively. The determination module is used to determine the serialization result corresponding to the business data based on all sub-conversion results.

9. A serialization device for business data, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-7.

11. A computer program product comprising a computer program that, when executed by a processor, implements the method of any one of claims 1-7.