Data processing method and device, equipment, storage medium and program product

By detecting changes in the data structure of parameter classes and adjusting the attribute parsing template in a microservice architecture, the problems of high operation and maintenance costs and low processing efficiency caused by the continuous growth of parameter classes are solved, thereby improving the fault tolerance and processing efficiency of the service caller.

CN122018964APending Publication Date: 2026-05-12BEIJING JINGDONG YUANSHENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING JINGDONG YUANSHENG TECH CO LTD
Filing Date
2024-11-11
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

When using MessagePack for data interaction in a microservice architecture, the ever-increasing size of the parameter class leads to high operation and maintenance costs and poor readability. Furthermore, the reconstruction of the parameter class requires coordination with the service caller, resulting in low processing efficiency.

Method used

When a runtime error is detected at the service call end, the description information of the parameter class is obtained, the changed attributes of the data structure are determined, and the attribute parsing template is adjusted according to this information to achieve compatible processing of the parsing process.

Benefits of technology

It improves the fault tolerance and data processing efficiency of the service caller, avoids the need for coordination with the service caller, and simplifies the parameter class refactoring process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122018964A_ABST
    Figure CN122018964A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method and device, electronic equipment, a computer storage medium and a computer program product, the method is applied to a service calling end of a micro-service architecture, and the method comprises the steps that when an operation report error exists, description information of all attributes in a first parameter class is acquired; the first parameter class represents a self-defined interface parameter class; according to the description information of each attribute, under the condition that it is determined that the data structure of the first parameter class changes, description information of a changed attribute corresponding to the first parameter class is determined; and obtaining an attribute analysis template of the first parameter class, and adjusting the attribute analysis template according to the description information of the changed attribute.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a data processing method, apparatus, electronic device, computer storage medium, and computer program product. Background Technology

[0002] Microservice architecture is a new technology for deploying applications and services in the cloud. MessagePack is an efficient binary serialization format that is widely used in microservice architectures for data interaction due to its efficient serialization performance and compact data format.

[0003] In related technologies, the following problems exist when using MessagePack for data interaction: First, in order to maintain the stability of inter-service calls, new parameter class attributes can only be appended to the end of the original parameter class, making the parameter class larger and larger, resulting in high operation and maintenance costs and poor readability; Second, when refactoring the parameter class, such as deleting or modifying parameter class attributes, it is necessary to coordinate with the service caller to complete the task, resulting in low processing efficiency. Summary of the Invention

[0004] In view of the above problems, embodiments of this application are proposed to provide a data processing method, apparatus, electronic device, computer storage medium, and computer program product that overcomes or at least partially solves the above problems.

[0005] The technical solution of this application is implemented as follows:

[0006] This application provides a data processing method applied to a service call terminal in a microservice architecture, the method comprising:

[0007] When a runtime error occurs, retrieve the description information of each attribute in the first parameter class; the first parameter class represents a custom interface parameter class.

[0008] Based on the description information of each attribute, when it is determined that the data structure of the first parameter class has changed, the description information of the changed attribute corresponding to the first parameter class is determined;

[0009] Obtain the attribute parsing template of the first parameter class, and adjust the attribute parsing template according to the description information of the changed attribute.

[0010] This application also proposes a data processing apparatus for use in a service invocation terminal of a microservice architecture, the apparatus comprising:

[0011] The acquisition module is used to obtain the description information of each attribute in the first parameter class when a runtime error occurs; the first parameter class represents a custom interface parameter class.

[0012] The determining module is used to determine the description information of the changed attribute corresponding to the first parameter class based on the description information of each attribute, when it is determined that the data structure of the first parameter class has changed;

[0013] The adjustment module is used to obtain the attribute parsing template of the first parameter class and adjust the attribute parsing template according to the description information of the changed attribute.

[0014] This application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the data processing method provided by one or more of the aforementioned technical solutions.

[0015] This application provides a computer storage medium storing a computer program; the computer program, when executed by a processor, can implement the data processing method provided by one or more of the aforementioned technical solutions.

[0016] This application provides a computer program product, including a computer program that, when executed by a processor, implements the data processing method provided by one or more of the aforementioned technical solutions.

