Dialog box display method, device, electronic device and storage medium

By detecting and updating the background variables of the target element when the dialog box is displayed, the dynamic link library and the observer mode are used to realize the dynamic update of the dialog box, which solves the problem that the dialog box cannot be displayed dynamically in vehicle diagnosis and improves the flexibility of the display. and accuracy.

CN113885997BActive Publication Date: 2024-09-10LAUNCH TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111217676.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-19
Publication Date
2024-09-10
Estimated Expiration
2041-10-19

AI Technical Summary

Technical Problem

In the prior art, the dialog box cannot dynamically display the title and prompt information during the execution of the vehicle diagnostic function, causing the execution of the diagnostic process to be affected.

Method used

By detecting the background variable changes of the target element in the dialog box display state, and updating the display according to the updated variables, the dynamic link library and the observer mode are used to realize the dynamic update of the dialog box elements.

Benefits of technology

The timely and dynamically updated display of the dialog box is realized, the flexibility and accuracy of the dialog box display are improved, and the problem in the prior art that the dialog box cannot be dynamically displayed is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113885997B
    Figure CN113885997B
Patent Text Reader

Abstract

The present application is applicable to the field of computer technology, and provides a dialog box display method, device, electronic device and storage medium, including: when a dialog box is displayed, detecting whether a background variable corresponding to a target element in the dialog box has changed; wherein the target element is a dialog box element set as a monitoring target; if so, updating and displaying the corresponding target element according to the updated background variable. The embodiments of the present application can accurately realize the dynamic display of a dialog box.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and in particular, relates to a dialog box display method, device, electronic device and storage medium. Background Art

[0002] Currently, in many applications, the values ​​of dialog elements in a dialog box can usually only be displayed fixedly according to the initial settings, and it is difficult to achieve dynamic display of the dialog box.

[0003] For example, during the execution of the vehicle's diagnostic function, some dialog boxes often appear to prompt the user to perform vehicle diagnostic operations. In the Open Test sequence eXchange (OTX) source file, the label used to encapsulate the data of a dialog box (referred to as the dialog box label) is "openscreen", and the dialog box label contains sub-labels such as "title" and "message". These sub-labels are used to encapsulate the data of the title and prompt information presented in the dialog box. However, since a dialog box will be created during the parsing of the "openscreen" label, when the title "title" and prompt information "message" in the subsequent "openscreen" label change, only the values ​​of "title" and "message" are modified, and the openscreen label does not appear. The content of the prompt dialog box created previously cannot be changed, resulting in the dialog box being unable to dynamically display the title, prompt information and other content when executing the diagnostic function process according to the OTX source file, thereby affecting the execution of the diagnostic process. Summary of the invention

[0004] In view of this, embodiments of the present application provide a dialog box display method, device, electronic device and storage medium to solve the problem of how to accurately realize the dynamic display of a dialog box in the prior art.

[0005] A first aspect of an embodiment of the present application provides a dialog box display method, comprising:

[0006] When the dialog box is displayed, detect whether the background variable corresponding to the target element in the dialog box changes; wherein the target element is the dialog box element set as the monitoring target;

[0007] If so, the corresponding target element is updated and displayed according to the updated background variable.

[0008] Optionally, before detecting whether a background variable corresponding to a target element in the dialog box changes while the dialog box is displayed, the method further includes:

[0009] Calling a target dynamic link library; the target dynamic link library is a dynamic link library generated according to the OTX source file;

[0010] If a dialog interface is detected in the target dynamic link library, a dialog box is displayed according to the initial value of the background variable of the preset dialog element.

[0011] Optionally, before calling the target dynamic link library, the method further includes:

[0012] Parsing an OTX source file, and converting the OTX source file into a corresponding target code file; wherein the target code file includes the code of the dialog interface and background variables corresponding to the dialog elements of the dialog;

[0013] The target code file is compiled into the target dynamic link library.

[0014] Optionally, parsing the OTX source file and converting the OTX source file into a corresponding target code file includes:

[0015] Parse the OTX source file, and when a dialog box tag is parsed, create a corresponding dialog box interface according to the dialog box data encapsulated by the dialog box tag;

