A software interface design method of switchable data format
By designing a software interface method that allows for switching data formats, and independently handling service processing and data format conversion, the problems of large development workload and difficult maintenance in existing technologies are solved, achieving efficient data format conversion and expansion capabilities.
Patent Information
- Application Number
- CN202411226444.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2044-09-03
AI Technical Summary
In existing technologies, when software systems need to provide multiple data formats, it leads to a large development workload, difficult coding and maintenance, and is not conducive to the expansion of new data formats.
Design a software interface method with switchable data formats. By constructing a context data structure for the request data and using preset conversion modules to convert the request data into target data strings, including JSON, XML and HTML conversion modules, the service processing and data format conversion processes are handled independently, reducing coupling.
It improves development efficiency, reduces redundant development work, and supports multiple services sharing the data format conversion module, making it easy to expand to new data formats.
Smart Images

Figure CN119201047B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data format switching, in particular to a software interface design method capable of switching data formats. BACKGROUND
[0002] With the continuous development of information technology, the requirements for the interactive interface of software systems are getting higher and higher. The same interface may have different requirements when facing different clients or being in different running environments, such as returning data in a specified format.
[0003] At present, when solving this problem, the existing invention generally completes it by designing different service interfaces, such as specific coding of software for specific services to provide services in JSON data format, and similarly specific coding is required to provide XML data format.
[0004] Based on the prior art, if multiple services of software are to provide different data formats to the outside, then multiple combined coding is required, which will cause problems such as large development workload, difficult coding maintenance, and not conducive to the expansion of new data formats. SUMMARY
[0005] The present application is used to solve the problem in the prior art that if multiple services of software are to provide different data formats to the outside, then multiple combined coding is required, which will cause problems such as large development workload, difficult coding maintenance, and not conducive to the expansion of new data formats.
[0006] In a first aspect, the present application provides a software interface design method capable of switching data formats, comprising:
[0007] When receiving a data request of a client, a context data structure of the request data is constructed;
[0008] According to the context data structure, the request data is converted into a target data string through a preset conversion module;
[0009] The target data string is returned to the client.
[0010] In combination with the first aspect, the context data structure is further used to temporarily store the request data and attribute mark the request data, wherein:
[0011] The attribute mark includes a success mark, a prompt mark and a result mark;
[0012] The success mark is used to determine whether the data request of the current client is successful, and when the data request is successful, a true identifier or a false identifier is generated;
[0013] The prompt mark is used to generate storage prompts and exception information prompts when the data request fails;
[0014] The result data is used to store the result data of the data request when the data request is successful, and the result data is represented in a key-value pair, wherein each result data corresponds to a key-value pair when there are multiple result data.
[0015] In combination with the first aspect, the context data structure of the request data is constructed, and further includes:
[0016] According to the context data structure, the weight values of each group of strings in the request data are determined by assigning the request data according to the string weight.
[0017] It is judged whether there are string groups with the same weight value and the same string prefix, wherein:
[0018] When there are, the corresponding string group is taken as the verification string of the target data string, and it is judged through the verification string whether the target data string exists after conversion Format conversion exception, and when the format conversion exception, upload the exception data to the client;
[0019] When there is no, according to the weight value of each group of strings, the initial weight sequence is generated by arranging the strings according to the weight value, and it is judged whether the target weight sequence of the target data string and the initial weight sequence are the same, and when they are not the same, the format conversion exception information is output to the client.
[0020] In combination with the first aspect, the preset conversion module includes: a JSON conversion module, an XML conversion module, and an HTML conversion module.
[0021] In combination with the first aspect, the request data is converted into a target data string by the preset conversion module, including:
[0022] According to the request data, the initial data format is determined, and the target format of the target data string to be converted is determined.
[0023] According to the initial data format, the first format parameter of the request data is determined.
[0024] According to the target format, the second format parameter of the request data is determined.
[0025] According to the format difference between the first format parameter and the second format parameter, the activation interval of the preset conversion module to which the format difference interval belongs is judged, and the corresponding preset conversion module is activated.
[0026] The activation interval is the response interval of the preset conversion module, and when it is sensed that there is a format difference within the response interval, the mapping relationship between the initial data format corresponding to the first format parameter and the target format corresponding to the second format parameter is determined, and the activated preset conversion module is determined based on the mapping relationship.
[0027] According to the first aspect, the converting the request data into the target data string through the preset conversion module further comprises:
[0028] According to the data request, determining an identification parameter of the software interface;
[0029] According to the identification parameter, judging whether there is a target conversion module in the preset conversion module that meets the identification parameter;
[0030] When the target conversion module exists, according to the data request, importing the request data into the target conversion module, and performing format conversion according to the preset rules of the target conversion module.
[0031] According to the first aspect, the converting the request data into the target data string through the preset conversion module further comprises:
[0032] According to the structural features and the feature correlation of the upper and lower data structures of the request data, obtaining a format conversion component corresponding to both the structural conversion and the correlation conversion in the target conversion module as a target calling component;
[0033] According to the target calling component, determining a conversion path, and determining a target conversion direction in which the target conversion module converts the request data through the corresponding structural conversion component and the correlation conversion component;
[0034] According to the target conversion direction and the context structure, determining a target context structure of the target data string after the conversion of the request data.
[0035] According to the first aspect, the returning the target data string to the client further comprises:
[0036] According to the context data structure, determining a first data message quantity of the request data in the conversion process;
[0037] According to the target data string, determining a second data message quantity of the request data after the conversion;
[0038] Judging whether the first data message quantity and the second data message quantity are consistent, wherein:
[0039] When the first data message quantity and the second data message quantity are consistent, and there is no repeated data message in the second data message, it is identified that the conversion of the request data is normal;
[0040] When the first data message quantity and the second data message quantity are inconsistent or there is a repeated data message in the second data message, feeding back a format conversion error to the client.
[0041] According to the first aspect, the returning the target data string to the client further comprises:
[0042] According to the context data structure, determine the data bit sequence of the initial character string of the request data;
[0043] According to the data bit sequence, when the target data string is generated, it is determined whether the data contents of the same data bits before and after the conversion are consistent, and when the data bits are consistent, the target data string corresponding to the data bits in the target data string is returned to the client.
[0044] In combination with the first aspect, the returning of the target data string to the client further comprises:
[0045] A custom registration database of the preset conversion module is configured in the client, and when an update request is received, it is determined whether the to-be-loaded conversion module in the update request is in the custom registration database, and the to-be-loaded conversion module is loaded in the custom registration database.
[0046] The present application has the advantages that:
[0047] The present application separates the service processing and data format conversion processes by the designed data context, eliminates the coupling of each other, and focuses on the corresponding coding development, so that the development efficiency is higher. The data format conversion module is faced to the data context, and the internal data structure is independent of the specific service, so that the module can be shared by multiple services in the software, reduces the redundant development work, and can also be easily extended to new data formats.
[0048] Other features and advantages of the present application will be described in the following description, and some will become apparent from the description, or will be understood by those skilled in the art. The purpose and other advantages of the present application can be achieved and obtained by the structure specifically pointed out in the written description and the drawings.
[0049] The technical solutions of the present application will be further described in detail below with the help of the drawings and examples. BRIEF DESCRIPTION OF DRAWINGS
[0050] The accompanying drawings are used to provide a further understanding of the present application, and constitute a part of the specification, together with the embodiments of the present application, to explain the present application, and do not constitute a limitation of the present application. In the drawings:
[0051] Figure 1 A method flow chart of a software interface design method for a switchable data format in an embodiment of the present application;
[0052] Figure 2 A conversion exception determination flow chart for constructing a context data structure of request data in an embodiment of the present application;
[0053] Figure 3A conversion process diagram for converting the request data into a target data string through a preset conversion module in the embodiment of the present application. DETAILED DESCRIPTION
[0054] The preferred embodiments of the present application are described below in conjunction with the accompanying drawings, in which it is understood that the preferred embodiments described herein are merely intended to illustrate and explain the present application, and are not intended to limit the present application.
[0055] Term explanation:
[0056] Service: logical processing performed by software to complete a specified job, including transformation, combination, calculation, association of input parameters, and obtaining a processing result.
[0057] Software interface: a way in which software provides services, mainly referring to what parameters are received by the software and what data is returned by the software when the software is used.
[0058] Data format: a specification or mode agreed by both parties for data analysis, such as XML format, JSON format, web format, and key-value pair format.
[0059] As shown in FIG. Figure 1 The embodiment provides a software interface design method capable of switching data formats, including the following steps:
[0060] When receiving a data request of a client, a context data structure of the request data is constructed;
[0061] According to the context data structure, the request data is converted into a target data string through a preset conversion module;
[0062] The target data string is returned to the client.
[0063] The principle of the above technical solution is as follows:
[0064] In the present application, a design data context of the request data is first determined, the data context is a data structure used for temporary storage of result data in a service processing process, and at least includes the following key attributes,
[0065] Success flag: whether the present processing is successful, taking a value of true or false;
[0066] Prompt information: if the processing is not successful, prompt or exception information is stored.
[0067] Result data: if the processing is successful, the result data of the service is stored, the result data of the service processing is represented in a group of key-value pairs in a general type, and multiple groups of result data are multiple groups of key-value pairs.
[0068] A data format conversion module is designed.
[0069] The conversion module is used for converting the data context into a specified data format, and different conversion modules are designed for different formats, such as a JSON conversion module, an XML conversion module and an HTML conversion module.
[0070] The flow control module is designed.
[0071] The flow control module constructs a data context when receiving a client request for the first time, and passes the data context to a service processing module, stores processing results on the data context after the service processing is completed, and then passes the data context to a data format conversion module, especially converts the data context into a specific data format, and the type of the data format conversion module is determined according to parameters of the client request.
[0072] The technical scheme has the beneficial effects that:
[0073] The two processes of service processing and data format conversion are separated by the designed data context, the coupling between the two processes is eliminated, each process focuses on corresponding coding development and is not interfered by the other process, and therefore the development efficiency is higher. The data format conversion module is used for the data context, and the data format conversion module is a general data structure that is independent of specific services, and therefore the data format conversion module can be shared by multiple services in software, redundant development work is reduced, and new data formats can be conveniently extended.
[0074] As an embodiment of the application, the context data structure is also used for temporarily storing request data and marking attributes of the request data, and the attributes include:
[0075] The attributes include a success attribute, a prompt attribute and a result attribute.
[0076] The success attribute is used for judging whether the data request of the current client is successful, and a true identifier or a false identifier is generated when the data request is successful.
[0077] The prompt attribute is used for generating storage prompts and exception information prompts when the data request fails.
[0078] The result data is used for storing result data of the data request when the data request is successful, and the result data is represented in the form of a key-value pair.
[0079] The principle of the technical scheme is that:
[0080] The software interface design method of the present invention is applicable to a variety of application scenarios. For example, it can realize the saving and reading of game character status in video games; it can realize the reading and modification of product information in e-commerce systems; and it can realize the reading and modification of files in file systems, etc.
[0081] The context data structure is also used to temporarily store request data and add attribute tags to it. Therefore, when processing request data, the context data structure can be used to temporarily store the request data and add corresponding attribute tags to it, thus facilitating subsequent processing and use.
[0082] Specifically, when processing request data, different attribute flags can be set according to different business needs and processing logic. For example, when processing game character status, a success flag can be set to determine whether the request was successful, and a prompt flag can be used to display error messages; when processing product information, a success flag can be set to determine whether the request was successful, and a result flag can be used to return product information, etc.
[0083] Meanwhile, to ensure data reliability and consistency, timestamps or other control information can be added to the request data to quickly locate and resolve problems. Furthermore, to improve system performance and efficiency, request data with similar attributes can be grouped together for processing, thereby reducing redundant calculations or unnecessary data transfers.
[0084] As one embodiment of the present invention: such as Figure 2 As shown, the context data structure for constructing the request data further includes:
[0085] Based on the context data structure, the request data is assigned values according to string weights to determine the weight value of each string in the request data;
[0086] Determine if there exists a string group with the same weight value and the same string prefix, where:
[0087] If it exists, the corresponding string group is used as the verification string of the target data string. The verification string is used to determine whether the target data string has a format conversion error after conversion. If a format conversion error occurs, the error data is uploaded to the client.
[0088] If the target data string does not exist, the string is sorted according to the weight value of each string group to generate an initial weight sequence. The target weight sequence of the target data string is then compared with the initial weight sequence. If they are different, a format conversion error message is output to the client.
[0089] The principle behind the above technical solution is as follows:
[0090] According to the business requirements, the application defines a set of strings as weight strings and takes them as a weight sequence. For each request data, all strings in it are arranged in order according to the weight string sequence to obtain a weight sequence. In the weight sequence, all strings with the same weight value form a string group. The found string group is checked to determine whether there is a case of the same string prefix. If there is, the string group is taken as the verification string of the target data string. The target data string is converted, and the converted result is compared with the corresponding verification string. If the converted result matches the corresponding verification string, it means that the format conversion is correct, otherwise it means that the format conversion is incorrect. If an error occurs during conversion, the error information is uploaded to the client, and the client performs corresponding processing. If there is no string group with the same weight value and the same string prefix, all strings in the request data are assigned a weight value, and an initial weight sequence is generated. Then, the target data string is converted and compared with the generated initial weight sequence. If the converted result is different from the initial weight sequence, the format conversion exception information is output to the client.
[0091] As an embodiment of the application, the preset conversion module includes a JSON conversion module, an XML conversion module, and an HTML conversion module.
[0092] The principle of the above technical solution is:
[0093] The application predefines multiple data formats to achieve more flexible data exchange and parsing in different application environments. For example, in some scenarios, JSON format may be needed for data exchange, while in other scenarios, XML or HTML format may be needed. By pre-setting these data formats and providing dedicated conversion modules, the software interface can work normally in different application environments.
[0094] In the application, JSON (JavaScript Object Notation) is a lightweight data exchange format that is easy to read and write. It organizes data based on objects / arrays, supporting various data types such as text, numbers, booleans, objects, arrays, etc. JSON format data is very easy to parse and generate, so it has built-in support in many programming languages.
[0095] XML (Extensible Markup Language): This is a custom data format, mainly used to describe data structure and relationship. XML files are separated by pairs of start and end tags ' / >', with content between the start and end tags of each element. The advantage of XML is that it provides a good structured data representation, making it easy to understand and check the integrity of the data. However, its disadvantage is the high cost of writing and parsing.
[0096] HTML (Hypertext Markup Language): This is a standard markup language used to build web pages. The main role of HTML is to create a structured framework for web pages, defining the content of the web page through various tags and attributes. The advantage of HTML is easy to learn and use, and it can run on any device, but its main problem is that it is not a real data exchange format, and data exchange and parsing usually need to be done on the server side.
[0097] As an embodiment of the present application: the request data is converted into a target data string through a preset conversion module, which includes:
[0098] According to the request data, determine the initial data format, and determine the target format of the target data string to be converted;
[0099] According to the initial data format, determine the first format parameter of the request data;
[0100] According to the target format, determine the second format parameter of the request data;
[0101] According to the format difference between the first format parameter and the second format parameter, determine the activation interval of the preset conversion module to which the format difference interval belongs, and activate the corresponding preset conversion module;
[0102] The activation interval is the response interval of the preset conversion module. When it is sensed that there is a format difference within the response interval, the mapping relationship between the initial data format corresponding to the first format parameter and the target format corresponding to the second format parameter is determined, and the activated preset conversion module is determined based on the mapping relationship.
[0103] The principle of the above technical solution is:
[0104] First, according to the request data, the initial data format needs to be determined, as well as the target format of the target data string corresponding to this data format.
[0105] Second, according to the target format, the first format parameter of the request data needs to be determined, that is, which data format needs to be used to represent the original request data under this target format.
[0106] Then, according to the target format, the second format parameter of the request data needs to be determined, which is the way to further process and display the request data under this target format.
[0107] Next, according to the format difference between the first format parameter and the second format parameter, the activation interval of the preset conversion module to which they belong is determined, and the corresponding preset conversion module is activated.
[0108] Finally, when it is detected that the format difference is within the response interval, the mapping relationship between the initial data format corresponding to the first format parameter and the target format corresponding to the second format parameter is determined, and based on this mapping relationship, the activated preset conversion module is determined.
[0109] As an embodiment of the present application: the request data is converted into a target data string through a preset conversion module, which further includes:
[0110] According to the data request, the identification parameter of the software interface is determined;
[0111] According to the identification parameter, it is judged whether there is a target conversion module in the preset conversion module that meets the identification parameter;
[0112] When included, according to the data request, the request data is imported into the target conversion module, and the format conversion is performed according to the preset rules of the target conversion module.
[0113] The principle of the above technical solution is:
[0114] First, according to the data request, the identification parameter of the software interface needs to be determined. These parameters are usually defined according to business requirements and specific application scenarios, such as user name, order number, etc.
[0115] Next, according to these identification parameters, it is checked whether there is a target conversion module in the preset conversion module that meets the request target. If a conversion module that meets the conditions is found, the next step can be continued. If no conversion module that meets the conditions is found, the identification parameter needs to be redefined or adjusted.
[0116] If a conversion module that meets the conditions is found, the request data can be imported into the target conversion module according to the content of the request data. In this process, the format conversion needs to follow the preset rules of the target conversion module.
[0117] After the format conversion is completed, the result data needs to be checked and verified to ensure the correctness and consistency of the conversion result. If errors or problems are found, the previous step needs to be reprocessed in time.
[0118] As an embodiment of the present application: as Figure 3As shown, the request data is converted into a target data string by a preset conversion module, and the method further comprises:
[0119] According to the structure characteristics and feature correlations of the context data structure of the request data, a format conversion component corresponding to the structure conversion and the correlation conversion in the target conversion module is obtained as a target calling component;
[0120] According to the target calling component, a conversion path is determined, and a target conversion direction of the target conversion module for converting the request data through the corresponding structure conversion component and the correlation conversion component is determined;
[0121] According to the target conversion direction and the context structure, a target context structure of the target data string converted from the request data is determined.
[0122] The principle of the above technical solution is:
[0123] The present application mainly obtains a format conversion component corresponding to the structure conversion and the correlation conversion in the target conversion module as a target calling component according to the structure and feature correlations of the context data structure of the request data. Then, a conversion path is determined according to the target calling component, and a target conversion direction of the target conversion module for converting the request data through the corresponding structure conversion component and the correlation conversion component is determined. Finally, a target context structure of the target data string converted from the request data is determined according to the target conversion direction and the context structure. Such a design can make the software interface more intelligent and better adapt to different data structures and business requirements
[0124] As an embodiment of the present application, the target data string is returned to the client, and the method further comprises:
[0125] According to the context data structure, a first data message quantity of the request data in the conversion process is determined;
[0126] According to the target data string, a second data message quantity of the request data after conversion is determined;
[0127] It is judged whether the first data message quantity and the second data message quantity are consistent, wherein:
[0128] When the first data message quantity and the second data message quantity are consistent, and there is no repeated data message in the second data message, it is indicated that the request data conversion is normal;
[0129] When the first data message quantity and the second data message quantity are inconsistent or there is a repeated data message in the second data message, the client is fed back with a format conversion error.
[0130] The principle of the above technical solution is:
[0131] The main purpose of the present application is to ensure the correctness and integrity of the data conversion process. By checking the number of data messages generated at each stage of the data conversion process, and the content of the data messages generated at each stage, possible errors can be discovered and corrected in a timely manner. If an error is found, the client can be informed of the type and location of the error by feeding back the format conversion error, so that appropriate measures can be taken to correct it.
[0132] As an embodiment of the present application: the target data string is returned to the client, further comprising:
[0133] According to the context data structure, the data bit sequence of the initial string of the requested data is determined;
[0134] According to the data bit sequence, when the target data string is generated, it is determined whether the data content of the same data bit before and after conversion is consistent, and when the data bit is consistent, the target data string corresponding to the data bit in the target data string is returned to the client.
[0135] The principle of the above technical solution is:
[0136] The present application determines the information of the corresponding data bit in the target data string according to the data bit sequence of the initial string of the requested data. This step mainly relies on the attribute mark stored in the context data structure and the associated information of the requested data. Then, during the generation of the target data string, the corresponding data bits before and after conversion are checked, and if an error is found, the conversion is immediately stopped and the error is fed back to the client.
[0137] Secondly, since the data in the target data string is in binary form, and the data in the requested data may be in other forms, such as hexadecimal, ASCII, etc. Therefore, this method also needs to parse the target data string bit by bit, and convert it to the data format required by the client according to the corresponding attribute mark in the context data structure.
[0138] As an embodiment of the present application: the target data string is returned to the client, further comprising:
[0139] A custom registration database of the preset conversion module is configured in the client, and when an update request is received, it is determined whether the to-be-loaded conversion module in the update request is in the custom registration database, and the to-be-loaded conversion module is loaded in the custom registration database.
[0140] The principle of the above technical solution is:
[0141] The application needs to configure a custom registration database in the client, which records all the registered conversion modules and their attributes and other information. When receiving an update request, the server first checks whether the conversion module to be updated exists in the custom registration database. If not, the conversion is performed according to the specified format in the request, and the result is returned to the client. If the conversion module already exists in the database, the server extracts the conversion module to be updated from the request and loads the corresponding conversion module from the database to perform the conversion, and then returns the result to the client.
[0142] In this way, the client can flexibly select and load the preset conversion module according to its own needs and actual situation, to achieve more efficient and intelligent data conversion. At the same time, since all conversion modules have been preset and saved on the server side, conversion errors caused by software vulnerabilities and other reasons can be avoided, thereby ensuring the security and stability of data conversion.
[0143] Obviously, those skilled in the art can make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application also intends to include these modifications and variations.
Claims
1. A method of designing a software interface with switchable data formats, characterized by, The method comprises the following steps: when receiving a data request of a client, constructing a context data structure of the request data; according to the context data structure, converting the request data into a target data string through a preset conversion module; returning the target data string to the client; the step of converting the request data into the target data string through the preset conversion module further comprises the steps of: determining an identification parameter of a software interface according to the data request; judging whether there is a target conversion module in the preset conversion module that meets the identification parameter according to the identification parameter; when there is, importing the request data into the target conversion module according to the data request, and performing format conversion according to a preset rule of the target conversion module; the step of converting the request data into the target data string through the preset conversion module further comprises the steps of: according to the structure features and feature correlations of the context data structure of the request data, obtaining a format conversion component corresponding to both structure conversion and correlation conversion in the target conversion module as a target calling component; determining a conversion path according to the target calling component, and determining a target conversion direction in which the target conversion module converts the request data through the corresponding structure conversion component and correlation conversion component; determining a target context structure of the target data string after conversion of the request data according to the target conversion direction and the context structure.
2. The software interface design method of claim 1, wherein, the context data structure is further used for temporarily storing the request data and marking the properties of the request data, wherein: the property marking comprises a success mark, a prompt mark and a result mark; the success mark is used for judging whether the data request of the current client is successful, and a true mark or a false mark is generated when the data request is successful; the prompt mark is used for generating storage prompts and exception information prompts when the data request fails; the result data is used for storing result data of the data request when the data request is successful, and the result data is represented in the form of key-value pairs, wherein, when there are multiple result data, each result data corresponds to a key-value pair.
3. The software interface design method of claim 1, wherein, the step of constructing the context data structure of the request data further comprises the steps of: according to the context data structure, assigning weights to each group of strings in the request data to determine the weight values of the groups of strings; judging whether there are groups of strings with the same weight values and the same string prefixes, wherein: when there are, taking the corresponding groups of strings as verification strings of the target data string, judging whether there is a format conversion exception after conversion of the target data string through the verification strings, and uploading exception data to the client when there is a format conversion exception; when there are not, arranging the strings according to the weight values to generate an initial weight sequence, and judging whether a target weight sequence of the target data string is the same as the initial weight sequence, and outputting format conversion exception information to the client when they are not the same.
4. The software interface design method of claim 1, wherein, the preset conversion module comprises a JSON conversion module, an XML conversion module and an HTML conversion module.
5. The software interface design method of claim 1, wherein, the step of converting the request data into the target data string through the preset conversion module comprises the steps of: determining an initial data format according to the request data, and determining a target format of the target data string to be converted; determining a first format parameter of the request data according to the initial data format; According to the target format, a second format parameter of the request data is determined; According to a format difference between the first format parameter and the second format parameter, an activation interval of a preset conversion module to which the format difference interval belongs is determined, and the corresponding preset conversion module is activated; The activation interval is a response interval of the preset conversion module, and when it is sensed that the format difference is within the response interval, a mapping relationship between an initial data format corresponding to the first format parameter and the target format corresponding to the second format parameter is determined, and based on the mapping relationship, the activated preset conversion module is determined.
6. The software interface design method of claim 1, wherein, The returning of the target data string to the client further includes: According to the context data structure, a first data message quantity of the request data in the conversion process is determined; According to the target data string, a second data message quantity of the request data after the conversion is determined; It is judged whether the first data message quantity and the second data message quantity are consistent, wherein: When the first data message quantity and the second data message quantity are consistent, and there is no repeated data message in the second data message, it is indicated that the request data conversion is normal; When the first data message quantity and the second data message quantity are inconsistent or there is a repeated data message in the second data message, a format conversion error is fed back to the client.
7. The software interface design method of claim 1, wherein, The returning of the target data string to the client further includes: According to the context data structure, a data bit sequence of an initial string of the request data is determined; According to the data bit sequence, when the target data string is generated, it is judged whether the data contents of the same data bits before and after the conversion are consistent, and when the data bits are consistent, the target data string corresponding to the data bits in the target data string is returned to the client.
8. The software interface design method of claim 1, wherein, The returning of the target data string to the client further includes: A custom registration database of the preset conversion module is configured in the client, and when an update request is received, it is judged whether a to-be-loaded conversion module in the update request is in the custom registration database, and the to-be-loaded conversion module is loaded in the custom registration database.
Citation Information
Patent Citations
Method and system for realizing service orchestration data context sharing and management control under micro-service architecture
CN111309454A
Elastic interactive processing method for multi-source heterogeneous data
CN117688072A