Go language-based structure processing method, device, electronic device, and medium
By using the reflection mechanism to obtain the Go language structure field list, determine the type and perform corresponding processing, the problem of structure fields being deserialized to zero values is solved, and the default value, maximum value and minimum value can be quickly defined, reducing the developer workload and configuration errors.
Patent Information
- Application Number
- CN202211202239.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-09-29
AI Technical Summary
In the Go language, structure fields are deserialized to zero values when they do not exist in the original data. It is impossible to quickly define default, maximum, and minimum values. The numerous configuration items also increase the workload for developers and make them prone to errors.
Get the list of structure fields through reflection mechanism, determine the type and perform corresponding processing, including recursive calling of processing functions, assignment of environment variables, default values, maximum and minimum value labels, and automatic identification and assignment.
It reduces development workload, avoids configuration errors, improves development efficiency, and simplifies the definition of default values, maximum values, and minimum values of structure fields.
Smart Images

Figure CN115525291B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a structure processing method, device, electronic device, and medium based on the Go language. Background Art
[0002] In the current Golang language, open source packages such as json / yaml are available for deserializing byte array data. The choice of which package to use depends on the structural characteristics of the data. While these open source packages can successfully complete deserialization, they present the following challenges and requirements:
[0003] When a defined structure field doesn't exist in the original data, deserialization assigns a zero value based on the field's type (zero isn't necessarily 0; for example, a string type would be an empty string). However, a specified default value is often more desirable, and default values can be defined directly on the structure, allowing developers to quickly access this information.
[0004] Applications need to support defining configuration information through environment variables. For example, this scenario is needed when supporting Docker containerization. This usually requires continuous custom function calls, which cannot be defined quickly and is prone to errors due to the numerous configuration items.
[0005] Configuration items or network call messages typically define maximum or minimum values for certain fields to prevent callers from making unrestricted parameter calls and causing application system problems. For such scenarios, traditional code writing requires defining corresponding functions. However, due to the strongly typed nature of the Go language, different functions must be defined for different field types, making them impossible to reuse and increasing the burden on developers. Summary of the Invention
[0006] In order to solve the above problems, the present application provides a structure processing method, device, electronic device and medium based on the Go language, which can reduce development workload and improve development efficiency.
[0007] A first aspect of the present application discloses a structure processing method based on the Go language for use in electronic devices, the method comprising:
[0008] Get the original data stored in the form of a byte array;
[0009] Deserialize the original data to obtain the instance object,
[0010] Determine the field list of the structure variable of the instance object,
[0011] Traverse the field list and determine the field type.
[0012] The structure processing is performed based on the field type.
[0013] In a possible implementation of the first aspect, deserializing the original data to obtain the instance object includes deserializing the original data based on a predetermined structure.
[0014] In a possible implementation of the first aspect above, determining the field list of the structure variable of the instance object further includes determining a pointer of the instance object through reflection.
[0015] In a possible implementation of the first aspect above, performing the structure processing based on the field type includes, when the field type is a structure, recursively calling a predetermined processing function and modifying all structure fields; and when the field type is not a structure, performing assignment according to different field types.
[0016] In a possible implementation of the first aspect, when the field type is not a structure, performing assignment according to different field types includes:
[0017] Get the values of the environment variable tag, default value tag, maximum value tag, and minimum value tag of the corresponding field.
[0018] In a possible implementation of the first aspect above, the method further includes:
[0019] Compare the value of the maximum value tag of the corresponding field with the value of the current field. When the value of the maximum value tag is smaller than the value of the current field, assign the value of the maximum value tag to the current field.
[0020] In a possible implementation of the first aspect above, the method further includes:
[0021] The value of the minimum value tag of the corresponding field is compared with the value of the current field. When the value of the minimum value tag is greater than the value of the current field, the value of the minimum value tag is assigned to the current field.
[0022] A second aspect of the present application discloses a structure processing device based on the Go language, the device comprising:
[0023] an acquisition unit configured to acquire original data stored in the form of a byte array;
[0024] A deserialization unit is configured to deserialize the original data to obtain an instance object.
[0025] A determining unit is configured to determine a field list of a structure variable of the instance object,
[0026] A judging unit is configured to traverse the field list and judge the field type.
[0027] A processing unit is configured to perform the structure processing based on the field type.
[0028] The third aspect of the present application discloses an electronic device, comprising a memory storing computer-executable instructions and a processor; when the instructions are executed by the processor, the device implements the method described in the first aspect of the present application.
[0029] The fourth aspect of the present application discloses a computer-readable medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the method described in the first aspect of the present application.
[0030] The fifth aspect of the present application discloses a computer program product, comprising a computer program, which implements the method described in the first aspect of the present application when executed by a processor.
[0031] The Go language-based structure processing method according to the present application quickly identifies the definition information of the structure through reflection, and can quickly and directly define the default value, maximum value and minimum value of the structure field. Developers can simply and clearly identify all information without having to implement the entire assignment process by themselves, reducing a lot of development work and without having to worry about configuration errors.
[0032] Furthermore, the present invention can directly define the environment variable name, automatically identify and parse the value of the environment variable, and automatically convert the value of the environment variable (string type) to the corresponding field. Developers do not need to worry about this process, which reduces the development workload. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] To more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present invention, and those skilled in the art can derive other drawings based on these drawings without inventive effort.
[0034] Figure 1 This is a flowchart of a method for processing a structure based on the Go language according to an embodiment of the present application;
[0035] Figure 2 is a flowchart of a structure processing method based on the Go language according to another embodiment of the present application;
[0036] Figure 3is a schematic diagram of a structure processing device based on the Go language according to an embodiment of the present application;
[0037] Figure 4 It is a structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0038] The present application will be further described below with reference to specific embodiments and accompanying drawings. It should be understood that the specific embodiments described herein are intended only to illustrate the present application and are not intended to limit the present application. In addition, for ease of description, the accompanying drawings only illustrate some, but not all, structures or processes relevant to the present application.
[0039] Explanation of terms:
[0040] Go: Go (also known as Golang) is a statically strongly typed, compiled language developed by Google. Its syntax is similar to C, but it offers features like memory safety, garbage collection (GC), structural morphology, and CSP-style concurrent computing.
[0041] Structure: A structure is a type of data structured by combining a set of data. Each data element of a structure is called a member of the structure. It describes the size and meaning of a memory range, and each member can have a different type. Structures are often used to represent related data of different types.
[0042] Pointer: A pointer describes the location of variable data in memory (i.e., the memory address), marking the relative distance of an entity occupying storage space from the starting position of this space. In a computer, all data is stored in memory, and different data types occupy different amounts of memory space. Memory is a continuous addressable space in bytes, and each byte unit corresponds to a unique number, which is called the address of the memory unit. The address of the first byte unit that the system allocates storage space for a variable in memory is called the address of the variable.
[0043] Environment variables: refers to some parameters used in the operating system to specify the operating environment of the operating system. It is an object with a specific name in the operating system. It contains information that will be used by one or more applications.
[0044] Recursion: A recursive algorithm is to continuously decompose the original problem into sub-problems of smaller scale, and then within the same function method, continuously call itself to progressively solve the sub-problems to obtain the final solution.
[0045] Reflection: Reflection refers to the ability to access and modify a program while it's running. During compilation, variables are converted to memory addresses, and variable names are not written into the executable by the compiler. Therefore, the program cannot access its own information while running. Reflection in Go is supported by the reflect package, which defines two important types: Type and Value. In reflection, any interface value can be interpreted as consisting of reflect.Type and reflect.Value. The reflect package also provides the reflect.TypeOf and reflect.ValueOf functions to retrieve the Value and Type of any object.
[0046] Serialization: The process of converting an object's state information into a form that can be stored or transmitted, usually into a byte array.
[0047] Deserialization: The opposite process of serialization, which converts data that can be stored or transmitted into memory objects.
[0048] The following specific embodiments illustrate the implementation of the present application. Those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. Although the description of the present application will be introduced in conjunction with the preferred embodiment, this does not mean that the features of this invention are limited to this implementation. On the contrary, the purpose of introducing the invention in conjunction with the implementation is to cover other options or modifications that may be extended based on the claims of this application. In order to provide an in-depth understanding of the present application, the following description will contain many specific details. The present application can also be implemented without using these details. In addition, in order to avoid confusion or blurring the focus of the present application, some specific details will be omitted in the description. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other unless there is a conflict.
[0049] Furthermore, various operations will be described as multiple discrete operations in a manner that is most helpful in understanding the illustrative embodiments; however, the order of description should not be construed as implying that these operations are necessarily order dependent. In particular, these operations do not need to be performed in the order presented.
[0050] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0051] The acquisition, storage, use, and processing of data in this application's technical solution comply with relevant national laws and regulations.
[0052] Figure 1 It is a flowchart of a structure processing method 100 based on the Go language according to an embodiment of the present application.
[0053] In S101 , original data stored in the form of a byte array is obtained.
[0054] In some examples, the raw data is stored in memory in the form of a byte array. Those skilled in the art will appreciate that the raw data can also be obtained based on user input, reading the user input content, converting it into a byte array, and storing it in memory for subsequent processing.
[0055] In S102, the original data is deserialized to obtain an instance object.
[0056] Deserialization is the process of converting data that can be stored or transmitted into memory objects. In some examples, the deserialization process is performed based on a predetermined structure to obtain an instance object.
[0057] In S103 , a field list of the structure variable of the instance object is determined.
[0058] In some examples, determining the field list further includes obtaining a pointer to the instance object through reflection, and determining a list of all fields based on the pointer, that is, the memory address.
[0059] Next, in S104, all field lists are traversed to determine the field type.
[0060] In some examples, the field type is a structure (struct) or a non-structure, and different processing is performed for different field types.
[0061] Finally, at S105 , structure processing is performed based on the field type.
[0062] According to the processing method described in the embodiment of the present application, the definition information of the structure is quickly identified through reflection, so that developers can simply and clearly identify all information without having to implement the entire assignment process themselves, reducing a lot of development work and eliminating the need to worry about configuration errors.
[0063] Figure 2 It is a schematic diagram of a specific processing method 200 according to an embodiment of the present application, that is, a further detailed description of the above steps S104 and S105.
[0064] In S201, all field lists are traversed to determine whether the field type is a structure. Different processes are performed for field lists of structure type or non-structure type.
[0065] If the result of S201 is a structure, execute S202.
[0066] At S202, for a field list of a structure type, a predetermined processing function is called. For a field list of a non-structure type, the processing steps go to S203-S206 and are executed in sequence.
[0067] In S203 , the value of the environment variable tag of the field is obtained.
[0068] When retrieving the value of the field's environment variable tag, the actual environment variable value is retrieved. If the value is not empty, the value is assigned. In some examples, if an environment variable is set, the environment variable takes precedence over the original data. The corresponding data is replaced with the environment variable value, and the environment variable type is automatically calculated and adapted.
[0069] For example, after defining the environment variable KAFKA_ADDRESS with the string values 192.168.1.1, 192.168.1.2, and 192.168.1.3, they are automatically recognized and parsed into the array type of the address field, overwriting the original values IP1, IP2, and IP3.
[0070] Next, at S204 , the value of the default value tag (default) of the field is obtained.
[0071] Similar to the above step S203, when the value is not empty, the assignment operation is performed.
[0072] In S205 and S206 , the maximum value and the minimum value are processed respectively.
[0073] At S205, the value of the maximum value tag (maxv) of the field is obtained and compared with the current field value. If the value of the maximum value tag is smaller than the current field value, the maximum value tag (maxv) is assigned to the current field.
[0074] At S206, the value of the minimum value tag (minv) of the field is obtained and compared with the current field value. If the value of the minimum value tag is greater than the current field value, the minimum value tag (maxv) is assigned to the current field.
[0075] At this point, all parsing and assignment processing for non-structural field types has been completed.
[0076] For example, if you use open-source JSON to deserialize the original data, the resulting data will contain fields such as groupid, auto_offset_reset, version, size, and mode, which are all zero values for the corresponding types of the fields. However, using the method according to the above embodiments of the present application, the parsed data contains fields such as groupid, auto_offset_reset, version, and mode, which are not zero values but use the default values defined in the structure. Although the size field does not have a default value, its value is corrected to 10 because its zero value is less than the minimum value of 10 defined by the minv tag. The original value of bakups was 30, but because it exceeded the defined maximum value of 20, the data was corrected to 20.
[0077] Therefore, according to the method of the present application, the default value, maximum value, and minimum value of the structure field can be defined quickly and directly. Developers can simply and clearly identify all information without having to implement the entire assignment process themselves, which reduces a lot of development work and eliminates the need to worry about configuration errors.
[0078] In addition, according to the method of the present application, the environment variable name can be directly defined, and the value of the environment variable can be automatically identified and parsed, and the value of the environment variable (string type) can be automatically converted and adapted to the corresponding field. Developers do not need to worry about this process, thereby reducing the development workload.
[0079] Figure 3 This is a schematic diagram of a Go language-based structure processing device provided in one embodiment of the present application. The device 300 includes:
[0080] The acquisition unit 301 is configured to acquire original data stored in the form of a byte array;
[0081] The deserialization unit 302 is configured to deserialize the original data to obtain an instance object.
[0082] The determining unit 303 is configured to determine a field list of the structure variable of the instance object,
[0083] The judging unit 304 is configured to traverse the field list and judge the field type.
[0084] The processing unit 305 is configured to perform the structure processing based on the field type.
[0085] The above units 301-305 can be used to execute the processing method in the above embodiment. The implementation principles and technical effects are similar and will not be repeated here.
[0086] It should be noted that it should be understood that the division of the various units of the above device is merely a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. Moreover, these units can all be implemented in the form of software called by processing elements; they can also all be implemented in the form of hardware; some units can also be implemented in the form of processing elements calling software, and some units can be implemented in the form of hardware. The implementation of other units is similar. In addition, these units can all or partly be integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above units can be completed by the hardware integrated logic circuit in the processor element or by instructions in the form of software.
[0087] Now refer to Figure 4 , Figure 4 An example electronic device 1400 is schematically shown in accordance with an embodiment of the present invention. In one embodiment, the system 1400 may include one or more processors 1404, system control logic 1408 coupled to at least one of the processors 1404, system memory 1412 coupled to the system control logic 1408, non-volatile memory (NVM) 1416 coupled to the system control logic 1408, and a network interface 1420 coupled to the system control logic 1408.
[0088] In some embodiments, the processor 1404 may include one or more single-core or multi-core processors. In some embodiments, the processor 1404 may include any combination of general-purpose processors and specialized processors (e.g., graphics processors, application processors, baseband processors, etc.). In embodiments where the system 1400 employs an eNB (Evolved Node B) 101 or a RAN (Radio Access Network) controller 102, the processor 1404 may be configured to execute various embodiments, such as Figure 1 The embodiment shown.
[0089] In some embodiments, system control logic 1408 may include any suitable interface controller to provide any suitable interface to at least one of processors 1404 and / or any suitable device or component in communication with system control logic 1408 .
[0090] In some embodiments, the system control logic 1408 may include one or more memory controllers to provide an interface to the system memory 1412. The system memory 1412 may be used to load and store data and / or instructions. In some embodiments, the memory 1412 of the system 1400 may include any suitable volatile memory, such as a suitable dynamic random access memory (DRAM).
[0091] NVM / memory 1416 may include one or more tangible, non-transitory computer-readable media for storing data and / or instructions. In some embodiments, NVM / memory 1416 may include any suitable non-volatile memory such as flash memory and / or any suitable non-volatile storage device, such as at least one of an HDD (Hard Disk Drive), a CD (Compact Disc) drive, and a DVD (Digital Versatile Disc) drive.
[0092] NVM / storage 1416 may comprise a portion of the storage resources on the device on which system 1400 is installed, or it may be accessible to the device but not necessarily be part of the device. For example, NVM / storage 1416 may be accessed over a network via network interface 1420 .
[0093] In particular, system memory 1412 and NVM / storage 1416 may include, respectively, a temporary copy and a permanent copy of instructions 1424. Instructions 1424 may include instructions that, when executed by at least one of processors 1404, cause electronic device 1400 to perform the following operations: Figure 2 In some embodiments, instructions 1424 , hardware, firmware, and / or software components thereof may additionally or alternatively reside in system control logic 1408 , network interface 1420 , and / or processor 1404 .
[0094] The network interface 1420 may include a transceiver for providing a radio interface for the system 1400 to communicate with any other suitable devices (such as front-end modules, antennas, etc.) via one or more networks. In some embodiments, the network interface 1420 may be integrated with other components of the system 1400. For example, the network interface 1420 may be integrated with at least one of the processor 1404, the system memory 1412, the NVM / storage 1416, and a firmware device (not shown) having instructions. When at least one of the processors 1404 executes the instructions, the electronic device 1400 implements the following. Figure 1 The method shown.
[0095] The network interface 1420 may further include any suitable hardware and / or firmware to provide a multiple-input multiple-output radio interface. For example, the network interface 1420 may be a network adapter, a wireless network adapter, a telephone modem, and / or a wireless modem.
[0096] In one embodiment, at least one of the processors 1404 may be packaged together with logic for one or more controllers of the system control logic 1408 to form a system-in-package (SiP). In one embodiment, at least one of the processors 1404 may be integrated on the same die with logic for one or more controllers of the system control logic 1408 to form a system-on-chip (SoC).
[0097] Electronic device 1400 may further include an input / output (I / O) device 1432. I / O device 1432 may include a user interface that enables a user to interact with electronic device 1400; peripheral component interfaces may also be designed to enable peripheral components to interact with electronic device 1400. In some embodiments, electronic device 1400 may further include a sensor for determining at least one of environmental conditions and location information related to electronic device 1400.
[0098] In some embodiments, the user interface may include, but is not limited to, a display (e.g., an LCD display, a touch screen display, etc.), a speaker, a microphone, one or more cameras (e.g., a still image camera and / or a video camera), a flashlight (e.g., an LED flash), and a keyboard.
[0099] The various embodiments of the mechanisms disclosed in this application can be implemented in hardware, software, firmware, or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.
[0100] Program code can be applied to input instructions to perform the functions described herein and generate output information. The output information can be applied to one or more output devices in a known manner. For purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.
[0101] Program code can be implemented with a high-level programming language or an object-oriented programming language to communicate with the processing system. Where necessary, program code can also be implemented in assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any particular programming language. In either case, the language can be a compiled language or an interpreted language.
[0102] In some cases, the disclosed embodiments can be implemented in hardware, firmware, software or any combination thereof. The disclosed embodiments can also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which can be read and executed by one or more processors. For example, instructions can be distributed over a network or through other computer-readable media. Therefore, machine-readable media may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including but not limited to, floppy disks, optical disks, optical discs, read-only memories (CD-ROMs), magneto-optical disks, read-only memories (ROMs), random access memories (RAMs), erasable programmable read-only memories (EPROMs), electrically erasable programmable read-only memories (EEPROMs), magnetic or optical cards, flash memories, or tangible machine-readable memories for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) using the Internet in electrical, optical, acoustic or other forms of propagation signals. Therefore, machine-readable media include any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a form readable by a machine (e.g., a computer).
[0103] In the accompanying drawings, some structural or method features may be shown in a particular arrangement and / or order. However, it should be understood that such a particular arrangement and / or order may not be required. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of a structural or method feature in a particular figure does not imply that such feature is required in all embodiments, and in some embodiments, such features may not be included or may be combined with other features.
[0104] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems raised by this application. In addition, in order to highlight the innovative part of this application, the above-mentioned device embodiments of this application do not introduce units / modules that are not closely related to solving the technical problems raised by this application. This does not mean that other units / modules do not exist in the above-mentioned device embodiments.
[0105] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "including a" does not exclude the presence of other identical elements in the process, method, article or device that includes the element.
[0106] Although the present application has been shown and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the application.
Claims
1. A structure processing method based on Go language, characterized in that: The method comprises: Get the original data stored in the form of a byte array; Deserialize the original data to obtain the instance object, Determine the field list of the structure variable of the instance object, Traverse the field list and determine the field type. Performing the structure processing based on the field type includes: When the field type is a structure, recursively call a predetermined processing function and modify all structure fields; When the field type is not a structure, the assignment is performed according to different field types, including: Get the values of the environment variable label, default value label, maximum value label, and minimum value label of the corresponding field. Compare the value of the maximum value tag of the corresponding field with the value of the current field. When the value of the maximum value tag is less than the value of the current field, assign the value of the maximum value tag to the current field. Compare the value of the minimum value tag of the corresponding field with the value of the current field. When the value of the minimum value tag is greater than the value of the current field, assign the value of the minimum value tag to the current field. Among them, after obtaining the value of the default value tag, if the value is not empty, the assignment operation is performed. While obtaining the value of the environment variable tag of the corresponding field, the value of the actual environment variable is also obtained. If the value is not empty, the assignment operation is performed. The environment variable has a higher priority than the original data.
2. The method according to claim 1, characterized in that Deserializing the original data to obtain an instance object includes: The original data is deserialized based on a predetermined structure.
3. The method according to claim 2, characterized in that The field list of the structure variable of the instance object is further determined to include: Determine the pointer to the instance object through reflection.
4. A structure processing device based on Go language, characterized in that: The device comprises: an acquisition unit configured to acquire original data stored in the form of a byte array; A deserialization unit is configured to deserialize the original data to obtain an instance object. A determining unit is configured to determine a field list of a structure variable of the instance object, The judging unit is configured to traverse the field list and judge the field type. A processing unit is configured to perform the structure processing based on the field type, comprising: When the field type is a structure, recursively call a predetermined processing function and modify all structure fields; When the field type is not a structure, the assignment is performed according to different field types, including: Get the values of the environment variable label, default value label, maximum value label, and minimum value label of the corresponding field. Compare the value of the maximum value tag of the corresponding field with the value of the current field. When the value of the maximum value tag is less than the value of the current field, assign the value of the maximum value tag to the current field. Compare the value of the minimum value tag of the corresponding field with the value of the current field. When the value of the minimum value tag is greater than the value of the current field, assign the value of the minimum value tag to the current field. Among them, after obtaining the value of the default value tag, if the value is not empty, the assignment operation is performed. While obtaining the value of the environment variable tag of the corresponding field, the value of the actual environment variable is also obtained. If the value is not empty, the assignment operation is performed. The environment variable has a higher priority than the original data.
5. An electronic device, characterized in that: include: one or more processors; One or more memories; the one or more memories store one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device executes the method according to any one of claims 1 to 3.
6. A computer-readable medium, characterized in that The storage medium stores instructions, which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 3.
7. A computer program product comprising computer executable instructions, characterized in that The instructions are executed by a processor to implement the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Method and apparatus for serialization and deserialization
CN109117209A