[0016] Select the background variable corresponding to the target element to set the monitoring target and obtain the monitoring setting information;

[0017] Generate a target code file including the dialog interface, the background variables and the monitoring setting information.

[0018] Optionally, before parsing the OTX source file, the method further includes:

[0019] Obtain the vehicle identification number of the target vehicle;

[0020] The vehicle identification code is uploaded to the target server, and the OTX source file returned by the target server is obtained.

[0021] Optionally, the method further comprises:

[0022] When the preset conditions are met, the dialog closing interface is called to destroy the dialog.

[0023] Optionally, updating and displaying the corresponding target element according to the updated background variable includes:

[0024] The updated background variables are sent to the display interface through shared memory, so that the display interface updates and displays the dialog box, thereby realizing the updated display of the target element.

[0025] A second aspect of an embodiment of the present application provides a dialog box display device, including:

[0026] A detection unit, used to detect whether a background variable corresponding to a target element in the dialog box changes when the dialog box is displayed; wherein the target element is a dialog box element set as a monitoring target;

[0027] The updating unit is used to update and display the corresponding target element according to the updated background variable if the background variable of the target element changes.

[0028] Optionally, the dialog box display device further includes:

[0029] A dynamic link library calling unit, used for calling a target dynamic link library; the target dynamic link library is a dynamic link library generated according to the OTX source file;

[0030] The dialog initialization unit is used to display a dialog box according to the initial value of the background variable of the preset dialog element if a dialog interface is detected in the target dynamic link library.

[0031] Optionally, the dialog box display device further includes:

[0032] A parsing unit, configured to parse an OTX source file and convert the OTX source file into a corresponding target code file; wherein the target code file includes the code of the dialog interface and background variables corresponding to the dialog elements of the dialog;

[0033] The compiling unit is used to compile the target code file into the target dynamic link library.

[0034] Optionally, the parsing unit is specifically used to parse the OTX source file. When parsing to a dialog tag, a corresponding dialog interface is created according to the dialog data encapsulated by the dialog tag; the background variable corresponding to the target element is selected to perform monitoring target setting to obtain monitoring setting information; and a target code file containing the dialog interface, the background variable and the monitoring setting information is generated.

[0035] Optionally, the dialog box display device further includes:

[0036] A vehicle identification code acquisition unit, used to acquire the vehicle identification code of the target vehicle;

[0037] The OTX source file acquisition unit is used to upload the vehicle identification code to the target server and acquire the OTX source file returned by the target server.

[0038] Optionally, the dialog box display device further includes:

[0039] The dialog destroying unit is used to call the dialog closing interface to destroy the dialog when a preset condition is met.

[0040] Optionally, the updating unit is specifically configured to send the updated background variables to the display interface via a shared memory, so that the display interface updates and displays the dialog box, thereby realizing the updated display of the target element.

[0041] A third aspect of an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device implements the steps of the dialog box display method.

[0042] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the electronic device implements the steps of the dialog box display method.

[0043] A fifth aspect of an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the dialog box display method described in any one of the first aspects above.

[0044] Compared with the prior art, the embodiments of the present application have the following beneficial effects: in the embodiments of the present application, some dialog elements in the dialog box are set as monitoring targets in advance, and these dialog elements set as monitoring targets are called target elements. Afterwards, when the dialog box is displayed, if it is detected that the background variable corresponding to the target element in the dialog box has changed, the target element is automatically updated and displayed according to the updated background variable. Since the monitoring target can be set, when the background variable corresponding to the target element changes, the update display of the target element can be automatically detected, so that the dialog box can be dynamically updated and displayed in a timely manner, thereby improving the flexibility and accuracy of the dialog box display. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0046] Figure 1 This is a schematic diagram of the implementation process of the first dialog box display method provided in the embodiment of the present application;

[0047] Figure 2 This is a schematic diagram of the implementation process of the first dialog box display method provided in the embodiment of the present application;

[0048] Figure 3is a schematic diagram of a dialog box display device provided in an embodiment of the present application;

[0049] Figure 4 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0051] In order to illustrate the technical solution described in this application, a specific embodiment is provided below for illustration.

[0052] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.

