CN114896322A - JSON (Java Server object notation) -based configuration data conversion method, device, equipment and medium - Google Patents

JSON (Java Server object notation) -based configuration data conversion method, device, equipment and medium Download PDF

Info

Publication number
CN114896322A
CN114896322A CN202210551473.5A CN202210551473A CN114896322A CN 114896322 A CN114896322 A CN 114896322A CN 202210551473 A CN202210551473 A CN 202210551473A CN 114896322 A CN114896322 A CN 114896322A
Authority
CN
China
Prior art keywords
configuration
data
information
external data
json
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210551473.5A
Other languages
Chinese (zh)
Inventor
叶招艳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CCB Finetech Co Ltd
Original Assignee
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CCB Finetech Co Ltd filed Critical CCB Finetech Co Ltd
Priority to CN202210551473.5A priority Critical patent/CN114896322A/en
Publication of CN114896322A publication Critical patent/CN114896322A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a JSON (Java Server pages open) configuration-based data conversion method, device, equipment and medium. The invention relates to the technical field of data management, and the method comprises the following steps: receiving external data by calling a configuration protocol based on a pre-constructed configuration protocol; based on the data structure of the external data, reading the data information of the external data by adopting a reading rule matched with the data structure; determining standardized configuration information; wherein the standardized configuration information comprises a data name and a data type; and determining the mapping relation between the standardized configuration information and the data information based on the conversion mapping configuration so as to complete the conversion of the external data. The technical scheme of the invention solves the problems of high development cost and difficult maintenance of different codes required to be developed when external data are accessed in diversity, can quickly perform external data access adjustment only by adjusting configuration, is simple and flexible in configuration, and reduces the development, operation and maintenance cost.

Description

