Data semantic translation method and apparatus, and storage medium
Patent Information
- Application Number
- PCT/CN2023/097559
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2024-12-05
Smart Images

Figure CN2023097559_05122024_PF_FP_ABST
Abstract
Description
DATA SEMANTIC TRANSLATION METHOD AND APPARATUS, AND STORAGE MEDIUMTECHNICAL FIELD
[0001] The present disclosure relates to the field of data communication and distributed control, in particular to a data semantic translation method and apparatus, and a storage medium.BACKGROUND
[0002] Nowadays, more and more control systems begin to use a distributed system architecture. This kind of control system is composed of a series of applications. All these applications follow the same interface standard, provide a single function, and are easy to develop, maintain and deploy. Based on the same interface standard and same architecture, these applications build an ecosystem which reduce the time cost for a user building a control system from scratch.
[0003] To create an automation solution with these automation applications, the user may use some application recommendation systems to obtain recommendation applications, but not all of the applications fit to mutual connection due to the incompatible data model and different data units.SUMMARY
[0004] In order to solve the above problem, the present disclosure provides a data semantic translation method and apparatus, and a storage medium, so that data exchange can be implemented between applications with incompatible data, and an automation solution can be created quickly.
[0005] A data semantic translation method provided in an embodiment of the present disclosure includes: obtaining data information, including: obtaining at least one piece of source data generated by at least one source application and a data type of the source data and obtaining a data type of target data needed by a target application; calling a semantic translation tool, including: calling a semantic translation tool corresponding to the data type of the source data and the data type of the target data from a semantic translation tool library where the semantic translation tool and a scheduling rule are prestored; performing semantic translation, including: calling, based on the source data and the prestored scheduling rule corresponding to the semantic translation tool, a prestored script corresponding to the semantic translation tool from the semantic translation tool library where the script is prestored, and generating translation data; and outputting the translation data, including: transmitting the translation data to the target application. Data translation between applications with incompatible data is implemented, data exchange between the applications is implemented, and the automation solution can be created quickly.
[0006] In an implementation, the prestored scheduling rule includes at least one of the following: starting the semantic translation tool for performing semantic translation of all source data in a case that any piece of the source data is updated; starting the semantic translation tool for performing semantic translation of all the source data in a case that all the source data is updated; and / or performing, by the semantic translation tool, semantic translation of all the source data in cycles. Semantic translation of different modes is implemented, which is applicable to applications with various different requirements, and system performance is improved.
[0007] In an implementation, before obtaining the data information, the method further includes: establishing the semantic translation tool library, including: defining the semantic translation tool, the data type of the source data and the data type of the target data corresponding to the semantic translation tool, the semantic translation tool scheduling rule and a corresponding relationship between the semantic translation tool scheduling rule and the semantic translation tool, and storing them in the semantic translation tool library; and defining the script and a corresponding relationship between the script and the semantic translation tool, and storing them in the semantic translation tool library, where the script includes a specific computing mode of transforming the source data to the translation data. Configuration information of the semantic translation tool in different cases is defined in advance, which is applicable to the applications with various different requirements.
[0008] A data semantic translation apparatus provided in an embodiment of the present disclosure includes: a data information acceptance module, configured to: obtain at least one piece of source data generated by at least one source application and a data type of the source data and obtain a data type of target data needed by a target application; a data transformation tool calling module, configured to: call a semantic translation tool corresponding to the data type of the source data and the data type of the target data from a semantic translation tool library where the semantic translation tool and a scheduling rule are prestored; a semantic translation module, configured to: call, based on the source data and the prestored scheduling rule corresponding to the semantic translation tool, a prestored script corresponding to the semantic translation tool from the semantic translation tool library where the script is prestored, and generate translation data; and a data output module, configured to: transmit the translation data to the target application. Data translation between applications with incompatible data is implemented, data exchange between the applications is implemented, and the automation solution can be created quickly.
[0009] In an implementation, the prestored scheduling rule includes at least one of the following: starting the semantic translation tool for performing semantic translation of all source data in a case that any piece of the source data is updated; starting the semantic translation tool for performing semantic translation of all the source data in a case that all the source data is updated; and / or performing, by the semantic translation tool, semantic translation of all the source data in cycles. Semantic translation of different modes is implemented, which is applicable to applications with various different requirements, and system performance is improved.
[0010] In an implementation, the apparatus further includes: a semantic translation tool library establishing module, configured to: define the semantic translation tool, the data type of the source data and the data type of the target data corresponding to the semantic translation tool, the semantic translation tool scheduling rule and a corresponding relationship between the semantic translation tool scheduling rule and the semantic translation tool, and store them in the semantic translation tool library; and define the script and a corresponding relationship between the script and the semantic translation tool, and store them in the semantic translation tool library, where the script includes a specific computing mode of transforming the source data to the translation data. Configuration information of the semantic translation tool in different cases is defined in advance, which is applicable to the applications with various different requirements.
[0011] An electronic device provided by an embodiment of the present disclosure includes: at least one processor; and a memory coupled to the at least one processor, the memory being configured to store an instruction, and the instruction, when executed by the at least one processor, causing the processor to perform the method described above.
[0012] An embodiment of the present disclosure provides a computer-readable storage medium, storing a computer instruction, the computer instruction, when run, implementing the method as described in any above implementation.
[0013] A computer program product provided by an embodiment of the present disclosure includes a computer program, the computer program, when executed by a processor, implementing the method as described in any above implementation.BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The following accompanying drawings are only intended to give schematic illustrations and explanations of the present disclosure but are not intended to limit the scope of the present disclosure. Where,
[0015] FIG. 1 is a schematic flowchart of a data semantic translation method according to an embodiment of the present disclosure.
[0016] FIG. 2 is a schematic structural diagram of a data semantic translation apparatus according to an embodiment of the present disclosure.
[0017] FIG. 3 is a schematic diagram of an electronic device according to an embodiment of the present disclosure.
[0018] Descriptions of reference numerals are as follows: DETAILED DESCRIPTION
[0019] To provide a clearer understanding of the technical features, objectives, and effects of the present disclosure, specific implementations of the present disclosure are described with reference to the accompanying drawings.
[0020] Many specific details are set forth in the following description to facilitate a full understanding of the present disclosure, but the present disclosure may alternatively be implemented in other manners different from those described herein and is therefore not limited by specific embodiments disclosed below.
[0021] As shown in this application and the claims, words such as “a / an, ” “one, ” “one kind, ” and / or “the” do not refer specifically to singular forms and may also include plural forms, unless the context expressly indicates an exception. In general, terms “comprise” and “include” merely indicate including clearly identified steps and elements. These steps and elements do not constitute an exclusive list. A method or a device may also include other steps or elements.
[0022] In view of incompatible data models and different data units, not all of applications fit to mutual connection.
[0023] Thus, an embodiment of the present disclosure provides a more optimized inter-application data exchange solution, which can implement mutual connection between the applications with incompatible data. A data semantic translation method according to an embodiment of the present disclosure includes: obtaining data information, including: obtaining at least one piece of source data generated by at least one source application and a data type of the source data and obtaining a data type of target data needed by a target application; calling a semantic translation tool, including: calling a semantic translation tool corresponding to the data type of the source data and the data type of the target data from a semantic translation tool library where the semantic translation tool and a scheduling rule are prestored; performing semantic translation, including: calling, based on the source data and the prestored scheduling rule corresponding to the semantic translation tool, a prestored script corresponding to the semantic translation tool from the semantic translation tool library where the script is prestored, and generating translation data; and outputting the translation data, including: transmitting the translation data to the target application. The technical solution in this embodiment of the present disclosure can implement data exchange between applications with incompatible data, and quickly create an automation solution.
[0024] FIG. 1 is a schematic flowchart of a method 100 according to an embodiment of the present disclosure. As shown in FIG. 1, the method 100 may include:
[0025] step S101: data information is obtained, including: obtaining at least one piece of source data generated by at least one source application and a data type of the source data and obtaining a data type of target data needed by a target application;
[0026] In this embodiment, the source data may come from a plurality of source applications, each source application may generate a plurality of pieces of source data, and all the source data may include various different data types, such as a type, a structure and a unit. The source data may be obtained by being connected to the source application in a form of a certain interface. The source data may be accepted, buffered and transferred in a united mode through a data acceptance layer, and parallel processing of different multi-semantic translation threads is implemented.
[0027] In this embodiment, the source application may be an application 1 and an application 2, the target application may be an application 4, the application 1 generates data d1 with a data type m1, the application 2 generates data d2 with a data type m2, and target data d4 and d5 needed by the application 4 has a data type m4. The data types between the source application and the target application are incompatible.
[0028] Step S102: a semantic translation tool is called, including: calling a semantic translation tool corresponding to the data type of the source data and the data type of the target data from a semantic translation tool library where the semantic translation tool and a scheduling rule are prestored.
[0029] In this embodiment, before obtaining the data information, the method further includes:
[0030] step S105: the semantic translation tool library is established, including: defining the semantic translation tool, the data type of the source data and the data type of the target data corresponding to the semantic translation tool, the semantic translation tool scheduling rule and a corresponding relationship between the semantic translation tool scheduling rule and the semantic translation tool, and storing them in the semantic translation tool library; and defining the script and a corresponding relationship between the script and the semantic translation tool, and storing them in the semantic translation tool library, where the script includes a specific computing mode of transforming the source data to the translation data.
[0031] In this embodiment, the semantic translation tool may have an input data list and an output data list. The input data list represents a data type needed by the semantic translation tool, and the output data list represents a data type that the semantic translation tool may translate and output. When the data type of the source data matches the data type in the input data list of the semantic translation tool, and the data type of the target data matches the data type in the output data list of the semantic translation tool, it may be determined that the semantic translation tool may be called.
[0032] In this embodiment, when the data types in the input data list of the semantic translation tool are m1 and m2, and the data type in the output data list is m4, it may be regarded as the semantic translation tool matching the data types of the application 1, the application 2 and the application 4, and the semantic translation tool may be called.
[0033] Step S103: semantic translation is performed, including: calling, based on the source data and the prestored scheduling rule corresponding to the semantic translation tool, a prestored script corresponding to the semantic translation tool from the semantic translation tool library where the script is prestored, and generating translation data. A plurality of instantiated running scripts form a semantic translation pool.
[0034] In this embodiment, by calling the script corresponding to the semantic translation tool, the semantic translation tool performs computing processing on the source data inputted into the semantic translation tool according to a processing rule defined in the script, and then generates the translation data.
[0035] In this embodiment, the script may be defined as a computing formula, and the computing formula may be: d4=d1+10, d5=d2, and semantic translation can be performed on the source data with different types and contents by executing the script to obtain the target data.
[0036] In this embodiment, the prestored scheduling rule includes at least one of the following: starting the semantic translation tool for performing semantic translation of all source data in a case that any piece of the source data is updated; starting the semantic translation tool for performing semantic translation of all the source data in a case that all the source data is updated; and / or performing, by the semantic translation tool, semantic translation of all the source data in cycles. By defining scheduling rules for different semantic translation tools, control over starting data semantic translation may be implemented, and the different scheduling rules may be selected for source data and target data with different sensitivity requirements. Preferably, as for source data and target data with low sensitivity, it may be set as starting the semantic translation tool when all the source data is updated, so as to reduce a language transformation pressure.
[0037] Step S104: the translation data is outputted, including: transmitting the translation data to the target application.
[0038] In this embodiment, after the semantic translation tool generates the translation data, the translation data may be transmitted to the target application in a form of a certain interface and the like. The source data may be accepted, buffered and transferred in a united mode through a data transmission layer, and parallel processing of different multi-semantic translation threads is implemented.
[0039] FIG. 2 is a schematic structural diagram of a data semantic translation apparatus 200 in an embodiment of the present disclosure. As shown in FIG. 2, the apparatus 200 may include:
[0040] a data information acceptance module 201, configured to: obtain at least one piece of source data generated by at least one source application and a data type of the source data and obtain a data type of target data needed by a target application.
[0041] In this embodiment, the source data may come from a plurality of source applications, each source application may generate a plurality of pieces of source data, and all the source data may include various different data types, such as a type, a structure and a unit. The source data may be obtained by being connected to the source application in a form of a certain interface. The source data may be accepted, buffered and transferred in a united mode through a data acceptance layer, and parallel processing of different multi-semantic translation threads is implemented.
[0042] A data transformation tool calling module 202, configured to: call a semantic translation tool corresponding to the data type of the source data and the data type of the target data from a semantic translation tool library where the semantic translation tool and a scheduling rule are prestored.
[0043] In this embodiment, the apparatus further includes: a semantic translation tool library establishing module 205, configured to: define the semantic translation tool, the data type of the source data and the data type of the target data corresponding to the semantic translation tool, the semantic translation tool scheduling rule and a corresponding relationship between the semantic translation tool scheduling rule and the semantic translation tool, and store them in the semantic translation tool library; and define the script and a corresponding relationship between the script and the semantic translation tool, and store them in the semantic translation tool library, where the script includes a specific computing mode of transforming the source data to the translation data.
[0044] In this embodiment, the semantic translation tool may have an input data list and an output data list. The input data list represents a data type needed by the semantic translation tool, and the output data list represents a data type that the semantic translation tool may translate and output. When the data types of all the source data match the data type in the input data list of the semantic translation tool, and the data type of the target data matches the data type in the output data list of the semantic translation tool, it may be determined that the semantic translation tool may be called.
[0045] A semantic translation module 203, configured to: call, based on the source data and the prestored scheduling rule corresponding to the semantic translation tool, a prestored script corresponding to the semantic translation tool from the semantic translation tool library where the script is prestored, and generate translation data. A plurality of instantiated running scripts form a semantic translation pool.
[0046] In this embodiment, by calling the script corresponding to the semantic translation tool, the semantic translation tool performs computing processing on all the source data inputted into the semantic translation tool according to a processing rule defined in the script, and then generates the translation data.
[0047] In this embodiment, the prestored scheduling rule includes at least one of the following: starting the semantic translation tool for performing semantic translation of all source data in a case that any piece of the source data is updated; starting the semantic translation tool for performing semantic translation of all the source data in a case that all the source data is updated; and / or performing, by the semantic translation tool, semantic translation of all the source data in cycles. By defining scheduling rules for different semantic translation tools, control over starting data semantic translation may be implemented, and the different scheduling rules may be selected for source data and target data with different sensitivity requirements. Preferably, as for source data and target data with low sensitivity, it may be set as starting the semantic translation tool when all the source data is updated, so as to reduce a language transformation pressure.
[0048] A data output module 204, configured to: transmit the translation data to the target application.
[0049] In this embodiment, after the semantic translation tool generates the translation data, the translation data may be transmitted to the target application in a form of a certain interface and the like. The source data may be accepted, buffered and transferred in a united mode through a data transmission layer, and parallel processing of different multi-semantic translation threads is implemented.
[0050] The present disclosure further provides an electronic device 300. FIG. 3 is a schematic diagram of an electronic device 300 according to an embodiment of the present disclosure. As shown in FIG. 3, the electronic device 300 includes a processor 310 and a memory 320. The memory 320 stores an instruction, and the instruction, when executed by the processor 310, implements a scheduling method 100 for data semantic translation as described above.
[0051] The present disclosure also provides a computer-readable storage medium, storing a computer instruction, the computer instruction, when run, implementing the foregoing method.
[0052] The present disclosure further provides a computer program product, including a computer program, the computer program, when executed by a processor, implementing the foregoing method.
[0053] Some aspects of the method and apparatus of the present disclosure may be entirely executed by hardware, may be entirely executed by software (including firmware, resident software, microcode, and the like) , or may be executed by a combination of hardware and software. The foregoing hardware or software may be referred to as “data block” , “module” , “engine” , “unit” , “component” or “system” . The processor may be one or more application specific integrated circuits (ASICs) , digital signal processors (DSPs) , digital signal processing devices (DSPDs) , programmable logic devices (PLCs) , field programmable gate arrays (FPGAs) , processors, controllers, microcontrollers, microprocessors, or a combination thereof. In addition, various aspects of the present disclosure may be embodied as computer products located in one or more computer-readable media, and the product includes a computer-readable program code. For example, the computer-readable medium may include, but is not limited to, a magnetic storage device (for example, a hard disk, a floppy disk, a magnetic tape... ) , an optical disk (for example, a compact disk (CD) , a digital versatile disk (DVD) ... ) , a smart card, and a flash memory device (for example, a card, a stick, a key driver... ) .
[0054] The flowchart is used here for describing operations performed by the method according to this embodiment of this application. It is to be understood that the foregoing operations may not necessarily be performed accurately according to an order. On the contrary, the various steps may be processed in a reverse order or simultaneously. At the same time, or other operations are added into these processes, or one step or more steps of operations are removed from these processes.
[0055] It is to be understood that, although this specification is described according to each embodiment, each embodiment may not include only one independent technical solution. The description manner of this specification is merely for clarity. This specification should be considered as a whole by a person skilled in the art, and the technical solution in each embodiment may also be properly combined, to form other implementations that can be understood by the person skilled in the art.
[0056] The foregoing descriptions are merely specific schematic implementations of the present disclosure, and are not intended to limit the scope of the present disclosure. Any equivalent change, modification, and combination made by the person skilled in the art without departing from the conception and principles of the present disclosure should all fall within the protection scope of the present disclosure.
Claims
1.A data semantic translation method (S100) , comprising:obtaining data information (S101) , comprising: obtaining at least one piece of source data generated by at least one source application and a data type of the source data and obtaining a data type of target data needed by a target application;calling a semantic translation tool (S102) , comprising: calling a semantic translation tool corresponding to the data type of the source data and the data type of the target data from a semantic translation tool library where the semantic translation tool and a scheduling rule are prestored;performing semantic translation (S103) , comprising: calling, based on the source data and the prestored scheduling rule corresponding to the semantic translation tool, a prestored script corresponding to the semantic translation tool from the semantic translation tool library where the script is prestored, and generating translation data; andoutputting the translation data (S104) , comprising: transmitting the translation data to the target application.2.The method according to claim 1, wherein the prestored scheduling rule comprises at least one of the following:starting the semantic translation tool for performing semantic translation of all source data in a case that any piece of the source data is updated;starting the semantic translation tool for performing semantic translation of all the source data in a case that all the source data is updated; and / orperforming, by the semantic translation tool, semantic translation of all the source data in cycles.3.The method according to claim 1, wherein before obtaining the data information, the method further comprises:establishing the semantic translation tool library (S105) , comprising: defining the semantic translation tool, the data type of the source data and the data type of the target data corresponding to the semantic translation tool, the semantic translation tool scheduling rule and a corresponding relationship between the semantic translation tool scheduling rule and the semantic translation tool, and storing them in the semantic translation tool library; and defining the script and a corresponding relationship between the script and the semantic translation tool, and storing them in the semantic translation tool library, wherein the script comprises a specific computing mode of transforming the source data to the translation data.4.A data semantic translation apparatus (200) , comprising:a data information acceptance module (201) , configured to: obtain at least one piece of source data generated by at least one source application and a data type of the source data and obtain a data type of target data needed by a target application;a data transformation tool calling module (202) , configured to: call a semantic translation tool corresponding to the data type of the source data and the data type of the target data from a semantic translation tool library where the semantic translation tool and a scheduling rule are prestored;a semantic translation module (203) , configured to: call, based on the source data and the prestored scheduling rule corresponding to the semantic translation tool, a prestored script corresponding to the semantic translation tool from the semantic translation tool library where the script is prestored, and generate translation data; anda data output module (204) , configured to: transmit the translation data to the target application.5.The apparatus according to claim 4, wherein the prestored scheduling rule comprises:starting the semantic translation tool for performing semantic translation of all source data in a case that any piece of the source data is updated;starting the semantic translation tool for performing semantic translation of all the source data in a case that all the source data is updated; and / orperforming, by the semantic translation tool, semantic translation of all the source data in cycles.6.The apparatus according to claim 4, further comprising:a semantic translation tool library establishing module (205) , configured to: define the semantic translation tool, the data type of the source data and the data type of the target data corresponding to the semantic translation tool, the semantic translation tool scheduling rule and a corresponding relationship between the semantic translation tool scheduling rule and the semantic translation tool, and store them in the semantic translation tool library; and define the script and a corresponding relationship between the script and the semantic translation tool, and store them in the semantic translation tool library, wherein the script comprises a specific computing mode of transforming the source data to the translation data.7.An electronic device (300) , comprising:at least one processor (310) ; anda memory (320) coupled to the at least one processor (310) , the memory (320) being configured to store an instruction, and the instruction, when executed by the at least one processor (310) , causing the processor (310) to perform the method according to any one of claims 1 to 3.8.A computer-readable storage medium, storing a computer instruction, the computer instruction, when run, performing the method according to any one of claims 1 to 3.9.A computer program product, comprising a computer program, the computer program, when executed by a processor, implementing the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Cross-language programming method and device, electronic equipment and storage medium
CN108920133A
Intelligent programming language adaptation method and device, electronic equipment and medium
CN112988163A
Code translation method, device and equipment
CN114327492A
Data conversion method and device
CN114791810A
Data forwarding method and device, computer equipment and storage medium
CN116132385A