[0017] This application proposes a data processing method, apparatus, electronic device, computer storage medium, and computer program product. The method is applied to the service call terminal of a microservice architecture and includes: when a runtime error occurs, obtaining description information of each attribute in a first parameter class; the first parameter class represents a custom interface parameter class; based on the description information of each attribute, determining the description information of the changed attribute corresponding to the first parameter class when it is determined that the data structure of the first parameter class has changed; obtaining an attribute parsing template of the first parameter class, and adjusting the attribute parsing template according to the description information of the changed attribute.

[0018] As can be seen in this embodiment, when the service caller encounters a runtime error and it is determined that the error is caused by a change in the data structure of the parameter class (i.e., adding, deleting, or modifying parameter class attributes), the description information of the changed attributes corresponding to the parameter class will be directly used to adaptively adjust the attribute parsing template of the parameter class, thereby achieving compatible processing of the parsing process and improving the fault tolerance of the service caller during runtime. In addition, the entire processing does not require coordination with the service caller, thus improving data processing efficiency. Attached Figure Description

[0019] Figure 1 A schematic diagram of a microservice architecture provided in an embodiment of this application;

[0020] Figure 2 This is a flowchart illustrating a data processing method according to an embodiment of this application;

[0021] Figure 3 This is a schematic diagram of the first parameter class in an embodiment of this application;

[0022] Figure 4 This is a schematic diagram of the first parameter class and the second parameter class in the embodiments of this application;

[0023] Figure 5 This is a schematic diagram of the attribute parsing template in an embodiment of this application;

[0024] Figure 6 This is a flowchart illustrating another data processing method in an embodiment of this application;

[0025] Figure 7 This is a schematic diagram of the composition structure of the data processing device in the embodiments of this application;

[0026] Figure 8 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0027] The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the embodiments provided herein are merely illustrative of the present application and are not intended to limit the present application. Furthermore, the embodiments provided below are some embodiments for implementing the present application, and not all embodiments for implementing the present application. Unless otherwise specified, the technical solutions described in the embodiments of the present application can be implemented in any combination.

[0028] It should be noted that, in the embodiments of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a method or apparatus that includes a list of elements includes not only the elements expressly described, but also other elements not expressly listed, or elements inherent to implementing the method or apparatus. Without further limitations, an element defined by the phrase "comprising a..." does not exclude the presence of other related elements (e.g., steps in the method or units in the apparatus, such as portions of circuitry, processors, programs, or software, etc.) in the method or apparatus that includes that element.

[0029] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, I and / or J can represent three cases: I alone, I and J simultaneously, and J alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more of a plurality of elements. For example, including at least one of I, J, and R can mean including any one or more elements selected from the set consisting of I, J, and R.

[0030] For example, the data processing method provided in the embodiments of this application includes a series of steps, but the data processing method provided in the embodiments of this application is not limited to the steps described. Similarly, the data processing apparatus provided in the embodiments of this application includes a series of modules, but the data processing apparatus provided in the embodiments of this application is not limited to the modules explicitly described, but may also include modules that need to be set up for obtaining relevant task data or processing based on task data.

[0031] The embodiments of this application can be applied to computer systems composed of terminal devices and servers, and can operate together with a wide range of other general-purpose or special-purpose computing system environments or configurations. Here, the terminal device can be a thin client, a thick client, a handheld or laptop device, a microprocessor-based system, a set-top box, a programmable consumer electronics product, a network personal computer, a minicomputer system, etc., and the server can be a minicomputer system, a mainframe computer system, and a distributed cloud computing technology environment that includes any of the above systems, etc.

[0032] Terminal devices, servers, and other electronic devices can achieve corresponding functions through the execution of program modules. Typically, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in a distributed cloud computing environment, where tasks are executed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can reside on local or remote computing system storage media, including storage devices.

[0033] Currently, MessagePack is a commonly used data format in microservice architectures. MessagePack is an efficient binary serialization format that locates attributes by the order of values. However, it requires maintaining the same model (e.g., the interface JAR in Java) and the order of attributes in the model across different languages, resulting in high maintenance costs.