[0053] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0054] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0055] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0056] In addition, in the description of the present application, the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0057] At present, during the execution of the vehicle's diagnostic function, some dialog boxes often appear to prompt the user to operate the vehicle diagnostic process. In the OTX source file, the label used to encapsulate the data of a dialog box (referred to as the dialog box label) is "openscreen", and the dialog box label contains sub-labels such as "title" and "message". These sub-labels are used to encapsulate the data of the title and prompt information presented in the dialog box. However, since a dialog box will be created during the parsing of the "openscreen" label, when the title "title" and prompt information "message" in the subsequent "openscreen" label change, only the values ​​of the background variables of "title" and "message" are modified, and the openscreen label does not appear. The dialog box elements of the prompt dialog box created previously cannot be changed, resulting in the dialog box being unable to realize the dynamic display of dialog box elements such as the title and prompt information when executing the diagnostic function process according to the OTX source file, thereby affecting the execution of the diagnostic process.

[0058] In order to solve the above technical problems, the embodiments of the present application provide a dialog box display method, device, electronic device and storage medium. When the dialog box is displayed, it is detected whether the background variable corresponding to the target element in the dialog box has changed; wherein the target element is the dialog box element set as the monitoring target; if so, the corresponding target element is updated and displayed according to the updated background variable. Since the monitoring target can be set, when the background variable corresponding to the target element changes, the update display of the target element can be automatically detected, so that the dialog box can be dynamically updated and displayed in a timely manner, thereby improving the flexibility and accuracy of the dialog box display.

[0059] Embodiment 1:

[0060] Figure 1 A flowchart of a first dialog box display method provided in an embodiment of the present application is shown. The execution subject of the dialog box display method is an electronic device, which is described in detail as follows:

[0061] In S101, when a dialog box is displayed, it is detected whether a background variable corresponding to a target element in the dialog box changes; wherein the target element is a dialog box element set as a monitoring target.

[0062] In an embodiment of the present application, the dialog box is displayed on the client interface after calling the dialog box interface function in advance by a client installed in the electronic device. The dialog box includes multiple dialog box elements, wherein the dialog box elements may include title elements, information elements, etc. For each dialog box element displayed in the dialog box, there is a corresponding value in the background program, and the value may represent the text content to be displayed by the dialog box element, the size of the dialog box element, the color, the font, etc. The value may be a fixed value directly, or it may be a dynamic value stored in a background variable. For example, the background variable corresponding to the title element may be a variable named "title", and the background variable corresponding to the information element may be a variable named "message".

[0063] Usually, when the dialog box is initially displayed, the initial display of the corresponding dialog box element can be realized according to the initial value of the background variable. Later, when the value corresponding to the background variable changes, the dialog box usually cannot know the change, which makes it difficult for the dialog box to accurately update the display according to the dynamic changes of the background variable. In the embodiment of the present application, the change of the background variable can be accurately detected by setting the monitoring target in advance.

[0064] Specifically, among the dialog elements contained in the dialog box, the dialog element that needs to be dynamically displayed is set as a monitoring target in advance, and the dialog element set as the monitoring target is called the target element. Afterwards, when the dialog box is opened and displayed, the client can detect in real time whether the background variable of the target element has changed.

[0065] In one embodiment, when creating the code corresponding to the dialog box, the background variable corresponding to the target element in the dialog box can be set as the monitoring target object in the observer pattern through the observer pattern, and the corresponding observer object is bound to the monitoring target object. Afterwards, when the dialog box is displayed, the observer object in the client background program can monitor in real time whether the target object changes, thereby realizing the monitoring of the background variables of the target element. Among them, the observer object (ConcreteObserver) refers to an object inherited from the observer class in the observer pattern. The object here refers to an entity with class attributes in an object-oriented programming language, which contains the data to be operated and the method that can operate on the data.

[0066] In S102, if yes, then the corresponding target element is updated and displayed according to the updated background variable.

[0067] When it is detected that the background variable corresponding to the target element in the dialog box has changed, the display in the dialog box in the interface is refreshed according to the updated background variable, so that the display interface can read the updated background variable and realize the updated display of the target element.

[0068] In one embodiment, the updated background variables can be monitored and obtained through the observer object in the observer mode to implement the updated display of the target element.