JSON (Java Server object notation) -based configuration data conversion method, device, equipment and medium
Technical Field
The invention relates to the technical field of data management, in particular to a JSON configuration-based data conversion method, device, equipment and medium.
Background
With the growing maturity of big data technologies, data is also an important asset for many enterprise companies. The external data is generally data with characteristics of high utilization rate, high social acceptance, wide sample set, high data quality, and most importantly, according with the characteristics of the enterprise's own customer group.
At present, when an enterprise accesses external data, independent code compiling is needed according to differences of the accessed external data, a large number of redundant codes are different in style, and the problems of long development time, high development cost, difficulty in later maintenance and the like exist.
Disclosure of Invention
The invention provides a JSON (Java Server object notation) -based configuration data conversion method, device, equipment and medium, solves the problems that the diversity of accessed external data requires development of different codes, and is high in development cost and difficult to maintain, can quickly perform external data access adjustment only by adjusting configuration, is simple and flexible in configuration, and reduces development, operation and maintenance cost.
According to an aspect of the present invention, there is provided a JSON-configuration-based data transformation method, which is performed by an electronic device configured with a JSON configuration toolkit; the method comprises the following steps:
receiving external data by calling a configuration protocol based on a pre-constructed configuration protocol;
based on the data structure of the external data, reading the data information of the external data by adopting a reading rule matched with the data structure;
determining standardized configuration information; wherein the standardized configuration information comprises a data name and a data type;
and determining the mapping relation between the standardized configuration information and the data information based on the conversion mapping configuration so as to complete the conversion of the external data.
Optionally, receiving external data by invoking the configuration protocol based on the pre-constructed configuration protocol includes:
reading a configuration protocol in a JSON configuration toolkit; the key information of the configuration protocol comprises at least one of a username, a password, an IP address and a port address;
reading corresponding value information as a communication protocol according to the configuration protocol key information;
external data is received based on the communication protocol.
Optionally, determining standardized configuration information includes:
at least one of a field name, a field type, a field length, and a field constraint in the standardized configuration information is determined.
Optionally, determining a mapping relationship between the standardized configuration information and the data information based on the conversion mapping configuration to complete conversion of the external data, including:
determining an input field of data information of external data and a mapping rule based on the conversion mapping configuration;
and determining a mapping processing mode from the input field to the standardized configuration information according to the mapping rule so as to complete the conversion of the external data.
Optionally, the mapping processing manner includes determining a mapping position and a mapping constraint of the input field.
Optionally, the method further includes:
responding to a configuration change request of a JSON configuration toolkit, and determining the configuration of a change target;
changing the configuration of the change target;
and synchronizing to a JSON configuration toolkit based on the change processing result.
Optionally, the JSON configuration toolkit is invoked based on a preset invoking universal code.
According to another aspect of the present invention, there is provided a JSON-configuration-based data conversion apparatus configured in an electronic device having a JSON configuration toolkit, comprising:
the external data receiving module is used for receiving external data by calling a configuration protocol based on a pre-constructed configuration protocol;
the data information reading module is used for reading the data information of the external data by adopting a reading rule matched with the data structure based on the data structure of the external data;
the configuration information determining module is used for determining standardized configuration information; wherein the standardized configuration information comprises a data name and a data type;
and the external data conversion module is used for determining the mapping relation between the standardized configuration information and the data information based on the conversion mapping configuration so as to complete the conversion of the external data.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform a JSON-configured data transformation method according to any embodiment of the present invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the JSON-configured data transformation method according to any one of the embodiments of the present invention when the computer instructions are executed.
According to another aspect of the present invention, there is provided a computer program product comprising a computer program which, when executed by a processor, implements a JSON-configured data transformation-based method as in any one of the embodiments of the present invention.
According to the technical scheme of the embodiment of the invention, the external data is received by calling the configuration protocol based on the pre-constructed configuration protocol; based on the data structure of the external data, reading the data information of the external data by adopting a reading rule matched with the data structure; determining standardized configuration information; wherein the standardized configuration information comprises a data name and a data type; and determining the mapping relation between the standardized configuration information and the data information based on the conversion mapping configuration so as to complete the conversion of the external data. The technical scheme of the invention solves the problems of high development cost and difficult maintenance of different codes required to be developed when external data are accessed in diversity, can quickly perform external data access adjustment only by adjusting configuration, is simple and flexible in configuration, and reduces the development, operation and maintenance cost.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a JSON-based configured data conversion method according to an embodiment of the present invention;
fig. 2 is a flowchart of a JSON-based configured data conversion method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a JSON-based configuration data conversion device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. According to the technical scheme, the data acquisition, storage, use, processing and the like meet relevant regulations of national laws and regulations.
Example one
Fig. 1 is a flowchart of a JSON-configured data conversion method according to an embodiment of the present invention, where the embodiment is applicable to a case where external data is converted and standardized, and the method may be executed by a JSON-configured data conversion apparatus, which may be implemented in a hardware and/or software form, and may be configured in an electronic device having a JSON-configured toolkit. As shown in fig. 1, the method includes:
and S110, receiving external data by calling a configuration protocol based on the pre-constructed configuration protocol.
The technical solution of the embodiment can be executed by an electronic device configured with a JSON configuration toolkit. JavaScript Object notification, JSON for short, is a lightweight data exchange format, which is based on a subset of ECMAScript (js specification established by the european computer association), adopts a text format completely independent of a programming language to store and represent data, has a concise and clear hierarchical structure, and is easy for people to read and write. The JSON configuration toolkit may include configuration protocols, external data structure configurations, standardized configurations, and translation mapping configurations. In the embodiment, the external data is accessed into JSON configuration, so that data access and conversion standardization are completed, the problems that different codes need to be developed due to diversity of the accessed external data, development cost is high, and maintenance is difficult are solved, the external data can be accessed and adjusted quickly only by adjusting the configuration, the configuration is simple and flexible, and development, operation and maintenance cost is reduced.
The configuration protocol may be a configuration protocol pre-constructed in a JSON configuration toolkit. The configuration protocol may include setting protocol type, account information, and request parameters. The external data may be in the form of data on a third party server, such as file text data, data streams, and the like. Illustratively, a bank needs to access other external data to process a certain service, such as business data, judicial data, and stock transaction data. It can be understood that, in this embodiment, data of other service parties is acquired into the internal system, and different protocol configurations may be corresponding to different external data, for example, a protocol configuration corresponding to a provider a and a protocol configuration corresponding to a provider B. The configuration protocol in this embodiment may be configured through an interface, and the configuration protocol is a JSON file.
In this embodiment, the electronic device configured with the JSON configuration toolkit receives data on other servers by calling the configuration protocol in the JSON configuration toolkit based on the pre-established configuration protocol.
And S120, reading the data information of the external data by adopting a reading rule matched with the data structure based on the data structure of the external data.
Wherein the data structure of the external data may comprise a data structure type. The reading rule may be a pre-configured rule that is adapted to various data structures. The data information of the external data may include information of node name, data type, structure layer relationship, etc. of the data.
For example, in this embodiment, if the external data is text data, the text data may be converted into object data according to a reading rule adapted to a data structure of the text data, and then the object data is converted into database data for storage.
In this embodiment, the electronic device configured with the JSON configuration toolkit reads data information of the external data by using a reading rule adapted to the data structure based on the data structure of the external data.
S130, determining standardized configuration information; wherein the standardized configuration information includes a data name and a data type.
The standardized configuration information may include a data name and a data type. Specifically, the standardized configuration information may include field name, field type, field length, and field constraint. Normalization is understood to be the conversion of data from different data structures into a uniformly defined standardized format. In this embodiment, the memory data may be mapped by normalization, so that standard type data may be obtained.
In this embodiment, the data name and the data type information of the standardized configuration information are determined by the electronic device configured with the JSON configuration toolkit.
And S140, determining the mapping relation between the standardized configuration information and the data information based on the conversion mapping configuration so as to complete the conversion of the external data.
The conversion mapping configuration may be a mapping relationship between standardized configuration information and data information preset in a JSON configuration toolkit. Specifically, the mapping relationship between the standardized data name and the external data node name preset in the JSON configuration toolkit may be used.
In this embodiment, the mapping relationship between the standardized configuration information and the data information is determined by the conversion mapping configuration in the electronic device configured with the JSON configuration toolkit, so that the conversion of the external data is completed.
According to the technical scheme of the embodiment of the invention, the external data is received by calling the configuration protocol based on the pre-constructed configuration protocol; based on the data structure of the external data, reading the data information of the external data by adopting a reading rule matched with the data structure; determining standardized configuration information; wherein the standardized configuration information comprises a data name and a data type; and determining the mapping relation between the standardized configuration information and the data information based on the conversion mapping configuration so as to complete the conversion of the external data. The technical scheme of the invention solves the problems of high development cost and difficult maintenance of different codes required to be developed when external data are accessed in diversity, can quickly perform external data access adjustment only by adjusting configuration, is simple and flexible in configuration, and reduces the development, operation and maintenance cost.
Example two
Fig. 2 is a flowchart of a data conversion method based on JSON configuration according to a second embodiment of the present invention, and the present embodiment is optimized based on the above embodiments. The concrete optimization is as follows: based on a pre-constructed configuration protocol, receiving external data by calling the configuration protocol, comprising: reading a configuration protocol in a JSON configuration toolkit; the key information of the configuration protocol comprises at least one of a username, a password, an IP address and a port address; reading corresponding value information as a communication protocol according to the configuration protocol key information; external data is received based on the communication protocol. As shown in fig. 2, the method includes:
s210, reading a configuration protocol in a JSON configuration toolkit; the key information of the configuration protocol comprises at least one of a username, a password, an IP address and a port address.
The key information of the configuration protocol may include at least one of a username, password, IP address, and port address, and may also be information such as other parameters. The embodiment reads the configuration protocol in the JSON configuration toolkit by the electronic device configured with the JSON configuration toolkit.
And S220, reading corresponding value information as a communication protocol according to the configuration protocol key information.
The value information may be value information corresponding to the configuration protocol key information. The communication protocol may be a communication protocol with which external data is received. In this embodiment, the electronic device configured with the JSON configuration toolkit may use value information corresponding to at least one of key information user name, password, IP address, and port address of the configuration protocol as a communication protocol. The communication protocol may be a protocol in which the JSON configuration toolkit communicates with external data.
And S230, receiving external data based on the communication protocol.
In this embodiment, the electronic device configured with the JSON configuration toolkit receives external data according to a communication protocol by reading value information corresponding to the configuration protocol key information as the communication protocol.
S240, based on the data structure of the external data, reading the data information of the external data by adopting a reading rule matched with the data structure.
S250, determining standardized configuration information; wherein the standardized configuration information includes a data name and a data type.
And S260, determining the mapping relation between the standardized configuration information and the data information based on the conversion mapping configuration so as to complete the conversion of the external data.
According to the technical scheme of the embodiment of the invention, the configuration protocol in the JSON configuration toolkit is read; the key information of the configuration protocol comprises at least one of a username, a password, an IP address and a port address; reading corresponding value information as a communication protocol according to the configuration protocol key information; receiving external data based on the communication protocol; based on the data structure of the external data, reading the data information of the external data by adopting a reading rule matched with the data structure; determining standardized configuration information; wherein the standardized configuration information comprises a data name and a data type; and determining the mapping relation between the standardized configuration information and the data information based on the conversion mapping configuration so as to complete the conversion of the external data. The technical scheme of the invention solves the problems of high development cost and difficult maintenance of different codes required to be developed when external data are accessed in diversity, can quickly perform external data access adjustment only by adjusting configuration, is simple and flexible in configuration, and reduces the development, operation and maintenance cost.
In this embodiment, optionally, the determining the standardized configuration information includes: at least one of a field name, a field type, a field length, and a field constraint in the standardized configuration information is determined.
Wherein the field name may be a field name in the standardized configuration information. The field type may be a field type in the standardized configuration information. The field length may be a field specific length size of the standardized configuration information. A field constraint may be a restriction on the value that the field is to store.
In this embodiment, at least one of a field name, a field type, a field length, and a field constraint in the standardized configuration information is determined by the electronic device configured with the JSON configuration toolkit. In this embodiment, external data is subjected to standardized configuration by determining standardized configuration information.
Through the arrangement, the standardized configuration information can be determined, so that the accessed external information is converted into standardized data, and the method is simpler and more convenient.
In this embodiment, optionally, determining a mapping relationship between the standardized configuration information and the data information based on the conversion mapping configuration to complete conversion of the external data, includes: determining an input field of data information of external data and a mapping rule based on the conversion mapping configuration; and determining a mapping processing mode from the input field to the standardized configuration information according to the mapping rule so as to complete the conversion of the external data.
The input field may be specific input field information of data information of the external data, and may be determined according to the conversion mapping configuration. The mapping rule may be a mapping rule of data information of the external data and the standardized configuration information, and may be determined according to the conversion mapping configuration. The mapping processing mode may include determining a mapping position and a mapping constraint of the input field, and may be determined according to a mapping rule.
In the embodiment, the electronic equipment configured with the JSON configuration toolkit determines the input field and the mapping rule of the data information of the external data based on the conversion mapping configuration; and determining a mapping processing mode from the input field to the standardized configuration information according to the mapping rule, thereby completing the conversion of the external data.
Through the arrangement, the accessed external data can be converted into the standardized data through the conversion mapping configuration, and the efficiency of accessing the external data is improved.
In this embodiment, optionally, the mapping processing manner includes determining a mapping position and a mapping constraint of the input field.
Wherein the mapping location may be a location where the input field maps to the standardized configuration information. The mapping constraint may be a limit on the mapping of input fields to standardized configuration information.
The mapping processing manner of this embodiment may include determining a mapping position and a mapping constraint of the input field.
According to the scheme, through the arrangement, the external data is processed through a mapping processing mode from the input field to the standardized configuration information, and the configuration is more flexible and convenient.
In this embodiment, optionally, the method further includes: responding to a configuration change request of a JSON configuration toolkit, and determining the configuration of a change target; changing the configuration of the change target; and synchronizing to a JSON configuration toolkit based on the change processing result.
The configuration change request may be a request made by an electronic device configured with a JSON configuration toolkit when detecting that external data access needs to be modified and adjusted. The change target configuration may include a configuration protocol, an external data structure configuration, a standardized configuration, and a transformation mapping configuration in a JSON configuration toolkit. The change processing result may be a result of performing change processing on the change target configuration.
In this embodiment, the electronic device configured with the JSON configuration toolkit responds to the configuration change request of the JSON configuration toolkit, determines the configuration of the change target, performs change processing on the configuration of the change target, and synchronizes the change processing result to the JSON configuration toolkit.
In this embodiment, when the external data access party needs to be modified and adjusted and the data structure changes, the purpose of adjusting the external data access can be achieved only by modifying the JSON configuration information.
According to the scheme, external data can be accessed and adjusted by only adjusting JSON configuration information, configuration is simple and flexible, and development, operation and maintenance cost is reduced.
In this embodiment, optionally, the JSON configuration toolkit is called based on a preset call universal code.
The calling universal code can be a pre-written universal code, and can be used for loading and reading JSON configuration information, executing external data access, and generating standardized data.
The JSON configuration toolkit in this embodiment may be invoked based on a preset invocation generic code.
According to the scheme, the external data can be configured by calling the JSON configuration toolkit through the preset calling general codes, and the modification change is simple and clear and is more flexible.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a data conversion device configured based on JSON according to a third embodiment of the present invention. As shown in fig. 3, the apparatus is configured in an electronic device having a JSON configuration toolkit, and the apparatus includes:
an external data receiving module 310, configured to receive external data by invoking a configuration protocol based on a pre-constructed configuration protocol;
the data information reading module 320 is configured to read data information of the external data by using a reading rule adapted to a data structure of the external data based on the data structure of the external data;
a configuration information determination module 330 for determining standardized configuration information; wherein the standardized configuration information comprises a data name and a data type;
the external data conversion module 340 is configured to determine a mapping relationship between the standardized configuration information and the data information based on the conversion mapping configuration, so as to complete conversion of the external data.
Optionally, the external data receiving module 310 is specifically configured to:
reading a configuration protocol in a JSON configuration toolkit; the key information of the configuration protocol comprises at least one of a username, a password, an IP address and a port address;
reading corresponding value information as a communication protocol according to the configuration protocol key information;
external data is received based on the communication protocol.
Optionally, the configuration information determining module 330 is specifically configured to:
at least one of a field name, a field type, a field length, and a field constraint in the standardized configuration information is determined.
Optionally, the external data conversion module 340 is specifically configured to:
determining an input field of data information of external data and a mapping rule based on the conversion mapping configuration;
and determining a mapping processing mode from the input field to the standardized configuration information according to the mapping rule so as to complete the conversion of the external data.
Optionally, the mapping processing manner includes determining a mapping position and a mapping constraint of the input field.
Optionally, the apparatus further comprises:
the change target configuration determining module is used for responding to a configuration change request of the JSON configuration toolkit and determining the configuration of a change target;
the change processing module is used for carrying out change processing on the change target configuration;
and the synchronization module is used for synchronizing to the JSON configuration toolkit based on the change processing result.
Optionally, the JSON configuration toolkit is invoked based on a preset invoking universal code.
The JSON configuration-based data conversion device provided by the embodiment of the invention can execute the JSON configuration-based data conversion method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example four
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM)12, a Random Access Memory (RAM)13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM)12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as a JSON-based configured data conversion method.
In some embodiments, the JSON-based configured data transformation method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the JSON-based configured data transformation method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the JSON-based configured data conversion method by any other suitable means (e.g., by way of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
EXAMPLE five
An embodiment of the present invention further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the method for converting data based on JSON configuration is implemented as provided in any embodiment of the present application.
Computer program product in implementing the computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. A JSON configuration-based data conversion method is characterized in that the method is executed by an electronic device configured with a JSON configuration toolkit; the method comprises the following steps:
receiving external data by calling a configuration protocol based on a pre-constructed configuration protocol;
based on the data structure of the external data, reading the data information of the external data by adopting a reading rule matched with the data structure;
determining standardized configuration information; wherein the standardized configuration information comprises a data name and a data type;
and determining the mapping relation between the standardized configuration information and the data information based on the conversion mapping configuration so as to complete the conversion of the external data.
2. The method of claim 1, wherein receiving external data by invoking a configuration protocol based on a pre-constructed configuration protocol comprises:
reading a configuration protocol in a JSON configuration toolkit; the key information of the configuration protocol comprises at least one of a username, a password, an IP address and a port address;
reading corresponding value information as a communication protocol according to the configuration protocol key information;
external data is received based on the communication protocol.
3. The method of claim 1, wherein determining standardized configuration information comprises:
at least one of a field name, a field type, a field length, and a field constraint in the standardized configuration information is determined.
4. The method of claim 1, wherein determining a mapping relationship between the standardized configuration information and the data information based on the mapping configuration for conversion to complete conversion of the external data comprises:
determining an input field of data information of external data and a mapping rule based on the conversion mapping configuration;
and determining a mapping processing mode from the input field to the standardized configuration information according to the mapping rule so as to complete the conversion of the external data.
5. The method of claim 4, wherein the mapping process includes determining a mapping location and a mapping constraint for an input field.
6. The method of claim 1, further comprising:
responding to a configuration change request of a JSON configuration toolkit, and determining the configuration of a change target;
changing the configuration of the change target;
and synchronizing to a JSON configuration toolkit based on the change processing result.
7. The method of claim 1, wherein the JSON configuration toolkit is invoked based on pre-set invocation generic code.
8. A JSON configuration-based data conversion device, which is configured on an electronic device with a JSON configuration toolkit, comprises:
the external data receiving module is used for receiving external data by calling a configuration protocol based on a pre-constructed configuration protocol;
the data information reading module is used for reading the data information of the external data by adopting a reading rule matched with the data structure based on the data structure of the external data;
the configuration information determining module is used for determining standardized configuration information; wherein the standardized configuration information comprises a data name and a data type;
and the external data conversion module is used for determining the mapping relation between the standardized configuration information and the data information based on the conversion mapping configuration so as to complete the conversion of the external data.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the JSON-configured data transformation-based method of any one of claims 1-7.
10. A computer-readable storage medium storing computer instructions for causing a processor to implement the JSON-configured data transformation-based method according to any one of claims 1 to 7 when executed.
11. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the JSON-configured data transformation-based method of any of claims 1-7.
CN202210551473.5A 2022-05-18 2022-05-18 JSON (Java Server object notation) -based configuration data conversion method, device, equipment and medium Pending CN114896322A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210551473.5A CN114896322A (en) 2022-05-18 2022-05-18 JSON (Java Server object notation) -based configuration data conversion method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210551473.5A CN114896322A (en) 2022-05-18 2022-05-18 JSON (Java Server object notation) -based configuration data conversion method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN114896322A true CN114896322A (en) 2022-08-12

Family

ID=82723999

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210551473.5A Pending CN114896322A (en) 2022-05-18 2022-05-18 JSON (Java Server object notation) -based configuration data conversion method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN114896322A (en)

Similar Documents

Publication Publication Date Title
CN115421922A (en) Current limiting method, device, equipment, medium and product of distributed system
CN114925143A (en) Method, device, equipment, medium and product for describing logical model blood relationship
CN116611411A (en) Business system report generation method, device, equipment and storage medium
CN115905322A (en) Service processing method and device, electronic equipment and storage medium
CN115599571A (en) Data processing method and device, electronic equipment and storage medium
CN115934550A (en) Test method, test device, electronic equipment and storage medium
CN115630078A (en) User data processing method, device, equipment and medium based on digital twin
CN115309730A (en) Data auditing method and device, electronic equipment and storage medium
CN114896322A (en) JSON (Java Server object notation) -based configuration data conversion method, device, equipment and medium
CN114217790A (en) Interface scheduling method and device, electronic equipment and medium
CN113360672A (en) Methods, apparatus, devices, media and products for generating a knowledge graph
CN115277765A (en) Cloud platform access method and device, electronic equipment and storage medium
CN115510838A (en) Template generation method and device, electronic equipment and storage medium
CN115907779A (en) Transaction proposal verification method, device, server and storage medium
CN117081939A (en) Traffic data processing method, device, equipment and storage medium
CN115061664A (en) Object conversion method and device, electronic equipment and storage medium
CN117395309A (en) Data reporting method, device, computer equipment and storage medium
CN115525614A (en) Data access method, device, equipment, system and storage medium
CN114579494A (en) Interface calling method, device, equipment and medium
CN115529271A (en) Service request distribution method, device, equipment and medium
CN117574186A (en) Session feature recognition method, device, equipment and storage medium
CN115983222A (en) EasyExcel-based file data reading method, device, equipment and medium
CN115794255A (en) Data processing method and device, electronic equipment and storage medium
CN117608944A (en) Method and device for calculating weight migration volume ratio, electronic equipment and storage medium
CN115794830A (en) Data value determination method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination