CN115640012A - Data transcoding method, device, equipment and storage medium - Google Patents

Data transcoding method, device, equipment and storage medium Download PDF

Info

Publication number
CN115640012A
CN115640012A CN202211215516.9A CN202211215516A CN115640012A CN 115640012 A CN115640012 A CN 115640012A CN 202211215516 A CN202211215516 A CN 202211215516A CN 115640012 A CN115640012 A CN 115640012A
Authority
CN
China
Prior art keywords
transcoding
service data
data table
data
message queue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211215516.9A
Other languages
Chinese (zh)
Inventor
王暾
马骏
张开元
贾子豪
高帮鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Haier Smart Home Co Ltd
Qingdao Economic and Technological Development Zone Haier Water Heater Co Ltd
Original Assignee
Haier Smart Home Co Ltd
Qingdao Economic and Technological Development Zone Haier Water Heater Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Haier Smart Home Co Ltd, Qingdao Economic and Technological Development Zone Haier Water Heater Co Ltd filed Critical Haier Smart Home Co Ltd
Priority to CN202211215516.9A priority Critical patent/CN115640012A/en
Publication of CN115640012A publication Critical patent/CN115640012A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a data transcoding method, a data transcoding device, data transcoding equipment and a data transcoding storage medium, which relate to the technical field of computers, can avoid the overstaffed of service codes, and improve the expandability and readability of the service codes. The method comprises the following steps: when determining that a target service data table in a service system has service data change, acquiring a changed data sequence; sending a first message queue to a transcoding server, wherein the first message queue is used for indicating the transcoding server to transcode each task message in the first message queue based on a preset transcoding rule table to obtain a transcoding result corresponding to each task message; one task message comprises one piece of changed data in the changed data sequence and the identification of the target service data table; one transcoding result comprises the identifier of the transcoding content and the target service data table; and receiving a second message queue returned by the transcoding server, and updating each transcoding result in the second message queue to the target service data table.

Description