[0069] In the embodiment of the present application, since the setting of the monitoring target can be used to automatically detect and complete the update and display of the target element when the background variable corresponding to the target element changes, the dialog box can be dynamically updated and displayed in a timely manner, thereby improving the flexibility and accuracy of the dialog box display.

[0070] Embodiment 2:

[0071] Figure 2 The flowchart of the second dialog display method provided in the embodiment of the present application is shown, and the execution subject of the dialog display method is an electronic device. The dialog display method of the embodiment of the present application is further improved on the basis of the method described in the first embodiment, and the same points as the first embodiment are not repeated here. Figure 2 The dialog box display method shown is detailed as follows:

[0072] In S201, a target dynamic link library is called; the target dynamic link library is a dynamic link library generated according to an OTX source file.

[0073] In the embodiment of the present application, the target dynamic link library is a dynamic link library generated by code conversion and compilation in advance according to a preset OTX source file.

[0074] In one embodiment, the OTX source file may be a file for describing the diagnostic function process, and correspondingly, the target dynamic link library is a dynamic link library for implementing the diagnostic function. After the electronic device starts the vehicle diagnostic client, the diagnostic function dynamic link library is called to start executing the diagnostic function.

[0075] In S202, if a dialog interface is detected in the target dynamic link library, a dialog box is displayed according to the initial value of the background variable of the preset dialog element.

[0076] After calling the target dynamic link library, when the target dynamic link library is running in the background, if a dialog interface is detected, the initialization display of the dialog box is realized according to the initial value of the background variable stored in the target dynamic link library.

[0077] Exemplarily, in the execution process of the target dynamic link library, if an interface function named "openscreen" is detected, it is determined that a dialog interface is currently detected, and the corresponding dialog box is created and initialized for display according to the interface parameters of the dialog interface. The interface parameters of the dialog interface include the initial values ​​of the background variables corresponding to each dialog element, and the initialization display of each corresponding dialog element in the dialog box is realized according to the initial values ​​of these background variables.

[0078] In S203, when the dialog box is displayed, it is detected whether the background variable corresponding to the target element in the dialog box changes; wherein the target element is the dialog box element set as the monitoring target.

[0079] In S204, if yes, the corresponding target element is updated and displayed according to the updated background variable.

[0080] In the embodiment of the present application, by calling the target dynamic link library and detecting the dialog interface, the dialog box is displayed according to the initial value of the background variable of the preset dialog element, so that the initialization display of the dialog box can be flexibly and conveniently implemented.

[0081] Optionally, before calling the target dynamic link library, the method further includes:

[0082] Parsing an OTX source file, and converting the OTX source file into a corresponding target code file; wherein the target code file includes the code of the dialog interface and background variables corresponding to the dialog elements of the dialog;

[0083] The target code file is compiled into the target dynamic link library.

[0084] In an embodiment of the present application, the electronic device can obtain an OTX source file before starting the diagnostic client, and parse the OTX source file through a preset OTX parsing tool. According to the content of the parsed OTX source file, a code conversion tool is called to convert the content in the OTX source file into a corresponding target code file. Exemplarily, the target code file is a C++ code file.

[0085] The target code file contains the code of the dialog interface, and the fixed values ​​corresponding to the dialog elements of the dialog or the background variables for storing dynamically changing values. The code of the dialog interface is converted according to the data content encapsulated by the dialog tag "openscreen" in the OTX source file, and the background variables corresponding to the dialog elements can be converted according to the data content encapsulated by the dialog element tags "title" and "message" in the OTX source file.

[0086] After obtaining the target code file, the target code file is compiled by a compilation tool to generate a corresponding target dynamic link library.

[0087] In the embodiment of the present application, since the OTX source file can be automatically converted into a corresponding target code file, and the target code file is compiled to generate a corresponding target dynamic link library, the electronic device only needs to obtain the OTX source file to automatically parse and implement the corresponding functional flow, thereby improving the flexibility and convenience of program operation.

[0088] Optionally, parsing the OTX source file and converting the OTX source file into a corresponding target code file includes:

[0089] Parse the OTX source file, and when a dialog box tag is parsed, create a corresponding dialog box interface according to the dialog box data encapsulated by the dialog box tag;