[0034] In related technologies, the following problems exist when using MessagePack for data interaction: First, in order to maintain the stability of inter-service calls, new parameter class attributes can only be appended to the end of the original parameter class, making the parameter class larger and larger, resulting in high operation and maintenance costs and poor readability; Second, when refactoring the parameter class, such as deleting, modifying or altering parameter class attributes, it is necessary to coordinate with the service caller to complete the task, and multiple transition service deployments are required to complete the release of the new service, resulting in low processing efficiency.

[0035] To address the aforementioned technical problems, the following embodiments are proposed.

[0036] Figure 1 This is a schematic diagram of a microservice architecture provided in an embodiment of this application, such as... Figure 1 As shown, the microservice architecture includes: a service provider, a service registry, and a service caller. Here, the number of service providers and service callers can be one or more, and no specific limit is imposed here.

[0037] For example, when the service provider starts, in addition to reporting the service interface information to the service registry for service registration, it also reports the description information of the attributes in the interface parameter class. When the service caller starts, it obtains the service provider information (i.e., service interface information) and the description information of the attributes in the interface parameter class from the service registry. Based on the obtained information, the service caller calls the service interface provided by the service provider, sends the request data to the service provider, processes the request data through the service provider, and returns the processed data to the service caller.

[0038] It should be noted that the service caller and the service provider use MessagePack for data interaction. This interaction process involves data serialization and data deserialization. Correspondingly, the service caller uses MessagePack to serialize the request data into a string so that it can be transmitted to the service provider over the network. After receiving the string, the service provider uses MessagePack to deserialize the string back into the original request data for further processing.

[0039] In some embodiments of this application, the data processing method can be implemented using a processor in a data processing device. The processor can be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor.

[0040] In the embodiments of this application, the data processing method can be applied to Figure 1 The service call interface of the microservice architecture shown below; Figure 1 Based on, combined Figure 2 The implementation process of the data processing method is illustrated by an example.

[0041] Figure 2 This is a flowchart illustrating a data processing method according to an embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:

[0042] Step 100: When a runtime error occurs, obtain the description information of each attribute in the first parameter class.

[0043] In this embodiment of the application, if an exception occurs when the service caller uses MessagePack for deserialization, a runtime error will be reported. Here, the cause of the exception is not specifically limited. For example, it may be that the data structure of the first parameter class has changed, or that there are syntax errors or logical errors in the code file.

[0044] For example, an exception handling mechanism can be used, such as a try-catch statement, to capture exceptions that occur during the execution of the server-side application. When an exception is caught, it means that there is a runtime error on the server-side application, and an error message will be displayed. Conversely, if no exception is caught, it means that there is no runtime error on the server-side application, and no action will be taken.

[0045] In this embodiment of the application, when a runtime error occurs, the service caller can obtain the description information of each attribute in the first parameter class from the service registry. Here, the first parameter class represents a custom interface parameter class, which may include one or more attributes, each of which has corresponding description information.

[0046] For example, before the service caller obtains the description information of each attribute in the first parameter class, the service provider will report the description information of each attribute in the first parameter class to the service registry in advance.

[0047] Here, there are no specific restrictions on how the service caller obtains the description information of each attribute; it can be retrieved immediately or at regular intervals.

[0048] It should be noted that when the service caller has a new version of the parameter class, that is, the parameter class is defined for the first time or a change is made to the defined parameter class, it will report to the service registry center; here, the first parameter class is the latest version of the parameter class.

[0049] For example, in Python, you can use the `class` keyword to define a parameter class, and you can also change the defined parameter class; for example, you can use `class Person` to define a `Person` class.

[0050] For example, the description information of each attribute in the first parameter class may include the number of attributes, attribute names, and attribute types; here, the attribute type indicates the data type of the attribute. See also Figure 3 When the first parameter class is Person, the Person class includes name, address, and age attributes. Here, name, address, and age refer to the attribute names, and String and Integer refer to the attribute types. It can be seen that the data types of the name and address attributes are both String, and the attribute type of the age attribute is Integer. In this case, the description information of each attribute in the first parameter class can be represented as: {Person:[name:String,age:Integer,address:String]}. The service provider can report the description information of each attribute in the first parameter class to the service registry based on this data format.

[0051] Step 101: Based on the description information of each attribute, if it is determined that the data structure of the first parameter class has changed, determine the description information of the changed attribute corresponding to the first parameter class.

