A security analysis optimization method for an electronic commerce system
By using Petri net models and state transition diagrams, combined with reduction formulas and model checking tools, the security analysis of e-commerce systems was optimized, solving the problems of time factors and data consistency, and improving system security and user trust.
Patent Information
- Application Number
- CN202311654121.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-05
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2043-12-05
AI Technical Summary
Existing e-commerce system security analyses fail to effectively consider time factors and data consistency, leading to potential data tampering or untimely updates, which impacts system security and user trust.
The business flow and data flow of the e-commerce system are modeled using the Petri net model, merged and converted into a state transition diagram, and a security specification formula is defined. The nuXmv model checking tool is used to verify whether the system meets the specification, and the model is optimized through counterexamples until it is qualified.
It improves the security detection of e-commerce systems, avoids problems such as data tampering and untimely updates, and enhances users' trust in the system.
Smart Images

Figure CN117972709B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of e-commerce system technology, specifically a method for security analysis and optimization of e-commerce systems. Background Technology
[0002] E-commerce is a business activity conducted using network communication technology. To ensure the security of e-commerce transactions, a security analysis method is needed before the e-commerce system goes live. This method should accurately determine the security of the e-commerce system and ensure mutual trust between buyers and sellers after launch. However, most current security analyses focus on non-time-based structural security analysis and transaction consistency analysis. Time is an indispensable factor in business systems, and data consistency is also crucial in e-commerce. Two issues exist: data may be tampered with, or inconsistencies may arise due to time delays and failure to update data in a timely manner. Therefore, the security of e-commerce requires further improvement. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide a security analysis and optimization method for e-commerce systems, which can effectively verify the effectiveness of e-commerce systems and assess the security of e-commerce systems before they are officially launched.
[0004] The technical solution of this invention is as follows:
[0005] A security analysis and optimization method for an e-commerce system, specifically including the following steps:
[0006] (1) Use Petri nets to model the business flow and data flow in the e-commerce system respectively, and then merge the business flow model and data flow model of the e-commerce system to obtain the merged Petri net model;
[0007] (2) Transform the Petri net model into a state transition diagram;
[0008] (3) Define the specification formula for the security of e-commerce system in terms of accessibility, time validity and data consistency;
[0009] (4) Put the state transition diagram and the reduction formula of the e-commerce system into the model checking tool to check whether the model of the e-commerce system meets the reduction formula. If it does, the security test of the e-commerce system is qualified.
[0010] (5) When the model of the e-commerce system does not meet the specification formula, the model checking tool will return a counterexample. The model of the e-commerce system will be optimized by the counterexample. Then, steps (1)-(4) will be repeated until the security test of the e-commerce system is qualified.
[0011] The business flow model of the e-commerce system is as follows: The data flow model of an e-commerce system is
[0012] Where P1 and P2 represent the sets of places for the corresponding business flow model or data flow model, respectively; T1 and T2 represent the sets of transitions for the corresponding business flow model or data flow model, respectively, with each transition in the set being t; B1 and B2 represent the sets of directed arcs from the corresponding places to the transitions, i.e., the required input resource tokens; F1 and F2 represent the sets of directed arcs from the corresponding transitions to the places, i.e., the required output resource tokens. and D1 and D2 represent the resources in the initial state of the corresponding business flow model or data flow model, respectively; D1 and D2 represent the non-empty finite resource sets of the corresponding business flow model or data flow model, respectively, where each d∈D represents a resource token; V1 and V2 represent the symbol sets of the finite resources of the corresponding business flow model or data flow model, respectively, d→v, v∈V, indicating that each resource d in D has a mapping symbol in V; G1 and G2 both represent the set of predicate formulas, where each transition t maps to a predicate formula G(t), G(t) is a logical constraint, and G(t)=True is a necessary condition for the transition to be enabled; SI1 and SI2 represent the set of static time intervals of the corresponding business flow model or data flow model, respectively, t→[SEFT,SLFT], indicating that each transition t corresponds to a static time interval [SEFT,SLFT], where SEFT represents the earliest static occurrence time and SLFT represents the latest static occurrence time.
[0013] The rules for merging the business flow model and data flow model of the e-commerce system are as follows: P = P1∪P2, T = T1∪T2, B = B1∪B2, F = F1∪F2. D = D1∪D2, V = V1∪V2, G = G1∪G2, SI = SI1∪SI2, thus obtaining the Petri net model PTPN = (P,T,B,F,M0,D,V,G,SI).
[0014] The specific steps for transforming the Petri net model into a state transition diagram are as follows:
[0015] S21. Initialize the state set S by adding the initial state of the Petri net model to the state set S.
[0016] S22. Select a state s from the state set S and obtain the set of enabling transitions T under this state s. En ;
[0017] S23. Determine the enabling transition set T En Is it an empty set? If it is, jump to step S22 to select a new state s'; if it is not an empty set, then start from the enable transition set T. En Choose one transition t;
[0018] S24. Check if transition t satisfies the time constraint, i.e., whether EFT(t) ≤ Θ ≤ LFT(t), where EFT(t) is the earliest occurrence time of transition t, LFT(t) is the latest occurrence time of transition t, and Θ is the global time in state s; if the time constraint is not satisfied, transition t is reinserted into the enabling transition set T. En In the middle, the enabling transition set T is re-established. En Select a new transition t'; if the time constraint is satisfied, check whether transition t satisfies the corresponding predicate formula G(t). If not, jump to step S23 and re-enable the transition set T. En If a new transition t' is selected, and it satisfies the condition, then based on the current time, the resource distribution after transition t is triggered, and the new set of transitions under the resource distribution condition, a state s is created. t ;
[0019] S25, Determine s t Is it in set S? If so, create an edge s->s t If not, create a new state d in set S. t s points to s t That is, s->s t ;
[0020] S26. Repeat steps S22-S25 until all states s in set S have completed their transitions, forming a state transition diagram.
[0021] The state s = (M, Θ, I) is described, where M represents the resource set of the e-commerce system in the corresponding state; Θ represents the global time in the corresponding state; and I represents the set of enabling transitions T under M. En The corresponding set of triggering intervals; the set of enabling transitions T En The transition t in M is possible if and only if M(p)≥B(p,t), p∈ · t, G(t) = True, where M(p) represents the set of resources held by store p in state s, and B(p,t) represents the set of resources required for store p to transition to t. · t represents the set of input libraries for transition t.
[0022] The transition t is enabled under M(p), then the next state s · The formula for calculating SM′(p) is Equation (1):
[0023]
[0024] In equation (1), M′(p) represents a state s · The set of resources held by p in the lower and lower warehouses; · t represents the set of input libraries for transition t; t · Let M(p) represent the set of output places for transition t; let B(p,t) represent the set of resources held by place p in state s; let F(t,p) represent the set of resources required from place p to transition t; and let F(t,p) represent the set of output resources from transition t to place p.
[0025] The formulas for calculating the triggering interval of transition t′ are shown in equations (2)-(3) below;
[0026] a. When transition t′ is enabled in state s, and t′≠t, then:
[0027]
[0028] b. When transition t′ is in state s · If the condition is met, and t′≠t, then:
[0029]
[0030] c. When transition t′ is in state s · When the enable condition is met and t′=t, the trigger interval is calculated using equation (3);
[0031] Where SEFT(t′) represents the earliest static occurrence time of transition t′, and SLFT(t′) represents the latest static occurrence time of transition t′.
[0032] The aforementioned security specification formulas for e-commerce systems include:
[0033] S31. Reachability Formula: This indicates the existence of a path that starts from the initial state s0 and reaches the target state s at any future time. f The path;
[0034] S32, Time Validity Formula: This indicates that any path starting from the initial state s0 will reach state s at any future time. n And reach state s n The transitions t that occur satisfy their time constraints (time1, time2, ..., time...). n That is, the current global time is within the interval that triggers transition t;
[0035] S33, Data Time Consistency Formula: This means that if a user places an order at any time, the order state will be changed to orderStateUpdate at any future time within the time period [lowTime, upTime].
[0036] S34, Formula for Data Logical Consistency: This means that after a user makes a payment, at any future time after the payment status is "Pay", the order number "orderID" of the payment module will be equal to the user's order number "prePaidOrderID", and the order data will remain logically consistent.
[0037] S35. Formula for Real-Time Data Consistency: This means that at any time, when a user places an order, the resources will be updated immediately after the order is placed. Here, "order" indicates the state at which the order was placed, and "stockUpdate" indicates the state of the resources after the update.
[0038] The model checking tool used is the nuXmv model checking tool.
[0039] The specific steps for optimizing the e-commerce system model using counterexamples are as follows:
[0040] S51. Analyze counterexamples to determine the specific situations or paths that cause the reduction formula to be unsatisfactory.
[0041] S52. Based on the analysis results of the counterexamples, modify and optimize the model of the e-commerce system; the modification and optimization specifically involves adding new time constraints, logical constraints, or both of the above constraints, adjusting the behavioral rules of the e-commerce system, or modifying the data processing flow.
[0042] Advantages of this invention:
[0043] This invention incorporates the state transition diagram and specification formula of an e-commerce system into a model checking tool to check whether the e-commerce system model meets the specification formula, verifying reachability, time validity, and data consistency. Based on the results of these three aspects, the security of the e-commerce system is determined, and optimization is performed based on the determination results. This avoids problems such as malicious data tampering, untimely data updates, and inconsistencies in data before and after payment, thereby enhancing users' trust in the security of the e-commerce system and improving users' sense of security. Attached Figure Description
[0044] Figure 1 This is a flowchart of the present invention. Detailed Implementation
[0045] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0046] See Figure 1 A security analysis and optimization method for an e-commerce system, specifically including the following steps:
[0047] (1) Use Petri nets to model the business flow and data flow in the e-commerce system respectively, and then merge the business flow model and data flow model of the e-commerce system to obtain the merged Petri net model;
[0048] S11, The business flow model of the e-commerce system is The data flow model of an e-commerce system is
[0049] Where P1 and P2 represent the sets of places for the corresponding business flow model or data flow model, respectively; T1 and T2 represent the sets of transitions for the corresponding business flow model or data flow model, respectively, with each transition in the set being t; B1 and B2 represent the sets of directed arcs from the corresponding places to the transitions, i.e., the required input resource tokens; F1 and F2 represent the sets of directed arcs from the corresponding transitions to the places, i.e., the required output resource tokens. and D1 and D2 represent the resources in the initial state of the corresponding business flow model or data flow model, respectively; D1 and D2 represent the non-empty finite resource sets of the corresponding business flow model or data flow model, respectively, where each d∈D represents a resource token; V1 and V2 represent the symbol sets of the finite resources of the corresponding business flow model or data flow model, respectively, d→v, v∈V, indicating that each resource d in D has a mapping symbol in V; G1 and G2 both represent the set of predicate formulas, where each transition t maps to a predicate formula G(t), G(t) is a logical constraint, and G(t)=True is a necessary condition for the transition to be enabled; SI1 and SI2 represent the set of static time intervals of the corresponding business flow model or data flow model, respectively, t→[SEFT,SLFT], indicating that each t corresponds to a static time interval [SEFT,SLFT], where SEFT represents the earliest static occurrence time and SLFT represents the latest static occurrence time;
[0050] S12. The rules for merging the business flow model and data flow model of an e-commerce system are: P = P1∪P2, T = T1∪T2, B = B1∪B2, F = F1∪F2. D = D1∪D2, V = V1∪V2, G = G1∪G2, SI = SI1∪SI2, thus obtaining the Petri net model PTPN = (P, T, B, F, M0, D, V, G, SI);
[0051] (2) Transform the Petri net model into a state transition diagram. The specific steps are as follows:
[0052] S21. Initialize the state set S by adding the initial state of the Petri net model to the state set S.
[0053] S22. Select a state s from the state set S and obtain the set of enabling transitions T under this state s. En ;
[0054] S23. Determine the enabling transition set T En Is it an empty set? If it is, jump to step S22 to select a new state s'; if it is not an empty set, then start from the enable transition set T. En Choose one transition t;
[0055] S24. Check if transition t satisfies the time constraint, i.e., whether EFT(t) ≤ Θ ≤ LFT(t), where EFT(t) is the earliest occurrence time of transition t, LFT(t) is the latest occurrence time of transition t, and Θ is the global time in state s; if the time constraint is not satisfied, transition t is reinserted into the enabling transition set T. En In the middle, the enabling transition set T is re-established. En Select a new transition t'; if the time constraint is satisfied, check whether transition t satisfies the corresponding predicate formula G(t). If not, jump to step S23 and re-enable the transition set T. En If a new transition t' is selected, and it satisfies the condition, then based on the current time, the resource distribution after transition t is triggered, and the new set of transitions under the resource distribution condition, a state s is created. t ;
[0056] S25, Determine s t Is it in set S? If so, create an edge s->s t If not, create a new state s in set S. t s points to s t That is, s->s t ;
[0057] S26. Repeat steps S22-S25 until all states s in set S have completed their transitions, forming a state transition diagram.
[0058] Where, state s = (M, Θ, I), M represents the resource set of the e-commerce system in the corresponding state; Θ represents the global time in the corresponding state; and I represents the set of enabling transitions T under M. En The corresponding set of triggering intervals; the set of enabling transitions T En The transition t in M is possible if and only if M(p)≥B(p,t), p∈ · t, G(t) = True, where M(p) represents the set of resources held by store p in state s, and B(p,t) represents the set of resources required for store p to transition to t. · t represents the set of input libraries for transition t.
[0059] If transition t is enabled by M(p), then the next state s · The formula for calculating M′(p) is Equation (1):
[0060]
[0061] In equation (1), M′(p) represents a state s · The set of resources held by p in the lower and lower warehouses; · t represents the set of input libraries for transition t; t · Let M(p) represent the set of output places for transition t; let B(p,t) represent the set of resources held by place p in state s; let F(t,p) represent the set of resources required from place p to transition t; and let F(t,p) represent the set of output resources from transition t to place p.
[0062] The formulas for calculating the triggering interval of transition t′ are shown in equations (2)-(3) below;
[0063] a. When transition t′ is enabled in state s, and t′≠t, then:
[0064]
[0065] b. When transition t′ is in state s · If the condition is met, and t′≠t, then:
[0066]
[0067] c. When transition t′ is in state s · When the enable condition is met and t′=t, the trigger interval is calculated using equation (3);
[0068] Where SEFT(t′) represents the earliest static occurrence time of transition t′, and SLFT(t′) represents the latest static occurrence time of transition t′;
[0069] (3) Define the security specification formulas for e-commerce systems, focusing on accessibility, time validity, and data consistency. These formulas specifically include:
[0070] S31. Reachability Formula: This indicates the existence of a path that starts from the initial state s0 and reaches the target state s at any future time. f The path;
[0071] S32, Time Validity Formula: This indicates that any path starting from the initial state s0 will reach state s at any future time. n And reach state s n The transitions t that occur satisfy their time constraints (time1, time2, ..., time...). n That is, the current global time is within the interval that triggers transition t;
[0072] In a state transition diagram, the transition between each state may involve a certain time delay or waiting time. Time validity is verified by defining time constraints between each state. When the state transitions of an e-commerce system meet the time constraints, it indicates that the e-commerce system has time validity.
[0073] S33, Data Time Consistency Formula: This means that if a user places an order at any time, the order state will be changed to orderStateUpdate at any future time within the time period [lowTime, upTime].
[0074] Data time consistency requires that the data between different modules of an e-commerce system be consistent in time. These different modules refer to the user module, the merchant module, and the third-party payment module. They need to cooperate and exchange data to complete the overall business process of the e-commerce system. The purpose is to prevent network delays and data from not being updated within the specified time, which would harm the interests of both parties.
[0075] S34, Formula for Data Logical Consistency: This means that after a user makes a payment, at any future time after the payment status is "Pay", the order number "orderID" of the payment module will be equal to the user's order number "prePaidOrderID", and the order data will remain logically consistent.
[0076] Data logical consistency refers to the logical consistency of data, conforming to predetermined business rules and constraints. Business rules and constraints mainly refer to the rules and constraints for order updates, payments, and resource updates in e-commerce systems. The purpose is to ensure that the data in the system has not been altered by external operations.
[0077] S35. Formula for Real-Time Data Consistency: This means that at any time, when a user places an order, the resources will be updated immediately after the order is placed. Here, "order" indicates the status when the order is placed, and "stockUpdate" indicates the status of the resources after the update.
[0078] Real-time data consistency means that real-time data remains consistent across different modules of an e-commerce system, without delays or errors.
[0079] (4) Put the state transition diagram and reduction formula of the e-commerce system into the nuXmv model checking tool to check whether the model of the e-commerce system meets the reduction formula. If it does, the security test of the e-commerce system is qualified.
[0080] (5) When the model of the e-commerce system does not meet the specification formula, the model checking tool will return a counterexample. The model of the e-commerce system will be optimized by the counterexample. Then, steps (1)-(4) will be repeated until the security test of the e-commerce system is qualified.
[0081] The specific steps for optimizing the e-commerce system model using counterexamples are as follows:
[0082] S51. Analyze counterexamples to determine the specific situations or paths that cause the reduction formula to be unsatisfactory.
[0083] S52. Based on the analysis results of the counterexamples, modify and optimize the model of the e-commerce system; the modification and optimization specifically involves adding new time constraints, logical constraints, or both of the above constraints, adjusting the behavioral rules of the e-commerce system, or modifying the data processing flow.
[0084] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A security analysis and optimization method for an e-commerce system, characterized in that: Specifically, the following steps are included: (1) Use Petri nets to model the business flow and data flow in the e-commerce system separately, and then merge the business flow model and data flow model of the e-commerce system to obtain the merged Petri net model; (2) Transform the Petri net model into a state transition diagram; (3) Define the specification formula for the security of e-commerce systems, focusing on the accessibility, time validity, and data consistency of e-commerce systems; The aforementioned security specification formulas for e-commerce systems include: S31. Reachability Formula: This indicates that there exists a path from the initial state. Departure, will arrive at the target state at any time in the future. The path; S32, Time Validity Formula: , indicating any line starting from the initial state Departure, will arrive at the desired state at any time in the future. And reach the state The changes that have taken place Satisfy its time constraints ( That is, satisfying the current global time as it changes. The triggering interval; S33, Data Time Consistency Formula: This indicates the current status of an order placed by a user at any given time. In time period The future within can be changed at any moment, thus changing into a state. ; S34, Formula for Data Logical Consistency: This indicates the payment status after the user has made a payment. The order number of the payment module at any point in the future. Equal to the user's order number The order data is kept logically consistent; S35. Formula for Real-Time Data Consistency: This means that at any time, when a user places an order, the resources will be updated immediately after the order is placed. This indicates the current status of the order. This indicates the state of the resource after it has been updated; (4) Put the state transition diagram and the reduction formula of the e-commerce system into the model checking tool to check whether the model of the e-commerce system meets the reduction formula. If it does, the security test of the e-commerce system is qualified. (5) When the model of the e-commerce system does not meet the specification formula, the model checking tool will return a counterexample. The model of the e-commerce system will be optimized by the counterexample. Then, steps (1)-(4) will be repeated until the security test of the e-commerce system is qualified. The specific steps for optimizing the e-commerce system model using counterexamples are as follows: S51. Analyze counterexamples to determine the specific situations or paths that cause the reduction formula to be unsatisfactory. S52. Based on the analysis results of the counterexamples, modify and optimize the model of the e-commerce system; the modification and optimization specifically involves adding new time constraints, logical constraints, or both of the above constraints, adjusting the behavioral rules of the e-commerce system, or modifying the data processing flow.
2. The security analysis and optimization method for an e-commerce system according to claim 1, characterized in that: The business flow model of the e-commerce system is as follows: The data flow model of an e-commerce system is ; in, and These represent the collections of places corresponding to the business flow model or data flow model, respectively. and Let t represent the transition set of the corresponding business flow model or data flow model, respectively. and These represent the set of directed arcs from the corresponding library to the transition, i.e., the resource tokens required for input. and These represent the set of directed arcs that transition to the place, i.e., the resource tokens to be output. and These represent the resources in the initial state of the corresponding business flow model or data flow model, respectively. and Each represents a non-empty finite set of resources corresponding to the business flow model or data flow model. Both represent a resource token; and These represent the symbol sets of the corresponding business flow model or data flow model with limited resources. , representing each resource in D All of them have mapping symbols in V; and Each represents a set of predicate formulas, and each transition t maps to a predicate formula. , That is, logical constraints, G(t)=True is a necessary condition for transition enabling; and These represent the sets of static time intervals corresponding to the business flow model or data flow model, respectively. This indicates that each transition t corresponds to a static time interval. ,in, Indicates the earliest static occurrence time. Indicates the latest static occurrence time.
3. The security analysis and optimization method for an e-commerce system according to claim 2, characterized in that: The rules for merging the business flow model and data flow model of the e-commerce system are as follows: Thus, the Petri net model is obtained. .
4. The security analysis and optimization method for an e-commerce system according to claim 1, characterized in that: The specific steps for transforming the Petri net model into a state transition diagram are as follows: S21. Initialize the state set S by adding the initial state of the Petri net model to the state set S. S22. Select a state from the state set S. Get this state The enabling transition set T below En ; S23. Determine the enabling transition set T En Is it an empty set? If it is an empty set, proceed to step S22 to select a new state. ; If it is not an empty set, then from the enabling transition set T En Choose one transition t; S24. Check whether transition t satisfies the time constraint, i.e., whether it satisfies... ,in, The earliest time of change t. Let t be the latest time of change. For state Global time; when time constraints are not met, transitions... Reinsert into the enabling transition set T En In the middle, the enabling transition set T is re-established. En Choose a new transition If the time constraint is satisfied, then check whether transition t satisfies the corresponding predicate formula. If the condition is not met, proceed to step S23 and re-enable the transition set T. En Choose a new transition If the condition is met, then the transition will occur based on the current time. After activation, the distribution of resources and the set of new transitions under the resource distribution conditions are used to create a state. ; S25, Judgment Is it in set S? If so, create an edge. If not, create a new state in set S. s points to ,Right now ; S26. Repeat steps S22-S25 until all states in set S are found. Once all migrations are complete, a state transition diagram is formed.
5. The security analysis and optimization method for an e-commerce system according to claim 4, characterized in that: The state described , This represents the set of resources in an e-commerce system under the corresponding state. This represents the global time at the corresponding state. Indicates in Below, the enabling transition set T En The corresponding set of triggering intervals; the set of enabling transitions T En Changes in exist Enabled if and only if ,in, Indicates the state Lower, warehouse The collection of resources held, Indicates the place of storage To change The required set of resources The set of input libraries for transition t.
6. The security analysis and optimization method for an e-commerce system according to claim 5, characterized in that: The aforementioned changes exist The enable triggers the next state s. Down The calculation formula is Equation (1): (1); In equation (1), In a state s Lower, warehouse The collection of resources held; Represents the set of input libraries for transition t; This represents the set of output libraries for transition t; Indicates the state Lower, warehouse The collection of resources held; Indicates the place of storage To change The required set of resources; Indicates change to the warehouse The set of output resources; change The formulas for calculating the triggering interval are shown in equations (2)-(3) below; a. When changes occur In state The following enables, and Then: (2); b. When changes occur In state s The following enables, and Then: (3); c. When changes occur In state s The following enables, and When this happens, equation (3) is used to calculate the triggering interval; in, Indicates change The earliest static occurrence time, Indicates change The latest static occurrence time.
7. The security analysis and optimization method for an e-commerce system according to claim 1, characterized in that: The model checking tool used is the nuXmv model checking tool.
Citation Information
Patent Citations
Model variation region liability analyzing system based on behavior patterns
CN103559587A
Business process changing domain fusion analysis method based on behavior containing
CN104933325A