[0090] Select the background variable corresponding to the target element to set the monitoring target and obtain the monitoring setting information;

[0091] Generate a target code file including the dialog interface, the background variables and the monitoring setting information.

[0092] In an embodiment of the present application, after the OTX source file is obtained, the OTX source file is parsed in sequence. When the dialog tag "openscreen" is parsed, the corresponding dialog interface is set according to the dialog data encapsulated by the dialog tag. In one embodiment, the dialog data includes the unique identification information of the dialog box and the values ​​of each dialog element contained in the dialog box; wherein, for the target element whose value is stored in the background variable, the initial value and subsequent change value of the background variable are stored in the dialog data in sequence according to the execution order. When setting the dialog interface, the corresponding background variables can be set for each dialog element according to the execution order, and the initial value corresponding to the background variable can be passed in the dialog interface; and, in the subsequent code, the function that can change the background variable and the change value of the background variable are written. Afterwards, the unique identification information and the background variables of each dialog element are used as the initialized interface parameters.

[0093] After creating the dialog interface, the background variable corresponding to the target element can be selected from the background variables corresponding to the dialog elements contained in the dialog to set the monitoring target and obtain the monitoring setting information. In one embodiment, the background variable "title" corresponding to the title element and / or the background variable "message" corresponding to the information element in the dialog box are set to the monitoring target object inherited from the monitoring target class, and the corresponding observer objects are set for these monitoring target objects to monitor the changes of these monitoring target objects. The information of these monitoring target objects and the information of the observer object are used as the monitoring setting information.

[0094] Exemplarily, the monitoring target class specifically has the following three members:

[0095] m_ObserverList, the list of observer objects bound to the monitoring target object.

[0096] m_iState, the target string value of the monitored target object;

[0097] m_strObj, the name of the target object to be monitored

[0098] And, there are four member functions:

[0099] The binding function Attach is used to bind the observer object corresponding to the monitoring target object;

[0100] The clearing function Detach is used to clear the bound observer object;

[0101] The notification function Notify is used to notify the bound observer object that there is a change in the current monitoring target object;

[0102] Set the function SetState to change the value of the monitored target object.

[0103] For example, for a background variable named "sc_param_ttitle" corresponding to the dialog title element, the corresponding monitoring target object can be defined by the following code:

[0104] ConcreteSubject sc_param_title;

[0105] After setting the monitoring target object, a preset observer object needs to be created accordingly. Exemplarily, the preset observer object can be defined by the observer class ConcreteObserve.

[0106] The observer ConcreteObserve class has three class members:

[0107] M_strShowText, the handle mapping of the bound object and the prompt box.

[0108] M_vScreenArg, dialog box container, used to store the values ​​of each dialog box element.

[0109] M_vStrKey, stores the value of the object and is used to find which object has changed.

[0110] A member function:

[0111] The update function Update is used to dynamically update the dialog box according to the changed value after receiving the notification.

[0112] After each monitoring target object and the preset observer object are created, for each monitoring target object, the monitoring target object is bound to the preset observer object by calling the binding function Attach of the monitoring target object.

[0113] According to the above-mentioned dialog interface, the initial value and the change value of the background variable and the monitoring setting information, the corresponding target code file can be generated in combination.

[0114] In an embodiment of the present application, since it is possible to set the corresponding dialog interface according to the dialog data of the dialog tag and select the background variable corresponding to the target element to perform monitoring target setting when parsing the OTX source file, it is possible to accurately generate a target code file containing the dialog interface, background variables and monitoring setting information, so that a target dynamic link library capable of monitoring changes of the target element can be accurately generated based on the target code file.

[0115] In one embodiment, after the above-mentioned target code file is generated and the corresponding target dynamic link library is run, if the background variable of the target element needs to be changed, the update value is input through the setting function SetState in the background variable that has been set to monitor the target object. After that, the setting function SetState automatically calls the notification function Notify to notify the name of the currently changed background variable and the corresponding update value to the observer object corresponding to the background variable. According to the notification of the notification function, the observer object obtains the name of the currently changed background variable and the corresponding update value. Then, the observer object finds the background variable consistent with the name of the changed background variable in the dialog container through its update function Update, and passes in the corresponding update value to obtain the updated background variable, including the updated dialog container as the updated dialog container. After that, the updated dialog container is used as the new interface parameter of the dialog interface, and the dialog interface is called again, so that the interface can redisplay the dialog according to the value of the latest dialog element, thereby realizing the updated display of the dialog element to be updated.