[0052] In this embodiment of the application, after the service caller obtains the description information of each attribute in the first parameter class, it can determine whether the data structure of the first parameter class has changed based on the description information of each attribute.

[0053] For example, as can be seen from the above, the first parameter class may include one or more attributes. Whether the data structure of the first parameter class has changed refers to whether the attributes of the first parameter class have changed, that is, whether the first parameter class has changed attributes: here, changed attributes may include adding attributes, deleting attributes, or replacing attributes.

[0054] In some embodiments, before determining that the data structure of the first parameter class has changed, based on the description information of each attribute, the above method may further include: comparing the description information of each attribute in the first parameter class with the description information of each attribute in the second parameter class to obtain a comparison result; and determining that the data structure of the first parameter class has changed if the comparison result indicates that the description information of each attribute in the first parameter class is inconsistent with the description information of each attribute in the second parameter class.

[0055] In this embodiment of the application, the second parameter class and the first parameter class are the same parameter class obtained by the service caller at different times; and the second parameter class is obtained earlier than the first parameter class. According to the above, the parameter class can be changed on the service provider side. That is to say, the second parameter class may be the unchanged parameter class, while the first parameter class may be the latest version of the parameter class after the change.

[0056] For example, after the service caller obtains the description information of each attribute in the second parameter class in advance, it can store it locally. In this way, when the service caller obtains the description information of each attribute in the first parameter class, it can directly obtain the description information of each attribute in the second parameter class from the local machine. Then, it compares the description information of each attribute in the first parameter class with the description information of each attribute in the second parameter class to obtain the comparison result. Here, the comparison result includes whether the number of attributes is the same, whether the names of the attributes are the same, and whether the data types of the attributes are the same. Only when all the above information is the same, it means that the description information of the attributes is inconsistent; otherwise, it means that the description information of the attributes is inconsistent.

[0057] For example, if the comparison results indicate that the description information of the two attributes is inconsistent, it is determined that the data structure of the first parameter class has changed, indicating that the running error is caused by the change in the data structure of the first parameter class, and the subsequent process continues; conversely, if the comparison results indicate that the description information of the two attributes is consistent, it is determined that the data structure of the first parameter class has not changed, indicating that the running error is not caused by the change in the data structure of the first parameter class, and an exception is thrown to end the current process.

[0058] For example, see Figure 4 The first parameter class and the second parameter class are both the same Person class obtained by the service caller at different times. The second parameter class (the Person class on the left) includes two attributes: name and address. The first parameter class (the Person class on the right) includes three attributes: name, address, and age. By comparing the description information of the two attributes, it can be seen that the first parameter class has added an age attribute after the name attribute compared to the second parameter class. At this point, it can be determined that the data structure of the first parameter class has changed.

[0059] In this embodiment of the application, when the service caller determines that the data structure of the first parameter class has changed, it can determine the description information of the changed attribute corresponding to the first parameter class based on the above comparison results. For example, it can add the description information of the age attribute, and then perform subsequent processing based on the description information of the changed attribute.

[0060] Step 102: Obtain the attribute parsing template of the first parameter class, and adjust the attribute parsing template according to the description information of the changed attribute.

[0061] In this embodiment of the application, after the service caller determines the description information of the changed attribute according to the above steps, it can obtain the attribute parsing template of the first parameter class, and then adjust the attribute parsing template according to the description information of the changed attribute.

[0062] For example, the attribute parsing template is stored in the parameter parser of the first parameter class; the service caller can obtain the attribute parsing template of the first parameter class from the parameter parser; here, the attribute parsing template may include the number of attributes and the set of attribute fields, wherein the set of attribute fields may include information such as attribute name, attribute type, and attribute identifier, etc. Figure 5 As shown; the property parsing template of the first parameter class is used to ensure the correct parsing of each property in the first parameter class.

[0063] In some embodiments, adjusting the attribute parsing template based on the description information of the changed attribute may include: if the changed attribute is a newly added attribute, determining the target position of the changed attribute in the attribute parsing template based on the position information of the changed attribute in the first parameter class; and inserting the description information of the changed attribute into the target position.

