Interface message self-adaption method for realizing filling-free printing
By using adaptive templates and preset storage formats in the telecommunications information technology system, interface messages are dynamically replaced to adapt to different interface specifications, and the problem of poor adaptability of interface messages in the prior art is solved, and a more stable and unified code version is achieved.
Patent Information
- Application Number
- CN202411521368.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-03-21
AI Technical Summary
When the existing telecommunications information technology system realizes the adaptability of interface packets without filling-out printing, there is a problem that the code needs to be iterated continuously and cannot form a unified version.
By providing an adaptive method for interface packets that can be printed without filling-out, using an adaptive template and a preset storage format, the adaptive template dynamically replaces the adaptive template to obtain interface packets that are adapted to different interface specifications based on the matching request and the data content in the core business table.
It realizes the adaptability of the interface packet without filling-in form printing, avoids hard-coded methods, and improves the stability and unity of the code.
Smart Images

Figure CN119668683A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of telecommunication information technology, and in particular to an interface message adaptation method for realizing form-free printing. Background Art
[0002] In the current telecommunications information technology (IT) system, orders need to interact with various free form printing platforms to achieve the free form printing function for users. During the docking process, each business platform has its own interface protocol, and orders need to comply with the interface specifications of each platform to adapt the interface.
[0003] Currently, this is achieved by customizing the code development based on the interface specifications of each platform.
[0004] However, every time a new platform is connected, custom development work is required, so the code needs to be constantly iterated and a unified version cannot be formed. Summary of the invention
[0005] The embodiment of the present application provides an interface message adaptation method for realizing form-free printing, which can solve the technical problem of poor interface message adaptation capability for realizing form-free printing.
[0006] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0007] In a first aspect, an embodiment of the present application provides an interface message adaptation method for implementing form-free printing, and the interface message adaptation method for implementing form-free printing includes: storing a message for creating a document according to a first preset storage format; the message includes multiple identification keys and multiple data contents; the identification key is used to represent the associated data content; recording at least one data content and its associated identification key in a core business table; connecting to a target platform in response to an input matching request; the matching request includes multiple matching keys; the target platform includes an adaptive template, the adaptive template includes a connector and a key-value pair, the key-value pair includes a first key, a separator and a first value; the adaptive template is pre-stored in the target platform according to a second preset storage format; based on the matching key, traversing the adaptive template, matching the first key, and obtaining a target key; and obtaining a first value corresponding to the target key, recorded as the target value; based on the target key and the target value, obtaining the data content in the core business table or the message, and obtaining a replacement value; according to the replacement value, obtaining a replacement message.
[0008] Based on the above description of the interface message adaptive method for implementing form-free printing provided in the embodiment of the present application, it can be known that the interface message adaptive method for implementing form-free printing includes matching the form-free platform to be docked, and each platform corresponds to an adaptive template. During the docking process, the adaptive template is first obtained, and then the adaptive template is traversed. According to different matching key forms, the corresponding target value is obtained from the message or attribute, and then the adaptive template is replaced accordingly, so that the interface message corresponding to the platform is obtained. Through a reasonable method of storing messages and template configuration, the adaptive technology of interface messages can be implemented through configuration according to different interface specifications, avoiding hard coding methods and improving the adaptive ability of interface messages for implementing form-free printing.
[0009] In a possible implementation manner of the first aspect, the identification key includes a first letter.
[0010] In a feasible implementation of the first aspect, when the first key is a first letter, the first value is a first path of the message.
[0011] In a feasible implementation of the first aspect, when the first key is a first word, the first value is the data content corresponding to the first word in the core business table; the first word is used to represent the attribute address.
[0012] In a feasible implementation of the first aspect, when the first key is the second word, the key-value pair also includes an addition symbol and a second value; the second word is used to represent the calling interface; the first value is the interface name; and the second value is the second path.
[0013] In the second aspect, an embodiment of the present application provides an interface message adaptation method for realizing form-free printing, and the interface message adaptation method for realizing form-free printing includes: creating an adaptive template; the adaptive template includes a connector and a key-value pair, and the key-value pair includes a first key, a separator and a first value; the first key is used to match the matched key to obtain the first value corresponding to the target key, so as to obtain the data content in the core business table or the message and obtain the replacement value; according to the second preset storage format, the adaptive template is stored.
[0014] In this way, matching is performed for the docking free-form platform, and each platform corresponds to an adaptive template. During the docking process, the adaptive template is first obtained, and then the adaptive template is traversed. According to different matching key forms, the corresponding target value is obtained from the message or attribute, and then the adaptive template is replaced accordingly, so that the interface message corresponding to the platform will be obtained. Through reasonable methods of storing messages and template configuration, the adaptive technology of interface messages can be implemented through configuration according to different interface specifications, avoiding hard coding methods and improving the adaptive ability of interface messages for free-form printing.
[0015] In a feasible implementation manner of the second aspect, when the first key is a first letter, the first value is a first path of the message.
[0016] In a feasible implementation of the second aspect, when the first key is a first word, the first value is data content corresponding to the first word in the core business table; the first word is used to represent the attribute address.
[0017] In the third aspect, an embodiment of the present application provides an interface message adaptive system for implementing form-free printing, and the interface message adaptive system for implementing form-free printing includes: at least one processor; a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method provided in the first aspect or the second aspect.
[0018] The interface message adaptive system for implementing form-free printing performs matching for the connected form-free platform by executing the method provided in the first aspect or the second aspect. Each platform corresponds to an adaptive template. During the docking process, the adaptive template is first obtained, and then the adaptive template is traversed. According to different matching key forms, the corresponding target value is obtained from the message or attribute and then the adaptive template is replaced accordingly, so that the interface message corresponding to the platform is obtained. Through reasonable methods of storing messages and template configuration, the adaptive technology of interface messages can be implemented through configuration according to different interface specifications, avoiding hard coding methods and improving the adaptive ability of interface messages for implementing form-free printing.
[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable medium having computer program instructions stored thereon, and the computer program instructions can be executed by a processor to implement the method provided in the first aspect or the second aspect.
[0020] The computer program instructions in the computer-readable medium match the docked free-form platform by implementing the method provided in the first aspect or the second aspect. Each platform corresponds to an adaptive template. During the docking process, the adaptive template is first obtained, and then the adaptive template is traversed. According to different matching key forms, the corresponding target value is obtained from the message or attribute and then the adaptive template is replaced accordingly, so that the interface message corresponding to the platform is obtained. Through a reasonable method of storing messages and template configuration, the adaptive technology of the interface message can be implemented through configuration according to different interface specifications, avoiding the hard-coding method and improving the adaptive ability of the interface message for free-form printing. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A structural diagram of an interface message adaptive system for implementing form-free printing provided in an embodiment of the present application;
[0022] Figure 2 A flowchart of an interface message adaptation method for implementing form-free printing provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention. In the description of the embodiments of the present invention, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0024] In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, the words "first", "second" and the like are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit the difference. At the same time, in the embodiments of the present invention, the words "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or design. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way for easy understanding.
[0025] The principles and features of the present application are described below. The examples given are only used to explain the present application and are not used to limit the scope of the present application.
[0026] The embodiment of the present application provides an interface message adaptation method for implementing form-free printing, which is applicable to telecommunications information technology (IT) systems. Matching is performed for the form-free platforms to be connected, and each platform corresponds to an adaptive template. During the connection process, the adaptive template is first obtained, and then the adaptive template is traversed. According to different matching key forms, the corresponding target value is obtained from the message or attribute, and then the adaptive template is replaced accordingly, so that the interface message corresponding to the platform is obtained. Through a reasonable method of storing messages and template configuration, the adaptive technology of interface messages can be implemented through configuration according to different interface specifications, avoiding hard coding methods and improving the adaptive ability of interface messages for implementing form-free printing.
[0027] The embodiment of the present application provides an interface message adaptation system for realizing form-free printing, which can execute the interface message adaptation method for realizing form-free printing provided in the embodiment of the present application. Figure 1 A structural diagram of an interface message adaptation system for implementing form-free printing provided in an embodiment of the present application.
[0028] like Figure 1 As shown, the interface message adaptation system 001 for implementing form-free printing includes at least one processor 011 and a memory 012 communicatively connected to the at least one processor; wherein the memory 012 stores instructions executable by the at least one processor 011, and the instructions are executed by the at least one processor 011 so that the at least one processor 011 can execute the interface message adaptation method for implementing form-free printing provided in an embodiment of the present application.
[0029] Figure 2 The present invention provides a flowchart of an interface message adaptation method for implementing form-free printing. Figure 2 As shown, in some embodiments, the interface message adaptation method for implementing form-free printing includes the following steps:
[0030] S1, storing a message for creating a document according to a first preset storage format.
[0031] The message includes multiple identification keys and multiple data contents. The data contents can also be called values.
[0032] The identification key is used to represent the associated data content. In some embodiments, the identification key includes the first letter. For example, it can be "U". That is, the message for creating the document uses "U" as the key. In the message (usually referring to the data packet or message format), the letter "U" is used as the identifier of a key. Key-value pairs are a common way of storing and transmitting data, in which the key is used to identify a data field, and the value stores the actual data content. Exemplarily, "U" is the key, and its value is "12345", which may represent the number or ID of the document. Therefore, "using U as a key" means using the letter "U" to represent a specific data field, such as the unique identifier of a document.
[0033] In some embodiments, the first preset storage format is a json format.
[0034] S2, recording at least one data content and its associated identification key into the core business table.
[0035] In this way, some key information in the document printing process is recorded in the core business table of the document, and the attributes are recorded in the key and value format.
[0036] S3, in response to the input matching request, docking with the target platform.
[0037] A match request includes multiple match keys.
[0038] The target platform includes an adaptive template, the adaptive template includes a connector and a key-value pair, the key-value pair includes a first key, a separator and a first value. The adaptive template is pre-stored in the target platform according to a second preset storage format. The second preset storage format includes an XML format and a json format.
[0039] The following describes how to create an adaptive template.
[0040] In some embodiments, the adaptive template includes “&&{key^value}”. “&&{key^value}” is a variable. “&&” is a connector. “{key^value}” is a key-value pair. “key” is the first key. “^” is a separator. “value” is the first value.
[0041] In one implementation, when the first key is the first letter, the first value is the first path of the message. For example, in "&&{U^ROOT.BODY.HEADER.TEANE_ID}", "key" is "U" (i.e., the first letter is U), and "ROOT.BODY.HEADER.TEANE_ID" is the first path (i.e., the path of the message for creating the document). In this way, it means obtaining the message from a certain part of the document message, that is, it means obtaining the message value of the path of the message for creating the document at the node.
[0042] In another implementation, when the first key is the first word, the first value is the data content corresponding to the first word in the core business table. The first word is used to represent the attribute address. Exemplarily, in "&&{BUSYKEY^opcode}", the key value uses BUSYKEY (that is, the first word is BUSYKEY, which is used to represent the attribute address (ID)), and "opcode" is the core business. In this way, it means that the content corresponding to the specified core business ID is filled in, which means that the value corresponding to the core business "opcode" in the core business table is replaced.
[0043] In another implementation, when the first key is the second word, the key-value pair also includes an addition symbol and a second value. The second word is used to characterize the calling interface. The first value is the interface name. The second value is the second path. For example, in "&&{FUNRET^inger%HEADER.LOGINNO}", the key value uses FUNRET (that is, the second word is FUNRET, which is used to characterize the calling interface). "inger" is the interface name. "%" is the addition symbol. HEADER.LOGINNO is the second value, that is, the second path. In this way, it means that the content of the message returned by calling the interface of a certain business system is filled in, which means that after calling the interface, the return message of the interface is obtained, and the value corresponding to the HEADER.LOGINNO path of the return message is replaced.
[0044] S4, based on the matching key, traverse the adaptive template, match the first key, and obtain the target key.
[0045] Traverse the &&{key^value} in the adaptive template, and match the first key from the message or attribute according to different matching key forms. In other words, find the first key that is the same as the matching key as the target key.
[0046] S5, obtain the first value corresponding to the target key, recorded as the target value.
[0047] After obtaining the first value (value) corresponding to the target key, record it as the target value.
[0048] S6, based on the target key and the target value, obtain the data content in the core business table or message to obtain the replacement value.
[0049] S7, obtaining a replacement message according to the replacement value.
[0050] After obtaining the replacement value, replace &&{key^value} in the adaptive template to obtain the replacement message.
[0051] The interface message adaptive method for implementing form-free printing provided by the embodiment of the present application includes matching the form-free platform to be connected, each platform corresponds to an adaptive template, and in the docking process, the adaptive template is first obtained, and then the adaptive template is traversed, and the corresponding target value is obtained from the message or attribute according to different matching key forms, and then the adaptive template is replaced accordingly, so that the interface message corresponding to the platform is obtained. Through a reasonable method of storing messages and template configuration, the adaptive technology of interface messages can be implemented through configuration according to different interface specifications, avoiding the hard-coding method, and improving the adaptive ability of interface messages for implementing form-free printing.
[0052] Based on the same application concept, an interface message adaptive system for implementing form-free printing is also provided in an embodiment of the present application. The method corresponding to the interface message adaptive system for implementing form-free printing can be the interface message adaptive method for implementing form-free printing in the aforementioned embodiment, and its principle of solving the problem is similar to that of the method. The interface message adaptive system for implementing form-free printing provided in an embodiment of the present application includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the methods and / or technical solutions of the aforementioned multiple embodiments of the present application.
[0053] Another embodiment of the present application further provides a computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of the present application described above.
[0054] Specifically, the present embodiment may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device, or device.
[0055] Computer readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than a computer readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0056] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0057] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a 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 may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0058] The flow chart or block diagram in the accompanying drawings shows the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0059] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0060] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or page components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0061] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0062] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0063] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0064] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
[0065] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in a device claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
Claims
1. An interface message adaptive method for realizing form-free printing, characterized in that: include: storing a message for creating a document according to a first preset storage format; the message comprising a plurality of identification keys and a plurality of data contents; The identification key is used to represent the associated data content; Recording at least one of the data contents and the identification key associated therewith into a core business table; In response to the input matching request, docking with the target platform; The matching request includes a plurality of matching keys; the target platform includes an adaptive template, the adaptive template includes a connector and a key-value pair, the key-value pair includes a first key, a separator and a first value; the adaptive template is pre-stored in the target platform according to a second preset storage format; Based on the matching key, traverse the adaptive template, match the first key, and obtain a target key; and obtain the first value corresponding to the target key, recorded as a target value; Based on the target key and the target value, acquiring data content in the core business table or the message to obtain a replacement value; A replacement message is obtained according to the replacement value.
2. The interface message adaptive method for realizing form-free printing according to claim 1, characterized in that: The identification key includes a first letter.
3. The interface message adaptive method for realizing form-free printing according to claim 2, characterized in that: When the first key is a first letter, the first value is a first path of the message.
4. The interface message adaptive method for realizing form-free printing according to any one of claims 1 to 3, characterized in that: In the case where the first key is a first word, the first value is the data content corresponding to the first word in the core business table; The first word is used to represent an attribute address.
5. The interface message adaptive method for realizing form-free printing according to any one of claims 1 to 3, characterized in that: In the case where the first key is a second word, the key-value pair further includes an addition symbol and a second value; the second word is used to represent a calling interface; the first value is the interface name; and the second value is a second path.
6. An interface message adaptive method for realizing form-free printing, characterized in that: The interface message adaptive method for realizing form-free printing includes: Creating an adaptive template; the adaptive template includes a connector and a key-value pair, the key-value pair includes a first key, a separator and a first value; the first key is used to match the matched key, obtain the first value corresponding to the target key, so as to obtain the data content in the core business table or the message, and obtain the replacement value; The adaptive template is stored according to a second preset storage format.
7. The interface message self-adaptation method for realizing form-free printing according to claim 6, characterized in that: When the first key is a first letter, the first value is a first path of the message.
8. The interface message self-adaptation method for realizing form-free printing according to any one of claims 6 or 7, characterized in that: In the case where the first key is a first word, the first value is the data content corresponding to the first word in the core business table; The first word is used to represent an attribute address.
9. An interface message adaptive system for realizing form-free printing, characterized in that: include: at least one processor; a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1 to 8.
10. A computer readable medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the method according to any one of claims 1 to 8.