[0116] Optionally, before parsing the OTX source file, the method further includes:

[0117] Obtain the vehicle identification number of the target vehicle;

[0118] The vehicle identification code is uploaded to the target server, and the OTX source file returned by the target server is obtained.

[0119] In the embodiment of the present application, after receiving the diagnostic start command and starting the client, the electronic device automatically sends a vehicle identification number (VIN) reading command to the target vehicle. After that, the vehicle identification number returned by the target vehicle according to the VIN code reading command is obtained. After obtaining the vehicle identification number, the vehicle identification number is uploaded to the server.

[0120] The server of the embodiment of the present application pre-stores target diagnostic data packets corresponding to various types of vehicle models. The target diagnostic data packet includes at least an OTX source file, and may also include an ODX source file package (PACKAGED ODX DATA, PDX), where ODX is an open diagnostic data exchange (ODX) protocol. After obtaining the vehicle identification code uploaded by the electronic device, the server determines the vehicle model information of the target vehicle based on the vehicle identification code. Afterwards, based on the vehicle model information of the target vehicle, the target diagnostic data packet stored in association with the vehicle model information is obtained from the diagnostic data packet stored in association with the vehicle model information, and the target diagnostic data packet is returned to the electronic device. The electronic device receives the target diagnostic data packet, and obtains the OTX source file therefrom for parsing.

[0121] In an embodiment of the present application, since the vehicle identification code of the target vehicle can be obtained and sent to the server, the target diagnostic data packet corresponding to the vehicle identification code can be obtained, thereby accurately obtaining the OTX source file, so that the corresponding target dynamic link library can be accurately generated based on the OTX source file.

[0122] Optionally, the method further comprises:

[0123] When the preset conditions are met, the dialog closing interface is called to destroy the dialog.

[0124] In one embodiment, the OTX source file may be a file for describing a special function flow of vehicle diagnosis, and the target dynamic link library is specifically a dynamic link library for implementing special functions. The special functions are some relatively complex functions in vehicle diagnosis that need to be specially formulated according to different vehicle models. In one embodiment, the special functions may include action testing, writing vehicle identification codes, matching keys and other functions. Correspondingly, the above-mentioned step S201, specifically after the electronic device runs the diagnostic client and detects the startup instruction for starting the special function, calls the target dynamic link library to implement the corresponding special function.

[0125] Correspondingly, the preset condition is that the special function is executed. When it is detected that the preset condition is met, the target dynamic library calls the dialog closing interface function closescreen to automatically destroy the currently displayed dialog box, thereby releasing system resources in time.

[0126] Optionally, updating and displaying the corresponding target element according to the updated background variable includes:

[0127] The updated background variables are sent to the display interface through shared memory, so that the display interface updates and displays the dialog box, thereby realizing the updated display of the target element.

[0128] In the embodiment of the present application, in the embodiment itself, the updated background variable can be updated to the dialog handle of the created dialog box. Afterwards, the dialog handle is shared to the display interface by means of shared memory, so that the updated background variable can be sent to the display interface by means of shared memory. The display interface refreshes the display of the dialog box according to the updated background variable obtained, so that the target element can display the value of the updated background variable, and the updated display of the target element is realized.

[0129] In the embodiment of the present application, the update display of the target element can be accurately and efficiently achieved through the shared memory mechanism.

[0130] Exemplarily, the target element may be timing prompt information in a dialog box. When a change in a background variable corresponding to the timing prompt information is detected, the background variable may be updated to dynamically display the timing prompt information in a timing manner.

[0131] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0132] Embodiment three:

[0133] Figure 3 A schematic diagram of the structure of a dialog box display device provided in an embodiment of the present application is shown. For the sake of convenience, only the part related to the embodiment of the present application is shown:

[0134] The dialog display device comprises: a detection unit 31 and an updating unit 32. Wherein:

