Data processing method and device, storage medium and electronic device

By obtaining the field values ​​of the structure and using the mapping relationship set to determine the version, the problem of wasted storage space and low accuracy caused by different versions in data processing is solved, and the flexibility and efficiency of data transmission are achieved.

CN118656033BActive Publication Date: 2024-10-29ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411136287.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2024-10-29
Estimated Expiration
2044-08-19

AI Technical Summary

Technical Problem

During the data processing process, due to the existence of different versions of structures, storage space is wasted and data processing accuracy is low.

Method used

By obtaining the field values ​​of the calling structure and implementation structure, using the predetermined mapping relationship set to determine the calling version and implementation version, and generating target processing results and prompt messages, the data transfer is made more flexible and efficient, and the accuracy of data transfer is ensured. sex and effectiveness.

Benefits of technology

When the calling field value is different from the implemented field value, the corresponding version is quickly and accurately determined to avoid wasting storage space, improve the accuracy of data processing, and help developers understand the version difference through prompt messages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656033B_ABST
    Figure CN118656033B_ABST
Patent Text Reader

Abstract

The present application discloses a data processing method and device, a storage medium and an electronic device. The method includes: obtaining a call structure; determining the call field value of the call field and the implementation field value of the implementation field in the implementation structure; when the call field value is different from the implementation field value, determining the call version corresponding to the call field value and the implementation version corresponding to the implementation field value based on a predetermined mapping relationship set, wherein the mapping relationship set includes a one-to-one corresponding set of versions and a set of field values, a set of versions includes an implementation version, and a set of field values ​​includes an implementation field value; generating a target processing result based on the implementation structure, and generating a prompt message indicating that the call version and the implementation version are different. The present application solves the technical problem that the existence of different versions of structures in the data processing process leads to a waste of storage space and a low accuracy of data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a data processing method and device, a storage medium, and an electronic device. Background Art

[0002] At present, in the related art, the method of manually setting reserved fields is mainly used to ensure that sufficient reserved storage space is preset for the structure during the data processing process, so as to facilitate the subsequent business data expansion. However, since the structure will be updated and iterated during the data processing process, different versions of the structure will exist. Furthermore, the use of reserved fields will waste storage space and the accuracy of data processing will be difficult to guarantee. Therefore, there are different versions of structures in the related art, which leads to a waste of storage space and a technical problem of low data processing accuracy. Summary of the invention

[0003] The embodiments of the present application provide a data processing method and device, a storage medium and an electronic device to at least solve the technical problem that the existence of different versions of structures during the data processing process leads to waste of storage space and low accuracy of data processing.

[0004] According to one aspect of an embodiment of the present application, a data processing method is provided, comprising: obtaining a call structure, wherein the call structure includes a call field, and the call field is used to indicate the storage space required to be occupied by the call structure; determining a call field value of the call field and an implementation field value of an implementation field in an implementation structure, wherein the implementation field is used to indicate the storage space required to be occupied by the implementation structure; in a case where the call field value is different from the implementation field value, determining a call version corresponding to the call field value and an implementation version corresponding to the implementation field value based on a predetermined mapping relationship set, wherein the mapping relationship set includes a one-to-one corresponding set of versions and a set of field values, the set of versions includes the implementation version, and the set of field values ​​includes the implementation field value; generating a target processing result based on the implementation structure, and generating a prompt message indicating that the call version and the implementation version are different, wherein the target processing result represents a processing result generated according to the implementation version and compatible with the call version.

[0005] According to another aspect of an embodiment of the present application, a data processing device is also provided, including: an acquisition module, used to acquire a call structure, wherein the call structure includes a call field, and the call field is used to indicate the storage space required to be occupied by the call structure; a first determination module, used to determine the call field value of the call field and the implementation field value of the implementation field in the implementation structure, wherein the implementation field is used to indicate the storage space required to be occupied by the implementation structure; a second determination module, used to determine, when the call field value is different from the implementation field value, a call version corresponding to the call field value and an implementation version corresponding to the implementation field value based on a predetermined mapping relationship set, wherein the mapping relationship set includes a one-to-one corresponding set of versions and a set of field values, the set of versions includes the implementation version, and the set of field values ​​includes the implementation field value; a generation module, used to generate a target processing result based on the implementation structure, and generate a prompt message indicating that the call version and the implementation version are different, wherein the target processing result represents a processing result generated according to the implementation version and compatible with the call version.

[0006] Optionally, the device is used to generate a target processing result based on the implementation structure and generate a prompt message indicating that the calling version and the implementation version are different in the following manner: when the calling field value is less than the implementation field value, and the set of versions includes the calling version, the field with the same field identifier in the calling structure and the implementation structure is determined as the first target field; based on the implementation version, the business logic corresponding to the first target field is implemented to generate a first processing result, and the prompt message is generated based on the first processing result, wherein the target processing result includes the first processing result.

[0007] Optionally, the device is used to implement the business logic corresponding to the first target field based on the implementation version, generate a first processing result, and generate the prompt message based on the first processing result in the following manner: implement the business logic corresponding to the first target field based on the implementation version, and generate a first initial processing result; when the first initial processing result includes an excess field, clear the excess field to obtain the first processing result, wherein the excess field is indicated by the call structure; when the first initial processing result does not include an excess field, determine the first initial processing result as the first processing result; and generate the prompt message based on the first processing result.

[0008] Optionally, the device is used to implement the business logic corresponding to the first target field based on the implementation version, generate a first processing result, and generate the prompt message based on the first processing result in the following manner: generate a result execution code according to the target processing result, wherein the result execution code is used to indicate the execution result of the business logic; generate the prompt message according to the result execution code, wherein the prompt message indicates that the calling version is lower than the implementation version.

[0009] Optionally, the device is also used to: generate an error prompt code when the value of the call field is less than the value of the implementation field and the set of versions does not include the call version, wherein the error prompt code indicates that the call version is an invalid version; and generate the prompt message according to the error prompt code, wherein the prompt message indicates that the call structure is an invalid structure.

[0010] Optionally, the device is used to generate a target processing result based on the implementation structure and generate a prompt message indicating that the calling version and the implementation version are different in the following manner: when the value of the calling field is greater than the value of the implementation field, the field with the same field identifier in the calling structure and the implementation structure is determined as the second target field; based on the implementation version, the business logic corresponding to the second target field is implemented to generate a second processing result, and the prompt message is generated based on the second processing result, wherein the target processing result includes the second processing result, and the prompt message is used to indicate that the second processing result is a processing result of downgrading the calling structure for compatibility.