[0064] For example, when the changed attribute is a newly added attribute, it is explained that the changed attribute is an attribute included in the first parameter class but not included in the second parameter class. In this case, the position information of the changed attribute in the first parameter class can be obtained. This position information can indicate which attribute the changed attribute is before or after. Then, based on this position information, the target position of the changed attribute in the attribute parsing template can be determined. The description information of the changed attribute is inserted into the target position.

[0065] For example, by Figure 4 As can be seen, the age attribute is a newly added attribute corresponding to the first parameter class, and it can be determined that the age attribute is located after the name attribute; Figure 5 The property parsing template for the first parameter class is shown, such as... Figure 5 As shown, if it is determined that the age attribute is located after the name attribute, then the target position of the age attribute in the attribute parsing template can be determined, which is the second position in the attribute field set (corresponding to...). Figure 5 (The dashed box in the image) At this point, you can insert the description information of the age attribute into the target location.

[0066] In some embodiments, inserting description information of the changed attribute into the target location may include: obtaining the attribute identifier set for the newly added attribute; and inserting the description information and attribute identifier of the changed attribute into the target location.

[0067] Here, the attribute identifier indicates that newly added attributes are ignored during the parsing process; in this embodiment, the user can also set an attribute identifier for the newly added attribute. The service caller can obtain this attribute identifier and, while inserting the description information of the changed attribute into the target location, will also insert the corresponding attribute identifier, such as... Figure 5 As shown, the attribute identifier for the age attribute can be represented as: skip=true.

[0068] Understandably, by setting the attribute flag of the newly added attribute to skip=true, the service caller can skip the processing during the parsing process, i.e., the deserialization process, and will not report an error because the service caller does not have this newly added attribute, thus improving the fault tolerance of the service caller.

[0069] In some embodiments, adjusting the attribute parsing template based on the description information of the changed attribute may include: deleting the description information of the changed attribute from the attribute parsing template when the changed attribute is a deleted attribute.

[0070] For example, if the changed attribute is a deleted attribute, it means that the changed attribute is an attribute included in the second parameter class but not included in the first parameter class. In this case, the position information of the changed attribute in the second parameter class can also be obtained, and then the position of the changed attribute in the attribute parsing template can be found based on the position information, and the description information of the changed attribute located at that position can be deleted.

[0071] In some embodiments, adjusting the attribute parsing template based on the description information of the changed attribute may include: when the changed attribute is a replacement attribute, determining the description information of the initial attribute to be replaced from the attribute parsing template; and updating the description information of the initial attribute to the description information of the changed attribute.

[0072] For example, when changing an attribute to a replacement attribute, it is explained that the changed attribute is an attribute contained in the first parameter class, and the changed attribute is an attribute obtained by modifying an attribute in the second parameter class; here, the modification can be a modification of the data type or a modification of the attribute name, without specific limitations.

[0073] For example, when a change attribute is replaced by a replacement attribute, the position information of the initial attribute to be replaced in the second parameter class can be determined, and then the description information of the initial attribute to be replaced can be determined from the attribute parsing template based on the position information, and the description information of the initial attribute can be updated to the description information of the change attribute.

[0074] As can be seen, in this embodiment of the application, the attribute parsing template is adaptively adjusted according to the different types of changed attributes, which can ensure that the attribute parsing template stores the description information of the latest attributes in the parameter class. If the adjusted attribute parsing template is subsequently used to process the interactive data provided by the service provider, the success rate of data processing can be ensured.

[0075] In some embodiments, the above method may further include: after adjusting the attribute parsing template, the method further includes: obtaining monitoring data or log data of the changed attribute; and generating operation and maintenance reminder information for the changed attribute based on the monitoring data or log data.

[0076] Here, adjusting the attribute parsing template is equivalent to updating the parameter parser of the first parameter class. Understandably, adjusting the attribute parsing template can resolve runtime errors on the service caller side to some extent. To completely resolve inconsistencies between the service provider and the service caller regarding attributes of the same parameter class, after successfully updating the parameter parser of the first parameter class, monitoring or log data of the changed attributes can be obtained. Based on this data, maintenance reminders can be generated to alert maintenance personnel for timely maintenance, improving the completeness of maintenance operations.