[0135] The detection unit 31 is used to detect whether the background variable corresponding to the target element in the dialog box changes when the dialog box is displayed; wherein the target element is the dialog box element set as the monitoring target.

[0136] The updating unit 32 is used to update and display the corresponding target element according to the updated background variable if the background variable of the target element changes.

[0137] Optionally, the dialog box display device further includes:

[0138] A dynamic link library calling unit, used for calling a target dynamic link library; the target dynamic link library is a dynamic link library generated according to the OTX source file;

[0139] The dialog initialization unit is used to display a dialog box according to the initial value of the background variable of the preset dialog element if a dialog interface is detected in the target dynamic link library.

[0140] Optionally, the dialog box display device further includes:

[0141] A parsing unit, configured to parse an OTX source file and convert the OTX source file into a corresponding target code file; wherein the target code file includes the code of the dialog interface and background variables corresponding to the dialog elements of the dialog;

[0142] The compiling unit is used to compile the target code file into the target dynamic link library.

[0143] Optionally, the parsing unit is specifically used to parse the OTX source file. When parsing to a dialog tag, a corresponding dialog interface is created according to the dialog data encapsulated by the dialog tag; the background variable corresponding to the target element is selected to perform monitoring target setting to obtain monitoring setting information; and a target code file containing the dialog interface, the background variable and the monitoring setting information is generated.

[0144] Optionally, the dialog box display device further includes:

[0145] A vehicle identification code acquisition unit, used to acquire the vehicle identification code of the target vehicle;

[0146] The OTX source file acquisition unit is used to upload the vehicle identification code to the target server and acquire the OTX source file returned by the target server.

[0147] Optionally, the dialog box display device further includes:

[0148] The dialog destroying unit is used to call the dialog closing interface to destroy the dialog when a preset condition is met.

[0149] Optionally, the updating unit is specifically configured to send the updated background variables to the display interface via a shared memory, so that the display interface updates and displays the dialog box, thereby realizing the updated display of the target element.

[0150] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0151] Embodiment three:

[0152] Figure 4is a schematic diagram of an electronic device provided by an embodiment of the present application. Figure 4 As shown, the electronic device 4 of this embodiment includes: a processor 40, a memory 41, and a computer program 42 stored in the memory 41 and executable on the processor 40, such as a dialog box display program. When the processor 40 executes the computer program 42, the steps in the above-mentioned dialog box display method embodiments are implemented, such as Figure 1 Alternatively, when the processor 40 executes the computer program 42, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 3 The functions of the detection unit 31 to the updating unit 32 are shown.

[0153] Exemplarily, the computer program 42 may be divided into one or more modules / units, which are stored in the memory 41 and executed by the processor 40 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 42 in the electronic device 4.

[0154] The electronic device 4 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device may include, but is not limited to, a processor 40 and a memory 41. Those skilled in the art will appreciate that Figure 4 It is only an example of the electronic device 4 and does not constitute a limitation of the electronic device 4. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.

[0155] The processor 40 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0156] The memory 41 may be an internal storage unit of the electronic device 4, such as a hard disk or memory of the electronic device 4. The memory 41 may also be an external storage device of the electronic device 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the electronic device 4. The memory 41 is used to store the computer program and other programs and data required by the electronic device. The memory 41 may also be used to temporarily store data that has been output or is to be output.

[0157] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0158] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0159] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0160] In the embodiments provided in the present application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as 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 devices or units, which can be electrical, mechanical or other forms.

[0161] 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.

[0162] 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.