[0011] Optionally, the device is also used to: determine an inline function from the target header file when both the calling object and the implementation object reference the target header file, wherein the calling object includes a code segment and a calling structure for calling the target interface, and the implementation object includes a code segment and an implementation structure for implementing the target interface, the inline function and the target interface are pre-defined in the target header file, and the inline function is used to determine the storage space required to be occupied by the calling structure and the implementation structure respectively; determine a calling field value and an implementation field value using the inline function, wherein the calling field value corresponds to the implementation object, and the implementation field value corresponds to the calling object; determine the implementation version from the set of versions according to the implementation field value, and determine the calling version from the set of versions according to the calling field value.

[0012] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned data processing method when running.

[0013] According to another aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above data processing method.

[0014] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the data processing method through the computer program.

[0015] In an embodiment of the present application, a call structure is obtained, wherein the call structure includes a call field, and the call field is used to indicate the storage space that the call structure needs to occupy; a call field value of the call field and an implementation field value of the implementation field in the implementation structure are determined, wherein the implementation field is used to indicate the storage space that the implementation structure needs to occupy; when the call field value is different from the implementation field value, a call version corresponding to the call field value and an implementation version corresponding to the implementation field value are determined based on a predetermined mapping relationship set, wherein the mapping relationship set includes a one-to-one corresponding set of versions and a set of field values, a set of versions includes an implementation version, and a set of field values ​​includes an implementation field value; a target processing result is generated based on the implementation structure, and a target processing result is generated. A prompt message is generated to indicate that the calling version and the implementation version are different, wherein the target processing result is generated according to the implementation version and is compatible with the processing result of the calling version, so that the data transfer between the calling structure and the implementation structure is more flexible and efficient. Through a predetermined set of mapping relationships, the corresponding version can be quickly and accurately determined when the calling field value is different from the implementation field value, thereby ensuring the accuracy and effectiveness of the data transfer. In addition, the generated prompt message can also help developers better understand the difference between the calling version and the implementation version, thereby solving the technical problem of wasting storage space and low data processing accuracy due to the existence of different versions of structures in the data processing process. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0017] Figure 1 is a schematic diagram of an application environment of an optional data processing method according to an embodiment of the present application;

[0018] Figure 2 is a flowchart of an optional data processing method according to an embodiment of the present application;

[0019] Figure 3 is a schematic diagram of an optional data processing method according to an embodiment of the present application;

[0020] Figure 4 is a schematic diagram of another optional data processing method according to an embodiment of the present application;

[0021] Figure 5 is a schematic diagram of another optional data processing method according to an embodiment of the present application;

[0022] Figure 6 is a schematic diagram of another optional data processing method according to an embodiment of the present application;

[0023] Figure 7 is a schematic diagram of another optional data processing method according to an embodiment of the present application;

[0024] Figure 8 is a schematic diagram of another optional data processing method according to an embodiment of the present application;

[0025] Fig. 9 is a schematic diagram of another optional data processing method according to an embodiment of the present application;

[0026] Fig.10 is a schematic diagram of another optional data processing method according to an embodiment of the present application;

[0027] Fig.11 is a schematic structural diagram of an optional data processing device according to an embodiment of the present application;

[0028] Fig.12 is a schematic diagram of the structure of an optional data processing product according to an embodiment of the present application;

[0029] Fig.13 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] The present application is described below in conjunction with embodiments:

[0033] According to one aspect of an embodiment of the present application, a data processing method is provided. Optionally, in this embodiment, the data processing method can be applied to Figure 1 In the hardware environment composed of the server 101 and the terminal device 103 shown in FIG. Figure 1As shown, the server 101 is connected to the terminal device 103 via a network, and can be used to provide services for the terminal device or the application installed on the terminal device. The application 107 can be a video application, an instant messaging application, a browser application, an educational application, a game application, etc. A database 105 may be set up on the server or independently of the server to provide data storage services for the server 101, for example, a game data storage server. The above-mentioned network may include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network and a wide area network, and the wireless network includes: Bluetooth, WIFI and other networks that realize wireless communication. The terminal device 103 may be a terminal configured with an application, and may include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop computer, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, an intelligent voice interaction device, a smart home appliance, a vehicle-mounted terminal, an aircraft, a virtual reality (Virtual Reality, VR for short) terminal, an augmented reality (Augmented Reality, AR for short) terminal, a mixed reality (Mixed Reality, MR for short) terminal and other computer devices. The above-mentioned server may be a single server, or a server cluster consisting of multiple servers, or a cloud server.

[0034] Combination Figure 1 As shown, the above data processing method can be executed by an electronic device, which can be a terminal device or a server. The above data processing method can be implemented by the terminal device or the server respectively, or by the terminal device and the server together.

[0035] The above is only an example and is not specifically limited in this embodiment.

[0036] Optionally, as an optional implementation, as Figure 2 As shown, the method for processing the above data includes:

[0037] S202, obtaining a call structure, wherein the call structure includes a call field, and the call field is used to indicate a storage space required to be occupied by the call structure;

[0038] S204, determining a call field value of the call field and an implementation field value of the implementation field in the implementation structure, wherein the implementation field is used to indicate a storage space required to be occupied by the implementation structure;

[0039] Optionally, in an embodiment of the present application, the above-mentioned call result body and implementation structure may include but are not limited to the storage space size, the name of the called function or method, the parameters passed during the call, the return value of the call, the error information or exception handling mechanism, etc. The above-mentioned call field can be understood as the variable in the call structure, and the above-mentioned implementation field can be understood as the variable in the implementation structure. The present application does not limit the types of the call field and the implementation field, that is, the call field and the implementation field may include but are not limited to integers, floating-point numbers, pointers, etc.

[0040] In an exemplary embodiment, Figure 3 is a schematic diagram of an optional data processing method according to an embodiment of the present application. The above-mentioned calling structure can be as follows Figure 3 The structure A shown in the figure, where _param represents the structure type, that is, the type of the calling structure param_t is the parameter structure type, which contains four member variables, namely cbsize, align, id and type, where cbsize represents the storage space required for the calling structure, that is, the above-mentioned calling field, align represents the alignment of the calling structure, id and type are two integer variables, and the calling structure can add, delete or modify member variables according to actual business needs to adapt to specific needs.