[0077] For example, if the attribute flag "skip=true" is encountered, the operation and maintenance personnel can be reminded to perform operation and maintenance work through monitoring reminders or logs, so as to update the interface code in a timely manner and maintain the consistency of the data structure at both ends.

[0078] To facilitate understanding, the data processing flow will be further explained based on the above embodiments, such as... Figure 6 As shown, the process may include the following steps:

[0079] Step 200: An anomaly occurred during the MessagePack deserialization process.

[0080] For example, when an exception occurs during deserialization using MessagePack, a runtime error will occur. In this case, the description information of each attribute in the first parameter class will be obtained from the service registry.

[0081] Step 201: Determine whether the attribute description information is consistent; if it is not, proceed to step 202; if it is, proceed to step 203.

[0082] For example, the description information of each attribute in the first parameter class can be compared with the description information of each attribute in the second parameter class to obtain the comparison result, and the comparison result can be used to determine whether the description information of each attribute in the first parameter class and the description information of each attribute in the second parameter class are consistent.

[0083] Step 202: Should we attempt compatibility processing? If yes, proceed to step 204; if no, proceed to step 203.

[0084] Here, we need to consider whether compatibility processing can adaptively adjust the attribute parsing template of the first parameter class.

[0085] Step 203: Throw an exception and end the current process.

[0086] Step 204: Adjust the attribute parsing template according to the description information of the changed attributes.

[0087] Step 205: Mark as compatible.

[0088] Here, "marked as compatible" means that after adjusting the attribute parsing template, the changed attributes can be marked as compatible in the attribute parsing template.

[0089] Step 206: Re-deserialize MessagePack.

[0090] For example, after adjusting the attribute parsing template, the service caller re-deserializes the MessagePack.

[0091] Step 207: Determine if the call was successful; if it was successful, proceed to step 208; if it was unsuccessful, proceed to step 203.

[0092] For example, when the service caller performs MessagePack deserialization, it calls the service provider to determine whether the call was successful.

[0093] Step 208: Update the MessagePack deserialization configuration, and then proceed with compatibility processing.

[0094] Step 209: MessagePack deserialization is complete.

[0095] As can be seen from the embodiments of this application, during the MessagePack deserialization process at the service call end, by comparing the differences in the description information of each attribute in the interface parameter class of different versions, the changed attributes in the parameter class are determined, and the data parsing template is adjusted using the description information of the changed attributes. This decouples the forced sequential serialization and deserialization of MessagePack dependent class attributes, thereby improving the fault tolerance of MessagePack deserialization, increasing the call success rate, and thus improving the usability of microservices.

[0096] To make it easier to understand, the following is... Figure 6 Based on this, the processing flow of MessagePack deserialization will be further explained.

[0097] For example, the service caller obtains the description information of each attribute in the first parameter class (new version parameter class), which is divided into normal and abnormal cases. The process of repackaging the parameter parser is the same in both normal and abnormal cases. The exception handling process of MessagePack deserialization is described below.

[0098] Under normal circumstances, the service provider and the service caller use the same parameter class structure, that is, the data structure of the first parameter class remains unchanged.

[0099] In abnormal situations, if the parameter class structure of the service provider changes, i.e., the data structure of the first parameter class changes, the service caller will encounter a runtime error. In this case, the data processing method provided in this application embodiment can be used for fault tolerance.

[0100] First, the description information of each attribute in the first parameter class is retrieved in real time from the service registry. Then, the description information of each attribute in the first parameter class is compared with the description information of each attribute in the second parameter class. If the number of attributes is the same, and the attribute names and data types are also the same, it means that the runtime error on the service caller is not caused by a change in the data structure of the first parameter class, and an exception is thrown. Conversely, if the comparison finds that the description information of the attributes is inconsistent, and no comparison has been performed before, it means that the runtime error is caused by a change in the data structure of the first parameter class, and the subsequent process continues.

[0101] Then, iterate through the description information of each attribute in the first parameter class (obtained from the service registry) and compare it with the description information of each attribute in the second parameter class (already existing on the service caller). If any new attributes are found (such as...), Figure 5 If the `age` attribute is shown, then adjust the corresponding position in the existing parameter parsing parsing template (e.g., ...). Figure 5 Insert the description information for the `age` attribute in the second position of the attribute field set shown. If a change in the data type of any attribute is detected, it can also be reflected in the attribute parsing template of the parameter parser. This completes the update of the parameter parser.