[0163] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0164] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A dialog box display method, characterized in that: include: When the dialog box is displayed, detect whether the background variable corresponding to the target element in the dialog box changes; wherein the target element is the dialog box element set as the monitoring target; If yes, then update and display the corresponding target element according to the updated background variable; In the state where the dialog box is displayed, before detecting whether the background variable corresponding to the target element in the dialog box has changed, the method further includes: Calling a target dynamic link library; the target dynamic link library is a dynamic link library generated according to the OTX source file; If a dialog interface is detected in the target dynamic link library, a dialog box is displayed according to the initial value of the background variable of the preset dialog element; Before calling the target dynamic link library, the method further includes: Parsing an OTX source file, and converting the OTX source file into a corresponding target code file; wherein the target code file includes the dialog interface, the initial value and the change value of the background variable, and the monitoring setting information; Compiling the target code file into the target dynamic link library; The parsing of the OTX source file and converting the OTX source file into a corresponding target code file includes: Parse the OTX source file, and when a dialog box tag is parsed, create a corresponding dialog box interface according to the dialog box data encapsulated by the dialog box tag; Select the background variable corresponding to the target element to set the monitoring target, and obtain the monitoring setting information; wherein, the background variable corresponding to the target element is set to the monitoring target object inherited from the monitoring target class, and a corresponding observer object is set for the monitoring target object to monitor the changes of the monitoring target object, and the information of the monitoring target object and the information of the observer object are used as the monitoring setting information; Generate a target code file including the dialog interface, the initial value and the change value of the background variable and the monitoring setting information; the dialog data includes the unique identification information of the dialog and the values ​​of each dialog element contained in the dialog; wherein, for the target element whose value is stored in the background variable, the initial value and the subsequent change value of the background variable are stored in the dialog data in sequence according to the execution order; when setting the dialog interface, set the corresponding background variable for each dialog element according to the execution order, and pass the initial value corresponding to the background variable in the dialog interface, and in the subsequent code, write the function that can change the background variable and the change value of the background variable, and use the unique identification information and the background variables of each dialog element as the initialized interface parameters.

2. The dialog box display method according to claim 1, characterized in that: Before parsing the OTX source file, it also includes: Obtain the vehicle identification number of the target vehicle; The vehicle identification code is uploaded to the target server, and the OTX source file returned by the target server is obtained.

3. The dialog box display method according to claim 1, characterized in that: The method further comprises: When the preset conditions are met, the dialog closing interface is called to destroy the dialog.

4. The dialog box display method according to claim 1, characterized in that: The updating and displaying of the corresponding target element according to the updated background variable includes: The updated background variables are sent to the display interface through shared memory, so that the display interface updates and displays the dialog box, thereby realizing the updated display of the target element.

5. A dialog box display device, characterized in that: include: A detection unit, used to detect whether a background variable corresponding to a target element in the dialog box changes when the dialog box is displayed; wherein the target element is a dialog box element set as a monitoring target; An updating unit, configured to update and display the corresponding target element according to the updated background variable if the background variable of the target element changes; A dynamic link library calling unit, used for calling a target dynamic link library; the target dynamic link library is a dynamic link library generated according to the OTX source file; A dialog initialization unit, for displaying a dialog according to the initial value of the background variable of the preset dialog element if a dialog interface is detected in the target dynamic link library; Before calling the target dynamic link library, the method further includes: A parsing unit, used for parsing an OTX source file and converting the OTX source file into a corresponding target code file; wherein the target code file includes the dialog interface, the initial value and the change value of the background variable, and the monitoring setting information; A compiling unit, used for compiling the target code file into the target dynamic link library; The parsing unit is specifically used to: parse the OTX source file, and when parsing to a dialog tag, create a corresponding dialog interface according to the dialog data encapsulated by the dialog tag; select the background variable corresponding to the target element to set the monitoring target and obtain the monitoring setting information; wherein, the background variable corresponding to the target element is set to a monitoring target object inherited from the monitoring target class, and a corresponding observer object is set for the monitoring target object to monitor changes of the monitoring target object, and the information of the monitoring target object and the information of the observer object are used as the monitoring setting information; generate a dialog interface including the initial value and change value of the background variable and the monitoring The target code file of the setting information; the dialog data includes the unique identification information of the dialog and the values ​​of each dialog element contained in the dialog; wherein, for the target element whose value is stored in the background variable, the initial value and subsequent change value of the background variable are stored in the dialog data in sequence according to the execution order; when setting the dialog interface, the corresponding background variable is set for each dialog element according to the execution order, and the initial value corresponding to the background variable is passed in the dialog interface, and in the subsequent code, the function that can change the background variable and the change value of the background variable are written, and the unique identification information and the background variables of each dialog element are used as the initialized interface parameters.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the electronic device implements the steps of the method according to any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the electronic device implements the steps of the method according to any one of claims 1 to 4.