[0041] In another exemplary embodiment, the above calling structure can be as follows Figure 3 The structure B shown in the figure defines a calling structure options_t, which contains two member variables: cbsize and timeout_ms. cbsize is an unsigned short integer, which is used to indicate the storage space required for the calling structure, that is, the calling field mentioned above. timeout_ms is a short integer, which is used to indicate the timeout period in milliseconds. For example, the timeout period can be defined using "_options. timeout_ms".

[0042] It should be noted that a calling structure and an implementation structure may be defined in a header file, including but not limited to, and the calling structure and the implementation structure may include but are not limited to being the same structure. For example, a structure A is defined in a header file, and in the caller module, the calling structure is used to represent the structure A, and in the implementer module, the implementation structure is used to represent the structure A. Furthermore, the field in the implementation structure used to represent the storage space that the structure needs to occupy is the above-mentioned implementation field.

[0043] Furthermore, the caller module refers to the module that calls structure A, references the header file that defines structure A, and uses structure A to define variables or pass parameters. The implementer module refers to the module that implements structure A and implements the specific content of structure A. Both the caller module and the implementer module reference the header file that defines structure A.

[0044] S206, when the calling field value is different from the implementation field value, determining the calling version corresponding to the calling field value and the implementation version corresponding to the implementation field value based on a predetermined mapping relationship set, wherein the mapping relationship set includes a one-to-one corresponding set of versions and a set of field values, a set of versions includes the implementation version, and a set of field values ​​includes the implementation field value;

[0045] Optionally, in an embodiment of the present application, the value of the above-mentioned calling field is different from the value of the implementation field, indicating that the storage space required to be occupied by the calling structure is different from the storage space required to be occupied by the implementation structure. The above-mentioned mapping relationship set may include but is not limited to the above-mentioned set of versions and a set of field values. For example, the field value is 140, corresponding to version V1; the field value is 235, corresponding to version V2, and so on.

[0046] It should be noted that the mapping relationship between the above-mentioned field values ​​and versions is not limited in this application. That is, the mapping relationship between the field values ​​and versions may vary according to specific applications and requirements. For example, the larger the field value, the higher the version, or the smaller the field value, the higher the version.

[0047] For example, Figure 4 is a schematic diagram of an optional data processing method according to an embodiment of the present application. The above mapping relationship set can be as follows Figure 4 As shown, the field value is 12, corresponding to version V1, the field value is 14, corresponding to version V2, and so on.

[0048] Furthermore, in the above-mentioned call field, the field value with the largest value is X, and the corresponding version is up to Y10. At this time, if the call structure is expanded, for example, a member variable is added to the call structure, the storage space occupied by the corresponding call structure will also change. At this time, the field value corresponding to the call structure will increase.

[0049] Specifically, determine the member variable that occupies the most bytes among the member variables of the calling structure, for example, 4 bytes are required; accordingly, the field value corresponding to the calling structure will become X+4. At this time, the corresponding calling version is updated to Y11, the maximum version in the above set of versions is changed to Y11, and the maximum field value in the above set of field values ​​is also changed to X+4.

[0050] In an exemplary embodiment, Figure 5 is a schematic diagram of an optional data processing method according to an embodiment of the present application. The above-mentioned calling structure can be as follows Figure 5 As shown, before a member variable "depth" is added, there are 4 member variables, and after the member variable "depth" is added, there are 5 member variables.

[0051] Alternatively, obtain the member variables of the calling structure after adding variables, and determine the member variable that occupies the most bytes among the member variables, which needs to occupy 4 bytes; accordingly, the field value corresponding to the calling structure after adding member variables will become X+4 2. At this time, the corresponding call version is updated to Y11, the maximum version in the above set of versions is changed to Y11, and the maximum field value in the above set of field values ​​is also changed to X+4 2. That is, this application does not limit the mapping relationship between field values ​​and corresponding versions.

[0052] Exemplarily, the above-mentioned mapping relationship set can be queried according to the above-mentioned implementation field values, and the version corresponding to the implementation field value in a group of field values ​​is used as the above-mentioned implementation version, and the above-mentioned calling version can also be determined by querying the above-mentioned mapping relationship set. If a group of field values ​​includes the above-mentioned calling field value, then the version corresponding to the calling field value in a group of field values ​​is used as the above-mentioned calling version. Alternatively, if a group of field values ​​does not include the above-mentioned calling field value, by comparing the calling field value with the implementation field value, the relationship between the above-mentioned calling version and the implementation version can be obtained, thereby determining whether the calling version is available.

[0053] In an exemplary embodiment, if the value of the call field is greater than the value of the implementation field, it means that the call version is higher than the implementation version; if the value of the call field is less than the value of the implementation field, it means that the call version is lower than the implementation version.

[0054] S208, generating a target processing result based on the implementation structure, and generating a prompt message for indicating that the calling version and the implementation version are different, wherein the target processing result represents a processing result generated according to the implementation version and compatible with the calling version.

[0055] Exemplarily, the above target processing result can be understood as the implementation structure performs corresponding business processing using the variable parameters passed by the calling structure, and then returns the target processing result to the caller module using the outgoing variable parameters of the calling structure.

[0056] It should be noted that Figure 6 is a schematic diagram of an optional data processing method according to an embodiment of the present application, such as Figure 6As shown, in the embodiments of the present application, whether the implementation version is higher than the calling version, or the calling version is higher than the implementation version, the corresponding business logic can be successfully executed to ensure the smooth processing of the business logic and avoid program crashes or insufficient storage space.

[0057] In an exemplary embodiment, if the calling version is higher than the implementation version, the implementer module can process according to the implementation version. If the implementation version cannot meet some feature requirements of the calling version corresponding to the caller module, for example, there is a member variable A in the calling structure corresponding to the calling version, but there is no member variable A in the implementation structure corresponding to the implementation version, and the business logic is: sum the values ​​of the member variables in the calling structure and return the sum. At this time, the caller module can be prompted by returning a message, indicating that the business logic is successfully executed, but some features are missing, that is, the implementation version is lower than the calling version, and the implementation structure does not have member variable A. Therefore, the target processing result belongs to the result after downgrading.