Data transcoding method, device, equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data transcoding method, apparatus, device, and storage medium.
Background
At present, when transcoding is needed to be performed on service data in a service system, hard codes are often needed to be added into codes for specifying the service data needing transcoding, transcoding logic is visible, so that service codes are bloated, and expandability and readability are extremely low.
Disclosure of Invention
The application provides a data transcoding method, a data transcoding device, equipment and a storage medium, business data needing transcoding, transcoding rules and the like do not need to be specified in a code in a hard coding mode, the business code is prevented from being bloated, and the expandability and readability of the business code are improved.
In order to achieve the purpose, the technical scheme is as follows:
in a first aspect, the present application provides a data transcoding method, which may be applied to a service server, and includes: under the condition that a target service data table in a service system is determined to have service data change, a changed data sequence is obtained; sending a first message queue to a transcoding server, wherein the first message queue is used for indicating the transcoding server to transcode each task message in the first message queue based on a preset transcoding rule table to obtain a transcoding result corresponding to each task message; one task message comprises one piece of changed data in the changed data sequence and the identification of the target service data table; one transcoding result comprises the identification of the transcoding content and the target service data table; the preset transcoding rule table comprises a corresponding relation between the identification of the candidate service data table and the transcoding rule of the candidate service data table; the candidate service data table comprises a target service data table; and receiving a second message queue returned by the transcoding server, and updating each transcoding result in the second message queue to a target service data table.
According to the technical scheme, when the target business data table in the business system is changed, all the changed data in the changed data sequence and the identification of the target business data table can be sent to the transcoding server in a first message queue mode, and the transcoding server carries out transcoding on task information which contains the changed data and the identification of the target business data table in the first message queue in sequence according to a predetermined transcoding rule table. The transcoding result sent by the transcoding server in the form of a second message queue may then be received. It can be seen that in the technical scheme provided by the application, when transcoding is performed on the service data, the service data to be transcoded, transcoding rules and the like do not need to be specified in the code in a hard coding mode, so that the service code is prevented from being bloated, and the expandability and readability of the service code are improved.
Optionally, in a possible design, before the "obtaining the changed data sequence", the data transcoding method provided by the present application may further include:
monitoring the data change type of a binlog of the candidate service data table; the data change type at least comprises newly added data, deleted data and modified data;
and under the condition that the data change type of the target service data table in the candidate service data tables is determined to be newly added data or modified data, determining that the service data change occurs in the target service data table.
Optionally, in another possible design, the receiving a second message queue returned by the transcoding server, and updating each transcoding result in the second message queue to the target service data table "may include:
and calling the integrated JavaSdk execution file, receiving a second message queue returned by the transcoding server, and updating each transcoding result in the second message queue to a target service data table.
In a second aspect, the present application provides a data transcoding method, which may be applied to a transcoding server, including: receiving a first message queue sent by a service server; transcoding each task message in the first message queue based on a preset transcoding rule table to obtain a transcoding result corresponding to each task message; one task message comprises one piece of change data in the change data sequence of the target service data table and the identification of the target service data table; one transcoding result comprises the identifier of the transcoding content and the target service data table; the preset transcoding rule table comprises a corresponding relation between the identification of the candidate service data table and the transcoding rule of the candidate service data table; the candidate service data table comprises a target service data table; and transmitting a second message queue back to the service server, wherein the second message queue is used for indicating the service server to update each transcoding result in the second message queue to the target service data table.
Optionally, in a possible design, the transcoding rule of the candidate service data table includes a transcoded field name and a write-back field name.
Optionally, in another possible design, the data transcoding method provided by the present application may further include:
updating the preset transcoding rule table in response to the configuration operation of a user on the preset transcoding rule table; the configuring operation includes at least: adding operation, deleting operation and modifying operation.
In a third aspect, the present application provides a data transcoding apparatus, which may be applied to a service server, including: the device comprises an acquisition module, a sending module and an updating module;
the acquisition module is used for acquiring a changed data sequence under the condition that the target service data table in the service system is determined to have service data change;
the sending module is used for sending a first message queue to the transcoding server and indicating the transcoding server to transcode each task message in the first message queue based on a preset transcoding rule table to obtain a transcoding result corresponding to each task message; one task message comprises one piece of changed data in the changed data sequence and the identification of the target service data table; one transcoding result comprises the identifier of the transcoding content and the target service data table; the preset transcoding rule table comprises a corresponding relation between the identification of the candidate service data table and the transcoding rule of the candidate service data table; the candidate service data table comprises a target service data table;
and the updating module is used for receiving the second message queue returned by the transcoding server and updating each transcoding result in the second message queue to the target service data table.
Optionally, in a possible design, the data transcoding apparatus provided in the present application may further include: the monitoring module and the determining module;
the monitoring module is used for monitoring the data change type of the binlog of the candidate service data table; the data change type at least comprises newly added data, deleted data and modified data;
and the determining module is used for determining that the target service data table has service data change under the condition of determining that the data change type of the target service data table in the candidate service data tables is new data or modified data.
Optionally, in another possible design manner, the update module is specifically configured to:
and calling the integrated JavaSdk execution file, receiving a second message queue returned by the transcoding server, and updating each transcoding result in the second message queue to a target service data table.
In a fourth aspect, the present application provides a data transcoding apparatus, which may be applied to a transcoding server, including: the system comprises a receiving module, a transcoding module and a returning module;
the receiving module is used for receiving a first message queue sent by the service server;
the transcoding module is used for transcoding each task message in the first message queue based on a preset transcoding rule table to obtain a transcoding result corresponding to each task message; one task message comprises one piece of change data in the change data sequence of the target service data table and the identification of the target service data table; one transcoding result comprises the identifier of the transcoding content and the target service data table; the preset transcoding rule table comprises a corresponding relation between the identification of the candidate service data table and the transcoding rule of the candidate service data table; the candidate service data table comprises a target service data table;
and the return module is used for returning the second message queue to the service server and indicating the service server to update each transcoding result in the second message queue to the target service data table.
Optionally, in a possible design, the transcoding rule of the candidate service data table includes a transcoded field name and a write-back field name.
Optionally, in another possible design, the data transcoding apparatus provided in the present application may further include: an update module;
the updating module is used for responding to the configuration operation of a user on the preset transcoding rule table and updating the preset transcoding rule table; the configuring operation includes at least: adding operation, deleting operation and modifying operation.
In a fifth aspect, the present application provides a data transcoding device, comprising a memory, a processor, a bus, and a communication interface; the memory is used for storing computer execution instructions, and the processor is connected with the memory through a bus; the processor executes the computer-executable instructions stored by the memory when the data transcoding device is operating to cause the data transcoding device to perform the data transcoding method as provided in the first or second aspect above.
In a sixth aspect, the present application provides a computer-readable storage medium having instructions stored therein, which when executed by a computer, cause the computer to perform the data transcoding method as provided in the first or second aspect.
In a seventh aspect, the present application provides a computer program product comprising computer instructions which, when run on a computer, cause the computer to perform the method of transcoding data as provided in the first or second aspect.
In an eighth aspect, the present application provides a data transcoding system, including a service server and a transcoding server, where the service server is configured to implement the data transcoding method provided in the first aspect, and the transcoding server is configured to implement the data transcoding method provided in the second aspect.
It should be noted that the computer instructions may be stored in whole or in part on a computer-readable storage medium. The computer-readable storage medium may be packaged with a processor of the data transcoding device, or may be packaged separately from the processor of the data transcoding device, which is not limited in this application.
For the descriptions of the second aspect to the eighth aspect in the present application, reference may be made to the detailed description of the first aspect; in addition, for the beneficial effects described in the second aspect to the eighth aspect, reference may be made to the beneficial effect analysis of the first aspect, and details are not described here.
In the present application, the names of the above-mentioned devices or functional modules are not limited, and in actual implementation, the devices or functional modules may be represented by other names. Insofar as the functions of the respective devices or functional modules are similar to those of the present application, they are within the scope of the claims of the present application and their equivalents.
These and other aspects of the present application will be more readily apparent from the following description.
Drawings
Fig. 1 is a schematic flowchart of a data transcoding system according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a data transcoding method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another data transcoding method according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another data transcoding method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a data transcoding device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of another data transcoding device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a data transcoding device according to an embodiment of the present application.
Detailed Description
The following describes in detail a data transcoding method, an apparatus, a device, and a storage medium provided in an embodiment of the present application with reference to the drawings.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone.
The terms "first" and "second" and the like in the description and drawings of the present application are used for distinguishing different objects or for distinguishing different processes for the same object, and are not used for describing a specific order of the objects.
Furthermore, the terms "including" and "having," and any variations thereof, as referred to in the description of the present application, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
In the description of the present application, the meaning of "a plurality" means two or more unless otherwise specified.
In addition, the data acquisition, storage, use, processing and the like in the technical scheme of the application all conform to relevant regulations of national laws and regulations.
Currently, when service data in a service system needs to be transcoded, hard codes are often needed to be added into codes for specifying the service data needing to be transcoded, transcoding logic is visible, so that service codes are bloated, and expandability and readability are extremely low.
In view of the problems in the prior art, embodiments of the present application provide a data transcoding method, which does not need to specify service data to be transcoded, transcoding rules and the like in a form of hard coding in a code when transcoding service data, so that a service code is prevented from being bloated, and extensibility and readability of the service code are improved.
The data transcoding method provided by the embodiment of the application can be applied to the data transcoding system shown in fig. 1. Referring to fig. 1, the data transcoding system may include a traffic server 01 and a transcoding server 02.
The service server 01, which is a background server of the service system, may be one server or a server cluster composed of multiple servers, which is not limited in this application.
The business server 01 is integrated with a data transcoding device, and is used for acquiring a changed data sequence under the condition that a target business data table in a business system is determined to have business data change; moreover, a first message queue may be sent to the transcoding server 02, and is used to instruct the transcoding server 02 to transcode each task message in the first message queue based on a preset transcoding rule table, so as to obtain a transcoding result corresponding to each task message; then, a second message queue returned by transcoding server 02 may be received, and each transcoding result in the second message queue may be updated to the target service data table.
Another data transcoding device is integrated in the transcoding server 02 and is used for receiving a first message queue sent by the service server 01; transcoding each task message in the first message queue based on a preset transcoding rule table to obtain a transcoding result corresponding to each task message; then, a second message queue may be transmitted back to the service server 01, so as to instruct the service server 01 to update each transcoding result in the second message queue to the target service data table. Similarly, the transcoding server 02 may be one server or a server cluster composed of a plurality of servers, which is not limited in this application.
It is understood that, in practical applications, other hardware or software devices are also included in the data transcoding system, and only components that may be used in the embodiments of the present application are described herein, and do not form a specific limitation on the data transcoding system. For example, the data transcoding system may further include a communication device for implementing the service server 01 and the transcoding server 02.
The following describes a data transcoding method provided in an embodiment of the present application with reference to the data transcoding system shown in fig. 1.
Referring to fig. 2, an embodiment of the present application provides a data transcoding method, which may be applied to a service server shown in fig. 1, and the method may be performed by a data transcoding apparatus provided in an embodiment of the present application (such as the data transcoding apparatus shown in fig. 5), which may be implemented by software and/or hardware and integrated in a service server executing the method. As shown in fig. 2, the method may include S201-S203:
s201, acquiring a changed data sequence under the condition that the target service data table in the service system is determined to have changed service data.
Generally, a service system applied to multiple scenarios or multiple service types includes multiple service data tables (i.e., candidate service data tables in the embodiment of the present application), and when a service data change occurs in a certain target service data table, the corresponding changed data needs to be decoded.
Optionally, before obtaining the changed data sequence, the embodiment of the present application may determine whether the service data table is changed by the following method: monitoring a data change type of a binary log (binlog) of a candidate business data table; and under the condition that the data change type of the target service data table in the candidate service data tables is determined to be newly added data or modified data, determining that the service data change occurs in the target service data table.
The data change type at least comprises newly added data, deleted data and modified data.
For example, the embodiment of the present application may implement snooping on the data change type of the binlog of the candidate business data table by using canal (a big data development platform).
Currently, whether the service data change occurs in each service data table can be determined in a mode of periodically and circularly scanning the table, and specifically, whether the service data change occurs in each service data table can be determined once at intervals. However, this periodic and cyclic table scanning method wastes resources of the service system greatly. Therefore, the embodiment of the application monitors the data change type of the binlog of the candidate service data table to determine whether the service data change occurs in each candidate service data table, so that the resources of a service system can be saved.
In addition, when the target business data table is determined to have business data change, the data needing to be newly added or the data needing to be modified can be screened out, and a piece of changed data and the identification of the target business data table are used as a task message and are sent to the transcoding server in the form of a first message queue according to the change sequence.
S202, sending a first message queue to the transcoding server, wherein the first message queue is used for indicating the transcoding server to transcode each task message in the first message queue based on a preset transcoding rule table to obtain a transcoding result corresponding to each task message.
Wherein, a task message comprises a piece of change data in the change data sequence and the mark of the target service data table; one transcoding result comprises the identifier of the transcoding content and the target service data table; the identifier of the target service data table may be an identifier for uniquely representing one service data table, such as a table name or a number determined in advance by an operator, and the candidate service data table includes the target service data table.
The preset transcoding rule table may be a rule table determined manually according to requirements, and the preset transcoding rule table includes a correspondence between an identifier of the candidate service data table and a transcoding rule of the candidate service data table.
When receiving the first message queue, the transcoding server may search a transcoding rule corresponding to an identifier of a target service data table in the task message in a preset transcoding rule table according to a queue order of the task message in the first message queue, and then perform real-time transcoding based on the searched transcoding rule. After transcoding is completed, the transcoding server can send a transcoding content and an identifier of the target service data table as a transcoding result to the service server in a form of a second message queue according to the transcoding sequence, so that the service server can update the transcoding result.
In addition, the transcoding server carries out transcoding according to the queue sequence of the task messages in the first message queue and sends the second message queue to the service server according to the transcoding sequence, so that errors in the transcoding process can be avoided.
S203, receiving a second message queue returned by the transcoding server, and updating each transcoding result in the second message queue to a target service data table.
Each transcoding result in the second message queue comprises the transcoded content and the identifier of the target service data table.
Optionally, the embodiment of the application may call an integrated java sdk execution file, receive a second message queue returned by the transcoding server, and update each transcoding result in the second message queue to the target service data table.
Specifically, the function of the execution file of the JavaSdk may be configured in advance, so that the execution file of the JavaSdk may receive the second message queue returned by the transcoding server, update each transcoding result in the second message queue to the target service data table, and then integrate the configured execution file of the JavaSdk into the service server.
In the embodiment of the application, the functions of the service server only need to be simply configured, so that the service server has the functions of sending and receiving message queues and updating the transcoding result, and the data transcoding which is not perceived by a user, not coded by a developer and not intrusive to a service system can be realized.
In summary, in the data transcoding method provided in this embodiment of the present application, when a target service data table in a service system is changed, each piece of changed data in a changed data sequence and an identifier of the target service data table may be sent to a transcoding server in the form of a first message queue, and the transcoding server transcodes task information in the first message queue, which includes the changed data and the identifier of the target service data table, in sequence according to a predetermined transcoding rule table. The transcoding result sent by the transcoding server in the form of a second message queue may then be received. It can be seen that in the technical scheme provided by the application, when transcoding is performed on the service data, the service data to be transcoded, transcoding rules and the like do not need to be specified in the code in a hard coding mode, so that the service code is prevented from being bloated, and the expandability and readability of the service code are improved.
Optionally, as shown in fig. 3, an embodiment of the present application further provides a data transcoding method, which may be applied to the service server shown in fig. 1, where the method includes S301 to S305:
s301, monitoring the data change type of the binlog of the candidate service data table.
S302, determining whether the target business data table is changed according to the data change type of the binlog.
S303, under the condition that the target service data table in the service system is determined to have service data change, a changed data sequence is obtained.
S304, sending the first message queue to the transcoding server, wherein the first message queue is used for indicating the transcoding server to transcode each task message in the first message queue based on a preset transcoding rule table to obtain a transcoding result corresponding to each task message.
S305, calling the integrated JavaSdk execution file, receiving a second message queue returned by the transcoding server, and updating each transcoding result in the second message queue to a target service data table.
Referring to fig. 4, an embodiment of the present application further provides a data transcoding method, which may be applied to the transcoding server shown in fig. 1, and the method may be performed by a data transcoding device provided in an embodiment of the present application (such as the data transcoding device shown in fig. 6), which may be implemented by software and/or hardware, and is integrated in the transcoding server executing the method. As shown in fig. 2, the method may include S401-S403:
s401, receiving a first message queue sent by a service server.
S402, transcoding each task message in the first message queue based on a preset transcoding rule table to obtain a transcoding result corresponding to each task message.
Wherein, a task message comprises a piece of change data in the change data sequence of the target service data table and the mark of the target service data table; one transcoding result comprises the identifier of the transcoding content and the target service data table; the preset transcoding rule table comprises a corresponding relation between the identification of the candidate service data table and the transcoding rule of the candidate service data table; the candidate service data table comprises a target service data table.
Optionally, the transcoding rule of the candidate service data table includes a transcoded field name and a write-back field name.
In the embodiment of the present application, each piece of change data may be composed of a plurality of fields, but in practical application, only a part of the fields need to be transcoded, so that an identifier of a field that needs to be transcoded may be marked in a transcoding rule, that is, a name of a transcoded field is marked in the transcoding rule. In addition, after transcoding is completed, a transcoding result needs to be stored, so in the embodiment of the present application, a field for storing the transcoding result needs to be marked in the transcoding rule, that is, a name of a write-back field is marked in the transcoding rule.
And S403, transmitting a second message queue back to the service server, and instructing the service server to update each transcoding result in the second message queue to the target service data table.
Optionally, the data transcoding method provided in the embodiment of the present application may further include: updating the preset transcoding rule table in response to the configuration operation of a user on the preset transcoding rule table; the configuration operations include at least: adding operation, deleting operation and modifying operation.
Illustratively, when a user has a need to adjust the preset transcoding rule table, an addition operation, a deletion operation, and a modification operation may be performed in the user terminal to adjust the preset transcoding rule table.
The user terminal may be a different type of terminal, such as a mobile phone, a tablet computer, a desktop computer, a laptop computer, a notebook computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a Personal Digital Assistant (PDA), a wearable electronic device, a virtual reality device, and the like, which are connected to the transcoding server.
In the existing data transcoding mode, when transcoding logic changes or transcoding logic needs to be newly added, transcoding logic needs to be hard coded in codes again, coding efficiency is extremely low, and development cost of system developers is greatly wasted. In the embodiment of the application, the user can be supported to adjust the preset transcoding rule table according to the requirement, the hard coding transcoding logic in the code does not need to be repeated, the coding efficiency can be improved, and the development cost of system developers is saved.
For the explanation of the related contents in the embodiments of the present application, reference may be made to the foregoing embodiments, which are not repeated herein.
As shown in fig. 5, an embodiment of the present application further provides a data transcoding apparatus, where the apparatus may be applied to a service server, and the apparatus includes: an acquisition module 11, a sending module 12 and an updating module 13.
The obtaining module 11 executes S201 in the above method embodiment, the sending module 12 executes S202 in the above method embodiment, and the updating module 13 executes S203 in the above method embodiment.
Specifically, the obtaining module 11 is configured to obtain a changed data sequence when it is determined that a target service data table in the service system has a service data change;
the sending module 12 is configured to send a first message queue to the transcoding server, and is configured to instruct the transcoding server to transcode each task message in the first message queue based on a preset transcoding rule table, so as to obtain a transcoding result corresponding to each task message; one task message comprises one piece of changed data in the changed data sequence and the identification of the target service data table; one transcoding result comprises the identifier of the transcoding content and the target service data table; the preset transcoding rule table comprises a corresponding relation between the identification of the candidate service data table and the transcoding rule of the candidate service data table; the candidate service data table comprises a target service data table;
and the updating module 13 is configured to receive the second message queue returned by the transcoding server, and update each transcoding result in the second message queue to the target service data table.
Optionally, in a possible design, the data transcoding apparatus provided in the present application may further include: the monitoring module and the determining module;
the monitoring module is used for monitoring the data change type of the binlog of the candidate service data table; the data change type at least comprises newly added data, deleted data and modified data;
and the determining module is used for determining that the target service data table has service data change under the condition of determining that the data change type of the target service data table in the candidate service data tables is new data or modified data.
Optionally, in another possible design manner, the update module 13 is specifically configured to:
and calling the integrated JavaSdk execution file, receiving a second message queue returned by the transcoding server, and updating each transcoding result in the second message queue to a target service data table.
Optionally, the data transcoding device may further include a storage module, where the storage module is configured to store the program code of the data transcoding device, and the like.
As shown in fig. 6, an embodiment of the present application further provides a data transcoding apparatus, which may be applied to a transcoding server, and includes: a receiving module 21, a transcoding module 22 and a backhaul module 23.
The receiving module 21 executes S401 in the above method embodiment, the transcoding module 22 executes S402 in the above method embodiment, and the backhaul module 23 executes S403 in the above method embodiment.
Specifically, the receiving module 21 is configured to receive a first message queue sent by a service server;
the transcoding module 22 is configured to transcode each task message in the first message queue based on a preset transcoding rule table to obtain a transcoding result corresponding to each task message; one task message comprises one piece of change data in the change data sequence of the target service data table and the identification of the target service data table; one transcoding result comprises the identifier of the transcoding content and the target service data table; the preset transcoding rule table comprises a corresponding relation between the identification of the candidate service data table and the transcoding rule of the candidate service data table; the candidate service data table comprises a target service data table;
and a returning module 23, configured to return the second message queue to the service server, and instruct the service server to update each transcoding result in the second message queue to the target service data table.
Optionally, in a possible design, the transcoding rule of the candidate service data table includes a transcoded field name and a write-back field name.
Optionally, in another possible design, the data transcoding apparatus provided in the present application may further include: updating the module;
the updating module is used for responding to the configuration operation of a user on the preset transcoding rule table and updating the preset transcoding rule table; the configuring operation includes at least: adding operation, deleting operation and modifying operation.
Optionally, the data transcoding device may further include a storage module, where the storage module is configured to store the program code of the data transcoding device, and the like.
As shown in fig. 7, an embodiment of the present application further provides a data transcoding device, which includes a memory 41, a processor (such as 42-1 and 42-2 in fig. 7), a bus 43, and a communication interface 44; the memory 41 is used for storing computer execution instructions, and the processor is connected with the memory 41 through a bus 43; when the data transcoding device is running, the processor executes the computer-executable instructions stored by the memory 41 to cause the data transcoding device to perform the data transcoding method applied to the service server or applied to the transcoding server as provided in the above embodiments.
In a particular implementation, as one embodiment, the processor may include one or more Central Processing Units (CPUs), such as CPU0 and CPU1 shown in FIG. 7. And as an example, the data transcoding device may include multiple processors, such as processor 42-1 and processor 42-2 shown in fig. 7. Each of these processors may be a single-Core Processor (CPU) or a multi-Core Processor (CPU). A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
The memory 41 may be, but is not limited to, a read-only memory 41 (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory 41 may be self-contained and coupled to the processor via a bus 43. The memory 41 may also be integrated with the processor.
In a specific implementation, the memory 41 is used for storing data in the present application and computer-executable instructions corresponding to software programs for executing the present application. The processor may operate or execute software programs stored in memory 41 and invoke various functions of the data transcoding device stored in memory 41.
The communication interface 44 may be any device, such as a transceiver, for communicating with other devices or communication networks, such as a control system, a Radio Access Network (RAN), a Wireless Local Area Network (WLAN), etc. The communication interface 44 may include a receiving unit implementing a receiving function and a transmitting unit implementing a transmitting function.
The bus 43 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus 43 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 7, but this is not intended to represent only one bus or type of bus.
As an example, in conjunction with fig. 5, the function implemented by the obtaining module in the data transcoding device is the same as the function implemented by the receiving unit in fig. 7, the function implemented by the sending module in the data transcoding device is the same as the function implemented by the sending unit in fig. 7, and the function implemented by the updating module in the data transcoding device is the same as the function implemented by the processor in fig. 7. When the data transcoding device comprises the storage module, the functions implemented by the storage module are the same as those implemented by the storage in fig. 7.
For the explanation of the related contents in this embodiment, reference may be made to the above method embodiments, which are not described herein again.
Through the description of the above embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above functions may be distributed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions. For the specific working processes of the above-described system, device and unit, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
The embodiment of the present application further provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed by a computer, the computer is enabled to execute the data transcoding method applied to the service server or the transcoding server provided in the foregoing embodiment.
The computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a RAM, a ROM, an erasable programmable read-only memory (EPROM), a register, a hard disk, an optical fiber, a CD-ROM, an optical storage device, a magnetic storage device, any suitable combination of the foregoing, or any other form of computer readable storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be integral to the processor. The processor and the storage medium may reside in an Application Specific Integrated Circuit (ASIC). In embodiments of the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A data transcoding method is applied to a service server and comprises the following steps:
under the condition that a target service data table in a service system is determined to have service data change, a changed data sequence is obtained;
sending a first message queue to a transcoding server, wherein the first message queue is used for indicating the transcoding server to transcode each task message in the first message queue based on a preset transcoding rule table to obtain a transcoding result corresponding to each task message; a task message comprises a piece of changed data in the changed data sequence and the identifier of the target service data table; one transcoding result comprises the transcoded content and the identifier of the target service data table; the preset transcoding rule table comprises a corresponding relation between the identification of the candidate service data table and the transcoding rule of the candidate service data table; the candidate service data table comprises the target service data table;
and receiving a second message queue returned by the transcoding server, and updating each transcoding result in the second message queue to the target service data table.
2. The method of data transcoding of claim 1, wherein prior to obtaining the sequence of altered data, the method further comprises:
monitoring the data change type of a binary log binlog of the candidate service data table; the data change type at least comprises newly added data, deleted data and modified data;
and under the condition that the data change type of the target service data table in the candidate service data tables is determined to be the newly added data or the modified data, determining that the service data change occurs in the target service data table.
3. The method of claim 1, wherein the receiving a second message queue returned by the transcoding server and updating each transcoding result in the second message queue into the target service data table comprises:
and calling an integrated JavaSdk execution file, receiving the second message queue returned by the transcoding server, and updating each transcoding result in the second message queue to the target service data table.
4. A data transcoding method is applied to a transcoding server and comprises the following steps:
receiving a first message queue sent by a service server;
transcoding each task message in the first message queue based on a preset transcoding rule table to obtain a transcoding result corresponding to each task message; a task message comprises a piece of change data in a change data sequence of a target service data table and an identifier of the target service data table; one transcoding result comprises the transcoding content and the identification of the target service data table; the preset transcoding rule table comprises a corresponding relation between the identification of the candidate service data table and the transcoding rule of the candidate service data table; the candidate service data table comprises the target service data table;
and transmitting a second message queue back to the service server, wherein the second message queue is used for indicating the service server to update each transcoding result in the second message queue to the target service data table.
5. The data transcoding method of claim 4, wherein the transcoding rules of the candidate service data table comprise a transcoded field name and a write-back field name.
6. The method of data transcoding of claim 4, wherein the method further comprises:
responding to the configuration operation of a user on the preset transcoding rule table, and updating the preset transcoding rule table; the configuration operation includes at least: adding operation, deleting operation and modifying operation.
7. A data transcoding device, applied to a service server, includes:
the acquisition module is used for acquiring a changed data sequence under the condition that the target service data table in the service system is determined to have service data change;
the sending module is used for sending a first message queue to the transcoding server and indicating the transcoding server to transcode each task message in the first message queue based on a preset transcoding rule table to obtain a transcoding result corresponding to each task message; a task message comprises a piece of changed data in the changed data sequence and the identifier of the target service data table; one transcoding result comprises the transcoded content and the identifier of the target service data table; the preset transcoding rule table comprises a corresponding relation between the identification of the candidate service data table and the transcoding rule of the candidate service data table; the candidate service data table comprises the target service data table;
and the updating module is used for receiving the second message queue returned by the transcoding server and updating each transcoding result in the second message queue to the target service data table.
8. A data transcoding device is applied to a transcoding server and comprises the following components:
the receiving module is used for receiving a first message queue sent by the service server;
the transcoding module is used for transcoding each task message in the first message queue based on a preset transcoding rule table to obtain a transcoding result corresponding to each task message; a task message comprises a piece of change data in a change data sequence of a target service data table and an identifier of the target service data table; one transcoding result comprises the transcoded content and the identifier of the target service data table; the preset transcoding rule table comprises a corresponding relation between the identification of the candidate service data table and the transcoding rule of the candidate service data table; the candidate service data table comprises the target service data table;
and the return module is used for returning a second message queue to the service server and indicating the service server to update each transcoding result in the second message queue to the target service data table.
9. A data transcoding device, comprising a memory, a processor, a bus, and a communication interface; the memory is used for storing computer execution instructions, and the processor is connected with the memory through the bus;
when the data transcoding device is running, a processor executes the computer-executable instructions stored by the memory to cause the data transcoding device to perform the data transcoding method of any of claims 1-3, or to perform the data transcoding method of any of claims 4-6.
10. A computer-readable storage medium having stored therein instructions that, when executed by a computer, cause the computer to perform a method of transcoding data as claimed in any one of claims 1 to 3, or a method of transcoding data as claimed in any one of claims 4 to 6.
CN202211215516.9A 2022-09-30 2022-09-30 Data transcoding method, device, equipment and storage medium Pending CN115640012A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211215516.9A CN115640012A (en) 2022-09-30 2022-09-30 Data transcoding method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211215516.9A CN115640012A (en) 2022-09-30 2022-09-30 Data transcoding method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115640012A true CN115640012A (en) 2023-01-24

Family

ID=84942002

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211215516.9A Pending CN115640012A (en) 2022-09-30 2022-09-30 Data transcoding method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115640012A (en)

Similar Documents

Publication Publication Date Title
CN107798108B (en) Asynchronous task query method and device
KR101577920B1 (en) Location-based group generation method, apparatus and system
CN111177112A (en) Database blocking method and device based on operation and maintenance management system and electronic equipment
CN110688096B (en) Method and device for constructing application program containing plug-in, medium and electronic equipment
CN112835632B (en) Method and equipment for calling end capability and computer storage medium
CN110019444B (en) Operation request processing method, device, equipment and system
CN110598093B (en) Business rule management method and device
CN115145806A (en) Data acquisition method and device and computer readable storage medium
JP2005228183A (en) Program execution method and computer system for executing the program
CN110287049B (en) Data processing method, device and storage medium
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN115640012A (en) Data transcoding method, device, equipment and storage medium
CN113259437B (en) Method and device for determining vehicle network protocol and storage medium
CN111953718A (en) Page debugging method and device
CN113157375A (en) Content display method, device, equipment, system and storage medium
CN112651212A (en) Method and terminal for remotely acquiring word stock
CN112215667A (en) User behavior prediction method and device
CN111277435A (en) Method and device for upgrading network equipment, storage medium and electronic equipment
CN114270309A (en) Resource acquisition method and device and electronic equipment
CN114443125A (en) Stream switching method and device based on gray scale release and storage medium
CN110489469B (en) Data transmission method, device, computer equipment and storage medium
CN113282391B (en) Cluster switching method, cluster switching device, electronic equipment and readable storage medium
CN113225399B (en) Data communication method and device and electronic equipment
CN110427600B (en) Batch text management method and device
CN111490885B (en) Method for processing equipment error information, electronic equipment and storage medium

Legal Events

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