Data processing system and method based on local replacement, electronic equipment and storage medium
By using XSD files and JSON files to manage field changes in the data processing system, local replacement and version compatibility are achieved, solving the problem that local modified configuration files cannot be effectively handled in the prior art, and improving version compatibility and development efficiency.
Patent Information
- Application Number
- CN202411820744.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-05-13
AI Technical Summary
The existing technology cannot effectively handle locally modified configuration files during software upgrades, resulting in version compatibility issues.
By introducing configuration tools in the data processing system, using the addition and deletion of XSD files and JSON file management fields, it is automatically decided whether to skip reading or assign default values, thereby achieving local replacement and version compatibility.
Improve compatibility between different versions of configuration tools, reduce problems caused by version inconsistency, reduce the need and error risk of manual code adjustment, and improve development and debugging efficiency.
Smart Images

Figure CN119987835A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data replacement, and in particular to a data processing system and method based on local replacement, an electronic device, and a storage medium. Background Art
[0002] The rail transit signal system contains multiple subsystems, and each subsystem device has a corresponding configuration tool. The relationship between these configuration tools is usually a hierarchical relationship, that is, the output file of one configuration tool (such as tool 1) is the input file of another configuration tool (such as tool 2). Therefore, only when all configuration tools belong to the same major version can the normal operation of configuration tools at all levels be guaranteed, and version consistency is particularly important.
[0003] The invention patent with publication number CN111367546A discloses a method for implementing XML configuration file upgrade processing during software upgrade, including the following steps: deserializing the XML configuration file; performing consistency check on the data model with other data models; writing the target version data model after the check into the XML configuration file of the target version; the patent can maximize the reuse of previous projects and reduce the errors caused by manual changes to the configuration file, but the patent only performs an overall replacement after the check is passed, and fails to solve the problem of replacing only local content after local modification.
[0004] Therefore, providing a data processing method and system capable of performing partial replacement and improving version compatibility is an issue that urgently needs to be resolved. Summary of the invention
[0005] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and to provide a data processing system and method, electronic device and storage medium based on local replacement.
[0006] The purpose of the present invention can be achieved by the following technical solutions:
[0007] According to a first aspect of the present invention, there is provided a data processing system based on local replacement, including an input unit, a conversion tool and a configuration tool, wherein the configuration tool is integrated with a data processing unit, and an XSD file and a JSON file are obtained after processing the input file of the input unit, and a field information JAR package is obtained after the XSD file is processed by the conversion tool. The configuration tool receives the input file, the JSON file and the field information JAR package, and the data processing unit reads and processes the input file, the JSON file and the field information JAR package and locally modifies the configuration tool, and outputs the modified configuration tool as an output file, thereby improving the version compatibility of different configuration tools.
[0008] As a preferred technical solution, the conversion tool runs independently.
[0009] According to a second aspect of the present invention, there is provided a method for a data processing system based on local replacement as described above, the method comprising the following steps:
[0010] S1. Sort the field data that has changed in the input file and generate JSON files and XSD files;
[0011] S2, the conversion tool parses the XSD file and generates a field information JAR package;
[0012] S3, the configuration tool receives the input file, the JSON file and the field information JAR package;
[0013] S4. The data processing unit reads and processes the input file, the JSON file and the field information JAR package, fills the field data in the configuration tool in sequence, and locally modifies the configuration tool.
[0014] As a preferred technical solution, S4 specifically includes:
[0015] S41, parsing the JSON file and generating a first data object, parsing the field information JAR package and the input file and generating a second data object, and sequentially filling the configuration tool with field data of the input file in combination with the first data object and the second data object;
[0016] S42, determining whether the data object filling is complete;
[0017] S43. If the data object is not fully filled, fill in the fields of the data object and determine whether to use the JSON file to configure the fields; if the data object is fully filled, the configuration tool modification is completed;
[0018] S44. If the JSON file is not used to configure the field, fill in the value from the index position; if the JSON file is used to configure the field, determine the configuration method of the field data.
[0019] As a preferred technical solution, the configuration method of the field data includes skipping reading or assigning a default value.
[0020] As a preferred technical solution, the S44 specifically includes:
[0021] S441, determining whether the configuration mode is to skip reading;
[0022] S442. If the read is skipped, the field length annotation is obtained and the data index is relocated; if the read is not skipped, a default value is assigned.
[0023] As a preferred technical solution, the S442 specifically includes:
[0024] S4421. If the read is not skipped, obtain the field default value annotation and fill in the default value.
[0025] As a preferred technical solution, the field data includes a single field and a list field, the single field includes a simple field and a complex field, and the list field includes a simple list field and a complex list field.
[0026] As a preferred technical solution, the method for processing simple fields and complex fields includes:
[0027] If it is skip reading, the simple field will move the data list index of the input file backward by one position; the complex field will calculate the number of all subfields in the complex field, and move the input file data list index backward by the corresponding number of positions to complete the skip processing of the complex field;
[0028] If a default value is assigned, the simple field will keep the data list index position unchanged, obtain the configured default value from the annotation of the data object field to be filled, and fill it with the default value; the complex field will keep the data list index position unchanged, obtain the default value in the annotation of each subfield in the complex field in turn, and store these default values in a newly created list, construct a complex field data object containing internal subfields, traverse each subfield in turn, and take and assign values from the newly created list in order.
[0029] As a preferred technical solution, the method for processing the simple list field and the complex list field includes:
[0030] If it is skip reading, the simple list field obtains the attribute value of the number of occurrences of the field from the annotation, and determines the number of bits that the input file data list index moves backward according to the attribute value; the moving value of the data list index in the complex list field is equal to the number of occurrences of the complex list field multiplied by the number of internal subfields;
[0031] If a default value is assigned, the simple list field keeps the data list index position unchanged, obtains the default value from the annotation of the simple list field, inserts the same number of default values into the newly created list according to the number of occurrences of the field, and uses the newly created list as the data to fill the field; the complex list field will obtain the default value in the annotation of each subfield in turn, and store it in a newly created list. According to the attribute value of the number of occurrences of the complex list field, the newly created lists with the same number of occurrences are placed in a parent list as sublists, and the same number of complex list field objects as the number of occurrences are constructed. Each complex list object is traversed in turn. When assigning default values in a single field manner, values are taken from the newly created list in order to assign values to the subfields.
[0032] According to a third aspect of the present invention, there is provided an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements any of the above methods when executing the program.
[0033] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein the program implements any of the above methods when executed by a processor.
[0034] Compared with the prior art, the present invention has the following beneficial effects:
[0035] 1. The present invention sets the configuration tool so that even if the fields of the input file change, the configuration tool can automatically decide whether to skip reading or assign default values according to the settings in the JSON file, thereby ensuring the compatibility between configuration tools of different versions and reducing problems caused by version inconsistency.
[0036] 2. The present invention uses XSD files and JSON files. By using JSON files to manage the addition, deletion and change of fields and cooperating with XSD files, the configuration tool can automatically process input files of different versions.
[0037] 3. The configuration tool of the present invention integrates a data processing unit, which can automatically read and parse JSON files, reducing the need to manually adjust the configuration tool code. This not only speeds up the iteration speed of the configuration tool, but also reduces the risk of errors caused by manual code modification, making the development and debugging process more efficient and reliable.
[0038] 4. The present invention can perform data compatibility by itself. The automated testing system does not need to frequently update interfaces or redevelop to adapt to new configuration tools. Even if the fields of the configuration tool change, the new field configuration can be adapted by reading the updated JSON file, thereby reducing the workload of test developers and reducing maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a work flow chart of the present invention;
[0040] Figure 2 It is a data modification flow chart of the present invention;
[0041] Figure 3 It is a schematic diagram of the structure of the JSON file of the present invention. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0043] The rail transit signal system contains multiple subsystems, and each subsystem device has a corresponding configuration tool. The relationship between these configuration tools is usually a hierarchical relationship, that is, the output file of one configuration tool (such as tool 1) is the input file of another configuration tool (such as tool 2). Therefore, only when all configuration tools belong to the same major version can the normal operation of configuration tools at all levels be guaranteed, and version consistency is particularly important.
[0044] However, in the actual development process, the following situations may cause progress delays or increase development costs:
[0045] (1) Field additions, deletions, and changes: If one or more fields of a configuration tool are added, deleted, or changed, then its upper and lower configuration tools must also be updated accordingly. This chain reaction will increase additional development workload and extend the delivery time of the entire project.
[0046] (2) Iteration is not synchronized: Even if a configuration tool has completed the iteration update, if the upper or lower configuration tools connected to it are still in the iteration, then the overall debugging can only be carried out after the development of all related configuration tools is completed. This will not only delay the progress of the project, but also lead to idle resources.
[0047] (3) Adaptation of automated test systems: Automated test systems are usually integrated with old versions of configuration tools. Whenever there is a new requirement to delete or modify fields in the configuration tool, the automated test system also needs to be updated by the test developers or iteratively developed to adapt to the new configuration tool. This increases the workload of test development and may lead to an extension of the test cycle.
[0048] The idea of the present invention is as follows: a JSON file is used to store the added and reduced fields, and the interface integrated by the configuration tool reads the file and parses it into a data object. When the input file is subsequently processed and encounters a field in the data object, it will be processed according to whether the configuration of the field in the data object is to assign a default value or skip reading, so as to be compatible with different versions of input files.
[0049] The present invention provides a data processing system and method based on local replacement. The present invention sets a configuration tool, and even if the field of the input file changes, the configuration tool can automatically decide whether to skip reading or assign a default value according to the setting in the JSON file, thereby ensuring the compatibility between configuration tools of different versions and reducing problems caused by inconsistent versions. The present invention uses XSD files and JSON files, manages the addition and deletion of fields by using JSON files and cooperates with XSD files, so that the configuration tool can automatically process input files of different versions. The configuration tool of the present invention integrates a data processing unit, can automatically read and parse JSON files, and reduces the need to manually adjust the configuration tool code, which not only speeds up the iteration speed of the configuration tool, but also reduces the risk of errors caused by manual code modification, making the development and debugging process more efficient and reliable. The present invention can perform data compatibility by itself, and the automated test system does not need to frequently update the interface or redevelop to adapt to the new configuration tool. Even if the field of the configuration tool changes, it can adapt to the new field configuration by reading the updated JSON file, thereby reducing the workload of test developers and reducing maintenance costs.
[0050] Example 1
[0051] like Figure 1 As shown, a data processing system based on local replacement includes an input unit, a conversion tool and a configuration tool. The configuration tool is integrated with a data processing unit. After processing the input file of the input unit, an XSD file and a JSON file are obtained respectively. After the XSD file is processed by the conversion tool, a field information JAR package is obtained. The configuration tool receives the input file, the JSON file and the field information JAR package. The data processing unit reads and processes the input file, the JSON file and the field information JAR package and partially modifies the configuration tool, and outputs the modified configuration tool as an output file to improve the version compatibility of different configuration tools. The conversion tool runs independently.
[0052] In this embodiment, all input files need to configure an XSD file that describes their own field structure information according to their respective data structures. For fields that need to be skipped and assigned default values, attribute information such as default values and maximum number of occurrences should be configured in their respective nodes. After the XSD file is read and processed by the conversion tool, a bytecode file (JAR package) containing the input file field structure information can be generated. The JAR package and the data processing unit need to be integrated into the configuration tool project. The output processing unit contains a program in the data processing JAR package, which processes the field information JAR package. The output file serves as an input file for another configuration tool, and the corresponding input unit will also be converted accordingly.
[0053] When the configuration tool is run, the JSON file will be read before the input file is read, and the first data object jsonObject will be parsed and temporarily stored in the memory. According to the currently read input file, the second data object is created from the JAR package generated by the conversion tool and the data filling operation is performed. The data filling order is based on the structure information defined by XSD, from the outside to the inside, from the root node to the leaf node, and the fields are filled in sequence.
[0054] like Figure 2 and Figure 3 As shown, a method for a data processing system based on local replacement, the method comprising the following steps:
[0055] S1. Sort the field data that has changed in the input file and generate JSON files and XSD files;
[0056] S2, the conversion tool parses the XSD file and generates a field information JAR package;
[0057] S3, the configuration tool receives the input file, the JSON file and the field information JAR package;
[0058] S4. The data processing unit reads and processes the input file, the JSON file and the field information JAR package, fills the field data in the configuration tool in sequence, and locally modifies the configuration tool.
[0059] The S4 specifically includes:
[0060] S41, parsing the JSON file and generating a first data object, parsing the field information JAR package and the input file and generating a second data object, and sequentially filling the configuration tool with field data of the input file in combination with the first data object and the second data object;
[0061] S42, determining whether the data object filling is complete;
[0062] S43. If the data object is not fully filled, fill in the fields of the data object and determine whether to use the JSON file to configure the fields; if the data object is fully filled, the configuration tool modification is completed;
[0063] S44. If the JSON file is not used to configure the field, fill in the value from the index position; if the JSON file is used to configure the field, determine the configuration method of the field data.
[0064] The configuration method of the field data includes skipping reading or assigning a default value.
[0065] The S44 specifically includes:
[0066] S441, determining whether the configuration mode is to skip reading;
[0067] S442. If the read is skipped, the field length annotation is obtained and the data index is relocated; if the read is not skipped, a default value is assigned.
[0068] The S442 specifically includes:
[0069] S4421. If the read is not skipped, obtain the field default value annotation and fill in the default value.
[0070] In this embodiment, the single field or a group of field data that has changed in the input files of different versions of the configuration tool are sorted out, and it is distinguished whether the field is skipped or assigned a default value. In the JSON file, the fields in each input file are configured separately, and the fields of all files are configured according to a certain structure; the XSD used to describe the input file structure information is configured. The XSD can set attribute information such as default value, number of occurrences, etc. for each field, and the XSD file is read and converted using the supporting tools to generate a JAR package that can be integrated by the configuration tool. The XSD file and JSON file are manually configured after the input file is manually analyzed.
[0071] The configuration tool also integrates the data processing unit and places the JSON file in a specified folder under the configuration tool directory.
[0072] The configuration tool runs and loads the JSON file. The data processing unit integrated in the configuration tool processes the JSON file. The configuration data in the JSON file is parsed and generates a first data object jsonObject. The data object stores the field information that needs to be compatible according to the file.
[0073] After reading the input file through the interface in the data processing platform, the configuration tool constructs the second data object fileObject according to the structural information corresponding to the file in the field information JAR package, and fills the field data of the input file in sequence.
[0074] When filling field data into the second data object fileObject according to the content of the first data object, single fields and list fields are processed separately. If the name of the single field to be filled exists in jsonObject, determine whether the current field is configured to skip reading or assign a default value. If the field is configured to skip reading, it will jump from the current field data bit to the next field data bit index; if the field is configured to assign a default value, it will obtain the annotation from the data object of the field in fileObject, which contains the default value set for the field when configuring the XSD file, obtain the default value and assign it to the current field. The list field is composed of multiple fields of the same type. The number of fields in the current list will be configured in the annotation of this type of field. The skip reading or default value assignment of the list field can be correctly implemented based on this number. In particular, there is also a complex type list field, which also contains multiple groups of field data. The difference is that each group contains multiple fields of different types. The field containing this complex type list can be regarded as the parent field. This type of field is usually used to describe the entire table in the input file. Its skip reading or default value assignment only requires special configuration of the parent field in the JSON file.
[0075] The field data includes single fields and list fields, the single fields include simple fields and complex fields, and the list fields include simple list fields and complex list fields.
[0076] The processing method of the simple field and the complex field includes:
[0077] If it is skip reading, the simple field will move the data list index of the input file backward by one position; the complex field will calculate the number of all subfields in the complex field, and move the input file data list index backward by the corresponding number of positions to complete the skip processing of the complex field;
[0078] If a default value is assigned, the simple field will keep the data list index position unchanged, obtain the configured default value from the annotation of the data object field to be filled, and fill it with the default value; the complex field will keep the data list index position unchanged, obtain the default value in the annotation of each subfield in the complex field in turn, and store these default values in a newly created list, construct a complex field data object containing internal subfields, traverse each subfield in turn, and take and assign values from the newly created list in order.
[0079] The processing method of the simple list field and the complex list field includes:
[0080] If it is skip reading, the simple list field obtains the attribute value of the number of occurrences of the field from the annotation, and determines the number of bits that the input file data list index moves backward according to the attribute value; the moving value of the data list index in the complex list field is equal to the number of occurrences of the complex list field multiplied by the number of internal subfields;
[0081] If a default value is assigned, the simple list field keeps the data list index position unchanged, obtains the default value from the annotation of the simple list field, inserts the same number of default values into the newly created list according to the number of occurrences of the field, and uses the newly created list as the data to fill the field; the complex list field will obtain the default value in the annotation of each subfield in turn, and store it in a newly created list. According to the attribute value of the number of occurrences of the complex list field, the newly created lists with the same number of occurrences are placed in a parent list as sublists, and the same number of complex list field objects as the number of occurrences are constructed. Each complex list object is traversed in turn. When assigning default values in a single field manner, values are taken from the newly created list in order to assign values to the subfields.
[0082] In this embodiment, the single field and complex field processing method are as follows:
[0083] If skip reading:
[0084] Simple field: Shift the input file data list index one position backward.
[0085] Complex fields: Calculate the number of all subfields in a complex field, and move the input file data list index backward by the corresponding number of positions to complete the skipping of complex fields.
[0086] If the default value is assigned:
[0087] Simple field: Keep the data list index position unchanged, get the configured default value from the annotation of the data object field to be filled, and use the default value to fill.
[0088] Complex fields:
[0089] (1) Keep the data list index position unchanged.
[0090] (2) Obtain the default values in the annotation of each subfield in the complex field in turn, and store these default values in a newly created list.
[0091] (3) Construct a complex field data object containing internal subfields.
[0092] (4) Following the single field processing method described above, traverse each subfield in turn and retrieve and assign values from the newly created list in order.
[0093] Single field list and complex field list processing method:
[0094] If skip reading:
[0095] Simple list field: First, get the attribute value of the number of occurrences of the field from the annotation. Then, determine the number of digits to move the input file data list index backward based on the attribute value.
[0096] Complex list fields: The data list index is shifted by a value equal to the number of occurrences of the complex list field multiplied by the number of internal subfields.
[0097] If the default value is assigned:
[0098] Simple list field:
[0099] (1) Keep the data list index position unchanged.
[0100] (2) Get the default value from the annotation of the simple list field.
[0101] (3) According to the number of times the field appears, insert the same number of default values into the newly created list.
[0102] (4) Use the newly created list as data to fill in the fields.
[0103] Complex list fields:
[0104] (1) Get the default value in each subfield annotation in turn and store it in a new list.
[0105] (2) According to the occurrence count attribute value of the complex list field, the newly created lists with the same number of occurrences are placed into a parent list as child lists.
[0106] (3) Construct a number of complex list field objects equal to the number of occurrences.
[0107] (4) Traverse each complex list object in turn. When assigning default values to a single field, take values from the newly created list in order and assign them to the subfields.
[0108] Example 2
[0109] An electronic device comprises a memory and a processor, wherein a computer program is stored in the memory, and wherein the processor implements any of the above methods when executing the program.
[0110] A computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements any of the methods described above.
[0111] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0112] In the present embodiment, the electronic device of the present invention includes a central processing unit (CPU), which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) or loaded from a storage unit into a random access memory (RAM). In the RAM, various programs and data required for the operation of the device can also be stored. The CPU, ROM and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0113] A plurality of components in the device are connected to the I / O interface, including: an input unit, such as a keyboard, a mouse, etc.; an output unit, such as various types of displays, speakers, etc.; a storage unit, such as a disk, an optical disk, etc.; and a communication unit, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit allows the device to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks. The processing unit performs the various methods and processes described above, such as the method of the present invention. For example, in some embodiments, the method of the present invention may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed on the device via a ROM and / or a communication unit. When the computer program is loaded into the RAM and executed by the CPU, one or more steps of the method of the present invention described above may be performed. Alternatively, in other embodiments, the CPU may be configured to perform the method of the present invention in any other appropriate manner (e.g., by means of firmware).
[0114] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0115] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0116] In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0117] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A data processing system based on local replacement, characterized in that: The invention comprises an input unit, a conversion tool and a configuration tool. The configuration tool is integrated with a data processing unit. After processing the input file of the input unit, an XSD file and a JSON file are obtained respectively. After the XSD file is processed by the conversion tool, a field information JAR package is obtained. The configuration tool receives the input file, the JSON file and the field information JAR package. The data processing unit reads and processes the input file, the JSON file and the field information JAR package and partially modifies the configuration tool. The modified configuration tool is output as an output file to improve the version compatibility of different configuration tools.
2. A data processing system based on local replacement according to claim 1, characterized in that: The conversion tool runs independently.
3. A method for a data processing system based on local replacement according to any one of claims 1-2, characterized in that: The method comprises the following steps: S1. Sort the field data that has changed in the input file and generate JSON files and XSD files; S2, the conversion tool parses the XSD file and generates a field information JAR package; S3, the configuration tool receives the input file, the JSON file and the field information JAR package; S4. The data processing unit reads and processes the input file, the JSON file and the field information JAR package, fills the field data in the configuration tool in sequence, and locally modifies the configuration tool.
4. The method of a data processing system based on local replacement according to claim 3, characterized in that: The S4 specifically includes: S41, parsing the JSON file and generating a first data object, parsing the field information JAR package and the input file and generating a second data object, and sequentially filling the configuration tool with field data of the input file in combination with the first data object and the second data object; S42, determining whether the data object filling is complete; S43. If the data object is not filled, fill in the fields of the data object and determine whether to use the JSON file to configure the fields; if the data object is filled, the configuration tool modification is completed; S44. If the JSON file is not used to configure the field, fill in the value from the index position; if the JSON file is used to configure the field, determine the configuration method of the field data.
5. The method of a data processing system based on local replacement according to claim 4, characterized in that: The configuration method of the field data includes skipping reading or assigning a default value.
6. The method of a data processing system based on local replacement according to claim 5, characterized in that: The S44 specifically includes: S441, determining whether the configuration mode is to skip reading; S442. If the read is skipped, the field length annotation is obtained and the data index is relocated; if the read is not skipped, a default value is assigned.
7. The method of a data processing system based on local replacement according to claim 6, characterized in that: The S442 specifically includes: S4421. If the read is not skipped, obtain the field default value annotation and fill in the default value.
8. The method of a data processing system based on local replacement according to claim 3, characterized in that: The field data includes single fields and list fields, the single fields include simple fields and complex fields, and the list fields include simple list fields and complex list fields.
9. The method of a data processing system based on local replacement according to claim 8, characterized in that: The processing method of the simple field and the complex field includes: If it is skip reading, the simple field will move the data list index of the input file backward by one position; the complex field will calculate the number of all subfields in the complex field, and move the input file data list index backward by the corresponding number of positions to complete the skip processing of the complex field; If a default value is assigned, the simple field will keep the data list index position unchanged, obtain the configured default value from the annotation of the data object field to be filled, and fill it with the default value; the complex field will keep the data list index position unchanged, obtain the default value in the annotation of each subfield in the complex field in turn, and store these default values in a newly created list, construct a complex field data object containing internal subfields, traverse each subfield in turn, and take and assign values from the newly created list in order.
10. The method of a data processing system based on local replacement according to claim 8, characterized in that: The processing method of the simple list field and the complex list field includes: If it is skip reading, the simple list field obtains the attribute value of the number of occurrences of the field from the annotation, and determines the number of bits that the input file data list index moves backward according to the attribute value; the moving value of the data list index in the complex list field is equal to the number of occurrences of the complex list field multiplied by the number of internal subfields; If a default value is assigned, the simple list field keeps the data list index position unchanged, obtains the default value from the annotation of the simple list field, inserts the same number of default values into the newly created list according to the number of occurrences of the field, and uses the newly created list as the data to fill the field; the complex list field will obtain the default value in the annotation of each subfield in turn, and store it in a newly created list. According to the attribute value of the number of occurrences of the complex list field, the newly created lists with the same number of occurrences are placed in a parent list as sublists, and the same number of complex list field objects as the number of occurrences are constructed. Each complex list object is traversed in turn. When assigning default values in a single field manner, values are taken from the newly created list in order to assign values to the subfields.
11. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the program, the method according to any one of claims 3 to 10 is implemented.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 3 to 10 is implemented.
Citation Information
Patent Citations
Method for realizing xml configuration file upgrading processing in software upgrading process
CN111367546A