[0058] In another exemplary embodiment, if the calling version is lower than the implementation version, and the higher version can be compatible with the lower version, the implementation version can correctly implement the business logic requested to be executed by the calling version. For example, the calling version is 1.0, in which a function add(a, b) is defined to calculate the sum of two numbers. In the calling version 1.0, the add function can only receive parameters of type int; and the implementation version is 2.0, in which the function add(a, b) is upgraded to receive parameters of type int and type float. At this time, the parameters passed into the implementation structure are two int type parameters, and the implementation version 2.0 can use the function add(a, b) to correctly calculate the corresponding sum value.

[0059] In an exemplary embodiment, Figure 7 This is a schematic diagram of an optional data processing method according to an embodiment of the present application. It is assumed that a caller module and an implementer module are deployed on a terminal device, and data processing can be performed between the two through an interface. During the data processing process, the caller module uses the calling structure of the calling version, and the implementer module uses the implementation structure of the implementation version, and the implementation version is different from the calling version. At this time, during the data processing process, the data processing method proposed in the embodiment of the present application can be used to ensure that the implementation version can successfully execute the business logic requested by the calling structure, and will not cause overflow of storage space or memory leakage, so as to ensure the stability and compatibility of data processing. Specifically, as Figure 7 As shown:

[0060] S702, the caller module requests the implementer module to execute the business logic and determine the call structure;

[0061] S704, obtaining the call field in the structure parameter of the call structure passed into the implementer module;

[0062] S706, determine whether the calling field value of the calling field is greater than the implementation field value of the implementation field in the implementation structure, if so, execute S708, otherwise, execute S712;

[0063] S708, determining the implementation version from a predetermined mapping relationship set according to the implementation field value, processing the business logic using the implementation version, obtaining a target processing result, and generating a prompt message indicating that the calling version and the implementation version are different;

[0064] S710, returning the target processing result and prompt message to the caller module, and ending;

[0065] S712, determining the implementation version from a predetermined mapping relationship set according to the implementation field value;

[0066] S714, determine whether there is a call version corresponding to the call field value in the mapping relationship set, if so, execute S716, otherwise execute S722;

[0067] S716, using the implementation version to process the business logic, obtaining a target processing result;

[0068] S718, if the target processing result includes a variable parameter that implements the structure, that is, the variable parameter needs to be returned to the caller module as an outgoing parameter, then the variable parameter is converted into a structure, which can be understood as encapsulating the variable parameter into a structure object, and returning the structure object to the caller module as a return value;

[0069] S720, generating a prompt message of successful execution of the business logic, and returning the target processing result and the prompt message to the caller module;

[0070] S722, returns an error code to the caller module, indicating that the calling version is an invalid structure version;

[0071] S724, end.

[0072] Through the embodiment of the present application, a call structure is obtained, wherein the call structure includes a call field, and the call field is used to indicate the storage space that the call structure needs to occupy; the call field value of the call field and the implementation field value of the implementation field in the implementation structure are determined, wherein the implementation field is used to indicate the storage space that the implementation structure needs to occupy; when the call field value is different from the implementation field value, the call version corresponding to the call field value and the implementation version corresponding to the implementation field value are determined based on a predetermined mapping relationship set, wherein the mapping relationship set includes a one-to-one corresponding set of versions and a set of field values, a set of versions includes an implementation version, and a set of field values ​​includes an implementation field value; a target processing result is generated based on the implementation structure, and a target processing result is generated. A prompt message is generated to indicate that the calling version and the implementation version are different, wherein the target processing result is generated according to the implementation version and is compatible with the processing result of the calling version, so that the data transfer between the calling structure and the implementation structure is more flexible and efficient. Through a predetermined set of mapping relationships, the corresponding version can be quickly and accurately determined when the calling field value is different from the implementation field value, thereby ensuring the accuracy and effectiveness of the data transfer. In addition, the generated prompt message can also help developers better understand the difference between the calling version and the implementation version, thereby solving the technical problem of wasting storage space and low data processing accuracy due to the existence of different versions of structures in the data processing process.

[0073] As an optional scheme, the above-mentioned target processing result is generated based on the above-mentioned implementation structure, and a prompt message is generated to indicate that the above-mentioned calling version and the above-mentioned implementation version are different, including: when the value of the above-mentioned calling field is less than the value of the above-mentioned implementation field, and the above-mentioned set of versions includes the above-mentioned calling version, the field with the same field identifier in the above-mentioned calling structure and the above-mentioned implementation structure is determined as the first target field; based on the above-mentioned implementation version, the business logic corresponding to the above-mentioned first target field is implemented to generate the first processing result, and the above-mentioned prompt message is generated based on the above-mentioned first processing result, wherein the above-mentioned target processing result includes the above-mentioned first processing result.

[0074] For example, Figure 8 is a schematic diagram of an optional data processing method according to an embodiment of the present application. The field identifier may include but is not limited to the field name. For example, the field name of the field "id" is "id". The first target field may be as follows: Figure 8 As shown, it includes "cbsize", "depth", "id" and "type", and because the calling structure does not include the field "format" in the implementation structure, the first target field does not include the field "format".

[0075] It should be noted that the above-mentioned target processing result may include multiple processing results, one or more of which are the above-mentioned first processing results.

[0076] In an exemplary embodiment, Fig. 9 is a schematic diagram of an optional data processing method according to an embodiment of the present application, which implements the existence of parameters in the structure that are not defined in the calling structure, such as Fig. 9 As shown, the calling version is lower than the implementation version, or there are parameters in the calling structure that are not defined in the implementation structure, and the calling version is higher than the implementation version.

[0077] Exemplarily, the calling structure corresponding to the calling version includes the fields "name" and "age", and the implementation structure corresponding to the implementation version includes the fields "name", "age" and "gender". Therefore, the two fields "name" and "age" are determined as the first target fields, and the "name" and "age" are processed according to the business logic of the implementation version, for example, the "name" is formatted and the "age" is encrypted to generate a first processing result. Then, a prompt message is generated according to the first processing result, for example: "The implementation version is higher than the calling version, the name has been formatted, and the age has been encrypted."

[0078] Through the embodiments of the present application, when the value of the calling field is less than the value of the implementation field, and a group of versions includes the calling version, the field with the same field identifier in the calling structure and the implementation structure is determined as the first target field, the business logic corresponding to the first target field is implemented based on the implementation version, a first processing result is generated, and a prompt message is generated based on the first processing result to ensure the successful execution of the business logic and the compatibility and stability of the structure data between different versions.

[0079] As an optional scheme, the above-mentioned business logic corresponding to the above-mentioned first target field is implemented based on the above-mentioned implementation version, the first processing result is generated, and the above-mentioned prompt message is generated based on the above-mentioned first processing result, including: implementing the business logic corresponding to the above-mentioned first target field based on the above-mentioned implementation version, generating a first initial processing result; when the above-mentioned first initial processing result includes an excess field, clearing the above-mentioned excess field to obtain the above-mentioned first processing result, wherein the above-mentioned excess field is indicated by the above-mentioned call structure; when the above-mentioned first initial processing result does not include an excess field, determining the above-mentioned first initial processing result as the above-mentioned first processing result; generating the above-mentioned prompt message based on the above-mentioned first processing result.

[0080] Optionally, in an embodiment of the present application, the above-mentioned first initial processing result may include but is not limited to whether the business logic is executed successfully.

[0081] In an exemplary embodiment, if the calling structure corresponding to the calling version contains the fields "name" and "age", and the implementation structure corresponding to the implementation version contains the fields "name", "age" and "telephone number", the business logic is to output the structure field names, and the first initial processing result is "name, age and telephone number", then there will be a redundant field "telephone number" in the first initial processing result, that is, the field "telephone number" is the above-mentioned excess field. At this time, the excess field will be cleared, and the first processing result will be "name, age".

[0082] For example, Fig.10 It is a schematic diagram of an optional data processing method according to an embodiment of the present application. The implementation version is higher than the calling version. After the implementation structure processes the business logic, there are exceeded fields, and the exceeded fields will be cleared. Alternatively, the calling version is higher than the implementation version. After the implementation structure processes the business logic, it is necessary to call the fields in the structure as outgoing parameters. However, the implementation structure does not process the field, that is, the first initial processing result lacks the field. At this time, the field can be filled with a preset value to obtain the above-mentioned target processing result.

[0083] As an optional scheme, the above-mentioned business logic corresponding to the above-mentioned first target field is implemented based on the above-mentioned implementation version, a first processing result is generated, and the above-mentioned prompt message is generated based on the above-mentioned first processing result, including: generating a result execution code according to the above-mentioned target processing result, wherein the above-mentioned result execution code is used to indicate the execution result of the above-mentioned business logic; generating the above-mentioned prompt message according to the above-mentioned result execution code, wherein the above-mentioned prompt message indicates that the above-mentioned calling version is lower than the above-mentioned implementation version.

[0084] Optionally, in an embodiment of the present application, the above-mentioned result execution code may include but is not limited to an execution success code and an execution failure code. The above-mentioned result execution code may include but is not limited to characters, symbols, numbers, etc. For example, "success" represents an execution success code and "fail" represents an execution failure code. In other words, the execution result of the above-mentioned business logic can be directly obtained through the above-mentioned result execution code.

[0085] In an exemplary embodiment, if the above result execution code is "success", the prompt message is: "success execution, the implementation version is higher than the calling version, and the target processing result is the result after downgrading compatibility processing."

[0086] As an optional scheme, the above method also includes: when the value of the above calling field is less than the value of the above implementation field, and the above set of versions does not include the above calling version, generating an error prompt code, wherein the above error prompt code indicates that the above calling version is an invalid version; generating the above prompt message according to the above error prompt code, wherein the above prompt message indicates that the above calling structure is an invalid structure.

[0087] Optionally, in an embodiment of the present application, the above error prompt code may include but is not limited to being expressed as characters, symbols, numbers, etc. For example, "500" indicates that an error occurs in the calling version, and the above invalid version indicates an unavailable calling version, that is, a version that does not exist in the above set of versions.

[0088] In an exemplary embodiment, the error prompt code is represented as "ERR_INVALID_VERSION", and the prompt message is "the calling version is not a valid version, and the calling structure cannot be used."

[0089] As an optional scheme, the above-mentioned target processing result is generated based on the above-mentioned implementation structure, and a prompt message is generated to indicate that the above-mentioned calling version and the above-mentioned implementation version are different, including: when the value of the above-mentioned calling field is greater than the value of the above-mentioned implementation field, the field with the same field identifier in the above-mentioned calling structure and the above-mentioned implementation structure is determined as the second target field; based on the above-mentioned implementation version, the business logic corresponding to the above-mentioned second target field is implemented to generate a second processing result, and the above-mentioned prompt information is generated based on the above-mentioned second processing result, wherein the above-mentioned target processing result includes the above-mentioned second processing result, and the above-mentioned prompt message is used to indicate that the above-mentioned second processing result is a processing result of downgrading the above-mentioned calling structure for compatibility.

[0090] Exemplarily, the calling version is higher than the implementation version. First, a latest_param structure is defined in the implementation function that implements the business logic, that is, the implementation structure. Corresponding to the implementation version, the content of the calling structure as an input parameter is copied (memcopy) to the implementation structure.

[0091] In an exemplary embodiment, if the implementation structure corresponding to the implementation version contains the fields "name" and "age", and the calling structure corresponding to the calling version contains the fields "name", "age" and "telephone number", the second target fields are "name" and "age", and the business logic is to output the structure field values. Since "telephone number" does not exist in the implementation version, even if the caller module passes the structure field values ​​"name = Zhang San, age = 34, telephone number = 1111111" to the implementer module through the interface, since the implementer module only defines "name, age", according to the above business logic, only "name = Zhang San, age = 34" can be successfully output, and the above prompt message is generated accordingly, indicating that the second processing result is the result of processing the above calling structure for downgrade compatibility.

[0092] Furthermore, if the outgoing parameter corresponding to the caller module is not correctly processed by the implementer module corresponding to the implementation version, a preset default value may be used as the outgoing parameter and returned to the above-mentioned caller module.

[0093] As an optional scheme, the above method also includes: when the calling object and the implementation object both reference the target header file, determining the inline function from the above target header file, wherein the above calling object includes a code segment and a calling structure for calling the target interface, and the above implementation object includes a code segment and an implementation structure for implementing the above target interface, and the above target header file pre-defines the above inline function and the above target interface, and the above inline function is used to determine the storage space required to be occupied by the above calling structure and the above implementation structure respectively; using the above inline function to determine the calling field value and the implementation field value, wherein the above calling field value corresponds to the above implementation object, and the above implementation field value corresponds to the above calling object; determining the above implementation version from the above set of versions according to the above implementation field value, and determining the above calling version from the above set of versions according to the above calling field value.