[0102] Finally, the parameter parser, updated to the latest data format, processes the string data provided by the service provider. The MessagePack deserialization process involves iterating through the parameter class attribute set and parsing the parameters. If a new attribute is encountered (such as...),... Figure 5 The age attribute shown is skipped during deserialization because the parameter parser has set the attribute flag of the new attribute to skip=true. This prevents errors from occurring on the service caller side because the new attribute is not present, thus improving the fault tolerance of the service caller side.

[0103] Figure 7 This is a schematic diagram of the composition structure of the data processing device in the embodiments of this application, as shown below. Figure 7 As shown, the device includes: an acquisition module 300, a determination module 301, and an adjustment module 302, wherein:

[0104] The acquisition module 300 is used to acquire the description information of each attribute in the first parameter class when a runtime error occurs; the first parameter class represents a custom interface parameter class.

[0105] The determining module 301 is used to determine the description information of the changed attribute corresponding to the first parameter class based on the description information of each attribute, when it is determined that the data structure of the first parameter class has changed;

[0106] The adjustment module 302 is used to obtain the attribute parsing template of the first parameter class and adjust the attribute parsing template according to the description information of the changed attribute.

[0107] In some embodiments, the adjustment module 302 is further configured to:

[0108] When the changed attribute is a newly added attribute, the target position of the changed attribute in the attribute parsing template is determined based on the position information of the changed attribute in the first parameter class;

[0109] Insert the description information of the changed attribute into the target location.

[0110] In some embodiments, the adjustment module 302 is further configured to:

[0111] Obtain the attribute identifier set for the newly added attribute; the attribute identifier indicates that the newly added attribute is ignored during the parsing process;

[0112] Insert the description information of the changed attribute and the attribute identifier into the target location.

[0113] In some embodiments, the adjustment module 302 is further configured to:

[0114] If the changed attribute is a deleted attribute, the description information of the changed attribute is deleted from the attribute parsing template.

[0115] In some embodiments, the adjustment module 302 is further configured to:

[0116] In the case where the changed attribute is replaced, the description information of the initial attribute to be replaced is determined from the attribute parsing template;

[0117] Update the description information of the initial attribute to the description information of the changed attribute.

[0118] In some embodiments, the determining module 301 is further configured to:

[0119] The description information of each attribute in the first parameter class is compared with the description information of each attribute in the second parameter class to obtain the comparison result; the second parameter class and the first parameter class are the same parameter class obtained by the service caller at different times, and the second parameter class is obtained earlier than the first parameter class.

[0120] If the comparison results indicate that the description information of each attribute in the first parameter class is inconsistent with the description information of each attribute in the second parameter class, it is determined that the data structure of the first parameter class has changed.

[0121] In some embodiments, the device further includes an operation and maintenance reminder module, the operation and maintenance reminder module being used for:

[0122] Obtain monitoring data or log data of the changed attributes;

[0123] Based on the monitoring data or log data, generate maintenance reminder information for the changed attributes.

[0124] In practical applications, the acquisition module 300, determination module 301, adjustment module 302 and maintenance reminder module can all be implemented by a processor located in an electronic device. The processor can be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller and microprocessor.

[0125] Furthermore, in this embodiment, the functional modules can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional module.

[0126] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, in essence, or the part that contributes to related technologies, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method of this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0127] Specifically, the computer program instructions corresponding to a data processing method in this embodiment can be stored on storage media such as optical discs, hard disks, and USB flash drives. When the computer program instructions corresponding to a data processing method in the storage media are read or executed by an electronic device, any one of the data processing methods in the aforementioned embodiments is implemented.

[0128] Based on the same technical concept as the foregoing embodiments, see Figure 8 It illustrates an electronic device 400 provided in an embodiment of this application, which may include: a memory 401 and a processor 402; wherein,

[0129] Memory 401 is used to store computer programs and data;

[0130] The processor 402 is configured to execute a computer program stored in a memory to implement any of the data processing methods described in the foregoing embodiments.

[0131] In practical applications, the memory 401 mentioned above can be volatile memory, such as RAM; or non-volatile memory, such as ROM, flash memory, hard disk drive (HDD) or solid-state drive (SSD); or a combination of the above types of memory, and provide instructions and data to the processor 402.

[0132] The processor 402 described above can be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor. It is understood that for different electronic devices, the electronic device used to implement the above processor function can also be other types, and this application embodiment does not specifically limit the specific types.

[0133] This application provides a computer program product, including a computer program that, when executed by a processor, implements any of the data processing methods described in the foregoing embodiments.

[0134] In some embodiments, the functions or modules of the apparatus provided in this application can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0135] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.

[0136] The methods disclosed in the various method embodiments provided in this application can be arbitrarily combined to obtain new method embodiments without conflict.

[0137] The features disclosed in the various product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0138] The features disclosed in the various method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.

[0139] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program goods. Therefore, this application can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Furthermore, this application can take the form of a computer program goods embodied on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.

[0140] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program goods according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0141] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0142] The above are merely preferred embodiments of this application and are not intended to limit the scope of protection of this application.

Claims

1. A data processing method, characterized in that, The method, applied to the service invocation end of a microservice architecture, includes: When a runtime error occurs, retrieve the description information of each attribute in the first parameter class; the first parameter class represents a custom interface parameter class. Based on the description information of each attribute, when it is determined that the data structure of the first parameter class has changed, the description information of the changed attribute corresponding to the first parameter class is determined; Obtain the attribute parsing template of the first parameter class, and adjust the attribute parsing template according to the description information of the changed attribute.

2. The method according to claim 1, characterized in that, The step of adjusting the attribute parsing template based on the description information of the changed attribute includes: When the changed attribute is a newly added attribute, the target position of the changed attribute in the attribute parsing template is determined based on the position information of the changed attribute in the first parameter class; Insert the description information of the changed attribute into the target location.

3. The method according to claim 2, characterized in that, The step of inserting the description information of the changed attribute into the target location includes: Obtain the attribute identifier set for the newly added attribute; the attribute identifier indicates that the newly added attribute is ignored during the parsing process; Insert the description information of the changed attribute and the attribute identifier into the target location.

4. The method according to claim 1, characterized in that, The step of adjusting the attribute parsing template based on the description information of the changed attribute includes: If the changed attribute is a deleted attribute, the description information of the changed attribute is deleted from the attribute parsing template.

5. The method according to claim 1, characterized in that, The step of adjusting the attribute parsing template based on the description information of the changed attribute includes: In the case where the changed attribute is replaced, the description information of the initial attribute to be replaced is determined from the attribute parsing template; Update the description information of the initial attribute to the description information of the changed attribute.

6. The method according to claim 1, characterized in that, Before determining that the data structure of the first parameter class has changed based on the description information of each attribute, the method further includes: The description information of each attribute in the first parameter class is compared with the description information of each attribute in the second parameter class to obtain the comparison result; the second parameter class and the first parameter class are the same parameter class obtained by the service caller at different times, and the second parameter class is obtained earlier than the first parameter class. If the comparison results indicate that the description information of each attribute in the first parameter class is inconsistent with the description information of each attribute in the second parameter class, it is determined that the data structure of the first parameter class has changed.

7. The method according to claim 1, characterized in that, After adjusting the attribute parsing template, the method further includes: Obtain monitoring data or log data of the changed attributes; Based on the monitoring data or log data, generate maintenance reminder information for the changed attributes.

8. A data processing apparatus, characterized in that, The device, used as a service invocation terminal in a microservice architecture, includes: The acquisition module is used to obtain the description information of each attribute in the first parameter class when a runtime error occurs; the first parameter class represents a custom interface parameter class. The determining module is used to determine the description information of the changed attribute corresponding to the first parameter class based on the description information of each attribute, when it is determined that the data structure of the first parameter class has changed; The adjustment module is used to obtain the attribute parsing template of the first parameter class and adjust the attribute parsing template according to the description information of the changed attribute.

9. An electronic device, characterized in that, The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the method according to any one of claims 1 to 7.

10. A computer storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the method described in any one of claims 1 to 7.

11. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the method described in any one of claims 1 to 7.