[0094] For example, when the calling object needs to pass a structure as a parameter, the inline function can automatically calculate the storage space occupied by the structure so as to correctly allocate memory during the calling process. When the implementation object receives the structure parameter, it can also use the same inline function to determine the storage space it occupies.

[0095] In an exemplary embodiment, the call field takes a value of 1, and the call structure needs to use a specific function, indicating that the call structure supports the first version of the specific function, and the implementation field takes a value of 2, indicating that the implementation structure supports the second version of the specific function, that is, the call version is lower than the implementation version.

[0096] It should be noted that in the embodiments of the present application, an inline function can be directly defined to realize the automatic assignment of the above-mentioned calling field values ​​and the above-mentioned implementation field values ​​without manual filling, that is, by referencing the target header file, when calling the above-mentioned target interface, there is no need to explicitly assign cbsize (implementation field, calling field). Since the interface definition in the target header file includes an inline function, the above-mentioned implementation field value and the above-mentioned calling field value can be automatically determined by calling the target.

[0097] In an exemplary embodiment, the present application can be applied to memory optimization application scenarios, including but not limited to: defining the first field of each structure as an integer type cbsize (the above-mentioned calling field, the above-mentioned implementation field) to indicate the size of the structure, and using the first field cbsize (current block size) to describe the size of the structure. When the structure needs to be expanded and new fields are added, the fields can be added directly to the structure.

[0098] Exemplarily, in interface design, the data processing method proposed in this application is used for structure parameters. Each time the structure version is updated, the caller (the above-mentioned calling object) and the implementer (the above-mentioned implementation object) can be version matched, wherein the caller is the upper-level logic code that uses the interface (the above-mentioned target interface); the implementer is the module that implements the interface; since the caller and the implementer are developed based on the interface, after the interface is defined, the caller and the implementer each reference the header file and develop according to the agreed header file. The data processing method proposed in this application can solve the problem of mismatch between header files and structure versions during product integration. In order to match the version difference between the caller and the implementer, the structure version passed in by the caller can be identified in the implementer module, and the identification method is to determine the structure version passed in by the caller through cbsize.

[0099] Specifically, the implementer module can maintain a size sequence of parameter structure V[0, 1, 2...n] versions (the above mapping relationship set), and compare them according to the cbsize information in the structure parameter passed in by the caller to find the corresponding version. If the structure header file version referenced by the caller is a high version, and the implementer is a low version, it will be impossible to distinguish. Then, the implementer will process it according to the current Vn version (the above implementation version). Since the implementer's current processing from the Vn version cannot meet the caller's requirements for some features of the high version, the caller needs to be informed that although the business logic requested by the caller has been processed, some features are missing, which is the result of downgrading the version; if the structure header file version referenced by the caller is a low version, and the current implementer is a high version, due to The higher version will process the compatibility with the lower version, so it can also correctly support the implementation of the lower version request. In the implementation function in the implementer module, you can define a latest_param structure variable, and copy (memcopy) the content of the incoming call structure to the current latest_param to facilitate the normal processing of the subsequent business logic; if the structure parameter is an output parameter, the data is converted according to the same logic, and the internal structure data is assigned to the output parameter; therefore, after the version is identified and confirmed by cbsize, whether the caller is a higher or lower version than the current implementer, it can ensure effective processing within the business capabilities of the current implementer, and the part of the structure that exceeds each other will be cleared to indicate the default value (or not processed).

[0100] Furthermore, due to the version inconsistency between the caller and the implementer, in order to allow the upper layer to better handle and cope with the impact of the underlying version difference, the upper layer can be informed through the return value of the interface. When the caller uses a high version and the underlying implementation module is a low version, in order to allow the caller to perceive that the underlying layer has discounted some logic, it is necessary to inform the caller through the return value. A return code can be added to the successful return (the specific name and the corresponding real value can be customized): "FULLY_SUCCESS: indicates success; PARTIAL_SUCCESS: indicates that due to the low version, only some feature functions are implemented".

[0101] In an exemplary embodiment, in order to avoid the caller failing to assign a value to cbsize when writing code, through the present application, an inline function can be defined in an interface in a header file. By referencing the header file, there is no need to explicitly assign a value to cbsize when calling the interface. The inline function automatically integrates the assignment of cbsize into the user's code. For example, in the header file, the interface uses the inline identifier (function name set_param) to indicate that it is an inline function. When the caller writes code, the set_param interface is called. During the compilation process, the compiler will automatically expand the inline function. By defining the interface inline in the header file, the problem of the caller not filling in cbsize is effectively avoided, and the burden of the developer filling in cbsize is reduced.

[0102] In summary, in the embodiments of the present application, the first field of the structure, unsigned short, is used to define a cbsize to represent the size of the structure; each structure extension needs to cause a change in the size of the structure, which is used to perceive the difference in structure versions, determine whether the structure parameters input by the caller are valid, intercept invalid structure parameters, and improve data processing quality; in order to avoid the caller from missing the cbsize field, the header file uses an inline function definition to complete the filling of cbsize; the implementer internally determines the structure version used for the input based on the cbsize information passed in by the caller, and copies the passed-in structure to the current local structure variable, so as to facilitate the logical processing of the code; if it is an output parameter, the content of the local structure variable is copied to the output parameter structure passed in by the caller; if the caller is a high version and the implementer is a low version, in order to enable the caller to perceive that the implementer is downgrading the version, a new return value is defined, which reflects that the processing is successful and the processing result is a low version implementation.

[0103] It should be noted that cbsize may include but is not limited to the first field, middle field, and last field of the structure. To facilitate unified code processing, combined with the commonly used structure sizes in the code, the unsigned short type may be used to support structures expressing the size of [0, 1, 2...65535]. In addition, considering the differences in interface header files and structure versions, the implementer may define a local parameter, assign and copy the caller parameters and local parameters, and clear or discard the excess parts, so as to meet the requirements for correct processing in the current implementer version. By comparing cbsize, the implementation of a higher version can be well compatible with the calling requirements of a lower version, while the implementation of a lower version may lack functionality to support the calling requirements of a higher version. For this reason, the return value is defined to distinguish between the lower version that implements the calling requirements of a higher version, and informs the caller that although it is successful, some parameters are ignored and there may be functional deficiencies.

[0104] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0105] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0106] According to another aspect of the embodiment of the present application, a data processing device for implementing the above-mentioned data processing method is also provided. Fig.11 As shown, the device comprises:

[0107] An acquisition module 1102 is used to acquire a call structure, wherein the call structure includes a call field, and the call field is used to indicate a storage space that the call structure needs to occupy;

[0108] A first determining module 1104 is used to determine a calling field value of a calling field and an implementation field value of an implementation field in an implementation structure, wherein the implementation field is used to indicate a storage space required to be occupied by the implementation structure;

[0109] A second determination module 1106 is used to determine, when the calling field value is different from the implementation field value, the calling version corresponding to the calling field value and the implementation version corresponding to the implementation field value based on a predetermined mapping relationship set, wherein the mapping relationship set includes a one-to-one corresponding set of versions and a set of field values, a set of versions includes the implementation version, and a set of field values ​​includes the implementation field value;

[0110] The generation module 1108 is used to generate a target processing result based on the implementation structure and generate a prompt message indicating that the calling version and the implementation version are different, wherein the target processing result indicates that it is generated according to the implementation version and is compatible with the processing result of the calling version.

[0111] As an optional scheme, the above-mentioned device is used to generate a target processing result based on the implementation structure and generate a prompt message indicating that the calling version and the implementation version are different in the following manner: when the value of the calling field is less than the value of the implementation field, and a group of versions includes the calling version, the field with the same field identifier in the calling structure and the implementation structure is determined as the first target field; based on the implementation version, the business logic corresponding to the first target field is implemented, a first processing result is generated, and a prompt message is generated based on the first processing result, wherein the target processing result includes the first processing result.

[0112] As an optional solution, the above-mentioned device is used to implement the business logic corresponding to the first target field based on the implementation version in the following manner, generate a first processing result, and generate a prompt message based on the first processing result: implement the business logic corresponding to the first target field based on the implementation version to generate a first initial processing result; when the first initial processing result includes an exceeded field, clear the exceeded field to obtain the first processing result, wherein the exceeded field is indicated by a calling structure; when the first initial processing result does not include the exceeded field, determine the first initial processing result as the first processing result; generate a prompt message based on the first processing result.

[0113] As an optional solution, the above-mentioned device is used to implement the business logic corresponding to the first target field based on the implementation version in the following manner, generate a first processing result, and generate a prompt message based on the first processing result: generate a result execution code according to the target processing result, wherein the result execution code is used to indicate the execution result of the business logic; generate a prompt message according to the result execution code, wherein the prompt message indicates that the calling version is lower than the implementation version.

[0114] As an optional solution, the above-mentioned device is also used to: generate an error prompt code when the value of the calling field is less than the value of the implementation field and a group of versions does not include the calling version, wherein the error prompt code indicates that the calling version is an invalid version; generate a prompt message based on the error prompt code, wherein the prompt message indicates that the calling structure is an invalid structure.

[0115] As an optional scheme, the above-mentioned device is used to generate a target processing result based on the implementation structure in the following manner, and generate a prompt message for indicating that the calling version and the implementation version are different: when the value of the calling field is greater than the value of the implementation field, the field with the same field identifier in the calling structure and the implementation structure is determined as the second target field; based on the business logic corresponding to the second target field implemented in the implementation version, a second processing result is generated, and a prompt message is generated based on the second processing result, wherein the target processing result includes the second processing result, and the prompt message is used to indicate that the second processing result is a processing result of downgrading the calling structure for compatibility.

[0116] As an optional solution, the above-mentioned device is also used to: determine the inline function from the target header file when the calling object and the implementation object both reference the target header file, wherein the calling object includes a code segment and a calling structure for calling the target interface, and the implementation object includes a code segment and an implementation structure for implementing the target interface, and the inline function and the target interface are pre-defined in the target header file, and the inline function is used to determine the storage space required to be occupied by the calling structure and the implementation structure respectively; use the inline function to determine the calling field value and the implementation field value, wherein the calling field value corresponds to the implementation object, and the implementation field value corresponds to the calling object; determine the implementation version from a group of versions according to the implementation field value, and determine the calling version from a group of versions according to the calling field value.

[0117] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0118] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0119] According to one aspect of the present application, a computer program product is provided. The computer program product includes a computer program.

[0120] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0121] Fig.12 The structure block diagram of a computer system for implementing an electronic device according to an embodiment of the present application is schematically shown.

[0122] It should be noted that Fig.12 The computer system 1200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0123] like Fig.12As shown, the computer system 1200 includes a central processing unit 1201 (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 1202 (ROM) or the program loaded from the storage part 1208 to the random access memory 1203 (RAM). Various programs and data required for system operation are also stored in the random access memory 1203. The central processing unit 1201, the read-only memory 1202 and the random access memory 1203 are connected to each other through a bus 1204. The input / output interface 1205 (Input / Output interface, i.e., I / O interface) is also connected to the bus 1204.

[0124] The following components are connected to the input / output interface 1205: an input section 1206 including a keyboard, a mouse, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the input / output interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1210 as needed so that a computer program read therefrom is installed into the storage section 1208 as needed.

[0125] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1209, and / or installed from the removable medium 1211. When the computer program is executed by the central processor 1201, various functions defined in the system of the present application are executed.

[0126] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1209, and / or installed from the removable medium 1211. When the computer program is executed by the central processor 1201, various functions provided by the embodiments of the present application are performed.

[0127] According to another aspect of the embodiment of the present application, an electronic device for implementing the above data processing method is also provided. The electronic device may be Figure 1 The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a terminal device as an example. Fig.13 As shown, the electronic device includes a memory 1302 and a processor 1304. The memory 1302 stores a computer program, and the processor 1304 is configured to execute the steps in any of the above method embodiments through the computer program.

[0128] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.

[0129] Optionally, in this embodiment, the above-mentioned processor can be configured to execute the methods in each embodiment of the present application through a computer program.

[0130] Alternatively, a person skilled in the art may understand that: Fig.13 The structure shown is for illustration only. Fig.13 The structure of the electronic device is not limited. Fig.13 More or fewer components (such as network interfaces, etc.) as shown in, or with Fig.13 Different configurations are shown.

[0131] Among them, the memory 1302 can be used to store software programs and modules, such as the program instructions / modules corresponding to the data processing method and device in the embodiments of the present application. The processor 1304 executes various functional applications and data processing by running the software programs and modules stored in the memory 1302, that is, realizing the above-mentioned data processing method. The memory 1302 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1302 may further include a memory remotely located relative to the processor 1304, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 1302 can be specifically, but not limited to, used to store information such as target processing results. As an example, such as Fig.13 As shown, the memory 1302 may include, but is not limited to, the acquisition module 1102, the first determination module 1104, the second determination module 1106, and the generation module 1108 in the data processing device. In addition, other module units in the data processing device may also be included but are not limited to, which will not be repeated in this example.

[0132] Optionally, the transmission device 1306 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 1306 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 1306 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0133] In addition, the electronic device further includes: a display 1308 for displaying the target processing result; and a connection bus 1310 for connecting various module components in the electronic device.

[0134] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. The nodes may form a peer-to-peer network, and any form of computing device, such as a server, terminal or other electronic device, may become a node in the blockchain system by joining the peer-to-peer network.

[0135] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the data processing method provided in various optional implementations of the above-mentioned data processing aspects.

[0136] Optionally, in this embodiment, the above-mentioned computer-readable storage medium can be configured to store data for executing the methods in various embodiments of the present application.

[0137] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0138] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0139] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for one or more electronic devices to execute all or part of the steps of the methods described in each embodiment of the present application.

[0140] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0141] In the several embodiments provided in the present application, it should be understood that the disclosed application can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0142] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0143] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0144] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A data processing method, characterized in that: include: Obtaining a call structure, wherein the call structure includes a call field, and the call field is used to indicate a storage space that the call structure needs to occupy; Determine a call field value of the call field and an implementation field value of an implementation field in an implementation structure, wherein the implementation field is used to indicate a storage space that the implementation structure needs to occupy; In the case where the call field value is different from the implementation field value, determining the call version corresponding to the call field value and the implementation version corresponding to the implementation field value based on a predetermined mapping relationship set, wherein the mapping relationship set includes a one-to-one corresponding set of versions and a set of field values, the set of versions includes the implementation version, and the set of field values ​​includes the implementation field value; A target processing result is generated based on the implementation structure, and a prompt message is generated to indicate that the calling version and the implementation version are different, wherein the target processing result represents a processing result generated according to the implementation version and compatible with the calling version.

2. The method according to claim 1, characterized in that The generating of the target processing result based on the implementation structure and generating a prompt message indicating that the calling version and the implementation version are different include: In a case where the value of the call field is smaller than the value of the implementation field, and the set of versions includes the call version, determining the field with the same field identifier in the call structure and the implementation structure as the first target field; The business logic corresponding to the first target field is implemented based on the implementation version to generate a first processing result, and the prompt message is generated based on the first processing result, wherein the target processing result includes the first processing result.

3. The method according to claim 2, characterized in that The implementing the business logic corresponding to the first target field based on the implementation version, generating a first processing result, and generating the prompt message based on the first processing result includes: Implement the business logic corresponding to the first target field based on the implementation version, and generate a first initial processing result; In the case where the first initial processing result includes an excess field, clearing the excess field to obtain the first processing result, wherein the excess field is indicated by the call structure; In a case where the first initial processing result does not include an excess field, determining the first initial processing result as the first processing result; The prompt message is generated based on the first processing result.

4. The method according to claim 2, characterized in that: The implementing the business logic corresponding to the first target field based on the implementation version, generating a first processing result, and generating the prompt message based on the first processing result includes: Generate a result execution code according to the target processing result, wherein the result execution code is used to indicate the execution result of the business logic; The prompt message is generated according to the result execution code, wherein the prompt message indicates that the calling version is lower than the implementation version.

5. The method according to claim 1, characterized in that: The method further comprises: In the case where the value of the call field is less than the value of the implementation field and the set of versions does not include the call version, an error prompt code is generated, wherein the error prompt code indicates that the call version is an invalid version; The prompt message is generated according to the error prompt code, wherein the prompt message indicates that the call structure is an invalid structure.

6. The method according to claim 1, characterized in that The generating of the target processing result based on the implementation structure and generating a prompt message indicating that the calling version and the implementation version are different include: In the case where the value of the calling field is greater than the value of the implementation field, determining the field with the same field identifier in the calling structure and the implementation structure as the second target field; Based on the implementation version, the business logic corresponding to the second target field is implemented to generate a second processing result, and the prompt message is generated based on the second processing result, wherein the target processing result includes the second processing result, and the prompt message is used to indicate that the second processing result is a processing result of downgrading the calling structure for compatibility with the version.

7. The method according to claim 1, characterized in that The method further comprises: In the case where both the calling object and the implementing object reference the target header file, determining an inline function from the target header file, wherein the calling object includes a code segment and a calling structure that call the target interface, the implementing object includes a code segment and an implementing structure that implement the target interface, the inline function and the target interface are predefined in the target header file, and the inline function is used to determine the storage space that the calling structure and the implementing structure need to occupy respectively; Determine a calling field value and an implementation field value by using the inline function, wherein the calling field value corresponds to the implementation object, and the implementation field value corresponds to the calling object; The implementation version is determined from the set of versions according to the implementation field value, and the call version is determined from the set of versions according to the call field value.

8. A data processing device, characterized in that: include: An acquisition module, used for acquiring a call structure, wherein the call structure includes a call field, and the call field is used for indicating a storage space that the call structure needs to occupy; A first determination module, used to determine a call field value of the call field and an implementation field value of an implementation field in an implementation structure, wherein the implementation field is used to indicate a storage space required to be occupied by the implementation structure; A second determination module is used to determine, when the call field value is different from the implementation field value, a call version corresponding to the call field value and an implementation version corresponding to the implementation field value based on a predetermined mapping relationship set, wherein the mapping relationship set includes a one-to-one corresponding set of versions and a set of field values, the set of versions includes the implementation version, and the set of field values ​​includes the implementation field value; A generation module is used to generate a target processing result based on the implementation structure, and generate a prompt message indicating that the calling version and the implementation version are different, wherein the target processing result represents a processing result generated according to the implementation version and compatible with the calling version.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein the computer program can be executed by an electronic device to perform the method described in any one of claims 1 to 7.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 7 are implemented.

11. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.

Citation Information

Patent Citations

  • Method and device for realizing cross-version software interaction

    CN101594355A

  • Data processing method and device, electronic equipment and storage medium

    CN112596770A